All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: yicongsrfy@163.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, linux-usb@vger.kernel.org,
	netdev@vger.kernel.org, oliver@neukum.org, pabeni@redhat.com
Subject: Re: [PATCH net v5 2/3] net: usb: ax88179_178a: add USB device driver for config selection
Date: Sat, 18 Oct 2025 17:56:18 +0200	[thread overview]
Message-ID: <20251018175618.148d4e59.michal.pecio@gmail.com> (raw)
In-Reply-To: <6640b191-d25b-4c4e-ac67-144357eb5cc3@rowland.harvard.edu>

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

  reply	other threads:[~2025-10-18 15:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11  7:53 [PATCH net v5 0/3] ax88179 driver optimization yicongsrfy
2025-10-11  7:53 ` [PATCH net v5 1/3] net: usb: support quirks in cdc_ncm yicongsrfy
2025-10-11  7:53 ` [PATCH net v5 2/3] net: usb: ax88179_178a: add USB device driver for config selection yicongsrfy
2025-10-13  9:07   ` Michal Pecio
2025-10-17  2:42     ` yicongsrfy
2025-10-17 13:10       ` Alan Stern
2025-10-17 17:15         ` Michal Pecio
2025-10-18  2:27           ` Alan Stern
2025-10-18 15:21             ` Michal Pecio
2025-10-18 15:36               ` Alan Stern
2025-10-18 15:56                 ` Michal Pecio [this message]
2025-10-20 15:56                   ` Alan Stern
2025-10-20 16:23                     ` Michal Pecio
2025-10-20 16:59                       ` Alan Stern
2025-10-21  9:13                         ` Oliver Neukum
2025-10-21 16:33                           ` Alan Stern
2025-10-22  7:58                             ` Oliver Neukum
2025-10-22 14:28                               ` Alan Stern
2025-10-21  2:29                     ` Yi Cong
2025-10-21  2:59                       ` Alan Stern
2025-10-21  6:26                         ` Yi Cong
2025-10-21 16:26                           ` Alan Stern
2025-10-20  9:59               ` Oliver Neukum
2025-10-20 10:48                 ` Greg KH
2025-10-20 15:59                 ` Michal Pecio
2025-10-21  9:02                   ` Oliver Neukum
2025-10-20 10:27           ` Oliver Neukum
2025-10-11  7:53 ` [PATCH net v5 3/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" yicongsrfy

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=20251018175618.148d4e59.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=pabeni@redhat.com \
    --cc=stern@rowland.harvard.edu \
    --cc=yicongsrfy@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.