diff options
author | Xinming Hu <huxm@marvell.com> | 2014-12-23 19:14:07 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-06 20:54:11 +0200 |
commit | cbf6e05527a7654ac1c4f4787dfd7a182fcc0c73 (patch) | |
tree | b4c5415b1a99372cd00395b3c09e38262f39e18c /drivers/net/wireless/mwifiex/cfp.c | |
parent | d35b6392281f3368c8d31be7ce4356ecf6580605 (diff) | |
download | lwn-cbf6e05527a7654ac1c4f4787dfd7a182fcc0c73.tar.gz lwn-cbf6e05527a7654ac1c4f4787dfd7a182fcc0c73.zip |
mwifiex: add rx histogram statistics support
This patch add a new debugfs item histogram used for reporting
rx data packet statitics(rx rate, snr, noise floor, signal strenth)
to userspace.
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfp.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c index b8242eb2be6f..f494fc7eeb62 100644 --- a/drivers/net/wireless/mwifiex/cfp.c +++ b/drivers/net/wireless/mwifiex/cfp.c @@ -509,3 +509,21 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates) return k; } + +u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv, + u8 rx_rate, u8 rate_info) +{ + u8 rate_index = 0; + + /* HT40 */ + if ((rate_info & BIT(0)) && (rate_info & BIT(1))) + rate_index = MWIFIEX_RATE_INDEX_MCS0 + + MWIFIEX_BW20_MCS_NUM + rx_rate; + else if (rate_info & BIT(0)) /* HT20 */ + rate_index = MWIFIEX_RATE_INDEX_MCS0 + rx_rate; + else + rate_index = (rx_rate > MWIFIEX_RATE_INDEX_OFDM0) ? + rx_rate - 1 : rx_rate; + + return rate_index; +} |