iwlwifi: additional items in sensitivity range table
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 9 Oct 2009 20:20:24 +0000 (13:20 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:47:58 +0000 (16:47 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-calib.c
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-dev.h

index 782a36198f3870f21ba21fd801e2ad89ba0d2aa6..966858587e256dc4bbf0c2a74de52dad3961940e 100644 (file)
@@ -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)
index 33b38aa0d8c3b6d0f4a8da1d0537cdd78324a345..a9d1aa3ad57b89b5aa3d156b384ccbb011706ea2 100644 (file)
@@ -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 = {
@@ -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,
index 46af74b86a83acbc9867a7ae2676df664fadd6c0..dda1dd6ed40aac93a22e741a91aa7527511f7e55 100644 (file)
@@ -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)
index 69a80d7c2e44aecb59194aa5d9a7bf5212615b03..1f801eb9fbff38cf5496df880e2e85b43be9f194 100644 (file)
@@ -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,
@@ -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;
index ba3e4c837d877697e41a5a858c545544b890d021..2e8a55ed7de5d77f2222ee15ee1ad61b0ed7e4c0 100644 (file)
@@ -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
  */
 
 /*
index 394402afaa5719fd794f43842dd074382183bc99..c1b07e2045e665aced78b35068c3fe78a3165ebc 100644 (file)
@@ -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;
 };
 
 
@@ -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 */