diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-06-30 05:23:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-30 17:37:43 -0400 |
commit | da154e306eb04426a3693c947588d82c3da05337 (patch) | |
tree | 288febbea32c102ce53dce375136bc2fc8c4c141 /drivers/net/wireless | |
parent | 3bff19c203d216436a73e56b8298bebd5ea75a3f (diff) |
iwlwifi: unite common settings of HW params
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 3 |
5 files changed, 18 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 311b37c383c0..7f6713f32c98 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -837,17 +837,8 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv) | |||
837 | 837 | ||
838 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; | 838 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; |
839 | priv->hw_params.first_ampdu_q = IWL49_FIRST_AMPDU_QUEUE; | 839 | priv->hw_params.first_ampdu_q = IWL49_FIRST_AMPDU_QUEUE; |
840 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; | ||
841 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; | ||
842 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; | ||
843 | if (priv->cfg->mod_params->amsdu_size_8K) | ||
844 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K; | ||
845 | else | ||
846 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K; | ||
847 | priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256; | ||
848 | priv->hw_params.max_stations = IWL4965_STATION_COUNT; | 840 | priv->hw_params.max_stations = IWL4965_STATION_COUNT; |
849 | priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID; | 841 | priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID; |
850 | |||
851 | priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE; | 842 | priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE; |
852 | priv->hw_params.max_inst_size = IWL49_RTC_INST_SIZE; | 843 | priv->hw_params.max_inst_size = IWL49_RTC_INST_SIZE; |
853 | priv->hw_params.max_bsm_size = BSM_SRAM_SIZE; | 844 | priv->hw_params.max_bsm_size = BSM_SRAM_SIZE; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 104b6f7c81ed..75283fb9d5a8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -827,19 +827,11 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
827 | 827 | ||
828 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; | 828 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; |
829 | priv->hw_params.first_ampdu_q = IWL50_FIRST_AMPDU_QUEUE; | 829 | priv->hw_params.first_ampdu_q = IWL50_FIRST_AMPDU_QUEUE; |
830 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; | ||
831 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; | ||
832 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; | ||
833 | if (priv->cfg->mod_params->amsdu_size_8K) | ||
834 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K; | ||
835 | else | ||
836 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K; | ||
837 | priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256; | ||
838 | priv->hw_params.max_stations = IWL5000_STATION_COUNT; | 830 | priv->hw_params.max_stations = IWL5000_STATION_COUNT; |
839 | priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; | 831 | priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; |
840 | priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE; | 832 | priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE; |
841 | priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE; | 833 | priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE; |
842 | priv->hw_params.max_bsm_size = BSM_SRAM_SIZE; | 834 | priv->hw_params.max_bsm_size = 0; |
843 | priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | | 835 | priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | |
844 | BIT(IEEE80211_BAND_5GHZ); | 836 | BIT(IEEE80211_BAND_5GHZ); |
845 | priv->hw_params.sens = &iwl5000_sensitivity; | 837 | priv->hw_params.sens = &iwl5000_sensitivity; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 95f7320fc9dd..97447df94d14 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -842,6 +842,21 @@ int iwl_setup_mac(struct iwl_priv *priv) | |||
842 | } | 842 | } |
843 | EXPORT_SYMBOL(iwl_setup_mac); | 843 | EXPORT_SYMBOL(iwl_setup_mac); |
844 | 844 | ||
845 | int iwl_set_hw_params(struct iwl_priv *priv) | ||
846 | { | ||
847 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; | ||
848 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; | ||
849 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; | ||
850 | if (priv->cfg->mod_params->amsdu_size_8K) | ||
851 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K; | ||
852 | else | ||
853 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K; | ||
854 | priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256; | ||
855 | |||
856 | /* Device-specific setup */ | ||
857 | return priv->cfg->ops->lib->set_hw_params(priv); | ||
858 | } | ||
859 | EXPORT_SYMBOL(iwl_set_hw_params); | ||
845 | 860 | ||
846 | int iwl_init_drv(struct iwl_priv *priv) | 861 | int iwl_init_drv(struct iwl_priv *priv) |
847 | { | 862 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 7814a48ccd0b..f156d27ee9a0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -193,6 +193,7 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, | |||
193 | struct ieee80211_ht_info *sta_ht_inf); | 193 | struct ieee80211_ht_info *sta_ht_inf); |
194 | int iwl_hw_nic_init(struct iwl_priv *priv); | 194 | int iwl_hw_nic_init(struct iwl_priv *priv); |
195 | int iwl_setup_mac(struct iwl_priv *priv); | 195 | int iwl_setup_mac(struct iwl_priv *priv); |
196 | int iwl_set_hw_params(struct iwl_priv *priv); | ||
196 | int iwl_init_drv(struct iwl_priv *priv); | 197 | int iwl_init_drv(struct iwl_priv *priv); |
197 | void iwl_uninit_drv(struct iwl_priv *priv); | 198 | void iwl_uninit_drv(struct iwl_priv *priv); |
198 | /* "keep warm" functions */ | 199 | /* "keep warm" functions */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 2d0d079a24ec..7c7b1034b707 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -4243,8 +4243,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4243 | /************************ | 4243 | /************************ |
4244 | * 5. Setup HW constants | 4244 | * 5. Setup HW constants |
4245 | ************************/ | 4245 | ************************/ |
4246 | /* Device-specific setup */ | 4246 | if (iwl_set_hw_params(priv)) { |
4247 | if (priv->cfg->ops->lib->set_hw_params(priv)) { | ||
4248 | IWL_ERROR("failed to set hw parameters\n"); | 4247 | IWL_ERROR("failed to set hw parameters\n"); |
4249 | goto out_free_eeprom; | 4248 | goto out_free_eeprom; |
4250 | } | 4249 | } |