Skip to content

Commit

Permalink
iwlagn: fix default calibration table size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shanyu Zhao authored and Wey-Yi Guy committed Oct 7, 2010
1 parent 65cccfb commit 642454c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
struct iwlagn_ucode_capabilities ucode_capa = {
.max_probe_length = 200,
.standard_phy_calibration_size =
IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE,
IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE,
};

memset(&pieces, 0, sizeof(pieces));
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -3784,7 +3784,8 @@ struct iwl_enhance_sensitivity_cmd {
*/

/* Phy calibration command for series */

/* The default calibrate table size if not specified by firmware */
#define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18
enum {
IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7,
IWL_PHY_CALIBRATE_DC_CMD = 8,
Expand Down

0 comments on commit 642454c

Please sign in to comment.