Skip to content

Commit

Permalink
iwlwifi: additional items in sensitivity range table
Browse files Browse the repository at this point in the history
Add more items to sensitivity range table to avoid using hardcoded values.
Initialize the table per device since unique per device information is
required to perform sensitivity calibration.

additional items in sensitivity range table:
   .barker_corr_th_min: Barker correlation threshold minimum
   .barker_corr_th_min_mrc: Barker correlation threshold minimum for MRC
   .nrg_th_cca: Energy threshold for Clear Channel Assessment

Barker codes are a technique used in WLAN encoding for transmission.
MRC is "Maximal Ratio Combining", a technique for optimally combining the
signals from 2 or more receivers to achieve a better signal.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Wey-Yi Guy authored and John W. Linville committed Oct 27, 2009
1 parent bd35f15 commit 55036d6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = {

.nrg_th_cck = 100,
.nrg_th_ofdm = 100,

.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};

static void iwl4965_set_ct_threshold(struct iwl_priv *priv)
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
.auto_corr_max_cck_mrc = 400,
.nrg_th_cck = 95,
.nrg_th_ofdm = 95,

.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};

static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
Expand All @@ -351,6 +355,10 @@ static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
.auto_corr_max_cck_mrc = 400,
.nrg_th_cck = 95,
.nrg_th_ofdm = 95,

.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};

const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
.auto_corr_max_cck_mrc = 310,
.nrg_th_cck = 97,
.nrg_th_ofdm = 100,

.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};

static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
cpu_to_le16((u16)data->nrg_th_ofdm);

cmd.table[HD_BARKER_CORR_TH_ADD_MIN_INDEX] =
cpu_to_le16(190);
cpu_to_le16(data->barker_corr_th_min);
cmd.table[HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX] =
cpu_to_le16(390);
cpu_to_le16(data->barker_corr_th_min_mrc);
cmd.table[HD_OFDM_ENERGY_TH_IN_INDEX] =
cpu_to_le16(62);
cpu_to_le16(data->nrg_th_cca);

IWL_DEBUG_CALIB(priv, "ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n",
data->auto_corr_ofdm, data->auto_corr_ofdm_mrc,
Expand Down Expand Up @@ -524,6 +524,9 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
data->auto_corr_cck_mrc = ranges->auto_corr_min_cck_mrc;
data->nrg_th_cck = ranges->nrg_th_cck;
data->nrg_th_ofdm = ranges->nrg_th_ofdm;
data->barker_corr_th_min = ranges->barker_corr_th_min;
data->barker_corr_th_min_mrc = ranges->barker_corr_th_min_mrc;
data->nrg_th_cca = ranges->nrg_th_cca;

data->last_bad_plcp_cnt_ofdm = 0;
data->last_fa_cnt_ofdm = 0;
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/wireless/iwlwifi/iwl-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -3247,12 +3247,6 @@ struct iwl_missed_beacon_notif {
* Lower values mean higher energy; this means making sure that the value
* in HD_MIN_ENERGY_CCK_DET_INDEX is at or *above* "Max cck energy".
*
* Driver should set the following entries to fixed values:
*
* HD_MIN_ENERGY_OFDM_DET_INDEX 100
* HD_BARKER_CORR_TH_ADD_MIN_INDEX 190
* HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX 390
* HD_OFDM_ENERGY_TH_IN_INDEX 62
*/

/*
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ struct iwl_sensitivity_ranges {
u16 auto_corr_max_cck_mrc;
u16 auto_corr_min_cck;
u16 auto_corr_min_cck_mrc;

u16 barker_corr_th_min;
u16 barker_corr_th_min_mrc;
u16 nrg_th_cca;
};


Expand Down Expand Up @@ -850,6 +854,10 @@ struct iwl_sensitivity_data {
s32 nrg_auto_corr_silence_diff;
u32 num_in_cck_no_fa;
u32 nrg_th_ofdm;

u16 barker_corr_th_min;
u16 barker_corr_th_min_mrc;
u16 nrg_th_cca;
};

/* Chain noise (differential Rx gain) calib data */
Expand Down

0 comments on commit 55036d6

Please sign in to comment.