diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-02-07 05:47:44 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 03:41:30 -0500 |
commit | e1a0c6b3a4b27ed5f21291d0bbee2167ec201ef5 (patch) | |
tree | 18e5c9bd022ea469e7350a52ca67ce505a7608e6 /drivers/net/wireless/rtlwifi | |
parent | 4a34215ef7487b1cbd783e7cc485eb03de893bd0 (diff) |
mac80211: stop toggling IEEE80211_HT_CAP_SUP_WIDTH_20_40
For VHT, many more bandwidth changes are possible. As a first
step, stop toggling the IEEE80211_HT_CAP_SUP_WIDTH_20_40 flag
in the HT capabilities and instead introduce a bandwidth field
indicating the currently usable bandwidth to transmit to the
station. Of course, make all drivers use it.
To achieve this, make ieee80211_ht_cap_ie_to_sta_ht_cap() get
the station as an argument, rather than the new capabilities,
so it can set up the new bandwidth field.
If the station is a VHT station and VHT bandwidth is in use,
also set the bandwidth accordingly.
Doing this allows us to get rid of the supports_40mhz flag as
the HT capabilities now reflect the true capability instead of
the current setting.
While at it, also fix ieee80211_ht_cap_ie_to_sta_ht_cap() to not
ignore HT cap overrides when MCS TX isn't supported (not that it
really happens...)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r-- | drivers/net/wireless/rtlwifi/base.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rc.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/trx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | 3 |
10 files changed, 15 insertions, 24 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 4494d130b37c..84ea04dab303 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -523,8 +523,8 @@ static void _rtl_query_shortgi(struct ieee80211_hw *hw, | |||
523 | if (mac->opmode == NL80211_IFTYPE_STATION) | 523 | if (mac->opmode == NL80211_IFTYPE_STATION) |
524 | bw_40 = mac->bw_40; | 524 | bw_40 = mac->bw_40; |
525 | else if (mac->opmode == NL80211_IFTYPE_AP || | 525 | else if (mac->opmode == NL80211_IFTYPE_AP || |
526 | mac->opmode == NL80211_IFTYPE_ADHOC) | 526 | mac->opmode == NL80211_IFTYPE_ADHOC) |
527 | bw_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 527 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
528 | 528 | ||
529 | if (bw_40 && sgi_40) | 529 | if (bw_40 && sgi_40) |
530 | tcb_desc->use_shortgi = true; | 530 | tcb_desc->use_shortgi = true; |
@@ -634,8 +634,7 @@ static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw, | |||
634 | return; | 634 | return; |
635 | if (mac->opmode == NL80211_IFTYPE_AP || | 635 | if (mac->opmode == NL80211_IFTYPE_AP || |
636 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 636 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
637 | if (!(sta->ht_cap.ht_supported) || | 637 | if (sta->bandwidth == IEEE80211_STA_RX_BW_20) |
638 | !(sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)) | ||
639 | return; | 638 | return; |
640 | } else if (mac->opmode == NL80211_IFTYPE_STATION) { | 639 | } else if (mac->opmode == NL80211_IFTYPE_STATION) { |
641 | if (!mac->bw_40 || !(sta->ht_cap.ht_supported)) | 640 | if (!mac->bw_40 || !(sta->ht_cap.ht_supported)) |
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c index 204f46c4510d..c12a866e1261 100644 --- a/drivers/net/wireless/rtlwifi/rc.c +++ b/drivers/net/wireless/rtlwifi/rc.c | |||
@@ -116,9 +116,8 @@ static void _rtl_rc_rate_set_series(struct rtl_priv *rtlpriv, | |||
116 | if (txrc->short_preamble) | 116 | if (txrc->short_preamble) |
117 | rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE; | 117 | rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE; |
118 | if (mac->opmode == NL80211_IFTYPE_AP || | 118 | if (mac->opmode == NL80211_IFTYPE_AP || |
119 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 119 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
120 | if (sta && (sta->ht_cap.cap & | 120 | if (sta && (sta->bandwidth >= IEEE80211_STA_RX_BW_40)) |
121 | IEEE80211_HT_CAP_SUP_WIDTH_20_40)) | ||
122 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; | 121 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; |
123 | } else { | 122 | } else { |
124 | if (mac->bw_40) | 123 | if (mac->bw_40) |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index d1f34f6ffbdf..1b65db7fd651 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
@@ -1846,9 +1846,9 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1846 | struct rtl_sta_info *sta_entry = NULL; | 1846 | struct rtl_sta_info *sta_entry = NULL; |
1847 | u32 ratr_bitmap; | 1847 | u32 ratr_bitmap; |
1848 | u8 ratr_index; | 1848 | u8 ratr_index; |
1849 | u8 curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) | 1849 | u8 curtxbw_40mhz = (sta->bandwidth >= IEEE80211_STA_RX_BW_40) ? 1 : 0; |
1850 | ? 1 : 0; | 1850 | u8 curshortgi_40mhz = curtxbw_40mhz && |
1851 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? | 1851 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? |
1852 | 1 : 0; | 1852 | 1 : 0; |
1853 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? | 1853 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? |
1854 | 1 : 0; | 1854 | 1 : 0; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c index da0e9022a99a..b9b1a6e0b16e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | |||
@@ -626,8 +626,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, | |||
626 | } else if (mac->opmode == NL80211_IFTYPE_AP || | 626 | } else if (mac->opmode == NL80211_IFTYPE_AP || |
627 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 627 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
628 | if (sta) | 628 | if (sta) |
629 | bw_40 = sta->ht_cap.cap & | 629 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
630 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
631 | } | 630 | } |
632 | 631 | ||
633 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; | 632 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c index f4051f4f0390..aa5b42521bb4 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c | |||
@@ -1970,8 +1970,7 @@ static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1970 | struct rtl_sta_info *sta_entry = NULL; | 1970 | struct rtl_sta_info *sta_entry = NULL; |
1971 | u32 ratr_bitmap; | 1971 | u32 ratr_bitmap; |
1972 | u8 ratr_index; | 1972 | u8 ratr_index; |
1973 | u8 curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) | 1973 | u8 curtxbw_40mhz = (sta->bandwidth >= IEEE80211_STA_RX_BW_40) ? 1 : 0; |
1974 | ? 1 : 0; | ||
1975 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? | 1974 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? |
1976 | 1 : 0; | 1975 | 1 : 0; |
1977 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? | 1976 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c index cdb570ffb4b5..941080e03c06 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c | |||
@@ -574,8 +574,7 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw, | |||
574 | } else if (mac->opmode == NL80211_IFTYPE_AP || | 574 | } else if (mac->opmode == NL80211_IFTYPE_AP || |
575 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 575 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
576 | if (sta) | 576 | if (sta) |
577 | bw_40 = sta->ht_cap.cap & | 577 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
578 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
579 | } | 578 | } |
580 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; | 579 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
581 | rtl_get_tcb_desc(hw, info, sta, skb, ptcb_desc); | 580 | rtl_get_tcb_desc(hw, info, sta, skb, ptcb_desc); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c index 28526a7361f5..084e7773bce2 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c | |||
@@ -2085,8 +2085,7 @@ static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
2085 | struct rtl_sta_info *sta_entry = NULL; | 2085 | struct rtl_sta_info *sta_entry = NULL; |
2086 | u32 ratr_bitmap; | 2086 | u32 ratr_bitmap; |
2087 | u8 ratr_index = 0; | 2087 | u8 ratr_index = 0; |
2088 | u8 curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) | 2088 | u8 curtxbw_40mhz = (sta->bandwidth >= IEEE80211_STA_RX_BW_40) ? 1 : 0; |
2089 | ? 1 : 0; | ||
2090 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? | 2089 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? |
2091 | 1 : 0; | 2090 | 1 : 0; |
2092 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? | 2091 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index f8431a3c2c9d..7b0a2e75b8b8 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -621,8 +621,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, | |||
621 | } else if (mac->opmode == NL80211_IFTYPE_AP || | 621 | } else if (mac->opmode == NL80211_IFTYPE_AP || |
622 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 622 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
623 | if (sta) | 623 | if (sta) |
624 | bw_40 = sta->ht_cap.cap & | 624 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
625 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
626 | } | 625 | } |
627 | 626 | ||
628 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; | 627 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c index 149804816ac4..9a0c71c2e15e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | |||
@@ -1866,8 +1866,7 @@ static void rtl8723ae_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1866 | struct rtl_sta_info *sta_entry = NULL; | 1866 | struct rtl_sta_info *sta_entry = NULL; |
1867 | u32 ratr_bitmap; | 1867 | u32 ratr_bitmap; |
1868 | u8 ratr_index; | 1868 | u8 ratr_index; |
1869 | u8 curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) | 1869 | u8 curtxbw_40mhz = (sta->bandwidth >= IEEE80211_STA_RX_BW_40) ? 1 : 0; |
1870 | ? 1 : 0; | ||
1871 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? | 1870 | u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? |
1872 | 1 : 0; | 1871 | 1 : 0; |
1873 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? | 1872 | u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c index b1fd2b328abf..ac081297db50 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | |||
@@ -395,8 +395,7 @@ void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw, | |||
395 | } else if (mac->opmode == NL80211_IFTYPE_AP || | 395 | } else if (mac->opmode == NL80211_IFTYPE_AP || |
396 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 396 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
397 | if (sta) | 397 | if (sta) |
398 | bw_40 = sta->ht_cap.cap & | 398 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
399 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
400 | } | 399 | } |
401 | 400 | ||
402 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; | 401 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |