-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: ethernet: lan9250: add support for a random mac address #99127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: ethernet: lan9250: add support for a random mac address #99127
Conversation
dsseng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Please find my suggestions below
659344d to
c5e45ea
Compare
|
interesting - not sure how the msg wait all stack issues relate to this change - so, need to see if that failure is upstream or in this PR alone? |
Looks like a flaky test, unlikely to be caused by this PR. Someone with the CI access rights will restart the failed twister run and let you know if it is somehow relevant |
c5e45ea to
fdaa24c
Compare
8e34711 to
1c940f7
Compare
1c940f7 to
93dac9c
Compare
|
@maass-hamburg and @dsseng - is there anything else needed? the changes have been made for the style and the reset gpio code was added to this as well. |
|
Please do it like in #100620 |
Extend the lan9250 driver to support using a local administered unicast random mac address during init. This follows the device tree settings for zephyr_random_mac_address from other ethernet drivers for the added support. Signed-off-by: Charles Hardin <[email protected]>
The reset gpio field was in the config structure but was not coded into the initialization path. So, add the appropriate code to handle the gpio setup when it is defined in the device tree. Signed-off-by: Charles Hardin <[email protected]>
93dac9c to
4855ed1
Compare
ok - changed to use net_eth_mac_load function |
|
dsseng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good
| } | ||
| lan9250_configure(dev); | ||
|
|
||
| (void)net_eth_mac_load(&config->mac_cfg, context->mac_address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this maybe retrieve and handle the return code? here we likely want to abort the initialization sequence if we cannot read the MAC (e.g. missing nvmem cell or a similar issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the user can still set the mac later via the api, so it is recoverable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, may be safe to ignore then. Or maybe initialize to a random address if failed to load the permanent one?



Extend the lan9250 driver to support using a local administered unicast random mac address during init. This follows the device tree settings for zephyr_random_mac_address from other ethernet drivers for the added support.