Add NetBSD Support for AboCom RTL8188EU

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

===> Successful make release
===> ended: Fri Nov 4 12:38:00 EDT 2016
===> Summary of results: command: ./ -U -u -m amd64 release started: Fri Nov 4 10:17:30 EDT 2016
NetBSD version: 7.0.2
MACHINE: amd64
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 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 {
#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:

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

Test. Mad Success!!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s