mac80211: merge a few pending upstream fixes
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 315-ath9k-Fix-address-management.patch
1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:20 +0530
3 Subject: [PATCH] ath9k: Fix address management
4
5 Since both the arguments need to satisfy
6 the alignment requirements of ether_addr_copy(),
7 use memcpy() in cases where there will be no
8 big performance benefit and make sure that
9 ether_addr_copy() calls use properly aligned
10 arguments.
11
12 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
13 ---
14
15 --- a/drivers/net/wireless/ath/ath.h
16 +++ b/drivers/net/wireless/ath/ath.h
17 @@ -147,7 +147,7 @@ struct ath_common {
18 u16 cachelsz;
19 u16 curaid;
20 u8 macaddr[ETH_ALEN];
21 - u8 curbssid[ETH_ALEN];
22 + u8 curbssid[ETH_ALEN] __aligned(2);
23 u8 bssidmask[ETH_ALEN];
24
25 u32 rx_bufsize;
26 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
27 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
28 @@ -595,7 +595,7 @@ struct ath_vif {
29 u16 seq_no;
30
31 /* BSS info */
32 - u8 bssid[ETH_ALEN];
33 + u8 bssid[ETH_ALEN] __aligned(2);
34 u16 aid;
35 bool assoc;
36
37 --- a/drivers/net/wireless/ath/ath9k/main.c
38 +++ b/drivers/net/wireless/ath/ath9k/main.c
39 @@ -1057,7 +1057,7 @@ static void ath9k_set_offchannel_state(s
40
41 eth_zero_addr(common->curbssid);
42 eth_broadcast_addr(common->bssidmask);
43 - ether_addr_copy(common->macaddr, vif->addr);
44 + memcpy(common->macaddr, vif->addr, ETH_ALEN);
45 common->curaid = 0;
46 ah->opmode = vif->type;
47 ah->imask &= ~ATH9K_INT_SWBA;
48 @@ -1098,7 +1098,7 @@ void ath9k_calculate_summary_state(struc
49 ath9k_calculate_iter_data(sc, ctx, &iter_data);
50
51 if (iter_data.has_hw_macaddr)
52 - ether_addr_copy(common->macaddr, iter_data.hw_macaddr);
53 + memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN);
54
55 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
56 ath_hw_setbssidmask(common);
57 @@ -1785,7 +1785,7 @@ static void ath9k_bss_info_changed(struc
58 ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n",
59 bss_conf->bssid, bss_conf->assoc);
60
61 - ether_addr_copy(avp->bssid, bss_conf->bssid);
62 + memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN);
63 avp->aid = bss_conf->aid;
64 avp->assoc = bss_conf->assoc;
65