Commit 82f60a01 authored by David S. Miller's avatar David S. Miller

Merge branch 'dev_addr-const-x86'

Jakub Kicinski says:

====================
net: constify netdev->dev_addr - x86 changes

Resending these so they can get merged while I battle random cross builds.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3b1abcf1 a608e679
......@@ -144,12 +144,13 @@ static void ax88796c_set_mac_addr(struct net_device *ndev)
static void ax88796c_load_mac_addr(struct net_device *ndev)
{
struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
u8 addr[ETH_ALEN];
u16 temp;
lockdep_assert_held(&ax_local->spi_lock);
/* Try the device tree first */
if (!eth_platform_get_mac_address(&ax_local->spi->dev, ndev->dev_addr) &&
if (!platform_get_ethdev_address(&ax_local->spi->dev, ndev) &&
is_valid_ether_addr(ndev->dev_addr)) {
if (netif_msg_probe(ax_local))
dev_info(&ax_local->spi->dev,
......@@ -159,18 +160,19 @@ static void ax88796c_load_mac_addr(struct net_device *ndev)
/* Read the MAC address from AX88796C */
temp = AX_READ(&ax_local->ax_spi, P3_MACASR0);
ndev->dev_addr[5] = (u8)temp;
ndev->dev_addr[4] = (u8)(temp >> 8);
addr[5] = (u8)temp;
addr[4] = (u8)(temp >> 8);
temp = AX_READ(&ax_local->ax_spi, P3_MACASR1);
ndev->dev_addr[3] = (u8)temp;
ndev->dev_addr[2] = (u8)(temp >> 8);
addr[3] = (u8)temp;
addr[2] = (u8)(temp >> 8);
temp = AX_READ(&ax_local->ax_spi, P3_MACASR2);
ndev->dev_addr[1] = (u8)temp;
ndev->dev_addr[0] = (u8)(temp >> 8);
addr[1] = (u8)temp;
addr[0] = (u8)(temp >> 8);
if (is_valid_ether_addr(ndev->dev_addr)) {
if (is_valid_ether_addr(addr)) {
eth_hw_addr_set(ndev, addr);
if (netif_msg_probe(ax_local))
dev_info(&ax_local->spi->dev,
"MAC address read from ASIX chip\n");
......
......@@ -303,7 +303,7 @@ int mlxsw_sp_port_admin_status_set(struct mlxsw_sp_port *mlxsw_sp_port,
}
static int mlxsw_sp_port_dev_addr_set(struct mlxsw_sp_port *mlxsw_sp_port,
unsigned char *addr)
const unsigned char *addr)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
char ppad_pl[MLXSW_REG_PPAD_LEN];
......
......@@ -2303,7 +2303,7 @@ static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len)
ssid);
}
static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
static int ipw_send_adapter_address(struct ipw_priv *priv, const u8 * mac)
{
if (!priv || !mac) {
IPW_ERROR("Invalid args\n");
......
......@@ -574,6 +574,7 @@ static int wilc_mac_open(struct net_device *ndev)
struct wilc *wl = vif->wilc;
int ret = 0;
struct mgmt_frame_regs mgmt_regs = {};
u8 addr[ETH_ALEN] __aligned(2);
if (!wl || !wl->dev) {
netdev_err(ndev, "device not ready\n");
......@@ -596,10 +597,9 @@ static int wilc_mac_open(struct net_device *ndev)
vif->idx);
if (is_valid_ether_addr(ndev->dev_addr)) {
wilc_set_mac_address(vif, ndev->dev_addr);
ether_addr_copy(addr, ndev->dev_addr);
wilc_set_mac_address(vif, addr);
} else {
u8 addr[ETH_ALEN];
wilc_get_mac_address(vif, addr);
eth_hw_addr_set(ndev, addr);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment