wl1251: allow to disable dynamic ps
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 7 Jun 2015 00:39:52 +0000 (03:39 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 7 Jun 2015 00:39:52 +0000 (03:39 +0300)
Some people with CC units reported they get better wifi without dynamic
PS enabled, so allow to disable it. I guess this could be related to
missing clock driver resistor tweak, which breaks chip's own PS.

drivers/net/wireless/wl1251/main.c

index 42b8df5..e7f1818 100644 (file)
 #include "debugfs.h"
 #include "boot.h"
 
+static bool use_fw_ps = true;
+module_param(use_fw_ps, bool, 0644);
+MODULE_PARM_DESC(use_fw_ps, "Enable powersave once and leave it for chip's "
+                           "firmware to manage. When disabled, mac80211 "
+                           "will toggle powersave on tx activity instead. "
+                           "Default: y/Y/1");
+
 void wl1251_enable_interrupts(struct wl1251 *wl)
 {
        wl->if_ops->enable_irq(wl);
@@ -1596,11 +1603,13 @@ int wl1251_init_ieee80211(struct wl1251 *wl)
 
        wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
                IEEE80211_HW_SUPPORTS_PS |
-               IEEE80211_HW_SUPPORTS_DYNAMIC_PS |
                IEEE80211_HW_BEACON_FILTER |
                IEEE80211_HW_SUPPORTS_UAPSD |
                IEEE80211_HW_SUPPORTS_CQM_RSSI;
 
+       if (use_fw_ps)
+               wl->hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+
        wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
                                         BIT(NL80211_IFTYPE_ADHOC);
        wl->hw->wiphy->max_scan_ssids = 1;