mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Birger Koblitz <mail@birger-koblitz.de>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 07/13] ax88179_178a: Obtain speed and duplex from Interrupt URB
Date: Fri, 24 Jul 2026 19:01:58 +0200	[thread overview]
Message-ID: <434f6f0b-40ce-4f2c-95ac-1fe24ce38366@lunn.ch> (raw)
In-Reply-To: <20260724-ax88179a-v3-7-bdde4f905883@birger-koblitz.de>

> @@ -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

  reply	other threads:[~2026-07-24 17:02 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  7:36 [PATCH net-next v3 00/13] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 01/13] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-07-24 13:22   ` Andrew Lunn
2026-07-24  7:36 ` [PATCH net-next v3 02/13] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-07-24 16:22   ` Andrew Lunn
2026-07-31 16:06     ` Birger Koblitz
2026-07-24 16:37   ` Andrew Lunn
2026-07-31 16:09     ` Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 03/13] ax88179_178a: Use MMD accessor functions for AX88179A Birger Koblitz
2026-07-24 13:25   ` Andrew Lunn
2026-07-24 16:44   ` Andrew Lunn
2026-07-24 17:07     ` Birger Koblitz
2026-07-24 17:27       ` Andrew Lunn
2026-07-31 16:10     ` Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 04/13] ax88179_178a: Add EEE HW configuration support " Birger Koblitz
2026-07-24 13:32   ` Andrew Lunn
2026-07-24  7:36 ` [PATCH net-next v3 05/13] ax88179_178a: Use phylink in get/set_link_ksettings Birger Koblitz
2026-07-24 13:38   ` Andrew Lunn
2026-07-24 15:06     ` Birger Koblitz
2026-07-24 15:35       ` Andrew Lunn
2026-07-24 15:53         ` Birger Koblitz
2026-07-24 16:25           ` Andrew Lunn
2026-07-24 17:02             ` Birger Koblitz
2026-07-24 18:22               ` Andrew Lunn
2026-07-25  3:59                 ` Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 06/13] ax88179_178a: EEE setup for AX88179A-based chips Birger Koblitz
2026-07-24 16:31   ` Andrew Lunn
2026-07-31 16:08     ` Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 07/13] ax88179_178a: Obtain speed and duplex from Interrupt URB Birger Koblitz
2026-07-24 17:01   ` Andrew Lunn [this message]
2026-07-31 16:12     ` Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 08/13] ax88179_178a: Add support for ethtool pause parameter configuration Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 09/13] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 10/13] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 11/13] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 12/13] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-07-24  7:36 ` [PATCH net-next v3 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-07-24 13:51   ` Andrew Lunn
2026-07-24 17:18   ` Andrew Lunn
2026-07-31 16:14     ` Birger Koblitz
2026-07-31 16:40       ` Andrew Lunn
2026-07-31 17:39         ` Birger Koblitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=434f6f0b-40ce-4f2c-95ac-1fe24ce38366@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mail@birger-koblitz.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®