DENX . Training2 . LddDeviceNumbers

5.3.2. Device numbers

API: Device numbers

type:

dev_t

include/linux/types.h

creation, accessors:

MKDEV(int major, int minor)
MAJOR(dev_t dev)
MINOR(dev_t dev)

include/linux/kdev_t.h

register a (known) range of numbers:

int register_chrdev_region(dev_t first, unsigned int count, char *name);

allocate a range of free numbers:

int alloc_chrdev_region(dev_t *dev, unsigned int firstminor, unsigned int count, char *name);

free allocated or registered range of numbers:

void unregister_chrdev_region(dev_t first, unsigned int count);

include/linux/fs.h

----- Revision r1.3 - 15 Feb 2008 - 10:10 - MarkusKlotzbuecher
Copyright © 2002-2018 by DENX Software Engineering