|
@@ -21287,10 +21287,9 @@ static void hdd_update_chan_info(struct hdd_context *hdd_ctx,
|
|
|
#undef CNT_DIFF
|
|
|
#undef MAX_COUNT
|
|
|
|
|
|
-#if defined(WLAN_FEATURE_FILS_SK) &&\
|
|
|
- defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) &&\
|
|
|
- (defined(CFG80211_UPDATE_CONNECT_PARAMS) ||\
|
|
|
- (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)))
|
|
|
+#ifndef UPDATE_ASSOC_IE
|
|
|
+#define UPDATE_ASSOC_IE BIT(0)
|
|
|
+#endif
|
|
|
|
|
|
#ifndef UPDATE_FILS_ERP_INFO
|
|
|
#define UPDATE_FILS_ERP_INFO BIT(1)
|
|
@@ -21300,62 +21299,43 @@ static void hdd_update_chan_info(struct hdd_context *hdd_ctx,
|
|
|
#define UPDATE_FILS_AUTH_TYPE BIT(2)
|
|
|
#endif
|
|
|
|
|
|
+#if defined(WLAN_FEATURE_FILS_SK) &&\
|
|
|
+ defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) &&\
|
|
|
+ (defined(CFG80211_UPDATE_CONNECT_PARAMS) ||\
|
|
|
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)))
|
|
|
+
|
|
|
|
|
|
- * __wlan_hdd_cfg80211_update_connect_params - update connect params
|
|
|
- * @wiphy: Handle to struct wiphy to get handle to module context.
|
|
|
- * @dev: Pointer to network device
|
|
|
+ * hdd_update_connect_params_fils_info() - Update fils parameters based on
|
|
|
+ * the update_connect_params received from userspace
|
|
|
+ * @adapter: Pointer to hdd_adapter
|
|
|
+ * @hdd_ctx: Pointer to hdd_context
|
|
|
* @req: Pointer to connect params
|
|
|
- * @changed: Bitmap used to indicate the changed params
|
|
|
- *
|
|
|
- * Update the connect parameters while connected to a BSS. The updated
|
|
|
- * parameters can be used by driver/firmware for subsequent BSS selection
|
|
|
- * (roaming) decisions and to form the Authentication/(Re)Association
|
|
|
- * Request frames. This call does not request an immediate disassociation
|
|
|
- * or reassociation with the current BSS, i.e., this impacts only
|
|
|
- * subsequent (re)associations. The bits in changed are defined in enum
|
|
|
- * cfg80211_connect_params_changed
|
|
|
+ * @changed: bitmap indicating which parameters have changed
|
|
|
*
|
|
|
- * Return: zero for success, non-zero for failure
|
|
|
+ * Return 0 on SUCCESS or error code on FAILURE
|
|
|
*/
|
|
|
static int
|
|
|
-__wlan_hdd_cfg80211_update_connect_params(struct wiphy *wiphy,
|
|
|
- struct net_device *dev,
|
|
|
- struct cfg80211_connect_params *req,
|
|
|
- uint32_t changed)
|
|
|
+hdd_update_connect_params_fils_info(struct hdd_adapter *adapter,
|
|
|
+ struct hdd_context *hdd_ctx,
|
|
|
+ struct cfg80211_connect_params *req,
|
|
|
+ uint32_t changed)
|
|
|
{
|
|
|
- struct csr_roam_profile *roam_profile;
|
|
|
uint8_t *buf;
|
|
|
- int ret;
|
|
|
- enum eAniAuthType auth_type;
|
|
|
- struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
- struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
|
QDF_STATUS status;
|
|
|
- struct cds_fils_connection_info *fils_info;
|
|
|
mac_handle_t mac_handle;
|
|
|
-
|
|
|
- hdd_enter_dev(dev);
|
|
|
-
|
|
|
- if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (ret)
|
|
|
- return -EINVAL;
|
|
|
+ struct csr_roam_profile *roam_profile;
|
|
|
+ struct cds_fils_connection_info *fils_info;
|
|
|
+ enum eAniAuthType auth_type;
|
|
|
|
|
|
roam_profile = hdd_roam_profile(adapter);
|
|
|
fils_info = roam_profile->fils_con_info;
|
|
|
-
|
|
|
+ mac_handle = hdd_ctx->mac_handle;
|
|
|
if (!fils_info) {
|
|
|
hdd_err("No valid FILS conn info");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- if (req->ie_len)
|
|
|
- wlan_hdd_cfg80211_set_ie(adapter, req->ie, req->ie_len);
|
|
|
-
|
|
|
- if (changed)
|
|
|
- fils_info->is_fils_connection = true;
|
|
|
-
|
|
|
+ fils_info->is_fils_connection = true;
|
|
|
if (changed & UPDATE_FILS_ERP_INFO) {
|
|
|
if (!wlan_hdd_fils_data_in_limits(req))
|
|
|
return -EINVAL;
|
|
@@ -21405,18 +21385,113 @@ __wlan_hdd_cfg80211_update_connect_params(struct wiphy *wiphy,
|
|
|
hdd_debug("fils conn update: changed %x is_fils %d keyname nai len %d",
|
|
|
changed, roam_profile->fils_con_info->is_fils_connection,
|
|
|
roam_profile->fils_con_info->key_nai_length);
|
|
|
-
|
|
|
- if (!hdd_ctx->is_fils_roaming_supported) {
|
|
|
- hdd_debug("FILS roaming support %d",
|
|
|
- hdd_ctx->is_fils_roaming_supported);
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- mac_handle = hdd_ctx->mac_handle;
|
|
|
+
|
|
|
+ * Update the FILS config from adapter->roam_profile to
|
|
|
+ * csr_session
|
|
|
+ */
|
|
|
status = sme_update_fils_config(mac_handle, adapter->vdev_id,
|
|
|
roam_profile);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
- hdd_err("Update FILS connect params to Fw failed %d", status);
|
|
|
+ hdd_err("Update FILS connect params to csr failed %d", status);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#else
|
|
|
+
|
|
|
+static int
|
|
|
+hdd_update_connect_params_fils_info(struct hdd_adapter *adapter,
|
|
|
+ struct hdd_context *hdd_ctx,
|
|
|
+ struct cfg80211_connect_params *req,
|
|
|
+ uint32_t changed)
|
|
|
+{
|
|
|
+ return -EINVAL;
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(CFG80211_UPDATE_CONNECT_PARAMS) ||\
|
|
|
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
|
|
|
+
|
|
|
+
|
|
|
+ * __wlan_hdd_cfg80211_update_connect_params - update connect params
|
|
|
+ * @wiphy: Handle to struct wiphy to get handle to module context.
|
|
|
+ * @dev: Pointer to network device
|
|
|
+ * @req: Pointer to connect params
|
|
|
+ * @changed: Bitmap used to indicate the changed params
|
|
|
+ *
|
|
|
+ * Update the connect parameters while connected to a BSS. The updated
|
|
|
+ * parameters can be used by driver/firmware for subsequent BSS selection
|
|
|
+ * (roaming) decisions and to form the Authentication/(Re)Association
|
|
|
+ * Request frames. This call does not request an immediate disassociation
|
|
|
+ * or reassociation with the current BSS, i.e., this impacts only
|
|
|
+ * subsequent (re)associations. The bits in changed are defined in enum
|
|
|
+ * cfg80211_connect_params_changed
|
|
|
+ *
|
|
|
+ * Return: zero for success, non-zero for failure
|
|
|
+ */
|
|
|
+static int
|
|
|
+__wlan_hdd_cfg80211_update_connect_params(struct wiphy *wiphy,
|
|
|
+ struct net_device *dev,
|
|
|
+ struct cfg80211_connect_params *req,
|
|
|
+ uint32_t changed)
|
|
|
+{
|
|
|
+ struct csr_roam_profile *roam_profile;
|
|
|
+ int ret;
|
|
|
+ struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
+ struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
|
+ QDF_STATUS status;
|
|
|
+ mac_handle_t mac_handle;
|
|
|
+
|
|
|
+ hdd_enter_dev(dev);
|
|
|
+
|
|
|
+ if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (ret)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ mac_handle = hdd_ctx->mac_handle;
|
|
|
+ roam_profile = hdd_roam_profile(adapter);
|
|
|
+
|
|
|
+ if (changed & UPDATE_ASSOC_IE) {
|
|
|
+
|
|
|
+ * Validate the elements of the IE and copy it to
|
|
|
+ * roam_profile in adapter
|
|
|
+ */
|
|
|
+ wlan_hdd_cfg80211_set_ie(adapter, req->ie, req->ie_len);
|
|
|
+
|
|
|
+
|
|
|
+ * Update this assoc IE received from user space to
|
|
|
+ * csr_session. RSO command will pick up the assoc
|
|
|
+ * IEs to be sent to firmware from the csr_session.
|
|
|
+ */
|
|
|
+ sme_update_session_assoc_ie(mac_handle, adapter->vdev_id,
|
|
|
+ roam_profile);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((changed & UPDATE_FILS_ERP_INFO) ||
|
|
|
+ (changed & UPDATE_FILS_AUTH_TYPE)) {
|
|
|
+ ret = hdd_update_connect_params_fils_info(adapter, hdd_ctx,
|
|
|
+ req, changed);
|
|
|
+ if (ret)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ if (!hdd_ctx->is_fils_roaming_supported) {
|
|
|
+ hdd_debug("FILS roaming support %d",
|
|
|
+ hdd_ctx->is_fils_roaming_supported);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (changed) {
|
|
|
+ status = sme_send_rso_connect_params(mac_handle,
|
|
|
+ adapter->vdev_id,
|
|
|
+ roam_profile);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ hdd_err("Update connect params to fw failed %d",
|
|
|
+ status);
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -21888,10 +21963,8 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
|
|
|
defined(CFG80211_ABORT_SCAN)
|
|
|
.abort_scan = wlan_hdd_cfg80211_abort_scan,
|
|
|
#endif
|
|
|
-#if defined(WLAN_FEATURE_FILS_SK) &&\
|
|
|
- defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) &&\
|
|
|
- (defined(CFG80211_UPDATE_CONNECT_PARAMS) ||\
|
|
|
- (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)))
|
|
|
+#if defined(CFG80211_UPDATE_CONNECT_PARAMS) || \
|
|
|
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
|
|
|
.update_connect_params = wlan_hdd_cfg80211_update_connect_params,
|
|
|
#endif
|
|
|
#if defined(WLAN_FEATURE_SAE) && \
|