Case of the Broken Linux Driver (Lenovo USB 2.0 Ethernet 10/100 dongle)

We had a customer that was in process of migrating from ZenWorks to SCCM and XP to Windows 7. However there was still XP out there being deployed through a ZenWorks 7 deployment solution. Instead of WinPE the solution is built around a Linux boot image and various bash scripting to deploy the appropriate images. However when a new model came around – The Lenovo Carbon X1 – the Linux boot image failed to detect the USB-only Ethernet dongle – preventing the boot image from copying OS images from the Netware share. Lenovo didn’t provide a Linux driver either – However their tech support did advise us to use the Linux driver available here:

http://www.asix.com.tw/download.php?sub=driverdetail&PItemID=105

Followed the instructions for compilation included in the readme – but still device was not making a connection. To verify my hardware was not faulty I tested in Windows machine and it worked fine with the Windows drivers from the same site.

Compiling & installing showed no errors:

make install
su -c “cp -v asix.ko /lib/modules/3.6.0-rc7-1-desktop/kernel/drivers/net/usb && /sbin/depmod -a”
‘asix.ko’ -> ‘/lib/modules/3.6.0-rc7-1-desktop/kernel/drivers/net/usb/asix.ko’

modprobe asix -v displayed:
/lib/modules/3.6.0-rc7-1-desktop/kernel/drivers/net/usb/asix.ko

dmesg displayed no errors, but included message:

usbcore: registered new interface driver asix

The output of lsusb showed us:

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 08ff:2683 AuthenTec, Inc.
Bus 001 Device 014: ID 17ef:7203 Lenovo
Bus 002 Device 003: ID 04f2:b240 Chicony Electronics Co., Ltd
Bus 002 Device 004: ID 0489:e031 Foxconn / Hon Hai

The output of modinfo asix

filename: /lib/modules/3.6.0-rc7-1-desktop/kernel/drivers/net/usb/asix.ko
license: GPL
description: ASIX AX8817X based USB 2.0 Ethernet Devices
author: David Hollis
srcversion: 3EB00488E36F8F5659BEFBB
alias: usb:v0B95p7E2Bd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0B95p772Bd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v05ACp1402d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v13B1p0018d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0421p772Ad*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0DB0pA877d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0B95p772Ad*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v125Ep180Dd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0B95p7720d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1631p6200d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1189p0893d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v07AAp0017d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v6189p182Dd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0411p003Dd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0557p2009d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v08DDp90FFd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v07B8p420Ad*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0B95p1720d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v07D1p3C05d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p3C05d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p1A00d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0846p1040d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v077Bp2226d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v050Dp5055d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v14EApAB11d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1737p0039d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v077Bp2226d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0B95p1780d*dc*dsc*dp*ic*isc*ip*in*
depends:
vermagic: 3.6.0-rc7-1-desktop SMP preempt mod_unload modversions 686
parm: msg_level: override default message level (int)
parm: bsize:Maximum transfer size per bulk (int)

Rebooting/reinserting device did not have any affect. After inserting device get this in dmesg – should have also seen detail about network interface being added…


[ 6133.758891] usbcore: registered new interface driver asix
[ 6514.502110] usb 1-1.3: USB disconnect, device number 14
[ 6515.701128] usb 1-1.3: new high-speed USB device number 15 using ehci_hcd
[ 6515.801403] usb 1-1.3: New USB device found, idVendor=17ef, idProduct=7203
[ 6515.801413] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6515.801418] usb 1-1.3: Product: AX88772B
[ 6515.801423] usb 1-1.3: Manufacturer: Lenovo
[ 6515.801428] usb 1-1.3: SerialNumber: 58265D

Despite this one thing was clear – running command ip link to show network interfaces – there was no USB network interface!

Why is the driver not being detected?

We need to simply use the device ID from lsusb which was 17ef:7203 and verify this device code is contained in the driver source code.

Well it sure was missing…

