Node reference counting looks broken due to the confusion between node references and node memory allocation/deallocation. Also, we seem to be holding some faux references to maintain the nodes' presence when authenticated and/or associated.
I have added a spin lock to each individual node to protect its reference count. Each node table also has a seperate lock. I have also rehashed the internal node allocation and external node join/leave functions. Thus the node AREF has been removed.
This update significantly changes the interface of ieee80211_free_node() -> ieee80211_unref_node(), and I will probably propose some other general API changes when passing references around to clarify things, if this patch's approach is condoned.
This is not a clean patch as I've buggered up some comments, and made some minor code changes that should not be in the patch. No prizes for spotting where.