diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-01-15 10:14:02 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-01-15 16:41:32 -0500 |
commit | b51f3beecfbbfc946749a91fb444cb8917cf444f (patch) | |
tree | 68ecd024ca26b392b48599dc3725e4416d053d1f /drivers/net/wireless | |
parent | 97d910d0aaa619ca530d08e2b1125b8014ccb030 (diff) |
cfg80211: change bandwidth reporting to explicit field
For some reason, we made the bandwidth separate flags, which
is rather confusing - a single rate cannot have different
bandwidths at the same time.
Change this to no longer be flags but use a separate field
for the bandwidth ('bw') instead.
While at it, add support for 5 and 10 MHz rates - these are
reported as regular legacy rates with their real bitrate,
but tagged as 5/10 now to make it easier to distinguish them.
In the nl80211 API, the flags are preserved, but the code
now can also clearly only set a single one of the flags.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 44dd6ef923cd..85da63a67faf 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -1827,6 +1827,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1827 | } | 1827 | } |
1828 | 1828 | ||
1829 | sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; | 1829 | sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; |
1830 | sinfo->txrate.bw = RATE_INFO_BW_20; | ||
1830 | } else if (is_rate_ht40(rate, &mcs, &sgi)) { | 1831 | } else if (is_rate_ht40(rate, &mcs, &sgi)) { |
1831 | if (sgi) { | 1832 | if (sgi) { |
1832 | sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; | 1833 | sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; |
@@ -1835,7 +1836,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1835 | sinfo->txrate.mcs = mcs; | 1836 | sinfo->txrate.mcs = mcs; |
1836 | } | 1837 | } |
1837 | 1838 | ||
1838 | sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; | 1839 | sinfo->txrate.bw = RATE_INFO_BW_40; |
1839 | sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; | 1840 | sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; |
1840 | } else { | 1841 | } else { |
1841 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, | 1842 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 71312ff52703..1996a8b612d2 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -856,16 +856,16 @@ mwifiex_parse_htinfo(struct mwifiex_private *priv, u8 tx_htinfo, | |||
856 | /* HT or VHT */ | 856 | /* HT or VHT */ |
857 | switch (tx_htinfo & (BIT(3) | BIT(2))) { | 857 | switch (tx_htinfo & (BIT(3) | BIT(2))) { |
858 | case 0: | 858 | case 0: |
859 | /* This will be 20MHz */ | 859 | rate->bw = RATE_INFO_BW_20; |
860 | break; | 860 | break; |
861 | case (BIT(2)): | 861 | case (BIT(2)): |
862 | rate->flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; | 862 | rate->bw = RATE_INFO_BW_40; |
863 | break; | 863 | break; |
864 | case (BIT(3)): | 864 | case (BIT(3)): |
865 | rate->flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH; | 865 | rate->bw = RATE_INFO_BW_80; |
866 | break; | 866 | break; |
867 | case (BIT(3) | BIT(2)): | 867 | case (BIT(3) | BIT(2)): |
868 | rate->flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH; | 868 | rate->bw = RATE_INFO_BW_160; |
869 | break; | 869 | break; |
870 | } | 870 | } |
871 | 871 | ||
@@ -885,8 +885,9 @@ mwifiex_parse_htinfo(struct mwifiex_private *priv, u8 tx_htinfo, | |||
885 | if ((tx_htinfo & BIT(0)) && (priv->tx_rate < 16)) { | 885 | if ((tx_htinfo & BIT(0)) && (priv->tx_rate < 16)) { |
886 | rate->mcs = priv->tx_rate; | 886 | rate->mcs = priv->tx_rate; |
887 | rate->flags |= RATE_INFO_FLAGS_MCS; | 887 | rate->flags |= RATE_INFO_FLAGS_MCS; |
888 | rate->bw = RATE_INFO_BW_20; | ||
888 | if (tx_htinfo & BIT(1)) | 889 | if (tx_htinfo & BIT(1)) |
889 | rate->flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; | 890 | rate->bw = RATE_INFO_BW_40; |
890 | if (tx_htinfo & BIT(2)) | 891 | if (tx_htinfo & BIT(2)) |
891 | rate->flags |= RATE_INFO_FLAGS_SHORT_GI; | 892 | rate->flags |= RATE_INFO_FLAGS_SHORT_GI; |
892 | } | 893 | } |