aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-10-12 14:07:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-12 16:05:30 -0400
commit908ebfb95d16bdf7f5f37ad911ccd9b7350ba780 (patch)
tree4a11c71816c2c545e8beabc4cc5c64d713d4f83e
parentcfd8e12f42746df396ecbdf7a1d8e92e8e4dbb97 (diff)
ath5k: fix build break from "ath5k: Print out opmode in debugfs"
Also improve ath_opmode_to_string usage by having it return UNKNOWN rather than NULL in the event of failure to map the opmode value to a representative string. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c16
-rw-r--r--drivers/net/wireless/ath/debug.c2
-rw-r--r--drivers/net/wireless/ath/debug.h7
4 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c9732a6ce87f..7baaf04f092d 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -563,9 +563,7 @@ static void ath_do_set_opmode(struct ath5k_softc *sc)
563 struct ath5k_hw *ah = sc->ah; 563 struct ath5k_hw *ah = sc->ah;
564 ath5k_hw_set_opmode(ah, sc->opmode); 564 ath5k_hw_set_opmode(ah, sc->opmode);
565 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n", 565 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
566 sc->opmode, 566 sc->opmode, ath_opmode_to_string(sc->opmode));
567 ath_opmode_to_string(sc->opmode) ?
568 ath_opmode_to_string(sc->opmode) : "UKNOWN");
569} 567}
570 568
571void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, 569void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index a3b217125331..7c77e5b7c9af 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -493,7 +493,6 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
493 char buf[700]; 493 char buf[700];
494 unsigned int len = 0; 494 unsigned int len = 0;
495 u32 filt = ath5k_hw_get_rx_filter(sc->ah); 495 u32 filt = ath5k_hw_get_rx_filter(sc->ah);
496 const char *tmp;
497 496
498 len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", 497 len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
499 sc->bssidmask); 498 sc->bssidmask);
@@ -522,17 +521,10 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
522 if (filt & AR5K_RX_FILTER_PHYERR_5211) 521 if (filt & AR5K_RX_FILTER_PHYERR_5211)
523 snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211"); 522 snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211");
524 if (filt & AR5K_RX_FILTER_RADARERR_5211) 523 if (filt & AR5K_RX_FILTER_RADARERR_5211)
525 len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n"); 524 len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211");
526 else 525
527 len += snprintf(buf+len, sizeof(buf)-len, "\n"); 526 len += snprintf(buf+len, sizeof(buf)-len, "\nopmode: %s (%d)\n",
528 527 ath_opmode_to_string(sc->opmode), sc->opmode);
529 tmp = ath_opmode_to_string(sc->opmode);
530 if (tmp)
531 len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
532 tmp);
533 else
534 len += snprintf(buf+len, sizeof(buf)-len,
535 "opmode: UNKNOWN-%i\n", sc->opmode);
536 528
537 if (len > sizeof(buf)) 529 if (len > sizeof(buf))
538 len = sizeof(buf); 530 len = sizeof(buf);
diff --git a/drivers/net/wireless/ath/debug.c b/drivers/net/wireless/ath/debug.c
index a9eb7876dbe1..dacfb234f491 100644
--- a/drivers/net/wireless/ath/debug.c
+++ b/drivers/net/wireless/ath/debug.c
@@ -55,7 +55,7 @@ const char *ath_opmode_to_string(enum nl80211_iftype opmode)
55 case NL80211_IFTYPE_P2P_GO: 55 case NL80211_IFTYPE_P2P_GO:
56 return "P2P-GO"; 56 return "P2P-GO";
57 default: 57 default:
58 return NULL; 58 return "UNKNOWN";
59 } 59 }
60} 60}
61EXPORT_SYMBOL(ath_opmode_to_string); 61EXPORT_SYMBOL(ath_opmode_to_string);
diff --git a/drivers/net/wireless/ath/debug.h b/drivers/net/wireless/ath/debug.h
index a3a5a628d24d..64e4af2c2887 100644
--- a/drivers/net/wireless/ath/debug.h
+++ b/drivers/net/wireless/ath/debug.h
@@ -78,6 +78,13 @@ ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
78#endif /* CONFIG_ATH_DEBUG */ 78#endif /* CONFIG_ATH_DEBUG */
79 79
80/** Returns string describing opmode, or NULL if unknown mode. */ 80/** Returns string describing opmode, or NULL if unknown mode. */
81#ifdef CONFIG_ATH_DEBUG
81const char *ath_opmode_to_string(enum nl80211_iftype opmode); 82const char *ath_opmode_to_string(enum nl80211_iftype opmode);
83#else
84static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
85{
86 return "UNKNOWN";
87}
88#endif
82 89
83#endif /* ATH_DEBUG_H */ 90#endif /* ATH_DEBUG_H */