ath10k: introduce struct ath10k_skb_rxcb
authorMichal Kazior <michal.kazior@tieto.com>
Sat, 24 Jan 2015 10:14:47 +0000 (12:14 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 27 Jan 2015 13:55:51 +0000 (15:55 +0200)
It doesn't make much sense to share the
ath10k_skb_cb with Rx path. The Rx path doesn't
need to keep any mac80211's data.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/pci.c

index c5686122b140801d8be16f002a9fef9d0b2788aa..739d9d69cf1cc75e047d620371ee343a4c02a477 100644 (file)
@@ -97,6 +97,10 @@ struct ath10k_skb_cb {
        } bcn;
 } __packed;
 
+struct ath10k_skb_rxcb {
+       dma_addr_t paddr;
+};
+
 static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
 {
        BUILD_BUG_ON(sizeof(struct ath10k_skb_cb) >
@@ -104,6 +108,12 @@ static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
        return (struct ath10k_skb_cb *)&IEEE80211_SKB_CB(skb)->driver_data;
 }
 
+static inline struct ath10k_skb_rxcb *ATH10K_SKB_RXCB(struct sk_buff *skb)
+{
+       BUILD_BUG_ON(sizeof(struct ath10k_skb_rxcb) > sizeof(skb->cb));
+       return (struct ath10k_skb_rxcb *)skb->cb;
+}
+
 static inline u32 host_interest_item_address(u32 item_offset)
 {
        return QCA988X_HOST_INTEREST_ADDRESS + item_offset;
index baa1c447a3b80238afe968dc99a8aee7e8a16b55..2e55ed7241aef8d3c5023e9ee1b0add36a3a71b8 100644 (file)
@@ -37,12 +37,12 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr);
 static void ath10k_htt_rx_ring_free(struct ath10k_htt *htt)
 {
        struct sk_buff *skb;
-       struct ath10k_skb_cb *cb;
+       struct ath10k_skb_rxcb *cb;
        int i;
 
        for (i = 0; i < htt->rx_ring.fill_cnt; i++) {
                skb = htt->rx_ring.netbufs_ring[i];
-               cb = ATH10K_SKB_CB(skb);
+               cb = ATH10K_SKB_RXCB(skb);
                dma_unmap_single(htt->ar->dev, cb->paddr,
                                 skb->len + skb_tailroom(skb),
                                 DMA_FROM_DEVICE);
@@ -86,7 +86,7 @@ static int __ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num)
                        goto fail;
                }
 
-               ATH10K_SKB_CB(skb)->paddr = paddr;
+               ATH10K_SKB_RXCB(skb)->paddr = paddr;
                htt->rx_ring.netbufs_ring[idx] = skb;
                htt->rx_ring.paddrs_ring[idx] = __cpu_to_le32(paddr);
                htt->rx_ring.fill_cnt++;
@@ -168,7 +168,7 @@ static void ath10k_htt_rx_ring_clean_up(struct ath10k_htt *htt)
                if (!skb)
                        continue;
 
-               dma_unmap_single(htt->ar->dev, ATH10K_SKB_CB(skb)->paddr,
+               dma_unmap_single(htt->ar->dev, ATH10K_SKB_RXCB(skb)->paddr,
                                 skb->len + skb_tailroom(skb),
                                 DMA_FROM_DEVICE);
                dev_kfree_skb_any(skb);
@@ -224,7 +224,7 @@ static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt)
        htt->rx_ring.fill_cnt--;
 
        dma_unmap_single(htt->ar->dev,
-                        ATH10K_SKB_CB(msdu)->paddr,
+                        ATH10K_SKB_RXCB(msdu)->paddr,
                         msdu->len + skb_tailroom(msdu),
                         DMA_FROM_DEVICE);
        ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt rx netbuf pop: ",
index 3b40a86304bfe349654ce15359b4b0690d8b04ee..b98354c004f59683cbb9247577d61ed8961e84d9 100644 (file)
@@ -403,7 +403,7 @@ static int __ath10k_pci_rx_post_buf(struct ath10k_pci_pipe *pipe)
                return -EIO;
        }
 
-       ATH10K_SKB_CB(skb)->paddr = paddr;
+       ATH10K_SKB_RXCB(skb)->paddr = paddr;
 
        ret = __ath10k_ce_rx_post_buf(ce_pipe, skb, paddr);
        if (ret) {
@@ -872,7 +872,7 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
                                             &flags) == 0) {
                skb = transfer_context;
                max_nbytes = skb->len + skb_tailroom(skb);
-               dma_unmap_single(ar->dev, ATH10K_SKB_CB(skb)->paddr,
+               dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr,
                                 max_nbytes, DMA_FROM_DEVICE);
 
                if (unlikely(max_nbytes < nbytes)) {
@@ -1238,7 +1238,7 @@ static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
 
                ce_ring->per_transfer_context[i] = NULL;
 
-               dma_unmap_single(ar->dev, ATH10K_SKB_CB(skb)->paddr,
+               dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr,
                                 skb->len + skb_tailroom(skb),
                                 DMA_FROM_DEVICE);
                dev_kfree_skb_any(skb);