]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Support BTM operations in wpa_supplicant AP mode
authorChaoli Zhou <quic_zchaoli@quicinc.com>
Tue, 22 Mar 2022 20:47:12 +0000 (22:47 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 23 Mar 2022 22:56:53 +0000 (00:56 +0200)
Extend AP mode BTM control interface commands to work from
wpa_supplicant in additiona to the previously support hostapd case.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
wpa_supplicant/ap.c
wpa_supplicant/ap.h
wpa_supplicant/ctrl_iface.c

index 0a972f56643eb0af3e57ce5b71f6074bd8121551..0d117b4ed69d272fd448743480350d8faf4cc938 100644 (file)
@@ -1569,6 +1569,47 @@ int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
        return pos - buf;
 }
 
+
+#ifdef CONFIG_WNM_AP
+
+int ap_ctrl_iface_disassoc_imminent(struct wpa_supplicant *wpa_s,
+                                   const char *buf)
+{
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else
+               return -1;
+       return hostapd_ctrl_iface_disassoc_imminent(hapd, buf);
+}
+
+
+int ap_ctrl_iface_ess_disassoc(struct wpa_supplicant *wpa_s, const char *buf)
+{
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else
+               return -1;
+       return hostapd_ctrl_iface_ess_disassoc(hapd, buf);
+}
+
+
+int ap_ctrl_iface_bss_tm_req(struct wpa_supplicant *wpa_s, const char *buf)
+{
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else
+               return -1;
+       return hostapd_ctrl_iface_bss_tm_req(hapd, buf);
+}
+
+#endif /* CONFIG_WNM_AP */
+
 #endif /* CONFIG_CTRL_IFACE */
 
 
index 7bc1b781e3ac4f24e7f2af0703e56d3d403d7dc4..3e20ac1bb994597364a7b3bfe9e9b646819b0b15 100644 (file)
@@ -38,6 +38,10 @@ int ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s,
                                   const char *txtaddr);
 int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
                                 size_t buflen, int verbose);
+int ap_ctrl_iface_disassoc_imminent(struct wpa_supplicant *wpa_s,
+                                   const char *buf);
+int ap_ctrl_iface_ess_disassoc(struct wpa_supplicant *wpa_s, const char *buf);
+int ap_ctrl_iface_bss_tm_req(struct wpa_supplicant *wpa_s, const char *buf);
 void ap_tx_status(void *ctx, const u8 *addr,
                  const u8 *buf, size_t len, int ack);
 void ap_eapol_tx_status(void *ctx, const u8 *dst,
index 21d7ec4b0982c008851fa7992738daa3379c7234..078a8110d9a632c459cd8ce65d1382d244c2aace 100644 (file)
@@ -12117,6 +12117,17 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18))
                        reply_len = -1;
 #endif /* CONFIG_WNM */
+#ifdef CONFIG_WNM_AP
+       } else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) {
+               if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18))
+                       reply_len = -1;
+       } else if (os_strncmp(buf, "ESS_DISASSOC ", 13) == 0) {
+               if (ap_ctrl_iface_ess_disassoc(wpa_s, buf + 13))
+                       reply_len = -1;
+       } else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) {
+               if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11))
+                       reply_len = -1;
+#endif /* CONFIG_WNM_AP */
        } else if (os_strcmp(buf, "FLUSH") == 0) {
                wpa_supplicant_ctrl_iface_flush(wpa_s);
        } else if (os_strncmp(buf, "RADIO_WORK ", 11) == 0) {