aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 3a6b8a5ca96c..7abb8367119a 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -823,20 +823,24 @@ static void ath10k_pci_ce_send_done(struct ath10k_ce_pipe *ce_state)
823 struct ath10k *ar = ce_state->ar; 823 struct ath10k *ar = ce_state->ar;
824 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); 824 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
825 struct ath10k_hif_cb *cb = &ar_pci->msg_callbacks_current; 825 struct ath10k_hif_cb *cb = &ar_pci->msg_callbacks_current;
826 void *transfer_context; 826 struct sk_buff_head list;
827 struct sk_buff *skb;
827 u32 ce_data; 828 u32 ce_data;
828 unsigned int nbytes; 829 unsigned int nbytes;
829 unsigned int transfer_id; 830 unsigned int transfer_id;
830 831
831 while (ath10k_ce_completed_send_next(ce_state, &transfer_context, 832 __skb_queue_head_init(&list);
832 &ce_data, &nbytes, 833 while (ath10k_ce_completed_send_next(ce_state, (void **)&skb, &ce_data,
833 &transfer_id) == 0) { 834 &nbytes, &transfer_id) == 0) {
834 /* no need to call tx completion for NULL pointers */ 835 /* no need to call tx completion for NULL pointers */
835 if (transfer_context == NULL) 836 if (skb == NULL)
836 continue; 837 continue;
837 838
838 cb->tx_completion(ar, transfer_context, transfer_id); 839 __skb_queue_tail(&list, skb);
839 } 840 }
841
842 while ((skb = __skb_dequeue(&list)))
843 cb->tx_completion(ar, skb);
840} 844}
841 845
842/* Called by lower (CE) layer when data is received from the Target. */ 846/* Called by lower (CE) layer when data is received from the Target. */
@@ -847,12 +851,14 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
847 struct ath10k_pci_pipe *pipe_info = &ar_pci->pipe_info[ce_state->id]; 851 struct ath10k_pci_pipe *pipe_info = &ar_pci->pipe_info[ce_state->id];
848 struct ath10k_hif_cb *cb = &ar_pci->msg_callbacks_current; 852 struct ath10k_hif_cb *cb = &ar_pci->msg_callbacks_current;
849 struct sk_buff *skb; 853 struct sk_buff *skb;
854 struct sk_buff_head list;
850 void *transfer_context; 855 void *transfer_context;
851 u32 ce_data; 856 u32 ce_data;
852 unsigned int nbytes, max_nbytes; 857 unsigned int nbytes, max_nbytes;
853 unsigned int transfer_id; 858 unsigned int transfer_id;
854 unsigned int flags; 859 unsigned int flags;
855 860
861 __skb_queue_head_init(&list);
856 while (ath10k_ce_completed_recv_next(ce_state, &transfer_context, 862 while (ath10k_ce_completed_recv_next(ce_state, &transfer_context,
857 &ce_data, &nbytes, &transfer_id, 863 &ce_data, &nbytes, &transfer_id,
858 &flags) == 0) { 864 &flags) == 0) {
@@ -869,13 +875,16 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
869 } 875 }
870 876
871 skb_put(skb, nbytes); 877 skb_put(skb, nbytes);
878 __skb_queue_tail(&list, skb);
879 }
872 880
881 while ((skb = __skb_dequeue(&list))) {
873 ath10k_dbg(ar, ATH10K_DBG_PCI, "pci rx ce pipe %d len %d\n", 882 ath10k_dbg(ar, ATH10K_DBG_PCI, "pci rx ce pipe %d len %d\n",
874 ce_state->id, skb->len); 883 ce_state->id, skb->len);
875 ath10k_dbg_dump(ar, ATH10K_DBG_PCI_DUMP, NULL, "pci rx: ", 884 ath10k_dbg_dump(ar, ATH10K_DBG_PCI_DUMP, NULL, "pci rx: ",
876 skb->data, skb->len); 885 skb->data, skb->len);
877 886
878 cb->rx_completion(ar, skb, pipe_info->pipe_num); 887 cb->rx_completion(ar, skb);
879 } 888 }
880 889
881 ath10k_pci_rx_post_pipe(pipe_info); 890 ath10k_pci_rx_post_pipe(pipe_info);
@@ -1263,7 +1272,7 @@ static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
1263 id = MS(__le16_to_cpu(ce_desc[i].flags), 1272 id = MS(__le16_to_cpu(ce_desc[i].flags),
1264 CE_DESC_FLAGS_META_DATA); 1273 CE_DESC_FLAGS_META_DATA);
1265 1274
1266 ar_pci->msg_callbacks_current.tx_completion(ar, skb, id); 1275 ar_pci->msg_callbacks_current.tx_completion(ar, skb);
1267 } 1276 }
1268} 1277}
1269 1278
@@ -1988,6 +1997,7 @@ static int ath10k_pci_hif_resume(struct ath10k *ar)
1988static const struct ath10k_hif_ops ath10k_pci_hif_ops = { 1997static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
1989 .tx_sg = ath10k_pci_hif_tx_sg, 1998 .tx_sg = ath10k_pci_hif_tx_sg,
1990 .diag_read = ath10k_pci_hif_diag_read, 1999 .diag_read = ath10k_pci_hif_diag_read,
2000 .diag_write = ath10k_pci_diag_write_mem,
1991 .exchange_bmi_msg = ath10k_pci_hif_exchange_bmi_msg, 2001 .exchange_bmi_msg = ath10k_pci_hif_exchange_bmi_msg,
1992 .start = ath10k_pci_hif_start, 2002 .start = ath10k_pci_hif_start,
1993 .stop = ath10k_pci_hif_stop, 2003 .stop = ath10k_pci_hif_stop,
@@ -1998,6 +2008,8 @@ static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
1998 .get_free_queue_number = ath10k_pci_hif_get_free_queue_number, 2008 .get_free_queue_number = ath10k_pci_hif_get_free_queue_number,
1999 .power_up = ath10k_pci_hif_power_up, 2009 .power_up = ath10k_pci_hif_power_up,
2000 .power_down = ath10k_pci_hif_power_down, 2010 .power_down = ath10k_pci_hif_power_down,
2011 .read32 = ath10k_pci_read32,
2012 .write32 = ath10k_pci_write32,
2001#ifdef CONFIG_PM 2013#ifdef CONFIG_PM
2002 .suspend = ath10k_pci_hif_suspend, 2014 .suspend = ath10k_pci_hif_suspend,
2003 .resume = ath10k_pci_hif_resume, 2015 .resume = ath10k_pci_hif_resume,