aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-6000.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-04-19 21:49:40 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-04-30 18:34:32 -0400
commite517736ab85fcaa4ceebbb572f3e86838097ad0a (patch)
tree399971d6ea5e1707bfd64ee17559b8a00f795065 /drivers/net/wireless/iwlwifi/iwl-6000.c
parente3a3cd8789e1daf1b5af70d3252cab50cd3824c9 (diff)
iwlwifi: set hw parameters based on device type
Separate the hw_set_hw_params() function to per device based; different devices can have different hardware parameters set, when separate the function based on device type can avoid mistakes, give more flexibilities and easier to read. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-6000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c70
1 files changed, 51 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 7da23d3ff7b6..c4926506a084 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -176,24 +176,56 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
176 /* Set initial sensitivity parameters */ 176 /* Set initial sensitivity parameters */
177 /* Set initial calibration set */ 177 /* Set initial calibration set */
178 priv->hw_params.sens = &iwl6000_sensitivity; 178 priv->hw_params.sens = &iwl6000_sensitivity;
179 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 179 priv->hw_params.calib_init_cfg =
180 case CSR_HW_REV_TYPE_6x50: 180 BIT(IWL_CALIB_XTAL) |
181 priv->hw_params.calib_init_cfg = 181 BIT(IWL_CALIB_LO) |
182 BIT(IWL_CALIB_XTAL) | 182 BIT(IWL_CALIB_TX_IQ) |
183 BIT(IWL_CALIB_DC) | 183 BIT(IWL_CALIB_BASE_BAND);
184 BIT(IWL_CALIB_LO) | 184
185 BIT(IWL_CALIB_TX_IQ) | 185 return 0;
186 BIT(IWL_CALIB_BASE_BAND); 186}
187 187
188 break; 188static int iwl6050_hw_set_hw_params(struct iwl_priv *priv)
189 default: 189{
190 priv->hw_params.calib_init_cfg = 190 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
191 BIT(IWL_CALIB_XTAL) | 191 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
192 BIT(IWL_CALIB_LO) | 192 priv->cfg->num_of_queues =
193 BIT(IWL_CALIB_TX_IQ) | 193 priv->cfg->mod_params->num_of_queues;
194 BIT(IWL_CALIB_BASE_BAND); 194
195 break; 195 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
196 } 196 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
197 priv->hw_params.scd_bc_tbls_size =
198 priv->cfg->num_of_queues *
199 sizeof(struct iwlagn_scd_bc_tbl);
200 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
201 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
202 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
203
204 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
205 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
206
207 priv->hw_params.max_bsm_size = 0;
208 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
209 BIT(IEEE80211_BAND_5GHZ);
210 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
211
212 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
213 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
214 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
215 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
216
217 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
218 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
219
220 /* Set initial sensitivity parameters */
221 /* Set initial calibration set */
222 priv->hw_params.sens = &iwl6000_sensitivity;
223 priv->hw_params.calib_init_cfg =
224 BIT(IWL_CALIB_XTAL) |
225 BIT(IWL_CALIB_DC) |
226 BIT(IWL_CALIB_LO) |
227 BIT(IWL_CALIB_TX_IQ) |
228 BIT(IWL_CALIB_BASE_BAND);
197 229
198 return 0; 230 return 0;
199} 231}
@@ -304,7 +336,7 @@ static const struct iwl_ops iwl6000_ops = {
304}; 336};
305 337
306static struct iwl_lib_ops iwl6050_lib = { 338static struct iwl_lib_ops iwl6050_lib = {
307 .set_hw_params = iwl6000_hw_set_hw_params, 339 .set_hw_params = iwl6050_hw_set_hw_params,
308 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 340 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
309 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 341 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
310 .txq_set_sched = iwlagn_txq_set_sched, 342 .txq_set_sched = iwlagn_txq_set_sched,