device.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * device.h - generic, centralized driver model
  3. *
  4. * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
  5. * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de>
  6. *
  7. * This file is released under the GPLv2
  8. *
  9. * See Documentation/driver-model/ for more information.
  10. */
  11. #ifndef _DEVICE_H_
  12. #define _DEVICE_H_
  13. #include <linux/ioport.h>
  14. #include <linux/kobject.h>
  15. #include <linux/klist.h>
  16. #include <linux/list.h>
  17. #include <linux/compiler.h>
  18. #include <linux/types.h>
  19. #include <linux/module.h>
  20. #include <linux/pm.h>
  21. #include <asm/semaphore.h>
  22. #include <asm/atomic.h>
  23. #include <asm/device.h>
  24. #define DEVICE_NAME_SIZE 50
  25. /* DEVICE_NAME_HALF is really less than half to accommodate slop */
  26. #define DEVICE_NAME_HALF __stringify(20)
  27. #define DEVICE_ID_SIZE 32
  28. #define BUS_ID_SIZE KOBJ_NAME_LEN
  29. struct device;
  30. struct device_driver;
  31. struct driver_private;
  32. struct class;
  33. struct class_device;
  34. struct bus_type;
  35. struct bus_type_private;
  36. struct bus_attribute {
  37. struct attribute attr;
  38. ssize_t (*show)(struct bus_type *bus, char *buf);
  39. ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
  40. };
  41. #define BUS_ATTR(_name, _mode, _show, _store) \
  42. struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store)
  43. extern int __must_check bus_create_file(struct bus_type *,
  44. struct bus_attribute *);
  45. extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
  46. struct bus_type {
  47. const char *name;
  48. struct bus_attribute *bus_attrs;
  49. struct device_attribute *dev_attrs;
  50. struct driver_attribute *drv_attrs;
  51. int (*match)(struct device *dev, struct device_driver *drv);
  52. int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
  53. int (*probe)(struct device *dev);
  54. int (*remove)(struct device *dev);
  55. void (*shutdown)(struct device *dev);
  56. int (*suspend)(struct device *dev, pm_message_t state);
  57. int (*suspend_late)(struct device *dev, pm_message_t state);
  58. int (*resume_early)(struct device *dev);
  59. int (*resume)(struct device *dev);
  60. struct bus_type_private *p;
  61. };
  62. extern int __must_check bus_register(struct bus_type *bus);
  63. extern void bus_unregister(struct bus_type *bus);
  64. extern int __must_check bus_rescan_devices(struct bus_type *bus);
  65. /* iterator helpers for buses */
  66. int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
  67. int (*fn)(struct device *dev, void *data));
  68. struct device *bus_find_device(struct bus_type *bus, struct device *start,
  69. void *data,
  70. int (*match)(struct device *dev, void *data));
  71. struct device *bus_find_device_by_name(struct bus_type *bus,
  72. struct device *start,
  73. const char *name);
  74. int __must_check bus_for_each_drv(struct bus_type *bus,
  75. struct device_driver *start, void *data,
  76. int (*fn)(struct device_driver *, void *));
  77. /*
  78. * Bus notifiers: Get notified of addition/removal of devices
  79. * and binding/unbinding of drivers to devices.
  80. * In the long run, it should be a replacement for the platform
  81. * notify hooks.
  82. */
  83. struct notifier_block;
  84. extern int bus_register_notifier(struct bus_type *bus,
  85. struct notifier_block *nb);
  86. extern int bus_unregister_notifier(struct bus_type *bus,
  87. struct notifier_block *nb);
  88. /* All 4 notifers below get called with the target struct device *
  89. * as an argument. Note that those functions are likely to be called
  90. * with the device semaphore held in the core, so be careful.
  91. */
  92. #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
  93. #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
  94. #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
  95. #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
  96. unbound */
  97. extern struct kset *bus_get_kset(struct bus_type *bus);
  98. extern struct klist *bus_get_device_klist(struct bus_type *bus);
  99. struct device_driver {
  100. const char *name;
  101. struct bus_type *bus;
  102. struct module *owner;
  103. const char *mod_name; /* used for built-in modules */
  104. int (*probe) (struct device *dev);
  105. int (*remove) (struct device *dev);
  106. void (*shutdown) (struct device *dev);
  107. int (*suspend) (struct device *dev, pm_message_t state);
  108. int (*resume) (struct device *dev);
  109. struct attribute_group **groups;
  110. struct driver_private *p;
  111. };
  112. extern int __must_check driver_register(struct device_driver *drv);
  113. extern void driver_unregister(struct device_driver *drv);
  114. extern struct device_driver *get_driver(struct device_driver *drv);
  115. extern void put_driver(struct device_driver *drv);
  116. extern struct device_driver *driver_find(const char *name,
  117. struct bus_type *bus);
  118. extern int driver_probe_done(void);
  119. /* sysfs interface for exporting driver attributes */
  120. struct driver_attribute {
  121. struct attribute attr;
  122. ssize_t (*show)(struct device_driver *driver, char *buf);
  123. ssize_t (*store)(struct device_driver *driver, const char *buf,
  124. size_t count);
  125. };
  126. #define DRIVER_ATTR(_name, _mode, _show, _store) \
  127. struct driver_attribute driver_attr_##_name = \
  128. __ATTR(_name, _mode, _show, _store)
  129. extern int __must_check driver_create_file(struct device_driver *driver,
  130. struct driver_attribute *attr);
  131. extern void driver_remove_file(struct device_driver *driver,
  132. struct driver_attribute *attr);
  133. extern int __must_check driver_add_kobj(struct device_driver *drv,
  134. struct kobject *kobj,
  135. const char *fmt, ...);
  136. extern int __must_check driver_for_each_device(struct device_driver *drv,
  137. struct device *start,
  138. void *data,
  139. int (*fn)(struct device *dev,
  140. void *));
  141. struct device *driver_find_device(struct device_driver *drv,
  142. struct device *start, void *data,
  143. int (*match)(struct device *dev, void *data));
  144. /*
  145. * device classes
  146. */
  147. struct class {
  148. const char *name;
  149. struct module *owner;
  150. struct kset subsys;
  151. struct list_head children;
  152. struct list_head devices;
  153. struct list_head interfaces;
  154. struct kset class_dirs;
  155. struct semaphore sem; /* locks children, devices, interfaces */
  156. struct class_attribute *class_attrs;
  157. struct class_device_attribute *class_dev_attrs;
  158. struct device_attribute *dev_attrs;
  159. int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env);
  160. int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
  161. void (*release)(struct class_device *dev);
  162. void (*class_release)(struct class *class);
  163. void (*dev_release)(struct device *dev);
  164. int (*suspend)(struct device *dev, pm_message_t state);
  165. int (*resume)(struct device *dev);
  166. };
  167. extern int __must_check class_register(struct class *class);
  168. extern void class_unregister(struct class *class);
  169. extern int class_for_each_device(struct class *class, void *data,
  170. int (*fn)(struct device *dev, void *data));
  171. extern struct device *class_find_device(struct class *class, void *data,
  172. int (*match)(struct device *, void *));
  173. extern struct class_device *class_find_child(struct class *class, void *data,
  174. int (*match)(struct class_device *, void *));
  175. struct class_attribute {
  176. struct attribute attr;
  177. ssize_t (*show)(struct class *class, char *buf);
  178. ssize_t (*store)(struct class *class, const char *buf, size_t count);
  179. };
  180. #define CLASS_ATTR(_name, _mode, _show, _store) \
  181. struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)
  182. extern int __must_check class_create_file(struct class *class,
  183. const struct class_attribute *attr);
  184. extern void class_remove_file(struct class *class,
  185. const struct class_attribute *attr);
  186. struct class_device_attribute {
  187. struct attribute attr;
  188. ssize_t (*show)(struct class_device *, char *buf);
  189. ssize_t (*store)(struct class_device *, const char *buf, size_t count);
  190. };
  191. #define CLASS_DEVICE_ATTR(_name, _mode, _show, _store) \
  192. struct class_device_attribute class_device_attr_##_name = \
  193. __ATTR(_name, _mode, _show, _store)
  194. extern int __must_check class_device_create_file(struct class_device *,
  195. const struct class_device_attribute *);
  196. /**
  197. * struct class_device - class devices
  198. * @class: pointer to the parent class for this class device. This is required.
  199. * @devt: for internal use by the driver core only.
  200. * @node: for internal use by the driver core only.
  201. * @kobj: for internal use by the driver core only.
  202. * @groups: optional additional groups to be created
  203. * @dev: if set, a symlink to the struct device is created in the sysfs
  204. * directory for this struct class device.
  205. * @class_data: pointer to whatever you want to store here for this struct
  206. * class_device. Use class_get_devdata() and class_set_devdata() to get and
  207. * set this pointer.
  208. * @parent: pointer to a struct class_device that is the parent of this struct
  209. * class_device. If NULL, this class_device will show up at the root of the
  210. * struct class in sysfs (which is probably what you want to have happen.)
  211. * @release: pointer to a release function for this struct class_device. If
  212. * set, this will be called instead of the class specific release function.
  213. * Only use this if you want to override the default release function, like
  214. * when you are nesting class_device structures.
  215. * @uevent: pointer to a uevent function for this struct class_device. If
  216. * set, this will be called instead of the class specific uevent function.
  217. * Only use this if you want to override the default uevent function, like
  218. * when you are nesting class_device structures.
  219. */
  220. struct class_device {
  221. struct list_head node;
  222. struct kobject kobj;
  223. struct class *class;
  224. dev_t devt;
  225. struct device *dev;
  226. void *class_data;
  227. struct class_device *parent;
  228. struct attribute_group **groups;
  229. void (*release)(struct class_device *dev);
  230. int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env);
  231. char class_id[BUS_ID_SIZE];
  232. };
  233. static inline void *class_get_devdata(struct class_device *dev)
  234. {
  235. return dev->class_data;
  236. }
  237. static inline void class_set_devdata(struct class_device *dev, void *data)
  238. {
  239. dev->class_data = data;
  240. }
  241. extern int __must_check class_device_register(struct class_device *);
  242. extern void class_device_unregister(struct class_device *);
  243. extern void class_device_initialize(struct class_device *);
  244. extern int __must_check class_device_add(struct class_device *);
  245. extern void class_device_del(struct class_device *);
  246. extern struct class_device *class_device_get(struct class_device *);
  247. extern void class_device_put(struct class_device *);
  248. extern void class_device_remove_file(struct class_device *,
  249. const struct class_device_attribute *);
  250. extern int __must_check class_device_create_bin_file(struct class_device *,
  251. struct bin_attribute *);
  252. extern void class_device_remove_bin_file(struct class_device *,
  253. struct bin_attribute *);
  254. struct class_interface {
  255. struct list_head node;
  256. struct class *class;
  257. int (*add) (struct class_device *, struct class_interface *);
  258. void (*remove) (struct class_device *, struct class_interface *);
  259. int (*add_dev) (struct device *, struct class_interface *);
  260. void (*remove_dev) (struct device *, struct class_interface *);
  261. };
  262. extern int __must_check class_interface_register(struct class_interface *);
  263. extern void class_interface_unregister(struct class_interface *);
  264. extern struct class *class_create(struct module *owner, const char *name);
  265. extern void class_destroy(struct class *cls);
  266. extern struct class_device *class_device_create(struct class *cls,
  267. struct class_device *parent,
  268. dev_t devt,
  269. struct device *device,
  270. const char *fmt, ...)
  271. __attribute__((format(printf, 5, 6)));
  272. extern void class_device_destroy(struct class *cls, dev_t devt);
  273. /*
  274. * The type of device, "struct device" is embedded in. A class
  275. * or bus can contain devices of different types
  276. * like "partitions" and "disks", "mouse" and "event".
  277. * This identifies the device type and carries type-specific
  278. * information, equivalent to the kobj_type of a kobject.
  279. * If "name" is specified, the uevent will contain it in
  280. * the DEVTYPE variable.
  281. */
  282. struct device_type {
  283. const char *name;
  284. struct attribute_group **groups;
  285. int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
  286. void (*release)(struct device *dev);
  287. int (*suspend)(struct device *dev, pm_message_t state);
  288. int (*resume)(struct device *dev);
  289. };
  290. /* interface for exporting device attributes */
  291. struct device_attribute {
  292. struct attribute attr;
  293. ssize_t (*show)(struct device *dev, struct device_attribute *attr,
  294. char *buf);
  295. ssize_t (*store)(struct device *dev, struct device_attribute *attr,
  296. const char *buf, size_t count);
  297. };
  298. #define DEVICE_ATTR(_name, _mode, _show, _store) \
  299. struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
  300. extern int __must_check device_create_file(struct device *device,
  301. struct device_attribute *entry);
  302. extern void device_remove_file(struct device *dev,
  303. struct device_attribute *attr);
  304. extern int __must_check device_create_bin_file(struct device *dev,
  305. struct bin_attribute *attr);
  306. extern void device_remove_bin_file(struct device *dev,
  307. struct bin_attribute *attr);
  308. extern int device_schedule_callback_owner(struct device *dev,
  309. void (*func)(struct device *dev), struct module *owner);
  310. /* This is a macro to avoid include problems with THIS_MODULE */
  311. #define device_schedule_callback(dev, func) \
  312. device_schedule_callback_owner(dev, func, THIS_MODULE)
  313. /* device resource management */
  314. typedef void (*dr_release_t)(struct device *dev, void *res);
  315. typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
  316. #ifdef CONFIG_DEBUG_DEVRES
  317. extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
  318. const char *name);
  319. #define devres_alloc(release, size, gfp) \
  320. __devres_alloc(release, size, gfp, #release)
  321. #else
  322. extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
  323. #endif
  324. extern void devres_free(void *res);
  325. extern void devres_add(struct device *dev, void *res);
  326. extern void *devres_find(struct device *dev, dr_release_t release,
  327. dr_match_t match, void *match_data);
  328. extern void *devres_get(struct device *dev, void *new_res,
  329. dr_match_t match, void *match_data);
  330. extern void *devres_remove(struct device *dev, dr_release_t release,
  331. dr_match_t match, void *match_data);
  332. extern int devres_destroy(struct device *dev, dr_release_t release,
  333. dr_match_t match, void *match_data);
  334. /* devres group */
  335. extern void * __must_check devres_open_group(struct device *dev, void *id,
  336. gfp_t gfp);
  337. extern void devres_close_group(struct device *dev, void *id);
  338. extern void devres_remove_group(struct device *dev, void *id);
  339. extern int devres_release_group(struct device *dev, void *id);
  340. /* managed kzalloc/kfree for device drivers, no kmalloc, always use kzalloc */
  341. extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
  342. extern void devm_kfree(struct device *dev, void *p);
  343. struct device_dma_parameters {
  344. /*
  345. * a low level driver may set these to teach IOMMU code about
  346. * sg limitations.
  347. */
  348. unsigned int max_segment_size;
  349. unsigned long segment_boundary_mask;
  350. };
  351. struct device {
  352. struct klist klist_children;
  353. struct klist_node knode_parent; /* node in sibling list */
  354. struct klist_node knode_driver;
  355. struct klist_node knode_bus;
  356. struct device *parent;
  357. struct kobject kobj;
  358. char bus_id[BUS_ID_SIZE]; /* position on parent bus */
  359. struct device_type *type;
  360. unsigned uevent_suppress:1;
  361. struct semaphore sem; /* semaphore to synchronize calls to
  362. * its driver.
  363. */
  364. struct bus_type *bus; /* type of bus device is on */
  365. struct device_driver *driver; /* which driver has allocated this
  366. device */
  367. void *driver_data; /* data private to the driver */
  368. void *platform_data; /* Platform specific data, device
  369. core doesn't touch it */
  370. struct dev_pm_info power;
  371. #ifdef CONFIG_NUMA
  372. int numa_node; /* NUMA node this device is close to */
  373. #endif
  374. u64 *dma_mask; /* dma mask (if dma'able device) */
  375. u64 coherent_dma_mask;/* Like dma_mask, but for
  376. alloc_coherent mappings as
  377. not all hardware supports
  378. 64 bit addresses for consistent
  379. allocations such descriptors. */
  380. struct device_dma_parameters *dma_parms;
  381. struct list_head dma_pools; /* dma pools (if dma'ble) */
  382. struct dma_coherent_mem *dma_mem; /* internal for coherent mem
  383. override */
  384. /* arch specific additions */
  385. struct dev_archdata archdata;
  386. spinlock_t devres_lock;
  387. struct list_head devres_head;
  388. /* class_device migration path */
  389. struct list_head node;
  390. struct class *class;
  391. dev_t devt; /* dev_t, creates the sysfs "dev" */
  392. struct attribute_group **groups; /* optional groups */
  393. void (*release)(struct device *dev);
  394. };
  395. /* Get the wakeup routines, which depend on struct device */
  396. #include <linux/pm_wakeup.h>
  397. #ifdef CONFIG_NUMA
  398. static inline int dev_to_node(struct device *dev)
  399. {
  400. return dev->numa_node;
  401. }
  402. static inline void set_dev_node(struct device *dev, int node)
  403. {
  404. dev->numa_node = node;
  405. }
  406. #else
  407. static inline int dev_to_node(struct device *dev)
  408. {
  409. return -1;
  410. }
  411. static inline void set_dev_node(struct device *dev, int node)
  412. {
  413. }
  414. #endif
  415. static inline void *dev_get_drvdata(struct device *dev)
  416. {
  417. return dev->driver_data;
  418. }
  419. static inline void dev_set_drvdata(struct device *dev, void *data)
  420. {
  421. dev->driver_data = data;
  422. }
  423. static inline int device_is_registered(struct device *dev)
  424. {
  425. return dev->kobj.state_in_sysfs;
  426. }
  427. void driver_init(void);
  428. /*
  429. * High level routines for use by the bus drivers
  430. */
  431. extern int __must_check device_register(struct device *dev);
  432. extern void device_unregister(struct device *dev);
  433. extern void device_initialize(struct device *dev);
  434. extern int __must_check device_add(struct device *dev);
  435. extern void device_del(struct device *dev);
  436. extern int device_for_each_child(struct device *dev, void *data,
  437. int (*fn)(struct device *dev, void *data));
  438. extern struct device *device_find_child(struct device *dev, void *data,
  439. int (*match)(struct device *dev, void *data));
  440. extern int device_rename(struct device *dev, char *new_name);
  441. extern int device_move(struct device *dev, struct device *new_parent);
  442. /*
  443. * Manual binding of a device to driver. See drivers/base/bus.c
  444. * for information on use.
  445. */
  446. extern int __must_check device_bind_driver(struct device *dev);
  447. extern void device_release_driver(struct device *dev);
  448. extern int __must_check device_attach(struct device *dev);
  449. extern int __must_check driver_attach(struct device_driver *drv);
  450. extern int __must_check device_reprobe(struct device *dev);
  451. /*
  452. * Easy functions for dynamically creating devices on the fly
  453. */
  454. extern struct device *device_create(struct class *cls, struct device *parent,
  455. dev_t devt, const char *fmt, ...)
  456. __attribute__((format(printf, 4, 5)));
  457. extern void device_destroy(struct class *cls, dev_t devt);
  458. /*
  459. * Platform "fixup" functions - allow the platform to have their say
  460. * about devices and actions that the general device layer doesn't
  461. * know about.
  462. */
  463. /* Notify platform of device discovery */
  464. extern int (*platform_notify)(struct device *dev);
  465. extern int (*platform_notify_remove)(struct device *dev);
  466. /**
  467. * get_device - atomically increment the reference count for the device.
  468. *
  469. */
  470. extern struct device *get_device(struct device *dev);
  471. extern void put_device(struct device *dev);
  472. /* drivers/base/power/shutdown.c */
  473. extern void device_shutdown(void);
  474. /* drivers/base/sys.c */
  475. extern void sysdev_shutdown(void);
  476. /* debugging and troubleshooting/diagnostic helpers. */
  477. extern const char *dev_driver_string(struct device *dev);
  478. #define dev_printk(level, dev, format, arg...) \
  479. printk(level "%s %s: " format , dev_driver_string(dev) , \
  480. (dev)->bus_id , ## arg)
  481. #define dev_emerg(dev, format, arg...) \
  482. dev_printk(KERN_EMERG , dev , format , ## arg)
  483. #define dev_alert(dev, format, arg...) \
  484. dev_printk(KERN_ALERT , dev , format , ## arg)
  485. #define dev_crit(dev, format, arg...) \
  486. dev_printk(KERN_CRIT , dev , format , ## arg)
  487. #define dev_err(dev, format, arg...) \
  488. dev_printk(KERN_ERR , dev , format , ## arg)
  489. #define dev_warn(dev, format, arg...) \
  490. dev_printk(KERN_WARNING , dev , format , ## arg)
  491. #define dev_notice(dev, format, arg...) \
  492. dev_printk(KERN_NOTICE , dev , format , ## arg)
  493. #define dev_info(dev, format, arg...) \
  494. dev_printk(KERN_INFO , dev , format , ## arg)
  495. #ifdef DEBUG
  496. #define dev_dbg(dev, format, arg...) \
  497. dev_printk(KERN_DEBUG , dev , format , ## arg)
  498. #else
  499. #define dev_dbg(dev, format, arg...) \
  500. ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
  501. #endif
  502. #ifdef VERBOSE_DEBUG
  503. #define dev_vdbg dev_dbg
  504. #else
  505. #define dev_vdbg(dev, format, arg...) \
  506. ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
  507. #endif
  508. /* Create alias, so I can be autoloaded. */
  509. #define MODULE_ALIAS_CHARDEV(major,minor) \
  510. MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
  511. #define MODULE_ALIAS_CHARDEV_MAJOR(major) \
  512. MODULE_ALIAS("char-major-" __stringify(major) "-*")
  513. #endif /* _DEVICE_H_ */