ethernet: renesas: 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.
Break the address up into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
1c5d09d587
Коммит
0b08956cd5
|
@ -136,13 +136,15 @@ static void ravb_read_mac_address(struct device_node *np,
|
|||
if (ret) {
|
||||
u32 mahr = ravb_read(ndev, MAHR);
|
||||
u32 malr = ravb_read(ndev, MALR);
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
ndev->dev_addr[0] = (mahr >> 24) & 0xFF;
|
||||
ndev->dev_addr[1] = (mahr >> 16) & 0xFF;
|
||||
ndev->dev_addr[2] = (mahr >> 8) & 0xFF;
|
||||
ndev->dev_addr[3] = (mahr >> 0) & 0xFF;
|
||||
ndev->dev_addr[4] = (malr >> 8) & 0xFF;
|
||||
ndev->dev_addr[5] = (malr >> 0) & 0xFF;
|
||||
addr[0] = (mahr >> 24) & 0xFF;
|
||||
addr[1] = (mahr >> 16) & 0xFF;
|
||||
addr[2] = (mahr >> 8) & 0xFF;
|
||||
addr[3] = (mahr >> 0) & 0xFF;
|
||||
addr[4] = (malr >> 8) & 0xFF;
|
||||
addr[5] = (malr >> 0) & 0xFF;
|
||||
eth_hw_addr_set(ndev, addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1157,13 +1157,15 @@ static void read_mac_address(struct net_device *ndev, unsigned char *mac)
|
|||
} else {
|
||||
u32 mahr = sh_eth_read(ndev, MAHR);
|
||||
u32 malr = sh_eth_read(ndev, MALR);
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
ndev->dev_addr[0] = (mahr >> 24) & 0xFF;
|
||||
ndev->dev_addr[1] = (mahr >> 16) & 0xFF;
|
||||
ndev->dev_addr[2] = (mahr >> 8) & 0xFF;
|
||||
ndev->dev_addr[3] = (mahr >> 0) & 0xFF;
|
||||
ndev->dev_addr[4] = (malr >> 8) & 0xFF;
|
||||
ndev->dev_addr[5] = (malr >> 0) & 0xFF;
|
||||
addr[0] = (mahr >> 24) & 0xFF;
|
||||
addr[1] = (mahr >> 16) & 0xFF;
|
||||
addr[2] = (mahr >> 8) & 0xFF;
|
||||
addr[3] = (mahr >> 0) & 0xFF;
|
||||
addr[4] = (malr >> 8) & 0xFF;
|
||||
addr[5] = (malr >> 0) & 0xFF;
|
||||
eth_hw_addr_set(ndev, addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче