Remove deprecated scan and set_probe_req_ie driver_ops

These have been replaced with scan2 driver_ops that provides all
parameters in a single call.
This commit is contained in:
Jouni Malinen 2009-11-23 21:13:46 +02:00 committed by Jouni Malinen
parent 4a867032ae
commit c2e8d0a092
18 changed files with 81 additions and 110 deletions

View file

@ -674,25 +674,6 @@ struct wpa_driver_ops {
*/
int (*set_countermeasures)(void *priv, int enabled);
/**
* scan - Request the driver to initiate scan (old version)
* @priv: private driver interface data
* @ssid: specific SSID to scan for (ProbeReq) or %NULL to scan for
* all SSIDs (either active scan with wildcard SSID or passive
* scan)
* @ssid_len: length of the SSID
*
* Returns: 0 on success, -1 on failure
*
* Once the scan results are ready, the driver should report scan
* results event for wpa_supplicant which will eventually request the
* results with wpa_driver_get_scan_results().
*
* This function is deprecated. New driver wrapper implementations
* should implement support for scan2().
*/
int (*scan)(void *priv, const u8 *ssid, size_t ssid_len);
/**
* get_scan_results - Fetch the latest scan results (old version)
* @priv: private driver interface data
@ -1041,15 +1022,6 @@ struct wpa_driver_ops {
*/
struct wpa_scan_results * (*get_scan_results2)(void *priv);
/**
* set_probe_req_ie - Set information element(s) for Probe Request
* @priv: private driver interface data
* @ies: Information elements to append or %NULL to remove extra IEs
* @ies_len: Length of the IE buffer in octets
* Returns: 0 on success, -1 on failure
*/
int (*set_probe_req_ie)(void *priv, const u8 *ies, size_t ies_len);
/**
* set_country - Set country
* @priv: Private driver interface data

View file

@ -420,10 +420,11 @@ static int wpa_driver_atmel_get_ssid(void *priv, u8 *ssid)
}
static int wpa_driver_atmel_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_atmel_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_atmel_data *drv = priv;
return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
return wpa_driver_wext_scan(drv->wext, params);
}
@ -488,7 +489,7 @@ const struct wpa_driver_ops wpa_driver_atmel_ops = {
.init = wpa_driver_atmel_init,
.deinit = wpa_driver_atmel_deinit,
.set_countermeasures = wpa_driver_atmel_set_countermeasures,
.scan = wpa_driver_atmel_scan,
.scan2 = wpa_driver_atmel_scan,
.get_scan_results2 = wpa_driver_atmel_get_scan_results,
.deauthenticate = wpa_driver_atmel_deauthenticate,
.disassociate = wpa_driver_atmel_disassociate,

View file

@ -400,11 +400,13 @@ static void wpa_driver_broadcom_scan_timeout(void *eloop_ctx,
wpa_supplicant_event(timeout_ctx, EVENT_SCAN_RESULTS, NULL);
}
static int wpa_driver_broadcom_scan(void *priv, const u8 *ssid,
size_t ssid_len)
static int wpa_driver_broadcom_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_broadcom_data *drv = priv;
wlc_ssid_t wst = { 0, "" };
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
if (ssid && ssid_len > 0 && ssid_len <= sizeof(wst.SSID)) {
wst.SSID_len = ssid_len;
@ -601,7 +603,7 @@ const struct wpa_driver_ops wpa_driver_broadcom_ops = {
.init = wpa_driver_broadcom_init,
.deinit = wpa_driver_broadcom_deinit,
.set_countermeasures = wpa_driver_broadcom_set_countermeasures,
.scan = wpa_driver_broadcom_scan,
.scan2 = wpa_driver_broadcom_scan,
.get_scan_results = wpa_driver_broadcom_get_scan_results,
.deauthenticate = wpa_driver_broadcom_deauthenticate,
.disassociate = wpa_driver_broadcom_disassociate,

View file

@ -1217,10 +1217,12 @@ wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg)
}
static int
wpa_driver_bsd_scan(void *priv, const u8 *ssid, size_t ssid_len)
wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan_params *params)
{
struct wpa_driver_bsd_data *drv = priv;
int flags;
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
/* NB: interface must be marked UP to do a scan */
if (getifflags(drv, &flags) != 0 || setifflags(drv, flags | IFF_UP) != 0)
@ -1523,7 +1525,7 @@ const struct wpa_driver_ops wpa_driver_bsd_ops = {
.get_ssid = wpa_driver_bsd_get_ssid,
.set_key = wpa_driver_bsd_set_key,
.set_countermeasures = wpa_driver_bsd_set_countermeasures,
.scan = wpa_driver_bsd_scan,
.scan2 = wpa_driver_bsd_scan,
.get_scan_results2 = wpa_driver_bsd_get_scan_results2,
.deauthenticate = wpa_driver_bsd_deauthenticate,
.disassociate = wpa_driver_bsd_disassociate,

View file

@ -1568,18 +1568,21 @@ wpa_driver_hostap_associate(void *priv,
}
static int wpa_driver_hostap_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_hostap_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_hostap_data *drv = priv;
struct prism2_hostapd_param param;
int ret;
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
if (ssid == NULL) {
/* Use standard Linux Wireless Extensions ioctl if possible
* because some drivers using hostap code in wpa_supplicant
* might not support Host AP specific scan request (with SSID
* info). */
return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
return wpa_driver_wext_scan(drv->wext, params);
}
if (ssid_len > 32)
@ -1730,7 +1733,7 @@ const struct wpa_driver_ops wpa_driver_hostap_ops = {
.get_bssid = wpa_driver_hostap_get_bssid,
.get_ssid = wpa_driver_hostap_get_ssid,
.set_countermeasures = wpa_driver_hostap_set_countermeasures,
.scan = wpa_driver_hostap_scan,
.scan2 = wpa_driver_hostap_scan,
.get_scan_results2 = wpa_driver_hostap_get_scan_results,
.deauthenticate = wpa_driver_hostap_deauthenticate,
.disassociate = wpa_driver_hostap_disassociate,

View file

@ -382,10 +382,11 @@ static int wpa_driver_ipw_get_ssid(void *priv, u8 *ssid)
}
static int wpa_driver_ipw_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_ipw_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_ipw_data *drv = priv;
return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
return wpa_driver_wext_scan(drv->wext, params);
}
@ -459,7 +460,7 @@ const struct wpa_driver_ops wpa_driver_ipw_ops = {
.get_ssid = wpa_driver_ipw_get_ssid,
.set_key = wpa_driver_ipw_set_key,
.set_countermeasures = wpa_driver_ipw_set_countermeasures,
.scan = wpa_driver_ipw_scan,
.scan2 = wpa_driver_ipw_scan,
.get_scan_results2 = wpa_driver_ipw_get_scan_results,
.deauthenticate = wpa_driver_ipw_deauthenticate,
.disassociate = wpa_driver_ipw_disassociate,

View file

@ -1387,6 +1387,8 @@ struct wpa_driver_madwifi_data {
};
static int wpa_driver_madwifi_set_auth_alg(void *priv, int auth_alg);
static int wpa_driver_madwifi_set_probe_req_ie(void *priv, const u8 *ies,
size_t ies_len);
static int
@ -1754,11 +1756,16 @@ wpa_driver_madwifi_set_auth_alg(void *priv, int auth_alg)
}
static int
wpa_driver_madwifi_scan(void *priv, const u8 *ssid, size_t ssid_len)
wpa_driver_madwifi_scan(void *priv, struct wpa_driver_scan_params *params)
{
struct wpa_driver_madwifi_data *drv = priv;
struct iwreq iwr;
int ret = 0;
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
wpa_driver_madwifi_set_probe_req_ie(drv, params->extra_ies,
params->extra_ies_len);
os_memset(&iwr, 0, sizeof(iwr));
os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
@ -1943,12 +1950,11 @@ const struct wpa_driver_ops wpa_driver_madwifi_ops = {
.init = wpa_driver_madwifi_init,
.deinit = wpa_driver_madwifi_deinit,
.set_countermeasures = wpa_driver_madwifi_set_countermeasures,
.scan = wpa_driver_madwifi_scan,
.scan2 = wpa_driver_madwifi_scan,
.get_scan_results2 = wpa_driver_madwifi_get_scan_results,
.deauthenticate = wpa_driver_madwifi_deauthenticate,
.disassociate = wpa_driver_madwifi_disassociate,
.associate = wpa_driver_madwifi_associate,
.set_operstate = wpa_driver_madwifi_set_operstate,
.set_probe_req_ie = wpa_driver_madwifi_set_probe_req_ie,
#endif /* HOSTAPD */
};

View file

@ -746,8 +746,9 @@ static void wpa_driver_ndis_scan_timeout(void *eloop_ctx, void *timeout_ctx)
}
static int wpa_driver_ndis_scan_native80211(struct wpa_driver_ndis_data *drv,
const u8 *ssid, size_t ssid_len)
static int wpa_driver_ndis_scan_native80211(
struct wpa_driver_ndis_data *drv,
struct wpa_driver_scan_params *params)
{
DOT11_SCAN_REQUEST_V2 req;
int res;
@ -765,13 +766,14 @@ static int wpa_driver_ndis_scan_native80211(struct wpa_driver_ndis_data *drv,
}
static int wpa_driver_ndis_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_ndis_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_ndis_data *drv = priv;
int res;
if (drv->native80211)
return wpa_driver_ndis_scan_native80211(drv, ssid, ssid_len);
return wpa_driver_ndis_scan_native80211(drv, params);
if (!drv->radio_enabled) {
wpa_printf(MSG_DEBUG, "NDIS: turning radio on before the first"
@ -3173,7 +3175,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
wpa_driver_ndis_deinit,
NULL /* set_param */,
NULL /* set_countermeasures */,
wpa_driver_ndis_scan,
NULL /* get_scan_results */,
wpa_driver_ndis_deauthenticate,
wpa_driver_ndis_disassociate,
@ -3198,13 +3199,12 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
NULL /* update_ft_ies */,
NULL /* send_ft_action */,
wpa_driver_ndis_get_scan_results,
NULL /* set_probe_req_ie */,
NULL /* set_country */,
NULL /* global_init */,
NULL /* global_deinit */,
NULL /* init2 */,
wpa_driver_ndis_get_interfaces,
NULL /* scan2 */,
wpa_driver_ndis_scan,
NULL /* authenticate */,
NULL /* set_beacon */,
NULL /* hapd_init */,

View file

@ -282,10 +282,11 @@ static int wpa_ndiswrapper_get_ssid(void *priv, u8 *ssid)
}
static int wpa_ndiswrapper_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_ndiswrapper_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_ndiswrapper_data *drv = priv;
return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
return wpa_driver_wext_scan(drv->wext, params);
}
@ -369,7 +370,7 @@ const struct wpa_driver_ops wpa_driver_ndiswrapper_ops = {
.get_bssid = wpa_ndiswrapper_get_bssid,
.get_ssid = wpa_ndiswrapper_get_ssid,
.scan = wpa_ndiswrapper_scan,
.scan2 = wpa_ndiswrapper_scan,
.get_scan_results2 = wpa_ndiswrapper_get_scan_results,
.init = wpa_ndiswrapper_init,
.deinit = wpa_ndiswrapper_deinit,

View file

@ -1363,10 +1363,11 @@ static int wpa_driver_prism54_get_ssid(void *priv, u8 *ssid)
}
static int wpa_driver_prism54_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_prism54_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_prism54_data *drv = priv;
return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
return wpa_driver_wext_scan(drv->wext, params);
}
@ -1447,7 +1448,7 @@ const struct wpa_driver_ops wpa_driver_prism54_ops = {
.get_bssid = wpa_driver_prism54_get_bssid,
.get_ssid = wpa_driver_prism54_get_ssid,
.set_countermeasures = wpa_driver_prism54_set_countermeasures,
.scan = wpa_driver_prism54_scan,
.scan2 = wpa_driver_prism54_scan,
.get_scan_results2 = wpa_driver_prism54_get_scan_results,
.deauthenticate = wpa_driver_prism54_deauthenticate,
.disassociate = wpa_driver_prism54_disassociate,

View file

@ -102,9 +102,12 @@ static int wpa_priv_cmd(struct wpa_driver_privsep_data *drv, int cmd,
}
static int wpa_driver_privsep_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_privsep_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_privsep_data *drv = priv;
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
wpa_printf(MSG_DEBUG, "%s: priv=%p", __func__, priv);
return wpa_priv_cmd(drv, PRIVSEP_CMD_SCAN, ssid, ssid_len,
NULL, NULL);
@ -757,7 +760,7 @@ struct wpa_driver_ops wpa_driver_privsep_ops = {
.init = wpa_driver_privsep_init,
.deinit = wpa_driver_privsep_deinit,
.set_param = wpa_driver_privsep_set_param,
.scan = wpa_driver_privsep_scan,
.scan2 = wpa_driver_privsep_scan,
.deauthenticate = wpa_driver_privsep_deauthenticate,
.disassociate = wpa_driver_privsep_disassociate,
.associate = wpa_driver_privsep_associate,

View file

@ -177,7 +177,7 @@ const struct wpa_driver_ops wpa_driver_ps3_ops = {
.desc = "PLAYSTATION3 Linux wireless extension driver",
.get_bssid = wpa_driver_wext_get_bssid,
.get_ssid = wpa_driver_wext_get_ssid,
.scan = wpa_driver_wext_scan,
.scan2 = wpa_driver_wext_scan,
.get_scan_results2 = wpa_driver_wext_get_scan_results,
.associate = wpa_driver_ps3_associate, /* PS3 */
.init = wpa_driver_wext_init,

View file

@ -1026,7 +1026,8 @@ static void wpa_driver_ralink_scan_timeout(void *eloop_ctx, void *timeout_ctx)
}
static int wpa_driver_ralink_scan(void *priv, const u8 *ssid, size_t ssid_len)
static int wpa_driver_ralink_scan(void *priv,
struct wpa_driver_scan_params *params)
{
struct wpa_driver_ralink_data *drv = priv;
struct iwreq iwr;
@ -1037,6 +1038,7 @@ static int wpa_driver_ralink_scan(void *priv, const u8 *ssid, size_t ssid_len)
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
#if 0
if (ssid_len > IW_ESSID_MAX_SIZE) {
wpa_printf(MSG_DEBUG, "%s: too long SSID (%lu)",
__FUNCTION__, (unsigned long) ssid_len);
@ -1044,6 +1046,7 @@ static int wpa_driver_ralink_scan(void *priv, const u8 *ssid, size_t ssid_len)
}
/* wpa_driver_ralink_set_ssid(drv, ssid, ssid_len); */
#endif
os_memset(&iwr, 0, sizeof(iwr));
os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
@ -1495,7 +1498,7 @@ const struct wpa_driver_ops wpa_driver_ralink_ops = {
.init = wpa_driver_ralink_init,
.deinit = wpa_driver_ralink_deinit,
.set_countermeasures = wpa_driver_ralink_set_countermeasures,
.scan = wpa_driver_ralink_scan,
.scan2 = wpa_driver_ralink_scan,
.get_scan_results = wpa_driver_ralink_get_scan_results,
.deauthenticate = wpa_driver_ralink_deauthenticate,
.disassociate = wpa_driver_ralink_disassociate,

View file

@ -1369,6 +1369,22 @@ static int wpa_driver_test_scan(void *priv,
size_t i;
wpa_printf(MSG_DEBUG, "%s: priv=%p", __func__, priv);
os_free(drv->probe_req_ie);
if (params->extra_ies) {
drv->probe_req_ie = os_malloc(params->extra_ies_len);
if (drv->probe_req_ie == NULL) {
drv->probe_req_ie_len = 0;
return -1;
}
os_memcpy(drv->probe_req_ie, params->extra_ies,
params->extra_ies_len);
drv->probe_req_ie_len = params->extra_ies_len;
} else {
drv->probe_req_ie = NULL;
drv->probe_req_ie_len = 0;
}
for (i = 0; i < params->num_ssids; i++)
wpa_hexdump(MSG_DEBUG, "Scan SSID",
params->ssids[i].ssid, params->ssids[i].ssid_len);
@ -2349,28 +2365,6 @@ static int wpa_driver_test_set_bssid(void *priv, const u8 *bssid)
}
static int wpa_driver_test_set_probe_req_ie(void *priv, const u8 *ies,
size_t ies_len)
{
struct wpa_driver_test_data *drv = priv;
os_free(drv->probe_req_ie);
if (ies) {
drv->probe_req_ie = os_malloc(ies_len);
if (drv->probe_req_ie == NULL) {
drv->probe_req_ie_len = 0;
return -1;
}
os_memcpy(drv->probe_req_ie, ies, ies_len);
drv->probe_req_ie_len = ies_len;
} else {
drv->probe_req_ie = NULL;
drv->probe_req_ie_len = 0;
}
return 0;
}
static void * wpa_driver_test_global_init(void)
{
struct wpa_driver_test_global *global;
@ -2519,7 +2513,6 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
.mlme_add_sta = wpa_driver_test_mlme_add_sta,
.mlme_remove_sta = wpa_driver_test_mlme_remove_sta,
.get_scan_results2 = wpa_driver_test_get_scan_results2,
.set_probe_req_ie = wpa_driver_test_set_probe_req_ie,
.global_init = wpa_driver_test_global_init,
.global_deinit = wpa_driver_test_global_deinit,
.init2 = wpa_driver_test_init2,

View file

@ -1088,18 +1088,17 @@ void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx)
/**
* wpa_driver_wext_scan - Request the driver to initiate scan
* @priv: Pointer to private wext data from wpa_driver_wext_init()
* @ssid: Specific SSID to scan for (ProbeReq) or %NULL to scan for
* all SSIDs (either active scan with wildcard SSID or passive
* scan)
* @ssid_len: Length of the SSID
* @param: Scan parameters (specific SSID to scan for (ProbeReq), etc.)
* Returns: 0 on success, -1 on failure
*/
int wpa_driver_wext_scan(void *priv, const u8 *ssid, size_t ssid_len)
int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params)
{
struct wpa_driver_wext_data *drv = priv;
struct iwreq iwr;
int ret = 0, timeout;
struct iw_scan_req req;
const u8 *ssid = params->ssids[0].ssid;
size_t ssid_len = params->ssids[0].ssid_len;
if (ssid_len > IW_ESSID_MAX_SIZE) {
wpa_printf(MSG_DEBUG, "%s: too long SSID (%lu)",
@ -2379,7 +2378,7 @@ const struct wpa_driver_ops wpa_driver_wext_ops = {
.get_ssid = wpa_driver_wext_get_ssid,
.set_key = wpa_driver_wext_set_key,
.set_countermeasures = wpa_driver_wext_set_countermeasures,
.scan = wpa_driver_wext_scan,
.scan2 = wpa_driver_wext_scan,
.get_scan_results2 = wpa_driver_wext_get_scan_results,
.deauthenticate = wpa_driver_wext_deauthenticate,
.disassociate = wpa_driver_wext_disassociate,

View file

@ -57,7 +57,7 @@ int wpa_driver_wext_set_key(const char *ifname, void *priv, wpa_alg alg,
const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
int wpa_driver_wext_scan(void *priv, const u8 *ssid, size_t ssid_len);
int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params);
struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv);
void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx);

View file

@ -75,10 +75,6 @@ static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s,
{
if (wpa_s->driver->scan2)
return wpa_s->driver->scan2(wpa_s->drv_priv, params);
if (wpa_s->driver->scan)
return wpa_s->driver->scan(wpa_s->drv_priv,
params->ssids[0].ssid,
params->ssids[0].ssid_len);
return -1;
}
@ -333,15 +329,6 @@ static inline int wpa_drv_send_ft_action(struct wpa_supplicant *wpa_s,
return -1;
}
static inline int wpa_drv_set_probe_req_ie(struct wpa_supplicant *wpa_s,
const u8 *ies, size_t ies_len)
{
if (wpa_s->driver->set_probe_req_ie)
return wpa_s->driver->set_probe_req_ie(wpa_s->drv_priv, ies,
ies_len);
return -1;
}
static inline int wpa_drv_set_beacon(struct wpa_supplicant *wpa_s,
const u8 *head, size_t head_len,
const u8 *tail, size_t tail_len,

View file

@ -191,11 +191,8 @@ int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
params->extra_ies_len);
ret = ieee80211_sta_req_scan(wpa_s, params->ssids[0].ssid,
params->ssids[0].ssid_len);
} else {
wpa_drv_set_probe_req_ie(wpa_s, params->extra_ies,
params->extra_ies_len);
} else
ret = wpa_drv_scan(wpa_s, params);
}
if (ret) {
wpa_supplicant_notify_scanning(wpa_s, 0);