lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251018175618.148d4e59.michal.pecio@gmail.com>
Date: Sat, 18 Oct 2025 17:56:18 +0200
From: Michal Pecio <michal.pecio@...il.com>
To: Alan Stern <stern@...land.harvard.edu>
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, 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.

> (Also, is prefer_vendor() really needed?  Can't you just pass 
> usb_driver_preferred as the argument to bus_for_each_drv()?  Maybe after 
> changing the type of its second argument to void * instead of struct 
> usb_device *?)

I didn't like the idea of usb_driver_preferred() taking void *.
However, I could cast it to a function taking void * here in generic.c.

The wrapper would become truly necessary if we wanted to pass
config / intf / other stuff to usb_driver_preferred().

Regards,
Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