iwlwifi: make uapsd_disable module param a bitmap
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 15 Mar 2016 09:04:29 +0000 (11:04 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 30 Mar 2016 13:21:23 +0000 (16:21 +0300)
This allows to disable uapsd for BSS only, or P2P client
separately. Remove the now unneeded
IWL_MVM_P2P_UAPSD_STANDALONE constant.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
drivers/net/wireless/intel/iwlwifi/mvm/constants.h
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index f899666acb41f44f56a326f5b0bfcff6dce88bde..2cd9c3139a1ca2132dab9dd35be70fb8d2be4d4e 100644 (file)
@@ -1561,7 +1561,7 @@ struct iwl_mod_params iwlwifi_mod_params = {
        .d0i3_disable = true,
        .d0i3_entry_delay = 1000,
 #ifndef CONFIG_IWLWIFI_UAPSD
-       .uapsd_disable = true,
+       .uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT,
 #endif /* CONFIG_IWLWIFI_UAPSD */
        /* the rest are 0 by default */
 };
@@ -1681,11 +1681,13 @@ module_param_named(lar_disable, iwlwifi_mod_params.lar_disable,
 MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)");
 
 module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable,
-                  bool, S_IRUGO | S_IWUSR);
+                  uint, S_IRUGO | S_IWUSR);
 #ifdef CONFIG_IWLWIFI_UAPSD
-MODULE_PARM_DESC(uapsd_disable, "disable U-APSD functionality (default: N)");
+MODULE_PARM_DESC(uapsd_disable,
+                "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 0)");
 #else
-MODULE_PARM_DESC(uapsd_disable, "disable U-APSD functionality (default: Y)");
+MODULE_PARM_DESC(uapsd_disable,
+                "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)");
 #endif
 
 /*
index d1a5dd1602f5894c52a286d18b18ad233a7b0715..6c5c2f9f73a26dde0594304e5c6f261532e5d6aa 100644 (file)
@@ -92,6 +92,11 @@ enum iwl_amsdu_size {
        IWL_AMSDU_12K = 2,
 };
 
+enum iwl_uapsd_disable {
+       IWL_DISABLE_UAPSD_BSS           = BIT(0),
+       IWL_DISABLE_UAPSD_P2P_CLIENT    = BIT(1),
+};
+
 /**
  * struct iwl_mod_params
  *
@@ -109,7 +114,8 @@ enum iwl_amsdu_size {
  * @debug_level: levels are IWL_DL_*
  * @ant_coupling: antenna coupling in dB, default = 0
  * @nvm_file: specifies a external NVM file
- * @uapsd_disable: disable U-APSD, default = 1
+ * @uapsd_disable: disable U-APSD, see %enum iwl_uapsd_disable, default =
+ *     IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT
  * @d0i3_disable: disable d0i3, default = 1,
  * @d0i3_entry_delay: time to wait after no refs are taken before
  *     entering D0i3 (in msecs)
@@ -131,7 +137,7 @@ struct iwl_mod_params {
 #endif
        int ant_coupling;
        char *nvm_file;
-       bool uapsd_disable;
+       u32 uapsd_disable;
        bool d0i3_disable;
        unsigned int d0i3_entry_delay;
        bool lar_disable;
index 4b560e4417ee55fa1da2539dbe7f3c1482fe8790..b96b1c6a97fa2db0a0474046ee23e97cbfec34a4 100644 (file)
@@ -75,7 +75,6 @@
 #define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT      (10 * USEC_PER_MSEC)
 #define IWL_MVM_SHORT_PS_TX_DATA_TIMEOUT       (2 * 1024) /* defined in TU */
 #define IWL_MVM_SHORT_PS_RX_DATA_TIMEOUT       (40 * 1024) /* defined in TU */
-#define IWL_MVM_P2P_UAPSD_STANDALONE           0
 #define IWL_MVM_P2P_LOWLATENCY_PS_ENABLE       0
 #define IWL_MVM_UAPSD_RX_DATA_TIMEOUT          (50 * USEC_PER_MSEC)
 #define IWL_MVM_UAPSD_TX_DATA_TIMEOUT          (50 * USEC_PER_MSEC)
index cff9c16e492048068ab3a19f686f583010a75667..1a3481ba144668dfbd9f3513bfbdfc98a6c014f6 100644 (file)
@@ -2345,7 +2345,8 @@ static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                return;
        }
 
-       if (iwlwifi_mod_params.uapsd_disable) {
+       if (!vif->p2p &&
+           (iwlwifi_mod_params.uapsd_disable & IWL_DISABLE_UAPSD_BSS)) {
                vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD;
                return;
        }
index 2e0a8824aabaeb9977c084823212111cebf8c0e3..02ef1d91478c3d936c88bfb8a4ec8ab78f85aad0 100644 (file)
@@ -1072,7 +1072,8 @@ bool iwl_mvm_is_p2p_standalone_uapsd_supported(struct iwl_mvm *mvm)
 {
        return fw_has_capa(&mvm->fw->ucode_capa,
                           IWL_UCODE_TLV_CAPA_P2P_STANDALONE_UAPSD) &&
-               IWL_MVM_P2P_UAPSD_STANDALONE;
+               !(iwlwifi_mod_params.uapsd_disable &
+                 IWL_DISABLE_UAPSD_P2P_CLIENT);
 }
 
 static inline bool iwl_mvm_has_new_rx_api(struct iwl_mvm *mvm)