staging: rtl: use eth_hw_addr_set()
Commit 406f42fa0d
("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>
This commit is contained in:
parent
13898e9341
commit
e7c636f2bb
@ -360,11 +360,14 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
||||
priv->eeprom_CustomerID);
|
||||
|
||||
if (!priv->AutoloadFailFlag) {
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
for (i = 0; i < 6; i += 2) {
|
||||
usValue = rtl92e_eeprom_read(dev,
|
||||
(EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1);
|
||||
*(u16 *)(&dev->dev_addr[i]) = usValue;
|
||||
*(u16 *)(&addr[i]) = usValue;
|
||||
}
|
||||
eth_hw_addr_set(dev, addr);
|
||||
} else {
|
||||
eth_hw_addr_set(dev, bMac_Tmp_Addr);
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ void rtl92e_cam_restore(struct net_device *dev)
|
||||
if (priv->rtllib->iw_mode == IW_MODE_ADHOC) {
|
||||
rtl92e_set_key(dev, 4, 0,
|
||||
priv->rtllib->pairwise_key_type,
|
||||
(u8 *)dev->dev_addr, 0,
|
||||
(const u8 *)dev->dev_addr, 0,
|
||||
(u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
|
||||
} else {
|
||||
rtl92e_set_key(dev, 4, 0,
|
||||
@ -197,7 +197,7 @@ void rtl92e_cam_restore(struct net_device *dev)
|
||||
if (priv->rtllib->iw_mode == IW_MODE_ADHOC) {
|
||||
rtl92e_set_key(dev, 4, 0,
|
||||
priv->rtllib->pairwise_key_type,
|
||||
(u8 *)dev->dev_addr, 0,
|
||||
(const u8 *)dev->dev_addr, 0,
|
||||
(u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
|
||||
} else {
|
||||
rtl92e_set_key(dev, 4, 0,
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -283,7 +283,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
|
||||
if (!padapter->bup) {
|
||||
/* addr->sa_data[4], addr->sa_data[5]); */
|
||||
memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
|
||||
/* memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN); */
|
||||
/* eth_hw_addr_set(pnetdev, addr->sa_data); */
|
||||
/* padapter->bset_hwaddr = true; */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user