Bug 179920

Summary: Add Lenovo USB 2.0 Ethernet Adapter support by axe(4)
Product: Base System Reporter: Koichiro IWAO <meta>
Component: usbAssignee: Pyun YongHyeon <yongari>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 9.1-STABLE   
Hardware: Any   
OS: Any   

Description Koichiro IWAO 2013-06-24 08:50:00 UTC
Lenovo USB 2.0 Ethernet Adapter [1] does not work with FreeBSD now.
This product is already supported by NetBSD. Is it possible to import 
it from NetBSD?

[1] http://shop.lenovo.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:item.detail?GroupID=460&Code=0A36322

Fix: 

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=47245
How-To-Repeat: Here's the usbconfig result of this product.

# usbconfig
ugen0.2: <product 0x7203 vendor 0x17ef> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA)
Comment 1 Pyun YongHyeon freebsd_committer freebsd_triage 2013-06-24 09:40:49 UTC
State Changed
From-To: open->feedback

Would you try patch at the following URL? 
http://people.freebsd.org/~yongari/axe/axe.lenovo.diff 

Here, I'm assuming the controller model is AX88772B. If the 
controller is a plain AX88772, please manually edit the 
following line in if_axe.c(line number 166). 

from 
AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B), 
to 
AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772), 

Unlike other BSDes, FreeBSD supports hardware checksum offloading 
for AX88772B. Their web site is not clear what controller chipset 
was used. 


Comment 2 Pyun YongHyeon freebsd_committer freebsd_triage 2013-06-24 09:40:49 UTC
Responsible Changed
From-To: freebsd-usb->yongari

Grab.
Comment 3 Koichiro IWAO 2013-06-24 17:09:48 UTC
Let me resend with additional information as I forgot CC'ing to 
bug-followup@.

AX88772B was correct. I applied your patch to 9.1-STABLE revision 
251447.
It works and I'm sending this e-mail via Lenovo ethernet adapter.

Logs and result of ifconfig is here.

Jun 25 00:58:19 graphite kernel: ugen1.6: <vendor 0x17ef> at usbus1
Jun 25 00:58:19 graphite kernel: axe0: <vendor 0x17ef product 0x7203, 
rev 2.00/0.01, addr 6> on usbus1
Jun 25 00:58:20 graphite kernel: miibus0: <MII bus> on axe0
Jun 25 00:58:20 graphite kernel: ukphy0: <Generic IEEE 802.3u media 
interface> PHY 16 on miibus0
Jun 25 00:58:20 graphite kernel: ukphy0:  none, 10baseT, 10baseT-FDX, 
100baseTX, 100baseTX-FDX, auto, auto-flow
Jun 25 00:58:20 graphite kernel: ue0: <USB Ethernet> on axe0
Jun 25 00:58:20 graphite kernel: ue0: Ethernet address: 
00:b5:6d:xx:xx:xx
Jun 25 00:58:20 graphite kernel: ue0: link state changed to DOWN

ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 
1500
	options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
	ether 00:b5:6d:xx:xx:xx
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (none)
	status: no carrier

Thanks,
-- 
`whois vmeta.jp | nkf -w`
meta <meta@vmeta.jp>
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-06-25 01:27:02 UTC
Author: yongari
Date: Tue Jun 25 00:26:30 2013
New Revision: 252185
URL: http://svnweb.freebsd.org/changeset/base/252185

Log:
  Add Lenovo USB 2.0 Ethernet adapter.
  
  PR:		usb/179920
  MFC After:	1 week

Modified:
  head/sys/dev/usb/net/if_axe.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/net/if_axe.c
==============================================================================
--- head/sys/dev/usb/net/if_axe.c	Tue Jun 25 00:10:49 2013	(r252184)
+++ head/sys/dev/usb/net/if_axe.c	Tue Jun 25 00:26:30 2013	(r252185)
@@ -163,6 +163,7 @@ static const STRUCT_USB_HOST_ID axe_devs
 	AXE_DEV(GOODWAY, GWUSB2E, 0),
 	AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178),
 	AXE_DEV(JVC, MP_PRX1, 0),
+	AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B),
 	AXE_DEV(LINKSYS2, USB200M, 0),
 	AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178),
 	AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178),

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Tue Jun 25 00:10:49 2013	(r252184)
+++ head/sys/dev/usb/usbdevs	Tue Jun 25 00:26:30 2013	(r252185)
@@ -681,6 +681,7 @@ vendor ASUS2		0x1761	ASUS
 vendor SWEEX2		0x177f	Sweex
 vendor METAGEEK		0x1781	MetaGeek
 vendor KAMSTRUP		0x17a8	Kamstrup A/S
+vendor LENOVO		0x17ef	Lenovo
 vendor WAVESENSE	0x17f4	WaveSense
 vendor VAISALA		0x1843	Vaisala
 vendor AMIT		0x18c5	AMIT
@@ -2462,6 +2463,9 @@ product LARSENBRUSGAARD ALTITRACK	0x0001
 /* Leadtek products */
 product LEADTEK 9531		0x2101	9531 GPS
 
