aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hif_usb.c
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/ath/ath9k/hif_usb.c
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/ath/ath9k/hif_usb.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c10
1 files changed, 5 insertions, 5 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