Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / drivers / driver_roboswitch.c
index bc11a48..0a9078a 100644 (file)
@@ -2,31 +2,21 @@
  * WPA Supplicant - roboswitch driver interface
  * Copyright (c) 2008-2009 Jouke Witteveen
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include "includes.h"
 #include <sys/ioctl.h>
-#include <linux/if.h>
 #include <linux/sockios.h>
 #include <linux/if_ether.h>
 #include <linux/mii.h>
+#include <net/if.h>
 
 #include "common.h"
 #include "driver.h"
 #include "l2_packet/l2_packet.h"
 
-#ifndef ETH_P_EAPOL
-#define ETH_P_EAPOL            0x888e
-#endif
-
 #define ROBO_PHY_ADDR          0x1e    /* RoboSwitch PHY address */
 
 /* MII access registers */
@@ -183,10 +173,8 @@ static void wpa_driver_roboswitch_receive(void *priv, const u8 *src_addr,
        struct wpa_driver_roboswitch_data *drv = priv;
 
        if (len > 14 && WPA_GET_BE16(buf + 12) == ETH_P_EAPOL &&
-           os_memcmp(buf, drv->own_addr, ETH_ALEN) == 0) {
-               wpa_supplicant_rx_eapol(drv->ctx, src_addr, buf + 14,
-                                       len - 14);
-       }
+           os_memcmp(buf, drv->own_addr, ETH_ALEN) == 0)
+               drv_event_eapol_rx(drv->ctx, src_addr, buf + 14, len - 14);
 }
 
 
@@ -205,6 +193,15 @@ static int wpa_driver_roboswitch_get_bssid(void *priv, u8 *bssid)
 }
 
 
+static int wpa_driver_roboswitch_get_capa(void *priv,
+                                         struct wpa_driver_capa *capa)
+{
+       os_memset(capa, 0, sizeof(*capa));
+       capa->flags = WPA_DRIVER_FLAGS_WIRED;
+       return 0;
+}
+
+
 static int wpa_driver_roboswitch_set_param(void *priv, const char *param)
 {
        struct wpa_driver_roboswitch_data *drv = priv;
@@ -361,7 +358,7 @@ static void * wpa_driver_roboswitch_init(void *ctx, const char *ifname)
        /* copy ifname and take a pointer to the second to last character */
        sep = drv->ifname +
              os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname)) - 2;
-       /* find the '.' seperating <interface> and <vlan> */
+       /* find the '.' separating <interface> and <vlan> */
        while (sep > drv->ifname && *sep != '.') sep--;
        if (sep <= drv->ifname) {
                wpa_printf(MSG_INFO, "%s: No <interface>.<vlan> pair in "
@@ -469,6 +466,7 @@ const struct wpa_driver_ops wpa_driver_roboswitch_ops = {
        .desc = "wpa_supplicant roboswitch driver",
        .get_ssid = wpa_driver_roboswitch_get_ssid,
        .get_bssid = wpa_driver_roboswitch_get_bssid,
+       .get_capa = wpa_driver_roboswitch_get_capa,
        .init = wpa_driver_roboswitch_init,
        .deinit = wpa_driver_roboswitch_deinit,
        .set_param = wpa_driver_roboswitch_set_param,