mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
mac80211: track AP's beacon rate and give it to the driver
Track the AP's beacon rate in the scan BSS data and in the interface configuration to let the drivers know which rate the AP is using. This information may be used by drivers, in our case to let the firmware optimise beacon RX. Signed-off-by: Alexander Bondar <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
e562078a19
commit
817cee7675
4 changed files with 19 additions and 1 deletions
|
|
@ -94,6 +94,7 @@ struct ieee80211_bss {
|
|||
#define IEEE80211_MAX_SUPP_RATES 32
|
||||
u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
|
||||
size_t supp_rates_len;
|
||||
struct ieee80211_rate *beacon_rate;
|
||||
|
||||
/*
|
||||
* During association, we save an ERP value from a probe response so
|
||||
|
|
|
|||
|
|
@ -1779,8 +1779,10 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
|
|||
* probably just won't work at all.
|
||||
*/
|
||||
bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1;
|
||||
bss_conf->beacon_rate = bss->beacon_rate;
|
||||
bss_info_changed |= BSS_CHANGED_BEACON_INFO;
|
||||
} else {
|
||||
bss_conf->beacon_rate = NULL;
|
||||
bss_conf->dtim_period = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1903,6 +1905,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
|
|||
del_timer_sync(&sdata->u.mgd.chswitch_timer);
|
||||
|
||||
sdata->vif.bss_conf.dtim_period = 0;
|
||||
sdata->vif.bss_conf.beacon_rate = NULL;
|
||||
|
||||
ifmgd->have_beacon = false;
|
||||
|
||||
ifmgd->flags = 0;
|
||||
|
|
@ -2754,8 +2758,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
|
|||
|
||||
bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems,
|
||||
channel);
|
||||
if (bss)
|
||||
if (bss) {
|
||||
ieee80211_rx_bss_put(local, bss);
|
||||
sdata->vif.bss_conf.beacon_rate = bss->beacon_rate;
|
||||
}
|
||||
|
||||
if (!sdata->u.mgd.associated ||
|
||||
!ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid))
|
||||
|
|
|
|||
|
|
@ -140,6 +140,15 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
|
|||
bss->valid_data |= IEEE80211_BSS_VALID_WMM;
|
||||
}
|
||||
|
||||
if (beacon) {
|
||||
struct ieee80211_supported_band *sband =
|
||||
local->hw.wiphy->bands[rx_status->band];
|
||||
if (!(rx_status->flag & RX_FLAG_HT) &&
|
||||
!(rx_status->flag & RX_FLAG_VHT))
|
||||
bss->beacon_rate =
|
||||
&sband->bitrates[rx_status->rate_idx];
|
||||
}
|
||||
|
||||
return bss;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue