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

Commit 61c8106e authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'addr_assign_type'



Bjørn Mork says:

====================
net: set addr_assign_type when inheriting a dev_addr

Copying the dev_addr from a parent device is an operation
common to a number of drivers. The addr_assign_type should
be updated accordingly, either by reusing the value from
the source device or explicitly indicating that the address
is stolen by setting addr_assign_type to NET_ADDR_STOLEN.

This patch set adds a helper copying both the dev_addr and
the addr_assign_type, and use this helper in drivers which
don't currently set the addr_assign_type. Using NET_ADDR_STOLEN
might be more appropriate in some of these cases.  Please
let me know, and I'll update the patch accordingly.

Changes in v2:
 - assuming addr_len == ETH_ALEN to allow optimized memcpy
 - dropped the vt6656 patch due to addr_len being unset in that driver
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5a17a390 314cb11b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -823,7 +823,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
		if (port->count)
			return -EINVAL;
		port->passthru = true;
		memcpy(dev->dev_addr, lowerdev->dev_addr, ETH_ALEN);
		eth_hw_addr_inherit(dev, lowerdev);
	}

	err = netdev_upper_dev_link(lowerdev, dev);
+1 −1
Original line number Diff line number Diff line
@@ -1974,7 +1974,7 @@ static void team_setup_by_port(struct net_device *dev,
	dev->addr_len = port_dev->addr_len;
	dev->mtu = port_dev->mtu;
	memcpy(dev->broadcast, port_dev->broadcast, port_dev->addr_len);
	memcpy(dev->dev_addr, port_dev->dev_addr, port_dev->addr_len);
	eth_hw_addr_inherit(dev, port_dev);
}

static int team_dev_type_check_change(struct net_device *dev,
+1 −1
Original line number Diff line number Diff line
@@ -2693,7 +2693,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
	dev->base_addr = ethdev->base_addr;
	dev->wireless_data = ethdev->wireless_data;
	SET_NETDEV_DEV(dev, ethdev->dev.parent);
	memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
	eth_hw_addr_inherit(dev, ethdev);
	err = register_netdev(dev);
	if (err<0) {
		free_netdev(dev);
+1 −1
Original line number Diff line number Diff line
@@ -1425,7 +1425,7 @@ static int prism2_hw_init2(struct net_device *dev, int initial)
		}
		list_for_each(ptr, &local->hostap_interfaces) {
			iface = list_entry(ptr, struct hostap_interface, list);
			memcpy(iface->dev->dev_addr, dev->dev_addr, ETH_ALEN);
			eth_hw_addr_inherit(iface->dev, dev);
		}
	} else if (local->fw_ap)
		prism2_check_sta_fw_version(local);
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ struct net_device * hostap_add_interface(struct local_info *local,
	list_add(&iface->list, &local->hostap_interfaces);

	mdev = local->dev;
	memcpy(dev->dev_addr, mdev->dev_addr, ETH_ALEN);
	eth_hw_addr_inherit(dev, mdev);
	dev->base_addr = mdev->base_addr;
	dev->irq = mdev->irq;
	dev->mem_start = mdev->mem_start;
Loading