-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: ethernet: w5500: Add link status detection #68752
drivers: ethernet: w5500: Add link status detection #68752
Conversation
Hello @vshymanskyy, and thank you very much for your first pull request to the Zephyr project! |
260d3f8
to
d7629d6
Compare
d7629d6
to
f4ac13e
Compare
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.
It's completely normal for the current phy drivers to have a monitor period to poll the status of the link, in this case this hardware is a combination of a phy and mac, so I think it is fair for it to do the same thing. However, please use the kconfig PHY_MONITOR_PERIOD which exists in the drivers/ethernet/phy/Kconfig file, as this is the common kconfig which users will expect to use for this purpose. Also, I suggest to use the system workqueue instead of creating a new thread, I believe this would improve the memory footprint.
@nashif This PR did not get an assignee, is that a mistake by the bot? I assigned myself for now |
its not a mistake, the area has no maintainer. |
okay, I didn't know that's how it works, thanks |
Removing the thread is a more significant change that is out of scope of this PR, I believe. |
Okay that's fine, because it already existed, but it was just a suggestion Still try to use the common kconfig if you can |
f4ac13e
to
9f83f72
Compare
@parthitce please return to this PR and note that it is not unusual for polling phy status in current zephyr drivers |
How about introducing |
Its not a bad idea but it seems outside the scope of this PR because it's not required to add link detection to the current driver. |
Agreed! |
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.
LGTM, please fix the CI.
Implemented link status detection using the W5500 built-in registers. Added periodic link status polling, configurable via Kconfig. Speeds up DHCPv4 from 9 seconds at best, to ~2 seconds after power-up. Signed-off-by: Volodymyr Shymanskyy <[email protected]>
9f83f72
to
b94b491
Compare
Not sure why CI was broken, I just pushed a dummy update to restart it |
All checks have passed |
Hi @vshymanskyy! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
This PR introduces link status detection functionality to the W5500 Ethernet driver within the Zephyr OS. This feature enhances the driver's capability to monitor and respond to changes in Ethernet link status (cable insertion/removal), providing a more robust and reliable network connection for devices utilizing the W5500 chip.
Test
The test was performed on WeAct BlackPill STM32F411CE + WIZnet W5500