diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2009-07-09 13:33:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:10 -0400 |
commit | 5905a1aa71488b5f78822100c865ed7c4f9fcd8f (patch) | |
tree | 27a02c54377eb158fd61935852ef8edcd47907ad /drivers/net | |
parent | fcf89d05404dafcde581d44dfa89bd8c8def27f9 (diff) |
iwl3945: cleanup number of queues settings
* Rename maximum number of queue (TFD_QUEUE_MAX) to IWL39_NUM_QUEUES to
be consistent with rest of iwlwifi.
* Remove unused defines.
* Fix loops that iterate over number of TX queues to stop when maximum is reached
(currently it is maximum + 1).
* Remove queues_num module parameter as it is not used.
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-3945-hw.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 15 |
4 files changed, 7 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h index 73f93a0ff2d..b569c6f38e5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h | |||
@@ -232,9 +232,8 @@ struct iwl3945_eeprom { | |||
232 | #define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */ | 232 | #define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */ |
233 | #define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */ | 233 | #define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */ |
234 | 234 | ||
235 | #define TFD_QUEUE_MIN 0 | 235 | /* 4 DATA + 1 CMD. There are 2 HCCA queues that are not used. */ |
236 | #define TFD_QUEUE_MAX 5 /* 4 DATA + 1 CMD */ | 236 | #define IWL39_NUM_QUEUES 5 |
237 | |||
238 | #define IWL_NUM_SCAN_RATES (2) | 237 | #define IWL_NUM_SCAN_RATES (2) |
239 | 238 | ||
240 | #define IWL_DEFAULT_TX_RETRY 15 | 239 | #define IWL_DEFAULT_TX_RETRY 15 |
@@ -280,8 +279,6 @@ struct iwl3945_eeprom { | |||
280 | /* Size of uCode instruction memory in bootstrap state machine */ | 279 | /* Size of uCode instruction memory in bootstrap state machine */ |
281 | #define IWL39_MAX_BSM_SIZE IWL39_RTC_INST_SIZE | 280 | #define IWL39_MAX_BSM_SIZE IWL39_RTC_INST_SIZE |
282 | 281 | ||
283 | #define IWL39_MAX_NUM_QUEUES 8 | ||
284 | |||
285 | static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr) | 282 | static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr) |
286 | { | 283 | { |
287 | return (addr >= IWL39_RTC_DATA_LOWER_BOUND) && | 284 | return (addr >= IWL39_RTC_DATA_LOWER_BOUND) && |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index b0246dbda99..1227ed2960f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -963,7 +963,7 @@ static int iwl3945_txq_ctx_reset(struct iwl_priv *priv) | |||
963 | goto error; | 963 | goto error; |
964 | 964 | ||
965 | /* Tx queue(s) */ | 965 | /* Tx queue(s) */ |
966 | for (txq_id = 0; txq_id <= priv->hw_params.max_txq_num; txq_id++) { | 966 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) { |
967 | slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? | 967 | slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? |
968 | TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; | 968 | TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; |
969 | rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num, | 969 | rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num, |
@@ -1140,7 +1140,7 @@ void iwl3945_hw_txq_ctx_free(struct iwl_priv *priv) | |||
1140 | int txq_id; | 1140 | int txq_id; |
1141 | 1141 | ||
1142 | /* Tx queues */ | 1142 | /* Tx queues */ |
1143 | for (txq_id = 0; txq_id <= priv->hw_params.max_txq_num; txq_id++) | 1143 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) |
1144 | if (txq_id == IWL_CMD_QUEUE_NUM) | 1144 | if (txq_id == IWL_CMD_QUEUE_NUM) |
1145 | iwl_cmd_queue_free(priv); | 1145 | iwl_cmd_queue_free(priv); |
1146 | else | 1146 | else |
@@ -1156,7 +1156,7 @@ void iwl3945_hw_txq_ctx_stop(struct iwl_priv *priv) | |||
1156 | iwl_write_prph(priv, ALM_SCD_MODE_REG, 0); | 1156 | iwl_write_prph(priv, ALM_SCD_MODE_REG, 0); |
1157 | 1157 | ||
1158 | /* reset TFD queues */ | 1158 | /* reset TFD queues */ |
1159 | for (txq_id = 0; txq_id <= priv->hw_params.max_txq_num; txq_id++) { | 1159 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) { |
1160 | iwl_write_direct32(priv, FH39_TCSR_CONFIG(txq_id), 0x0); | 1160 | iwl_write_direct32(priv, FH39_TCSR_CONFIG(txq_id), 0x0); |
1161 | iwl_poll_direct_bit(priv, FH39_TSSR_TX_STATUS, | 1161 | iwl_poll_direct_bit(priv, FH39_TSSR_TX_STATUS, |
1162 | FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id), | 1162 | FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id), |
@@ -2552,7 +2552,7 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv) | |||
2552 | } | 2552 | } |
2553 | 2553 | ||
2554 | /* Assign number of Usable TX queues */ | 2554 | /* Assign number of Usable TX queues */ |
2555 | priv->hw_params.max_txq_num = TFD_QUEUE_MAX; | 2555 | priv->hw_params.max_txq_num = IWL39_NUM_QUEUES; |
2556 | 2556 | ||
2557 | priv->hw_params.tfd_size = sizeof(struct iwl3945_tfd); | 2557 | priv->hw_params.tfd_size = sizeof(struct iwl3945_tfd); |
2558 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_3K; | 2558 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_3K; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index fbb3a573463..f2ffc48cbaf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -111,9 +111,6 @@ enum iwl3945_antenna { | |||
111 | #define IWL_TX_FIFO_HCCA_2 6 | 111 | #define IWL_TX_FIFO_HCCA_2 6 |
112 | #define IWL_TX_FIFO_NONE 7 | 112 | #define IWL_TX_FIFO_NONE 7 |
113 | 113 | ||
114 | /* Minimum number of queues. MAX_NUM is defined in hw specific files */ | ||
115 | #define IWL_MIN_NUM_QUEUES 4 | ||
116 | |||
117 | #define IEEE80211_DATA_LEN 2304 | 114 | #define IEEE80211_DATA_LEN 2304 |
118 | #define IEEE80211_4ADDR_LEN 30 | 115 | #define IEEE80211_4ADDR_LEN 30 |
119 | #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) | 116 | #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 7ff95f80b81..c9b3ea92714 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -89,7 +89,7 @@ MODULE_LICENSE("GPL"); | |||
89 | 89 | ||
90 | /* module parameters */ | 90 | /* module parameters */ |
91 | struct iwl_mod_params iwl3945_mod_params = { | 91 | struct iwl_mod_params iwl3945_mod_params = { |
92 | .num_of_queues = IWL39_MAX_NUM_QUEUES, | 92 | .num_of_queues = IWL39_NUM_QUEUES, /* Not used */ |
93 | .sw_crypto = 1, | 93 | .sw_crypto = 1, |
94 | .restart_fw = 1, | 94 | .restart_fw = 1, |
95 | /* the rest are 0 by default */ | 95 | /* the rest are 0 by default */ |
@@ -3947,15 +3947,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
3947 | priv = hw->priv; | 3947 | priv = hw->priv; |
3948 | SET_IEEE80211_DEV(hw, &pdev->dev); | 3948 | SET_IEEE80211_DEV(hw, &pdev->dev); |
3949 | 3949 | ||
3950 | if ((iwl3945_mod_params.num_of_queues > IWL39_MAX_NUM_QUEUES) || | ||
3951 | (iwl3945_mod_params.num_of_queues < IWL_MIN_NUM_QUEUES)) { | ||
3952 | IWL_ERR(priv, | ||
3953 | "invalid queues_num, should be between %d and %d\n", | ||
3954 | IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); | ||
3955 | err = -EINVAL; | ||
3956 | goto out_ieee80211_free_hw; | ||
3957 | } | ||
3958 | |||
3959 | /* | 3950 | /* |
3960 | * Disabling hardware scan means that mac80211 will perform scans | 3951 | * Disabling hardware scan means that mac80211 will perform scans |
3961 | * "the hard way", rather than using device's scan. | 3952 | * "the hard way", rather than using device's scan. |
@@ -4272,10 +4263,6 @@ module_param_named(debug, iwl3945_mod_params.debug, uint, 0444); | |||
4272 | MODULE_PARM_DESC(debug, "debug output mask"); | 4263 | MODULE_PARM_DESC(debug, "debug output mask"); |
4273 | module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444); | 4264 | module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444); |
4274 | MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); | 4265 | MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); |
4275 | |||
4276 | module_param_named(queues_num, iwl3945_mod_params.num_of_queues, int, 0444); | ||
4277 | MODULE_PARM_DESC(queues_num, "number of hw queues."); | ||
4278 | |||
4279 | module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, 0444); | 4266 | module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, 0444); |
4280 | MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error"); | 4267 | MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error"); |
4281 | 4268 | ||