diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/sta.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.h | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h index 4968d0237dc5..2ed84c421481 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/iwlwifi/mvm/sta.h | |||
@@ -195,24 +195,33 @@ struct iwl_mvm; | |||
195 | /** | 195 | /** |
196 | * DOC: AP mode - PS | 196 | * DOC: AP mode - PS |
197 | * | 197 | * |
198 | * When a station is asleep, the fw will set it as "asleep". All the | 198 | * When a station is asleep, the fw will set it as "asleep". All frames on |
199 | * non-aggregation frames to that station will be dropped by the fw | 199 | * shared queues (i.e. non-aggregation queues) to that station will be dropped |
200 | * (%TX_STATUS_FAIL_DEST_PS failure code). | 200 | * by the fw (%TX_STATUS_FAIL_DEST_PS failure code). |
201 | * | ||
201 | * AMPDUs are in a separate queue that is stopped by the fw. We just need to | 202 | * AMPDUs are in a separate queue that is stopped by the fw. We just need to |
202 | * let mac80211 know how many frames we have in these queues so that it can | 203 | * let mac80211 know when there are frames in these queues so that it can |
203 | * properly handle trigger frames. | 204 | * properly handle trigger frames. |
204 | * When the a trigger frame is received, mac80211 tells the driver to send | 205 | * |
205 | * frames from the AMPDU queues or AC queue depending on which queue are | 206 | * When a trigger frame is received, mac80211 tells the driver to send frames |
206 | * delivery-enabled and what TID has frames to transmit (Note that mac80211 has | 207 | * from the AMPDU queues or sends frames to non-aggregation queues itself, |
207 | * all the knowledege since all the non-agg frames are buffered / filtered, and | 208 | * depending on which ACs are delivery-enabled and what TID has frames to |
208 | * the driver tells mac80211 about agg frames). The driver needs to tell the fw | 209 | * transmit. Note that mac80211 has all the knowledege since all the non-agg |
209 | * to let frames out even if the station is asleep. This is done by | 210 | * frames are buffered / filtered, and the driver tells mac80211 about agg |
210 | * %iwl_mvm_sta_modify_sleep_tx_count. | 211 | * frames). The driver needs to tell the fw to let frames out even if the |
211 | * When we receive a frame from that station with PM bit unset, the | 212 | * station is asleep. This is done by %iwl_mvm_sta_modify_sleep_tx_count. |
212 | * driver needs to let the fw know that this station isn't alseep any more. | 213 | * |
213 | * This is done by %iwl_mvm_sta_modify_ps_wake. | 214 | * When we receive a frame from that station with PM bit unset, the driver |
214 | * | 215 | * needs to let the fw know that this station isn't asleep any more. This is |
215 | * TODO - EOSP handling | 216 | * done by %iwl_mvm_sta_modify_ps_wake in response to mac80211 signalling the |
217 | * station's wakeup. | ||
218 | * | ||
219 | * For a GO, the Service Period might be cut short due to an absence period | ||
220 | * of the GO. In this (and all other cases) the firmware notifies us with the | ||
221 | * EOSP_NOTIFICATION, and we notify mac80211 of that. Further frames that we | ||
222 | * already sent to the device will be rejected again. | ||
223 | * | ||
224 | * See also "AP support for powersaving clients" in mac80211.h. | ||
216 | */ | 225 | */ |
217 | 226 | ||
218 | /** | 227 | /** |
@@ -261,6 +270,12 @@ struct iwl_mvm_tid_data { | |||
261 | u16 ssn; | 270 | u16 ssn; |
262 | }; | 271 | }; |
263 | 272 | ||
273 | static inline u16 iwl_mvm_tid_queued(struct iwl_mvm_tid_data *tid_data) | ||
274 | { | ||
275 | return ieee80211_sn_sub(IEEE80211_SEQ_TO_SN(tid_data->seq_number), | ||
276 | tid_data->next_reclaimed); | ||
277 | } | ||
278 | |||
264 | /** | 279 | /** |
265 | * struct iwl_mvm_sta - representation of a station in the driver | 280 | * struct iwl_mvm_sta - representation of a station in the driver |
266 | * @sta_id: the index of the station in the fw (will be replaced by id_n_color) | 281 | * @sta_id: the index of the station in the fw (will be replaced by id_n_color) |
@@ -269,7 +284,11 @@ struct iwl_mvm_tid_data { | |||
269 | * @tid_disable_agg: bitmap: if bit(tid) is set, the fw won't send ampdus for | 284 | * @tid_disable_agg: bitmap: if bit(tid) is set, the fw won't send ampdus for |
270 | * tid. | 285 | * tid. |
271 | * @max_agg_bufsize: the maximal size of the AGG buffer for this station | 286 | * @max_agg_bufsize: the maximal size of the AGG buffer for this station |
287 | * @bt_reduced_txpower_dbg: debug mode in which %bt_reduced_txpower is forced | ||
288 | * by debugfs. | ||
272 | * @bt_reduced_txpower: is reduced tx power enabled for this station | 289 | * @bt_reduced_txpower: is reduced tx power enabled for this station |
290 | * @next_status_eosp: the next reclaimed packet is a PS-Poll response and | ||
291 | * we need to signal the EOSP | ||
273 | * @lock: lock to protect the whole struct. Since %tid_data is access from Tx | 292 | * @lock: lock to protect the whole struct. Since %tid_data is access from Tx |
274 | * and from Tx response flow, it needs a spinlock. | 293 | * and from Tx response flow, it needs a spinlock. |
275 | * @tid_data: per tid data. Look at %iwl_mvm_tid_data. | 294 | * @tid_data: per tid data. Look at %iwl_mvm_tid_data. |
@@ -287,7 +306,9 @@ struct iwl_mvm_sta { | |||
287 | u32 mac_id_n_color; | 306 | u32 mac_id_n_color; |
288 | u16 tid_disable_agg; | 307 | u16 tid_disable_agg; |
289 | u8 max_agg_bufsize; | 308 | u8 max_agg_bufsize; |
309 | bool bt_reduced_txpower_dbg; | ||
290 | bool bt_reduced_txpower; | 310 | bool bt_reduced_txpower; |
311 | bool next_status_eosp; | ||
291 | spinlock_t lock; | 312 | spinlock_t lock; |
292 | struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT]; | 313 | struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT]; |
293 | struct iwl_lq_sta lq_sta; | 314 | struct iwl_lq_sta lq_sta; |
@@ -345,6 +366,10 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
345 | struct ieee80211_sta *sta, u32 iv32, | 366 | struct ieee80211_sta *sta, u32 iv32, |
346 | u16 *phase1key); | 367 | u16 *phase1key); |
347 | 368 | ||
369 | int iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm, | ||
370 | struct iwl_rx_cmd_buffer *rxb, | ||
371 | struct iwl_device_cmd *cmd); | ||
372 | |||
348 | /* AMPDU */ | 373 | /* AMPDU */ |
349 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | 374 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, |
350 | int tid, u16 ssn, bool start); | 375 | int tid, u16 ssn, bool start); |
@@ -359,7 +384,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
359 | 384 | ||
360 | int iwl_mvm_add_aux_sta(struct iwl_mvm *mvm); | 385 | int iwl_mvm_add_aux_sta(struct iwl_mvm *mvm); |
361 | int iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta, | 386 | int iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta, |
362 | u32 qmask); | 387 | u32 qmask, enum nl80211_iftype iftype); |
363 | void iwl_mvm_dealloc_int_sta(struct iwl_mvm *mvm, | 388 | void iwl_mvm_dealloc_int_sta(struct iwl_mvm *mvm, |
364 | struct iwl_mvm_int_sta *sta); | 389 | struct iwl_mvm_int_sta *sta); |
365 | int iwl_mvm_send_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 390 | int iwl_mvm_send_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
@@ -375,7 +400,8 @@ void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, | |||
375 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, | 400 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, |
376 | struct ieee80211_sta *sta, | 401 | struct ieee80211_sta *sta, |
377 | enum ieee80211_frame_release_type reason, | 402 | enum ieee80211_frame_release_type reason, |
378 | u16 cnt); | 403 | u16 cnt, u16 tids, bool more_data, |
404 | bool agg); | ||
379 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, | 405 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, |
380 | bool drain); | 406 | bool drain); |
381 | 407 | ||