From: Andrew Lunn <andrew@lunn.ch>
To: Sergei Antonov <saproj@gmail.com>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <olteanv@gmail.com>,
Yang Yingliang <yangyingliang@huawei.com>,
Pavel Skripkin <paskripkin@gmail.com>,
Guobin Huang <huangguobin4@huawei.com>,
Yang Wei <yang.wei9@zte.com.cn>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v2] net: moxa: MAC address reading, generating, validity checking
Date: Thu, 18 Aug 2022 14:20:59 +0200 [thread overview]
Message-ID: <Yv4uq9nYp4Gu+PC4@lunn.ch> (raw)
In-Reply-To: <20220818092317.529557-1-saproj@gmail.com>
On Thu, Aug 18, 2022 at 12:23:17PM +0300, Sergei Antonov wrote:
> This device does not remember its MAC address, so add a possibility
> to get it from the platform. If it fails, generate a random address.
> This will provide a MAC address early during boot without user space
> being involved.
>
> Also remove extra calls to is_valid_ether_addr().
>
> Made after suggestions by Andrew Lunn:
> 1) Use eth_hw_addr_random() to assign a random MAC address during probe.
> 2) Remove is_valid_ether_addr() from moxart_mac_open()
> 3) Add a call to platform_get_ethdev_address() during probe
> 4) Remove is_valid_ether_addr() from moxart_set_mac_address(). The core does this
>
> v1 -> v2:
> Handle EPROBE_DEFER returned from platform_get_ethdev_address().
> Move MAC reading code to the beginning of the probe function.
>
> Signed-off-by: Sergei Antonov <saproj@gmail.com>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2022-08-18 12:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 9:23 [PATCH v2] net: moxa: MAC address reading, generating, validity checking Sergei Antonov
2022-08-18 12:20 ` Andrew Lunn [this message]
2022-08-18 14:10 ` Vladimir Oltean
2022-08-18 18:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yv4uq9nYp4Gu+PC4@lunn.ch \
--to=andrew@lunn.ch \
--cc=christophe.jaillet@wanadoo.fr \
--cc=huangguobin4@huawei.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=paskripkin@gmail.com \
--cc=saproj@gmail.com \
--cc=yang.wei9@zte.com.cn \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.