aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-dev.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-13 14:56:37 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-18 17:09:08 -0500
commit6ab10ff8738dfb098fd32132b7ebcf5cdb43ebde (patch)
tree7bb2cf0ce4d1b286aa14f4e0ae9d24dfee8b75c2 /drivers/net/wireless/iwlwifi/iwl-dev.h
parent9bb487b406692e172b15eba58de7d69358ac2005 (diff)
iwlwifi: handle unicast PS buffering
Using the new mac80211 functionality, this makes iwlwifi handle unicast PS buffering correctly. The device works like this: * when a station goes to sleep, the microcode notices this and marks the station as asleep * when the station is marked asleep, the microcode refuses to transmit to the station and rejects all frames queued to it with the failure status code TX_STATUS_FAIL_DEST_PS (a previous patch handled this correctly) * when we need to send frames to the station _although_ it is asleep, we need to tell the ucode how many, and this is asynchronous with sending so we cannot just send the frames, we need to wait for all other frames to be flushed, and then update the counter before sending out the poll response frames. This is handled partially in the driver and partially in mac80211. In order to do all this correctly, we need to * keep track of how many frames are pending for each associated client station (avoid doing it for other stations to avoid the atomic ops) * tell mac80211 that we driver-block the PS status while there are still frames pending on the queues, and once they are all rejected (due to the dest sta being in PS) unblock mac80211 Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index a474383ec0b8..f1601cfebc29 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -545,15 +545,11 @@ struct iwl_qos_info {
545 struct iwl_qosparam_cmd def_qos_parm; 545 struct iwl_qosparam_cmd def_qos_parm;
546}; 546};
547 547
548#define STA_PS_STATUS_WAKE 0
549#define STA_PS_STATUS_SLEEP 1
550
551 548
552struct iwl3945_station_entry { 549struct iwl3945_station_entry {
553 struct iwl3945_addsta_cmd sta; 550 struct iwl3945_addsta_cmd sta;
554 struct iwl_tid_data tid[MAX_TID_COUNT]; 551 struct iwl_tid_data tid[MAX_TID_COUNT];
555 u8 used; 552 u8 used;
556 u8 ps_status;
557 struct iwl_hw_key keyinfo; 553 struct iwl_hw_key keyinfo;
558}; 554};
559 555
@@ -561,7 +557,6 @@ struct iwl_station_entry {
561 struct iwl_addsta_cmd sta; 557 struct iwl_addsta_cmd sta;
562 struct iwl_tid_data tid[MAX_TID_COUNT]; 558 struct iwl_tid_data tid[MAX_TID_COUNT];
563 u8 used; 559 u8 used;
564 u8 ps_status;
565 struct iwl_hw_key keyinfo; 560 struct iwl_hw_key keyinfo;
566}; 561};
567 562
@@ -571,11 +566,12 @@ struct iwl_station_entry {
571 * When mac80211 creates a station it reserves some space (hw->sta_data_size) 566 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
572 * in the structure for use by driver. This structure is places in that 567 * in the structure for use by driver. This structure is places in that
573 * space. 568 * space.
574 *
575 * At the moment use it for the station's rate scaling information.
576 */ 569 */
577struct iwl_station_priv { 570struct iwl_station_priv {
578 struct iwl_lq_sta lq_sta; 571 struct iwl_lq_sta lq_sta;
572 atomic_t pending_frames;
573 bool client;
574 bool asleep;
579}; 575};
580 576
581/* one for each uCode image (inst/data, boot/init/runtime) */ 577/* one for each uCode image (inst/data, boot/init/runtime) */