diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/htc.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htc.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index edc57ab505c8..7f1bccd3597f 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c | |||
@@ -63,7 +63,9 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void *ar) | |||
63 | static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, | 63 | static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, |
64 | struct sk_buff *skb) | 64 | struct sk_buff *skb) |
65 | { | 65 | { |
66 | ath10k_skb_unmap(htc->ar->dev, skb); | 66 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); |
67 | |||
68 | dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); | ||
67 | skb_pull(skb, sizeof(struct ath10k_htc_hdr)); | 69 | skb_pull(skb, sizeof(struct ath10k_htc_hdr)); |
68 | } | 70 | } |
69 | 71 | ||
@@ -122,6 +124,9 @@ int ath10k_htc_send(struct ath10k_htc *htc, | |||
122 | struct sk_buff *skb) | 124 | struct sk_buff *skb) |
123 | { | 125 | { |
124 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; | 126 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; |
127 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); | ||
128 | struct ath10k_hif_sg_item sg_item; | ||
129 | struct device *dev = htc->ar->dev; | ||
125 | int credits = 0; | 130 | int credits = 0; |
126 | int ret; | 131 | int ret; |
127 | 132 | ||
@@ -157,19 +162,25 @@ int ath10k_htc_send(struct ath10k_htc *htc, | |||
157 | 162 | ||
158 | ath10k_htc_prepare_tx_skb(ep, skb); | 163 | ath10k_htc_prepare_tx_skb(ep, skb); |
159 | 164 | ||
160 | ret = ath10k_skb_map(htc->ar->dev, skb); | 165 | skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE); |
166 | ret = dma_mapping_error(dev, skb_cb->paddr); | ||
161 | if (ret) | 167 | if (ret) |
162 | goto err_credits; | 168 | goto err_credits; |
163 | 169 | ||
164 | ret = ath10k_hif_send_head(htc->ar, ep->ul_pipe_id, ep->eid, | 170 | sg_item.transfer_id = ep->eid; |
165 | skb->len, skb); | 171 | sg_item.transfer_context = skb; |
172 | sg_item.vaddr = skb->data; | ||
173 | sg_item.paddr = skb_cb->paddr; | ||
174 | sg_item.len = skb->len; | ||
175 | |||
176 | ret = ath10k_hif_tx_sg(htc->ar, ep->ul_pipe_id, &sg_item, 1); | ||
166 | if (ret) | 177 | if (ret) |
167 | goto err_unmap; | 178 | goto err_unmap; |
168 | 179 | ||
169 | return 0; | 180 | return 0; |
170 | 181 | ||
171 | err_unmap: | 182 | err_unmap: |
172 | ath10k_skb_unmap(htc->ar->dev, skb); | 183 | dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); |
173 | err_credits: | 184 | err_credits: |
174 | if (ep->tx_credit_flow_enabled) { | 185 | if (ep->tx_credit_flow_enabled) { |
175 | spin_lock_bh(&htc->tx_lock); | 186 | spin_lock_bh(&htc->tx_lock); |
@@ -191,10 +202,8 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar, | |||
191 | struct ath10k_htc *htc = &ar->htc; | 202 | struct ath10k_htc *htc = &ar->htc; |
192 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; | 203 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; |
193 | 204 | ||
194 | if (!skb) { | 205 | if (WARN_ON_ONCE(!skb)) |
195 | ath10k_warn("invalid sk_buff completion - NULL pointer. firmware crashed?\n"); | ||
196 | return 0; | 206 | return 0; |
197 | } | ||
198 | 207 | ||
199 | ath10k_htc_notify_tx_completion(ep, skb); | 208 | ath10k_htc_notify_tx_completion(ep, skb); |
200 | /* the skb now belongs to the completion handler */ | 209 | /* the skb now belongs to the completion handler */ |