If you run networksetup and do a -listallhardwareports in OS X Snow Leopard, you’ll see that the Hardware Port: for en0 (on an MBA at least, but you should get the point even if it’s a MacPro) is AirPort. If you run the same command in Lion, you’ll notice the the hardware port is now Wi-Fi.
This change cascades to any commands like -listpreferredwirelessnetworks where the hardware port might get called on. For most of my scripts for assigning AirPort networks, etc I was able to mostly just find-and-replace AirPort for Wi-Fi, provided I didn’t use AirPort anywhere else (e.g.$AirPort, etc).




Archive
4 Comments
Wi-Fi currently does not work as a hardware port, networksetup is broken.
It will only take en1 (or en0 for airs) as a valid wireless nic.
I have a bug report in for that and preferred at index not working.
That explains some issues I was having with a script. I filed an additional report to hopefully get it some more attention…
We can detect the device with this line:
/usr/sbin/networksetup -listallhardwareports | grep -A 1 Wi-Fi | grep Device | cut -c 9-12
Nice. Thanks Søren!