Skip to content

Conversation

@ckhardin
Copy link
Contributor

@ckhardin ckhardin commented Nov 8, 2025

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.

Copy link
Member

@dsseng dsseng left a 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

@ckhardin ckhardin force-pushed the ckhardin/add-random-mac-to-lan9250 branch from 659344d to c5e45ea Compare November 9, 2025 02:43
@ckhardin
Copy link
Contributor Author

ckhardin commented Nov 9, 2025

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?

@dsseng
Copy link
Member

dsseng commented Nov 9, 2025

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

@ckhardin ckhardin force-pushed the ckhardin/add-random-mac-to-lan9250 branch from c5e45ea to fdaa24c Compare November 10, 2025 20:15
@ckhardin ckhardin force-pushed the ckhardin/add-random-mac-to-lan9250 branch 2 times, most recently from 8e34711 to 1c940f7 Compare November 11, 2025 22:06
@ckhardin ckhardin force-pushed the ckhardin/add-random-mac-to-lan9250 branch from 1c940f7 to 93dac9c Compare November 18, 2025 01:29
@ckhardin
Copy link
Contributor Author

ckhardin commented Dec 6, 2025

@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.

@maass-hamburg
Copy link
Member

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]>
@ckhardin ckhardin force-pushed the ckhardin/add-random-mac-to-lan9250 branch from 93dac9c to 4855ed1 Compare December 7, 2025 01:56
@ckhardin
Copy link
Contributor Author

ckhardin commented Dec 7, 2025

Please do it like in #100620

ok - changed to use net_eth_mac_load function

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 7, 2025

Copy link
Member

@dsseng dsseng left a 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);
Copy link
Member

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)

Copy link
Member

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.

Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants