How can I use a TP-LINK WiFi USB interface in OS X Lion? I happen to have a TP-LINK TL-WN821N (it's a WiFi USB stick) around. Is there any chance to get that working on a Mac mini running OS X Lion?

There are no official drivers but it seems there are some kind of drivers for the ATHEROS AR9170+AR9102 chipset from other vendors like Ralink.
Update: The below hack worked when using D-Link's DWA-130 Rev. D drivers instead of the DWA-160 ones. Compatible drivers using the same chipset were identified with the help of the WikiDevi database.



A quick Google search shows that someone has had success in using D-Links DWA-160 driver (which uses the same chipset), although not without some minor hacking to make the driver recognize the different hardware IDs:


Install driver package
Extract kernel extension from installer:


Show Package Contents of the installer
unarchive Archive.pax.gz
grab AtherosOtusMac.kext

Edit plist and change or add your device id and product id converted to decimal (illustrated below):


Show Package Contents of AtherosOtusMac.kext
Open Info.plist within (using either Xcode or a text or XML editor)
Open System Information, find your TP-Link under USB and note down Product ID and Vendor ID
Convert both numbers from hexadecimal to decimal (you can use Calculator.app)
Replace idProduct and idVendor on the first model with your numbers

Use kext helper to install your modified AtherosOtusMac.kext
use DWA-160.app (in /Applications/Utilies) to connect


Although considering the price of a new Wifi USB stick with OS X drivers, this may not be worth the effort, unless you're doing this sort of thing for fun :-)

Illustration of the plist step (with my USB mouse as example, because I don't have a TL-WN821N laying around):