]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Driver configuration to disable/enable FILS features
authorvamsi krishna <vamsin@qti.qualcomm.com>
Thu, 14 Dec 2017 09:44:51 +0000 (15:14 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 15 Dec 2017 18:52:17 +0000 (20:52 +0200)
The new disable_fils parameter can be used to disable FILS functionality
in the driver. This is currently removing the FILS Capability bit in
Extended Capabilities and providing a callback to the driver wrappers.
driver_nl80211.c implements this using a QCA vendor specific command for
now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/driver_i.h
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index a6307e3b13743e94e487c98472bdd50af0ea6d13..f28bd2b2c4c6f8b5288b93f25b10a74aef0da79c 100644 (file)
@@ -3610,6 +3610,17 @@ struct wpa_driver_ops {
         */
        int (*roaming)(void *priv, int allowed, const u8 *bssid);
 
+       /**
+        * disable_fils - Enable/disable FILS feature
+        * @priv: Private driver interface data
+        * @disable: 0-enable and 1-disable FILS feature
+        * Returns: 0 on success, -1 on failure
+        *
+        * This callback can be used to configure driver and below layers to
+        * enable/disable all FILS features.
+        */
+       int (*disable_fils)(void *priv, int disable);
+
        /**
         * set_mac_addr - Set MAC address
         * @priv: Private driver interface data
index 58e6bf9d11ebe52baed8e2b2c0c63835aeeabcf0..277d5298601a707b3173e5038fed71f769e630cb 100644 (file)
@@ -8885,6 +8885,34 @@ static int nl80211_roaming(void *priv, int allowed, const u8 *bssid)
 }
 
 
+static int nl80211_disable_fils(void *priv, int disable)
+{
+       struct i802_bss *bss = priv;
+       struct wpa_driver_nl80211_data *drv = bss->drv;
+       struct nl_msg *msg;
+       struct nlattr *params;
+
+       wpa_printf(MSG_DEBUG, "nl80211: Disable FILS=%d", disable);
+
+       if (!drv->set_wifi_conf_vendor_cmd_avail)
+               return -1;
+
+       if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
+           nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA) ||
+           nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
+                       QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION) ||
+           !(params = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
+           nla_put_u8(msg, QCA_WLAN_VENDOR_ATTR_CONFIG_DISABLE_FILS,
+                      disable)) {
+               nlmsg_free(msg);
+               return -1;
+       }
+       nla_nest_end(msg, params);
+
+       return send_and_recv_msgs(drv, msg, NULL, NULL);
+}
+
+
 /* Reserved QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID value for wpa_supplicant */
 #define WPA_SUPPLICANT_CLIENT_ID 1
 
@@ -10450,6 +10478,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
        .get_ifindex = nl80211_get_ifindex,
 #ifdef CONFIG_DRIVER_NL80211_QCA
        .roaming = nl80211_roaming,
+       .disable_fils = nl80211_disable_fils,
        .do_acs = wpa_driver_do_acs,
        .set_band = nl80211_set_band,
        .get_pref_freq_list = nl80211_get_pref_freq_list,
index 61fc170df61618cadc4d8ed62a1bf5f7e51704d0..9ad39b8c676e71e230a89e62e8c586ce6e0a03f8 100644 (file)
@@ -717,6 +717,12 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                dpp_test = atoi(value);
 #endif /* CONFIG_DPP */
 #endif /* CONFIG_TESTING_OPTIONS */
+#ifdef CONFIG_FILS
+       } else if (os_strcasecmp(cmd, "disable_fils") == 0) {
+               wpa_s->disable_fils = !!atoi(value);
+               wpa_drv_disable_fils(wpa_s, wpa_s->disable_fils);
+               wpa_supplicant_set_default_scan_ies(wpa_s);
+#endif /* CONFIG_FILS */
 #ifndef CONFIG_NO_CONFIG_BLOBS
        } else if (os_strcmp(cmd, "blob") == 0) {
                ret = wpas_ctrl_set_blob(wpa_s, value);
index e131653e48b396c4ea50c877150cd8ee3f7c0dc6..81b4b5537c10e9ec7a8b38c6e22a88165ad06030 100644 (file)
@@ -689,6 +689,14 @@ static inline int wpa_drv_roaming(struct wpa_supplicant *wpa_s, int allowed,
        return wpa_s->driver->roaming(wpa_s->drv_priv, allowed, bssid);
 }
 
+static inline int wpa_drv_disable_fils(struct wpa_supplicant *wpa_s,
+                                      int disable)
+{
+       if (!wpa_s->driver->disable_fils)
+               return -1;
+       return wpa_s->driver->disable_fils(wpa_s->drv_priv, disable);
+}
+
 static inline int wpa_drv_set_mac_addr(struct wpa_supplicant *wpa_s,
                                       const u8 *addr)
 {
index 28e8d3186061d0ca55c69dc70b44f5134837c6ec..984fe02f74208487bc7e19a0b60d4908e171726d 100644 (file)
@@ -1606,7 +1606,8 @@ static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx)
                break;
        case 9: /* Bits 72-79 */
 #ifdef CONFIG_FILS
-               *pos |= 0x01;
+               if (!wpa_s->disable_fils)
+                       *pos |= 0x01;
 #endif /* CONFIG_FILS */
                break;
        }
index b1331a585c153b2261d3c82599244608cbcf562a..d4c01ba2a90303d50a41e1bd29ea5a6f853e84e6 100644 (file)
@@ -1215,6 +1215,10 @@ struct wpa_supplicant {
        unsigned int dpp_ignore_netaccesskey_mismatch:1;
 #endif /* CONFIG_TESTING_OPTIONS */
 #endif /* CONFIG_DPP */
+
+#ifdef CONFIG_FILS
+       unsigned int disable_fils:1;
+#endif /* CONFIG_FILS */
 };