Add NetBSD Support for AboCom RTL8188EU

I’m running Linux. Follow the instructions from Cross building NetBSD on Linux:

===> Successful make release
===> build.sh ended: Fri Nov 4 12:38:00 EDT 2016
===> Summary of results:
build.sh command: ./build.sh -U -u -m amd64 release
build.sh started: Fri Nov 4 10:17:30 EDT 2016
NetBSD version: 7.0.2
MACHINE: amd64
MACHINE_ARCH: x86_64
Build platform: Linux 4.8.6-1-ARCH x86_64
HOST_SH: /usr/bin/sh
MAKECONF file: /etc/mk.conf (File not found)
TOOLDIR path: /home/sinetek/dev/building-netbsd/usr/src/obj/tooldir.Linux-4.8.6-1-ARCH-x86_64
DESTDIR path: /home/sinetek/dev/building-netbsd/usr/src/obj/destdir.amd64
RELEASEDIR path: /home/sinetek/dev/building-netbsd/usr/src/obj/releasedir
Updated makewrapper: /home/sinetek/dev/building-netbsd/usr/src/obj/tooldir.Linux-4.8.6-1-ARCH-x86_64/bin/nbmake-amd64
Successful make release
build.sh ended: Fri Nov 4 12:38:00 EDT 2016
===> .

Then we build a custom configuration file for the kernel.
Drat. The config file for GENERIC already includes urtwn.
Let’s see what we can do poking around. Let’s grab the device id from Linux.

$ lsusb
Bus 001 Device 009: ID 07b8:8179 AboCom Systems Inc

Let’s poke around the driver. I found something interesting in if_urtwn.c.
From /sys/dev/usb/usbdevs.h I see that the constants I want are ABOCOM, and REALTEK RTL8188EU.
Let’s add these in.

diff –git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c
index 379365e..3294e54 100644
— a/sys/dev/usb/if_urtwn.c
+++ b/sys/dev/usb/if_urtwn.c
@@ -167,6 +167,7 @@ static const struct urtwn_dev {
URTWN_RTL8188E_DEV(ELECOM, WDC150SU2M),
URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV),
URTWN_RTL8188E_DEV(REALTEK, RTL8188EU),
+ URTWN_RTL8188E_DEV(ABOCOM, RTL8188EU),
};
#undef URTWN_DEV
#undef URTWN_RTL8188E_DEV

… and the usbdevs:

diff –git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index bfe82a2..1bc213f 100644
— a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -640,6 +640,7 @@ product ABOCOM XX9 0x4104 XX9
product ABOCOM UFE2000 0x420a UFE2000 USB2.0 Fast Ethernet Adapter
product ABOCOM WL54 0x6001 WL54
product ABOCOM RTL8192CU 0x8178 RTL8192CU
+product ABOCOM RTL8188EU 0x8179 RTL8188EU
product ABOCOM RTL8188CU_1 0x8188 RTL8188CU
product ABOCOM RTL8188CU_2 0x8189 RTL8188CU
product ABOCOM XX10 0xabc1 XX10

Regenerate the correct usb dev headers.

$ TOOL_AWK=awk bmake -f Makefile.usbdevs usbdevs.h

Rebuild the kernel, then rebuild the iso image:

./build.sh -U -u -m amd64 release
./build.sh -U -u -m amd64 iso-image

Test. Mad Success!!

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