diff options
| author | Maxime Chevallier <[email protected]> | 2025-03-07 17:36:04 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2025-03-18 08:03:11 +0000 |
| commit | fc81e257d19f5733c22732eef29fa15ee8bef221 (patch) | |
| tree | 6f02f1972746451e5bbb2deeeca8f520c4647600 /net/core/dev_api.c | |
| parent | net: phy: phy_caps: Implement link_capabilities lookup by linkmode (diff) | |
| download | kernel-fc81e257d19f5733c22732eef29fa15ee8bef221.tar.gz kernel-fc81e257d19f5733c22732eef29fa15ee8bef221.zip | |
net: phy: phy_caps: Allow looking-up link caps based on speed and duplex
As the link_caps array is efficient for <speed,duplex> lookups,
implement a function for speed/duplex lookups that matches a given
mask. This replicates to some extent the phy_lookup_settings()
behaviour, matching full link_capabilities instead of a single linkmode.
phy.c's phy_santize_settings() and phylink's
phylink_ethtool_ksettings_set() performs such lookup using the
phy_settings table, but are only interested in the actual speed/duplex
that were matched, rathet than the individual linkmode.
Similar to phy_lookup_settings(), the newly introduced phy_caps_lookup()
will run through the link_caps[] array by descending speed/duplex order.
If the link_capabilities for a given <speed/duplex> tuple intersects the
passed linkmodes, we consider that a match.
Similar to phy_lookup_settings(), we also allow passing an 'exact'
boolean, allowing non-exact match. Here, we MUST always match the
linkmodes mask, but we allow matching on lower speed settings.
Signed-off-by: Maxime Chevallier <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
0 files changed, 0 insertions, 0 deletions
