[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190829160610.60563ca0@cakuba.netronome.com>
Date: Thu, 29 Aug 2019 16:06:10 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Shannon Nelson <snelson@...sando.io>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH v6 net-next 12/19] ionic: Add Rx filter and rx_mode ndo
support
On Thu, 29 Aug 2019 11:27:13 -0700, Shannon Nelson wrote:
> @@ -588,8 +866,26 @@ static int ionic_set_features(struct net_device *netdev,
>
> static int ionic_set_mac_address(struct net_device *netdev, void *sa)
> {
> - netdev_info(netdev, "%s: stubbed\n", __func__);
> - return 0;
> + struct sockaddr *addr = sa;
> + u8 *mac;
> +
> + mac = (u8 *)addr->sa_data;
> + if (ether_addr_equal(netdev->dev_addr, mac))
> + return 0;
> +
> + if (!is_valid_ether_addr(mac))
> + return -EADDRNOTAVAIL;
> +
> + if (!is_zero_ether_addr(netdev->dev_addr)) {
> + netdev_info(netdev, "deleting mac addr %pM\n",
> + netdev->dev_addr);
> + ionic_addr_del(netdev, netdev->dev_addr);
> + }
> +
> + memcpy(netdev->dev_addr, mac, netdev->addr_len);
> + netdev_info(netdev, "updating mac addr %pM\n", mac);
> +
> + return ionic_addr_add(netdev, mac);
> }
Please use the eth_prepare_mac_addr_change() and
eth_commit_mac_addr_change() helpers.
Powered by blists - more mailing lists