wl12xx: AP-mode - disable beacon filtering on start up
authorArik Nemtsov <arik@wizery.com>
Mon, 18 Apr 2011 11:15:22 +0000 (14:15 +0300)
committerLuciano Coelho <coelho@ti.com>
Mon, 2 May 2011 07:30:48 +0000 (10:30 +0300)
New AP-mode FWs filter external beacons by default. Disable this
filtering on start up so we can properly configure ERP protection.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/acx.h
drivers/net/wireless/wl12xx/init.c

index 729f72a7b9126b9f8a44953258f21eb8374bfe8e..6860d7e9df70d0e8876c4747983083485e5c34f4 100644 (file)
@@ -1679,6 +1679,31 @@ out:
        return ret;
 }
 
+int wl1271_acx_set_ap_beacon_filter(struct wl1271 *wl, bool enable)
+{
+       struct acx_ap_beacon_filter *acx = NULL;
+       int ret;
+
+       wl1271_debug(DEBUG_ACX, "acx set ap beacon filter: %d", enable);
+
+       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
+       if (!acx)
+               return -ENOMEM;
+
+       acx->enable = enable ? 1 : 0;
+
+       ret = wl1271_cmd_configure(wl, ACX_AP_BEACON_FILTER_OPT,
+                                  acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("acx set ap beacon filter failed: %d", ret);
+               goto out;
+       }
+
+out:
+       kfree(acx);
+       return ret;
+}
+
 int wl1271_acx_fm_coex(struct wl1271 *wl)
 {
        struct wl1271_acx_fm_coex *acx;
index 828367d6266866de262336ccbb207704bf61d421..75338f9947cf87fefe1b91a438c9bc5ed0205b80 100644 (file)
@@ -303,7 +303,6 @@ struct acx_beacon_filter_option {
        struct acx_header header;
 
        u8 enable;
-
        /*
         * The number of beacons without the unicast TIM
         * bit set that the firmware buffers before
@@ -1188,6 +1187,13 @@ struct wl1271_acx_inconnection_sta {
        u8 padding1[2];
 } __packed;
 
+struct acx_ap_beacon_filter {
+       struct acx_header header;
+
+       u8 enable;
+       u8 pad[3];
+} __packed;
+
 /*
  * ACX_FM_COEX_CFG
  * set the FM co-existence parameters.
@@ -1265,6 +1271,7 @@ enum {
        ACX_TID_CFG                 = 0x001A,
        ACX_PS_RX_STREAMING         = 0x001B,
        ACX_BEACON_FILTER_OPT       = 0x001F,
+       ACX_AP_BEACON_FILTER_OPT    = 0x0020,
        ACX_NOISE_HIST              = 0x0021,
        ACX_HDK_VERSION             = 0x0022, /* ??? */
        ACX_PD_THRESHOLD            = 0x0023,
@@ -1388,6 +1395,7 @@ int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl);
 int wl1271_acx_sta_max_tx_retry(struct wl1271 *wl);
 int wl1271_acx_config_ps(struct wl1271 *wl);
 int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr);
+int wl1271_acx_set_ap_beacon_filter(struct wl1271 *wl, bool enable);
 int wl1271_acx_fm_coex(struct wl1271 *wl);
 
 #endif /* __WL1271_ACX_H__ */
index 060ca31818ebfb57e43713a000de6b5a9f83be91..e0de041e38f19240b0daab2bd0fc04e1dd54a8ab 100644 (file)
@@ -475,6 +475,14 @@ static int wl1271_ap_hw_init_post_mem(struct wl1271 *wl)
        if (ret < 0)
                return ret;
 
+       /*
+        * when operating as AP we want to receive external beacons for
+        * configuring ERP protection.
+        */
+       ret = wl1271_acx_set_ap_beacon_filter(wl, false);
+       if (ret < 0)
+               return ret;
+
        return 0;
 }