aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-09-11 13:38:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:32 -0400
commitf3a2a42470c1c362b9a7b4e933a15a274d4b090e (patch)
tree43e502c2c422aeb7cdbd8ca05f06dbc6acc83267 /drivers/net
parent9371d4ed79c1c2efefa00226f7f6b95e0e0b8f2b (diff)
iwlwifi: separate set_hw_params function for 6000 series
Separate set_hw_params() function for 6000 series from 5000/1000 series because: 1) 6000 series use different set of sensitivity range table 2) 6000 series has different uCode image size Also include the new sensitivity parameters needed by sensitivity algorithm. 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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c71
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.c2
3 files changed, 73 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index d312ef03245f..e1b378528c72 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -833,16 +833,8 @@ int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
833 priv->hw_params.max_stations = IWL5000_STATION_COUNT; 833 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
834 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; 834 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
835 835
836 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 836 priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
837 case CSR_HW_REV_TYPE_6x00: 837 priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
838 case CSR_HW_REV_TYPE_6x50:
839 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
840 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
841 break;
842 default:
843 priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
844 priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
845 }
846 838
847 priv->hw_params.max_bsm_size = 0; 839 priv->hw_params.max_bsm_size = 0;
848 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 840 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 37b3e2086633..4b3fb4095678 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -44,6 +44,7 @@
44#include "iwl-sta.h" 44#include "iwl-sta.h"
45#include "iwl-helpers.h" 45#include "iwl-helpers.h"
46#include "iwl-5000-hw.h" 46#include "iwl-5000-hw.h"
47#include "iwl-6000-hw.h"
47 48
48/* Highest firmware API version supported */ 49/* Highest firmware API version supported */
49#define IWL6000_UCODE_API_MAX 4 50#define IWL6000_UCODE_API_MAX 4
@@ -100,8 +101,76 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
100 /* else do nothing, uCode configured */ 101 /* else do nothing, uCode configured */
101} 102}
102 103
104static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
105 .min_nrg_cck = 97,
106 .max_nrg_cck = 0, /* not used, set to 0 */
107 .auto_corr_min_ofdm = 80,
108 .auto_corr_min_ofdm_mrc = 128,
109 .auto_corr_min_ofdm_x1 = 105,
110 .auto_corr_min_ofdm_mrc_x1 = 192,
111
112 .auto_corr_max_ofdm = 145,
113 .auto_corr_max_ofdm_mrc = 232,
114 .auto_corr_max_ofdm_x1 = 145,
115 .auto_corr_max_ofdm_mrc_x1 = 232,
116
117 .auto_corr_min_cck = 125,
118 .auto_corr_max_cck = 175,
119 .auto_corr_min_cck_mrc = 160,
120 .auto_corr_max_cck_mrc = 310,
121 .nrg_th_cck = 97,
122 .nrg_th_ofdm = 100,
123};
124
125static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
126{
127 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
128 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
129 IWL_ERR(priv,
130 "invalid queues_num, should be between %d and %d\n",
131 IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
132 return -EINVAL;
133 }
134
135 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
136 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
137 priv->hw_params.scd_bc_tbls_size =
138 IWL50_NUM_QUEUES * sizeof(struct iwl5000_scd_bc_tbl);
139 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
140 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
141 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
142
143 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
144 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
145
146 priv->hw_params.max_bsm_size = 0;
147 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
148 BIT(IEEE80211_BAND_5GHZ);
149 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
150
151 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
152 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
153 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
154 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
155
156 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
157 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
158
159 /* Set initial sensitivity parameters */
160 /* Set initial calibration set */
161 priv->hw_params.sens = &iwl6000_sensitivity;
162 priv->hw_params.calib_init_cfg =
163 BIT(IWL_CALIB_XTAL) |
164 BIT(IWL_CALIB_LO) |
165 BIT(IWL_CALIB_TX_IQ) |
166 BIT(IWL_CALIB_TX_IQ_PERD) |
167 BIT(IWL_CALIB_BASE_BAND);
168
169 return 0;
170}
171
103static struct iwl_lib_ops iwl6000_lib = { 172static struct iwl_lib_ops iwl6000_lib = {
104 .set_hw_params = iwl5000_hw_set_hw_params, 173 .set_hw_params = iwl6000_hw_set_hw_params,
105 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, 174 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
106 .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl, 175 .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl,
107 .txq_set_sched = iwl5000_txq_set_sched, 176 .txq_set_sched = iwl5000_txq_set_sched,
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index c4b565a2de94..6e73317c3b40 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -516,7 +516,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
516 for (i = 0; i < NRG_NUM_PREV_STAT_L; i++) 516 for (i = 0; i < NRG_NUM_PREV_STAT_L; i++)
517 data->nrg_silence_rssi[i] = 0; 517 data->nrg_silence_rssi[i] = 0;
518 518
519 data->auto_corr_ofdm = 90; 519 data->auto_corr_ofdm = ranges->auto_corr_min_ofdm;
520 data->auto_corr_ofdm_mrc = ranges->auto_corr_min_ofdm_mrc; 520 data->auto_corr_ofdm_mrc = ranges->auto_corr_min_ofdm_mrc;
521 data->auto_corr_ofdm_x1 = ranges->auto_corr_min_ofdm_x1; 521 data->auto_corr_ofdm_x1 = ranges->auto_corr_min_ofdm_x1;
522 data->auto_corr_ofdm_mrc_x1 = ranges->auto_corr_min_ofdm_mrc_x1; 522 data->auto_corr_ofdm_mrc_x1 = ranges->auto_corr_min_ofdm_mrc_x1;