return _ieee80211_sta_cur_vht_bw(link_sta, NULL);
}
void ieee80211_sta_init_nss(struct link_sta_info *link_sta);
-enum nl80211_chan_width
-ieee80211_sta_cap_chan_bw(struct link_sta_info *link_sta);
void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
struct ieee80211_link_data *link,
struct ieee80211_mgmt *mgmt);
/* IEEE802.11ac-2013 Table E-4 */
static const u16 centers_80mhz[] = { 5210, 5290, 5530, 5610, 5690, 5775 };
struct cfg80211_chan_def uc = sta->tdls_chandef;
- enum nl80211_chan_width max_width =
- ieee80211_sta_cap_chan_bw(&sta->deflink);
+ enum nl80211_chan_width max_width;
int i;
- /* only support upgrading non-narrow channels up to 80Mhz */
- if (max_width == NL80211_CHAN_WIDTH_5 ||
- max_width == NL80211_CHAN_WIDTH_10)
- return;
-
- if (max_width > NL80211_CHAN_WIDTH_80)
+ switch (ieee80211_sta_cap_rx_bw(&sta->deflink)) {
+ case IEEE80211_STA_RX_BW_20:
+ max_width = NL80211_CHAN_WIDTH_20;
+ break;
+ case IEEE80211_STA_RX_BW_40:
+ max_width = NL80211_CHAN_WIDTH_40;
+ break;
+ default: /* 80 or higher, only support upgrade to 80 */
max_width = NL80211_CHAN_WIDTH_80;
+ break;
+ }
if (uc.width >= max_width)
return;
link_sta->rx_omi_bw_rx);
}
-enum nl80211_chan_width
-ieee80211_sta_cap_chan_bw(struct link_sta_info *link_sta)
-{
- struct ieee80211_sta_vht_cap *vht_cap = &link_sta->pub->vht_cap;
- u32 cap_width;
-
- if (!vht_cap->vht_supported) {
- if (!link_sta->pub->ht_cap.ht_supported)
- return NL80211_CHAN_WIDTH_20_NOHT;
-
- return link_sta->pub->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?
- NL80211_CHAN_WIDTH_40 : NL80211_CHAN_WIDTH_20;
- }
-
- cap_width = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
-
- if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ)
- return NL80211_CHAN_WIDTH_160;
- else if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
- return NL80211_CHAN_WIDTH_80P80;
-
- return NL80211_CHAN_WIDTH_80;
-}
-
enum nl80211_chan_width
ieee80211_sta_rx_bw_to_chan_width(struct link_sta_info *link_sta)
{