diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-06-05 08:21:36 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-06-23 08:22:06 -0400 |
commit | af296bdb8da4d0a4284de10fc4a61497272ddf11 (patch) | |
tree | 5387b60fbc8d858402068f2ee69d57104f961e5f /net/mac80211/ieee80211_i.h | |
parent | b49328361bab10d786e321aeae79b4429fdff38c (diff) |
mac80211: move csa counters from sdata to beacon/presp
Having csa counters part of beacon and probe_resp
structures makes it easier to get rid of possible
races between setting a beacon and updating
counters on SMP systems by guaranteeing counters
are always consistent against given beacon struct.
While at it relax WARN_ON into WARN_ON_ONCE to
prevent spamming logs and racing.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[remove pointless array check]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 4372d48b718f..d9af7ef3c11a 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -229,16 +229,29 @@ struct ieee80211_rx_data { | |||
229 | u16 tkip_iv16; | 229 | u16 tkip_iv16; |
230 | }; | 230 | }; |
231 | 231 | ||
232 | struct ieee80211_csa_settings { | ||
233 | const u16 *counter_offsets_beacon; | ||
234 | const u16 *counter_offsets_presp; | ||
235 | |||
236 | int n_counter_offsets_beacon; | ||
237 | int n_counter_offsets_presp; | ||
238 | |||
239 | u8 count; | ||
240 | }; | ||
241 | |||
232 | struct beacon_data { | 242 | struct beacon_data { |
233 | u8 *head, *tail; | 243 | u8 *head, *tail; |
234 | int head_len, tail_len; | 244 | int head_len, tail_len; |
235 | struct ieee80211_meshconf_ie *meshconf; | 245 | struct ieee80211_meshconf_ie *meshconf; |
246 | u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; | ||
247 | u8 csa_current_counter; | ||
236 | struct rcu_head rcu_head; | 248 | struct rcu_head rcu_head; |
237 | }; | 249 | }; |
238 | 250 | ||
239 | struct probe_resp { | 251 | struct probe_resp { |
240 | struct rcu_head rcu_head; | 252 | struct rcu_head rcu_head; |
241 | int len; | 253 | int len; |
254 | u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; | ||
242 | u8 data[0]; | 255 | u8 data[0]; |
243 | }; | 256 | }; |
244 | 257 | ||
@@ -754,8 +767,6 @@ struct ieee80211_sub_if_data { | |||
754 | struct mac80211_qos_map __rcu *qos_map; | 767 | struct mac80211_qos_map __rcu *qos_map; |
755 | 768 | ||
756 | struct work_struct csa_finalize_work; | 769 | struct work_struct csa_finalize_work; |
757 | u16 csa_counter_offset_beacon[IEEE80211_MAX_CSA_COUNTERS_NUM]; | ||
758 | u16 csa_counter_offset_presp[IEEE80211_MAX_CSA_COUNTERS_NUM]; | ||
759 | bool csa_radar_required; | 770 | bool csa_radar_required; |
760 | bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */ | 771 | bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */ |
761 | struct cfg80211_chan_def csa_chandef; | 772 | struct cfg80211_chan_def csa_chandef; |
@@ -767,7 +778,6 @@ struct ieee80211_sub_if_data { | |||
767 | struct ieee80211_chanctx *reserved_chanctx; | 778 | struct ieee80211_chanctx *reserved_chanctx; |
768 | struct cfg80211_chan_def reserved_chandef; | 779 | struct cfg80211_chan_def reserved_chandef; |
769 | bool reserved_radar_required; | 780 | bool reserved_radar_required; |
770 | u8 csa_current_counter; | ||
771 | 781 | ||
772 | /* used to reconfigure hardware SM PS */ | 782 | /* used to reconfigure hardware SM PS */ |
773 | struct work_struct recalc_smps; | 783 | struct work_struct recalc_smps; |