All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Hector Martin <marcan@marcan.st>
Cc: Jacky Chou <jackychou@asix.com.tw>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: usb: ax88179_178a: Bind only to vendor-specific interface
Date: Wed, 4 May 2022 19:30:47 -0700	[thread overview]
Message-ID: <20220504193047.1e4b97b7@kernel.org> (raw)
In-Reply-To: <20220502110644.167179-1-marcan@marcan.st>

On Mon,  2 May 2022 20:06:44 +0900 Hector Martin wrote:
> The Anker PowerExpand USB-C to Gigabit Ethernet adapter uses this
> chipset, but exposes CDC Ethernet configurations as well as the
> vendor specific one. 

And we have reasons to believe all dongle vendors may have a similar
problem?

> This driver ends up binding first to both CDC
> interfaces, tries to instantiate two Ethernet interfaces talking to
> the same device, and the result is a nice fireworks show.
> 
> Change all the ID matches to specifically match the vendor-specific
> interface. By default the device comes up in CDC mode and is bound by
> that driver (which works fine); users may switch it to the vendor
> interface using sysfs to set bConfigurationValue, at which point the
> device actually goes through a reconnect cycle and comes back as a
> vendor specific only device, and then this driver binds and works too.
> 
> v2: Fixed interface protocol match, commit message.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  drivers/net/usb/ax88179_178a.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
> index e2fa56b92685..7c7c2f31d9f1 100644
> --- a/drivers/net/usb/ax88179_178a.c
> +++ b/drivers/net/usb/ax88179_178a.c
> @@ -1914,55 +1914,55 @@ static const struct driver_info at_umc2000sp_info = {
>  static const struct usb_device_id products[] = {
>  {
>  	/* ASIX AX88179 10/100/1000 */
> -	USB_DEVICE(0x0b95, 0x1790),
> +	USB_DEVICE_AND_INTERFACE_INFO(0x0b95, 0x1790, 0xff, 0xff, 0),
>  	.driver_info = (unsigned long)&ax88179_info,
>  }, 

Should we use USB_CLASS_VENDOR_SPEC and USB_SUBCLASS_VENDOR_SPEC ?
Maybe define a local macro wrapper for USB_DEVICE_AND.. which will
fill those in to avoid long lines?

  reply	other threads:[~2022-05-05  2:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 11:06 [PATCH v2] net: usb: ax88179_178a: Bind only to vendor-specific interface Hector Martin
2022-05-05  2:30 ` Jakub Kicinski [this message]
2022-05-05 12:05   ` Hector Martin
2022-05-05 16:17     ` Jakub Kicinski

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=20220504193047.1e4b97b7@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jackychou@asix.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcan@marcan.st \
    --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 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.