diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:04 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:20 -0400 |
commit | c1caf06ccfd3a4efd4b489f89bcdabd2362f31d0 (patch) | |
tree | 5571b9dc1b4b66c72ad64a406602d23112446f3e /drivers/pnp/pnpbios/rsparser.c | |
parent | cdef6254e17e98f1071ce1bfc8f2a87997c855d0 (diff) |
PNP: add debug output to option registration
Add debug output to resource option registration functions (enabled
by CONFIG_PNP_DEBUG). This uses dev_printk, so I had to add pnp_dev
arguments at the same time.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/pnpbios/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index 948a661280d7..70aa559b3f8c 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -263,7 +263,8 @@ len_err: | |||
263 | * Resource Configuration Options | 263 | * Resource Configuration Options |
264 | */ | 264 | */ |
265 | 265 | ||
266 | static __init void pnpbios_parse_mem_option(unsigned char *p, int size, | 266 | static __init void pnpbios_parse_mem_option(struct pnp_dev *dev, |
267 | unsigned char *p, int size, | ||
267 | struct pnp_option *option) | 268 | struct pnp_option *option) |
268 | { | 269 | { |
269 | struct pnp_mem *mem; | 270 | struct pnp_mem *mem; |
@@ -276,10 +277,11 @@ static __init void pnpbios_parse_mem_option(unsigned char *p, int size, | |||
276 | mem->align = (p[9] << 8) | p[8]; | 277 | mem->align = (p[9] << 8) | p[8]; |
277 | mem->size = ((p[11] << 8) | p[10]) << 8; | 278 | mem->size = ((p[11] << 8) | p[10]) << 8; |
278 | mem->flags = p[3]; | 279 | mem->flags = p[3]; |
279 | pnp_register_mem_resource(option, mem); | 280 | pnp_register_mem_resource(dev, option, mem); |
280 | } | 281 | } |
281 | 282 | ||
282 | static __init void pnpbios_parse_mem32_option(unsigned char *p, int size, | 283 | static __init void pnpbios_parse_mem32_option(struct pnp_dev *dev, |
284 | unsigned char *p, int size, | ||
283 | struct pnp_option *option) | 285 | struct pnp_option *option) |
284 | { | 286 | { |
285 | struct pnp_mem *mem; | 287 | struct pnp_mem *mem; |
@@ -292,10 +294,11 @@ static __init void pnpbios_parse_mem32_option(unsigned char *p, int size, | |||
292 | mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12]; | 294 | mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12]; |
293 | mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16]; | 295 | mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16]; |
294 | mem->flags = p[3]; | 296 | mem->flags = p[3]; |
295 | pnp_register_mem_resource(option, mem); | 297 | pnp_register_mem_resource(dev, option, mem); |
296 | } | 298 | } |
297 | 299 | ||
298 | static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, | 300 | static __init void pnpbios_parse_fixed_mem32_option(struct pnp_dev *dev, |
301 | unsigned char *p, int size, | ||
299 | struct pnp_option *option) | 302 | struct pnp_option *option) |
300 | { | 303 | { |
301 | struct pnp_mem *mem; | 304 | struct pnp_mem *mem; |
@@ -307,11 +310,12 @@ static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, | |||
307 | mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8]; | 310 | mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8]; |
308 | mem->align = 0; | 311 | mem->align = 0; |
309 | mem->flags = p[3]; | 312 | mem->flags = p[3]; |
310 | pnp_register_mem_resource(option, mem); | 313 | pnp_register_mem_resource(dev, option, mem); |
311 | } | 314 | } |
312 | 315 | ||
313 | static __init void pnpbios_parse_irq_option(unsigned char *p, int size, | 316 | static __init void pnpbios_parse_irq_option(struct pnp_dev *dev, |
314 | struct pnp_option *option) | 317 | unsigned char *p, int size, |
318 | struct pnp_option *option) | ||
315 | { | 319 | { |
316 | struct pnp_irq *irq; | 320 | struct pnp_irq *irq; |
317 | unsigned long bits; | 321 | unsigned long bits; |
@@ -325,11 +329,12 @@ static __init void pnpbios_parse_irq_option(unsigned char *p, int size, | |||
325 | irq->flags = p[3]; | 329 | irq->flags = p[3]; |
326 | else | 330 | else |
327 | irq->flags = IORESOURCE_IRQ_HIGHEDGE; | 331 | irq->flags = IORESOURCE_IRQ_HIGHEDGE; |
328 | pnp_register_irq_resource(option, irq); | 332 | pnp_register_irq_resource(dev, option, irq); |
329 | } | 333 | } |
330 | 334 | ||
331 | static __init void pnpbios_parse_dma_option(unsigned char *p, int size, | 335 | static __init void pnpbios_parse_dma_option(struct pnp_dev *dev, |
332 | struct pnp_option *option) | 336 | unsigned char *p, int size, |
337 | struct pnp_option *option) | ||
333 | { | 338 | { |
334 | struct pnp_dma *dma; | 339 | struct pnp_dma *dma; |
335 | 340 | ||
@@ -338,10 +343,11 @@ static __init void pnpbios_parse_dma_option(unsigned char *p, int size, | |||
338 | return; | 343 | return; |
339 | dma->map = p[1]; | 344 | dma->map = p[1]; |
340 | dma->flags = p[2]; | 345 | dma->flags = p[2]; |
341 | pnp_register_dma_resource(option, dma); | 346 | pnp_register_dma_resource(dev, option, dma); |
342 | } | 347 | } |
343 | 348 | ||
344 | static __init void pnpbios_parse_port_option(unsigned char *p, int size, | 349 | static __init void pnpbios_parse_port_option(struct pnp_dev *dev, |
350 | unsigned char *p, int size, | ||
345 | struct pnp_option *option) | 351 | struct pnp_option *option) |
346 | { | 352 | { |
347 | struct pnp_port *port; | 353 | struct pnp_port *port; |
@@ -354,10 +360,11 @@ static __init void pnpbios_parse_port_option(unsigned char *p, int size, | |||
354 | port->align = p[6]; | 360 | port->align = p[6]; |
355 | port->size = p[7]; | 361 | port->size = p[7]; |
356 | port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0; | 362 | port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0; |
357 | pnp_register_port_resource(option, port); | 363 | pnp_register_port_resource(dev, option, port); |
358 | } | 364 | } |
359 | 365 | ||
360 | static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size, | 366 | static __init void pnpbios_parse_fixed_port_option(struct pnp_dev *dev, |
367 | unsigned char *p, int size, | ||
361 | struct pnp_option *option) | 368 | struct pnp_option *option) |
362 | { | 369 | { |
363 | struct pnp_port *port; | 370 | struct pnp_port *port; |
@@ -369,7 +376,7 @@ static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size, | |||
369 | port->size = p[3]; | 376 | port->size = p[3]; |
370 | port->align = 0; | 377 | port->align = 0; |
371 | port->flags = PNP_PORT_FLAG_FIXED; | 378 | port->flags = PNP_PORT_FLAG_FIXED; |
372 | pnp_register_port_resource(option, port); | 379 | pnp_register_port_resource(dev, option, port); |
373 | } | 380 | } |
374 | 381 | ||
375 | static __init unsigned char * | 382 | static __init unsigned char * |
@@ -403,37 +410,37 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end, | |||
403 | case LARGE_TAG_MEM: | 410 | case LARGE_TAG_MEM: |
404 | if (len != 9) | 411 | if (len != 9) |
405 | goto len_err; | 412 | goto len_err; |
406 | pnpbios_parse_mem_option(p, len, option); | 413 | pnpbios_parse_mem_option(dev, p, len, option); |
407 | break; | 414 | break; |
408 | 415 | ||
409 | case LARGE_TAG_MEM32: | 416 | case LARGE_TAG_MEM32: |
410 | if (len != 17) | 417 | if (len != 17) |
411 | goto len_err; | 418 | goto len_err; |
412 | pnpbios_parse_mem32_option(p, len, option); | 419 | pnpbios_parse_mem32_option(dev, p, len, option); |
413 | break; | 420 | break; |
414 | 421 | ||
415 | case LARGE_TAG_FIXEDMEM32: | 422 | case LARGE_TAG_FIXEDMEM32: |
416 | if (len != 9) | 423 | if (len != 9) |
417 | goto len_err; | 424 | goto len_err; |
418 | pnpbios_parse_fixed_mem32_option(p, len, option); | 425 | pnpbios_parse_fixed_mem32_option(dev, p, len, option); |
419 | break; | 426 | break; |
420 | 427 | ||
421 | case SMALL_TAG_IRQ: | 428 | case SMALL_TAG_IRQ: |
422 | if (len < 2 || len > 3) | 429 | if (len < 2 || len > 3) |
423 | goto len_err; | 430 | goto len_err; |
424 | pnpbios_parse_irq_option(p, len, option); | 431 | pnpbios_parse_irq_option(dev, p, len, option); |
425 | break; | 432 | break; |
426 | 433 | ||
427 | case SMALL_TAG_DMA: | 434 | case SMALL_TAG_DMA: |
428 | if (len != 2) | 435 | if (len != 2) |
429 | goto len_err; | 436 | goto len_err; |
430 | pnpbios_parse_dma_option(p, len, option); | 437 | pnpbios_parse_dma_option(dev, p, len, option); |
431 | break; | 438 | break; |
432 | 439 | ||
433 | case SMALL_TAG_PORT: | 440 | case SMALL_TAG_PORT: |
434 | if (len != 7) | 441 | if (len != 7) |
435 | goto len_err; | 442 | goto len_err; |
436 | pnpbios_parse_port_option(p, len, option); | 443 | pnpbios_parse_port_option(dev, p, len, option); |
437 | break; | 444 | break; |
438 | 445 | ||
439 | case SMALL_TAG_VENDOR: | 446 | case SMALL_TAG_VENDOR: |
@@ -443,7 +450,7 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end, | |||
443 | case SMALL_TAG_FIXEDPORT: | 450 | case SMALL_TAG_FIXEDPORT: |
444 | if (len != 3) | 451 | if (len != 3) |
445 | goto len_err; | 452 | goto len_err; |
446 | pnpbios_parse_fixed_port_option(p, len, option); | 453 | pnpbios_parse_fixed_port_option(dev, p, len, option); |
447 | break; | 454 | break; |
448 | 455 | ||
449 | case SMALL_TAG_STARTDEP: | 456 | case SMALL_TAG_STARTDEP: |
@@ -464,6 +471,7 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end, | |||
464 | printk(KERN_WARNING | 471 | printk(KERN_WARNING |
465 | "PnPBIOS: Missing SMALL_TAG_STARTDEP tag\n"); | 472 | "PnPBIOS: Missing SMALL_TAG_STARTDEP tag\n"); |
466 | option = option_independent; | 473 | option = option_independent; |
474 | dev_dbg(&dev->dev, "end dependent options\n"); | ||
467 | break; | 475 | break; |
468 | 476 | ||
469 | case SMALL_TAG_END: | 477 | case SMALL_TAG_END: |