wlcore: add quirk to disable ELP
authorLuciano Coelho <coelho@ti.com>
Wed, 30 Nov 2011 13:07:20 +0000 (15:07 +0200)
committerLuciano Coelho <coelho@ti.com>
Thu, 12 Apr 2012 05:43:58 +0000 (08:43 +0300)
ELP is a very complicated process in the firmware.  Due to its
complexity, in some early firmware revisions, the ELP feature is
disabled.  To support this cases, this patch adds a quirk that
disables ELP mode.

When ELP is not supported, do not attempt to enter ELP when requested by
the driver.

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

index 3cb75db39b9e2ceaff648cd0f835ff40b2fcc68d..2aae201f776dbc30cb1c06acc715e7e0d8327125 100644 (file)
@@ -408,11 +408,6 @@ int wlcore_boot_run_firmware(struct wl1271 *wl)
        wl1271_debug(DEBUG_MAILBOX, "MBOX ptrs: 0x%x 0x%x",
                     wl->mbox_ptr[0], wl->mbox_ptr[1]);
 
-       /*
-        * TODO: wl12xx used to set the partition here, but it seems
-        * that it can be done later.  Make sure this is okay.
-        */
-
        wl1271_boot_fw_version(wl);
 
        /*
index c146d8ed305496de117ac8bd8c684a7c86467d55..d8c22351a73ec4f07b217b5b243372f82ec4eb57 100644 (file)
@@ -581,10 +581,17 @@ int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
                        if (ret < 0)
                                return ret;
                } else if (!wl->sta_count) {
-                       /* Configure for ELP power saving */
-                       ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
-                       if (ret < 0)
-                               return ret;
+                       if (wl->quirks & WLCORE_QUIRK_NO_ELP) {
+                               /* Configure for power always on */
+                               ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
+                               if (ret < 0)
+                                       return ret;
+                       } else {
+                               /* Configure for ELP power saving */
+                               ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
+                               if (ret < 0)
+                                       return ret;
+                       }
                }
        }
 
index cfeb114843eeeba70629753cbce97751bc1f828b..756eee2257b4bc51d857f3068c46b06cc5844907 100644 (file)
@@ -73,6 +73,9 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
 {
        struct wl12xx_vif *wlvif;
 
+       if (wl->quirks & WLCORE_QUIRK_NO_ELP)
+               return;
+
        /* we shouldn't get consecutive sleep requests */
        if (WARN_ON(test_and_set_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags)))
                return;
index 984dda73134495ac1c59276a7b20d2b6acf29a6a..66c33b8c0119e5fd63d041c7aa7b5624cca3b6ad 100644 (file)
@@ -324,6 +324,9 @@ int wlcore_free_hw(struct wl1271 *wl);
 /* Older firmwares use an old NVS format */
 #define WLCORE_QUIRK_LEGACY_NVS                        BIT(5)
 
+/* Some firmwares may not support ELP */
+#define WLCORE_QUIRK_NO_ELP                    BIT(6)
+
 /* TODO: move to the lower drivers when all usages are abstracted */
 #define CHIP_ID_1271_PG10              (0x4030101)
 #define CHIP_ID_1271_PG20              (0x4030111)