#include "../hostapd/hostapd.h"
#include "../hostapd/config.h"
#include "../hostapd/driver.h"
+#ifdef NEED_MLME
+#include "../hostapd/ieee802_11.h"
+#endif /* NEED_MLME */
#include "eap_common/eap_defs.h"
#include "eap_server/eap_methods.h"
#include "eap_common/eap_wsc_common.h"
static void * ap_driver_init(struct hostapd_data *hapd)
{
struct ap_driver_data *drv;
+ struct wpa_supplicant *wpa_s = hapd->iface->owner;
drv = os_zalloc(sizeof(struct ap_driver_data));
if (drv == NULL) {
return NULL;
}
drv->hapd = hapd;
+ os_memcpy(hapd->own_addr, wpa_s->own_addr, ETH_ALEN);
return drv;
}
static int ap_driver_send_mgmt_frame(void *priv, const void *data, size_t len,
int flags)
{
- wpa_printf(MSG_DEBUG, "AP TODO: %s", __func__);
- return -1;
+ struct ap_driver_data *drv = priv;
+ struct wpa_supplicant *wpa_s = drv->hapd->iface->owner;
+ return wpa_drv_send_mlme(wpa_s, data, len);
}
hostapd_interface_deinit(wpa_s->ap_iface);
wpa_s->ap_iface = NULL;
}
+
+
+void ap_tx_status(void *ctx, const u8 *addr,
+ const u8 *buf, size_t len, int ack)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+ hostapd_tx_status(wpa_s->ap_iface->bss[0], addr, buf, len, ack);
+}
+
+
+void ap_rx_from_unknown_sta(void *ctx, const u8 *addr)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+ ap_rx_from_unknown_sta(wpa_s->ap_iface->bss[0], addr);
+}
+
+
+#ifdef NEED_MLME
+void ap_mgmt_rx(void *ctx, u8 *buf, size_t len, u16 stype,
+ struct hostapd_frame_info *fi)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+ ieee802_11_mgmt(wpa_s->ap_iface->bss[0], buf, len, stype, fi);
+}
+
+
+void ap_mgmt_tx_cb(void *ctx, u8 *buf, size_t len, u16 stype, int ok)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+ ieee802_11_mgmt_cb(wpa_s->ap_iface->bss[0], buf, len, stype, ok);
+}
+#endif /* NEED_MLME */