diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-05-05 16:14:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-05 16:14:16 -0400 |
commit | 83163244f845c296a118ce85c653872dbff6abfe (patch) | |
tree | ce2eac695a1c198f23d537e20ed86c16ece21f7e /drivers/net/wireless/iwmc3200wifi | |
parent | 0a12761bcd5646691c5d16dd93df84d1b8849285 (diff) | |
parent | adfba3c7c026a6a5560d2a43fefc9b198cb74462 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
drivers/net/wireless/libertas_tf/cmd.c
drivers/net/wireless/libertas_tf/main.c
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/bus.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/debug.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/debugfs.c | 110 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/sdio.c | 17 |
4 files changed, 15 insertions, 121 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/bus.h b/drivers/net/wireless/iwmc3200wifi/bus.h index 836663eec257..62edd5888a7b 100644 --- a/drivers/net/wireless/iwmc3200wifi/bus.h +++ b/drivers/net/wireless/iwmc3200wifi/bus.h | |||
@@ -31,7 +31,7 @@ struct iwm_if_ops { | |||
31 | int (*disable)(struct iwm_priv *iwm); | 31 | int (*disable)(struct iwm_priv *iwm); |
32 | int (*send_chunk)(struct iwm_priv *iwm, u8* buf, int count); | 32 | int (*send_chunk)(struct iwm_priv *iwm, u8* buf, int count); |
33 | 33 | ||
34 | int (*debugfs_init)(struct iwm_priv *iwm, struct dentry *parent_dir); | 34 | void (*debugfs_init)(struct iwm_priv *iwm, struct dentry *parent_dir); |
35 | void (*debugfs_exit)(struct iwm_priv *iwm); | 35 | void (*debugfs_exit)(struct iwm_priv *iwm); |
36 | 36 | ||
37 | const char *umac_name; | 37 | const char *umac_name; |
diff --git a/drivers/net/wireless/iwmc3200wifi/debug.h b/drivers/net/wireless/iwmc3200wifi/debug.h index e35c9b693d1f..a0c13a49ab3c 100644 --- a/drivers/net/wireless/iwmc3200wifi/debug.h +++ b/drivers/net/wireless/iwmc3200wifi/debug.h | |||
@@ -113,13 +113,10 @@ struct iwm_debugfs { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | #ifdef CONFIG_IWM_DEBUG | 115 | #ifdef CONFIG_IWM_DEBUG |
116 | int iwm_debugfs_init(struct iwm_priv *iwm); | 116 | void iwm_debugfs_init(struct iwm_priv *iwm); |
117 | void iwm_debugfs_exit(struct iwm_priv *iwm); | 117 | void iwm_debugfs_exit(struct iwm_priv *iwm); |
118 | #else | 118 | #else |
119 | static inline int iwm_debugfs_init(struct iwm_priv *iwm) | 119 | static inline void iwm_debugfs_init(struct iwm_priv *iwm) {} |
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | static inline void iwm_debugfs_exit(struct iwm_priv *iwm) {} | 120 | static inline void iwm_debugfs_exit(struct iwm_priv *iwm) {} |
124 | #endif | 121 | #endif |
125 | 122 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c index 724441368a18..53b0b7711f02 100644 --- a/drivers/net/wireless/iwmc3200wifi/debugfs.c +++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c | |||
@@ -48,12 +48,11 @@ static struct { | |||
48 | 48 | ||
49 | #define add_dbg_module(dbg, name, id, initlevel) \ | 49 | #define add_dbg_module(dbg, name, id, initlevel) \ |
50 | do { \ | 50 | do { \ |
51 | struct dentry *d; \ | ||
52 | dbg.dbg_module[id] = (initlevel); \ | 51 | dbg.dbg_module[id] = (initlevel); \ |
53 | d = debugfs_create_x8(name, 0600, dbg.dbgdir, \ | 52 | dbg.dbg_module_dentries[id] = \ |
54 | &(dbg.dbg_module[id])); \ | 53 | debugfs_create_x8(name, 0600, \ |
55 | if (!IS_ERR(d)) \ | 54 | dbg.dbgdir, \ |
56 | dbg.dbg_module_dentries[id] = d; \ | 55 | &(dbg.dbg_module[id])); \ |
57 | } while (0) | 56 | } while (0) |
58 | 57 | ||
59 | static int iwm_debugfs_u32_read(void *data, u64 *val) | 58 | static int iwm_debugfs_u32_read(void *data, u64 *val) |
@@ -423,89 +422,29 @@ static const struct file_operations iwm_debugfs_fw_err_fops = { | |||
423 | .read = iwm_debugfs_fw_err_read, | 422 | .read = iwm_debugfs_fw_err_read, |
424 | }; | 423 | }; |
425 | 424 | ||
426 | int iwm_debugfs_init(struct iwm_priv *iwm) | 425 | void iwm_debugfs_init(struct iwm_priv *iwm) |
427 | { | 426 | { |
428 | int i, result; | 427 | int i; |
429 | char devdir[16]; | ||
430 | 428 | ||
431 | iwm->dbg.rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL); | 429 | iwm->dbg.rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL); |
432 | result = PTR_ERR(iwm->dbg.rootdir); | 430 | iwm->dbg.devdir = debugfs_create_dir(wiphy_name(iwm_to_wiphy(iwm)), |
433 | if (!result || IS_ERR(iwm->dbg.rootdir)) { | 431 | iwm->dbg.rootdir); |
434 | if (result == -ENODEV) { | ||
435 | IWM_ERR(iwm, "DebugFS (CONFIG_DEBUG_FS) not " | ||
436 | "enabled in kernel config\n"); | ||
437 | result = 0; /* No debugfs support */ | ||
438 | } | ||
439 | IWM_ERR(iwm, "Couldn't create rootdir: %d\n", result); | ||
440 | goto error; | ||
441 | } | ||
442 | |||
443 | snprintf(devdir, sizeof(devdir), "%s", wiphy_name(iwm_to_wiphy(iwm))); | ||
444 | |||
445 | iwm->dbg.devdir = debugfs_create_dir(devdir, iwm->dbg.rootdir); | ||
446 | result = PTR_ERR(iwm->dbg.devdir); | ||
447 | if (IS_ERR(iwm->dbg.devdir) && (result != -ENODEV)) { | ||
448 | IWM_ERR(iwm, "Couldn't create devdir: %d\n", result); | ||
449 | goto error; | ||
450 | } | ||
451 | |||
452 | iwm->dbg.dbgdir = debugfs_create_dir("debug", iwm->dbg.devdir); | 432 | iwm->dbg.dbgdir = debugfs_create_dir("debug", iwm->dbg.devdir); |
453 | result = PTR_ERR(iwm->dbg.dbgdir); | ||
454 | if (IS_ERR(iwm->dbg.dbgdir) && (result != -ENODEV)) { | ||
455 | IWM_ERR(iwm, "Couldn't create dbgdir: %d\n", result); | ||
456 | goto error; | ||
457 | } | ||
458 | |||
459 | iwm->dbg.rxdir = debugfs_create_dir("rx", iwm->dbg.devdir); | 433 | iwm->dbg.rxdir = debugfs_create_dir("rx", iwm->dbg.devdir); |
460 | result = PTR_ERR(iwm->dbg.rxdir); | ||
461 | if (IS_ERR(iwm->dbg.rxdir) && (result != -ENODEV)) { | ||
462 | IWM_ERR(iwm, "Couldn't create rx dir: %d\n", result); | ||
463 | goto error; | ||
464 | } | ||
465 | |||
466 | iwm->dbg.txdir = debugfs_create_dir("tx", iwm->dbg.devdir); | 434 | iwm->dbg.txdir = debugfs_create_dir("tx", iwm->dbg.devdir); |
467 | result = PTR_ERR(iwm->dbg.txdir); | ||
468 | if (IS_ERR(iwm->dbg.txdir) && (result != -ENODEV)) { | ||
469 | IWM_ERR(iwm, "Couldn't create tx dir: %d\n", result); | ||
470 | goto error; | ||
471 | } | ||
472 | |||
473 | iwm->dbg.busdir = debugfs_create_dir("bus", iwm->dbg.devdir); | 435 | iwm->dbg.busdir = debugfs_create_dir("bus", iwm->dbg.devdir); |
474 | result = PTR_ERR(iwm->dbg.busdir); | 436 | if (iwm->bus_ops->debugfs_init) |
475 | if (IS_ERR(iwm->dbg.busdir) && (result != -ENODEV)) { | 437 | iwm->bus_ops->debugfs_init(iwm, iwm->dbg.busdir); |
476 | IWM_ERR(iwm, "Couldn't create bus dir: %d\n", result); | ||
477 | goto error; | ||
478 | } | ||
479 | |||
480 | if (iwm->bus_ops->debugfs_init) { | ||
481 | result = iwm->bus_ops->debugfs_init(iwm, iwm->dbg.busdir); | ||
482 | if (result < 0) { | ||
483 | IWM_ERR(iwm, "Couldn't create bus entry: %d\n", result); | ||
484 | goto error; | ||
485 | } | ||
486 | } | ||
487 | |||
488 | 438 | ||
489 | iwm->dbg.dbg_level = IWM_DL_NONE; | 439 | iwm->dbg.dbg_level = IWM_DL_NONE; |
490 | iwm->dbg.dbg_level_dentry = | 440 | iwm->dbg.dbg_level_dentry = |
491 | debugfs_create_file("level", 0200, iwm->dbg.dbgdir, iwm, | 441 | debugfs_create_file("level", 0200, iwm->dbg.dbgdir, iwm, |
492 | &fops_iwm_dbg_level); | 442 | &fops_iwm_dbg_level); |
493 | result = PTR_ERR(iwm->dbg.dbg_level_dentry); | ||
494 | if (IS_ERR(iwm->dbg.dbg_level_dentry) && (result != -ENODEV)) { | ||
495 | IWM_ERR(iwm, "Couldn't create dbg_level: %d\n", result); | ||
496 | goto error; | ||
497 | } | ||
498 | |||
499 | 443 | ||
500 | iwm->dbg.dbg_modules = IWM_DM_DEFAULT; | 444 | iwm->dbg.dbg_modules = IWM_DM_DEFAULT; |
501 | iwm->dbg.dbg_modules_dentry = | 445 | iwm->dbg.dbg_modules_dentry = |
502 | debugfs_create_file("modules", 0200, iwm->dbg.dbgdir, iwm, | 446 | debugfs_create_file("modules", 0200, iwm->dbg.dbgdir, iwm, |
503 | &fops_iwm_dbg_modules); | 447 | &fops_iwm_dbg_modules); |
504 | result = PTR_ERR(iwm->dbg.dbg_modules_dentry); | ||
505 | if (IS_ERR(iwm->dbg.dbg_modules_dentry) && (result != -ENODEV)) { | ||
506 | IWM_ERR(iwm, "Couldn't create dbg_modules: %d\n", result); | ||
507 | goto error; | ||
508 | } | ||
509 | 448 | ||
510 | for (i = 0; i < __IWM_DM_NR; i++) | 449 | for (i = 0; i < __IWM_DM_NR; i++) |
511 | add_dbg_module(iwm->dbg, iwm_debug_module[i].name, | 450 | add_dbg_module(iwm->dbg, iwm_debug_module[i].name, |
@@ -514,44 +453,15 @@ int iwm_debugfs_init(struct iwm_priv *iwm) | |||
514 | iwm->dbg.txq_dentry = debugfs_create_file("queues", 0200, | 453 | iwm->dbg.txq_dentry = debugfs_create_file("queues", 0200, |
515 | iwm->dbg.txdir, iwm, | 454 | iwm->dbg.txdir, iwm, |
516 | &iwm_debugfs_txq_fops); | 455 | &iwm_debugfs_txq_fops); |
517 | result = PTR_ERR(iwm->dbg.txq_dentry); | ||
518 | if (IS_ERR(iwm->dbg.txq_dentry) && (result != -ENODEV)) { | ||
519 | IWM_ERR(iwm, "Couldn't create tx queue: %d\n", result); | ||
520 | goto error; | ||
521 | } | ||
522 | |||
523 | iwm->dbg.tx_credit_dentry = debugfs_create_file("credits", 0200, | 456 | iwm->dbg.tx_credit_dentry = debugfs_create_file("credits", 0200, |
524 | iwm->dbg.txdir, iwm, | 457 | iwm->dbg.txdir, iwm, |
525 | &iwm_debugfs_tx_credit_fops); | 458 | &iwm_debugfs_tx_credit_fops); |
526 | result = PTR_ERR(iwm->dbg.tx_credit_dentry); | ||
527 | if (IS_ERR(iwm->dbg.tx_credit_dentry) && (result != -ENODEV)) { | ||
528 | IWM_ERR(iwm, "Couldn't create tx credit: %d\n", result); | ||
529 | goto error; | ||
530 | } | ||
531 | |||
532 | iwm->dbg.rx_ticket_dentry = debugfs_create_file("tickets", 0200, | 459 | iwm->dbg.rx_ticket_dentry = debugfs_create_file("tickets", 0200, |
533 | iwm->dbg.rxdir, iwm, | 460 | iwm->dbg.rxdir, iwm, |
534 | &iwm_debugfs_rx_ticket_fops); | 461 | &iwm_debugfs_rx_ticket_fops); |
535 | result = PTR_ERR(iwm->dbg.rx_ticket_dentry); | ||
536 | if (IS_ERR(iwm->dbg.rx_ticket_dentry) && (result != -ENODEV)) { | ||
537 | IWM_ERR(iwm, "Couldn't create rx ticket: %d\n", result); | ||
538 | goto error; | ||
539 | } | ||
540 | |||
541 | iwm->dbg.fw_err_dentry = debugfs_create_file("last_fw_err", 0200, | 462 | iwm->dbg.fw_err_dentry = debugfs_create_file("last_fw_err", 0200, |
542 | iwm->dbg.dbgdir, iwm, | 463 | iwm->dbg.dbgdir, iwm, |
543 | &iwm_debugfs_fw_err_fops); | 464 | &iwm_debugfs_fw_err_fops); |
544 | result = PTR_ERR(iwm->dbg.fw_err_dentry); | ||
545 | if (IS_ERR(iwm->dbg.fw_err_dentry) && (result != -ENODEV)) { | ||
546 | IWM_ERR(iwm, "Couldn't create last FW err: %d\n", result); | ||
547 | goto error; | ||
548 | } | ||
549 | |||
550 | |||
551 | return 0; | ||
552 | |||
553 | error: | ||
554 | return result; | ||
555 | } | 465 | } |
556 | 466 | ||
557 | void iwm_debugfs_exit(struct iwm_priv *iwm) | 467 | void iwm_debugfs_exit(struct iwm_priv *iwm) |
diff --git a/drivers/net/wireless/iwmc3200wifi/sdio.c b/drivers/net/wireless/iwmc3200wifi/sdio.c index 1eafd6dec3fd..1acea37f39f8 100644 --- a/drivers/net/wireless/iwmc3200wifi/sdio.c +++ b/drivers/net/wireless/iwmc3200wifi/sdio.c | |||
@@ -366,21 +366,13 @@ static const struct file_operations iwm_debugfs_sdio_fops = { | |||
366 | .read = iwm_debugfs_sdio_read, | 366 | .read = iwm_debugfs_sdio_read, |
367 | }; | 367 | }; |
368 | 368 | ||
369 | static int if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir) | 369 | static void if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir) |
370 | { | 370 | { |
371 | int result; | ||
372 | struct iwm_sdio_priv *hw = iwm_to_if_sdio(iwm); | 371 | struct iwm_sdio_priv *hw = iwm_to_if_sdio(iwm); |
373 | 372 | ||
374 | hw->cccr_dentry = debugfs_create_file("cccr", 0200, | 373 | hw->cccr_dentry = debugfs_create_file("cccr", 0200, |
375 | parent_dir, iwm, | 374 | parent_dir, iwm, |
376 | &iwm_debugfs_sdio_fops); | 375 | &iwm_debugfs_sdio_fops); |
377 | result = PTR_ERR(hw->cccr_dentry); | ||
378 | if (IS_ERR(hw->cccr_dentry) && (result != -ENODEV)) { | ||
379 | IWM_ERR(iwm, "Couldn't create CCCR entry: %d\n", result); | ||
380 | return result; | ||
381 | } | ||
382 | |||
383 | return 0; | ||
384 | } | 376 | } |
385 | 377 | ||
386 | static void if_sdio_debugfs_exit(struct iwm_priv *iwm) | 378 | static void if_sdio_debugfs_exit(struct iwm_priv *iwm) |
@@ -440,11 +432,7 @@ static int iwm_sdio_probe(struct sdio_func *func, | |||
440 | hw = iwm_private(iwm); | 432 | hw = iwm_private(iwm); |
441 | hw->iwm = iwm; | 433 | hw->iwm = iwm; |
442 | 434 | ||
443 | ret = iwm_debugfs_init(iwm); | 435 | iwm_debugfs_init(iwm); |
444 | if (ret < 0) { | ||
445 | IWM_ERR(iwm, "Debugfs registration failed\n"); | ||
446 | goto if_free; | ||
447 | } | ||
448 | 436 | ||
449 | sdio_set_drvdata(func, hw); | 437 | sdio_set_drvdata(func, hw); |
450 | 438 | ||
@@ -473,7 +461,6 @@ static int iwm_sdio_probe(struct sdio_func *func, | |||
473 | destroy_workqueue(hw->isr_wq); | 461 | destroy_workqueue(hw->isr_wq); |
474 | debugfs_exit: | 462 | debugfs_exit: |
475 | iwm_debugfs_exit(iwm); | 463 | iwm_debugfs_exit(iwm); |
476 | if_free: | ||
477 | iwm_if_free(iwm); | 464 | iwm_if_free(iwm); |
478 | return ret; | 465 | return ret; |
479 | } | 466 | } |