aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pnp.h363
-rw-r--r--include/linux/pnpbios.h62
2 files changed, 268 insertions, 157 deletions
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 66edb2293184..6f9cf2fcffd0 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -23,7 +23,6 @@
23struct pnp_protocol; 23struct pnp_protocol;
24struct pnp_dev; 24struct pnp_dev;
25 25
26
27/* 26/*
28 * Resource Management 27 * Resource Management
29 */ 28 */
@@ -73,37 +72,37 @@ struct pnp_dev;
73#define PNP_PORT_FLAG_FIXED (1<<1) 72#define PNP_PORT_FLAG_FIXED (1<<1)
74 73
75struct pnp_port { 74struct pnp_port {
76 unsigned short min; /* min base number */ 75 unsigned short min; /* min base number */
77 unsigned short max; /* max base number */ 76 unsigned short max; /* max base number */
78 unsigned char align; /* align boundary */ 77 unsigned char align; /* align boundary */
79 unsigned char size; /* size of range */ 78 unsigned char size; /* size of range */
80 unsigned char flags; /* port flags */ 79 unsigned char flags; /* port flags */
81 unsigned char pad; /* pad */ 80 unsigned char pad; /* pad */
82 struct pnp_port *next; /* next port */ 81 struct pnp_port *next; /* next port */
83}; 82};
84 83
85#define PNP_IRQ_NR 256 84#define PNP_IRQ_NR 256
86struct pnp_irq { 85struct pnp_irq {
87 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */ 86 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */
88 unsigned char flags; /* IRQ flags */ 87 unsigned char flags; /* IRQ flags */
89 unsigned char pad; /* pad */ 88 unsigned char pad; /* pad */
90 struct pnp_irq *next; /* next IRQ */ 89 struct pnp_irq *next; /* next IRQ */
91}; 90};
92 91
93struct pnp_dma { 92struct pnp_dma {
94 unsigned char map; /* bitmask for DMA channels */ 93 unsigned char map; /* bitmask for DMA channels */
95 unsigned char flags; /* DMA flags */ 94 unsigned char flags; /* DMA flags */
96 struct pnp_dma *next; /* next port */ 95 struct pnp_dma *next; /* next port */
97}; 96};
98 97
99struct pnp_mem { 98struct pnp_mem {
100 unsigned int min; /* min base number */ 99 unsigned int min; /* min base number */
101 unsigned int max; /* max base number */ 100 unsigned int max; /* max base number */
102 unsigned int align; /* align boundary */ 101 unsigned int align; /* align boundary */
103 unsigned int size; /* size of range */ 102 unsigned int size; /* size of range */
104 unsigned char flags; /* memory flags */ 103 unsigned char flags; /* memory flags */
105 unsigned char pad; /* pad */ 104 unsigned char pad; /* pad */
106 struct pnp_mem *next; /* next memory resource */ 105 struct pnp_mem *next; /* next memory resource */
107}; 106};
108 107
109#define PNP_RES_PRIORITY_PREFERRED 0 108#define PNP_RES_PRIORITY_PREFERRED 0
@@ -113,10 +112,10 @@ struct pnp_mem {
113 112
114struct pnp_option { 113struct pnp_option {
115 unsigned short priority; /* priority */ 114 unsigned short priority; /* priority */
116 struct pnp_port *port; /* first port */ 115 struct pnp_port *port; /* first port */
117 struct pnp_irq *irq; /* first IRQ */ 116 struct pnp_irq *irq; /* first IRQ */
118 struct pnp_dma *dma; /* first DMA */ 117 struct pnp_dma *dma; /* first DMA */
119 struct pnp_mem *mem; /* first memory resource */ 118 struct pnp_mem *mem; /* first memory resource */
120 struct pnp_option *next; /* used to chain dependent resources */ 119 struct pnp_option *next; /* used to chain dependent resources */
121}; 120};
122 121
@@ -127,26 +126,25 @@ struct pnp_resource_table {
127 struct resource irq_resource[PNP_MAX_IRQ]; 126 struct resource irq_resource[PNP_MAX_IRQ];
128}; 127};
129 128
130
131/* 129/*
132 * Device Managemnt 130 * Device Managemnt
133 */ 131 */
134 132
135struct pnp_card { 133struct pnp_card {
136 struct device dev; /* Driver Model device interface */ 134 struct device dev; /* Driver Model device interface */
137 unsigned char number; /* used as an index, must be unique */ 135 unsigned char number; /* used as an index, must be unique */
138 struct list_head global_list; /* node in global list of cards */ 136 struct list_head global_list; /* node in global list of cards */
139 struct list_head protocol_list; /* node in protocol's list of cards */ 137 struct list_head protocol_list; /* node in protocol's list of cards */
140 struct list_head devices; /* devices attached to the card */ 138 struct list_head devices; /* devices attached to the card */
141 139
142 struct pnp_protocol * protocol; 140 struct pnp_protocol *protocol;
143 struct pnp_id * id; /* contains supported EISA IDs*/ 141 struct pnp_id *id; /* contains supported EISA IDs */
144 142
145 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 143 char name[PNP_NAME_LEN]; /* contains a human-readable name */
146 unsigned char pnpver; /* Plug & Play version */ 144 unsigned char pnpver; /* Plug & Play version */
147 unsigned char productver; /* product version */ 145 unsigned char productver; /* product version */
148 unsigned int serial; /* serial number */ 146 unsigned int serial; /* serial number */
149 unsigned char checksum; /* if zero - checksum passed */ 147 unsigned char checksum; /* if zero - checksum passed */
150 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ 148 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */
151}; 149};
152 150
@@ -159,26 +157,26 @@ struct pnp_card {
159 (card) = global_to_pnp_card((card)->global_list.next)) 157 (card) = global_to_pnp_card((card)->global_list.next))
160 158
161struct pnp_card_link { 159struct pnp_card_link {
162 struct pnp_card * card; 160 struct pnp_card *card;
163 struct pnp_card_driver * driver; 161 struct pnp_card_driver *driver;
164 void * driver_data; 162 void *driver_data;
165 pm_message_t pm_state; 163 pm_message_t pm_state;
166}; 164};
167 165
168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 166static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard)
169{ 167{
170 return pcard->driver_data; 168 return pcard->driver_data;
171} 169}
172 170
173static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) 171static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data)
174{ 172{
175 pcard->driver_data = data; 173 pcard->driver_data = data;
176} 174}
177 175
178struct pnp_dev { 176struct pnp_dev {
179 struct device dev; /* Driver Model device interface */ 177 struct device dev; /* Driver Model device interface */
180 u64 dma_mask; 178 u64 dma_mask;
181 unsigned char number; /* used as an index, must be unique */ 179 unsigned char number; /* used as an index, must be unique */
182 int status; 180 int status;
183 181
184 struct list_head global_list; /* node in global list of devices */ 182 struct list_head global_list; /* node in global list of devices */
@@ -186,22 +184,22 @@ struct pnp_dev {
186 struct list_head card_list; /* node in card's list of devices */ 184 struct list_head card_list; /* node in card's list of devices */
187 struct list_head rdev_list; /* node in cards list of requested devices */ 185 struct list_head rdev_list; /* node in cards list of requested devices */
188 186
189 struct pnp_protocol * protocol; 187 struct pnp_protocol *protocol;
190 struct pnp_card * card; /* card the device is attached to, none if NULL */ 188 struct pnp_card *card; /* card the device is attached to, none if NULL */
191 struct pnp_driver * driver; 189 struct pnp_driver *driver;
192 struct pnp_card_link * card_link; 190 struct pnp_card_link *card_link;
193 191
194 struct pnp_id * id; /* supported EISA IDs*/ 192 struct pnp_id *id; /* supported EISA IDs */
195 193
196 int active; 194 int active;
197 int capabilities; 195 int capabilities;
198 struct pnp_option * independent; 196 struct pnp_option *independent;
199 struct pnp_option * dependent; 197 struct pnp_option *dependent;
200 struct pnp_resource_table res; 198 struct pnp_resource_table res;
201 199
202 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 200 char name[PNP_NAME_LEN]; /* contains a human-readable name */
203 unsigned short regs; /* ISAPnP: supported registers */ 201 unsigned short regs; /* ISAPnP: supported registers */
204 int flags; /* used by protocols */ 202 int flags; /* used by protocols */
205 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ 203 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
206 void *data; 204 void *data;
207}; 205};
@@ -220,19 +218,19 @@ struct pnp_dev {
220 (dev) = card_to_pnp_dev((dev)->card_list.next)) 218 (dev) = card_to_pnp_dev((dev)->card_list.next))
221#define pnp_dev_name(dev) (dev)->name 219#define pnp_dev_name(dev) (dev)->name
222 220
223static inline void *pnp_get_drvdata (struct pnp_dev *pdev) 221static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
224{ 222{
225 return dev_get_drvdata(&pdev->dev); 223 return dev_get_drvdata(&pdev->dev);
226} 224}
227 225
228static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) 226static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
229{ 227{
230 dev_set_drvdata(&pdev->dev, data); 228 dev_set_drvdata(&pdev->dev, data);
231} 229}
232 230
233struct pnp_fixup { 231struct pnp_fixup {
234 char id[7]; 232 char id[7];
235 void (*quirk_function)(struct pnp_dev *dev); /* fixup function */ 233 void (*quirk_function) (struct pnp_dev * dev); /* fixup function */
236}; 234};
237 235
238/* config parameters */ 236/* config parameters */
@@ -269,7 +267,6 @@ extern struct pnp_protocol pnpbios_protocol;
269#define pnp_device_is_pnpbios(dev) 0 267#define pnp_device_is_pnpbios(dev) 0
270#endif 268#endif
271 269
272
273/* status */ 270/* status */
274#define PNP_READY 0x0000 271#define PNP_READY 0x0000
275#define PNP_ATTACHED 0x0001 272#define PNP_ATTACHED 0x0001
@@ -287,17 +284,18 @@ extern struct pnp_protocol pnpbios_protocol;
287 284
288struct pnp_id { 285struct pnp_id {
289 char id[PNP_ID_LEN]; 286 char id[PNP_ID_LEN];
290 struct pnp_id * next; 287 struct pnp_id *next;
291}; 288};
292 289
293struct pnp_driver { 290struct pnp_driver {
294 char * name; 291 char *name;
295 const struct pnp_device_id *id_table; 292 const struct pnp_device_id *id_table;
296 unsigned int flags; 293 unsigned int flags;
297 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); 294 int (*probe) (struct pnp_dev * dev,
298 void (*remove) (struct pnp_dev *dev); 295 const struct pnp_device_id * dev_id);
299 int (*suspend) (struct pnp_dev *dev, pm_message_t state); 296 void (*remove) (struct pnp_dev * dev);
300 int (*resume) (struct pnp_dev *dev); 297 int (*suspend) (struct pnp_dev * dev, pm_message_t state);
298 int (*resume) (struct pnp_dev * dev);
301 struct device_driver driver; 299 struct device_driver driver;
302}; 300};
303 301
@@ -305,13 +303,14 @@ struct pnp_driver {
305 303
306struct pnp_card_driver { 304struct pnp_card_driver {
307 struct list_head global_list; 305 struct list_head global_list;
308 char * name; 306 char *name;
309 const struct pnp_card_device_id *id_table; 307 const struct pnp_card_device_id *id_table;
310 unsigned int flags; 308 unsigned int flags;
311 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); 309 int (*probe) (struct pnp_card_link * card,
312 void (*remove) (struct pnp_card_link *card); 310 const struct pnp_card_device_id * card_id);
313 int (*suspend) (struct pnp_card_link *card, pm_message_t state); 311 void (*remove) (struct pnp_card_link * card);
314 int (*resume) (struct pnp_card_link *card); 312 int (*suspend) (struct pnp_card_link * card, pm_message_t state);
313 int (*resume) (struct pnp_card_link * card);
315 struct pnp_driver link; 314 struct pnp_driver link;
316}; 315};
317 316
@@ -321,29 +320,28 @@ struct pnp_card_driver {
321#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ 320#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */
322#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ 321#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */
323 322
324
325/* 323/*
326 * Protocol Management 324 * Protocol Management
327 */ 325 */
328 326
329struct pnp_protocol { 327struct pnp_protocol {
330 struct list_head protocol_list; 328 struct list_head protocol_list;
331 char * name; 329 char *name;
332 330
333 /* resource control functions */ 331 /* resource control functions */
334 int (*get)(struct pnp_dev *dev, struct pnp_resource_table *res); 332 int (*get) (struct pnp_dev * dev, struct pnp_resource_table * res);
335 int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); 333 int (*set) (struct pnp_dev * dev, struct pnp_resource_table * res);
336 int (*disable)(struct pnp_dev *dev); 334 int (*disable) (struct pnp_dev * dev);
337 335
338 /* protocol specific suspend/resume */ 336 /* protocol specific suspend/resume */
339 int (*suspend)(struct pnp_dev *dev, pm_message_t state); 337 int (*suspend) (struct pnp_dev * dev, pm_message_t state);
340 int (*resume)(struct pnp_dev *dev); 338 int (*resume) (struct pnp_dev * dev);
341 339
342 /* used by pnp layer only (look but don't touch) */ 340 /* used by pnp layer only (look but don't touch) */
343 unsigned char number; /* protocol number*/ 341 unsigned char number; /* protocol number */
344 struct device dev; /* link to driver model */ 342 struct device dev; /* link to driver model */
345 struct list_head cards; 343 struct list_head cards;
346 struct list_head devices; 344 struct list_head devices;
347}; 345};
348 346
349#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) 347#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
@@ -356,7 +354,6 @@ struct pnp_protocol {
356 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ 354 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
357 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) 355 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
358 356
359
360extern struct bus_type pnp_bus_type; 357extern struct bus_type pnp_bus_type;
361 358
362#if defined(CONFIG_PNP) 359#if defined(CONFIG_PNP)
@@ -376,21 +373,25 @@ void pnp_remove_card(struct pnp_card *card);
376int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); 373int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
377void pnp_remove_card_device(struct pnp_dev *dev); 374void pnp_remove_card_device(struct pnp_dev *dev);
378int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); 375int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
379struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); 376struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
380void pnp_release_card_device(struct pnp_dev * dev); 377 const char *id, struct pnp_dev *from);
381int pnp_register_card_driver(struct pnp_card_driver * drv); 378void pnp_release_card_device(struct pnp_dev *dev);
382void pnp_unregister_card_driver(struct pnp_card_driver * drv); 379int pnp_register_card_driver(struct pnp_card_driver *drv);
380void pnp_unregister_card_driver(struct pnp_card_driver *drv);
383extern struct list_head pnp_cards; 381extern struct list_head pnp_cards;
384 382
385/* resource management */ 383/* resource management */
386struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); 384struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
387struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); 385struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
386 int priority);
388int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); 387int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
389int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); 388int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
390int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); 389int pnp_register_port_resource(struct pnp_option *option,
390 struct pnp_port *data);
391int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); 391int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
392void pnp_init_resource_table(struct pnp_resource_table *table); 392void pnp_init_resource_table(struct pnp_resource_table *table);
393int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 393int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
394 int mode);
394int pnp_auto_config_dev(struct pnp_dev *dev); 395int pnp_auto_config_dev(struct pnp_dev *dev);
395int pnp_validate_config(struct pnp_dev *dev); 396int pnp_validate_config(struct pnp_dev *dev);
396int pnp_start_dev(struct pnp_dev *dev); 397int pnp_start_dev(struct pnp_dev *dev);
@@ -398,11 +399,11 @@ int pnp_stop_dev(struct pnp_dev *dev);
398int pnp_activate_dev(struct pnp_dev *dev); 399int pnp_activate_dev(struct pnp_dev *dev);
399int pnp_disable_dev(struct pnp_dev *dev); 400int pnp_disable_dev(struct pnp_dev *dev);
400void pnp_resource_change(struct resource *resource, resource_size_t start, 401void pnp_resource_change(struct resource *resource, resource_size_t start,
401 resource_size_t size); 402 resource_size_t size);
402 403
403/* protocol helpers */ 404/* protocol helpers */
404int pnp_is_active(struct pnp_dev * dev); 405int pnp_is_active(struct pnp_dev *dev);
405int compare_pnp_id(struct pnp_id * pos, const char * id); 406int compare_pnp_id(struct pnp_id *pos, const char *id);
406int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); 407int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
407int pnp_register_driver(struct pnp_driver *drv); 408int pnp_register_driver(struct pnp_driver *drv);
408void pnp_unregister_driver(struct pnp_driver *drv); 409void pnp_unregister_driver(struct pnp_driver *drv);
@@ -410,54 +411,162 @@ void pnp_unregister_driver(struct pnp_driver *drv);
410#else 411#else
411 412
412/* device management */ 413/* device management */
413static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return -ENODEV; } 414static inline int pnp_register_protocol(struct pnp_protocol *protocol)
414static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } 415{
415static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 416 return -ENODEV;
416static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 417}
417static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 418static inline void pnp_unregister_protocol(struct pnp_protocol *protocol)
418static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 419{
420}
421static inline int pnp_init_device(struct pnp_dev *dev)
422{
423 return -ENODEV;
424}
425static inline int pnp_add_device(struct pnp_dev *dev)
426{
427 return -ENODEV;
428}
429static inline int pnp_device_attach(struct pnp_dev *pnp_dev)
430{
431 return -ENODEV;
432}
433static inline void pnp_device_detach(struct pnp_dev *pnp_dev)
434{;
435}
436
419#define pnp_platform_devices 0 437#define pnp_platform_devices 0
420 438
421/* multidevice card support */ 439/* multidevice card support */
422static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } 440static inline int pnp_add_card(struct pnp_card *card)
423static inline void pnp_remove_card(struct pnp_card *card) { ; } 441{
424static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } 442 return -ENODEV;
425static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } 443}
426static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } 444static inline void pnp_remove_card(struct pnp_card *card)
427static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } 445{;
428static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } 446}
429static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } 447static inline int pnp_add_card_device(struct pnp_card *card,
430static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } 448 struct pnp_dev *dev)
449{
450 return -ENODEV;
451}
452static inline void pnp_remove_card_device(struct pnp_dev *dev)
453{;
454}
455static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card)
456{
457 return -ENODEV;
458}
459static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link
460 *clink, const char *id,
461 struct pnp_dev *from)
462{
463 return NULL;
464}
465static inline void pnp_release_card_device(struct pnp_dev *dev)
466{;
467}
468static inline int pnp_register_card_driver(struct pnp_card_driver *drv)
469{
470 return -ENODEV;
471}
472static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv)
473{;
474}
431 475
432/* resource management */ 476/* resource management */
433static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } 477static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev
434static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } 478 *dev)
435static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } 479{
436static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } 480 return NULL;
437static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } 481}
438static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; } 482static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev
439static inline void pnp_init_resource_table(struct pnp_resource_table *table) { } 483 *dev,
440static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; } 484 int priority)
441static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } 485{
442static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; } 486 return NULL;
443static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } 487}
444static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 488static inline int pnp_register_irq_resource(struct pnp_option *option,
445static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 489 struct pnp_irq *data)
446static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 490{
491 return -ENODEV;
492}
493static inline int pnp_register_dma_resource(struct pnp_option *option,
494 struct pnp_dma *data)
495{
496 return -ENODEV;
497}
498static inline int pnp_register_port_resource(struct pnp_option *option,
499 struct pnp_port *data)
500{
501 return -ENODEV;
502}
503static inline int pnp_register_mem_resource(struct pnp_option *option,
504 struct pnp_mem *data)
505{
506 return -ENODEV;
507}
508static inline void pnp_init_resource_table(struct pnp_resource_table *table)
509{
510}
511static inline int pnp_manual_config_dev(struct pnp_dev *dev,
512 struct pnp_resource_table *res,
513 int mode)
514{
515 return -ENODEV;
516}
517static inline int pnp_auto_config_dev(struct pnp_dev *dev)
518{
519 return -ENODEV;
520}
521static inline int pnp_validate_config(struct pnp_dev *dev)
522{
523 return -ENODEV;
524}
525static inline int pnp_start_dev(struct pnp_dev *dev)
526{
527 return -ENODEV;
528}
529static inline int pnp_stop_dev(struct pnp_dev *dev)
530{
531 return -ENODEV;
532}
533static inline int pnp_activate_dev(struct pnp_dev *dev)
534{
535 return -ENODEV;
536}
537static inline int pnp_disable_dev(struct pnp_dev *dev)
538{
539 return -ENODEV;
540}
447static inline void pnp_resource_change(struct resource *resource, 541static inline void pnp_resource_change(struct resource *resource,
448 resource_size_t start, 542 resource_size_t start,
449 resource_size_t size) { } 543 resource_size_t size)
544{
545}
450 546
451/* protocol helpers */ 547/* protocol helpers */
452static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 548static inline int pnp_is_active(struct pnp_dev *dev)
453static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } 549{
454static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } 550 return 0;
455static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 551}
456static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } 552static inline int compare_pnp_id(struct pnp_id *pos, const char *id)
553{
554 return -ENODEV;
555}
556static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
557{
558 return -ENODEV;
559}
560static inline int pnp_register_driver(struct pnp_driver *drv)
561{
562 return -ENODEV;
563}
564static inline void pnp_unregister_driver(struct pnp_driver *drv)
565{;
566}
457 567
458#endif /* CONFIG_PNP */ 568#endif /* CONFIG_PNP */
459 569
460
461#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) 570#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg)
462#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) 571#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
463#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) 572#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
index 0a282ac1f6b2..2e625d11a176 100644
--- a/include/linux/pnpbios.h
+++ b/include/linux/pnpbios.h
@@ -99,32 +99,32 @@
99 99
100#pragma pack(1) 100#pragma pack(1)
101struct pnp_dev_node_info { 101struct pnp_dev_node_info {
102 __u16 no_nodes; 102 __u16 no_nodes;
103 __u16 max_node_size; 103 __u16 max_node_size;
104}; 104};
105struct pnp_docking_station_info { 105struct pnp_docking_station_info {
106 __u32 location_id; 106 __u32 location_id;
107 __u32 serial; 107 __u32 serial;
108 __u16 capabilities; 108 __u16 capabilities;
109}; 109};
110struct pnp_isa_config_struc { 110struct pnp_isa_config_struc {
111 __u8 revision; 111 __u8 revision;
112 __u8 no_csns; 112 __u8 no_csns;
113 __u16 isa_rd_data_port; 113 __u16 isa_rd_data_port;
114 __u16 reserved; 114 __u16 reserved;
115}; 115};
116struct escd_info_struc { 116struct escd_info_struc {
117 __u16 min_escd_write_size; 117 __u16 min_escd_write_size;
118 __u16 escd_size; 118 __u16 escd_size;
119 __u32 nv_storage_base; 119 __u32 nv_storage_base;
120}; 120};
121struct pnp_bios_node { 121struct pnp_bios_node {
122 __u16 size; 122 __u16 size;
123 __u8 handle; 123 __u8 handle;
124 __u32 eisa_id; 124 __u32 eisa_id;
125 __u8 type_code[3]; 125 __u8 type_code[3];
126 __u16 flags; 126 __u16 flags;
127 __u8 data[0]; 127 __u8 data[0];
128}; 128};
129#pragma pack() 129#pragma pack()
130 130
@@ -133,21 +133,23 @@ struct pnp_bios_node {
133/* non-exported */ 133/* non-exported */
134extern struct pnp_dev_node_info node_info; 134extern struct pnp_dev_node_info node_info;
135 135
136extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); 136extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data);
137extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); 137extern int pnp_bios_get_dev_node(u8 * nodenum, char config,
138extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); 138 struct pnp_bios_node *data);
139extern int pnp_bios_get_stat_res (char *info); 139extern int pnp_bios_set_dev_node(u8 nodenum, char config,
140extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); 140 struct pnp_bios_node *data);
141extern int pnp_bios_escd_info (struct escd_info_struc *data); 141extern int pnp_bios_get_stat_res(char *info);
142extern int pnp_bios_read_escd (char *data, u32 nvram_base); 142extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data);
143extern int pnp_bios_escd_info(struct escd_info_struc *data);
144extern int pnp_bios_read_escd(char *data, u32 nvram_base);
143extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); 145extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
144#define needed 0 146#define needed 0
145#if needed 147#if needed
146extern int pnp_bios_get_event (u16 *message); 148extern int pnp_bios_get_event(u16 * message);
147extern int pnp_bios_send_message (u16 message); 149extern int pnp_bios_send_message(u16 message);
148extern int pnp_bios_set_stat_res (char *info); 150extern int pnp_bios_set_stat_res(char *info);
149extern int pnp_bios_apm_id_table (char *table, u16 *size); 151extern int pnp_bios_apm_id_table(char *table, u16 * size);
150extern int pnp_bios_write_escd (char *data, u32 nvram_base); 152extern int pnp_bios_write_escd(char *data, u32 nvram_base);
151#endif 153#endif
152 154
153#endif /* CONFIG_PNPBIOS */ 155#endif /* CONFIG_PNPBIOS */