1. Apple80211Monitor == tamed

    YES!

    Found the incredibly arcane issue and now the problem I mentioned in my last post is fixed. Every wireless device needs to create an entry under /dev which is automatically done by the devfs system. The name of this entry must be less than 32 characters. Apple’s 802.11 system queries the driver for this status device name but I had no idea of the limitations in its naming. After I noticed a message in the logs saying that devfs had failed to create the “name slot,” I searched the XNU kernel sources to look for the error and lo - there was the problem. Changed the status device name to something short and now everything works. No more CPU-gobbling configd!

    What does it mean for end users? It means the driver is now 100% compatible with Airport — automatic connection to networks, suspend/resume support, display of association status and signal strength in the icon etc etc. The ‘slow transfer’ problem is also gone.

    The one last thing I have not managed to fix yet is WEP support. There are two problems with that -

    1. No matter what is selected in OS X configuration options, the OS always sends the WEP password as gibberish, and says that the key length is 128-bit WEP with shared-key authentication. This is totally wrong as my test network uses 64-bit key with open authentication! I have no idea how to get around this.

    2. Hardware WEP decryption is working well for received packets. But transmitted packets are not getting encrypted by the card. Every combination of tx descriptor options leads to a firmware error (system assert failure), and the one combination which works (and which is used in Linux driver) doesn’t encrypt the packet at all. If I don’t manage to get this working I’ll have to implement software WEP encryption, so only half of the packets (the received ones) will be handled by hardware, the other half will be handled by the computer’s CPU.

    Oh by the way I also added LED support. So now the LED blinks when packets are being transmitted or received. When no packets are flowing, the LED blinks in “heartbeat” style every few seconds to let you know we’re still associated (i.e. beacon frames are being received). I borrowed this idea from the incredibly well-written FreeBSD iwi driver.

    Now with almost everything working except WEP tx and WPA, the driver is still under 3500 lines of source code, just a bit behind FreeBSD’s 4k lines. (compare that with Linux’s 15000+ lines for the same thing..)