提交 a0c7b782 编写于 作者: E Eliad Peller 提交者: Luciano Coelho

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: NEliad Peller <eliad@wizery.com>
Signed-off-by: NLuciano Coelho <coelho@ti.com>
上级 5b37ddfe
...@@ -2384,6 +2384,10 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -2384,6 +2384,10 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
bool idle) bool idle)
{ {
int ret; int ret;
bool cur_idle = !test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
if (idle == cur_idle)
return 0;
if (idle) { if (idle) {
/* no need to croc if we weren't busy (e.g. during boot) */ /* 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,7 +2406,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
ACX_KEEP_ALIVE_TPL_INVALID); ACX_KEEP_ALIVE_TPL_INVALID);
if (ret < 0) if (ret < 0)
goto out; goto out;
set_bit(WL1271_FLAG_IDLE, &wl->flags); clear_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
} else { } else {
/* The current firmware only supports sched_scan in idle */ /* The current firmware only supports sched_scan in idle */
if (wl->sched_scanning) { if (wl->sched_scanning) {
...@@ -2413,7 +2417,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -2413,7 +2417,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
ret = wl12xx_start_dev(wl, wlvif); ret = wl12xx_start_dev(wl, wlvif);
if (ret < 0) if (ret < 0)
goto out; goto out;
clear_bit(WL1271_FLAG_IDLE, &wl->flags); set_bit(WLVIF_FLAG_IN_USE, &wlvif->flags);
} }
out: out:
......
...@@ -53,8 +53,11 @@ void wl1271_elp_work(struct work_struct *work) ...@@ -53,8 +53,11 @@ void wl1271_elp_work(struct work_struct *work)
goto out; goto out;
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
if (wlvif->bss_type == BSS_TYPE_AP_BSS)
goto out;
if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) &&
!test_bit(WL1271_FLAG_IDLE, &wl->flags)) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
goto out; goto out;
} }
...@@ -78,8 +81,11 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl) ...@@ -78,8 +81,11 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
return; return;
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
if (wlvif->bss_type == BSS_TYPE_AP_BSS)
return;
if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) && if (!test_bit(WLVIF_FLAG_PSM, &wlvif->flags) &&
!test_bit(WL1271_FLAG_IDLE, &wl->flags)) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
return; return;
} }
......
...@@ -703,7 +703,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -703,7 +703,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif)
if (wlvif->bss_type != BSS_TYPE_STA_BSS) if (wlvif->bss_type != BSS_TYPE_STA_BSS)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!test_bit(WL1271_FLAG_IDLE, &wl->flags)) if (test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
return -EBUSY; return -EBUSY;
start = kzalloc(sizeof(*start), GFP_KERNEL); start = kzalloc(sizeof(*start), GFP_KERNEL);
......
...@@ -241,7 +241,6 @@ enum wl12xx_flags { ...@@ -241,7 +241,6 @@ enum wl12xx_flags {
WL1271_FLAG_IN_ELP, WL1271_FLAG_IN_ELP,
WL1271_FLAG_ELP_REQUESTED, WL1271_FLAG_ELP_REQUESTED,
WL1271_FLAG_IRQ_RUNNING, WL1271_FLAG_IRQ_RUNNING,
WL1271_FLAG_IDLE,
WL1271_FLAG_FW_TX_BUSY, WL1271_FLAG_FW_TX_BUSY,
WL1271_FLAG_DUMMY_PACKET_PENDING, WL1271_FLAG_DUMMY_PACKET_PENDING,
WL1271_FLAG_SUSPENDED, WL1271_FLAG_SUSPENDED,
...@@ -262,6 +261,7 @@ enum wl12xx_vif_flags { ...@@ -262,6 +261,7 @@ enum wl12xx_vif_flags {
WLVIF_FLAG_PSPOLL_FAILURE, WLVIF_FLAG_PSPOLL_FAILURE,
WLVIF_FLAG_CS_PROGRESS, WLVIF_FLAG_CS_PROGRESS,
WLVIF_FLAG_AP_PROBE_RESP_SET, WLVIF_FLAG_AP_PROBE_RESP_SET,
WLVIF_FLAG_IN_USE,
}; };
struct wl1271_link { struct wl1271_link {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册