aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r--net/mac80211/sta_info.h56
1 files changed, 24 insertions, 32 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index b2f95966c7f4..c6ae8718bd57 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -43,6 +43,8 @@
43 * be in the queues 43 * be in the queues
44 * @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping 44 * @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping
45 * station in power-save mode, reply when the driver unblocks. 45 * station in power-save mode, reply when the driver unblocks.
46 * @WLAN_STA_PS_DRIVER_BUF: Station has frames pending in driver internal
47 * buffers. Automatically cleared on station wake-up.
46 */ 48 */
47enum ieee80211_sta_info_flags { 49enum ieee80211_sta_info_flags {
48 WLAN_STA_AUTH = 1<<0, 50 WLAN_STA_AUTH = 1<<0,
@@ -58,6 +60,7 @@ enum ieee80211_sta_info_flags {
58 WLAN_STA_BLOCK_BA = 1<<11, 60 WLAN_STA_BLOCK_BA = 1<<11,
59 WLAN_STA_PS_DRIVER = 1<<12, 61 WLAN_STA_PS_DRIVER = 1<<12,
60 WLAN_STA_PSPOLL = 1<<13, 62 WLAN_STA_PSPOLL = 1<<13,
63 WLAN_STA_PS_DRIVER_BUF = 1<<14,
61}; 64};
62 65
63#define STA_TID_NUM 16 66#define STA_TID_NUM 16
@@ -149,6 +152,7 @@ struct tid_ampdu_rx {
149 * 152 *
150 * @tid_rx: aggregation info for Rx per TID -- RCU protected 153 * @tid_rx: aggregation info for Rx per TID -- RCU protected
151 * @tid_tx: aggregation info for Tx per TID 154 * @tid_tx: aggregation info for Tx per TID
155 * @tid_start_tx: sessions where start was requested
152 * @addba_req_num: number of times addBA request has been sent. 156 * @addba_req_num: number of times addBA request has been sent.
153 * @dialog_token_allocator: dialog token enumerator for each new session; 157 * @dialog_token_allocator: dialog token enumerator for each new session;
154 * @work: work struct for starting/stopping aggregation 158 * @work: work struct for starting/stopping aggregation
@@ -160,40 +164,18 @@ struct tid_ampdu_rx {
160struct sta_ampdu_mlme { 164struct sta_ampdu_mlme {
161 struct mutex mtx; 165 struct mutex mtx;
162 /* rx */ 166 /* rx */
163 struct tid_ampdu_rx *tid_rx[STA_TID_NUM]; 167 struct tid_ampdu_rx __rcu *tid_rx[STA_TID_NUM];
164 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)]; 168 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)];
165 /* tx */ 169 /* tx */
166 struct work_struct work; 170 struct work_struct work;
167 struct tid_ampdu_tx *tid_tx[STA_TID_NUM]; 171 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM];
172 struct tid_ampdu_tx *tid_start_tx[STA_TID_NUM];
168 u8 addba_req_num[STA_TID_NUM]; 173 u8 addba_req_num[STA_TID_NUM];
169 u8 dialog_token_allocator; 174 u8 dialog_token_allocator;
170}; 175};
171 176
172 177
173/** 178/**
174 * enum plink_state - state of a mesh peer link finite state machine
175 *
176 * @PLINK_LISTEN: initial state, considered the implicit state of non existent
177 * mesh peer links
178 * @PLINK_OPN_SNT: mesh plink open frame has been sent to this mesh peer
179 * @PLINK_OPN_RCVD: mesh plink open frame has been received from this mesh peer
180 * @PLINK_CNF_RCVD: mesh plink confirm frame has been received from this mesh
181 * peer
182 * @PLINK_ESTAB: mesh peer link is established
183 * @PLINK_HOLDING: mesh peer link is being closed or cancelled
184 * @PLINK_BLOCKED: all frames transmitted from this mesh plink are discarded
185 */
186enum plink_state {
187 PLINK_LISTEN,
188 PLINK_OPN_SNT,
189 PLINK_OPN_RCVD,
190 PLINK_CNF_RCVD,
191 PLINK_ESTAB,
192 PLINK_HOLDING,
193 PLINK_BLOCKED
194};
195
196/**
197 * struct sta_info - STA information 179 * struct sta_info - STA information
198 * 180 *
199 * This structure collects information about a station that 181 * This structure collects information about a station that
@@ -226,6 +208,7 @@ enum plink_state {
226 * @rx_bytes: Number of bytes received from this STA 208 * @rx_bytes: Number of bytes received from this STA
227 * @wep_weak_iv_count: number of weak WEP IVs received from this station 209 * @wep_weak_iv_count: number of weak WEP IVs received from this station
228 * @last_rx: time (in jiffies) when last frame was received from this STA 210 * @last_rx: time (in jiffies) when last frame was received from this STA
211 * @last_connected: time (in seconds) when a station got connected
229 * @num_duplicates: number of duplicate frames received from this STA 212 * @num_duplicates: number of duplicate frames received from this STA
230 * @rx_fragments: number of received MPDUs 213 * @rx_fragments: number of received MPDUs
231 * @rx_dropped: number of dropped MPDUs from this STA 214 * @rx_dropped: number of dropped MPDUs from this STA
@@ -260,11 +243,11 @@ enum plink_state {
260struct sta_info { 243struct sta_info {
261 /* General information, mostly static */ 244 /* General information, mostly static */
262 struct list_head list; 245 struct list_head list;
263 struct sta_info *hnext; 246 struct sta_info __rcu *hnext;
264 struct ieee80211_local *local; 247 struct ieee80211_local *local;
265 struct ieee80211_sub_if_data *sdata; 248 struct ieee80211_sub_if_data *sdata;
266 struct ieee80211_key *gtk[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 249 struct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
267 struct ieee80211_key *ptk; 250 struct ieee80211_key __rcu *ptk;
268 struct rate_control_ref *rate_ctrl; 251 struct rate_control_ref *rate_ctrl;
269 void *rate_ctrl_priv; 252 void *rate_ctrl_priv;
270 spinlock_t lock; 253 spinlock_t lock;
@@ -295,6 +278,7 @@ struct sta_info {
295 unsigned long rx_packets, rx_bytes; 278 unsigned long rx_packets, rx_bytes;
296 unsigned long wep_weak_iv_count; 279 unsigned long wep_weak_iv_count;
297 unsigned long last_rx; 280 unsigned long last_rx;
281 long last_connected;
298 unsigned long num_duplicates; 282 unsigned long num_duplicates;
299 unsigned long rx_fragments; 283 unsigned long rx_fragments;
300 unsigned long rx_dropped; 284 unsigned long rx_dropped;
@@ -334,7 +318,7 @@ struct sta_info {
334 u8 plink_retries; 318 u8 plink_retries;
335 bool ignore_plink_timer; 319 bool ignore_plink_timer;
336 bool plink_timer_was_running; 320 bool plink_timer_was_running;
337 enum plink_state plink_state; 321 enum nl80211_plink_state plink_state;
338 u32 plink_timeout; 322 u32 plink_timeout;
339 struct timer_list plink_timer; 323 struct timer_list plink_timer;
340#endif 324#endif
@@ -352,12 +336,12 @@ struct sta_info {
352 struct ieee80211_sta sta; 336 struct ieee80211_sta sta;
353}; 337};
354 338
355static inline enum plink_state sta_plink_state(struct sta_info *sta) 339static inline enum nl80211_plink_state sta_plink_state(struct sta_info *sta)
356{ 340{
357#ifdef CONFIG_MAC80211_MESH 341#ifdef CONFIG_MAC80211_MESH
358 return sta->plink_state; 342 return sta->plink_state;
359#endif 343#endif
360 return PLINK_LISTEN; 344 return NL80211_PLINK_LISTEN;
361} 345}
362 346
363static inline void set_sta_flags(struct sta_info *sta, const u32 flags) 347static inline void set_sta_flags(struct sta_info *sta, const u32 flags)
@@ -416,7 +400,16 @@ static inline u32 get_sta_flags(struct sta_info *sta)
416 return ret; 400 return ret;
417} 401}
418 402
403void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
404 struct tid_ampdu_tx *tid_tx);
419 405
406static inline struct tid_ampdu_tx *
407rcu_dereference_protected_tid_tx(struct sta_info *sta, int tid)
408{
409 return rcu_dereference_protected(sta->ampdu_mlme.tid_tx[tid],
410 lockdep_is_held(&sta->lock) ||
411 lockdep_is_held(&sta->ampdu_mlme.mtx));
412}
420 413
421#define STA_HASH_SIZE 256 414#define STA_HASH_SIZE 256
422#define STA_HASH(sta) (sta[5]) 415#define STA_HASH(sta) (sta[5])
@@ -497,7 +490,6 @@ void sta_info_set_tim_bit(struct sta_info *sta);
497void sta_info_clear_tim_bit(struct sta_info *sta); 490void sta_info_clear_tim_bit(struct sta_info *sta);
498 491
499void sta_info_init(struct ieee80211_local *local); 492void sta_info_init(struct ieee80211_local *local);
500int sta_info_start(struct ieee80211_local *local);
501void sta_info_stop(struct ieee80211_local *local); 493void sta_info_stop(struct ieee80211_local *local);
502int sta_info_flush(struct ieee80211_local *local, 494int sta_info_flush(struct ieee80211_local *local,
503 struct ieee80211_sub_if_data *sdata); 495 struct ieee80211_sub_if_data *sdata);