[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbd0fb96-f721-42a5-92e5-98324546e9ae@suse.com>
Date: Mon, 29 Sep 2025 13:20:22 +0200
From: Oliver Neukum <oneukum@...e.com>
To: yicongsrfy@....com, michal.pecio@...il.com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org
Cc: marcan@...can.st, pabeni@...hat.com, linux-usb@...r.kernel.org,
netdev@...r.kernel.org, yicong@...inos.cn
Subject: Re: [PATCH v3 3/3] net: usb: ax88179_178a: add USB device driver for
config selection
Hi,
On 29.09.25 09:54, yicongsrfy@....com wrote:
> From: Yi Cong <yicong@...inos.cn>
>
> A similar reason was raised in commit ec51fbd1b8a2 ("r8152: add USB
> device driver for config selection"):
> Linux prioritizes probing non-vendor-specific configurations.
>
> Referring to the implementation of this patch, cfgselect is also
> used for ax88179 to override the default configuration selection.
>
> v2: fix warning from checkpatch
>
> Signed-off-by: Yi Cong <yicong@...inos.cn>
> ---
> drivers/net/usb/ax88179_178a.c | 70 ++++++++++++++++++++++++++++++++--
> 1 file changed, 67 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
> index 29cbe9ddd610..f2e86b9256dc 100644
> --- a/drivers/net/usb/ax88179_178a.c
> +++ b/drivers/net/usb/ax88179_178a.c
> @@ -14,6 +14,7 @@
> #include <uapi/linux/mdio.h>
> #include <linux/mdio.h>
>
> +#define MODULENAME "ax88179_178a"
> #define AX88179_PHY_ID 0x03
> #define AX_EEPROM_LEN 0x100
> #define AX88179_EEPROM_MAGIC 0x17900b95
> @@ -1713,6 +1714,14 @@ static int ax88179_stop(struct usbnet *dev)
> return 0;
> }
>
> +static int ax88179_probe(struct usb_interface *intf, const struct usb_device_id *i)
> +{
> + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
> + return -ENODEV;
And here you need to work around the problem the
first patch in the series creates. The solution
in this case is to drop it.
> +
> + return usbnet_probe(intf, i);
> +}
> +
> static const struct driver_info ax88179_info = {
> .description = "ASIX AX88179 USB 3.0 Gigabit Ethernet",
> .bind = ax88179_bind,
> @@ -1941,9 +1950,9 @@ static const struct usb_device_id products[] = {
> MODULE_DEVICE_TABLE(usb, products);
>
> static struct usb_driver ax88179_178a_driver = {
> - .name = "ax88179_178a",
> + .name = MODULENAME,
> .id_table = products,
> - .probe = usbnet_probe,
> + .probe = ax88179_probe,
> .suspend = ax88179_suspend,
> .resume = ax88179_resume,
> .reset_resume = ax88179_resume,
> @@ -1952,7 +1961,62 @@ static struct usb_driver ax88179_178a_driver = {
> .disable_hub_initiated_lpm = 1,
> };
>
> -module_usb_driver(ax88179_178a_driver);
> +static int ax88179_cfgselector_probe(struct usb_device *udev)
And this should run only if you match the device ID and the generic
class.
That is, if you want this approach at all. If this should o into
kernel space at all, it blongs into usbcore.
Regards
Oliver
Powered by blists - more mailing lists