]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Update connect params with new MBO attributes to driver
authorAnkita Bajaj <bankita@codeaurora.org>
Tue, 2 Apr 2019 09:02:50 +0000 (14:32 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 5 Apr 2019 17:56:03 +0000 (20:56 +0300)
MBO attributes Non-preferred channel list and Cellular capabilities are
updated using WNM-Notification Request frame to the current connected
BSS. These same attributes need to be added in the (Re)Association
Request frame sent by the station when roaming, including the case where
the driver/firmware takes care of SME/MLME operations during roaming, so
we need to update the MBO IE to the driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/mbo.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 43722a976d7c1a7cddc7e6269d563b88c2c0f33d..43b1fa7beb388875d5361ae98983930e5ed48957 100644 (file)
@@ -275,6 +275,7 @@ static void wpas_mbo_non_pref_chan_changed(struct wpa_supplicant *wpa_s)
        wpas_mbo_non_pref_chan_attrs(wpa_s, buf, 1);
        wpas_mbo_send_wnm_notification(wpa_s, wpabuf_head_u8(buf),
                                       wpabuf_len(buf));
+       wpas_update_mbo_connect_params(wpa_s);
        wpabuf_free(buf);
 }
 
@@ -565,6 +566,7 @@ void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa)
 
        wpas_mbo_send_wnm_notification(wpa_s, cell_capa, 7);
        wpa_supplicant_set_default_scan_ies(wpa_s);
+       wpas_update_mbo_connect_params(wpa_s);
 }
 
 
index 7c9f58105faae277124326ade03cc4394d85c502..a34e022017c8516bca4c4ab2addd15767807928d 100644 (file)
@@ -2959,6 +2959,34 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s)
 #endif /* CONFIG_FILS && IEEE8021X_EAPOL */
 
 
+#ifdef CONFIG_MBO
+void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s)
+{
+       struct wpa_driver_associate_params params;
+       u8 *wpa_ie;
+
+       /*
+        * Update MBO connect params only in case of change of MBO attributes
+        * when connected, if the AP support MBO.
+        */
+
+       if (wpa_s->wpa_state != WPA_COMPLETED || !wpa_s->current_ssid ||
+           !wpa_s->current_bss ||
+           !wpa_bss_get_vendor_ie(wpa_s->current_bss, MBO_IE_VENDOR_TYPE))
+               return;
+
+       os_memset(&params, 0, sizeof(params));
+       wpa_ie = wpas_populate_assoc_ies(wpa_s, wpa_s->current_bss,
+                                        wpa_s->current_ssid, &params, NULL);
+       if (!wpa_ie)
+               return;
+
+       wpa_drv_update_connect_params(wpa_s, &params, WPA_DRV_UPDATE_ASSOC_IES);
+       os_free(wpa_ie);
+}
+#endif /* CONFIG_MBO */
+
+
 static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
 {
        struct wpa_connect_work *cwork = work->ctx;
index 267a09eb060bfe664b0941e0b31406152edd3e90..16e4db62aeef1dbdd4cd119d4edc272aba7ad3ac 100644 (file)
@@ -1402,6 +1402,7 @@ struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
 void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
                            struct wpa_bss *bss, const u8 *sa,
                            const u8 *data, size_t slen);
+void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s);
 
 /* op_classes.c */
 enum chan_allowed {