aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2010-04-12 12:29:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-14 14:52:43 -0400
commite6c6d33cb7d18721e56ce4bb5a0e22593956ef14 (patch)
tree1492732f91d4ae425c9f2e2c3de1db0229913be5 /drivers/net/wireless
parentf28a7b30cdaa936bdbdc0a2018241936fb56cae6 (diff)
ath9k-htc:respect usb buffer cacheline alignment in reg in path
In ath9k-htc register in path, ath9k-htc will pass skb->data into usb hcd and usb hcd will do dma mapping and unmapping to the buffer pointed by skb->data, so we should pass a cache-line aligned address. This patch replace __dev_alloc_skb with alloc_skb to make skb->data pointed to a cacheline aligned address simply since ath9k-htc does not skb_push on the skb and pass it to mac80211, also use kfree_skb to free the skb allocated by alloc_skb(we can use kfree_skb safely in hardirq context since skb->destructor is NULL always in the path). Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/wmi.c4
3 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 178b11a8403a..259de170ea25 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -499,7 +499,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
499 if (likely(urb->actual_length != 0)) { 499 if (likely(urb->actual_length != 0)) {
500 skb_put(skb, urb->actual_length); 500 skb_put(skb, urb->actual_length);
501 501
502 nskb = __dev_alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); 502 nskb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC);
503 if (!nskb) 503 if (!nskb)
504 goto resubmit; 504 goto resubmit;
505 505
@@ -510,7 +510,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
510 510
511 ret = usb_submit_urb(urb, GFP_ATOMIC); 511 ret = usb_submit_urb(urb, GFP_ATOMIC);
512 if (ret) { 512 if (ret) {
513 dev_kfree_skb_any(nskb); 513 kfree_skb(nskb);
514 goto free; 514 goto free;
515 } 515 }
516 516
@@ -530,7 +530,7 @@ resubmit:
530 530
531 return; 531 return;
532free: 532free:
533 dev_kfree_skb_any(skb); 533 kfree_skb(skb);
534 urb->context = NULL; 534 urb->context = NULL;
535} 535}
536 536
@@ -670,7 +670,7 @@ static void ath9k_hif_usb_dealloc_reg_in_urb(struct hif_device_usb *hif_dev)
670 if (hif_dev->reg_in_urb) { 670 if (hif_dev->reg_in_urb) {
671 usb_kill_urb(hif_dev->reg_in_urb); 671 usb_kill_urb(hif_dev->reg_in_urb);
672 if (hif_dev->reg_in_urb->context) 672 if (hif_dev->reg_in_urb->context)
673 dev_kfree_skb_any((void *)hif_dev->reg_in_urb->context); 673 kfree_skb((void *)hif_dev->reg_in_urb->context);
674 usb_free_urb(hif_dev->reg_in_urb); 674 usb_free_urb(hif_dev->reg_in_urb);
675 hif_dev->reg_in_urb = NULL; 675 hif_dev->reg_in_urb = NULL;
676 } 676 }
@@ -684,7 +684,7 @@ static int ath9k_hif_usb_alloc_reg_in_urb(struct hif_device_usb *hif_dev)
684 if (hif_dev->reg_in_urb == NULL) 684 if (hif_dev->reg_in_urb == NULL)
685 return -ENOMEM; 685 return -ENOMEM;
686 686
687 skb = __dev_alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_KERNEL); 687 skb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_KERNEL);
688 if (!skb) 688 if (!skb)
689 goto err; 689 goto err;
690 690
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 24d7b886fe23..d1fa5bd6bdbb 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -374,7 +374,10 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
374 epid = htc_hdr->endpoint_id; 374 epid = htc_hdr->endpoint_id;
375 375
376 if (epid >= ENDPOINT_MAX) { 376 if (epid >= ENDPOINT_MAX) {
377 dev_kfree_skb_any(skb); 377 if (pipe_id != USB_REG_IN_PIPE)
378 dev_kfree_skb_any(skb);
379 else
380 kfree_skb(skb);
378 return; 381 return;
379 } 382 }
380 383
@@ -403,7 +406,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
403 break; 406 break;
404 } 407 }
405 408
406 dev_kfree_skb_any(skb); 409 kfree_skb(skb);
407 410
408 } else { 411 } else {
409 if (htc_hdr->flags & HTC_FLAGS_RECV_TRAILER) 412 if (htc_hdr->flags & HTC_FLAGS_RECV_TRAILER)
diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c
index 818dea0164ec..acb66544a2aa 100644
--- a/drivers/net/wireless/ath/ath9k/wmi.c
+++ b/drivers/net/wireless/ath/ath9k/wmi.c
@@ -169,7 +169,7 @@ void ath9k_wmi_tasklet(unsigned long data)
169 break; 169 break;
170 } 170 }
171 171
172 dev_kfree_skb_any(skb); 172 kfree_skb(skb);
173} 173}
174 174
175static void ath9k_wmi_rsp_callback(struct wmi *wmi, struct sk_buff *skb) 175static void ath9k_wmi_rsp_callback(struct wmi *wmi, struct sk_buff *skb)
@@ -207,7 +207,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
207 ath9k_wmi_rsp_callback(wmi, skb); 207 ath9k_wmi_rsp_callback(wmi, skb);
208 208
209free_skb: 209free_skb:
210 dev_kfree_skb_any(skb); 210 kfree_skb(skb);
211} 211}
212 212
213static void ath9k_wmi_ctrl_tx(void *priv, struct sk_buff *skb, 213static void ath9k_wmi_ctrl_tx(void *priv, struct sk_buff *skb,