diff options
author | Arik Nemtsov <arikx.nemtsov@intel.com> | 2014-12-28 02:23:16 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-12 03:57:29 -0400 |
commit | 5711cac489d06cc9c3cdcd513c810b7148beb49d (patch) | |
tree | 58e2b813e65db801667c77118a9f1d0e7b174b85 | |
parent | ce5000710bd80b87917875897d74167a0a07b342 (diff) |
iwlwifi: allow disabling LAR via module param
This module parameter is useful for debugging NVM and LAR related issues.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-drv.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-modparams.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/nvm.c | 13 |
4 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 141331d41abf..f1d73d5e6eff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c | |||
@@ -1546,6 +1546,10 @@ module_param_named(d0i3_disable, iwlwifi_mod_params.d0i3_disable, | |||
1546 | bool, S_IRUGO); | 1546 | bool, S_IRUGO); |
1547 | MODULE_PARM_DESC(d0i3_disable, "disable d0i3 functionality (default: Y)"); | 1547 | MODULE_PARM_DESC(d0i3_disable, "disable d0i3 functionality (default: Y)"); |
1548 | 1548 | ||
1549 | module_param_named(lar_disable, iwlwifi_mod_params.lar_disable, | ||
1550 | bool, S_IRUGO); | ||
1551 | MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)"); | ||
1552 | |||
1549 | module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, | 1553 | module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, |
1550 | bool, S_IRUGO | S_IWUSR); | 1554 | bool, S_IRUGO | S_IWUSR); |
1551 | #ifdef CONFIG_IWLWIFI_UAPSD | 1555 | #ifdef CONFIG_IWLWIFI_UAPSD |
diff --git a/drivers/net/wireless/iwlwifi/iwl-modparams.h b/drivers/net/wireless/iwlwifi/iwl-modparams.h index e8eabd21ccfe..ac2b90df8413 100644 --- a/drivers/net/wireless/iwlwifi/iwl-modparams.h +++ b/drivers/net/wireless/iwlwifi/iwl-modparams.h | |||
@@ -103,6 +103,7 @@ enum iwl_disable_11n { | |||
103 | * @debug_level: levels are IWL_DL_* | 103 | * @debug_level: levels are IWL_DL_* |
104 | * @ant_coupling: antenna coupling in dB, default = 0 | 104 | * @ant_coupling: antenna coupling in dB, default = 0 |
105 | * @d0i3_disable: disable d0i3, default = 1, | 105 | * @d0i3_disable: disable d0i3, default = 1, |
106 | * @lar_disable: disable LAR (regulatory), default = 0 | ||
106 | * @fw_monitor: allow to use firmware monitor | 107 | * @fw_monitor: allow to use firmware monitor |
107 | */ | 108 | */ |
108 | struct iwl_mod_params { | 109 | struct iwl_mod_params { |
@@ -121,6 +122,7 @@ struct iwl_mod_params { | |||
121 | char *nvm_file; | 122 | char *nvm_file; |
122 | bool uapsd_disable; | 123 | bool uapsd_disable; |
123 | bool d0i3_disable; | 124 | bool d0i3_disable; |
125 | bool lar_disable; | ||
124 | bool fw_monitor; | 126 | bool fw_monitor; |
125 | }; | 127 | }; |
126 | 128 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index a196c7859086..207c3a847ed4 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -917,6 +917,10 @@ static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm) | |||
917 | bool nvm_lar = mvm->nvm_data->lar_enabled; | 917 | bool nvm_lar = mvm->nvm_data->lar_enabled; |
918 | bool tlv_lar = mvm->fw->ucode_capa.capa[0] & | 918 | bool tlv_lar = mvm->fw->ucode_capa.capa[0] & |
919 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT; | 919 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT; |
920 | |||
921 | if (iwlwifi_mod_params.lar_disable) | ||
922 | return false; | ||
923 | |||
920 | /* | 924 | /* |
921 | * Enable LAR only if it is supported by the FW (TLV) && | 925 | * Enable LAR only if it is supported by the FW (TLV) && |
922 | * enabled in the NVM | 926 | * enabled in the NVM |
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index eb40c89624d3..5a16e0d79352 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c | |||
@@ -264,7 +264,7 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
264 | { | 264 | { |
265 | struct iwl_nvm_section *sections = mvm->nvm_sections; | 265 | struct iwl_nvm_section *sections = mvm->nvm_sections; |
266 | const __le16 *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; | 266 | const __le16 *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; |
267 | bool is_family_8000_a_step = false; | 267 | bool is_family_8000_a_step = false, lar_enabled; |
268 | 268 | ||
269 | /* Checking for required sections */ | 269 | /* Checking for required sections */ |
270 | if (mvm->trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) { | 270 | if (mvm->trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) { |
@@ -312,13 +312,14 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
312 | (const __le16 *)sections[NVM_SECTION_TYPE_MAC_OVERRIDE].data; | 312 | (const __le16 *)sections[NVM_SECTION_TYPE_MAC_OVERRIDE].data; |
313 | phy_sku = (const __le16 *)sections[NVM_SECTION_TYPE_PHY_SKU].data; | 313 | phy_sku = (const __le16 *)sections[NVM_SECTION_TYPE_PHY_SKU].data; |
314 | 314 | ||
315 | lar_enabled = !iwlwifi_mod_params.lar_disable && | ||
316 | (mvm->fw->ucode_capa.capa[0] & | ||
317 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); | ||
318 | |||
315 | return iwl_parse_nvm_data(mvm->trans->dev, mvm->cfg, hw, sw, calib, | 319 | return iwl_parse_nvm_data(mvm->trans->dev, mvm->cfg, hw, sw, calib, |
316 | regulatory, mac_override, phy_sku, | 320 | regulatory, mac_override, phy_sku, |
317 | mvm->fw->valid_tx_ant, | 321 | mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant, |
318 | mvm->fw->valid_rx_ant, | 322 | lar_enabled, is_family_8000_a_step); |
319 | mvm->fw->ucode_capa.capa[0] & | ||
320 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT, | ||
321 | is_family_8000_a_step); | ||
322 | } | 323 | } |
323 | 324 | ||
324 | #define MAX_NVM_FILE_LEN 16384 | 325 | #define MAX_NVM_FILE_LEN 16384 |