Replace hostapd_wps_probe_req_rx() with more generic ProbeReq notifier
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 12 Jun 2009 14:31:43 +0000 (17:31 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jun 2009 14:31:43 +0000 (17:31 +0300)
The driver wrappers should not need to include wps_hostapd.h, so let's
make this easier by introducing a driver callback for reporting Probe
Request frames.

hostapd/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_atheros.c
src/drivers/driver_madwifi.c
src/drivers/driver_test.c

index 21187e5..8a7fcf9 100644 (file)
@@ -25,6 +25,7 @@
 #include "wpa.h"
 #include "iapp.h"
 #include "wme.h"
+#include "wps_hostapd.h"
 
 
 struct prune_data {
@@ -431,3 +432,10 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
        }
 }
 #endif /* CONFIG_AP */
+
+
+void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+                        const u8 *ie, size_t ie_len)
+{
+       hostapd_wps_probe_req_rx(hapd, sa, ie, ie_len);
+}
index 943d61c..2ae5b1a 100644 (file)
@@ -1766,5 +1766,7 @@ void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
 void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
 struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
                                          const u8 *addr);
+void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+                         const u8 *ie, size_t ie_len);
 
 #endif /* DRIVER_H */
index f1241f5..82237a6 100644 (file)
@@ -685,7 +685,7 @@ static void madwifi_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
        ie = mgmt->u.probe_req.variable;
        ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
 
-       hostapd_wps_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
+       hostapd_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
 }
 #endif /* CONFIG_WPS */
 
index 191fd31..6c040aa 100644 (file)
@@ -71,7 +71,6 @@
 #include "l2_packet/l2_packet.h"
 #include "../../hostapd/hostapd.h"
 #include "../../hostapd/config.h"
-#include "../../hostapd/wps_hostapd.h"
 #include "../../hostapd/sta_flags.h"
 
 
@@ -778,7 +777,7 @@ static void madwifi_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
        ie = mgmt->u.probe_req.variable;
        ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
 
-       hostapd_wps_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
+       hostapd_probe_req_rx(drv->hapd, mgmt->sa, ie, ie_len);
 }
 #endif /* IEEE80211_IOCTL_FILTERFRAME */
 #endif /* CONFIG_WPS */
index dbb0edb..ff4da08 100644 (file)
@@ -40,7 +40,6 @@
 #include "../../hostapd/hostapd.h"
 #include "../../hostapd/wpa.h"
 #include "../../hostapd/hw_features.h"
-#include "../../hostapd/wps_hostapd.h"
 
 
 struct test_client_socket {
@@ -415,7 +414,7 @@ static void test_driver_scan(struct test_driver_data *drv,
                           MAC2STR(sa));
                wpa_hexdump(MSG_MSGDUMP, "test_driver: scan IEs", ie, ielen);
 
-               hostapd_wps_probe_req_rx(drv->hapd, sa, ie, ielen);
+               hostapd_probe_req_rx(drv->hapd, sa, ie, ielen);
        }
 
        for (bss = drv->bss; bss; bss = bss->next) {