cdev.h 677 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _LINUX_CDEV_H
  2. #define _LINUX_CDEV_H
  3. #include <linux/kobject.h>
  4. #include <linux/kdev_t.h>
  5. #include <linux/list.h>
  6. struct file_operations;
  7. struct inode;
  8. struct module;
  9. struct cdev {
  10. struct kobject kobj;
  11. struct module *owner;
  12. const struct file_operations *ops;
  13. struct list_head list;
  14. dev_t dev;
  15. unsigned int count;
  16. };
  17. void cdev_init(struct cdev *, const struct file_operations *);
  18. struct cdev *cdev_alloc(void);
  19. void cdev_put(struct cdev *p);
  20. int cdev_add(struct cdev *, dev_t, unsigned);
  21. void cdev_del(struct cdev *);
  22. int cdev_index(struct inode *inode);
  23. void cd_forget(struct inode *);
  24. extern struct backing_dev_info directly_mappable_cdev_bdi;
  25. #endif