Re: [PATCH net-next v12 12/15] ax88179_178a: Add ethtool get_drvinfo

From: netdev-bot+sashiko

Date: Thu Sep 17 2026 - 18:31:54 EST


Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 2

- [Low] ax88179a_get_drvinfo()
(drivers/net/usb/ax88179a_devices.c:221-233) formats the ethtool…
- [Low] When a bootloader-window read fails in ax88179a_bind()
(ax88179_read_cmd() < 0 at…

--

ax88179_178a: Add ethtool get_drvinfo

This adds ax88179a_get_drvinfo() and wires it into ax88179a_ethtool_ops so
that ethtool -i reports the cached firmware version bytes for AX88179A and
newer chips. It calls usbnet_get_drvinfo() first and then overwrites
info->fw_version with the four cached bytes.

> diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c
> index ff41d20c219d4..6225b88681e62 100644
> --- a/drivers/net/usb/ax88179a_devices.c
> +++ b/drivers/net/usb/ax88179a_devices.c
> @@ -218,6 +218,20 @@ static int ax88179a_resume(struct usb_interface *intf)
> return usbnet_resume(intf);
> }
>
> +static void ax88179a_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
> +{
> + struct ax88179_data *priv = netdev2data(net);
> +
> + /* Inherit standard device info */
> + usbnet_get_drvinfo(net, info);
> + if (priv->chip_version < AX_VERSION_AX88179A)
> + return;
> +
> + snprintf(info->fw_version, sizeof(info->fw_version), "%d.%d.%d.%d",
> + priv->fw_version[0], priv->fw_version[1],
> + priv->fw_version[2], priv->fw_version[3]);
> +}

[Severity: Low]
Is the fourth component here ever read from the device?

The only writer of fw_version[] is the loop in ax88179a_bind():

for (int i = 0; i < 3; i++) {
ret = ax88179_read_cmd(dev, AX88179A_ACCESS_BL, (0xFD + i),
1, 1, &ax179_data->fw_version[i]);
if (ret < 0)
ax179_data->fw_version[i] = 0xff;
}

That fills fw_version[0..2] only, and the container comes from
kzalloc_obj(*ax179_data), so fw_version[3] is always 0.

Grepping fw_version[ over drivers/net/usb/ finds no other assignment, so
the last component of the string exported through ETHTOOL_GDRVINFO is a
constant 0 rather than something read from the chip.

Should the loop read a fourth bootloader register, or should the format
string print three components? The declaration in
drivers/net/usb/ax88179_lib.h:

u8 fw_version[4];

the read loop, and this new format string currently disagree about how
many bytes the firmware version has, and this patch is what turns that
disagreement into a user-visible string. The same mismatch is still
present at the end of the series (cfe9f4be1c4a5ee15cf890112026b94028566314).

[Severity: Low]
What does userspace see when the bootloader-window reads fail?

In ax88179a_bind(), a failed ax88179_read_cmd() stores a sentinel and the
error is not propagated, so bind continues:

if (ret < 0)
ax179_data->fw_version[i] = 0xff;

With this change, ethtool -i then reports "255.255.255.0" as if the chip
had answered the vendor request. Before this patch the sentinel only
appeared in the netdev_info() line at bind time, where the surrounding log
gave context.

Would it be preferable to leave info->fw_version as set by
usbnet_get_drvinfo() when the reads failed, or to track a "version unknown"
state, rather than formatting the sentinel bytes? This is unchanged at the
end of the series (cfe9f4be1c4a5ee15cf890112026b94028566314).

> +
> static void ax88179a_bulkin_config(struct usbnet *dev, u8 link_sts, u8 speed, bool full_duplex)
> {
> struct ax88179_data *ax179_data = dev->driver_priv;

[ ... ]

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260916-ax88179a-v12-0-60c04c9924a2%40birger-koblitz.de