Replace wpa_supplicant_sta_rx() call with driver event

Get rid of wpa_supplicant_sta_rx() and add a new driver event that is
marked to be used only with driver_test.c. In addition, remove this
functionality from privsep wrapper. This is only use for client mode
MLME testing with driver_test.c.
This commit is contained in:
Jouni Malinen 2010-01-03 11:50:26 +02:00
parent 7d7d57b2dc
commit 245519e0cd
8 changed files with 44 additions and 73 deletions

View file

@ -70,7 +70,6 @@ enum privsep_event {
PRIVSEP_EVENT_STKSTART,
PRIVSEP_EVENT_FT_RESPONSE,
PRIVSEP_EVENT_RX_EAPOL,
PRIVSEP_EVENT_STA_RX,
};
#endif /* PRIVSEP_COMMANDS_H */

View file

@ -404,12 +404,6 @@ struct wpa_driver_capa {
};
struct ieee80211_rx_status {
int channel;
int ssi;
};
struct hostapd_data;
struct hostap_sta_driver_data {
@ -1724,7 +1718,14 @@ typedef enum wpa_event_type {
/**
* EVENT_RX_MGMT - Report RX of a management frame
*/
EVENT_RX_MGMT
EVENT_RX_MGMT,
/**
* EVENT_MLME_RX - Report reception of frame for MLME (test use only)
*
* This event is used only by driver_test.c and userspace MLME.
*/
EVENT_MLME_RX
} wpa_event_type;
@ -1966,6 +1967,17 @@ union wpa_event_data {
struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
size_t num_ssids;
} scan_info;
/**
* struct mlme_rx - Data for EVENT_MLME_RX events
*/
struct mlme_rx {
const u8 *buf;
size_t len;
int freq;
int channel;
int ssi;
} mlme_rx;
};
/**
@ -1998,9 +2010,6 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
const u8 *buf, size_t len);
void wpa_supplicant_sta_rx(void *ctx, const u8 *buf, size_t len,
struct ieee80211_rx_status *rx_status);
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie);
const u8 * wpa_scan_get_vendor_ie(const struct wpa_scan_res *res,
u32 vendor_type);

View file

@ -438,22 +438,6 @@ static void wpa_driver_privsep_event_rx_eapol(void *ctx, u8 *buf, size_t len)
}
static void wpa_driver_privsep_event_sta_rx(void *ctx, u8 *buf, size_t len)
{
#ifdef CONFIG_CLIENT_MLME
struct ieee80211_rx_status *rx_status;
if (len < sizeof(*rx_status))
return;
rx_status = (struct ieee80211_rx_status *) buf;
buf += sizeof(*rx_status);
len -= sizeof(*rx_status);
wpa_supplicant_sta_rx(ctx, buf, len, rx_status);
#endif /* CONFIG_CLIENT_MLME */
}
static void wpa_driver_privsep_receive(int sock, void *eloop_ctx,
void *sock_ctx)
{
@ -530,10 +514,6 @@ static void wpa_driver_privsep_receive(int sock, void *eloop_ctx,
wpa_driver_privsep_event_rx_eapol(drv->ctx, event_buf,
event_len);
break;
case PRIVSEP_EVENT_STA_RX:
wpa_driver_privsep_event_sta_rx(drv->ctx, event_buf,
event_len);
break;
}
os_free(buf);

View file

@ -1790,11 +1790,11 @@ static void wpa_driver_test_mlme(struct wpa_driver_test_data *drv,
socklen_t fromlen,
const u8 *data, size_t data_len)
{
#ifdef CONFIG_CLIENT_MLME
struct ieee80211_rx_status rx_status;
os_memset(&rx_status, 0, sizeof(rx_status));
wpa_supplicant_sta_rx(drv->ctx, data, data_len, &rx_status);
#endif /* CONFIG_CLIENT_MLME */
union wpa_event_data event;
os_memset(&event, 0, sizeof(event));
event.mlme_rx.buf = data;
event.mlme_rx.len = data_len;
wpa_supplicant_event(drv->ctx, EVENT_MLME_RX, &event);
}