summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-19 10:12:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-20 19:33:59 +0200
commite7c636f2bb50367581bec53782fb15ebf8648936 (patch)
tree44a6675308b40878b62d098449227b1e41952f6d /drivers/staging/rtl8192u
parent13898e9341824f8d96cb37e5f36eb1828e9f2e63 (diff)
staging: rtl: use eth_hw_addr_set()
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20211019171243.1412240-8-kuba@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/r8192U.h3
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
index 4013107cd93a..14ca00a2789b 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -1114,6 +1114,7 @@ void rtl8192_set_rxconf(struct net_device *dev);
void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate);
void EnableHWSecurityConfig8192(struct net_device *dev);
-void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
+void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
+ const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
#endif
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 3718d72e217e..cfbd9d79baa7 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2300,12 +2300,15 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
/* set channelplan from eeprom */
priv->ChannelPlan = priv->eeprom_ChannelPlan;
if (bLoad_From_EEPOM) {
+ u8 addr[ETH_ALEN];
+
for (i = 0; i < 6; i += 2) {
ret = eprom_read(dev, (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1));
if (ret < 0)
return ret;
- *(u16 *)(&dev->dev_addr[i]) = (u16)ret;
+ *(u16 *)(&addr[i]) = (u16)ret;
}
+ eth_hw_addr_set(dev, addr);
} else {
eth_hw_addr_set(dev, bMac_Tmp_Addr);
/* should I set IDR0 here? */
@@ -3045,14 +3048,14 @@ static void CamRestoreAllEntry(struct net_device *dev)
} else if (priv->ieee80211->pairwise_key_type == KEY_TYPE_TKIP) {
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
- (u8 *)dev->dev_addr, 0, NULL);
+ (const u8 *)dev->dev_addr, 0, NULL);
else
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
MacAddr, 0, NULL);
} else if (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP) {
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
- (u8 *)dev->dev_addr, 0, NULL);
+ (const u8 *)dev->dev_addr, 0, NULL);
else
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
MacAddr, 0, NULL);
@@ -4868,7 +4871,7 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
}
void setKey(struct net_device *dev, u8 entryno, u8 keyindex, u16 keytype,
- u8 *macaddr, u8 defaultkey, u32 *keycontent)
+ const u8 *macaddr, u8 defaultkey, u32 *keycontent)
{
u32 target_command = 0;
u32 target_content = 0;