linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Hayes Wang <hayeswang@realtek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	nic_swsd <nic_swsd@realtek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Oliver Neukum <oliver@neukum.org>
Subject: Re: [PATCH net-next v2] net/usb/r8153_ecm: support ECM mode for RTL8153
Date: Mon, 2 Nov 2020 11:47:18 -0800	[thread overview]
Message-ID: <20201102114718.0118cc12@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> (raw)
In-Reply-To: <dc7fd1d4d1c544e8898224c7d9b54bda@realtek.com>

On Mon, 2 Nov 2020 07:20:15 +0000 Hayes Wang wrote:
> Jakub Kicinski <kuba@kernel.org>
> > Can you describe the use case in more detail?
> > 
> > AFAICT r8152 defines a match for the exact same device.
> > Does it not mean that which driver is used will be somewhat random
> > if both are built?  
> 
> I export rtl_get_version() from r8152. It would return none zero
> value if r8152 could support this device. Both r8152 and r8153_ecm
> would check the return value of rtl_get_version() in porbe().
> Therefore, if rtl_get_version() return none zero value, the r8152
> is used for the device with vendor mode. Otherwise, the r8153_ecm
> is used for the device with ECM mode.

Oh, I see, I missed that the rtl_get_version() checking is the inverse
of r8152.

> > > +/* Define these values to match your device */
> > > +#define VENDOR_ID_REALTEK		0x0bda
> > > +#define VENDOR_ID_MICROSOFT		0x045e
> > > +#define VENDOR_ID_SAMSUNG		0x04e8
> > > +#define VENDOR_ID_LENOVO		0x17ef
> > > +#define VENDOR_ID_LINKSYS		0x13b1
> > > +#define VENDOR_ID_NVIDIA		0x0955
> > > +#define VENDOR_ID_TPLINK		0x2357  
> > 
> > $ git grep 0x2357 | grep -i tplink
> > drivers/net/usb/cdc_ether.c:#define TPLINK_VENDOR_ID	0x2357
> > drivers/net/usb/r8152.c:#define VENDOR_ID_TPLINK		0x2357
> > drivers/usb/serial/option.c:#define TPLINK_VENDOR_ID			0x2357
> > 
> > $ git grep 0x17ef | grep -i lenovo
> > drivers/hid/hid-ids.h:#define USB_VENDOR_ID_LENOVO		0x17ef
> > drivers/hid/wacom.h:#define USB_VENDOR_ID_LENOVO	0x17ef
> > drivers/net/usb/cdc_ether.c:#define LENOVO_VENDOR_ID	0x17ef
> > drivers/net/usb/r8152.c:#define VENDOR_ID_LENOVO		0x17ef
> > 
> > Time to consolidate those vendor id defines perhaps?  
> 
> It seems that there is no such header file which I could include
> or add the new vendor IDs.

Please create one. (Adding Greg KH to the recipients, in case there is
a reason that USB subsystem doesn't have a common vendor id header.)

Also please make sure to add Oliver to the CC for v3, to make sure the
reuse of CDC_ETHER is okay.

  reply	other threads:[~2020-11-02 19:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 12:33 [PATCH] net/usb/r8153_ecm: support ECM mode for RTL8153 Hayes Wang
2020-10-29 15:04 ` kernel test robot
2020-10-30  3:23 ` [PATCH net-next v2] " Hayes Wang
2020-10-31 23:08   ` Jakub Kicinski
2020-11-02  7:20     ` Hayes Wang
2020-11-02 19:47       ` Jakub Kicinski [this message]
2020-11-03  9:32         ` Greg Kroah-Hartman
2020-11-03  9:51           ` Hayes Wang
2020-11-03 16:15           ` Jakub Kicinski
2020-11-04  1:39             ` Hayes Wang
2020-11-04  1:44               ` Jakub Kicinski
2020-11-03  9:46 ` [PATCH net-next v3 0/2] drivers/net/usb: " Hayes Wang
2020-11-03  9:46   ` [PATCH net-next v3 1/2] include/linux/usb: new header file for the vendor ID of USB devices Hayes Wang
2020-11-03  9:55     ` Greg KH
2020-11-03  9:46   ` [PATCH net-next v3 2/2] net/usb/r8153_ecm: support ECM mode for RTL8153 Hayes Wang
2020-11-04  2:19 ` [PATCH net-next v2 RESEND] " Hayes Wang
2020-11-06  1:00   ` Jakub Kicinski
     [not found]   ` <CGME20201113152938eucas1p2c8500d9d3d0c892c7c2a2d56b32fedc0@eucas1p2.samsung.com>
2020-11-13 15:29     ` Marek Szyprowski
2020-11-16  6:52       ` [PATCH net-next] r8153_ecm: avoid to be prior to r8152 driver Hayes Wang
2020-11-16  9:18         ` Marek Szyprowski
2020-11-16 17:02           ` Jakub Kicinski
2020-11-17  1:50             ` Hayes Wang
2020-11-17 16:11               ` Jakub Kicinski
2020-11-18  1:21                 ` Hayes Wang
2020-11-18  6:43         ` [PATCH net-next v2] " Hayes Wang
2020-11-18  8:18           ` Marek Szyprowski
2020-11-19 16:50           ` patchwork-bot+netdevbpf

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=20201102114718.0118cc12@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net \
    --to=kuba@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=oliver@neukum.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).