pnp.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /*
  2. * Linux Plug and Play Support
  3. * Copyright by Adam Belay <ambx1@neo.rr.com>
  4. *
  5. */
  6. #ifndef _LINUX_PNP_H
  7. #define _LINUX_PNP_H
  8. #ifdef __KERNEL__
  9. #include <linux/device.h>
  10. #include <linux/list.h>
  11. #include <linux/errno.h>
  12. #include <linux/mod_devicetable.h>
  13. #define PNP_MAX_PORT 8
  14. #define PNP_MAX_MEM 4
  15. #define PNP_MAX_IRQ 2
  16. #define PNP_MAX_DMA 2
  17. #define PNP_NAME_LEN 50
  18. struct pnp_protocol;
  19. struct pnp_dev;
  20. /*
  21. * Resource Management
  22. */
  23. /* Use these instead of directly reading pnp_dev to get resource information */
  24. #define pnp_port_start(dev,bar) ((dev)->res.port_resource[(bar)].start)
  25. #define pnp_port_end(dev,bar) ((dev)->res.port_resource[(bar)].end)
  26. #define pnp_port_flags(dev,bar) ((dev)->res.port_resource[(bar)].flags)
  27. #define pnp_port_valid(dev,bar) \
  28. ((pnp_port_flags((dev),(bar)) & (IORESOURCE_IO | IORESOURCE_UNSET)) \
  29. == IORESOURCE_IO)
  30. #define pnp_port_len(dev,bar) \
  31. ((pnp_port_start((dev),(bar)) == 0 && \
  32. pnp_port_end((dev),(bar)) == \
  33. pnp_port_start((dev),(bar))) ? 0 : \
  34. \
  35. (pnp_port_end((dev),(bar)) - \
  36. pnp_port_start((dev),(bar)) + 1))
  37. #define pnp_mem_start(dev,bar) ((dev)->res.mem_resource[(bar)].start)
  38. #define pnp_mem_end(dev,bar) ((dev)->res.mem_resource[(bar)].end)
  39. #define pnp_mem_flags(dev,bar) ((dev)->res.mem_resource[(bar)].flags)
  40. #define pnp_mem_valid(dev,bar) \
  41. ((pnp_mem_flags((dev),(bar)) & (IORESOURCE_MEM | IORESOURCE_UNSET)) \
  42. == IORESOURCE_MEM)
  43. #define pnp_mem_len(dev,bar) \
  44. ((pnp_mem_start((dev),(bar)) == 0 && \
  45. pnp_mem_end((dev),(bar)) == \
  46. pnp_mem_start((dev),(bar))) ? 0 : \
  47. \
  48. (pnp_mem_end((dev),(bar)) - \
  49. pnp_mem_start((dev),(bar)) + 1))
  50. #define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
  51. #define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
  52. #define pnp_irq_valid(dev,bar) \
  53. ((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
  54. == IORESOURCE_IRQ)
  55. #define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
  56. #define pnp_dma_flags(dev,bar) ((dev)->res.dma_resource[(bar)].flags)
  57. #define pnp_dma_valid(dev,bar) \
  58. ((pnp_dma_flags((dev),(bar)) & (IORESOURCE_DMA | IORESOURCE_UNSET)) \
  59. == IORESOURCE_DMA)
  60. #define PNP_PORT_FLAG_16BITADDR (1<<0)
  61. #define PNP_PORT_FLAG_FIXED (1<<1)
  62. struct pnp_port {
  63. unsigned short min; /* min base number */
  64. unsigned short max; /* max base number */
  65. unsigned char align; /* align boundary */
  66. unsigned char size; /* size of range */
  67. unsigned char flags; /* port flags */
  68. unsigned char pad; /* pad */
  69. struct pnp_port *next; /* next port */
  70. };
  71. #define PNP_IRQ_NR 256
  72. struct pnp_irq {
  73. DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */
  74. unsigned char flags; /* IRQ flags */
  75. unsigned char pad; /* pad */
  76. struct pnp_irq *next; /* next IRQ */
  77. };
  78. struct pnp_dma {
  79. unsigned char map; /* bitmask for DMA channels */
  80. unsigned char flags; /* DMA flags */
  81. struct pnp_dma *next; /* next port */
  82. };
  83. struct pnp_mem {
  84. unsigned int min; /* min base number */
  85. unsigned int max; /* max base number */
  86. unsigned int align; /* align boundary */
  87. unsigned int size; /* size of range */
  88. unsigned char flags; /* memory flags */
  89. unsigned char pad; /* pad */
  90. struct pnp_mem *next; /* next memory resource */
  91. };
  92. #define PNP_RES_PRIORITY_PREFERRED 0
  93. #define PNP_RES_PRIORITY_ACCEPTABLE 1
  94. #define PNP_RES_PRIORITY_FUNCTIONAL 2
  95. #define PNP_RES_PRIORITY_INVALID 65535
  96. struct pnp_option {
  97. unsigned short priority; /* priority */
  98. struct pnp_port *port; /* first port */
  99. struct pnp_irq *irq; /* first IRQ */
  100. struct pnp_dma *dma; /* first DMA */
  101. struct pnp_mem *mem; /* first memory resource */
  102. struct pnp_option *next; /* used to chain dependent resources */
  103. };
  104. struct pnp_resource_table {
  105. struct resource port_resource[PNP_MAX_PORT];
  106. struct resource mem_resource[PNP_MAX_MEM];
  107. struct resource dma_resource[PNP_MAX_DMA];
  108. struct resource irq_resource[PNP_MAX_IRQ];
  109. };
  110. /*
  111. * Device Managemnt
  112. */
  113. struct pnp_card {
  114. struct device dev; /* Driver Model device interface */
  115. unsigned char number; /* used as an index, must be unique */
  116. struct list_head global_list; /* node in global list of cards */
  117. struct list_head protocol_list; /* node in protocol's list of cards */
  118. struct list_head devices; /* devices attached to the card */
  119. struct pnp_protocol *protocol;
  120. struct pnp_id *id; /* contains supported EISA IDs */
  121. char name[PNP_NAME_LEN]; /* contains a human-readable name */
  122. unsigned char pnpver; /* Plug & Play version */
  123. unsigned char productver; /* product version */
  124. unsigned int serial; /* serial number */
  125. unsigned char checksum; /* if zero - checksum passed */
  126. struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */
  127. };
  128. #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
  129. #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
  130. #define to_pnp_card(n) container_of(n, struct pnp_card, dev)
  131. #define pnp_for_each_card(card) \
  132. for((card) = global_to_pnp_card(pnp_cards.next); \
  133. (card) != global_to_pnp_card(&pnp_cards); \
  134. (card) = global_to_pnp_card((card)->global_list.next))
  135. struct pnp_card_link {
  136. struct pnp_card *card;
  137. struct pnp_card_driver *driver;
  138. void *driver_data;
  139. pm_message_t pm_state;
  140. };
  141. static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard)
  142. {
  143. return pcard->driver_data;
  144. }
  145. static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data)
  146. {
  147. pcard->driver_data = data;
  148. }
  149. struct pnp_dev {
  150. struct device dev; /* Driver Model device interface */
  151. u64 dma_mask;
  152. unsigned char number; /* used as an index, must be unique */
  153. int status;
  154. struct list_head global_list; /* node in global list of devices */
  155. struct list_head protocol_list; /* node in list of device's protocol */
  156. struct list_head card_list; /* node in card's list of devices */
  157. struct list_head rdev_list; /* node in cards list of requested devices */
  158. struct pnp_protocol *protocol;
  159. struct pnp_card *card; /* card the device is attached to, none if NULL */
  160. struct pnp_driver *driver;
  161. struct pnp_card_link *card_link;
  162. struct pnp_id *id; /* supported EISA IDs */
  163. int active;
  164. int capabilities;
  165. struct pnp_option *independent;
  166. struct pnp_option *dependent;
  167. struct pnp_resource_table res;
  168. char name[PNP_NAME_LEN]; /* contains a human-readable name */
  169. unsigned short regs; /* ISAPnP: supported registers */
  170. int flags; /* used by protocols */
  171. struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
  172. void *data;
  173. };
  174. #define global_to_pnp_dev(n) list_entry(n, struct pnp_dev, global_list)
  175. #define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list)
  176. #define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list)
  177. #define to_pnp_dev(n) container_of(n, struct pnp_dev, dev)
  178. #define pnp_for_each_dev(dev) \
  179. for((dev) = global_to_pnp_dev(pnp_global.next); \
  180. (dev) != global_to_pnp_dev(&pnp_global); \
  181. (dev) = global_to_pnp_dev((dev)->global_list.next))
  182. #define card_for_each_dev(card,dev) \
  183. for((dev) = card_to_pnp_dev((card)->devices.next); \
  184. (dev) != card_to_pnp_dev(&(card)->devices); \
  185. (dev) = card_to_pnp_dev((dev)->card_list.next))
  186. #define pnp_dev_name(dev) (dev)->name
  187. static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
  188. {
  189. return dev_get_drvdata(&pdev->dev);
  190. }
  191. static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
  192. {
  193. dev_set_drvdata(&pdev->dev, data);
  194. }
  195. struct pnp_fixup {
  196. char id[7];
  197. void (*quirk_function) (struct pnp_dev * dev); /* fixup function */
  198. };
  199. /* config parameters */
  200. #define PNP_CONFIG_NORMAL 0x0001
  201. #define PNP_CONFIG_FORCE 0x0002 /* disables validity checking */
  202. /* capabilities */
  203. #define PNP_READ 0x0001
  204. #define PNP_WRITE 0x0002
  205. #define PNP_DISABLE 0x0004
  206. #define PNP_CONFIGURABLE 0x0008
  207. #define PNP_REMOVABLE 0x0010
  208. #define pnp_can_read(dev) (((dev)->protocol) && ((dev)->protocol->get) && \
  209. ((dev)->capabilities & PNP_READ))
  210. #define pnp_can_write(dev) (((dev)->protocol) && ((dev)->protocol->set) && \
  211. ((dev)->capabilities & PNP_WRITE))
  212. #define pnp_can_disable(dev) (((dev)->protocol) && ((dev)->protocol->disable) && \
  213. ((dev)->capabilities & PNP_DISABLE))
  214. #define pnp_can_configure(dev) ((!(dev)->active) && \
  215. ((dev)->capabilities & PNP_CONFIGURABLE))
  216. #ifdef CONFIG_ISAPNP
  217. extern struct pnp_protocol isapnp_protocol;
  218. #define pnp_device_is_isapnp(dev) ((dev)->protocol == (&isapnp_protocol))
  219. #else
  220. #define pnp_device_is_isapnp(dev) 0
  221. #endif
  222. #ifdef CONFIG_PNPBIOS
  223. extern struct pnp_protocol pnpbios_protocol;
  224. #define pnp_device_is_pnpbios(dev) ((dev)->protocol == (&pnpbios_protocol))
  225. #else
  226. #define pnp_device_is_pnpbios(dev) 0
  227. #endif
  228. /* status */
  229. #define PNP_READY 0x0000
  230. #define PNP_ATTACHED 0x0001
  231. #define PNP_BUSY 0x0002
  232. #define PNP_FAULTY 0x0004
  233. /* isapnp specific macros */
  234. #define isapnp_card_number(dev) ((dev)->card ? (dev)->card->number : -1)
  235. #define isapnp_csn_number(dev) ((dev)->number)
  236. /*
  237. * Driver Management
  238. */
  239. struct pnp_id {
  240. char id[PNP_ID_LEN];
  241. struct pnp_id *next;
  242. };
  243. struct pnp_driver {
  244. char *name;
  245. const struct pnp_device_id *id_table;
  246. unsigned int flags;
  247. int (*probe) (struct pnp_dev * dev,
  248. const struct pnp_device_id * dev_id);
  249. void (*remove) (struct pnp_dev * dev);
  250. int (*suspend) (struct pnp_dev * dev, pm_message_t state);
  251. int (*resume) (struct pnp_dev * dev);
  252. struct device_driver driver;
  253. };
  254. #define to_pnp_driver(drv) container_of(drv, struct pnp_driver, driver)
  255. struct pnp_card_driver {
  256. struct list_head global_list;
  257. char *name;
  258. const struct pnp_card_device_id *id_table;
  259. unsigned int flags;
  260. int (*probe) (struct pnp_card_link * card,
  261. const struct pnp_card_device_id * card_id);
  262. void (*remove) (struct pnp_card_link * card);
  263. int (*suspend) (struct pnp_card_link * card, pm_message_t state);
  264. int (*resume) (struct pnp_card_link * card);
  265. struct pnp_driver link;
  266. };
  267. #define to_pnp_card_driver(drv) container_of(drv, struct pnp_card_driver, link)
  268. /* pnp driver flags */
  269. #define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */
  270. #define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */
  271. /*
  272. * Protocol Management
  273. */
  274. struct pnp_protocol {
  275. struct list_head protocol_list;
  276. char *name;
  277. /* resource control functions */
  278. int (*get) (struct pnp_dev * dev, struct pnp_resource_table * res);
  279. int (*set) (struct pnp_dev * dev, struct pnp_resource_table * res);
  280. int (*disable) (struct pnp_dev * dev);
  281. /* protocol specific suspend/resume */
  282. int (*suspend) (struct pnp_dev * dev, pm_message_t state);
  283. int (*resume) (struct pnp_dev * dev);
  284. /* used by pnp layer only (look but don't touch) */
  285. unsigned char number; /* protocol number */
  286. struct device dev; /* link to driver model */
  287. struct list_head cards;
  288. struct list_head devices;
  289. };
  290. #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
  291. #define protocol_for_each_card(protocol,card) \
  292. for((card) = protocol_to_pnp_card((protocol)->cards.next); \
  293. (card) != protocol_to_pnp_card(&(protocol)->cards); \
  294. (card) = protocol_to_pnp_card((card)->protocol_list.next))
  295. #define protocol_for_each_dev(protocol,dev) \
  296. for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \
  297. (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
  298. (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
  299. extern struct bus_type pnp_bus_type;
  300. #if defined(CONFIG_PNP)
  301. /* device management */
  302. int pnp_register_protocol(struct pnp_protocol *protocol);
  303. void pnp_unregister_protocol(struct pnp_protocol *protocol);
  304. int pnp_add_device(struct pnp_dev *dev);
  305. int pnp_device_attach(struct pnp_dev *pnp_dev);
  306. void pnp_device_detach(struct pnp_dev *pnp_dev);
  307. extern struct list_head pnp_global;
  308. extern int pnp_platform_devices;
  309. /* multidevice card support */
  310. int pnp_add_card(struct pnp_card *card);
  311. void pnp_remove_card(struct pnp_card *card);
  312. int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
  313. void pnp_remove_card_device(struct pnp_dev *dev);
  314. int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
  315. struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
  316. const char *id, struct pnp_dev *from);
  317. void pnp_release_card_device(struct pnp_dev *dev);
  318. int pnp_register_card_driver(struct pnp_card_driver *drv);
  319. void pnp_unregister_card_driver(struct pnp_card_driver *drv);
  320. extern struct list_head pnp_cards;
  321. /* resource management */
  322. struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
  323. struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
  324. int priority);
  325. int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
  326. int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
  327. int pnp_register_port_resource(struct pnp_option *option,
  328. struct pnp_port *data);
  329. int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
  330. void pnp_init_resource_table(struct pnp_resource_table *table);
  331. int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
  332. int mode);
  333. int pnp_auto_config_dev(struct pnp_dev *dev);
  334. int pnp_validate_config(struct pnp_dev *dev);
  335. int pnp_start_dev(struct pnp_dev *dev);
  336. int pnp_stop_dev(struct pnp_dev *dev);
  337. int pnp_activate_dev(struct pnp_dev *dev);
  338. int pnp_disable_dev(struct pnp_dev *dev);
  339. void pnp_resource_change(struct resource *resource, resource_size_t start,
  340. resource_size_t size);
  341. /* protocol helpers */
  342. int pnp_is_active(struct pnp_dev *dev);
  343. int compare_pnp_id(struct pnp_id *pos, const char *id);
  344. int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
  345. int pnp_register_driver(struct pnp_driver *drv);
  346. void pnp_unregister_driver(struct pnp_driver *drv);
  347. #else
  348. /* device management */
  349. static inline int pnp_register_protocol(struct pnp_protocol *protocol)
  350. {
  351. return -ENODEV;
  352. }
  353. static inline void pnp_unregister_protocol(struct pnp_protocol *protocol)
  354. {
  355. }
  356. static inline int pnp_init_device(struct pnp_dev *dev)
  357. {
  358. return -ENODEV;
  359. }
  360. static inline int pnp_add_device(struct pnp_dev *dev)
  361. {
  362. return -ENODEV;
  363. }
  364. static inline int pnp_device_attach(struct pnp_dev *pnp_dev)
  365. {
  366. return -ENODEV;
  367. }
  368. static inline void pnp_device_detach(struct pnp_dev *pnp_dev)
  369. {;
  370. }
  371. #define pnp_platform_devices 0
  372. /* multidevice card support */
  373. static inline int pnp_add_card(struct pnp_card *card)
  374. {
  375. return -ENODEV;
  376. }
  377. static inline void pnp_remove_card(struct pnp_card *card)
  378. {;
  379. }
  380. static inline int pnp_add_card_device(struct pnp_card *card,
  381. struct pnp_dev *dev)
  382. {
  383. return -ENODEV;
  384. }
  385. static inline void pnp_remove_card_device(struct pnp_dev *dev)
  386. {;
  387. }
  388. static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card)
  389. {
  390. return -ENODEV;
  391. }
  392. static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link
  393. *clink, const char *id,
  394. struct pnp_dev *from)
  395. {
  396. return NULL;
  397. }
  398. static inline void pnp_release_card_device(struct pnp_dev *dev)
  399. {;
  400. }
  401. static inline int pnp_register_card_driver(struct pnp_card_driver *drv)
  402. {
  403. return -ENODEV;
  404. }
  405. static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv)
  406. {;
  407. }
  408. /* resource management */
  409. static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev
  410. *dev)
  411. {
  412. return NULL;
  413. }
  414. static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev
  415. *dev,
  416. int priority)
  417. {
  418. return NULL;
  419. }
  420. static inline int pnp_register_irq_resource(struct pnp_option *option,
  421. struct pnp_irq *data)
  422. {
  423. return -ENODEV;
  424. }
  425. static inline int pnp_register_dma_resource(struct pnp_option *option,
  426. struct pnp_dma *data)
  427. {
  428. return -ENODEV;
  429. }
  430. static inline int pnp_register_port_resource(struct pnp_option *option,
  431. struct pnp_port *data)
  432. {
  433. return -ENODEV;
  434. }
  435. static inline int pnp_register_mem_resource(struct pnp_option *option,
  436. struct pnp_mem *data)
  437. {
  438. return -ENODEV;
  439. }
  440. static inline void pnp_init_resource_table(struct pnp_resource_table *table)
  441. {
  442. }
  443. static inline int pnp_manual_config_dev(struct pnp_dev *dev,
  444. struct pnp_resource_table *res,
  445. int mode)
  446. {
  447. return -ENODEV;
  448. }
  449. static inline int pnp_auto_config_dev(struct pnp_dev *dev)
  450. {
  451. return -ENODEV;
  452. }
  453. static inline int pnp_validate_config(struct pnp_dev *dev)
  454. {
  455. return -ENODEV;
  456. }
  457. static inline int pnp_start_dev(struct pnp_dev *dev)
  458. {
  459. return -ENODEV;
  460. }
  461. static inline int pnp_stop_dev(struct pnp_dev *dev)
  462. {
  463. return -ENODEV;
  464. }
  465. static inline int pnp_activate_dev(struct pnp_dev *dev)
  466. {
  467. return -ENODEV;
  468. }
  469. static inline int pnp_disable_dev(struct pnp_dev *dev)
  470. {
  471. return -ENODEV;
  472. }
  473. static inline void pnp_resource_change(struct resource *resource,
  474. resource_size_t start,
  475. resource_size_t size)
  476. {
  477. }
  478. /* protocol helpers */
  479. static inline int pnp_is_active(struct pnp_dev *dev)
  480. {
  481. return 0;
  482. }
  483. static inline int compare_pnp_id(struct pnp_id *pos, const char *id)
  484. {
  485. return -ENODEV;
  486. }
  487. static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
  488. {
  489. return -ENODEV;
  490. }
  491. static inline int pnp_register_driver(struct pnp_driver *drv)
  492. {
  493. return -ENODEV;
  494. }
  495. static inline void pnp_unregister_driver(struct pnp_driver *drv)
  496. {;
  497. }
  498. #endif /* CONFIG_PNP */
  499. #define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg)
  500. #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
  501. #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
  502. #ifdef CONFIG_PNP_DEBUG
  503. #define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg)
  504. #else
  505. #define pnp_dbg(format, arg...) do {} while (0)
  506. #endif
  507. #endif /* __KERNEL__ */
  508. #endif /* _LINUX_PNP_H */