ath10k: remove transfer_id from ath10k_hif_cb::tx_completion
authorMichal Kazior <michal.kazior@tieto.com>
Thu, 27 Nov 2014 10:09:37 +0000 (11:09 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 1 Dec 2014 07:13:36 +0000 (09:13 +0200)
Pass the eid argument via skbuff control buffer.
This will make it possible to work with queues of
HTC event buffers.

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/hif.h
drivers/net/wireless/ath/ath10k/htc.c
drivers/net/wireless/ath/ath10k/pci.c

index 5af9a24ae143fb420ce8ee5af767619e735d28be..514c219263a5905a11288f842789133c01f49350 100644 (file)
@@ -79,6 +79,7 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus)
 
 struct ath10k_skb_cb {
        dma_addr_t paddr;
+       u8 eid;
        u8 vdev_id;
 
        struct {
index 91d24a546efa23c38b25fe0e65a2ac03ecb1be09..0c92e0251e84f64fd0e8b53679deda60803749f9 100644 (file)
@@ -32,8 +32,7 @@ struct ath10k_hif_sg_item {
 
 struct ath10k_hif_cb {
        int (*tx_completion)(struct ath10k *ar,
-                            struct sk_buff *wbuf,
-                            unsigned transfer_id);
+                            struct sk_buff *wbuf);
        int (*rx_completion)(struct ath10k *ar,
                             struct sk_buff *wbuf);
 };
index e245e34f9f1c55a880198ff35269906ba1357e3b..f1946a6be442cb1d031b91b0556df1b3ae275b32 100644 (file)
@@ -160,6 +160,7 @@ int ath10k_htc_send(struct ath10k_htc *htc,
 
        ath10k_htc_prepare_tx_skb(ep, skb);
 
+       skb_cb->eid = eid;
        skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE);
        ret = dma_mapping_error(dev, skb_cb->paddr);
        if (ret)
@@ -197,15 +198,18 @@ err_pull:
 }
 
 static int ath10k_htc_tx_completion_handler(struct ath10k *ar,
-                                           struct sk_buff *skb,
-                                           unsigned int eid)
+                                           struct sk_buff *skb)
 {
        struct ath10k_htc *htc = &ar->htc;
-       struct ath10k_htc_ep *ep = &htc->endpoint[eid];
+       struct ath10k_skb_cb *skb_cb;
+       struct ath10k_htc_ep *ep;
 
        if (WARN_ON_ONCE(!skb))
                return 0;
 
+       skb_cb = ATH10K_SKB_CB(skb);
+       ep = &htc->endpoint[skb_cb->eid];
+
        ath10k_htc_notify_tx_completion(ep, skb);
        /* the skb now belongs to the completion handler */
 
index 541f3bc497a956aecb6d8364f744c11ff0585390..95e90668f67cc66ee55f6da8fe947eae9697e11a 100644 (file)
@@ -835,7 +835,7 @@ static void ath10k_pci_ce_send_done(struct ath10k_ce_pipe *ce_state)
                if (transfer_context == NULL)
                        continue;
 
-               cb->tx_completion(ar, transfer_context, transfer_id);
+               cb->tx_completion(ar, transfer_context);
        }
 }
 
@@ -1263,7 +1263,7 @@ static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
                id = MS(__le16_to_cpu(ce_desc[i].flags),
                        CE_DESC_FLAGS_META_DATA);
 
-               ar_pci->msg_callbacks_current.tx_completion(ar, skb, id);
+               ar_pci->msg_callbacks_current.tx_completion(ar, skb);
        }
 }