From 90494a90bea010af47547880634e0f1c52824a7d Mon Sep 17 00:00:00 2001 From: Juuso Oikarinen Date: Thu, 8 Jul 2010 17:50:00 +0300 Subject: wl1271: Work around AP's with broken ps-poll functionality Some AP's (such as Zyxel Prestige 600) have totally broken ps-poll functionality. When powersave is enabled, these AP's will set the TIM bit for a STA in beacons, but when the STA responds with a ps-poll, the AP does not respond with data. The wl1271 firmware is able to send an indication to the host, when this problem occurs. This patch adds implementation, which temporarily disables power-save in response to this indication, allowing the AP to transmit whatever data it has buffered for the STA / whatever data is inbound at that time. This patch does not make these AP's work reliably in PSM, but improves the chances of inbound data getting through. The side effect of this patch is increased power consumption when using a faulty AP. Signed-off-by: Juuso Oikarinen Reviewed-by: Teemu Paasikivi Signed-off-by: Luciano Coelho Signed-off-by: John W. Linville --- drivers/net/wireless/wl12xx/wl1271.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/wireless/wl12xx/wl1271.h') diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index 1b52ce6a84d7..cfdccdb86067 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h @@ -351,6 +351,7 @@ struct wl1271 { #define WL1271_FLAG_IRQ_RUNNING (10) #define WL1271_FLAG_IDLE (11) #define WL1271_FLAG_IDLE_REQUESTED (12) +#define WL1271_FLAG_PSPOLL_FAILURE (13) unsigned long flags; struct wl1271_partition_set part; @@ -445,6 +446,10 @@ struct wl1271 { struct completion *elp_compl; struct delayed_work elp_work; + struct delayed_work pspoll_work; + + /* counter for ps-poll delivery failures */ + int ps_poll_failures; /* retry counter for PSM entries */ u8 psm_entry_retry; -- cgit v1.2.3 From 08688d6b1a85484cc8e4a920afc60ffa6559999d Mon Sep 17 00:00:00 2001 From: Luciano Coelho Date: Thu, 8 Jul 2010 17:50:07 +0300 Subject: wl1271: rewritten scanning code This patch is a complete rewrite of the scanning code. It now includes a state machine to scan all four possible sets of channels independently: 2.4GHz active, 2.4GHz passive, 5GHz active and 5GHz passive. The wl1271 firmware doesn't allow these sets to be mixed, so up to several scan commands have to be issued. This patch also allows scanning more than 24 channels per set, by breaking the sets into smaller parts if needed (the firmware can scan a maximum of 24 channels at a time). Previously, the scanning code was erroneously scanning all channels possible actively, not complying with the CRDA values. This is also fixed with this patch. Signed-off-by: Luciano Coelho Reviewed-by: Saravanan Dhanabal Signed-off-by: John W. Linville --- drivers/net/wireless/wl12xx/wl1271.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'drivers/net/wireless/wl12xx/wl1271.h') diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index cfdccdb86067..b7c2995d4f40 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h @@ -300,12 +300,10 @@ struct wl1271_rx_mem_pool_addr { struct wl1271_scan { struct cfg80211_scan_request *req; + bool *scanned_ch; u8 state; u8 ssid[IW_ESSID_MAX_SIZE+1]; size_t ssid_len; - u8 active; - u8 high_prio; - u8 probe_requests; }; struct wl1271_if_operations { @@ -343,15 +341,14 @@ struct wl1271 { #define WL1271_FLAG_JOINED (2) #define WL1271_FLAG_GPIO_POWER (3) #define WL1271_FLAG_TX_QUEUE_STOPPED (4) -#define WL1271_FLAG_SCANNING (5) -#define WL1271_FLAG_IN_ELP (6) -#define WL1271_FLAG_PSM (7) -#define WL1271_FLAG_PSM_REQUESTED (8) -#define WL1271_FLAG_IRQ_PENDING (9) -#define WL1271_FLAG_IRQ_RUNNING (10) -#define WL1271_FLAG_IDLE (11) -#define WL1271_FLAG_IDLE_REQUESTED (12) -#define WL1271_FLAG_PSPOLL_FAILURE (13) +#define WL1271_FLAG_IN_ELP (5) +#define WL1271_FLAG_PSM (6) +#define WL1271_FLAG_PSM_REQUESTED (7) +#define WL1271_FLAG_IRQ_PENDING (8) +#define WL1271_FLAG_IRQ_RUNNING (9) +#define WL1271_FLAG_IDLE (10) +#define WL1271_FLAG_IDLE_REQUESTED (11) +#define WL1271_FLAG_PSPOLL_FAILURE (12) unsigned long flags; struct wl1271_partition_set part; -- cgit v1.2.3