]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Report beacon request TX status as control interface event
authorJouni Malinen <j@w1.fi>
Sun, 1 Jan 2017 22:54:44 +0000 (00:54 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 3 Jan 2017 14:02:58 +0000 (16:02 +0200)
The new BEACON-REQ-TX-STATUS control interface event is now used to
report whether a beacon request (from REQ_BEACON command) was delivered
successfully. This event has the following parameters: <STA address>
<dialog token> <ack=0/1>.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ieee802_11.c
src/ap/rrm.c
src/ap/rrm.h
src/common/wpa_ctrl.h

index f3d8c967ce769981f13f2a4d08218ebc9ab6ae0a..f7cd0eae892ec2fbfb7e9bd4ffb09893d95ef7ad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / IEEE 802.11 Management
- * Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -3359,6 +3359,29 @@ static void handle_disassoc_cb(struct hostapd_data *hapd,
 }
 
 
+static void handle_action_cb(struct hostapd_data *hapd,
+                            const struct ieee80211_mgmt *mgmt,
+                            size_t len, int ok)
+{
+       struct sta_info *sta;
+
+       if (is_multicast_ether_addr(mgmt->da))
+               return;
+       sta = ap_get_sta(hapd, mgmt->da);
+       if (!sta) {
+               wpa_printf(MSG_DEBUG, "handle_action_cb: STA " MACSTR
+                          " not found", MAC2STR(mgmt->da));
+               return;
+       }
+
+       if (len < 24 + 2)
+               return;
+       if (mgmt->u.action.category == WLAN_ACTION_RADIO_MEASUREMENT &&
+           mgmt->u.action.u.rrm.action == WLAN_RRM_RADIO_MEASUREMENT_REQUEST)
+               hostapd_rrm_beacon_req_tx_status(hapd, mgmt, len, ok);
+}
+
+
 /**
  * ieee802_11_mgmt_cb - Process management frame TX status callback
  * @hapd: hostapd BSS data structure (the BSS from which the management frame
@@ -3408,6 +3431,7 @@ void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len,
                break;
        case WLAN_FC_STYPE_ACTION:
                wpa_printf(MSG_DEBUG, "mgmt::action cb ok=%d", ok);
+               handle_action_cb(hapd, mgmt, len, ok);
                break;
        default:
                wpa_printf(MSG_INFO, "unknown mgmt cb frame subtype %d", stype);
index 78557dc6851bf74e5c18ff8961a882e988d514d1..1ca7428c54ab6a0d98b7c2c017887c515760a3c7 100644 (file)
@@ -2,6 +2,7 @@
  * hostapd / Radio Measurement (RRM)
  * Copyright(c) 2013 - 2016 Intel Mobile Communications GmbH.
  * Copyright(c) 2011 - 2016 Intel Corporation. All rights reserved.
+ * Copyright (c) 2016-2017, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -10,6 +11,7 @@
 #include "utils/includes.h"
 
 #include "utils/common.h"
+#include "common/wpa_ctrl.h"
 #include "hostapd.h"
 #include "ap_drv_ops.h"
 #include "sta_info.h"
@@ -638,3 +640,15 @@ int hostapd_send_beacon_req(struct hostapd_data *hapd, const u8 *addr,
 
        return hapd->beacon_req_token;
 }
+
+
+void hostapd_rrm_beacon_req_tx_status(struct hostapd_data *hapd,
+                                     const struct ieee80211_mgmt *mgmt,
+                                     size_t len, int ok)
+{
+       if (len < 24 + 3)
+               return;
+       wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_REQ_TX_STATUS MACSTR
+               " %u ack=%d", MAC2STR(mgmt->da),
+               mgmt->u.action.u.rrm.dialog_token, ok);
+}
index 720fad9b1a41b7a60b137f59b99c8e8992cb4b2f..02cd522ee9d633c493db700e13baed180bcae022 100644 (file)
@@ -26,5 +26,8 @@ int hostapd_send_range_req(struct hostapd_data *hapd, const u8 *addr,
 void hostapd_clean_rrm(struct hostapd_data *hapd);
 int hostapd_send_beacon_req(struct hostapd_data *hapd, const u8 *addr,
                            u8 req_mode, const struct wpabuf *req);
+void hostapd_rrm_beacon_req_tx_status(struct hostapd_data *hapd,
+                                     const struct ieee80211_mgmt *mgmt,
+                                     size_t len, int ok);
 
 #endif /* RRM_H */
index 4420b5860169261030e0da4f35a5272173949b47..b68527ee32cbf987dd0bdad5b86e6bc0b07912fd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * wpa_supplicant/hostapd control interface library
- * Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -288,6 +288,9 @@ extern "C" {
 /* BSS Transition Management Request received with MBO transition reason */
 #define MBO_TRANSITION_REASON "MBO-TRANSITION-REASON "
 
+/* parameters: <STA address> <dialog token> <ack=0/1> */
+#define BEACON_REQ_TX_STATUS "BEACON-REQ-TX-STATUS "
+
 /* PMKSA cache entry added; parameters: <BSSID> <network_id> */
 #define PMKSA_CACHE_ADDED "PMKSA-CACHE-ADDED "
 /* PMKSA cache entry removed; parameters: <BSSID> <network_id> */