]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCE: Send scan parameters when OCE_STA functionality is enabled
authorRoee Zamir <roee.zamir@intel.com>
Sun, 26 Aug 2018 17:45:03 +0000 (20:45 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 2 Sep 2018 15:08:51 +0000 (18:08 +0300)
If the device supports OCE features and OCE is enabled, set the relevant
scan parameters and FILS Request Parameters element with Max Channel
Time.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
wpa_supplicant/scan.c

index 3c52c395bbba7ad63595c564068d0492a14e5564..56d53fbba01944761710a46b3083317088899b57 100644 (file)
@@ -455,6 +455,33 @@ static void wpas_add_interworking_elements(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_INTERWORKING */
 
 
+#ifdef CONFIG_MBO
+static void wpas_fils_req_param_add_max_channel(struct wpa_supplicant *wpa_s,
+                                               struct wpabuf **ie)
+{
+       if (wpabuf_resize(ie, 5)) {
+               wpa_printf(MSG_DEBUG,
+                          "Failed to allocate space for FILS Request Parameters element");
+               return;
+       }
+
+       /* FILS Request Parameters element */
+       wpabuf_put_u8(*ie, WLAN_EID_EXTENSION);
+       wpabuf_put_u8(*ie, 3); /* FILS Request attribute length */
+       wpabuf_put_u8(*ie, WLAN_EID_EXT_FILS_REQ_PARAMS);
+       /* Parameter control bitmap */
+       wpabuf_put_u8(*ie, 0);
+       /* Max Channel Time field - contains the value of MaxChannelTime
+        * parameter of the MLME-SCAN.request primitive represented in units of
+        * TUs, as an unsigned integer. A Max Channel Time field value of 255
+        * is used to indicate any duration of more than 254 TUs, or an
+        * unspecified or unknown duration. (IEEE Std 802.11ai-2016, 9.4.2.178)
+        */
+       wpabuf_put_u8(*ie, 255);
+}
+#endif /* CONFIG_MBO */
+
+
 void wpa_supplicant_set_default_scan_ies(struct wpa_supplicant *wpa_s)
 {
        struct wpabuf *default_ies = NULL;
@@ -476,6 +503,8 @@ void wpa_supplicant_set_default_scan_ies(struct wpa_supplicant *wpa_s)
                wpabuf_put_data(default_ies, ext_capab, ext_capab_len);
 
 #ifdef CONFIG_MBO
+       if (wpa_s->enable_oce & OCE_STA)
+               wpas_fils_req_param_add_max_channel(wpa_s, &default_ies);
        /* Send MBO and OCE capabilities */
        if (wpabuf_resize(&default_ies, 12) == 0)
                wpas_mbo_scan_ie(wpa_s, default_ies);
@@ -517,6 +546,11 @@ static struct wpabuf * wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s)
                wpas_add_interworking_elements(wpa_s, extra_ie);
 #endif /* CONFIG_INTERWORKING */
 
+#ifdef CONFIG_MBO
+       if (wpa_s->enable_oce & OCE_STA)
+               wpas_fils_req_param_add_max_channel(wpa_s, &extra_ie);
+#endif /* CONFIG_MBO */
+
 #ifdef CONFIG_WPS
        wps = wpas_wps_in_use(wpa_s, &req_type);
 
@@ -1077,6 +1111,11 @@ ssid_list_set:
                }
        }
 
+#ifdef CONFIG_MBO
+       if (wpa_s->enable_oce & OCE_STA)
+               params.oce_scan = 1;
+#endif /* CONFIG_MBO */
+
        params.filter_ssids = wpa_supplicant_build_filter_ssids(
                wpa_s->conf, &params.num_filter_ssids);
        if (extra_ie) {
@@ -1486,6 +1525,11 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
                int_array_concat(&params.freqs, wpa_s->conf->freq_list);
        }
 
+#ifdef CONFIG_MBO
+       if (wpa_s->enable_oce & OCE_STA)
+               params.oce_scan = 1;
+#endif /* CONFIG_MBO */
+
        scan_params = &params;
 
 scan: