driver_nl80211: Add support for multi-SSID scan requests

This commit is contained in:
Jouni Malinen 2009-02-14 21:17:46 +02:00
parent e76baaac0c
commit 6a1063e008
2 changed files with 14 additions and 13 deletions

View file

@ -1683,17 +1683,16 @@ static void wpa_driver_nl80211_scan_timeout(void *eloop_ctx, void *timeout_ctx)
/** /**
* wpa_driver_nl80211_scan - Request the driver to initiate scan * wpa_driver_nl80211_scan - Request the driver to initiate scan
* @priv: Pointer to private wext data from wpa_driver_nl80211_init() * @priv: Pointer to private wext data from wpa_driver_nl80211_init()
* @ssid: Specific SSID to scan for (ProbeReq) or %NULL to scan for * @params: Scan parameters
* all SSIDs (either active scan with broadcast SSID or passive
* scan
* @ssid_len: Length of the SSID
* Returns: 0 on success, -1 on failure * Returns: 0 on success, -1 on failure
*/ */
static int wpa_driver_nl80211_scan(void *priv, const u8 *ssid, size_t ssid_len) static int wpa_driver_nl80211_scan(void *priv,
struct wpa_driver_scan_params *params)
{ {
struct wpa_driver_nl80211_data *drv = priv; struct wpa_driver_nl80211_data *drv = priv;
int ret = 0, timeout; int ret = 0, timeout;
struct nl_msg *msg, *ssids; struct nl_msg *msg, *ssids;
size_t i;
msg = nlmsg_alloc(); msg = nlmsg_alloc();
ssids = nlmsg_alloc(); ssids = nlmsg_alloc();
@ -1708,14 +1707,12 @@ static int wpa_driver_nl80211_scan(void *priv, const u8 *ssid, size_t ssid_len)
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex); NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
if (ssid && ssid_len) { for (i = 0; i < params->num_ssids; i++) {
/* Request an active scan for a specific SSID */ NLA_PUT(ssids, i + 1, params->ssids[i].ssid_len,
NLA_PUT(ssids, 1, ssid_len, ssid); params->ssids[i].ssid);
} else {
/* Request an active scan for wildcard SSID */
NLA_PUT(ssids, 1, 0, "");
} }
nla_put_nested(msg, NL80211_ATTR_SCAN_SSIDS, ssids); if (params->num_ssids)
nla_put_nested(msg, NL80211_ATTR_SCAN_SSIDS, ssids);
ret = send_and_recv_msgs(drv, msg, NULL, NULL); ret = send_and_recv_msgs(drv, msg, NULL, NULL);
msg = NULL; msg = NULL;
@ -2791,7 +2788,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.set_key = wpa_driver_nl80211_set_key, .set_key = wpa_driver_nl80211_set_key,
.set_countermeasures = wpa_driver_nl80211_set_countermeasures, .set_countermeasures = wpa_driver_nl80211_set_countermeasures,
.set_drop_unencrypted = wpa_driver_nl80211_set_drop_unencrypted, .set_drop_unencrypted = wpa_driver_nl80211_set_drop_unencrypted,
.scan = wpa_driver_nl80211_scan, .scan2 = wpa_driver_nl80211_scan,
.get_scan_results2 = wpa_driver_nl80211_get_scan_results, .get_scan_results2 = wpa_driver_nl80211_get_scan_results,
.deauthenticate = wpa_driver_nl80211_deauthenticate, .deauthenticate = wpa_driver_nl80211_deauthenticate,
.disassociate = wpa_driver_nl80211_disassociate, .disassociate = wpa_driver_nl80211_disassociate,

View file

@ -8,6 +8,10 @@ ChangeLog for wpa_supplicant
* allow multiple driver wrappers to be specified on command line * allow multiple driver wrappers to be specified on command line
(e.g., -Dnl80211,wext); the first one that is able to initialize the (e.g., -Dnl80211,wext); the first one that is able to initialize the
interface will be used interface will be used
* added support for multiple SSIDs per scan request to optimize
scan_ssid=1 operations in ap_scan=1 mode (i.e., search for hidden
SSIDs); this requires driver support and can currently be used only
with nl80211
2009-01-06 - v0.6.7 2009-01-06 - v0.6.7
* added support for Wi-Fi Protected Setup (WPS) * added support for Wi-Fi Protected Setup (WPS)