ath9k: Fix address management
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Fri, 17 Oct 2014 02:10:20 +0000 (07:40 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Oct 2014 18:16:16 +0000 (14:16 -0400)
Since both the arguments need to satisfy
the alignment requirements of ether_addr_copy(),
use memcpy() in cases where there will be no
big performance benefit and make sure that
ether_addr_copy() calls use properly aligned
arguments.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/main.c

index e5ba6faf32815173fa47fa81fd303082688202bd..9c56ecbae37fce62409a5016e24359bf4bedd6dc 100644 (file)
@@ -147,7 +147,7 @@ struct ath_common {
        u16 cachelsz;
        u16 curaid;
        u8 macaddr[ETH_ALEN];
-       u8 curbssid[ETH_ALEN];
+       u8 curbssid[ETH_ALEN] __aligned(2);
        u8 bssidmask[ETH_ALEN];
 
        u32 rx_bufsize;
index d4b71ed9023631f7897d7b90f7eb7017ec732d76..9e92cb2145bcd88dfccc7e284a44e21a5688aa23 100644 (file)
@@ -595,7 +595,7 @@ struct ath_vif {
        u16 seq_no;
 
        /* BSS info */
-       u8 bssid[ETH_ALEN];
+       u8 bssid[ETH_ALEN] __aligned(2);
        u16 aid;
        bool assoc;
 
index 0545fe64e1e5e86ec2f445e86b0a35b1b7fd6003..c291d54756ef001397bd550cd7e84443ff91f928 100644 (file)
@@ -1057,7 +1057,7 @@ static void ath9k_set_offchannel_state(struct ath_softc *sc)
 
        eth_zero_addr(common->curbssid);
        eth_broadcast_addr(common->bssidmask);
-       ether_addr_copy(common->macaddr, vif->addr);
+       memcpy(common->macaddr, vif->addr, ETH_ALEN);
        common->curaid = 0;
        ah->opmode = vif->type;
        ah->imask &= ~ATH9K_INT_SWBA;
@@ -1098,7 +1098,7 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
        ath9k_calculate_iter_data(sc, ctx, &iter_data);
 
        if (iter_data.has_hw_macaddr)
-               ether_addr_copy(common->macaddr, iter_data.hw_macaddr);
+               memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN);
 
        memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
        ath_hw_setbssidmask(common);
@@ -1785,7 +1785,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
                ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n",
                        bss_conf->bssid, bss_conf->assoc);
 
-               ether_addr_copy(avp->bssid, bss_conf->bssid);
+               memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN);
                avp->aid = bss_conf->aid;
                avp->assoc = bss_conf->assoc;