diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2007-07-26 13:41:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-26 14:35:20 -0400 |
commit | 9dd78466c956ac4b4f38e12032dc4249ccf57ad1 (patch) | |
tree | 57ee3822b79049d38c1df952fe77e72a97c718f3 /include | |
parent | 8ec3cf7d29aef773eee5bc6cd9b0fa4d3fb42480 (diff) |
PNP: Lindent all source files
Run Lindent on all PNP source files.
Produced by:
$ quilt new pnp-lindent
$ find drivers/pnp -name \*.[ch] | xargs quilt add
$ quilt add include/linux/{pnp.h,pnpbios.h}
$ scripts/Lindent drivers/pnp/*.c drivers/pnp/*/*.c include/linux/pnp*.h
$ quilt refresh --sort
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pnp.h | 363 | ||||
-rw-r--r-- | include/linux/pnpbios.h | 62 |
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 @@ | |||
23 | struct pnp_protocol; | 23 | struct pnp_protocol; |
24 | struct pnp_dev; | 24 | struct 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 | ||
75 | struct pnp_port { | 74 | struct 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 |
86 | struct pnp_irq { | 85 | struct 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 | ||
93 | struct pnp_dma { | 92 | struct 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 | ||
99 | struct pnp_mem { | 98 | struct 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 | ||
114 | struct pnp_option { | 113 | struct 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 | ||
135 | struct pnp_card { | 133 | struct 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 | ||
161 | struct pnp_card_link { | 159 | struct 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 | ||
168 | static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) | 166 | static 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 | ||
173 | static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) | 171 | static 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 | ||
178 | struct pnp_dev { | 176 | struct 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 | ||
223 | static inline void *pnp_get_drvdata (struct pnp_dev *pdev) | 221 | static 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 | ||
228 | static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) | 226 | static 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 | ||
233 | struct pnp_fixup { | 231 | struct 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 | ||
288 | struct pnp_id { | 285 | struct 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 | ||
293 | struct pnp_driver { | 290 | struct 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 | ||
306 | struct pnp_card_driver { | 304 | struct 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 | ||
329 | struct pnp_protocol { | 327 | struct 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 | |||
360 | extern struct bus_type pnp_bus_type; | 357 | extern 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); | |||
376 | int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); | 373 | int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); |
377 | void pnp_remove_card_device(struct pnp_dev *dev); | 374 | void pnp_remove_card_device(struct pnp_dev *dev); |
378 | int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); | 375 | int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); |
379 | struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); | 376 | struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, |
380 | void pnp_release_card_device(struct pnp_dev * dev); | 377 | const char *id, struct pnp_dev *from); |
381 | int pnp_register_card_driver(struct pnp_card_driver * drv); | 378 | void pnp_release_card_device(struct pnp_dev *dev); |
382 | void pnp_unregister_card_driver(struct pnp_card_driver * drv); | 379 | int pnp_register_card_driver(struct pnp_card_driver *drv); |
380 | void pnp_unregister_card_driver(struct pnp_card_driver *drv); | ||
383 | extern struct list_head pnp_cards; | 381 | extern struct list_head pnp_cards; |
384 | 382 | ||
385 | /* resource management */ | 383 | /* resource management */ |
386 | struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); | 384 | struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev); |
387 | struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); | 385 | struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, |
386 | int priority); | ||
388 | int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); | 387 | int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); |
389 | int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); | 388 | int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); |
390 | int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); | 389 | int pnp_register_port_resource(struct pnp_option *option, |
390 | struct pnp_port *data); | ||
391 | int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); | 391 | int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); |
392 | void pnp_init_resource_table(struct pnp_resource_table *table); | 392 | void pnp_init_resource_table(struct pnp_resource_table *table); |
393 | int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); | 393 | int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, |
394 | int mode); | ||
394 | int pnp_auto_config_dev(struct pnp_dev *dev); | 395 | int pnp_auto_config_dev(struct pnp_dev *dev); |
395 | int pnp_validate_config(struct pnp_dev *dev); | 396 | int pnp_validate_config(struct pnp_dev *dev); |
396 | int pnp_start_dev(struct pnp_dev *dev); | 397 | int pnp_start_dev(struct pnp_dev *dev); |
@@ -398,11 +399,11 @@ int pnp_stop_dev(struct pnp_dev *dev); | |||
398 | int pnp_activate_dev(struct pnp_dev *dev); | 399 | int pnp_activate_dev(struct pnp_dev *dev); |
399 | int pnp_disable_dev(struct pnp_dev *dev); | 400 | int pnp_disable_dev(struct pnp_dev *dev); |
400 | void pnp_resource_change(struct resource *resource, resource_size_t start, | 401 | void 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 */ |
404 | int pnp_is_active(struct pnp_dev * dev); | 405 | int pnp_is_active(struct pnp_dev *dev); |
405 | int compare_pnp_id(struct pnp_id * pos, const char * id); | 406 | int compare_pnp_id(struct pnp_id *pos, const char *id); |
406 | int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); | 407 | int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); |
407 | int pnp_register_driver(struct pnp_driver *drv); | 408 | int pnp_register_driver(struct pnp_driver *drv); |
408 | void pnp_unregister_driver(struct pnp_driver *drv); | 409 | void 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 */ |
413 | static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return -ENODEV; } | 414 | static inline int pnp_register_protocol(struct pnp_protocol *protocol) |
414 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } | 415 | { |
415 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } | 416 | return -ENODEV; |
416 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } | 417 | } |
417 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } | 418 | static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) |
418 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } | 419 | { |
420 | } | ||
421 | static inline int pnp_init_device(struct pnp_dev *dev) | ||
422 | { | ||
423 | return -ENODEV; | ||
424 | } | ||
425 | static inline int pnp_add_device(struct pnp_dev *dev) | ||
426 | { | ||
427 | return -ENODEV; | ||
428 | } | ||
429 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) | ||
430 | { | ||
431 | return -ENODEV; | ||
432 | } | ||
433 | static 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 */ |
422 | static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } | 440 | static inline int pnp_add_card(struct pnp_card *card) |
423 | static inline void pnp_remove_card(struct pnp_card *card) { ; } | 441 | { |
424 | static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } | 442 | return -ENODEV; |
425 | static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } | 443 | } |
426 | static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } | 444 | static inline void pnp_remove_card(struct pnp_card *card) |
427 | static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } | 445 | {; |
428 | static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } | 446 | } |
429 | static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } | 447 | static inline int pnp_add_card_device(struct pnp_card *card, |
430 | static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } | 448 | struct pnp_dev *dev) |
449 | { | ||
450 | return -ENODEV; | ||
451 | } | ||
452 | static inline void pnp_remove_card_device(struct pnp_dev *dev) | ||
453 | {; | ||
454 | } | ||
455 | static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) | ||
456 | { | ||
457 | return -ENODEV; | ||
458 | } | ||
459 | static 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 | } | ||
465 | static inline void pnp_release_card_device(struct pnp_dev *dev) | ||
466 | {; | ||
467 | } | ||
468 | static inline int pnp_register_card_driver(struct pnp_card_driver *drv) | ||
469 | { | ||
470 | return -ENODEV; | ||
471 | } | ||
472 | static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) | ||
473 | {; | ||
474 | } | ||
431 | 475 | ||
432 | /* resource management */ | 476 | /* resource management */ |
433 | static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } | 477 | static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev |
434 | static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } | 478 | *dev) |
435 | static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } | 479 | { |
436 | static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } | 480 | return NULL; |
437 | static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } | 481 | } |
438 | static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; } | 482 | static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev |
439 | static inline void pnp_init_resource_table(struct pnp_resource_table *table) { } | 483 | *dev, |
440 | static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; } | 484 | int priority) |
441 | static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } | 485 | { |
442 | static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; } | 486 | return NULL; |
443 | static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | 487 | } |
444 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 488 | static inline int pnp_register_irq_resource(struct pnp_option *option, |
445 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 489 | struct pnp_irq *data) |
446 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 490 | { |
491 | return -ENODEV; | ||
492 | } | ||
493 | static inline int pnp_register_dma_resource(struct pnp_option *option, | ||
494 | struct pnp_dma *data) | ||
495 | { | ||
496 | return -ENODEV; | ||
497 | } | ||
498 | static inline int pnp_register_port_resource(struct pnp_option *option, | ||
499 | struct pnp_port *data) | ||
500 | { | ||
501 | return -ENODEV; | ||
502 | } | ||
503 | static inline int pnp_register_mem_resource(struct pnp_option *option, | ||
504 | struct pnp_mem *data) | ||
505 | { | ||
506 | return -ENODEV; | ||
507 | } | ||
508 | static inline void pnp_init_resource_table(struct pnp_resource_table *table) | ||
509 | { | ||
510 | } | ||
511 | static inline int pnp_manual_config_dev(struct pnp_dev *dev, | ||
512 | struct pnp_resource_table *res, | ||
513 | int mode) | ||
514 | { | ||
515 | return -ENODEV; | ||
516 | } | ||
517 | static inline int pnp_auto_config_dev(struct pnp_dev *dev) | ||
518 | { | ||
519 | return -ENODEV; | ||
520 | } | ||
521 | static inline int pnp_validate_config(struct pnp_dev *dev) | ||
522 | { | ||
523 | return -ENODEV; | ||
524 | } | ||
525 | static inline int pnp_start_dev(struct pnp_dev *dev) | ||
526 | { | ||
527 | return -ENODEV; | ||
528 | } | ||
529 | static inline int pnp_stop_dev(struct pnp_dev *dev) | ||
530 | { | ||
531 | return -ENODEV; | ||
532 | } | ||
533 | static inline int pnp_activate_dev(struct pnp_dev *dev) | ||
534 | { | ||
535 | return -ENODEV; | ||
536 | } | ||
537 | static inline int pnp_disable_dev(struct pnp_dev *dev) | ||
538 | { | ||
539 | return -ENODEV; | ||
540 | } | ||
447 | static inline void pnp_resource_change(struct resource *resource, | 541 | static 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 */ |
452 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } | 548 | static inline int pnp_is_active(struct pnp_dev *dev) |
453 | static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } | 549 | { |
454 | static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } | 550 | return 0; |
455 | static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } | 551 | } |
456 | static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } | 552 | static inline int compare_pnp_id(struct pnp_id *pos, const char *id) |
553 | { | ||
554 | return -ENODEV; | ||
555 | } | ||
556 | static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) | ||
557 | { | ||
558 | return -ENODEV; | ||
559 | } | ||
560 | static inline int pnp_register_driver(struct pnp_driver *drv) | ||
561 | { | ||
562 | return -ENODEV; | ||
563 | } | ||
564 | static 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) |
101 | struct pnp_dev_node_info { | 101 | struct pnp_dev_node_info { |
102 | __u16 no_nodes; | 102 | __u16 no_nodes; |
103 | __u16 max_node_size; | 103 | __u16 max_node_size; |
104 | }; | 104 | }; |
105 | struct pnp_docking_station_info { | 105 | struct 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 | }; |
110 | struct pnp_isa_config_struc { | 110 | struct 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 | }; |
116 | struct escd_info_struc { | 116 | struct 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 | }; |
121 | struct pnp_bios_node { | 121 | struct 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 */ |
134 | extern struct pnp_dev_node_info node_info; | 134 | extern struct pnp_dev_node_info node_info; |
135 | 135 | ||
136 | extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); | 136 | extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data); |
137 | extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); | 137 | extern int pnp_bios_get_dev_node(u8 * nodenum, char config, |
138 | extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); | 138 | struct pnp_bios_node *data); |
139 | extern int pnp_bios_get_stat_res (char *info); | 139 | extern int pnp_bios_set_dev_node(u8 nodenum, char config, |
140 | extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); | 140 | struct pnp_bios_node *data); |
141 | extern int pnp_bios_escd_info (struct escd_info_struc *data); | 141 | extern int pnp_bios_get_stat_res(char *info); |
142 | extern int pnp_bios_read_escd (char *data, u32 nvram_base); | 142 | extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data); |
143 | extern int pnp_bios_escd_info(struct escd_info_struc *data); | ||
144 | extern int pnp_bios_read_escd(char *data, u32 nvram_base); | ||
143 | extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); | 145 | extern 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 |
146 | extern int pnp_bios_get_event (u16 *message); | 148 | extern int pnp_bios_get_event(u16 * message); |
147 | extern int pnp_bios_send_message (u16 message); | 149 | extern int pnp_bios_send_message(u16 message); |
148 | extern int pnp_bios_set_stat_res (char *info); | 150 | extern int pnp_bios_set_stat_res(char *info); |
149 | extern int pnp_bios_apm_id_table (char *table, u16 *size); | 151 | extern int pnp_bios_apm_id_table(char *table, u16 * size); |
150 | extern int pnp_bios_write_escd (char *data, u32 nvram_base); | 152 | extern int pnp_bios_write_escd(char *data, u32 nvram_base); |
151 | #endif | 153 | #endif |
152 | 154 | ||
153 | #endif /* CONFIG_PNPBIOS */ | 155 | #endif /* CONFIG_PNPBIOS */ |