diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-15 01:53:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:47:53 -0400 |
commit | 443cfd457f780e40ceab7e00fbb6a56882848834 (patch) | |
tree | 6085149d4636bf3f7048223579b71512932122c1 /drivers | |
parent | 39130df32adf8272373c03c8c2499cd2a1b4c5cf (diff) |
iwlwifi: rename iwl4965_queue to iwl_queue
This patch renames iwl4965_queue to iwl_queue.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 28 |
4 files changed, 22 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 17847f981e1..2bb0075a807 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -3231,7 +3231,7 @@ static int iwl4965_tx_queue_agg_disable(struct iwl_priv *priv, u16 txq_id, | |||
3231 | int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id, | 3231 | int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id, |
3232 | u8 tid, int txq_id) | 3232 | u8 tid, int txq_id) |
3233 | { | 3233 | { |
3234 | struct iwl4965_queue *q = &priv->txq[txq_id].q; | 3234 | struct iwl_queue *q = &priv->txq[txq_id].q; |
3235 | u8 *addr = priv->stations[sta_id].sta.sta.addr; | 3235 | u8 *addr = priv->stations[sta_id].sta.sta.addr; |
3236 | struct iwl_tid_data *tid_data = &priv->stations[sta_id].tid[tid]; | 3236 | struct iwl_tid_data *tid_data = &priv->stations[sta_id].tid[tid]; |
3237 | 3237 | ||
@@ -3263,16 +3263,6 @@ int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id, | |||
3263 | } | 3263 | } |
3264 | 3264 | ||
3265 | /** | 3265 | /** |
3266 | * iwl4965_queue_dec_wrap - Decrement queue index, wrap back to end if needed | ||
3267 | * @index -- current index | ||
3268 | * @n_bd -- total number of entries in queue (s/b power of 2) | ||
3269 | */ | ||
3270 | static inline int iwl4965_queue_dec_wrap(int index, int n_bd) | ||
3271 | { | ||
3272 | return (index == 0) ? n_bd - 1 : index - 1; | ||
3273 | } | ||
3274 | |||
3275 | /** | ||
3276 | * iwl4965_rx_reply_compressed_ba - Handler for REPLY_COMPRESSED_BA | 3266 | * iwl4965_rx_reply_compressed_ba - Handler for REPLY_COMPRESSED_BA |
3277 | * | 3267 | * |
3278 | * Handles block-acknowledge notification from device, which reports success | 3268 | * Handles block-acknowledge notification from device, which reports success |
@@ -3304,7 +3294,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
3304 | agg = &priv->stations[ba_resp->sta_id].tid[ba_resp->tid].agg; | 3294 | agg = &priv->stations[ba_resp->sta_id].tid[ba_resp->tid].agg; |
3305 | 3295 | ||
3306 | /* Find index just before block-ack window */ | 3296 | /* Find index just before block-ack window */ |
3307 | index = iwl4965_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd); | 3297 | index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd); |
3308 | 3298 | ||
3309 | /* TODO: Need to get this copy more safely - now good for debug */ | 3299 | /* TODO: Need to get this copy more safely - now good for debug */ |
3310 | 3300 | ||
@@ -3337,7 +3327,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
3337 | int freed = iwl4965_tx_queue_reclaim(priv, scd_flow, index); | 3327 | int freed = iwl4965_tx_queue_reclaim(priv, scd_flow, index); |
3338 | priv->stations[ba_resp->sta_id]. | 3328 | priv->stations[ba_resp->sta_id]. |
3339 | tid[ba_resp->tid].tfds_in_queue -= freed; | 3329 | tid[ba_resp->tid].tfds_in_queue -= freed; |
3340 | if (iwl4965_queue_space(&txq->q) > txq->q.low_mark && | 3330 | if (iwl_queue_space(&txq->q) > txq->q.low_mark && |
3341 | priv->mac80211_registered && | 3331 | priv->mac80211_registered && |
3342 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) | 3332 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) |
3343 | ieee80211_wake_queue(priv->hw, ampdu_q); | 3333 | ieee80211_wake_queue(priv->hw, ampdu_q); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 5dccc5a8fa9..cf992240756 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -102,7 +102,7 @@ struct iwl_rx_mem_buffer { | |||
102 | * | 102 | * |
103 | * Contains common data for Rx and Tx queues | 103 | * Contains common data for Rx and Tx queues |
104 | */ | 104 | */ |
105 | struct iwl4965_queue { | 105 | struct iwl_queue { |
106 | int n_bd; /* number of BDs in this queue */ | 106 | int n_bd; /* number of BDs in this queue */ |
107 | int write_ptr; /* 1-st empty entry (index) host_w*/ | 107 | int write_ptr; /* 1-st empty entry (index) host_w*/ |
108 | int read_ptr; /* last used entry (index) host_r*/ | 108 | int read_ptr; /* last used entry (index) host_r*/ |
@@ -137,7 +137,7 @@ struct iwl4965_tx_info { | |||
137 | * descriptors) and required locking structures. | 137 | * descriptors) and required locking structures. |
138 | */ | 138 | */ |
139 | struct iwl_tx_queue { | 139 | struct iwl_tx_queue { |
140 | struct iwl4965_queue q; | 140 | struct iwl_queue q; |
141 | struct iwl_tfd_frame *bd; | 141 | struct iwl_tfd_frame *bd; |
142 | struct iwl_cmd *cmd; | 142 | struct iwl_cmd *cmd; |
143 | dma_addr_t dma_addr_cmd; | 143 | dma_addr_t dma_addr_cmd; |
@@ -721,7 +721,7 @@ extern u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid); | |||
721 | 721 | ||
722 | extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel); | 722 | extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel); |
723 | extern int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); | 723 | extern int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); |
724 | extern int iwl4965_queue_space(const struct iwl4965_queue *q); | 724 | extern int iwl_queue_space(const struct iwl_queue *q); |
725 | struct iwl_priv; | 725 | struct iwl_priv; |
726 | 726 | ||
727 | extern void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio); | 727 | extern void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index a1e03ccd514..870d257bded 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -105,7 +105,7 @@ EXPORT_SYMBOL(iwl_hw_txq_free_tfd); | |||
105 | */ | 105 | */ |
106 | static void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq) | 106 | static void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq) |
107 | { | 107 | { |
108 | struct iwl4965_queue *q = &txq->q; | 108 | struct iwl_queue *q = &txq->q; |
109 | struct pci_dev *dev = priv->pci_dev; | 109 | struct pci_dev *dev = priv->pci_dev; |
110 | int len; | 110 | int len; |
111 | 111 | ||
@@ -158,7 +158,7 @@ EXPORT_SYMBOL(iwl_hw_txq_ctx_free); | |||
158 | /** | 158 | /** |
159 | * iwl_queue_init - Initialize queue's high/low-water and read/write indexes | 159 | * iwl_queue_init - Initialize queue's high/low-water and read/write indexes |
160 | */ | 160 | */ |
161 | static int iwl_queue_init(struct iwl_priv *priv, struct iwl4965_queue *q, | 161 | static int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q, |
162 | int count, int slots_num, u32 id) | 162 | int count, int slots_num, u32 id) |
163 | { | 163 | { |
164 | q->n_bd = count; | 164 | q->n_bd = count; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index c713b27ec65..2e7e616a089 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -173,7 +173,7 @@ static const char *iwl4965_escape_essid(const char *essid, u8 essid_len) | |||
173 | * See more detailed info in iwl-4965-hw.h. | 173 | * See more detailed info in iwl-4965-hw.h. |
174 | ***************************************************/ | 174 | ***************************************************/ |
175 | 175 | ||
176 | int iwl4965_queue_space(const struct iwl4965_queue *q) | 176 | int iwl_queue_space(const struct iwl_queue *q) |
177 | { | 177 | { |
178 | int s = q->read_ptr - q->write_ptr; | 178 | int s = q->read_ptr - q->write_ptr; |
179 | 179 | ||
@@ -190,14 +190,14 @@ int iwl4965_queue_space(const struct iwl4965_queue *q) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||
193 | static inline int x2_queue_used(const struct iwl4965_queue *q, int i) | 193 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) |
194 | { | 194 | { |
195 | return q->write_ptr > q->read_ptr ? | 195 | return q->write_ptr > q->read_ptr ? |
196 | (i >= q->read_ptr && i < q->write_ptr) : | 196 | (i >= q->read_ptr && i < q->write_ptr) : |
197 | !(i < q->read_ptr && i >= q->write_ptr); | 197 | !(i < q->read_ptr && i >= q->write_ptr); |
198 | } | 198 | } |
199 | 199 | ||
200 | static inline u8 get_cmd_index(struct iwl4965_queue *q, u32 index, int is_huge) | 200 | static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge) |
201 | { | 201 | { |
202 | /* This is for scan command, the big buffer at end of command array */ | 202 | /* This is for scan command, the big buffer at end of command array */ |
203 | if (is_huge) | 203 | if (is_huge) |
@@ -348,7 +348,7 @@ u8 iwl4965_add_station_flags(struct iwl_priv *priv, const u8 *addr, | |||
348 | int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | 348 | int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) |
349 | { | 349 | { |
350 | struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM]; | 350 | struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM]; |
351 | struct iwl4965_queue *q = &txq->q; | 351 | struct iwl_queue *q = &txq->q; |
352 | struct iwl_tfd_frame *tfd; | 352 | struct iwl_tfd_frame *tfd; |
353 | u32 *control_flags; | 353 | u32 *control_flags; |
354 | struct iwl_cmd *out_cmd; | 354 | struct iwl_cmd *out_cmd; |
@@ -369,7 +369,7 @@ int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
369 | return -EIO; | 369 | return -EIO; |
370 | } | 370 | } |
371 | 371 | ||
372 | if (iwl4965_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) { | 372 | if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) { |
373 | IWL_ERROR("No space for Tx\n"); | 373 | IWL_ERROR("No space for Tx\n"); |
374 | return -ENOSPC; | 374 | return -ENOSPC; |
375 | } | 375 | } |
@@ -1768,7 +1768,7 @@ static int iwl4965_tx_skb(struct iwl_priv *priv, | |||
1768 | u32 *control_flags; | 1768 | u32 *control_flags; |
1769 | int txq_id = ctl->queue; | 1769 | int txq_id = ctl->queue; |
1770 | struct iwl_tx_queue *txq = NULL; | 1770 | struct iwl_tx_queue *txq = NULL; |
1771 | struct iwl4965_queue *q = NULL; | 1771 | struct iwl_queue *q = NULL; |
1772 | dma_addr_t phys_addr; | 1772 | dma_addr_t phys_addr; |
1773 | dma_addr_t txcmd_phys; | 1773 | dma_addr_t txcmd_phys; |
1774 | dma_addr_t scratch_phys; | 1774 | dma_addr_t scratch_phys; |
@@ -1981,7 +1981,7 @@ static int iwl4965_tx_skb(struct iwl_priv *priv, | |||
1981 | if (rc) | 1981 | if (rc) |
1982 | return rc; | 1982 | return rc; |
1983 | 1983 | ||
1984 | if ((iwl4965_queue_space(q) < q->high_mark) | 1984 | if ((iwl_queue_space(q) < q->high_mark) |
1985 | && priv->mac80211_registered) { | 1985 | && priv->mac80211_registered) { |
1986 | if (wait_write_ptr) { | 1986 | if (wait_write_ptr) { |
1987 | spin_lock_irqsave(&priv->lock, flags); | 1987 | spin_lock_irqsave(&priv->lock, flags); |
@@ -2332,10 +2332,10 @@ static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv, | |||
2332 | int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) | 2332 | int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) |
2333 | { | 2333 | { |
2334 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; | 2334 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; |
2335 | struct iwl4965_queue *q = &txq->q; | 2335 | struct iwl_queue *q = &txq->q; |
2336 | int nfreed = 0; | 2336 | int nfreed = 0; |
2337 | 2337 | ||
2338 | if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) { | 2338 | if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) { |
2339 | IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " | 2339 | IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " |
2340 | "is out of range [0-%d] %d %d.\n", txq_id, | 2340 | "is out of range [0-%d] %d %d.\n", txq_id, |
2341 | index, q->n_bd, q->write_ptr, q->read_ptr); | 2341 | index, q->n_bd, q->write_ptr, q->read_ptr); |
@@ -2541,7 +2541,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
2541 | __le16 *qc; | 2541 | __le16 *qc; |
2542 | #endif | 2542 | #endif |
2543 | 2543 | ||
2544 | if ((index >= txq->q.n_bd) || (x2_queue_used(&txq->q, index) == 0)) { | 2544 | if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { |
2545 | IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " | 2545 | IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " |
2546 | "is out of range [0-%d] %d %d\n", txq_id, | 2546 | "is out of range [0-%d] %d %d\n", txq_id, |
2547 | index, txq->q.n_bd, txq->q.write_ptr, | 2547 | index, txq->q.n_bd, txq->q.write_ptr, |
@@ -2587,7 +2587,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
2587 | freed = iwl4965_tx_queue_reclaim(priv, txq_id, index); | 2587 | freed = iwl4965_tx_queue_reclaim(priv, txq_id, index); |
2588 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | 2588 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; |
2589 | 2589 | ||
2590 | if (iwl4965_queue_space(&txq->q) > txq->q.low_mark && | 2590 | if (iwl_queue_space(&txq->q) > txq->q.low_mark && |
2591 | txq_id >= 0 && priv->mac80211_registered && | 2591 | txq_id >= 0 && priv->mac80211_registered && |
2592 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { | 2592 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { |
2593 | /* calculate mac80211 ampdu sw queue to wake */ | 2593 | /* calculate mac80211 ampdu sw queue to wake */ |
@@ -2621,7 +2621,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
2621 | int freed = iwl4965_tx_queue_reclaim(priv, txq_id, index); | 2621 | int freed = iwl4965_tx_queue_reclaim(priv, txq_id, index); |
2622 | if (tid != MAX_TID_COUNT) | 2622 | if (tid != MAX_TID_COUNT) |
2623 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | 2623 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; |
2624 | if (iwl4965_queue_space(&txq->q) > txq->q.low_mark && | 2624 | if (iwl_queue_space(&txq->q) > txq->q.low_mark && |
2625 | (txq_id >= 0) && priv->mac80211_registered) | 2625 | (txq_id >= 0) && priv->mac80211_registered) |
2626 | ieee80211_wake_queue(priv->hw, txq_id); | 2626 | ieee80211_wake_queue(priv->hw, txq_id); |
2627 | if (tid != MAX_TID_COUNT) | 2627 | if (tid != MAX_TID_COUNT) |
@@ -5783,7 +5783,7 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw, | |||
5783 | struct iwl_priv *priv = hw->priv; | 5783 | struct iwl_priv *priv = hw->priv; |
5784 | int i, avail; | 5784 | int i, avail; |
5785 | struct iwl_tx_queue *txq; | 5785 | struct iwl_tx_queue *txq; |
5786 | struct iwl4965_queue *q; | 5786 | struct iwl_queue *q; |
5787 | unsigned long flags; | 5787 | unsigned long flags; |
5788 | 5788 | ||
5789 | IWL_DEBUG_MAC80211("enter\n"); | 5789 | IWL_DEBUG_MAC80211("enter\n"); |
@@ -5798,7 +5798,7 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw, | |||
5798 | for (i = 0; i < AC_NUM; i++) { | 5798 | for (i = 0; i < AC_NUM; i++) { |
5799 | txq = &priv->txq[i]; | 5799 | txq = &priv->txq[i]; |
5800 | q = &txq->q; | 5800 | q = &txq->q; |
5801 | avail = iwl4965_queue_space(q); | 5801 | avail = iwl_queue_space(q); |
5802 | 5802 | ||
5803 | stats[i].len = q->n_window - avail; | 5803 | stats[i].len = q->n_window - avail; |
5804 | stats[i].limit = q->n_window - q->high_mark; | 5804 | stats[i].limit = q->n_window - q->high_mark; |