aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorShanyu Zhao <shanyu.zhao@intel.com>2010-09-21 15:06:18 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-07 18:53:49 -0400
commit642454cc0774e0774bc1ccb4292d6dc0abd06d20 (patch)
treef42e1d93e0ba197735982b5323142d435586fd63 /drivers/net/wireless/iwlwifi
parent65cccfb03d0dc99fd213d57be5f60f8ca6a60824 (diff)
iwlagn: fix default calibration table size
iwlagn driver uses the IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE as the chain noise reset calibration index and IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE+1 as the chain noise gain calibration index, if not specified by the TLV value in the new firmware format. However, this is broken if we need to add more calibrations like the temperature offset calibration because we increased IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE by 1. To fix this issue, define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE and use it as the calibration index instead. We still keep the IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE as a sanity check for the TLV value given by ucode. Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 1b682ddcf4e8..c4fe3f94c366 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2062,7 +2062,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
2062 struct iwlagn_ucode_capabilities ucode_capa = { 2062 struct iwlagn_ucode_capabilities ucode_capa = {
2063 .max_probe_length = 200, 2063 .max_probe_length = 200,
2064 .standard_phy_calibration_size = 2064 .standard_phy_calibration_size =
2065 IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE, 2065 IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE,
2066 }; 2066 };
2067 2067
2068 memset(&pieces, 0, sizeof(pieces)); 2068 memset(&pieces, 0, sizeof(pieces));
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index fe652568fec7..74b78d858936 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3784,7 +3784,8 @@ struct iwl_enhance_sensitivity_cmd {
3784 */ 3784 */
3785 3785
3786/* Phy calibration command for series */ 3786/* Phy calibration command for series */
3787 3787/* The default calibrate table size if not specified by firmware */
3788#define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18
3788enum { 3789enum {
3789 IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7, 3790 IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7,
3790 IWL_PHY_CALIBRATE_DC_CMD = 8, 3791 IWL_PHY_CALIBRATE_DC_CMD = 8,