[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <082aefef-5927-181e-e505-685c1ca51492@aquantia.com>
Date: Tue, 9 Oct 2018 14:34:36 +0000
From: Igor Russkikh <Igor.Russkikh@...antia.com>
To: Andrew Lunn <andrew@...n.ch>
CC: "David S . Miller" <davem@...emloft.net>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH net-next 07/19] net: usb: aqc111: Add support for getting
and setting of MAC address
Hi Andrew,
>> + if (ret < 0)
>> + goto out;
>> +
>> + memcpy(dev->net->dev_addr, buf, ETH_ALEN);
>> + memcpy(dev->net->perm_addr, dev->net->dev_addr, ETH_ALEN);
>
> Is this really the permanent address? If i call aqc111_set_mac_addr()
> followed by aqc111_get_mac() i still get what is in the OTP EEPROM?
Thats actually a confusion with function name here.
Think its better to name it aqc111_init_mac() since it gets called
only once on bind.
It really initializes perm_addr once, thus standard ndev callback will give
the perm mac you want.
>
> You initialized it above as {0}. You don't need to memset it here.
>
>> + ret = aqc111_get_mac(dev, buf);
>
> Do you even need to zero it? If aqc111_get_mac() fails, it will be
> left undefined, but you fail the bind anyway.
We even don't need this `buf` here at all. We'll move it into
above init_mac function.
BR, Igor
Powered by blists - more mailing lists