]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove flags parameter from send_mgmt_frame() driver op
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 9 Apr 2009 16:42:19 +0000 (19:42 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 Apr 2009 16:42:19 +0000 (19:42 +0300)
This was not documented properly and was not really used nor would it be
suitable to be used in generic way as it was implemented. It is better
to just remove the parameter since there does not seem to be any
reasonable use for it.

hostapd/beacon.c
hostapd/driver_i.h
hostapd/hostapd.c
hostapd/ieee802_11.c
hostapd/sta_info.c
hostapd/wme.c
src/drivers/driver.h
src/drivers/driver_hostap.c
src/drivers/driver_nl80211.c
src/drivers/driver_test.c

index 2e0d3e3a8e326dc1de007a8a8cb5f1e736467461..1df8752423e73ab443beeee21e822454cabfe548 100644 (file)
@@ -312,7 +312,7 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
        }
 #endif /* CONFIG_WPS */
 
-       if (hostapd_send_mgmt_frame(hapd, resp, pos - (u8 *) resp, 0) < 0)
+       if (hostapd_send_mgmt_frame(hapd, resp, pos - (u8 *) resp) < 0)
                perror("handle_probe_req: send");
 
        os_free(resp);
index 81be2278ea075420b5143ec92a993851bedae372..170c3b3e86e89b5d7d1fcc10509cf2da5faac9f4 100644 (file)
@@ -175,12 +175,11 @@ hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
 }
 
 static inline int
-hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len,
-                       int flags)
+hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len)
 {
        if (hapd->driver == NULL || hapd->driver->send_mgmt_frame == NULL)
                return 0;
-       return hapd->driver->send_mgmt_frame(hapd->drv_priv, msg, len, flags);
+       return hapd->driver->send_mgmt_frame(hapd->drv_priv, msg, len);
 }
 
 static inline int
index 0ed72f8f268efe27981d0fa978d5c35bbf6f4d89..2f5a888c3ac51cf48bd317675d06c0d63073ede3 100644 (file)
@@ -816,7 +816,7 @@ static int hostapd_wpa_auth_send_ft_action(void *ctx, const u8 *dst,
        os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN);
        os_memcpy(&m->u, data, data_len);
 
-       res = hostapd_send_mgmt_frame(hapd, (u8 *) m, mlen, 0);
+       res = hostapd_send_mgmt_frame(hapd, (u8 *) m, mlen);
        os_free(m);
        return res;
 }
index 759d9ffd63f83eb1df00fd574b06e0e263a3173b..f60c72d05db56585480dd69439f8f59211d35016 100644 (file)
@@ -357,7 +357,7 @@ void ieee802_11_send_deauth(struct hostapd_data *hapd, u8 *addr, u16 reason)
        os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN);
        mgmt.u.deauth.reason_code = host_to_le16(reason);
        if (hostapd_send_mgmt_frame(hapd, &mgmt, IEEE80211_HDRLEN +
-                                   sizeof(mgmt.u.deauth), 0) < 0)
+                                   sizeof(mgmt.u.deauth)) < 0)
                perror("ieee802_11_send_deauth: send");
 }
 
@@ -452,7 +452,7 @@ static void send_auth_reply(struct hostapd_data *hapd,
                   " auth_alg=%d auth_transaction=%d resp=%d (IE len=%lu)",
                   MAC2STR(dst), auth_alg, auth_transaction,
                   resp, (unsigned long) ies_len);
-       if (hostapd_send_mgmt_frame(hapd, reply, rlen, 0) < 0)
+       if (hostapd_send_mgmt_frame(hapd, reply, rlen) < 0)
                perror("send_auth_reply: send");
 
        os_free(buf);
@@ -1170,7 +1170,7 @@ static void handle_assoc(struct hostapd_data *hapd,
                send_len += p - reply->u.assoc_resp.variable;
        }
 
-       if (hostapd_send_mgmt_frame(hapd, reply, send_len, 0) < 0)
+       if (hostapd_send_mgmt_frame(hapd, reply, send_len) < 0)
                perror("handle_assoc: send");
 }
 
@@ -1298,7 +1298,7 @@ void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
        os_memcpy(mgmt.u.action.u.sa_query_req.trans_id, trans_id,
                  WLAN_SA_QUERY_TR_ID_LEN);
        end = mgmt.u.action.u.sa_query_req.trans_id + WLAN_SA_QUERY_TR_ID_LEN;
