[Intel-wired-lan] [PATCH iwl-next 3/10] ice: add PORT_AUI and PORT_NONE ethtool port type reporting

Aleksandr Loktionov
2026-04-10T07:49:34Z

Now that ICE_MEDIA_AUI and ICE_MEDIA_NONE enum values exist,
ice_get_link_ksettings() reports PORT_OTHER for both of them because the
switch falls through to the former default handler.

Replace the catch-all default with an explicit ICE_MEDIA_UNKNOWN case for
PORT_OTHER, and add proper ICE_MEDIA_AUI -> PORT_AUI and
ICE_MEDIA_NONE -> PORT_NONE mappings. The switch now covers every
enum ice_media_type value.

Suggested-by: Paul Greenwalt <paul.greenwalt@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 11 +++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index caec297..6857fcd 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1901,9 +1901,18 @@ ice_get_link_ksettings(struct net_device *netdev,
ethtool_link_ksettings_add_link_mode(ks, advertising, FIBRE);
ks->base.port = PORT_DA;
break;
- default:
+ case ICE_MEDIA_AUI:
+ ethtool_link_ksettings_add_link_mode(ks, supported, AUI);
+ ethtool_link_ksettings_add_link_mode(ks, advertising, AUI);
+ ks->base.port = PORT_AUI;
+ break;
+ case ICE_MEDIA_NONE:
+ ks->base.port = PORT_NONE;
+ break;
+ case ICE_MEDIA_UNKNOWN:
ks->base.port = PORT_OTHER;
break;
+ /* All ice_media_type enum values are explicitly handled above. */
}

/* flow control is symmetric and always supported */
--
2.52.0