rndis_wlan: scanning, workaround device returning incorrect bssid-list item count.
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Tue, 21 Dec 2010 20:44:05 +0000 (22:44 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Dec 2010 20:43:30 +0000 (15:43 -0500)
commitbfe3850b0cfca6ba64395e2705d9a51cd044f374
treef7a0a8c14ae3a55ba42d3361aa8d038ec1630870
parentab72efdf107e5b0e0a05efb8f24cc6c598ae31ea
rndis_wlan: scanning, workaround device returning incorrect bssid-list item count.

Sometimes device returns wrong number of items in bssid-list. Appears that
some specific beacons trigger this problem and leads to very poor scanning
results. Workaround by ignoring num_items received from device and walkthrough
full bssid-list buffer.

v2: Fix buffer range checks and reading next item length. Old code read
    behind buffer on last item but didn't use those values as 'count' would
    also reach zero. Also fix resizing of buffer if device has larger buffer,
    old code assumed that BSSID-list OID would return same buffer size
    when it really can return yet another new larger length.

Tested-by: Luís Picciochi <Pitxyoki@gmail.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rndis_wlan.c