diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 0878b34ee58..fc7a51144f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -524,7 +524,7 @@ int iwl_hw_tx_queue_init(struct iwl_priv *priv, | |||
524 | static void iwl_rx_reply_alive(struct iwl_priv *priv, | 524 | static void iwl_rx_reply_alive(struct iwl_priv *priv, |
525 | struct iwl_rx_mem_buffer *rxb) | 525 | struct iwl_rx_mem_buffer *rxb) |
526 | { | 526 | { |
527 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; | 527 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
528 | struct iwl_alive_resp *palive; | 528 | struct iwl_alive_resp *palive; |
529 | struct delayed_work *pwork; | 529 | struct delayed_work *pwork; |
530 | 530 | ||
@@ -610,7 +610,7 @@ static void iwl_rx_beacon_notif(struct iwl_priv *priv, | |||
610 | struct iwl_rx_mem_buffer *rxb) | 610 | struct iwl_rx_mem_buffer *rxb) |
611 | { | 611 | { |
612 | #ifdef CONFIG_IWLWIFI_DEBUG | 612 | #ifdef CONFIG_IWLWIFI_DEBUG |
613 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; | 613 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
614 | struct iwl4965_beacon_notif *beacon = | 614 | struct iwl4965_beacon_notif *beacon = |
615 | (struct iwl4965_beacon_notif *)pkt->u.raw; | 615 | (struct iwl4965_beacon_notif *)pkt->u.raw; |
616 | u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); | 616 | u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); |
@@ -634,7 +634,7 @@ static void iwl_rx_beacon_notif(struct iwl_priv *priv, | |||
634 | static void iwl_rx_card_state_notif(struct iwl_priv *priv, | 634 | static void iwl_rx_card_state_notif(struct iwl_priv *priv, |
635 | struct iwl_rx_mem_buffer *rxb) | 635 | struct iwl_rx_mem_buffer *rxb) |
636 | { | 636 | { |
637 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; | 637 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
638 | u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); | 638 | u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); |
639 | unsigned long status = priv->status; | 639 | unsigned long status = priv->status; |
640 | 640 | ||
@@ -786,10 +786,10 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
786 | 786 | ||
787 | rxq->queue[i] = NULL; | 787 | rxq->queue[i] = NULL; |
788 | 788 | ||
789 | pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, | 789 | pci_unmap_page(priv->pci_dev, rxb->page_dma, |
790 | priv->hw_params.rx_buf_size + 256, | 790 | PAGE_SIZE << priv->hw_params.rx_page_order, |
791 | PCI_DMA_FROMDEVICE); | 791 | PCI_DMA_FROMDEVICE); |
792 | pkt = (struct iwl_rx_packet *)rxb->skb->data; | 792 | pkt = rxb_addr(rxb); |
793 | 793 | ||
794 | trace_iwlwifi_dev_rx(priv, pkt, | 794 | trace_iwlwifi_dev_rx(priv, pkt, |
795 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); | 795 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); |
@@ -825,10 +825,10 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
825 | } | 825 | } |
826 | 826 | ||
827 | if (reclaim) { | 827 | if (reclaim) { |
828 | /* Invoke any callbacks, transfer the skb to caller, and | 828 | /* Invoke any callbacks, transfer the buffer to caller, |
829 | * fire off the (possibly) blocking iwl_send_cmd() | 829 | * and fire off the (possibly) blocking iwl_send_cmd() |
830 | * as we reclaim the driver command queue */ | 830 | * as we reclaim the driver command queue */ |
831 | if (rxb && rxb->skb) | 831 | if (rxb && rxb->page) |
832 | iwl_tx_cmd_complete(priv, rxb); | 832 | iwl_tx_cmd_complete(priv, rxb); |
833 | else | 833 | else |
834 | IWL_WARN(priv, "Claim null rxb?\n"); | 834 | IWL_WARN(priv, "Claim null rxb?\n"); |
@@ -837,10 +837,10 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
837 | /* For now we just don't re-use anything. We can tweak this | 837 | /* For now we just don't re-use anything. We can tweak this |
838 | * later to try and re-use notification packets and SKBs that | 838 | * later to try and re-use notification packets and SKBs that |
839 | * fail to Rx correctly */ | 839 | * fail to Rx correctly */ |
840 | if (rxb->skb != NULL) { | 840 | if (rxb->page != NULL) { |
841 | priv->alloc_rxb_skb--; | 841 | priv->alloc_rxb_page--; |
842 | dev_kfree_skb_any(rxb->skb); | 842 | __free_pages(rxb->page, priv->hw_params.rx_page_order); |
843 | rxb->skb = NULL; | 843 | rxb->page = NULL; |
844 | } | 844 | } |
845 | 845 | ||
846 | spin_lock_irqsave(&rxq->lock, flags); | 846 | spin_lock_irqsave(&rxq->lock, flags); |
@@ -907,6 +907,8 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv) | |||
907 | } | 907 | } |
908 | #endif | 908 | #endif |
909 | 909 | ||
910 | spin_unlock_irqrestore(&priv->lock, flags); | ||
911 | |||
910 | /* Since CSR_INT and CSR_FH_INT_STATUS reads and clears are not | 912 | /* Since CSR_INT and CSR_FH_INT_STATUS reads and clears are not |
911 | * atomic, make sure that inta covers all the interrupts that | 913 | * atomic, make sure that inta covers all the interrupts that |
912 | * we've discovered, even if FH interrupt came in just after | 914 | * we've discovered, even if FH interrupt came in just after |
@@ -928,8 +930,6 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv) | |||
928 | 930 | ||
929 | handled |= CSR_INT_BIT_HW_ERR; | 931 | handled |= CSR_INT_BIT_HW_ERR; |
930 | 932 | ||
931 | spin_unlock_irqrestore(&priv->lock, flags); | ||
932 | |||
933 | return; | 933 | return; |
934 | } | 934 | } |
935 | 935 | ||
@@ -1056,7 +1056,6 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv) | |||
1056 | "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags); | 1056 | "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags); |
1057 | } | 1057 | } |
1058 | #endif | 1058 | #endif |
1059 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1060 | } | 1059 | } |
1061 | 1060 | ||
1062 | /* tasklet for iwlagn interrupt */ | 1061 | /* tasklet for iwlagn interrupt */ |
@@ -1086,6 +1085,9 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
1086 | inta, inta_mask); | 1085 | inta, inta_mask); |
1087 | } | 1086 | } |
1088 | #endif | 1087 | #endif |
1088 | |||
1089 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1090 | |||
1089 | /* saved interrupt in inta variable now we can reset priv->inta */ | 1091 | /* saved interrupt in inta variable now we can reset priv->inta */ |
1090 | priv->inta = 0; | 1092 | priv->inta = 0; |
1091 | 1093 | ||
@@ -1101,8 +1103,6 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
1101 | 1103 | ||
1102 | handled |= CSR_INT_BIT_HW_ERR; | 1104 | handled |= CSR_INT_BIT_HW_ERR; |
1103 | 1105 | ||
1104 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1105 | |||
1106 | return; | 1106 | return; |
1107 | } | 1107 | } |
1108 | 1108 | ||
@@ -1242,14 +1242,10 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
1242 | inta & ~priv->inta_mask); | 1242 | inta & ~priv->inta_mask); |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | |||
1246 | /* Re-enable all interrupts */ | 1245 | /* Re-enable all interrupts */ |
1247 | /* only Re-enable if diabled by irq */ | 1246 | /* only Re-enable if diabled by irq */ |
1248 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | 1247 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) |
1249 | iwl_enable_interrupts(priv); | 1248 | iwl_enable_interrupts(priv); |
1250 | |||
1251 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1252 | |||
1253 | } | 1249 | } |
1254 | 1250 | ||
1255 | 1251 | ||