diff options
-rw-r--r-- | include/net/mac80211.h | 2 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 8 | ||||
-rw-r--r-- | net/mac80211/scan.c | 9 |
4 files changed, 19 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index a405a7a9775c..5b7a3dadadde 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -305,6 +305,7 @@ enum ieee80211_rssi_event { | |||
305 | * @basic_rates: bitmap of basic rates, each bit stands for an | 305 | * @basic_rates: bitmap of basic rates, each bit stands for an |
306 | * index into the rate table configured by the driver in | 306 | * index into the rate table configured by the driver in |
307 | * the current band. | 307 | * the current band. |
308 | * @beacon_rate: associated AP's beacon TX rate | ||
308 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 309 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
309 | * @bssid: The BSSID for this BSS | 310 | * @bssid: The BSSID for this BSS |
310 | * @enable_beacon: whether beaconing should be enabled or not | 311 | * @enable_beacon: whether beaconing should be enabled or not |
@@ -352,6 +353,7 @@ struct ieee80211_bss_conf { | |||
352 | u32 sync_device_ts; | 353 | u32 sync_device_ts; |
353 | u8 sync_dtim_count; | 354 | u8 sync_dtim_count; |
354 | u32 basic_rates; | 355 | u32 basic_rates; |
356 | struct ieee80211_rate *beacon_rate; | ||
355 | int mcast_rate[IEEE80211_NUM_BANDS]; | 357 | int mcast_rate[IEEE80211_NUM_BANDS]; |
356 | u16 ht_operation_mode; | 358 | u16 ht_operation_mode; |
357 | s32 cqm_rssi_thold; | 359 | s32 cqm_rssi_thold; |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 7a6f1a0207ec..a4dfb0be53d7 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -94,6 +94,7 @@ struct ieee80211_bss { | |||
94 | #define IEEE80211_MAX_SUPP_RATES 32 | 94 | #define IEEE80211_MAX_SUPP_RATES 32 |
95 | u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; | 95 | u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; |
96 | size_t supp_rates_len; | 96 | size_t supp_rates_len; |
97 | struct ieee80211_rate *beacon_rate; | ||
97 | 98 | ||
98 | /* | 99 | /* |
99 | * During association, we save an ERP value from a probe response so | 100 | * During association, we save an ERP value from a probe response so |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index ad9bb9e10cbb..87f2d4df31f8 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1779,8 +1779,10 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
1779 | * probably just won't work at all. | 1779 | * probably just won't work at all. |
1780 | */ | 1780 | */ |
1781 | bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1; | 1781 | bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1; |
1782 | bss_conf->beacon_rate = bss->beacon_rate; | ||
1782 | bss_info_changed |= BSS_CHANGED_BEACON_INFO; | 1783 | bss_info_changed |= BSS_CHANGED_BEACON_INFO; |
1783 | } else { | 1784 | } else { |
1785 | bss_conf->beacon_rate = NULL; | ||
1784 | bss_conf->dtim_period = 0; | 1786 | bss_conf->dtim_period = 0; |
1785 | } | 1787 | } |
1786 | 1788 | ||
@@ -1903,6 +1905,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1903 | del_timer_sync(&sdata->u.mgd.chswitch_timer); | 1905 | del_timer_sync(&sdata->u.mgd.chswitch_timer); |
1904 | 1906 | ||
1905 | sdata->vif.bss_conf.dtim_period = 0; | 1907 | sdata->vif.bss_conf.dtim_period = 0; |
1908 | sdata->vif.bss_conf.beacon_rate = NULL; | ||
1909 | |||
1906 | ifmgd->have_beacon = false; | 1910 | ifmgd->have_beacon = false; |
1907 | 1911 | ||
1908 | ifmgd->flags = 0; | 1912 | ifmgd->flags = 0; |
@@ -2754,8 +2758,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
2754 | 2758 | ||
2755 | bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, | 2759 | bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, |
2756 | channel); | 2760 | channel); |
2757 | if (bss) | 2761 | if (bss) { |
2758 | ieee80211_rx_bss_put(local, bss); | 2762 | ieee80211_rx_bss_put(local, bss); |
2763 | sdata->vif.bss_conf.beacon_rate = bss->beacon_rate; | ||
2764 | } | ||
2759 | 2765 | ||
2760 | if (!sdata->u.mgd.associated || | 2766 | if (!sdata->u.mgd.associated || |
2761 | !ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) | 2767 | !ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 99b103921a4b..1b122a79b0d8 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -140,6 +140,15 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
140 | bss->valid_data |= IEEE80211_BSS_VALID_WMM; | 140 | bss->valid_data |= IEEE80211_BSS_VALID_WMM; |
141 | } | 141 | } |
142 | 142 | ||
143 | if (beacon) { | ||
144 | struct ieee80211_supported_band *sband = | ||
145 | local->hw.wiphy->bands[rx_status->band]; | ||
146 | if (!(rx_status->flag & RX_FLAG_HT) && | ||
147 | !(rx_status->flag & RX_FLAG_VHT)) | ||
148 | bss->beacon_rate = | ||
149 | &sband->bitrates[rx_status->rate_idx]; | ||
150 | } | ||
151 | |||
143 | return bss; | 152 | return bss; |
144 | } | 153 | } |
145 | 154 | ||