The following patch fixes issues with AP scanning.
Notes: Some document on the net claims that there should be at least 6
second gap between when scanning is issued and when list is
obtained. So, now scannig is now done with a timer (at 10 second
There was a bug in earlier mode detection in ndis_translate_scan:
instead of using mode, net_type was being used.
Now protocol detection is also supported. However, even the 802.11g
routers present themselves as 802.11a (probably because of
key_len and timer are initialized in ndis_init_one instead of
setup_dev, so all setup is in ndis_init_one and cleanup (e.g.,
del_timer) is in ndis_remove_one.
Apparently the BSSID_LIST OID fails if there is not enough space for
all the APs available. So the number of items in the list is increased
to 10 (MAX_SCAN_LIST_ITEMS). (It took me nearly whole day to find it
out the hard way.) If there is not enough space, an error is issued
Hopefully this is all that is needed.