Adding support for Transition Disable policy setting
With the implementation of seamless roaming across WPA3-SAE and
WPA2PSK, there is a need to avoid driver roam to APs with certain
security based on the Transition Disable policy set by the current AP.
The setting of Transition Disable policy to driver is done based
on the Transition disable bitmap received as part of EAPOL 3/4th frame.
Bug:210811506
Test:Validated on Hikey with Android-S
Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
Change-Id: Iaf95f6d635584f6df7c3866d5efde6b10db6a73e
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index acd122d..0783aa0 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -199,7 +199,9 @@
#endif /* CONFIG_MESH */
static int i802_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr,
u16 reason);
-
+#ifdef CONFIG_DRIVER_NL80211_BRCM
+static int nl80211_set_td_policy(void *priv, u32 td_policy);
+#endif /* CONFIG_DRIVER_NL80211_BRCM */
/* Converts nl80211_chan_width to a common format */
enum chan_width convert2width(int width)
@@ -12018,6 +12020,19 @@
if (drv->capa.flags & WPA_DRIVER_FLAGS_SME)
return 0;
+ /* Handle any connection param update here which might receive kernel handling in future */
+#ifdef CONFIG_DRIVER_NL80211_BRCM
+ if (mask & WPA_DRV_UPDATE_TD_POLICY) {
+ ret = nl80211_set_td_policy(priv, params->td_policy);
+ if (ret) {
+ wpa_dbg(drv->ctx, MSG_DEBUG,
+ "nl80211: Update connect params command failed: ret=%d (%s)",
+ ret, strerror(-ret));
+ }
+ return ret;
+ }
+#endif /* CONFIG_DRIVER_NL80211_BRCM */
+
msg = nl80211_drv_msg(drv, 0, NL80211_CMD_UPDATE_CONNECT_PARAMS);
if (!msg)
goto fail;
@@ -12171,6 +12186,36 @@
}
#endif /* CONFIG_DPP */
+#ifdef CONFIG_DRIVER_NL80211_BRCM
+static int nl80211_set_td_policy(void *priv, u32 td_policy)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg;
+ int ret;
+ struct nlattr *params;
+
+ if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_BRCM) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, BRCM_VENDOR_SCMD_SET_TD_POLICY) ||
+ !(params = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
+ (nla_put_u32(msg, BRCM_ATTR_DRIVER_TD_POLICY, td_policy))) {
+ nl80211_nlmsg_clear(msg);
+ nlmsg_free(msg);
+ return -ENOBUFS;
+ }
+ nla_nest_end(msg, params);
+ wpa_printf(MSG_DEBUG, "nl80211: Transition Disable Policy %d\n", td_policy);
+
+ ret = send_and_recv_msgs(drv, msg, NULL, (void *) -1, NULL, NULL);
+ if (ret) {
+ wpa_printf(MSG_DEBUG, "nl80211: Transition Disable setting failed: ret=%d (%s)",
+ ret, strerror(-ret));
+ }
+
+ return ret;
+}
+#endif /* CONFIG_DRIVER_NL80211_BRCM */
#ifdef CONFIG_TESTING_OPTIONS