-
Notifications
You must be signed in to change notification settings - Fork 1.5k
include/net/if.h: Add mechanism for MMD access with SIOCxMIIREG ioctls #16926
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
Conversation
please fix the style warning:
|
@xiaoxiang781216 The warning is in the license banner in SPDX tag-value line. A short search indicates that SPDX tag-value must be entirely on a single line. Another option may be shortening the line maybe? I might need a bit of help on this. https://spdx.github.io/spdx-spec/v2.3/file-tags/:
|
@xiaoxiang781216 It is the original line unmodified by the patch. Its correction is problematic as specified by @matiamic and this style update should not be mixed with functionality added by this patch. So my personal opinion is that it needs to be ignored now. |
Hi @matiamic possible solution as is done in other files |
Add mdio_phy_id_c45 macro. This macro allows encoding of additional information needed for MMD access into the phy_id field of the mii_ioctl_data_s structure. This macro is intended for use by user applications. Add macros for decoding the phy_id encoded with the mdio_phy_id_c45 macro. These macros are intended for use by network drivers implementing SIOCxMIIREG commands. Signed-off-by: michal matias <mich4l.matias@gmail.com>
Please, can somebody approve this change ( for example @acassis ) to allow @matiamic to continue with main OpenAliance T1S pull request preparation/posting as his GSoC final report reference? The failed check is in the line not touched by patch. If it should be resolved, it can be done latter as some formatting change. |
@ppisa I force the re-run of the failed job. Unfortunately our CI is very unstable, sometime it fails because download error, like temporary 502 error that normally we see in the browser. In our browser we just try again, in the CI it just fails and never try again |
#16940 (review) |
Summary
This patch adds
mdio_phy_id_c45
macro. This macro allows encoding of additional information needed for MDIO Manageable Device (MMD) access into thephy_id
field of themii_ioctl_data_s
structure. This macro is intended for use by user applications.This patch also adds macros for decoding the
phy_id
encoded with themdio_phy_id_c45
macro. These macros are intended for use by network drivers implementing SIOCxMIIREG commands.The mechanism is inspired by the approach used in Linux:
https://elixir.bootlin.com/linux/v6.16.3/source/include/uapi/linux/mdio.h#L456-L465
https://elixir.bootlin.com/linux/v6.16.3/source/include/linux/mdio.h#L110-L123
This PR was preceded by discussion in PR #16911
Impact
Network drivers now may implement access to MMD registers through ioctl.
Testing
The testing was performed by a testing application during development of a driver for 10BASE-T1x SPI MAC-PHYs.
A mirrored bit between two registers - one in MII interface, second in an MMD space - was written to. The bit enables / disables the PHY. Same effect was observed when accessing the bit using MII and MMD.