]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
driver: Add no_encrypt argument to send_mlme()
authorJouni Malinen <j@w1.fi>
Fri, 3 Jan 2020 11:48:33 +0000 (13:48 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 3 Jan 2020 11:53:32 +0000 (13:53 +0200)
This is in preparation of being able to remove the separate send_frame()
callback.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ap_drv_ops.c
src/drivers/driver.h
src/drivers/driver_atheros.c
src/drivers/driver_hostap.c
src/drivers/driver_nl80211.c
wpa_supplicant/driver_i.h

index ec1d970eaed9b7a201e1ddc82d6be9d42b1ce735..35ecf41022af6b6f1c3ba1ea4b225a23d365f2b3 100644 (file)
@@ -700,7 +700,7 @@ int hostapd_drv_send_mlme(struct hostapd_data *hapd,
        if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
                return 0;
        return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
-                                      csa_offs, csa_offs_len);
+                                      csa_offs, csa_offs_len, no_encrypt);
 }
 
 
index ce64f341c6fdb862a1e48125f386dddabd34c0bd..d793cc8fec04d42ec51a8f934ac3b1623ff0e03f 100644 (file)
@@ -2609,11 +2609,13 @@ struct wpa_driver_ops {
         * driver decide
         * @csa_offs: Array of CSA offsets or %NULL
         * @csa_offs_len: Number of elements in csa_offs
+        * @no_encrypt: Do not encrypt frame even if appropriate key exists
+        *      (used only for testing purposes)
         * Returns: 0 on success, -1 on failure
         */
        int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
                         int noack, unsigned int freq, const u16 *csa_offs,
-                        size_t csa_offs_len);
+                        size_t csa_offs_len, int no_encrypt);
 
        /**
         * update_ft_ies - Update FT (IEEE 802.11r) IEs
index eac3ae8af87054084e1a1a5b82f4166beaa0c8c8..de25e4e4e0dda852fa7f9d233d06f41ac4db92e8 100644 (file)
@@ -1960,7 +1960,8 @@ static int atheros_set_ap(void *priv, struct wpa_driver_ap_params *params)
 
 static int atheros_send_mgmt(void *priv, const u8 *frm, size_t data_len,
                             int noack, unsigned int freq,
-                            const u16 *csa_offs, size_t csa_offs_len)
+                            const u16 *csa_offs, size_t csa_offs_len,
+                            int no_encrypt)
 {
        struct atheros_driver_data *drv = priv;
        u8 buf[1510];
index 186eccbf2181e33153f345bd2c2eb3dd2b3ebc51..dbe7fafc8b3384d439e7acb862f467a7598a394b 100644 (file)
@@ -263,7 +263,8 @@ static int hostap_init_sockets(struct hostap_driver_data *drv, u8 *own_addr)
 
 static int hostap_send_mlme(void *priv, const u8 *msg, size_t len, int noack,
                            unsigned int freq,
-                           const u16 *csa_offs, size_t csa_offs_len)
+                           const u16 *csa_offs, size_t csa_offs_len,
+                           int no_encrypt)
 {
        struct hostap_driver_data *drv = priv;
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) msg;
@@ -312,7 +313,7 @@ static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data,
        pos += 2;
        memcpy(pos, data, data_len);
 
-       res = hostap_send_mlme(drv, (u8 *) hdr, len, 0, 0, NULL, 0);
+       res = hostap_send_mlme(drv, (u8 *) hdr, len, 0, 0, NULL, 0, 0);
        if (res < 0) {
                wpa_printf(MSG_ERROR, "hostap_send_eapol - packet len: %lu - "
                           "failed: %d (%s)",
@@ -1051,7 +1052,7 @@ static int hostap_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr,
        memcpy(mgmt.bssid, own_addr, ETH_ALEN);
        mgmt.u.deauth.reason_code = host_to_le16(reason);
        return hostap_send_mlme(drv, (u8 *) &mgmt, IEEE80211_HDRLEN +
-                               sizeof(mgmt.u.deauth), 0, 0, NULL, 0);
+                               sizeof(mgmt.u.deauth), 0, 0, NULL, 0, 0);
 }
 
 
@@ -1089,7 +1090,7 @@ static int hostap_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr,
        memcpy(mgmt.bssid, own_addr, ETH_ALEN);
        mgmt.u.disassoc.reason_code = host_to_le16(reason);
        return  hostap_send_mlme(drv, (u8 *) &mgmt, IEEE80211_HDRLEN +
-                                sizeof(mgmt.u.disassoc), 0, 0, NULL, 0);
+                                sizeof(mgmt.u.disassoc), 0, 0, NULL, 0, 0);
 }
 
 
@@ -1169,7 +1170,7 @@ static void wpa_driver_hostap_poll_client(void *priv, const u8 *own_addr,
        os_memcpy(hdr.IEEE80211_BSSID_FROMDS, own_addr, ETH_ALEN);
        os_memcpy(hdr.IEEE80211_SA_FROMDS, own_addr, ETH_ALEN);
 
-       hostap_send_mlme(priv, (u8 *)&hdr, sizeof(hdr), 0, 0, NULL, 0);
+       hostap_send_mlme(priv, (u8 *) &hdr, sizeof(hdr), 0, 0, NULL, 0, 0);
 }
 
 
index 87656147b4761114d80ab36c83716e69cc18b57d..0809e4d9a135ee1fbfaf07b51000636e6c077738 100644 (file)
@@ -8751,7 +8751,8 @@ static int driver_nl80211_if_remove(void *priv, enum wpa_driver_if_type type,
 static int driver_nl80211_send_mlme(void *priv, const u8 *data,
                                    size_t data_len, int noack,
                                    unsigned int freq,
-                                   const u16 *csa_offs, size_t csa_offs_len)
+                                   const u16 *csa_offs, size_t csa_offs_len,
+                                   int no_encrypt)
 {
        struct i802_bss *bss = priv;
        return wpa_driver_nl80211_send_mlme(bss, data, data_len, noack,
index 8743d566858797c19e050b77ab44647be7f366ad..f8d63a07b0ef4ac3448e0e788fce100f2e9b685a 100644 (file)
@@ -304,7 +304,7 @@ static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
        if (wpa_s->driver->send_mlme)
                return wpa_s->driver->send_mlme(wpa_s->drv_priv,
                                                data, data_len, noack,
-                                               freq, NULL, 0);
+                                               freq, NULL, 0, 0);
        return -1;
 }