summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-10-05 09:29:49 -0400
committerJohannes Berg <johannes.berg@intel.com>2016-10-12 03:19:10 -0400
commit7f6990c830f3e8d703f13d7963acf51936c52ad2 (patch)
tree62aa92ae505076f216bc41ce98cb2cf066a78efb /net/wireless
parentea720935cf6686f72def9d322298bf7e9bd53377 (diff)
cfg80211: let ieee80211_amsdu_to_8023s() take only header-less SKB
There's only a single case where has_80211_header is passed as true, which is in mac80211. Given that there's only simple code that needs to be done before calling it, export that function from cfg80211 instead and let mac80211 call it itself. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/util.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 8edce22d1b93..e36ede840b88 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -420,8 +420,8 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr)
420} 420}
421EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen); 421EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
422 422
423static int __ieee80211_data_to_8023(struct sk_buff *skb, struct ethhdr *ehdr, 423int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
424 const u8 *addr, enum nl80211_iftype iftype) 424 const u8 *addr, enum nl80211_iftype iftype)
425{ 425{
426 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 426 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
427 struct { 427 struct {
@@ -525,13 +525,7 @@ static int __ieee80211_data_to_8023(struct sk_buff *skb, struct ethhdr *ehdr,
525 525
526 return 0; 526 return 0;
527} 527}
528 528EXPORT_SYMBOL(ieee80211_data_to_8023_exthdr);
529int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
530 enum nl80211_iftype iftype)
531{
532 return __ieee80211_data_to_8023(skb, NULL, addr, iftype);
533}
534EXPORT_SYMBOL(ieee80211_data_to_8023);
535 529
536int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, 530int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
537 enum nl80211_iftype iftype, 531 enum nl80211_iftype iftype,
@@ -745,25 +739,18 @@ __ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen,
745 739
746void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, 740void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
747 const u8 *addr, enum nl80211_iftype iftype, 741 const u8 *addr, enum nl80211_iftype iftype,
748 const unsigned int extra_headroom, 742 const unsigned int extra_headroom)
749 bool has_80211_header)
750{ 743{
751 unsigned int hlen = ALIGN(extra_headroom, 4); 744 unsigned int hlen = ALIGN(extra_headroom, 4);
752 struct sk_buff *frame = NULL; 745 struct sk_buff *frame = NULL;
753 u16 ethertype; 746 u16 ethertype;
754 u8 *payload; 747 u8 *payload;
755 int offset = 0, remaining, err; 748 int offset = 0, remaining;
756 struct ethhdr eth; 749 struct ethhdr eth;
757 bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb); 750 bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb);
758 bool reuse_skb = false; 751 bool reuse_skb = false;
759 bool last = false; 752 bool last = false;
760 753
761 if (has_80211_header) {
762 err = __ieee80211_data_to_8023(skb, &eth, addr, iftype);
763 if (err)
764 goto out;
765 }
766
767 while (!last) { 754 while (!last) {
768 unsigned int subframe_len; 755 unsigned int subframe_len;
769 int len; 756 int len;
@@ -819,7 +806,6 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
819 806
820 purge: 807 purge:
821 __skb_queue_purge(list); 808 __skb_queue_purge(list);
822 out:
823 dev_kfree_skb(skb); 809 dev_kfree_skb(skb);
824} 810}
825EXPORT_SYMBOL(ieee80211_amsdu_to_8023s); 811EXPORT_SYMBOL(ieee80211_amsdu_to_8023s);