aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-12-18 13:25:41 -0500
committerLuciano Coelho <coelho@ti.com>2011-12-20 15:30:14 -0500
commita0c7b7825e026c7acf63fd92a5182efd3aff637f (patch)
tree84e316833522bc0c644129c2abcd23ca7d81ab2f
parent5b37ddfec23c17e16b99d8b5c5d1815b312af060 (diff)
wl12xx: make WL1271_FLAG_IDLE flag per-vif
This flag should be set per-vif, rather than globally. Rename the flag to indicate IN_USE (rather than IDLE), as in the default configuration (i.e. flag is clear) the vif should be idle. Change all the bit operations (and elp conditions) appropriately. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/main.c8
-rw-r--r--drivers/net/wireless/wl12xx/ps.c10
-rw-r--r--drivers/net/wireless/wl12xx/scan.c2
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h2
4 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 92a0577cb062..69f6937d4029 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2384,6 +2384,10 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2384 bool idle) 2384 bool idle)
2385{ 2385{
2386 int ret; 2386 int ret;
2387 bool cur_idle = !test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
2388
2389 if (idle == cur_idle)
2390 return 0;
2387 2391
2388 if (idle) { 2392 if (idle) {
2389 /* no need to croc if we weren't busy (e.g. during boot) */ 2393 /* no need to croc if we weren't busy (e.g. during boot) */
@@ -2402,7 +2406,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2402 ACX_KEEP_ALIVE_TPL_INVALID); 2406 ACX_KEEP_ALIVE_TPL_INVALID);
2403 if (ret < 0) 2407 if (ret < 0)
2404 goto out; 2408 goto out;
2405 set_bit(WL1271_FLAG_IDLE, &wl->flags); 2409 clear_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
2406 } else { 2410 } else {
2407 /* The current firmware only supports sched_scan in idle */ 2411 /* The current firmware only supports sched_scan in idle */
2408 if (wl->sched_scanning) { 2412 if (wl->sched_scanning) {
@@ -2413,7 +2417,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2413 ret = wl12xx_start_dev(wl, wlvif); 2417 ret = wl12xx_start_dev(wl, wlvif);
2414 if (ret < 0) 2418 if (ret < 0)
2415 goto out; 2419 goto out;
2416 clear_bit(WL1271_FLAG_IDLE, &wl->flags); 2420 set_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
2417 } 2421 }
2418 2422
2419out: 2423out:
diff --git a/drivers/net/wireless/wl12xx/ps.c b/drivers/net/wireless/wl12xx/ps.c
index a7a11088dd31..a2bdacdd7e1d 100644
--- a/drivers/net/wireless/wl12xx/ps.c
+++ b/drivers/net/wireless/wl12xx/ps.c
@@ -53,8 +53,11 @@ void wl1271_elp_work(struct work_struct *work)
53 goto out; 53 goto out;
54 54
55 wl12xx_for_each_wlvif(wl, wlvif) { 55 wl12xx_for_each_wlvif(wl, wlvif) {
56 if (wlvif->bss_type == BSS_TYPE_AP_BSS)
57 goto out;
58
56 if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && 59 if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) &&
57 !test_bit(WL1271_FLAG_IDLE, &wl->flags)) 60 test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
58 goto out; 61 goto out;
59 } 62 }
60 63
@@ -78,8 +81,11 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
78 return; 81 return;
79 82
80 wl12xx_for_each_wlvif(wl, wlvif) { 83 wl12xx_for_each_wlvif(wl, wlvif) {
84 if (wlvif->bss_type == BSS_TYPE_AP_BSS)
85 return;
86
81 if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && 87 if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) &&
82 !test_bit(WL1271_FLAG_IDLE, &wl->flags)) 88 test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
83 return; 89 return;
84 } 90 }
85 91
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 8599dab1fe2a..108765ab7755 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -703,7 +703,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif)
703 if (wlvif->bss_type != BSS_TYPE_STA_BSS) 703 if (wlvif->bss_type != BSS_TYPE_STA_BSS)
704 return -EOPNOTSUPP; 704 return -EOPNOTSUPP;
705 705
706 if (!test_bit(WL1271_FLAG_IDLE, &wl->flags)) 706 if (test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
707 return -EBUSY; 707 return -EBUSY;
708 708
709 start = kzalloc(sizeof(*start), GFP_KERNEL); 709 start = kzalloc(sizeof(*start), GFP_KERNEL);
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index d21f71ff6f64..b2b09cd02022 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -241,7 +241,6 @@ enum wl12xx_flags {
241 WL1271_FLAG_IN_ELP, 241 WL1271_FLAG_IN_ELP,
242 WL1271_FLAG_ELP_REQUESTED, 242 WL1271_FLAG_ELP_REQUESTED,
243 WL1271_FLAG_IRQ_RUNNING, 243 WL1271_FLAG_IRQ_RUNNING,
244 WL1271_FLAG_IDLE,
245 WL1271_FLAG_FW_TX_BUSY, 244 WL1271_FLAG_FW_TX_BUSY,
246 WL1271_FLAG_DUMMY_PACKET_PENDING, 245 WL1271_FLAG_DUMMY_PACKET_PENDING,
247 WL1271_FLAG_SUSPENDED, 246 WL1271_FLAG_SUSPENDED,
@@ -262,6 +261,7 @@ enum wl12xx_vif_flags {
262 WLVIF_FLAG_PSPOLL_FAILURE, 261 WLVIF_FLAG_PSPOLL_FAILURE,
263 WLVIF_FLAG_CS_PROGRESS, 262 WLVIF_FLAG_CS_PROGRESS,
264 WLVIF_FLAG_AP_PROBE_RESP_SET, 263 WLVIF_FLAG_AP_PROBE_RESP_SET,
264 WLVIF_FLAG_IN_USE,
265}; 265};
266 266
267struct wl1271_link { 267struct wl1271_link {