From 08fd8c15a0eee9d29535264d8d350e7132e8121e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 12 Dec 2009 22:43:26 +0200 Subject: [PATCH] Replace direct driver call to wpa_ft_rrb_rx() with driver event This avoids need to include hostapd/wpa.h into the driver wrappers. --- hostapd/drv_callbacks.c | 5 +++++ src/drivers/driver.h | 16 +++++++++++++++- src/drivers/driver_test.c | 10 +++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/hostapd/drv_callbacks.c b/hostapd/drv_callbacks.c index af9c4c8b0..db6b19f4b 100644 --- a/hostapd/drv_callbacks.c +++ b/hostapd/drv_callbacks.c @@ -466,6 +466,11 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event, if (hapd->iface->scan_cb) hapd->iface->scan_cb(hapd->iface); break; +#ifdef CONFIG_IEEE80211R + wpa_ft_rrb_rx(hapd->wpa_auth, data->ft_rrb_rx.src, + data->ft_rrb_rx.data, data->ft_rrb_rx.data_len); + break; +#endif /* CONFIG_IEEE80211R */ default: wpa_printf(MSG_DEBUG, "Unknown event %d", event); break; diff --git a/src/drivers/driver.h b/src/drivers/driver.h index c889ba9f3..4825cb550 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1681,7 +1681,12 @@ typedef enum wpa_event_type { /** * EVENT_ASSOC_TIMED_OUT - Association timed out */ - EVENT_ASSOC_TIMED_OUT + EVENT_ASSOC_TIMED_OUT, + + /** + * EVENT_FT_RRB_RX - FT (IEEE 802.11r) RRB frame received + */ + EVENT_FT_RRB_RX } wpa_event_type; @@ -1863,6 +1868,15 @@ union wpa_event_data { struct timeout_event { u8 addr[ETH_ALEN]; } timeout_event; + + /** + * struct ft_rrb_rx - Data for EVENT_FT_RRB_RX events + */ + struct ft_rrb_rx { + const u8 *src; + const u8 *data; + size_t data_len; + } ft_rrb_rx; }; /** diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c index c6147a650..787ae9530 100644 --- a/src/drivers/driver_test.c +++ b/src/drivers/driver_test.c @@ -35,7 +35,6 @@ #include "common/ieee802_11_defs.h" #include "../../hostapd/hostapd.h" -#include "../../hostapd/wpa.h" struct test_client_socket { @@ -744,10 +743,11 @@ static void test_driver_ether(struct wpa_driver_test_data *drv, #ifdef CONFIG_IEEE80211R if (be_to_host16(eth->h_proto) == ETH_P_RRB) { -#ifdef HOSTAPD - wpa_ft_rrb_rx(drv->hapd->wpa_auth, eth->h_source, - data + sizeof(*eth), datalen - sizeof(*eth)); -#endif /* HOSTAPD */ + union wpa_event_data ev; + os_memset(&ev, 0, sizeof(ev)); + ev.ft_rrb_rx.src = eth->h_source; + ev.ft_rrb_rx.data = data + sizeof(*eth); + ev.ft_rrb_rx.data_len = datalen - sizeof(*eth); } #endif /* CONFIG_IEEE80211R */ }