Chinaunix首页 | 论坛 | 博客
  • 博客访问: 524425
  • 博文数量: 87
  • 博客积分: 4086
  • 博客等级: 上校
  • 技术积分: 900
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-23 15:55
文章分类

全部博文(87)

文章存档

2012年(3)

2010年(13)

2009年(7)

2008年(64)

我的朋友

分类: LINUX

2008-07-06 10:49:29

1、register_chrdev
 
位置:fs/char_dev.c
 
原型:int register_chrdev(unsigned int major, const char *name,
      const struct file_operations *fops)
 
说明
/**
 * register_chrdev() - Register a major number for character devices.
 * @major: major device number or 0 for dynamic allocation
 * @name: name of this range of devices
 * @fops: file operations associated with this devices
 *
 * If @major == 0 this functions will dynamically allocate a major and return
 * its number.
 *
 * If @major > 0 this function will attempt to reserve a device with the given
 * major number and will return zero on success.
 *
 * Returns a -ve errno on failure.
 *
 * The name of this device has nothing to do with the name of the device in
 * /dev. It only helps to keep track of the different owners of devices. If
 * your module name has only one type of devices it's ok to use e.g. the name
 * of the module here.
 *
 * This function registers a range of 256 minor numbers. The first minor number
 * is 0.
 */

2、register_netdev

位置:net/core/dev.c

原型:int register_netdev(struct net_device *dev)

说明

/**
 * register_netdev - register a network device
 * @dev: device to register
 *
 * Take a completed network device structure and add it to the kernel
 * interfaces. A %NETDEV_REGISTER message is sent to the netdev notifier
 * chain. 0 is returned on success. A negative errno code is returned
 * on a failure to set up the device, or if the name is a duplicate.
 *
 * This is a wrapper around register_netdevice that takes the rtnl semaphore
 * and expands the device name if you passed a format string to
 * alloc_netdev.
 */

3、register_framebuffer

位置:driver/video/fbmem.c

原型:int
register_framebuffer(struct fb_info *fb_info)

说明

/**
 * register_framebuffer - registers a frame buffer device
 * @fb_info: frame buffer info structure
 *
 * Registers a frame buffer device @fb_info.
 *
 * Returns negative errno on error, or zero for success.
 *
 */

4、register_sound_dsp

位置:sound/sound_core.c

原型:int register_sound_dsp(const struct file_operations *fops, int dev)

说明

/**
 * register_sound_dsp - register a DSP device
 * @fops: File operations for the driver
 * @dev: Unit number to allocate
 *
 * Allocate a DSP device. Unit is the number of the DSP requested.
 * Pass -1 to request the next free DSP unit. On success the allocated
 * number is returned, on failure a negative error code is returned.
 *
 * This function allocates both the audio and dsp device entries together
 * and will always allocate them as a matching pair - eg dsp3/audio3
 */

5、register_sound_mixer

位置:sound/sound_core.c

原型:int register_sound_mixer(const struct file_operations *fops, int dev)

说明

/**
 * register_sound_mixer - register a mixer device
 * @fops: File operations for the driver
 * @dev: Unit number to allocate
 *
 * Allocate a mixer device. Unit is the number of the mixer requested.
 * Pass -1 to request the next free mixer unit. On success the allocated
 * number is returned, on failure a negative error code is returned.
 */



阅读(1593) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~