Browse Source

Replace direct driver call to wpa_ft_rrb_rx() with driver event

This avoids need to include hostapd/wpa.h into the driver wrappers.
Jouni Malinen 15 years ago
parent
commit
08fd8c15a0
3 changed files with 25 additions and 6 deletions
  1. 5 0
      hostapd/drv_callbacks.c
  2. 15 1
      src/drivers/driver.h
  3. 5 5
      src/drivers/driver_test.c

+ 5 - 0
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;

+ 15 - 1
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;
 };
 
 /**

+ 5 - 5
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 */
 }