staging: wilc1000: Connect to highest RSSI value for required SSID
authorAditya Shankar <aditya.shankar@microchip.com>
Mon, 9 Jan 2017 06:12:15 +0000 (11:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Jan 2017 16:37:25 +0000 (17:37 +0100)
commit05a157403cb09ac32f70d77532e923fbfb39eb03
tree4d36b6e345a29accf39b4cb56d8d951992ada970
parentf631a9704833b291cb88c6dda4230a2e68354eb6
staging: wilc1000: Connect to highest RSSI value for required SSID

Connect to the highest rssi with the required SSID in the shadow
table if the connection criteria is based only on the SSID.
For the first matching SSID, an index to the table is saved.
Later the index is updated if matching SSID has a higher
RSSI value than the last saved index.

However if decision is made based on BSSID, there is only one match
in the table and corresponding index is used.

changes in v2:
initialize sel_bssi_idx to UINT_MAX.
Combine two checks for identifying
sel_bssi_idx value for a SSID.

Signed-off-by: Aditya Shankar <aditya.shankar@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c