aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2008-12-18 21:37:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:08 -0500
commit6100b58806e6307f959af79334ac553825400242 (patch)
treebed0cda1758c177dc698f148cd74fbda852c31c7 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parentd2bf55839ad77486a02ec32f8411f432621da110 (diff)
iwl3945: use iwl_rx_mem_buffer
The patch replaces iwl3945_rx_mem_buffer with iwl_rx_mem_buffer. 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/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 6fb5d07ec6b9..47db9087e68b 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2863,7 +2863,7 @@ static int iwl3945_get_measurement(struct iwl3945_priv *priv,
2863#endif 2863#endif
2864 2864
2865static void iwl3945_rx_reply_alive(struct iwl3945_priv *priv, 2865static void iwl3945_rx_reply_alive(struct iwl3945_priv *priv,
2866 struct iwl3945_rx_mem_buffer *rxb) 2866 struct iwl_rx_mem_buffer *rxb)
2867{ 2867{
2868 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2868 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2869 struct iwl_alive_resp *palive; 2869 struct iwl_alive_resp *palive;
@@ -2899,7 +2899,7 @@ static void iwl3945_rx_reply_alive(struct iwl3945_priv *priv,
2899} 2899}
2900 2900
2901static void iwl3945_rx_reply_add_sta(struct iwl3945_priv *priv, 2901static void iwl3945_rx_reply_add_sta(struct iwl3945_priv *priv,
2902 struct iwl3945_rx_mem_buffer *rxb) 2902 struct iwl_rx_mem_buffer *rxb)
2903{ 2903{
2904 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2904 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2905 2905
@@ -2908,7 +2908,7 @@ static void iwl3945_rx_reply_add_sta(struct iwl3945_priv *priv,
2908} 2908}
2909 2909
2910static void iwl3945_rx_reply_error(struct iwl3945_priv *priv, 2910static void iwl3945_rx_reply_error(struct iwl3945_priv *priv,
2911 struct iwl3945_rx_mem_buffer *rxb) 2911 struct iwl_rx_mem_buffer *rxb)
2912{ 2912{
2913 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2913 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2914 2914
@@ -2923,7 +2923,7 @@ static void iwl3945_rx_reply_error(struct iwl3945_priv *priv,
2923 2923
2924#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x 2924#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
2925 2925
2926static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl3945_rx_mem_buffer *rxb) 2926static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl_rx_mem_buffer *rxb)
2927{ 2927{
2928 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2928 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2929 struct iwl3945_rxon_cmd *rxon = (void *)&priv->active_rxon; 2929 struct iwl3945_rxon_cmd *rxon = (void *)&priv->active_rxon;
@@ -2935,7 +2935,7 @@ static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl3945_rx_mem_buff
2935} 2935}
2936 2936
2937static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv, 2937static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv,
2938 struct iwl3945_rx_mem_buffer *rxb) 2938 struct iwl_rx_mem_buffer *rxb)
2939{ 2939{
2940#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT 2940#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
2941 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2941 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2953,7 +2953,7 @@ static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv,
2953} 2953}
2954 2954
2955static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv, 2955static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv,
2956 struct iwl3945_rx_mem_buffer *rxb) 2956 struct iwl_rx_mem_buffer *rxb)
2957{ 2957{
2958#ifdef CONFIG_IWL3945_DEBUG 2958#ifdef CONFIG_IWL3945_DEBUG
2959 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2959 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2964,7 +2964,7 @@ static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv,
2964} 2964}
2965 2965
2966static void iwl3945_rx_pm_debug_statistics_notif(struct iwl3945_priv *priv, 2966static void iwl3945_rx_pm_debug_statistics_notif(struct iwl3945_priv *priv,
2967 struct iwl3945_rx_mem_buffer *rxb) 2967 struct iwl_rx_mem_buffer *rxb)
2968{ 2968{
2969 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2969 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2970 IWL_DEBUG_RADIO("Dumping %d bytes of unhandled " 2970 IWL_DEBUG_RADIO("Dumping %d bytes of unhandled "
@@ -3000,7 +3000,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work)
3000} 3000}
3001 3001
3002static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv, 3002static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv,
3003 struct iwl3945_rx_mem_buffer *rxb) 3003 struct iwl_rx_mem_buffer *rxb)
3004{ 3004{
3005#ifdef CONFIG_IWL3945_DEBUG 3005#ifdef CONFIG_IWL3945_DEBUG
3006 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3006 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3023,7 +3023,7 @@ static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv,
3023 3023
3024/* Service response to REPLY_SCAN_CMD (0x80) */ 3024/* Service response to REPLY_SCAN_CMD (0x80) */
3025static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv, 3025static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv,
3026 struct iwl3945_rx_mem_buffer *rxb) 3026 struct iwl_rx_mem_buffer *rxb)
3027{ 3027{
3028#ifdef CONFIG_IWL3945_DEBUG 3028#ifdef CONFIG_IWL3945_DEBUG
3029 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3029 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3036,7 +3036,7 @@ static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv,
3036 3036
3037/* Service SCAN_START_NOTIFICATION (0x82) */ 3037/* Service SCAN_START_NOTIFICATION (0x82) */
3038static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv, 3038static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv,
3039 struct iwl3945_rx_mem_buffer *rxb) 3039 struct iwl_rx_mem_buffer *rxb)
3040{ 3040{
3041 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3041 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
3042 struct iwl_scanstart_notification *notif = 3042 struct iwl_scanstart_notification *notif =
@@ -3053,7 +3053,7 @@ static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv,
3053 3053
3054/* Service SCAN_RESULTS_NOTIFICATION (0x83) */ 3054/* Service SCAN_RESULTS_NOTIFICATION (0x83) */
3055static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv, 3055static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv,
3056 struct iwl3945_rx_mem_buffer *rxb) 3056 struct iwl_rx_mem_buffer *rxb)
3057{ 3057{
3058 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3058 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
3059 struct iwl_scanresults_notification *notif = 3059 struct iwl_scanresults_notification *notif =
@@ -3078,7 +3078,7 @@ static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv,
3078 3078
3079/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ 3079/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
3080static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv, 3080static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv,
3081 struct iwl3945_rx_mem_buffer *rxb) 3081 struct iwl_rx_mem_buffer *rxb)
3082{ 3082{
3083 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3083 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
3084 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; 3084 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
@@ -3141,7 +3141,7 @@ reschedule:
3141/* Handle notification from uCode that card's power state is changing 3141/* Handle notification from uCode that card's power state is changing
3142 * due to software, hardware, or critical temperature RFKILL */ 3142 * due to software, hardware, or critical temperature RFKILL */
3143static void iwl3945_rx_card_state_notif(struct iwl3945_priv *priv, 3143static void iwl3945_rx_card_state_notif(struct iwl3945_priv *priv,
3144 struct iwl3945_rx_mem_buffer *rxb) 3144 struct iwl_rx_mem_buffer *rxb)
3145{ 3145{
3146 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3146 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
3147 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); 3147 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
@@ -3259,7 +3259,7 @@ static void iwl3945_cmd_queue_reclaim(struct iwl3945_priv *priv,
3259 * if the callback returns 1 3259 * if the callback returns 1
3260 */ 3260 */
3261static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv, 3261static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv,
3262 struct iwl3945_rx_mem_buffer *rxb) 3262 struct iwl_rx_mem_buffer *rxb)
3263{ 3263{
3264 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 3264 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
3265 u16 sequence = le16_to_cpu(pkt->hdr.sequence); 3265 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
@@ -3346,7 +3346,7 @@ static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv,
3346 * are available, schedules iwl3945_rx_replenish 3346 * are available, schedules iwl3945_rx_replenish
3347 * 3347 *
3348 * -- enable interrupts -- 3348 * -- enable interrupts --
3349 * ISR - iwl3945_rx() Detach iwl3945_rx_mem_buffers from pool up to the 3349 * ISR - iwl3945_rx() Detach iwl_rx_mem_buffers from pool up to the
3350 * READ INDEX, detaching the SKB from the pool. 3350 * READ INDEX, detaching the SKB from the pool.
3351 * Moves the packet buffer from queue to rx_used. 3351 * Moves the packet buffer from queue to rx_used.
3352 * Calls iwl3945_rx_queue_restock to refill any empty 3352 * Calls iwl3945_rx_queue_restock to refill any empty
@@ -3440,7 +3440,7 @@ static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv)
3440{ 3440{
3441 struct iwl3945_rx_queue *rxq = &priv->rxq; 3441 struct iwl3945_rx_queue *rxq = &priv->rxq;
3442 struct list_head *element; 3442 struct list_head *element;
3443 struct iwl3945_rx_mem_buffer *rxb; 3443 struct iwl_rx_mem_buffer *rxb;
3444 unsigned long flags; 3444 unsigned long flags;
3445 int write, rc; 3445 int write, rc;
3446 3446
@@ -3449,11 +3449,11 @@ static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv)
3449 while ((iwl3945_rx_queue_space(rxq) > 0) && (rxq->free_count)) { 3449 while ((iwl3945_rx_queue_space(rxq) > 0) && (rxq->free_count)) {
3450 /* Get next free Rx buffer, remove from free list */ 3450 /* Get next free Rx buffer, remove from free list */
3451 element = rxq->rx_free.next; 3451 element = rxq->rx_free.next;
3452 rxb = list_entry(element, struct iwl3945_rx_mem_buffer, list); 3452 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
3453 list_del(element); 3453 list_del(element);
3454 3454
3455 /* Point to Rx buffer via next RBD in circular buffer */ 3455 /* Point to Rx buffer via next RBD in circular buffer */
3456 rxq->bd[rxq->write] = iwl3945_dma_addr2rbd_ptr(priv, rxb->dma_addr); 3456 rxq->bd[rxq->write] = iwl3945_dma_addr2rbd_ptr(priv, rxb->real_dma_addr);
3457 rxq->queue[rxq->write] = rxb; 3457 rxq->queue[rxq->write] = rxb;
3458 rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; 3458 rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
3459 rxq->free_count--; 3459 rxq->free_count--;
@@ -3492,12 +3492,12 @@ static void iwl3945_rx_allocate(struct iwl3945_priv *priv)
3492{ 3492{
3493 struct iwl3945_rx_queue *rxq = &priv->rxq; 3493 struct iwl3945_rx_queue *rxq = &priv->rxq;
3494 struct list_head *element; 3494 struct list_head *element;
3495 struct iwl3945_rx_mem_buffer *rxb; 3495 struct iwl_rx_mem_buffer *rxb;
3496 unsigned long flags; 3496 unsigned long flags;
3497 spin_lock_irqsave(&rxq->lock, flags); 3497 spin_lock_irqsave(&rxq->lock, flags);
3498 while (!list_empty(&rxq->rx_used)) { 3498 while (!list_empty(&rxq->rx_used)) {
3499 element = rxq->rx_used.next; 3499 element = rxq->rx_used.next;
3500 rxb = list_entry(element, struct iwl3945_rx_mem_buffer, list); 3500 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
3501 3501
3502 /* Alloc a new receive buffer */ 3502 /* Alloc a new receive buffer */
3503 rxb->skb = 3503 rxb->skb =
@@ -3524,7 +3524,7 @@ static void iwl3945_rx_allocate(struct iwl3945_priv *priv)
3524 list_del(element); 3524 list_del(element);
3525 3525
3526 /* Get physical address of RB/SKB */ 3526 /* Get physical address of RB/SKB */
3527 rxb->dma_addr = 3527 rxb->real_dma_addr =
3528 pci_map_single(priv->pci_dev, rxb->skb->data, 3528 pci_map_single(priv->pci_dev, rxb->skb->data,
3529 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 3529 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
3530 list_add_tail(&rxb->list, &rxq->rx_free); 3530 list_add_tail(&rxb->list, &rxq->rx_free);
@@ -3568,7 +3568,7 @@ static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl3945_rx_q
3568 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { 3568 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) {
3569 if (rxq->pool[i].skb != NULL) { 3569 if (rxq->pool[i].skb != NULL) {
3570 pci_unmap_single(priv->pci_dev, 3570 pci_unmap_single(priv->pci_dev,
3571 rxq->pool[i].dma_addr, 3571 rxq->pool[i].real_dma_addr,
3572 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 3572 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
3573 dev_kfree_skb(rxq->pool[i].skb); 3573 dev_kfree_skb(rxq->pool[i].skb);
3574 } 3574 }
@@ -3619,7 +3619,7 @@ void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, struct iwl3945_rx_queue *
3619 * to an SKB, so we need to unmap and free potential storage */ 3619 * to an SKB, so we need to unmap and free potential storage */
3620 if (rxq->pool[i].skb != NULL) { 3620 if (rxq->pool[i].skb != NULL) {
3621 pci_unmap_single(priv->pci_dev, 3621 pci_unmap_single(priv->pci_dev,
3622 rxq->pool[i].dma_addr, 3622 rxq->pool[i].real_dma_addr,
3623 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 3623 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
3624 priv->alloc_rxb_skb--; 3624 priv->alloc_rxb_skb--;
3625 dev_kfree_skb(rxq->pool[i].skb); 3625 dev_kfree_skb(rxq->pool[i].skb);
@@ -3722,7 +3722,7 @@ int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm)
3722 */ 3722 */
3723static void iwl3945_rx_handle(struct iwl3945_priv *priv) 3723static void iwl3945_rx_handle(struct iwl3945_priv *priv)
3724{ 3724{
3725 struct iwl3945_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 iwl3945_rx_queue *rxq = &priv->rxq;
3728 u32 r, i; 3728 u32 r, i;
@@ -3752,7 +3752,7 @@ static void iwl3945_rx_handle(struct iwl3945_priv *priv)
3752 3752
3753 rxq->queue[i] = NULL; 3753 rxq->queue[i] = NULL;
3754 3754
3755 pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, 3755 pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->real_dma_addr,
3756 IWL_RX_BUF_SIZE, 3756 IWL_RX_BUF_SIZE,
3757 PCI_DMA_FROMDEVICE); 3757 PCI_DMA_FROMDEVICE);
3758 pkt = (struct iwl_rx_packet *)rxb->skb->data; 3758 pkt = (struct iwl_rx_packet *)rxb->skb->data;
@@ -3802,7 +3802,7 @@ static void iwl3945_rx_handle(struct iwl3945_priv *priv)
3802 rxb->skb = NULL; 3802 rxb->skb = NULL;
3803 } 3803 }
3804 3804
3805 pci_unmap_single(priv->pci_dev, rxb->dma_addr, 3805 pci_unmap_single(priv->pci_dev, rxb->real_dma_addr,
3806 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 3806 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
3807 spin_lock_irqsave(&rxq->lock, flags); 3807 spin_lock_irqsave(&rxq->lock, flags);
3808 list_add_tail(&rxb->list, &priv->rxq.rx_used); 3808 list_add_tail(&rxb->list, &priv->rxq.rx_used);