Skip to content

Commit

Permalink
mac80211: only bother printing highest data rate on debugfs if its set
Browse files Browse the repository at this point in the history
IEEE-802.11n spec says the RX highest data rate field does
not specify the highest supported RX data rate if its not set.
Ignore it if not set then. Refer to section 7.3.56.4

Cc: johannes@sipsolutions.net
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Dec 22, 2009
1 parent 7db94e2 commit 9da3e06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,10 @@ struct ieee80211_bar {
/**
* struct ieee80211_mcs_info - MCS information
* @rx_mask: RX mask
* @rx_highest: highest supported RX rate
* @rx_highest: highest supported RX rate. If set represents
* the highest supported RX data rate in units of 1 Mbps.
* If this field is 0 this value should not be used to
* consider the highest RX data rate supported.
* @tx_params: TX parameters
*/
struct ieee80211_mcs_info {
Expand Down
12 changes: 10 additions & 2 deletions net/mac80211/debugfs_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,19 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n",
htc->ampdu_factor, htc->ampdu_density);
p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:");

for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++)
p += scnprintf(p, sizeof(buf)+buf-p, " %.2x",
htc->mcs.rx_mask[i]);
p += scnprintf(p, sizeof(buf)+buf-p, "\nMCS rx highest: %d\n",
le16_to_cpu(htc->mcs.rx_highest));
p += scnprintf(p, sizeof(buf)+buf-p, "\n");

/* If not set this is meaningless */
if (le16_to_cpu(htc->mcs.rx_highest)) {
p += scnprintf(p, sizeof(buf)+buf-p,
"MCS rx highest: %d Mbps\n",
le16_to_cpu(htc->mcs.rx_highest));
}

p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n",
htc->mcs.tx_params);
}
Expand Down

0 comments on commit 9da3e06

Please sign in to comment.