Remove unused send_eapol() driver op
authorJouni Malinen <j@w1.fi>
Thu, 11 Dec 2014 13:40:07 +0000 (15:40 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 11 Dec 2014 13:40:07 +0000 (15:40 +0200)
The send_eapol() callback was used by driver_test.c, but with that
removed, there is no remaining users of the alternative EAPOL frame
transmitting mechanism in wpa_supplicant, i.e., all remaining driver
interfaces use l2_packet instead. Remove the send_eapol() to get rid of
unused code.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver.h
src/drivers/driver_none.c
wpa_supplicant/driver_i.h
wpa_supplicant/ibss_rsn.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpas_glue.c

index 54050db..95aa553 100644 (file)
@@ -1726,27 +1726,6 @@ struct wpa_driver_ops {
        const u8 * (*get_mac_addr)(void *priv);
 
        /**
-        * send_eapol - Optional function for sending EAPOL packets
-        * @priv: private driver interface data
-        * @dest: Destination MAC address
-        * @proto: Ethertype
-        * @data: EAPOL packet starting with IEEE 802.1X header
-        * @data_len: Size of the EAPOL packet
-        *
-        * Returns: 0 on success, -1 on failure
-        *
-        * This optional function can be used to override l2_packet operations
-        * with driver specific functionality. If this function pointer is set,
-        * l2_packet module is not used at all and the driver interface code is
-        * responsible for receiving and sending all EAPOL packets. The
-        * received EAPOL packets are sent to core code with EVENT_EAPOL_RX
-        * event. The driver interface is required to implement get_mac_addr()
-        * handler if send_eapol() is used.
-        */
-       int (*send_eapol)(void *priv, const u8 *dest, u16 proto,
-                         const u8 *data, size_t data_len);
-
-       /**
         * set_operstate - Sets device operating state to DORMANT or UP
         * @priv: private driver interface data
         * @state: 0 = dormant, 1 = up
@@ -3477,9 +3456,7 @@ enum wpa_event_type {
         * EVENT_EAPOL_RX - Report received EAPOL frame
         *
         * When in AP mode with hostapd, this event is required to be used to
-        * deliver the receive EAPOL frames from the driver. With
-        * %wpa_supplicant, this event is used only if the send_eapol() handler
-        * is used to override the use of l2_packet for EAPOL frame TX.
+        * deliver the receive EAPOL frames from the driver.
         */
        EVENT_EAPOL_RX,
 
index d75c14b..6ff3eae 100644 (file)
@@ -74,13 +74,6 @@ static void none_driver_deinit(void *priv)
 }
 
 
-static int none_driver_send_eapol(void *priv, const u8 *dest, u16 proto,
-                                 const u8 *data, size_t data_len)
-{
-       return -1;
-}
-
-
 const struct wpa_driver_ops wpa_driver_none_ops = {
        .name = "none",
        .desc = "no driver (RADIUS server/WPS ER)",
@@ -89,5 +82,4 @@ const struct wpa_driver_ops wpa_driver_none_ops = {
        .send_ether = none_driver_send_ether,
        .init = none_driver_init,
        .deinit = none_driver_deinit,
-       .send_eapol = none_driver_send_eapol,
 };
index ae50835..a92c5f7 100644 (file)
@@ -244,16 +244,6 @@ static inline const u8 * wpa_drv_get_mac_addr(struct wpa_supplicant *wpa_s)
        return NULL;
 }
 
-static inline int wpa_drv_send_eapol(struct wpa_supplicant *wpa_s,
-                                    const u8 *dst, u16 proto,
-                                    const u8 *data, size_t data_len)
-{
-       if (wpa_s->driver->send_eapol)
-               return wpa_s->driver->send_eapol(wpa_s->drv_priv, dst, proto,
-                                                data, data_len);
-       return -1;
-}
-
 static inline int wpa_drv_set_operstate(struct wpa_supplicant *wpa_s,
                                        int state)
 {
index 0e487d2..d0ae135 100644 (file)
@@ -72,7 +72,7 @@ static int supp_ether_send(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
        if (wpa_s->l2)
                return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
 
-       return wpa_drv_send_eapol(wpa_s, dest, proto, buf, len);
+       return -1;
 }
 
 
@@ -283,7 +283,7 @@ static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
                return l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data,
                                      data_len);
 
-       return wpa_drv_send_eapol(wpa_s, addr, ETH_P_EAPOL, data, data_len);
+       return -1;
 }
 
 
index 68fcbef..04d6d2f 100644 (file)
@@ -2825,15 +2825,9 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
 
 int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
 {
-       if (wpa_s->driver->send_eapol) {
-               const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
-               if (addr)
-                       os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
-       } else if ((!wpa_s->p2p_mgmt ||
-                   !(wpa_s->drv_flags &
-                     WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) &&
-                  !(wpa_s->drv_flags &
-                    WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) {
+       if ((!wpa_s->p2p_mgmt ||
+            !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) &&
+           !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) {
                l2_packet_deinit(wpa_s->l2);
                wpa_s->l2 = l2_packet_init(wpa_s->ifname,
                                           wpa_drv_get_mac_addr(wpa_s),
index 3bf5135..70ece22 100644 (file)
@@ -115,7 +115,7 @@ static int wpa_ether_send(struct wpa_supplicant *wpa_s, const u8 *dest,
                return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
        }
 
-       return wpa_drv_send_eapol(wpa_s, dest, proto, buf, len);
+       return -1;
 }
 #endif /* IEEE8021X_EAPOL || !CONFIG_NO_WPA */