|
@@ -371,6 +371,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
|
|
|
struct sta_info *sta;
|
|
|
struct ieee80211_chanctx_conf *chanctx_conf;
|
|
|
struct ieee80211_supported_band *sband;
|
|
|
+ enum nl80211_bss_scan_width scan_width;
|
|
|
int band;
|
|
|
|
|
|
/*
|
|
@@ -399,6 +400,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
|
|
|
if (WARN_ON_ONCE(!chanctx_conf))
|
|
|
return NULL;
|
|
|
band = chanctx_conf->def.chan->band;
|
|
|
+ scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
sta = sta_info_alloc(sdata, addr, GFP_KERNEL);
|
|
@@ -412,7 +414,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
|
|
|
/* make sure mandatory rates are always added */
|
|
|
sband = local->hw.wiphy->bands[band];
|
|
|
sta->sta.supp_rates[band] = supp_rates |
|
|
|
- ieee80211_mandatory_rates(sband);
|
|
|
+ ieee80211_mandatory_rates(sband, scan_width);
|
|
|
|
|
|
return ieee80211_ibss_finish_sta(sta);
|
|
|
}
|
|
@@ -476,6 +478,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
|
|
|
u64 beacon_timestamp, rx_timestamp;
|
|
|
u32 supp_rates = 0;
|
|
|
enum ieee80211_band band = rx_status->band;
|
|
|
+ enum nl80211_bss_scan_width scan_width;
|
|
|
struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
|
|
|
bool rates_updated = false;
|
|
|
|
|
@@ -504,9 +507,15 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
|
|
|
|
|
|
prev_rates = sta->sta.supp_rates[band];
|
|
|
/* make sure mandatory rates are always added */
|
|
|
- sta->sta.supp_rates[band] = supp_rates |
|
|
|
- ieee80211_mandatory_rates(sband);
|
|
|
+ scan_width = NL80211_BSS_CHAN_WIDTH_20;
|
|
|
+ if (rx_status->flag & RX_FLAG_5MHZ)
|
|
|
+ scan_width = NL80211_BSS_CHAN_WIDTH_5;
|
|
|
+ if (rx_status->flag & RX_FLAG_10MHZ)
|
|
|
+ scan_width = NL80211_BSS_CHAN_WIDTH_10;
|
|
|
|
|
|
+ sta->sta.supp_rates[band] = supp_rates |
|
|
|
+ ieee80211_mandatory_rates(sband,
|
|
|
+ scan_width);
|
|
|
if (sta->sta.supp_rates[band] != prev_rates) {
|
|
|
ibss_dbg(sdata,
|
|
|
"updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n",
|
|
@@ -640,6 +649,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
|
|
|
struct sta_info *sta;
|
|
|
struct ieee80211_chanctx_conf *chanctx_conf;
|
|
|
struct ieee80211_supported_band *sband;
|
|
|
+ enum nl80211_bss_scan_width scan_width;
|
|
|
int band;
|
|
|
|
|
|
/*
|
|
@@ -665,6 +675,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
|
|
|
return;
|
|
|
}
|
|
|
band = chanctx_conf->def.chan->band;
|
|
|
+ scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
|
|
@@ -676,7 +687,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
|
|
|
/* make sure mandatory rates are always added */
|
|
|
sband = local->hw.wiphy->bands[band];
|
|
|
sta->sta.supp_rates[band] = supp_rates |
|
|
|
- ieee80211_mandatory_rates(sband);
|
|
|
+ ieee80211_mandatory_rates(sband, scan_width);
|
|
|
|
|
|
spin_lock(&ifibss->incomplete_lock);
|
|
|
list_add(&sta->list, &ifibss->incomplete_stations);
|