Commit 908ebfb9 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cfd8e12f
...@@ -563,9 +563,7 @@ static void ath_do_set_opmode(struct ath5k_softc *sc) ...@@ -563,9 +563,7 @@ static void ath_do_set_opmode(struct ath5k_softc *sc)
struct ath5k_hw *ah = sc->ah; struct ath5k_hw *ah = sc->ah;
ath5k_hw_set_opmode(ah, sc->opmode); ath5k_hw_set_opmode(ah, sc->opmode);
ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n", ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
sc->opmode, sc->opmode, ath_opmode_to_string(sc->opmode));
ath_opmode_to_string(sc->opmode) ?
ath_opmode_to_string(sc->opmode) : "UKNOWN");
} }
void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
......
...@@ -493,7 +493,6 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, ...@@ -493,7 +493,6 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
char buf[700]; char buf[700];
unsigned int len = 0; unsigned int len = 0;
u32 filt = ath5k_hw_get_rx_filter(sc->ah); u32 filt = ath5k_hw_get_rx_filter(sc->ah);
const char *tmp;
len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
sc->bssidmask); sc->bssidmask);
...@@ -522,17 +521,10 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, ...@@ -522,17 +521,10 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
if (filt & AR5K_RX_FILTER_PHYERR_5211) if (filt & AR5K_RX_FILTER_PHYERR_5211)
snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211"); snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211");
if (filt & AR5K_RX_FILTER_RADARERR_5211) if (filt & AR5K_RX_FILTER_RADARERR_5211)
len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n"); len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211");
else
len += snprintf(buf+len, sizeof(buf)-len, "\n"); len += snprintf(buf+len, sizeof(buf)-len, "\nopmode: %s (%d)\n",
ath_opmode_to_string(sc->opmode), sc->opmode);
tmp = ath_opmode_to_string(sc->opmode);
if (tmp)
len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
tmp);
else
len += snprintf(buf+len, sizeof(buf)-len,
"opmode: UNKNOWN-%i\n", sc->opmode);
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
......
...@@ -55,7 +55,7 @@ const char *ath_opmode_to_string(enum nl80211_iftype opmode) ...@@ -55,7 +55,7 @@ const char *ath_opmode_to_string(enum nl80211_iftype opmode)
case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_GO:
return "P2P-GO"; return "P2P-GO";
default: default:
return NULL; return "UNKNOWN";
} }
} }
EXPORT_SYMBOL(ath_opmode_to_string); EXPORT_SYMBOL(ath_opmode_to_string);
...@@ -78,6 +78,13 @@ ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...) ...@@ -78,6 +78,13 @@ ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
#endif /* CONFIG_ATH_DEBUG */ #endif /* CONFIG_ATH_DEBUG */
/** Returns string describing opmode, or NULL if unknown mode. */ /** Returns string describing opmode, or NULL if unknown mode. */
#ifdef CONFIG_ATH_DEBUG
const char *ath_opmode_to_string(enum nl80211_iftype opmode); const char *ath_opmode_to_string(enum nl80211_iftype opmode);
#else
static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
{
return "UNKNOWN";
}
#endif
#endif /* ATH_DEBUG_H */ #endif /* ATH_DEBUG_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment