Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62ae1aef authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville
Browse files

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: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 91e6ceb3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -147,7 +147,7 @@ struct ath_common {
	u16 cachelsz;
	u16 cachelsz;
	u16 curaid;
	u16 curaid;
	u8 macaddr[ETH_ALEN];
	u8 macaddr[ETH_ALEN];
	u8 curbssid[ETH_ALEN];
	u8 curbssid[ETH_ALEN] __aligned(2);
	u8 bssidmask[ETH_ALEN];
	u8 bssidmask[ETH_ALEN];


	u32 rx_bufsize;
	u32 rx_bufsize;
+1 −1
Original line number Original line Diff line number Diff line
@@ -595,7 +595,7 @@ struct ath_vif {
	u16 seq_no;
	u16 seq_no;


	/* BSS info */
	/* BSS info */
	u8 bssid[ETH_ALEN];
	u8 bssid[ETH_ALEN] __aligned(2);
	u16 aid;
	u16 aid;
	bool assoc;
	bool assoc;


+3 −3
Original line number Original line Diff line number Diff line
@@ -1057,7 +1057,7 @@ static void ath9k_set_offchannel_state(struct ath_softc *sc)


	eth_zero_addr(common->curbssid);
	eth_zero_addr(common->curbssid);
	eth_broadcast_addr(common->bssidmask);
	eth_broadcast_addr(common->bssidmask);
	ether_addr_copy(common->macaddr, vif->addr);
	memcpy(common->macaddr, vif->addr, ETH_ALEN);
	common->curaid = 0;
	common->curaid = 0;
	ah->opmode = vif->type;
	ah->opmode = vif->type;
	ah->imask &= ~ATH9K_INT_SWBA;
	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);
	ath9k_calculate_iter_data(sc, ctx, &iter_data);


	if (iter_data.has_hw_macaddr)
	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);
	memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
	ath_hw_setbssidmask(common);
	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",
		ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n",
			bss_conf->bssid, bss_conf->assoc);
			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->aid = bss_conf->aid;
		avp->assoc = bss_conf->assoc;
		avp->assoc = bss_conf->assoc;