-       if (hostapd_send_mgmt_frame(hapd, &mgmt, end - (u8 *) &mgmt, 0) < 0)
+       if (hostapd_send_mgmt_frame(hapd, &mgmt, end - (u8 *) &mgmt) < 0)
                perror("ieee802_11_send_sa_query_req: send");
 }
 
@@ -1416,7 +1416,7 @@ static void handle_action(struct hostapd_data *hapd,
                os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
                mgmt->u.action.category |= 0x80;
 
-               hostapd_send_mgmt_frame(hapd, mgmt, len, 0);
+               hostapd_send_mgmt_frame(hapd, mgmt, len);
        }
 }
 
index cbf556c12c2dd3a4b23035ee1e79d169c4079988..7a22e9298ebc0cdb1b02ab6f3ece7d9f6fa71a84 100644 (file)
@@ -314,7 +314,7 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
                          ETH_ALEN);
                os_memcpy(hdr.IEEE80211_SA_FROMDS, hapd->own_addr, ETH_ALEN);
 
-               if (hostapd_send_mgmt_frame(hapd, &hdr, sizeof(hdr), 0) < 0)
+               if (hostapd_send_mgmt_frame(hapd, &hdr, sizeof(hdr)) < 0)
                        perror("ap_handle_timer: send");
 #endif /* CONFIG_NATIVE_WINDOWS */
        } else if (sta->timeout_next != STA_REMOVE) {
index 7f92a0a490c3cd983b79200776cc6a54d452382d..efcbe37142071eb91ad11e74c2dff0de10ce4e75 100644 (file)
@@ -160,7 +160,7 @@ static void wmm_send_action(struct hostapd_data *hapd, const u8 *addr,
        os_memcpy(t, tspec, sizeof(struct wmm_tspec_element));
        len = ((u8 *) (t + 1)) - buf;
 
-       if (hostapd_send_mgmt_frame(hapd, m, len, 0) < 0)
+       if (hostapd_send_mgmt_frame(hapd, m, len) < 0)
                perror("wmm_send_action: send");
 }
 
index eee49cbc47db55b05088d2b532d9e295d5a98c56..5242748684be9916356770508a2b99b731d8e59c 100644 (file)
@@ -1249,8 +1249,7 @@ struct wpa_driver_ops {
        int (*hapd_set_ssid)(const char *ifname, void *priv, const u8 *buf,
                             int len);
        int (*hapd_set_countermeasures)(void *priv, int enabled);
-       int (*send_mgmt_frame)(void *priv, const void *msg, size_t len,
-                              int flags);
+       int (*send_mgmt_frame)(void *priv, const void *msg, size_t len);
        int (*sta_add)(const char *ifname, void *priv,
                       struct hostapd_sta_add_params *params);
        int (*get_inact_sec)(void *priv, const u8 *addr);
index de2e1cfb13ed1c1cefece9d889c4db665292204e..e22739dfccf4752c7144a2d2d892fbc4a45b8f34 100644 (file)
@@ -293,8 +293,7 @@ static int hostap_init_sockets(struct hostap_driver_data *drv)
 }
 
 
-static int hostap_send_mgmt_frame(void *priv, const void *msg, size_t len,
-                                 int flags)
+static int hostap_send_mgmt_frame(void *priv, const void *msg, size_t len)
 {
        struct hostap_driver_data *drv = priv;
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) msg;
@@ -302,7 +301,7 @@ static int hostap_send_mgmt_frame(void *priv, const void *msg, size_t len,
 
        /* Request TX callback */
        hdr->frame_control |= host_to_le16(BIT(1));
-       res = send(drv->sock, msg, len, flags);
+       res = send(drv->sock, msg, len, 0);
        hdr->frame_control &= ~host_to_le16(BIT(1));
 
        return res;
@@ -342,7 +341,7 @@ static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data,
        pos += 2;
        memcpy(pos, data, data_len);
 
-       res = hostap_send_mgmt_frame(drv, (u8 *) hdr, len, 0);
+       res = hostap_send_mgmt_frame(drv, (u8 *) hdr, len);
        free(hdr);
 
        if (res < 0) {
@@ -1147,7 +1146,7 @@ static int hostap_sta_deauth(void *priv, const u8 *addr, int reason)
        memcpy(mgmt.bssid, drv->hapd->own_addr, ETH_ALEN);
        mgmt.u.deauth.reason_code = host_to_le16(reason);
        return hostap_send_mgmt_frame(drv, &mgmt, IEEE80211_HDRLEN +
-                                     sizeof(mgmt.u.deauth), 0);
+                                     sizeof(mgmt.u.deauth));
 }
 
 
@@ -1164,7 +1163,7 @@ static int hostap_sta_disassoc(void *priv, const u8 *addr, int reason)
        memcpy(mgmt.bssid, drv->hapd->own_addr, ETH_ALEN);
        mgmt.u.disassoc.reason_code = host_to_le16(reason);
        return  hostap_send_mgmt_frame(drv, &mgmt, IEEE80211_HDRLEN +
-                                      sizeof(mgmt.u.disassoc), 0);
+                                      sizeof(mgmt.u.disassoc));
 }
 
 
