]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
iwlwifi: unite common settings of HW params
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Mon, 30 Jun 2008 09:23:20 +0000 (17:23 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 30 Jun 2008 21:37:43 +0000 (17:37 -0400)
This patch unites common settings of 4965 and 5000 hw params.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@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-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl4965-base.c

index 311b37c383c0a606bb88b41d017dfeb7d08ebd1e..7f6713f32c9847b890240282fc1614c25f92a5eb 100644 (file)
@@ -837,17 +837,8 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
 
        priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
        priv->hw_params.first_ampdu_q = IWL49_FIRST_AMPDU_QUEUE;
-       priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
-       priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
-       priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
-       if (priv->cfg->mod_params->amsdu_size_8K)
-               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K;
-       else
-               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
-       priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
        priv->hw_params.max_stations = IWL4965_STATION_COUNT;
        priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID;
-
        priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWL49_RTC_INST_SIZE;
        priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
index 104b6f7c81edf8c67c0dd0a8a6ced05820aa0c57..75283fb9d5a875b5721014fb4d09fb21bba4a84d 100644 (file)
@@ -827,19 +827,11 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 
        priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
        priv->hw_params.first_ampdu_q = IWL50_FIRST_AMPDU_QUEUE;
-       priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
-       priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
-       priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
-       if (priv->cfg->mod_params->amsdu_size_8K)
-               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K;
-       else
-               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
-       priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
        priv->hw_params.max_stations = IWL5000_STATION_COUNT;
        priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
        priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
-       priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
+       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.fat_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.sens = &iwl5000_sensitivity;
index 95f7320fc9dd44c3de1ec724258570ad5c7c77d2..97447df94d14693d3dc44b24aef2d8895fa81668 100644 (file)
@@ -842,6 +842,21 @@ int iwl_setup_mac(struct iwl_priv *priv)
 }
 EXPORT_SYMBOL(iwl_setup_mac);
 
+int iwl_set_hw_params(struct iwl_priv *priv)
+{
+       priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
+       priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
+       priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
+       if (priv->cfg->mod_params->amsdu_size_8K)
+               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K;
+       else
+               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
+       priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
+
+       /* Device-specific setup */
+       return priv->cfg->ops->lib->set_hw_params(priv);
+}
+EXPORT_SYMBOL(iwl_set_hw_params);
 
 int iwl_init_drv(struct iwl_priv *priv)
 {
index 7814a48ccd0bcde76b423fc99ff98d6bea92a36a..f156d27ee9a0a68cab97589f41c73c8377dd177c 100644 (file)
@@ -193,6 +193,7 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
                         struct ieee80211_ht_info *sta_ht_inf);
 int iwl_hw_nic_init(struct iwl_priv *priv);
 int iwl_setup_mac(struct iwl_priv *priv);
+int iwl_set_hw_params(struct iwl_priv *priv);
 int iwl_init_drv(struct iwl_priv *priv);
 void iwl_uninit_drv(struct iwl_priv *priv);
 /* "keep warm" functions */
index 2d0d079a24ec7ad68b0e3168cb212144ead76af7..7c7b1034b707c87aafa36c2d1f5921e43c9da5de 100644 (file)
@@ -4243,8 +4243,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        /************************
         * 5. Setup HW constants
         ************************/
-       /* Device-specific setup */
-       if (priv->cfg->ops->lib->set_hw_params(priv)) {
+       if (iwl_set_hw_params(priv)) {
                IWL_ERROR("failed to set hw parameters\n");
                goto out_free_eeprom;
        }