wlcore: add ap_event_mask
authorEliad Peller <eliad@wizery.com>
Mon, 9 Sep 2013 09:24:34 +0000 (12:24 +0300)
committerLuciano Coelho <luciano.coelho@intel.com>
Wed, 23 Oct 2013 06:47:39 +0000 (09:47 +0300)
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: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wl18xx/main.c
drivers/net/wireless/ti/wlcore/event.c
drivers/net/wireless/ti/wlcore/init.c
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/wlcore.h

index 591526b991547281e4e04f341e071d57c84d58e2..7d88a950383a85e4702a27f00c83ab664e0e5d30 100644 (file)
@@ -1262,9 +1262,10 @@ static int wl12xx_boot(struct wl1271 *wl)
                BA_SESSION_RX_CONSTRAINT_EVENT_ID |
                REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
                INACTIVE_STA_EVENT_ID |
-               MAX_TX_RETRY_EVENT_ID |
                CHANNEL_SWITCH_COMPLETE_EVENT_ID;
 
+       wl->ap_event_mask = MAX_TX_RETRY_EVENT_ID;
+
        ret = wlcore_boot_run_firmware(wl);
        if (ret < 0)
                goto out;
index b48d01db3ef44a903b3c4a3e20c612ea84a2d961..3804a554ecf044bdb968963d8b72c659389a7cce 100644 (file)
@@ -988,10 +988,11 @@ static int wl18xx_boot(struct wl1271 *wl)
                BA_SESSION_RX_CONSTRAINT_EVENT_ID |
                REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
                INACTIVE_STA_EVENT_ID |
-               MAX_TX_FAILURE_EVENT_ID |
                CHANNEL_SWITCH_COMPLETE_EVENT_ID |
                DFS_CHANNELS_CONFIG_COMPLETE_EVENT;
 
+       wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID;
+
        ret = wlcore_boot_run_firmware(wl);
        if (ret < 0)
                goto out;
index 67f61689b49edcba1e54198db538eb277aa4bda0..8d3b34965db3475f64178eeb6463ec2589434c3f 100644 (file)
@@ -266,6 +266,7 @@ int wl1271_event_unmask(struct wl1271 *wl)
 {
        int ret;
 
+       wl1271_debug(DEBUG_EVENT, "unmasking event_mask 0x%x", wl->event_mask);
        ret = wl1271_acx_event_mbox_mask(wl, ~(wl->event_mask));
        if (ret < 0)
                return ret;
index 5c6f11e157d9b0016633dfe932f34984fedeb65c..7699f9d07e2636e3528fa7e3c28f260bfaa63e3f 100644 (file)
@@ -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);
                if (ret < 0)
                        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 */
        } else if (wl->sta_count == 0 && wl->ap_count == 0 && !is_ap) {
                u8 sta_auth = wl->conf.conn.sta_sleep_auth;
index bbdd10632373d0481ae7dd21b331ce566903c77c..31476656ac8142ec7103f4ab3b5701eba6870ff7 100644 (file)
@@ -2623,6 +2623,12 @@ deinit:
            !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags))
                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) {
                u8 sta_auth = wl->conf.conn.sta_sleep_auth;
                /* Configure for power according to debugfs */
index 54ce5d5e84db0be55da713ddcdbcd19818d507f3..f9272229d73d841c45ab44c05111a45c5af35195 100644 (file)
@@ -307,6 +307,8 @@ struct wl1271 {
 
        /* The mbox event mask */
        u32 event_mask;
+       /* events to unmask only when ap interface is up */
+       u32 ap_event_mask;
 
        /* Mailbox pointers */
        u32 mbox_size;