To fix this I opened up asix.c and searched for the usb_device_id line of code, then inserted the Lenovo’s device Id we found earlier using lsusb

static const struct usb_device_id    products [] = {
     USB_DEVICE (0x04f1, 0x3008),
     .driver_info = (unsigned long) &ax8817x_info,
}, {
    // Lenovo 10/100
    USB_DEVICE (0x17ef, 0x7203),
    .driver_info = (unsigned long) &ax88772_info,
},
{
     // ASIX AX88772B 10/100
     USB_DEVICE (0x0b95, 0x772b),
     .driver_info = (unsigned long) &ax88772_info,

Another go at re-compilation and re-install – and voila ! We have network in Linux.

You can use a similar process for devices that are not working in Linux – find a driver based on the same chipset and add your devices own ID. It may or may not work. Good luck, you’ll need it.

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Deployment, Linux and tagged . Bookmark the permalink.

5 Responses to Case of the Broken Linux Driver (Lenovo USB 2.0 Ethernet 10/100 dongle)

  1. priisholm says:

    Thank you Sir – you just saved my day, big time!

    Regards, Kenneth

  2. mehturt1 says:

    Thanks a lot, you only need to fix the code snippet to contain &ax88772b_info.

  3. hs says:

    After doing this changes in asix.c and recompile and installing the connection fixed and worked but suddenly the adaptor starts to create extensive lines of the repeated error in /var/log/syslog file “eth2: header length size is error …” and it grow to fill all storage. I rotate the syslog and kern.log files to free the space but again when I use the ethernet the same story. It seems somthing is wrong with this changes that creates error. Would you please consider this ASAP?

  4. lastorset says:

    Thank you for writing this up! It helped me get my ThinkPad USB 3.0 Ethernet Adapter working. The 3.0/Gigabit device appears to be an AX88179, so the download link I used was http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=131;71;112 . The vendor/product IDs are 17ef:7205, and the struct that worked for me was &ax88179_info.

    Caveats: it does take a long time (a couple of minutes) to initialize, with some cryptic errors in dmesg:

    usb 2-1: new SuperSpeed USB device number 4 using xhci_hcd
    usb 2-1: New USB device found, idVendor=17ef, idProduct=7205
    usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 2-1: Product: ThinkpadUSBLAN
    usb 2-1: Manufacturer: Lenovo
    usb 2-1: SerialNumber: 3C18A00213EC
    ax88179_178a 2-1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32
    ax88179_178a 2-1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32
    ax88179_178a 2-1:2.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32
    ax88179_178a 2-1:2.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -32
    ax88179_178a: probe of 2-1:2.0 failed with error -32
    ax88179_178a 2-1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32
    ax88179_178a 2-1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0002: -32
    ax88179_178a 2-1:2.1 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -32
    ax88179_178a 2-1:2.1 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -32
    ax88179_178a: probe of 2-1:2.1 failed with error -32
    usb 2-1: reset SuperSpeed USB device number 4 using xhci_hcd
    r8152 2-1:1.0 eth1: v1.08.1 (2015/07/28)
    r8152 2-1:1.0 enx3c18a00213ec: renamed from eth1
    IPv6: ADDRCONF(NETDEV_UP): enx3c18a00213ec: link is not ready
    IPv6: ADDRCONF(NETDEV_UP): enx3c18a00213ec: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): enx3c18a00213ec: link becomes ready

    I’m going to try to figure out whether and how it makes sense to get this into distributions. Hopefully I can simply report my findings somewhere and the knowledgeable people can take care of it…

    • lastorset says:

      I wrote to Asix about it, and it turns out I was wrong about this device being manufactured by them, it’s actually a Realtek device. This may explain the erratic behavior, and that it works at all is probably due to the general usbnet layer. Which is quite interesting in itself.

      I don’t have access to the device anymore, so I’m halting my patching efforts. Hopefully all this is useful to some other random surfer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s