+/* Lenovo products */
+product LENOVO ETHERNET		0x7203	USB 2.0 Ethernet
+
 /* Lexar products */
 product LEXAR JUMPSHOT		0x0001	jumpSHOT CompactFlash Reader
 product LEXAR CF_READER		0xb002	USB CF Reader
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 5 Pyun YongHyeon freebsd_committer freebsd_triage 2013-06-25 01:32:38 UTC
State Changed
From-To: feedback->patched

Fixed in r252185. Will MFC after 1 week. 
Thanks for reporting and testing!
Comment 6 dfilter service freebsd_committer freebsd_triage 2013-07-01 06:29:54 UTC
Author: yongari
Date: Mon Jul  1 05:29:42 2013
New Revision: 252444
URL: http://svnweb.freebsd.org/changeset/base/252444

Log:
  MFC r252185:
    Add Lenovo USB 2.0 Ethernet adapter.
  
    PR:	usb/179920

Modified:
  stable/9/sys/dev/usb/net/if_axe.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/net/if_axe.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_axe.c	Mon Jul  1 05:26:29 2013	(r252443)
+++ stable/9/sys/dev/usb/net/if_axe.c	Mon Jul  1 05:29:42 2013	(r252444)
@@ -162,6 +162,7 @@ static const STRUCT_USB_HOST_ID axe_devs
 	AXE_DEV(GOODWAY, GWUSB2E, 0),
 	AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178),
 	AXE_DEV(JVC, MP_PRX1, 0),
+	AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B),
 	AXE_DEV(LINKSYS2, USB200M, 0),
 	AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178),
 	AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178),

Modified: stable/9/sys/dev/usb/usbdevs
==============================================================================
--- stable/9/sys/dev/usb/usbdevs	Mon Jul  1 05:26:29 2013	(r252443)
+++ stable/9/sys/dev/usb/usbdevs	Mon Jul  1 05:29:42 2013	(r252444)
@@ -678,6 +678,7 @@ vendor ASUS2		0x1761	ASUS
 vendor SWEEX2		0x177f	Sweex
 vendor METAGEEK		0x1781	MetaGeek
 vendor KAMSTRUP		0x17a8	Kamstrup A/S
+vendor LENOVO		0x17ef	Lenovo
 vendor WAVESENSE	0x17f4	WaveSense
 vendor VAISALA		0x1843	Vaisala
 vendor AMIT		0x18c5	AMIT
@@ -2420,6 +2421,9 @@ product LARSENBRUSGAARD ALTITRACK	0x0001
 /* Leadtek products */
 product LEADTEK 9531		0x2101	9531 GPS
 
+/* Lenovo products */
+product LENOVO ETHERNET		0x7203	USB 2.0 Ethernet
+
 /* Lexar products */
 product LEXAR JUMPSHOT		0x0001	jumpSHOT CompactFlash Reader
 product LEXAR CF_READER		0xb002	USB CF Reader
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2013-07-01 06:30:46 UTC
Author: yongari
Date: Mon Jul  1 05:30:38 2013
New Revision: 252445
URL: http://svnweb.freebsd.org/changeset/base/252445

Log:
  MFC r252185:
    Add Lenovo USB 2.0 Ethernet adapter.
  
    PR:	usb/179920

Modified:
  stable/8/sys/dev/usb/net/if_axe.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/net/if_axe.c
==============================================================================
--- stable/8/sys/dev/usb/net/if_axe.c	Mon Jul  1 05:29:42 2013	(r252444)
+++ stable/8/sys/dev/usb/net/if_axe.c	Mon Jul  1 05:30:38 2013	(r252445)
@@ -163,6 +163,7 @@ static const STRUCT_USB_HOST_ID axe_devs
 	AXE_DEV(GOODWAY, GWUSB2E, 0),
 	AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178),
 	AXE_DEV(JVC, MP_PRX1, 0),
+	AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B),
 	AXE_DEV(LINKSYS2, USB200M, 0),
 	AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178),
 	AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Mon Jul  1 05:29:42 2013	(r252444)
+++ stable/8/sys/dev/usb/usbdevs	Mon Jul  1 05:30:38 2013	(r252445)
@@ -677,6 +677,7 @@ vendor ASUS2		0x1761	ASUS
 vendor SWEEX2		0x177f	Sweex
 vendor METAGEEK		0x1781	MetaGeek
 vendor KAMSTRUP		0x17a8	Kamstrup A/S
+vendor LENOVO		0x17ef	Lenovo
 vendor WAVESENSE	0x17f4	WaveSense
 vendor VAISALA		0x1843	Vaisala
 vendor AMIT		0x18c5	AMIT
@@ -2421,6 +2422,9 @@ product LARSENBRUSGAARD ALTITRACK	0x0001
 /* Leadtek products */
 product LEADTEK 9531		0x2101	9531 GPS
 
+/* Lenovo products */
+product LENOVO ETHERNET		0x7203	USB 2.0 Ethernet
+
 /* Lexar products */
 product LEXAR JUMPSHOT		0x0001	jumpSHOT CompactFlash Reader
 product LEXAR CF_READER		0xb002	USB CF Reader
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 8 Pyun YongHyeon freebsd_committer freebsd_triage 2013-07-01 06:37:16 UTC
State Changed
From-To: patched->closed

MFC to both stable/9 and stable/8 done. 
Thanks for reporting and testing!