diff options
| author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2011-05-13 14:22:31 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:50 -0400 |
| commit | 8b3becadc82de3b87a5c196239db3fef6caa9c82 (patch) | |
| tree | d71a3c7e29d30c92c4b677257c289ca63b4e65f3 /net | |
| parent | 57cf8043a64b56a10b9f194572548a3dfb62e596 (diff) | |
cfg80211: make stripping of 802.11 header optional from AMSDU
Currently the devices that have already stripped IEEE 802.11
header from the AMSDU SKB can not use ieee80211_amsdu_to_8023s
routine. This patch enhances ieee80211_amsdu_to_8023s() API by
changing mandatory removing of IEEE 802.11 header from AMSDU
to optional.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/mac80211/rx.c | 2 | ||||
| -rw-r--r-- | net/wireless/util.c | 21 |
2 files changed, 14 insertions, 9 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 3a9515cb7ce1..78c72a41d864 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -1783,7 +1783,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) | |||
| 1783 | 1783 | ||
| 1784 | ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, | 1784 | ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, |
| 1785 | rx->sdata->vif.type, | 1785 | rx->sdata->vif.type, |
| 1786 | rx->local->hw.extra_tx_headroom); | 1786 | rx->local->hw.extra_tx_headroom, true); |
| 1787 | 1787 | ||
| 1788 | while (!skb_queue_empty(&frame_list)) { | 1788 | while (!skb_queue_empty(&frame_list)) { |
| 1789 | rx->skb = __skb_dequeue(&frame_list); | 1789 | rx->skb = __skb_dequeue(&frame_list); |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 95e4e254da0a..f0536d44d43c 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
| @@ -544,7 +544,8 @@ EXPORT_SYMBOL(ieee80211_data_from_8023); | |||
| 544 | 544 | ||
| 545 | void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, | 545 | void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, |
| 546 | const u8 *addr, enum nl80211_iftype iftype, | 546 | const u8 *addr, enum nl80211_iftype iftype, |
| 547 | const unsigned int extra_headroom) | 547 | const unsigned int extra_headroom, |
| 548 | bool has_80211_header) | ||
| 548 | { | 549 | { |
| 549 | struct sk_buff *frame = NULL; | 550 | struct sk_buff *frame = NULL; |
| 550 | u16 ethertype; | 551 | u16 ethertype; |
| @@ -553,14 +554,18 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, | |||
| 553 | int remaining, err; | 554 | int remaining, err; |
| 554 | u8 dst[ETH_ALEN], src[ETH_ALEN]; | 555 | u8 dst[ETH_ALEN], src[ETH_ALEN]; |
| 555 | 556 | ||
| 556 | err = ieee80211_data_to_8023(skb, addr, iftype); | 557 | if (has_80211_header) { |
| 557 | if (err) | 558 | err = ieee80211_data_to_8023(skb, addr, iftype); |
| 558 | goto out; | 559 | if (err) |
| 560 | goto out; | ||
| 559 | 561 | ||
| 560 | /* skip the wrapping header */ | 562 | /* skip the wrapping header */ |
| 561 | eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); | 563 | eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); |
| 562 | if (!eth) | 564 | if (!eth) |
| 563 | goto out; | 565 | goto out; |
| 566 | } else { | ||
| 567 | eth = (struct ethhdr *) skb->data; | ||
| 568 | } | ||
| 564 | 569 | ||
| 565 | while (skb != frame) { | 570 | while (skb != frame) { |
| 566 | u8 padding; | 571 | u8 padding; |
