# Driver for USB Ethernet adapter



## balanga (Jan 25, 2016)

How can I tell if FreeBSD has support for this USB Ethernet adapter?


http://www.amazon.co.uk/Handacc-Alu...53753463&sr=8-1&keywords=usb+ethernet+handacc


----------



## asteriskRoss (Jan 25, 2016)

Identifying what chipset the adapter uses and then searching for it in the hardware compatibility list is a good start.  The link you supplied doesn't mention the chipset unfortunately.  Searching the mailing lists for "handacc" didn't bring back any results either.  I would be cautious about that product since it uses USB 3.0 and also is a USB hub as well as a network adapter.  I chose use a USB adapter with the ASIX AX88772 chipset, which is listed in the hardware compatibility list.  It works fine and can be purchased from Amazon UK.


----------



## balanga (Jan 26, 2016)

How would I identify the chipset? I know the adapter works in Windows...


----------



## kpa (Jan 26, 2016)

Your best bet is to download the windows drivers from the manufacturer's website. Extract the drivers to a temporary directory and look at the file names, one of the .sys files will probably be named after the chipset used.


----------



## tobik@ (Jan 26, 2016)

balanga said:


> How would I identify the chipset? I know the adapter works in Windows...


Attach it to your FreeBSD machine and post the output of `usbconfig dump_device_desc`. If it's supported by FreeBSD the vendor and product id of the adapter are probably hard coded in the kernel's usbdevs.h and I can take a look. 

According to the Amazon reviews it has a RTL8153 chipset which should be supported by rue(4) or cdce(4).


----------



## balanga (Jan 26, 2016)

`usbconfig dump_device_desc` :-



```
ugen3.1: <EHCI root HUB Intel> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Intel>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen2.1: <UHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Intel>
  iProduct = 0x0002  <UHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen1.1: <UHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Intel>
  iProduct = 0x0002  <UHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Intel>
  iProduct = 0x0002  <UHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen3.2: <USB2.0 Hub VIA Labs, Inc.> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0210
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x2109
  idProduct = 0x2812
  bcdDevice = 0x9090
  iManufacturer = 0x0001  <VIA Labs, Inc.         >
  iProduct = 0x0002  <USB2.0 Hub             >
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen3.3: <product 0x1221 vendor 0x1997> at usbus3, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x1997
  idProduct = 0x1221
  bcdDevice = 0x0207
  iManufacturer = 0x0001  <retrieving string failed>
  iProduct = 0x0002  <retrieving string failed>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen3.4: <USB 101001000 LAN Realtek> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (180mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0210
  bDeviceClass = 0x0000
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0bda
  idProduct = 0x8153
  bcdDevice = 0x3000
  iManufacturer = 0x0001  <Realtek>
  iProduct = 0x0002  <USB 10/100/1000 LAN>
  iSerialNumber = 0x0006  <000001000000>
  bNumConfigurations = 0x0002
```


----------



## tingo (Jan 26, 2016)

Suggestion for next time:
1. run usbconfig
2. insert usb device
3. run usbconfig
3. dump device description for only the device in question. This step is accomplished by looking at the output from step 1 and step 3 and  notice which device has been added (ugenX.Y).
then run
`# usbconfig -d ugenX.Y dump_device_desc`
I hope this helps.


----------



## tobik@ (Jan 26, 2016)

balanga


balanga said:


> idVendor = 0x0bda idProduct = 0x8153


Your device indeed has a Realtek RTL8153 chipset. Here are the relevant entries from /usr/src/sys/dev/usb/usbdevs:


> vendor REALTEK          0x0bda  Realtek
> product REALTEK RTL8153         0x8153  RTL8153 USB Ethernet


Please run `usbconfig -d ugen3.4 dump_all_config_desc | grep -i binterface` as see if there is an output like:

```
bInterfaceClass = 0x0002
      bInterfaceSubClass = 0x0006
```
I think I see an entry for this in /etc/devd/usb.conf so the driver was maybe already loaded automatically. Do you see any output with `dmesg | grep ue0` or `ifconfig ue0`? If not try loading cdce(4) with `kldload if_cdce` and see if you get a ue0 device then.

This is on FreeBSD 10.2. I don't think FreeBSD 10.1 supports it.


----------



## balanga (Jan 26, 2016)

I guess I should upgrade to 10.2... I've never done an upgrade. Is it fairly straightforward?


----------



## tobik@ (Jan 26, 2016)

balanga said:


> I guess I should upgrade to 10.2... I've never done an upgrade. Is it fairly straightforward?


Sure, it's pretty straightforward. I haven't had a problem with it yet. Refer to the handbook on how to do it: https://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html#freebsdupdate-upgrade


----------



## balanga (Jan 27, 2016)

I've done the upgrade and the upgrade and my adapter does now work. Thanks for the help.

My problem now is to get that adapter working with pfSense, which unfortunately is based on FreeBSD 10.1.

Is there any way to get support for this adapter added separately into pfSense?


----------



## tingo (Jan 28, 2016)

You should probably ask pfSense questions in their forums, the probability of an answer would be much higher there.


----------



## balanga (Jan 29, 2016)

I guess what I'm asking is, how would I get a driver which works with FreeBSD 10.2 installed into 10.1?  Is this doable?


----------



## kpa (Jan 29, 2016)

Please ask this on the freebsd-net mailing list where the NIC driver experts hang around. It could though be as simple as copying of the 10.2 source files for the driver over the 10.1 source tree but there could have been changes that make it impossible to use the newer files as they are on 10.1. The other thing is that pfSense uses a heavily modified kernel and they might have local patches for the driver, this is why getting the driver backported to pfSense may require co-ordination between FreeBSD and pfSense devs.


----------

