diff options
author | Adham Abozaeid <adham.abozaeid@microchip.com> | 2019-06-20 19:54:55 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-21 16:49:04 +0200 |
commit | f5a3cb90b802da2dee8bc1dc39339b6521c33652 (patch) | |
tree | c1b1ca25ecb4ed3c42bf335d2ee8665050d0f8a4 /drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | |
parent | b43f6a60e2718058675f7fcd681b96be2bdedbeb (diff) |
staging: wilc1000: add passive scan support
Add passive scan support to the driver by passing the scan type to the
HW and configure the HW scan time if configured by the cfg80211.
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_wfi_cfgoperations.c')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index f6825727bf77..b0daa1136663 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -221,6 +221,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) u32 i; int ret = 0; u8 scan_ch_list[WILC_MAX_NUM_SCANNED_CH]; + u8 scan_type; if (request->n_channels > WILC_MAX_NUM_SCANNED_CH) { netdev_err(priv->dev, "Requested scanned channels over\n"); @@ -235,9 +236,14 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) scan_ch_list[i] = ieee80211_frequency_to_channel(freq); } - ret = wilc_scan(vif, WILC_FW_USER_SCAN, WILC_FW_ACTIVE_SCAN, - scan_ch_list, request->n_channels, cfg_scan_result, - (void *)priv, request); + if (request->n_ssids) + scan_type = WILC_FW_ACTIVE_SCAN; + else + scan_type = WILC_FW_PASSIVE_SCAN; + + ret = wilc_scan(vif, WILC_FW_USER_SCAN, scan_type, scan_ch_list, + request->n_channels, cfg_scan_result, (void *)priv, + request); if (ret) { priv->scan_req = NULL; |