Search code examples
macosdriverkernel-extension

TP-LINK WN722N Wireless USB device recognized as Ethernet device by macOS


I am developing a kernel extension (kext) for TP-WN722N-v1 because it is not supported. I managed to upload the firmware to the device, it is recognized by the system and, aparently, it is working with veeery basic support. I can find it under Networks in Settings panel, but it is recognized as an ethernet device, so I can not use it yet. Where should I start to make the system view it as a wireless interface? Did I inherited from the proper class?

My class start like this:

class TL_WN722N : public IOEthernetController

Solution

  • Apple's own Wifi drivers are based on the IO80211Controller class, which is a subclass of IOEthernetController.

    Screenshot of AppleBCMWLANCore node in IORegistryExplorer.app

    Unfortunately, this isn't a public KPI. There was at one point a "leaked" header file, and there have been some efforts to reverse engineer it by the Hackintosh crowd. I don't know if anyone has actually got a driver working based on that.

    Any manufacturer-provided 3rd party wifi drivers I've seen have skipped IO80211Controller and simply subclassed IOEthernetController directly, (re-)implementing any wifi-specific stuff directly in the driver. Any UI for selecting the SSID etc. will need to go through a custom App and can't use Apple's own wifi UI in the Network preference pane or in the menu bar icon. This is likely to be quite a lot of work, but it's definitely possible.

    Note that implementing USB network device drivers in kexts is deprecated as of macOS 10.15 Catalina, and any such kext will likely stop working in 10.16. You should be using DriverKit for targeting future versions of macOS.