]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MSCS: Add support to process MSCS Response frames
authorVinita S. Maloo <vmaloo@codeaurora.org>
Wed, 3 Jun 2020 15:24:04 +0000 (20:54 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 14 Aug 2020 08:53:37 +0000 (11:53 +0300)
Add support to receive and process MSCS Response frames from the AP and
indicate the status to upper layers.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
src/common/wpa_ctrl.h
src/drivers/driver_nl80211.c
wpa_supplicant/events.c
wpa_supplicant/robust_av.c
wpa_supplicant/wpa_supplicant_i.h

index f5199de9aa8be939853f3855b768771d789992f7..4e42c890fa2215e7a399a49164050279d306fead 100644 (file)
@@ -126,6 +126,8 @@ extern "C" {
 #define WPA_EVENT_FREQ_CONFLICT "CTRL-EVENT-FREQ-CONFLICT "
 /** Frequency ranges that the driver recommends to avoid */
 #define WPA_EVENT_AVOID_FREQ "CTRL-EVENT-AVOID-FREQ "
+/** Result of MSCS setup */
+#define WPA_EVENT_MSCS_RESULT "CTRL-EVENT-MSCS-RESULT "
 /** WPS overlap detected in PBC mode */
 #define WPS_EVENT_OVERLAP "WPS-OVERLAP-DETECTED "
 /** Available WPS AP with active PBC found in scan results */
index 14179f79bb7319c65596b4936c43250c7488ce00..2ee34d11d64e895a1ec235d36443c099f0723495 100644 (file)
@@ -2451,6 +2451,10 @@ static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss)
            (nl80211_register_action_frame(bss, (u8 *) "\x05\x02", 2) < 0))
                ret = -1;
 
+       /* Robust AV MSCS Response */
+       if (nl80211_register_action_frame(bss, (u8 *) "\x13\x05", 2) < 0)
+               ret = -1;
+
        nl80211_mgmt_handle_register_eloop(bss);
 
        return ret;
index bd1af8915f4cb55ff275989d41f544d37af50bff..3b169dae4de95b3dd578666e9f15cc017ac68ab8 100644 (file)
@@ -4245,6 +4245,13 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_DPP */
 
+       if (category == WLAN_ACTION_ROBUST_AV_STREAMING &&
+           payload[0] == ROBUST_AV_MSCS_RESP) {
+               wpas_handle_robust_av_recv_action(wpa_s, mgmt->sa,
+                                                 payload + 1, plen - 1);
+               return;
+       }
+
        wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid,
                           category, payload, plen, freq);
        if (wpa_s->ifmsh)
index 6bb4e3e956b8ead20984bd294331e3b48ca9fcdb..f7e4100e599f4c44ade941e24f6e1fe6d35fcc74 100644 (file)
@@ -96,3 +96,26 @@ int wpas_send_mscs_req(struct wpa_supplicant *wpa_s)
        wpabuf_free(buf);
        return ret;
 }
+
+
+void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
+                                      const u8 *src, const u8 *buf, size_t len)
+{
+       u8 dialog_token;
+       u16 status_code;
+
+       if (len < 3)
+               return;
+
+       dialog_token = *buf++;
+       if (dialog_token != wpa_s->robust_av.dialog_token) {
+               wpa_printf(MSG_INFO,
+                          "MSCS: Drop received frame due to dialog token mismatch: received:%u expected:%u",
+                          dialog_token, wpa_s->robust_av.dialog_token);
+               return;
+       }
+
+       status_code = *buf;
+       wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
+               " status_code=%u", MAC2STR(src), status_code);
+}
index 44f5f375a1d3ba11dd9f95293693cbe45ab36be1..9ed886ff54f87e76ac323c07faff2d57d5e052ea 100644 (file)
@@ -1638,5 +1638,8 @@ void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s);
 int wpas_send_mscs_req(struct wpa_supplicant *wpa_s);
 void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
                                      struct wpabuf *buf);
+void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
+                                      const u8 *src, const u8 *buf,
+                                      size_t len);
 
 #endif /* WPA_SUPPLICANT_I_H */