[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4ce396c-0047-4bd1-a5d2-aee3b86315b1@rowland.harvard.edu>
Date: Mon, 20 Oct 2025 11:56:50 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Michal Pecio <michal.pecio@...il.com>
Cc: yicongsrfy@....com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, linux-usb@...r.kernel.org,
netdev@...r.kernel.org, oliver@...kum.org, pabeni@...hat.com
Subject: Re: [PATCH net v5 2/3] net: usb: ax88179_178a: add USB device driver
for config selection
On Sat, Oct 18, 2025 at 05:56:18PM +0200, Michal Pecio wrote:
> On Sat, 18 Oct 2025 11:36:11 -0400, Alan Stern wrote:
> > > @@ -169,6 +175,12 @@ int usb_choose_configuration(struct usb_device *udev)
> > > #endif
> > > }
> > >
> > > + /* Check if we have a preferred vendor driver for this config */
> > > + else if (bus_for_each_drv(&usb_bus_type, NULL, (void *) udev, prefer_vendor)) {
> > > + best = c;
> > > + break;
> > > + }
> >
> > How are prefer_vendor() and usb_driver_preferred() supposed to know
> > which configuration is being considered?
>
> Currently they don't need to know, but this could be added by passing
> a temporary struct with more stuff in place of udev.
>
> Really, this whole usb_drv->preferred business could be a simple
> boolean flag, if not for r8152 needing to issue control transfers to
> the chip to find whether it supports at all.
>
> It seems that ax88179_preferred() could simply always return true.
Instead of all this preferred() stuff, why not have the ax88179 driver's
probe routine check for a different configuration with a vendor-specific
interface? If that other config is present and the chip is the right
type then you can call usb_driver_set_configuration() -- this is exactly
what it's meant for.
Especially with that extra requirement for the chip being the right
kind, this doesn't seem like something the USB core should have to
handle. If other USB networking drivers need to do similar things,
maybe the common part could be put in a library in the usbnet core.
Alan Stern
Powered by blists - more mailing lists