diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2008-12-18 21:37:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:09 -0500 |
commit | cc2f362c360af35b74530f3c896511b8dbd0264c (patch) | |
tree | f2aa74145e83c0076c0f57c3d75cbdf7baf76109 /drivers/net | |
parent | 6100b58806e6307f959af79334ac553825400242 (diff) |
iwl3945: use iwl_rx_queue in iwl3945
The patch replaces iwl3945_rx_queue with iwl_rx_queue.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 33 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 16 |
3 files changed, 13 insertions, 40 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index f283b1dea9d7..82b2023c6ad0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -961,7 +961,7 @@ static int iwl3945_nic_set_pwr_src(struct iwl3945_priv *priv, int pwr_max) | |||
961 | return rc; | 961 | return rc; |
962 | } | 962 | } |
963 | 963 | ||
964 | static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl3945_rx_queue *rxq) | 964 | static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) |
965 | { | 965 | { |
966 | int rc; | 966 | int rc; |
967 | unsigned long flags; | 967 | unsigned long flags; |
@@ -1082,7 +1082,7 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv) | |||
1082 | u8 rev_id; | 1082 | u8 rev_id; |
1083 | int rc; | 1083 | int rc; |
1084 | unsigned long flags; | 1084 | unsigned long flags; |
1085 | struct iwl3945_rx_queue *rxq = &priv->rxq; | 1085 | struct iwl_rx_queue *rxq = &priv->rxq; |
1086 | 1086 | ||
1087 | iwl3945_power_init_handle(priv); | 1087 | iwl3945_power_init_handle(priv); |
1088 | 1088 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 410a8bd0d4fb..c4d56ef0fa8f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -213,33 +213,6 @@ struct iwl3945_host_cmd { | |||
213 | #define SUP_RATE_11B_MAX_NUM_CHANNELS 4 | 213 | #define SUP_RATE_11B_MAX_NUM_CHANNELS 4 |
214 | #define SUP_RATE_11G_MAX_NUM_CHANNELS 12 | 214 | #define SUP_RATE_11G_MAX_NUM_CHANNELS 12 |
215 | 215 | ||
216 | /** | ||
217 | * struct iwl3945_rx_queue - Rx queue | ||
218 | * @processed: Internal index to last handled Rx packet | ||
219 | * @read: Shared index to newest available Rx buffer | ||
220 | * @write: Shared index to oldest written Rx packet | ||
221 | * @free_count: Number of pre-allocated buffers in rx_free | ||
222 | * @rx_free: list of free SKBs for use | ||
223 | * @rx_used: List of Rx buffers with no SKB | ||
224 | * @need_update: flag to indicate we need to update read/write index | ||
225 | * | ||
226 | * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers | ||
227 | */ | ||
228 | struct iwl3945_rx_queue { | ||
229 | __le32 *bd; | ||
230 | dma_addr_t dma_addr; | ||
231 | struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; | ||
232 | struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; | ||
233 | u32 processed; | ||
234 | u32 read; | ||
235 | u32 write; | ||
236 | u32 free_count; | ||
237 | struct list_head rx_free; | ||
238 | struct list_head rx_used; | ||
239 | int need_update; | ||
240 | spinlock_t lock; | ||
241 | }; | ||
242 | |||
243 | #define IWL_SUPPORTED_RATES_IE_LEN 8 | 216 | #define IWL_SUPPORTED_RATES_IE_LEN 8 |
244 | 217 | ||
245 | #define SCAN_INTERVAL 100 | 218 | #define SCAN_INTERVAL 100 |
@@ -333,7 +306,7 @@ extern int iwl3945_power_init_handle(struct iwl3945_priv *priv); | |||
333 | extern int iwl3945_eeprom_init(struct iwl3945_priv *priv); | 306 | extern int iwl3945_eeprom_init(struct iwl3945_priv *priv); |
334 | extern int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv); | 307 | extern int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv); |
335 | extern void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, | 308 | extern void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, |
336 | struct iwl3945_rx_queue *rxq); | 309 | struct iwl_rx_queue *rxq); |
337 | extern int iwl3945_calc_db_from_ratio(int sig_ratio); | 310 | extern int iwl3945_calc_db_from_ratio(int sig_ratio); |
338 | extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm); | 311 | extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm); |
339 | extern int iwl3945_tx_queue_init(struct iwl3945_priv *priv, | 312 | extern int iwl3945_tx_queue_init(struct iwl3945_priv *priv, |
@@ -347,7 +320,7 @@ extern int __must_check iwl3945_send_cmd(struct iwl3945_priv *priv, | |||
347 | extern unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv, | 320 | extern unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv, |
348 | struct ieee80211_hdr *hdr,int left); | 321 | struct ieee80211_hdr *hdr,int left); |
349 | extern int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, | 322 | extern int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, |
350 | struct iwl3945_rx_queue *q); | 323 | struct iwl_rx_queue *q); |
351 | extern int iwl3945_send_statistics_request(struct iwl3945_priv *priv); | 324 | extern int iwl3945_send_statistics_request(struct iwl3945_priv *priv); |
352 | extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb, | 325 | extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb, |
353 | u32 decrypt_res, | 326 | u32 decrypt_res, |
@@ -564,7 +537,7 @@ struct iwl3945_priv { | |||
564 | int activity_timer_active; | 537 | int activity_timer_active; |
565 | 538 | ||
566 | /* Rx and Tx DMA processing queues */ | 539 | /* Rx and Tx DMA processing queues */ |
567 | struct iwl3945_rx_queue rxq; | 540 | struct iwl_rx_queue rxq; |
568 | struct iwl3945_tx_queue txq[IWL39_MAX_NUM_QUEUES]; | 541 | struct iwl3945_tx_queue txq[IWL39_MAX_NUM_QUEUES]; |
569 | 542 | ||
570 | unsigned long status; | 543 | unsigned long status; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 47db9087e68b..da5309e69bdd 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3358,7 +3358,7 @@ static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv, | |||
3358 | /** | 3358 | /** |
3359 | * iwl3945_rx_queue_space - Return number of free slots available in queue. | 3359 | * iwl3945_rx_queue_space - Return number of free slots available in queue. |
3360 | */ | 3360 | */ |
3361 | static int iwl3945_rx_queue_space(const struct iwl3945_rx_queue *q) | 3361 | static int iwl3945_rx_queue_space(const struct iwl_rx_queue *q) |
3362 | { | 3362 | { |
3363 | int s = q->read - q->write; | 3363 | int s = q->read - q->write; |
3364 | if (s <= 0) | 3364 | if (s <= 0) |
@@ -3373,7 +3373,7 @@ static int iwl3945_rx_queue_space(const struct iwl3945_rx_queue *q) | |||
3373 | /** | 3373 | /** |
3374 | * iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue | 3374 | * iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue |
3375 | */ | 3375 | */ |
3376 | int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, struct iwl3945_rx_queue *q) | 3376 | int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, struct iwl_rx_queue *q) |
3377 | { | 3377 | { |
3378 | u32 reg = 0; | 3378 | u32 reg = 0; |
3379 | int rc = 0; | 3379 | int rc = 0; |
@@ -3438,7 +3438,7 @@ static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl3945_priv *priv, | |||
3438 | */ | 3438 | */ |
3439 | static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv) | 3439 | static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv) |
3440 | { | 3440 | { |
3441 | struct iwl3945_rx_queue *rxq = &priv->rxq; | 3441 | struct iwl_rx_queue *rxq = &priv->rxq; |
3442 | struct list_head *element; | 3442 | struct list_head *element; |
3443 | struct iwl_rx_mem_buffer *rxb; | 3443 | struct iwl_rx_mem_buffer *rxb; |
3444 | unsigned long flags; | 3444 | unsigned long flags; |
@@ -3490,7 +3490,7 @@ static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv) | |||
3490 | */ | 3490 | */ |
3491 | static void iwl3945_rx_allocate(struct iwl3945_priv *priv) | 3491 | static void iwl3945_rx_allocate(struct iwl3945_priv *priv) |
3492 | { | 3492 | { |
3493 | struct iwl3945_rx_queue *rxq = &priv->rxq; | 3493 | struct iwl_rx_queue *rxq = &priv->rxq; |
3494 | struct list_head *element; | 3494 | struct list_head *element; |
3495 | struct iwl_rx_mem_buffer *rxb; | 3495 | struct iwl_rx_mem_buffer *rxb; |
3496 | unsigned long flags; | 3496 | unsigned long flags; |
@@ -3562,7 +3562,7 @@ void iwl3945_rx_replenish(void *data) | |||
3562 | * This free routine walks the list of POOL entries and if SKB is set to | 3562 | * This free routine walks the list of POOL entries and if SKB is set to |
3563 | * non NULL it is unmapped and freed | 3563 | * non NULL it is unmapped and freed |
3564 | */ | 3564 | */ |
3565 | static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl3945_rx_queue *rxq) | 3565 | static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) |
3566 | { | 3566 | { |
3567 | int i; | 3567 | int i; |
3568 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { | 3568 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { |
@@ -3581,7 +3581,7 @@ static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl3945_rx_q | |||
3581 | 3581 | ||
3582 | int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv) | 3582 | int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv) |
3583 | { | 3583 | { |
3584 | struct iwl3945_rx_queue *rxq = &priv->rxq; | 3584 | struct iwl_rx_queue *rxq = &priv->rxq; |
3585 | struct pci_dev *dev = priv->pci_dev; | 3585 | struct pci_dev *dev = priv->pci_dev; |
3586 | int i; | 3586 | int i; |
3587 | 3587 | ||
@@ -3606,7 +3606,7 @@ int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv) | |||
3606 | return 0; | 3606 | return 0; |
3607 | } | 3607 | } |
3608 | 3608 | ||
3609 | void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, struct iwl3945_rx_queue *rxq) | 3609 | void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) |
3610 | { | 3610 | { |
3611 | unsigned long flags; | 3611 | unsigned long flags; |
3612 | int i; | 3612 | int i; |
@@ -3724,7 +3724,7 @@ static void iwl3945_rx_handle(struct iwl3945_priv *priv) | |||
3724 | { | 3724 | { |
3725 | struct iwl_rx_mem_buffer *rxb; | 3725 | struct iwl_rx_mem_buffer *rxb; |
3726 | struct iwl_rx_packet *pkt; | 3726 | struct iwl_rx_packet *pkt; |
3727 | struct iwl3945_rx_queue *rxq = &priv->rxq; | 3727 | struct iwl_rx_queue *rxq = &priv->rxq; |
3728 | u32 r, i; | 3728 | u32 r, i; |
3729 | int reclaim; | 3729 | int reclaim; |
3730 | unsigned long flags; | 3730 | unsigned long flags; |