Commit 524b09ea authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Greg Kroah-Hartman
Browse files

staging: use eth_hw_addr_set() in orphan drivers



Commit 406f42fa ("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.

Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-9-kuba@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e7c636f2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -867,6 +867,7 @@ int register_lte_device(struct phy_dev *phy_dev,
	struct nic *nic;
	struct net_device *net;
	char pdn_dev_name[16];
	u8 addr[ETH_ALEN];
	int ret = 0;
	u8 index;

@@ -893,11 +894,12 @@ int register_lte_device(struct phy_dev *phy_dev,
		nic->phy_dev = phy_dev;
		nic->nic_id = index;

		form_mac_address(net->dev_addr,
		form_mac_address(addr,
				 nic->src_mac_addr,
				 nic->dest_mac_addr,
				 mac_address,
				 index);
		eth_hw_addr_set(net, addr);

		SET_NETDEV_DEV(net, dev);
		SET_NETDEV_DEVTYPE(net, &wwan_type);
+1 −1
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
	    (cvmx_helper_interface_get_mode(interface) !=
		CVMX_HELPER_INTERFACE_MODE_SPI)) {
		int i;
		u8 *ptr = dev->dev_addr;
		const u8 *ptr = dev->dev_addr;
		u64 mac = 0;
		int index = INDEX(priv->port);

+3 −1
Original line number Diff line number Diff line
@@ -585,6 +585,7 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
	struct hfa384x *hw = wlandev->priv;
	u16 temp;
	u8 snum[HFA384x_RID_NICSERIALNUMBER_LEN];
	u8 addr[ETH_ALEN];

	/* Collect version and compatibility info */
	/*  Some are critical, some are not */
@@ -855,11 +856,12 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)

	/* Collect the MAC address */
	result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR,
					wlandev->netdev->dev_addr, ETH_ALEN);
					addr, ETH_ALEN);
	if (result != 0) {
		netdev_err(wlandev->netdev, "Failed to retrieve mac address\n");
		goto failed;
	}
	eth_hw_addr_set(wlandev->netdev, addr);

	/* short preamble is always implemented */
	wlandev->nsdcaps |= P80211_NSDCAP_SHORT_PREAMBLE;