diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2014-10-16 22:10:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-10-27 14:16:16 -0400 |
commit | 62ae1aef2070e9d281e2daab2447ab85d30df99a (patch) | |
tree | a804b16e5986e172c5619f9bf57739bcd326ab5b | |
parent | 91e6ceb354289ef1b143735b218599b5ad1b58c8 (diff) |
ath9k: Fix address management
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>
-rw-r--r-- | drivers/net/wireless/ath/ath.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index e5ba6faf3281..9c56ecbae37f 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -147,7 +147,7 @@ struct ath_common { | |||
147 | u16 cachelsz; | 147 | u16 cachelsz; |
148 | u16 curaid; | 148 | u16 curaid; |
149 | u8 macaddr[ETH_ALEN]; | 149 | u8 macaddr[ETH_ALEN]; |
150 | u8 curbssid[ETH_ALEN]; | 150 | u8 curbssid[ETH_ALEN] __aligned(2); |
151 | u8 bssidmask[ETH_ALEN]; | 151 | u8 bssidmask[ETH_ALEN]; |
152 | 152 | ||
153 | u32 rx_bufsize; | 153 | u32 rx_bufsize; |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index d4b71ed90236..9e92cb2145bc 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -595,7 +595,7 @@ struct ath_vif { | |||
595 | u16 seq_no; | 595 | u16 seq_no; |
596 | 596 | ||
597 | /* BSS info */ | 597 | /* BSS info */ |
598 | u8 bssid[ETH_ALEN]; | 598 | u8 bssid[ETH_ALEN] __aligned(2); |
599 | u16 aid; | 599 | u16 aid; |
600 | bool assoc; | 600 | bool assoc; |
601 | 601 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 0545fe64e1e5..c291d54756ef 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1057,7 +1057,7 @@ static void ath9k_set_offchannel_state(struct ath_softc *sc) | |||
1057 | 1057 | ||
1058 | eth_zero_addr(common->curbssid); | 1058 | eth_zero_addr(common->curbssid); |
1059 | eth_broadcast_addr(common->bssidmask); | 1059 | eth_broadcast_addr(common->bssidmask); |
1060 | ether_addr_copy(common->macaddr, vif->addr); | 1060 | memcpy(common->macaddr, vif->addr, ETH_ALEN); |
1061 | common->curaid = 0; | 1061 | common->curaid = 0; |
1062 | ah->opmode = vif->type; | 1062 | ah->opmode = vif->type; |
1063 | ah->imask &= ~ATH9K_INT_SWBA; | 1063 | ah->imask &= ~ATH9K_INT_SWBA; |
@@ -1098,7 +1098,7 @@ void ath9k_calculate_summary_state(struct ath_softc *sc, | |||
1098 | ath9k_calculate_iter_data(sc, ctx, &iter_data); | 1098 | ath9k_calculate_iter_data(sc, ctx, &iter_data); |
1099 | 1099 | ||
1100 | if (iter_data.has_hw_macaddr) | 1100 | if (iter_data.has_hw_macaddr) |
1101 | ether_addr_copy(common->macaddr, iter_data.hw_macaddr); | 1101 | memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN); |
1102 | 1102 | ||
1103 | memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); | 1103 | memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); |
1104 | ath_hw_setbssidmask(common); | 1104 | ath_hw_setbssidmask(common); |
@@ -1785,7 +1785,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
1785 | ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n", | 1785 | ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n", |
1786 | bss_conf->bssid, bss_conf->assoc); | 1786 | bss_conf->bssid, bss_conf->assoc); |
1787 | 1787 | ||
1788 | ether_addr_copy(avp->bssid, bss_conf->bssid); | 1788 | memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); |
1789 | avp->aid = bss_conf->aid; | 1789 | avp->aid = bss_conf->aid; |
1790 | avp->assoc = bss_conf->assoc; | 1790 | avp->assoc = bss_conf->assoc; |
1791 | 1791 | ||