Thread (34 messages) 34 messages, 2 authors, 1d ago

Re: [PATCH net-next v3 07/13] ax88179_178a: Obtain speed and duplex from Interrupt URB

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-07-24 17:02:08
Also in: linux-usb, lkml

quoted hunk ↗ jump to hunk
@@ -506,6 +507,9 @@ static void ax88179_status(struct usbnet *dev, struct urb *urb)
 	le32_to_cpus((void *)&event->intdata1);
 
 	link = (((__force u32)event->intdata1) & AX_INT_PPLS_LINK) >> 16;
+	data->speed = (((__force u32)event->intdata1) >> 8) & 0x7;
+	data->full_duplex = (((__force u32)event->intdata1) >> 12) & 0x1;
+	data->link = link;
 
 	if (netif_carrier_ok(dev->net) != link) {
 		usbnet_link_change(dev, link, 1);
usbnet_link_change() calls netif_carrier_off(). With phylink, phylink
is in charge of the carrier.

I would also be careful with speed. What is it actually returning?

Think about when you turn autoneg off:

ethtool    -s    devname   [speed N]   [lanes N]   [du‐
            plex half|full]            [port tp|aui|bnc|mii]
            [mdix auto|on|off]    [autoneg on|off]

If i do ethtool -s eth42 speed 100 autoneg off

The PHY does not have valid speed information in its advertise
registers. The LP values are probably also wrong. phylib will set the
speed the PHY is doing in its forced mode. Is the firmware clever
enough to understand this and return the correct thing?

The phylink link up callback will however tell you the truth. I would
trust it over firmware.

     Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help