index 96acef9a29dc9c55c970abe5f274c1c8256b6a83..f5f18c0b5ad72078c75d770d90198f85083842ab 100644 (file)
@@ -3039,7 +3039,7 @@ static int i802_set_rate_sets(void *priv, int *supp_rates, int *basic_rates,
 
 
 static int i802_send_frame(void *priv, const void *data, size_t len,
-                          int encrypt, int flags)
+                          int encrypt)
 {
        __u8 rtap_hdr[] = {
                0x00, 0x00, /* radiotap version */
@@ -3074,11 +3074,10 @@ static int i802_send_frame(void *priv, const void *data, size_t len,
        if (encrypt)
                rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP;
 
-       return sendmsg(drv->monitor_sock, &msg, flags);
+       return sendmsg(drv->monitor_sock, &msg, 0);
 }
 
-static int i802_send_mgmt_frame(void *priv, const void *data, size_t len,
-                               int flags)
+static int i802_send_mgmt_frame(void *priv, const void *data, size_t len)
 {
        struct ieee80211_mgmt *mgmt;
        int do_not_encrypt = 0;
@@ -3102,7 +3101,7 @@ static int i802_send_mgmt_frame(void *priv, const void *data, size_t len,
                        do_not_encrypt = 1;
        }
 
-       return i802_send_frame(priv, data, len, !do_not_encrypt, flags);
+       return i802_send_frame(priv, data, len, !do_not_encrypt);
 }
 
 /* Set kernel driver on given frequency (MHz) */
@@ -3364,7 +3363,7 @@ static int i802_send_eapol(void *priv, const u8 *addr, const u8 *data,
        pos += 2;
        memcpy(pos, data, data_len);
 
-       res = i802_send_frame(drv, (u8 *) hdr, len, encrypt, 0);
+       res = i802_send_frame(drv, (u8 *) hdr, len, encrypt);
        free(hdr);
 
        if (res < 0) {
@@ -4945,7 +4944,7 @@ static int i802_sta_deauth(void *priv, const u8 *addr, int reason)
        memcpy(mgmt.bssid, drv->hapd->own_addr, ETH_ALEN);
        mgmt.u.deauth.reason_code = host_to_le16(reason);
        return i802_send_mgmt_frame(drv, &mgmt, IEEE80211_HDRLEN +
-                                     sizeof(mgmt.u.deauth), 0);
+                                   sizeof(mgmt.u.deauth));
 }
 
 
@@ -4961,8 +4960,8 @@ static int i802_sta_disassoc(void *priv, const u8 *addr, int reason)
        memcpy(mgmt.sa, drv->hapd->own_addr, ETH_ALEN);
        memcpy(mgmt.bssid, drv->hapd->own_addr, ETH_ALEN);
        mgmt.u.disassoc.reason_code = host_to_le16(reason);
-       return  i802_send_mgmt_frame(drv, &mgmt, IEEE80211_HDRLEN +
-                                      sizeof(mgmt.u.disassoc), 0);
+       return i802_send_mgmt_frame(drv, &mgmt, IEEE80211_HDRLEN +
+                                   sizeof(mgmt.u.disassoc));
 }
 
 
index 2cbf591838d40849fb758554e38ccf60fa05c79d..ab522fcb59766169bcb3524edf48217609f81db5 100644 (file)
@@ -297,8 +297,7 @@ static int test_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
 }
 
 
-static int test_driver_send_mgmt_frame(void *priv, const void *buf,
-                                      size_t len, int flags)
+static int test_driver_send_mgmt_frame(void *priv, const void *buf, size_t len)
 {
        struct test_driver_data *drv = priv;
        struct msghdr msg;