Porting a WiFi Driver
To win this bet I have with Ed I need a WiFi adapter that can do 80211n in the 5GHz band. There aren't a lot of these around and n in 2.4GHz band makes it hard to find adapters with the right support.
I got pair of AC600 generic adapters on ebay for about a tenner, a quick look showed promising Linux support. This indicated I could use one for the bet without too much hassle.
I got a second so I could work on a wireless driver for FreeBSD, what else am I to do with my time?
The adapter is a MediaTek MT7610U device, there is a whole load of information about it on Wikidevi and there are a family of forks of the vendor code on github.
Wikidevi says the MT7610U is similar to the RT28xx series , which are supported by run in FreeBSD. I started last night by taking the run driver, getting it to build as a module, then turning everything off apart from probe, attach and detach.
This is the first time I have tried to port a driver, to help I collated everything I could find written about doing it.
There is straight up FreeBSD stuff:
- http://adrianchadd.blogspot.co.uk/2015/09/porting-wifi-driver-from-openbsd-ar9170.html
- https://people.freebsd.org/~jmg/drivers
- https://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/
There are load of little posts where people have ported drivers from FreeBSD to somewhere else:
- https://wiki.smartos.org/display/DOC/Porting+Network+Device+Drivers+from+FreeBSD
- http://cnds.eecs.jacobs-university.de/archive/bsc-2011-pvaibhav.pdf
- https://www.dan.me.uk/blog/2010/01/25/ndis-wifi-drivers-in-freebsd-project-evil/
- http://www.netbsd.org/docs/kernel/porting-freebsd-net.html
- http://stackoverflow.com/questions/32156173/porting-pcie-driver-from-linux-to-freebsd
And there are a load of articles about building wifi drivers for android, these are worth read, but they are worth pointing out:
- http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html
- https://community.nxp.com/docs/DOC-93603
- https://befinitiv.wordpress.com/2015/04/18/porting-wifibroadcast-to-android/
Reading: Little Brother
I had an argument with some Germans about the pronunciation of WiFi, apparently it is WeeFii using the sounds of wireless and fidelity. They also pronounced HiFi incorrectly, English is a strange language.