Commit 71e996be authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wlcore: add ap_event_mask

Add new ap_event_mask field, to indicate events that
should be unmasked only when there's an ap interface.

This is done in order to avoid spurious wakeups
when we don't care about the incoming event anyway.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
parent bbd74557
...@@ -1262,9 +1262,10 @@ static int wl12xx_boot(struct wl1271 *wl) ...@@ -1262,9 +1262,10 @@ static int wl12xx_boot(struct wl1271 *wl)
BA_SESSION_RX_CONSTRAINT_EVENT_ID | BA_SESSION_RX_CONSTRAINT_EVENT_ID |
REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
INACTIVE_STA_EVENT_ID | INACTIVE_STA_EVENT_ID |
MAX_TX_RETRY_EVENT_ID |
CHANNEL_SWITCH_COMPLETE_EVENT_ID; CHANNEL_SWITCH_COMPLETE_EVENT_ID;
wl->ap_event_mask = MAX_TX_RETRY_EVENT_ID;
ret = wlcore_boot_run_firmware(wl); ret = wlcore_boot_run_firmware(wl);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -988,10 +988,11 @@ static int wl18xx_boot(struct wl1271 *wl) ...@@ -988,10 +988,11 @@ static int wl18xx_boot(struct wl1271 *wl)
BA_SESSION_RX_CONSTRAINT_EVENT_ID | BA_SESSION_RX_CONSTRAINT_EVENT_ID |
REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
INACTIVE_STA_EVENT_ID | INACTIVE_STA_EVENT_ID |
MAX_TX_FAILURE_EVENT_ID |
CHANNEL_SWITCH_COMPLETE_EVENT_ID | CHANNEL_SWITCH_COMPLETE_EVENT_ID |
DFS_CHANNELS_CONFIG_COMPLETE_EVENT; DFS_CHANNELS_CONFIG_COMPLETE_EVENT;
wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID;
ret = wlcore_boot_run_firmware(wl); ret = wlcore_boot_run_firmware(wl);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -266,6 +266,7 @@ int wl1271_event_unmask(struct wl1271 *wl) ...@@ -266,6 +266,7 @@ int wl1271_event_unmask(struct wl1271 *wl)
{ {
int ret; int ret;
wl1271_debug(DEBUG_EVENT, "unmasking event_mask 0x%x", wl->event_mask);
ret = wl1271_acx_event_mbox_mask(wl, ~(wl->event_mask)); ret = wl1271_acx_event_mbox_mask(wl, ~(wl->event_mask));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -571,6 +571,12 @@ int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif) ...@@ -571,6 +571,12 @@ int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM); ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
if (ret < 0) if (ret < 0)
return ret; return ret;
/* unmask ap events */
wl->event_mask |= wl->ap_event_mask;
ret = wl1271_event_unmask(wl);
if (ret < 0)
return ret;
/* first STA, no APs */ /* first STA, no APs */
} else if (wl->sta_count == 0 && wl->ap_count == 0 && !is_ap) { } else if (wl->sta_count == 0 && wl->ap_count == 0 && !is_ap) {
u8 sta_auth = wl->conf.conn.sta_sleep_auth; u8 sta_auth = wl->conf.conn.sta_sleep_auth;
......
...@@ -2623,6 +2623,12 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, ...@@ -2623,6 +2623,12 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)) !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags))
goto unlock; goto unlock;
if (wl->ap_count == 0 && is_ap) {
/* mask ap events */
wl->event_mask &= ~wl->ap_event_mask;
wl1271_event_unmask(wl);
}
if (wl->ap_count == 0 && is_ap && wl->sta_count) { if (wl->ap_count == 0 && is_ap && wl->sta_count) {
u8 sta_auth = wl->conf.conn.sta_sleep_auth; u8 sta_auth = wl->conf.conn.sta_sleep_auth;
/* Configure for power according to debugfs */ /* Configure for power according to debugfs */
......
...@@ -307,6 +307,8 @@ struct wl1271 { ...@@ -307,6 +307,8 @@ struct wl1271 {
/* The mbox event mask */ /* The mbox event mask */
u32 event_mask; u32 event_mask;
/* events to unmask only when ap interface is up */
u32 ap_event_mask;
/* Mailbox pointers */ /* Mailbox pointers */
u32 mbox_size; u32 mbox_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment