Linux Kernel
3.7.1
|
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/kdev_t.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/kobject.h>
#include <linux/kobj_map.h>
#include <linux/cdev.h>
#include <linux/mutex.h>
#include <linux/backing-dev.h>
#include <linux/tty.h>
#include "internal.h"
Go to the source code of this file.
Data Structures | |
struct | char_device_struct |
Functions | |
: the name of the device or driver. | |
register_chrdev_region() - register a range of device numbers : the first in the desired range of device numbers; must include the major number. : the number of consecutive device numbers required Return value is zero on success, a negative error code on failure. | |
int | register_chrdev_region (dev_t from, unsigned count, const char *name) |
: the name of the associated device or driver | |
alloc_chrdev_region() - register a range of char device numbers : output parameter for first assigned number : first of the requested range of minor numbers : the number of minor numbers required Allocates a range of char device numbers. The major number will be chosen dynamically, and returned (along with the first minor number) in . Returns zero or a negative error code. | |
int | alloc_chrdev_region (dev_t *dev, unsigned baseminor, unsigned count, const char *name) |
Variables | |
struct backing_dev_info | directly_mappable_cdev_bdi |
int __register_chrdev | ( | unsigned int | major, |
unsigned int | baseminor, | ||
unsigned int | count, | ||
const char * | name, | ||
const struct file_operations * | fops | ||
) |
Definition at line 264 of file char_dev.c.
void __unregister_chrdev | ( | unsigned int | major, |
unsigned int | baseminor, | ||
unsigned int | count, | ||
const char * | name | ||
) |
Definition at line 331 of file char_dev.c.
Definition at line 232 of file char_dev.c.
Definition at line 420 of file char_dev.c.
cdev_add() - add a char device to the system : the cdev structure for the device : the first device number for which this device is responsible : the number of consecutive minor numbers corresponding to this device
cdev_add() adds the device represented by to
the system, making it live immediately. A negative error code is returned on failure.
Definition at line 472 of file char_dev.c.
cdev_alloc() - allocate a cdev structure
Allocates and returns a cdev structure, or NULL on failure.
Definition at line 540 of file char_dev.c.
cdev_del() - remove a cdev from the system : the cdev structure to be removed
cdev_del() removes from
the system, possibly freeing the structure itself.
Definition at line 501 of file char_dev.c.
cdev_init() - initialize a cdev structure : the structure to initialize : the file_operations for this device
Initializes , remembering , making it ready to add to the system with cdev_add().
Definition at line 558 of file char_dev.c.
Definition at line 357 of file char_dev.c.
Definition at line 574 of file char_dev.c.
EXPORT_SYMBOL | ( | register_chrdev_region | ) |
EXPORT_SYMBOL | ( | unregister_chrdev_region | ) |
EXPORT_SYMBOL | ( | alloc_chrdev_region | ) |
EXPORT_SYMBOL | ( | cdev_init | ) |
EXPORT_SYMBOL | ( | cdev_alloc | ) |
EXPORT_SYMBOL | ( | cdev_del | ) |
EXPORT_SYMBOL | ( | cdev_add | ) |
EXPORT_SYMBOL | ( | __register_chrdev | ) |
EXPORT_SYMBOL | ( | __unregister_chrdev | ) |
EXPORT_SYMBOL | ( | directly_mappable_cdev_bdi | ) |
Definition at line 196 of file char_dev.c.
unregister_chrdev_region() - return a range of device numbers : the first in the range of numbers to unregister : the number of device numbers to unregister
This function will unregister a range of device numbers, starting with . The caller should normally be the one who allocated those numbers in the first place...
Definition at line 307 of file char_dev.c.
struct file_operations def_chr_fops |
Definition at line 445 of file char_dev.c.
struct backing_dev_info directly_mappable_cdev_bdi |
Definition at line 34 of file char_dev.c.