-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: ethernet: drop _T
from ethernet speed types
#87194
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: drop _T
from ethernet speed types
#87194
Conversation
fc585db
to
cd1bb94
Compare
for 10 Mbits and 100 Mbits phys are not able to distinguish between BASE-T and BASE-X, renaming them would actually be the better option |
4581b9c
cd1bb94
to
4581b9c
Compare
4581b9c
to
b45a2ee
Compare
I wonder, should we add backwards compatible defines to denote deprecation and give downstream users time to adopt? |
Due to it being a pretty simply and trivial change, I would prefer to not do that. Also the ethernet API is still considered unstable according to https://docs.zephyrproject.org/latest/develop/api/overview.html#api-overview, so it is not required. |
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.
I really do not see the point of this. And how then would someone support something like the Marvel Alaska 88e151x PHY which can support both Copper and Fiber and be switched between them programmatically.
see Page 117, Table 130, General Control Register 1, bits 2:0 for mode selection
I think we have to differentiate between the communication between the mac/ethernet driver and the phy and other communication. API calls like But what I see what we might also need is a api to set the media or used standards of the phy. |
b45a2ee
to
56dd990
Compare
Maybe it can be a new field in the phy_link_state struct . |
That could be a solution. But that should be part of another PR. I'm a bit more in favor in having separate set and get config api functions for that, so that the existing |
I am envisioning an enum member field with options of like twisted pair, fiber, or any/unspecified |
624ea67
to
2533459
Compare
Do you want that to be part of this PR? I rather wait until we have a phy in tree with support for that change of media(for fist only with setting it via a DT prop) in tree and then open a PR for changing it during runtime. |
2533459
to
2740041
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.
Couple of minor nits
@@ -1029,16 +1029,16 @@ static void phy_link_state_change_callback(const struct device *phy_dev, | |||
if (is_up) { |
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.
In the first commit drivers: ethernet: phy: rename LINK_*_*BASE_T
of this set, the commit description is missing the "why this change" part. Could you add the text in the PR description to the commit message too.
2740041
to
46493a7
Compare
rename LINK_*_*BASE_T to LINK_*_*BASE speed options for ethernet drivers shouldn't end with a _T, implying that ethernet is only supported via a twisted pair cable. Signed-off-by: Fin Maaß <[email protected]>
add PHY_LINK_IS_SPEED_10M macro to check if the link speed is 10M. Signed-off-by: Fin Maaß <[email protected]>
change ETHERNET_LINK_*BASE_T to ETHERNET_LINK_*BASE. Signed-off-by: Fin Maaß <[email protected]>
mention change of ethernet speed enums. Signed-off-by: Fin Maaß <[email protected]>
46493a7
to
c858607
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.
LGTM.
Do we really need both, the LINK_*_*BASE
and the ETHERNET_LINK_*BASE
enums?
Maybe we could report the half
-vs-full
info out-of-band and have the same enum for speed in the future?
@decsny would you be fine, with that, that we add an api for supporting for switching between fiber and copper, when it is needed. In the meantime it could be implemented as a DT property to set that mode at build time. I don't feel good with adding a api right now without implementing it for at least one phy in tree |
i will remove the block but do not want to approve the PR, the breaking change seems unnecessary right now
We shouldn't have speed options for ethernet drivers, which end with a
_T
, that imply that ethernet is only supported via a twisted pair cable.