ath10k-ct: depend on kmod-hwmon-core, it gets used when CONFIG_THERMAL is set
[openwrt/staging/dedeckeh.git] / package / kernel / mac80211 / patches / 319-mac80211-avoid-extra-memcpy-in-A-MSDU-head-creation.patch
1 From: Michael Braun <michael-dev@fami-braun.de>
2 Date: Sat, 15 Oct 2016 13:28:18 +0200
3 Subject: [PATCH] mac80211: avoid extra memcpy in A-MSDU head creation
4
5 Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
6 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 ---
8
9 --- a/net/mac80211/tx.c
10 +++ b/net/mac80211/tx.c
11 @@ -3069,11 +3069,11 @@ static bool ieee80211_amsdu_prepare_head
12 struct ieee80211_local *local = sdata->local;
13 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
14 struct ieee80211_hdr *hdr;
15 - struct ethhdr amsdu_hdr;
16 + struct ethhdr *amsdu_hdr;
17 int hdr_len = fast_tx->hdr_len - sizeof(rfc1042_header);
18 int subframe_len = skb->len - hdr_len;
19 void *data;
20 - u8 *qc;
21 + u8 *qc, *h_80211_src, *h_80211_dst;
22
23 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
24 return false;
25 @@ -3081,19 +3081,22 @@ static bool ieee80211_amsdu_prepare_head
26 if (info->control.flags & IEEE80211_TX_CTRL_AMSDU)
27 return true;
28
29 - if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(amsdu_hdr),
30 + if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr),
31 &subframe_len))
32 return false;
33
34 - amsdu_hdr.h_proto = cpu_to_be16(subframe_len);
35 - memcpy(amsdu_hdr.h_source, skb->data + fast_tx->sa_offs, ETH_ALEN);
36 - memcpy(amsdu_hdr.h_dest, skb->data + fast_tx->da_offs, ETH_ALEN);
37 -
38 - data = skb_push(skb, sizeof(amsdu_hdr));
39 - memmove(data, data + sizeof(amsdu_hdr), hdr_len);
40 - memcpy(data + hdr_len, &amsdu_hdr, sizeof(amsdu_hdr));
41 -
42 + data = skb_push(skb, sizeof(*amsdu_hdr));
43 + memmove(data, data + sizeof(*amsdu_hdr), hdr_len);
44 hdr = data;
45 + amsdu_hdr = data + hdr_len;
46 + /* h_80211_src/dst is addr* field within hdr */
47 + h_80211_src = data + fast_tx->sa_offs;
48 + h_80211_dst = data + fast_tx->da_offs;
49 +
50 + amsdu_hdr->h_proto = cpu_to_be16(subframe_len);
51 + ether_addr_copy(amsdu_hdr->h_source, h_80211_src);
52 + ether_addr_copy(amsdu_hdr->h_dest, h_80211_dst);
53 +
54 qc = ieee80211_get_qos_ctl(hdr);
55 *qc |= IEEE80211_QOS_CTL_A_MSDU_PRESENT;
56