Subject: Re: [PATCH net-next 6/6] bnxt_en: Implement ethtool_ops -> get_link_ext_state()

From: Jakub Kicinski <[email-masked]>
Date: Tue, 6 Jan 2026 18:15:13 -0800

On Mon,  5 Jan 2026 13:58:33 -0800 Michael Chan wrote:
> +static char *bnxt_link_down_reason(struct bnxt_link_info *link_info)
> +{
> +	u8 reason = link_info->link_down_reason;
> +
> +	/* Multiple bits can be set, we report 1 bit only in order of
> +	 * priority.
> +	 */
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_RF)
> +		return "(Remote fault)";
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_OTP_SPEED_VIOLATION)
> +		return "(OTP Speed limit violation)";
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_CABLE_REMOVED)
> +		return "(Cable removed)";
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_MODULE_FAULT)
> +		return "(Module fault)";
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_BMC_REQUEST)
> +		return "(BMC request down)";
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_TX_LASER_DISABLED)
> +		return "(TX laser disabled)";
> +	return "";
> +};

spurious ;

> +static int bnxt_get_link_ext_state(struct net_device *dev,
> +				   struct ethtool_link_ext_state_info *info)
> +{
> +	struct bnxt *bp = netdev_priv(dev);
> +	u8 reason;
> +
> +	if (BNXT_LINK_IS_UP(bp))
> +		return -ENODATA;
> +
> +	reason = bp->link_info.link_down_reason;
> +	if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_CABLE_REMOVED) {
> +		info->link_ext_state = ETHTOOL_LINK_EXT_STATE_NO_CABLE;
> +		return 0;
> +	} else if (reason & PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_MODULE_FAULT) {
> +		info->link_ext_state = ETHTOOL_LINK_EXT_STATE_MODULE;
> +		return 0;

Please extend the uAPI to add the missing codes. None of the strings
you're adding look very Broadcom specific to me. And there's a code 
for Remote Fault already.