diff options
author | Ben Greear <greearb@candelatech.com> | 2011-01-31 13:37:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-03 16:44:43 -0500 |
commit | 4e6975f7b8ca31febaa94a1ee1acfb5322f8a82b (patch) | |
tree | d29eae089e50a79f0b8658746c58426dea418444 /drivers/net/wireless/ath | |
parent | 4c89fe954d929781126af41691fba1bc670293a5 (diff) |
ath9k: Show channel type and frequency in debugfs.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 9cdc41b0ec44..5cfcf8c235a4 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -381,21 +381,40 @@ static const struct file_operations fops_interrupt = { | |||
381 | .llseek = default_llseek, | 381 | .llseek = default_llseek, |
382 | }; | 382 | }; |
383 | 383 | ||
384 | static const char *channel_type_str(enum nl80211_channel_type t) | ||
385 | { | ||
386 | switch (t) { | ||
387 | case NL80211_CHAN_NO_HT: | ||
388 | return "no ht"; | ||
389 | case NL80211_CHAN_HT20: | ||
390 | return "ht20"; | ||
391 | case NL80211_CHAN_HT40MINUS: | ||
392 | return "ht40-"; | ||
393 | case NL80211_CHAN_HT40PLUS: | ||
394 | return "ht40+"; | ||
395 | default: | ||
396 | return "???"; | ||
397 | } | ||
398 | } | ||
399 | |||
384 | static ssize_t read_file_wiphy(struct file *file, char __user *user_buf, | 400 | static ssize_t read_file_wiphy(struct file *file, char __user *user_buf, |
385 | size_t count, loff_t *ppos) | 401 | size_t count, loff_t *ppos) |
386 | { | 402 | { |
387 | struct ath_softc *sc = file->private_data; | 403 | struct ath_softc *sc = file->private_data; |
388 | struct ieee80211_channel *chan = sc->hw->conf.channel; | 404 | struct ieee80211_channel *chan = sc->hw->conf.channel; |
405 | struct ieee80211_conf *conf = &(sc->hw->conf); | ||
389 | char buf[512]; | 406 | char buf[512]; |
390 | unsigned int len = 0; | 407 | unsigned int len = 0; |
391 | u8 addr[ETH_ALEN]; | 408 | u8 addr[ETH_ALEN]; |
392 | u32 tmp; | 409 | u32 tmp; |
393 | 410 | ||
394 | len += snprintf(buf + len, sizeof(buf) - len, | 411 | len += snprintf(buf + len, sizeof(buf) - len, |
395 | "%s (chan=%d ht=%d)\n", | 412 | "%s (chan=%d center-freq: %d MHz channel-type: %d (%s))\n", |
396 | wiphy_name(sc->hw->wiphy), | 413 | wiphy_name(sc->hw->wiphy), |
397 | ieee80211_frequency_to_channel(chan->center_freq), | 414 | ieee80211_frequency_to_channel(chan->center_freq), |
398 | conf_is_ht(&sc->hw->conf)); | 415 | chan->center_freq, |
416 | conf->channel_type, | ||
417 | channel_type_str(conf->channel_type)); | ||
399 | 418 | ||
400 | put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr); | 419 | put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr); |
401 | put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4); | 420 | put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4); |