瀏覽代碼

qcacmn: Add missing params for the fils connection

Add missing params for the fils connection.

Change-Id: I7442670c30d7ddee201c2bc328372513302f971d
CRs-Fixed: 2857905
gaurank kathpalia 4 年之前
父節點
當前提交
bd8eeecda6

+ 13 - 0
os_if/linux/mlme/inc/osif_cm_req.h

@@ -54,6 +54,19 @@ struct osif_connect_params {
 	struct qdf_mac_addr prev_bssid;
 };
 
+#if defined(WLAN_FEATURE_FILS_SK) && \
+	(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
+		 (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
+/**
+ * osif_cm_get_fils_auth_type() - get fils auth type
+ * @auth: nl auth type
+ *
+ * Return: enum wlan_fils_auth_type
+ */
+enum wlan_fils_auth_type
+osif_cm_get_fils_auth_type(enum nl80211_auth_type auth);
+#endif
+
 /**
  * osif_cm_connect() - Connect start request
  * @dev: net dev

+ 17 - 0
os_if/linux/mlme/src/osif_cm_req.c

@@ -218,6 +218,21 @@ static bool osif_cm_is_conn_type_fils(const struct cfg80211_connect_params *req)
 	return true;
 }
 
+enum wlan_fils_auth_type
+osif_cm_get_fils_auth_type(enum nl80211_auth_type auth)
+{
+	switch (auth) {
+	case NL80211_AUTHTYPE_FILS_SK:
+		return FILS_SK_WITHOUT_PFS;
+	case NL80211_AUTHTYPE_FILS_SK_PFS:
+		return FILS_SK_WITH_PFS;
+	case NL80211_AUTHTYPE_FILS_PK:
+		return FILS_PK_AUTH;
+	default:
+		return FILS_PK_MAX;
+	}
+}
+
 static QDF_STATUS
 osif_cm_set_fils_info(struct wlan_cm_connect_req *connect_req,
 		      const struct cfg80211_connect_params *req)
@@ -257,6 +272,8 @@ osif_cm_set_fils_info(struct wlan_cm_connect_req *connect_req,
 	qdf_mem_zero(connect_req->fils_info.rrk, WLAN_CM_FILS_MAX_RRK_LENGTH);
 	qdf_mem_copy(connect_req->fils_info.rrk, req->fils_erp_rrk,
 		     connect_req->fils_info.rrk_len);
+	connect_req->fils_info.auth_type =
+		osif_cm_get_fils_auth_type(req->auth_type);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 3 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -1385,6 +1385,9 @@ static inline void cm_set_fils_connection(struct cnx_mgr *cm_ctx,
 {
 	int32_t key_mgmt;
 
+	/* return if already set */
+	if (resp->is_fils_connection)
+		return;
 	key_mgmt = wlan_crypto_get_param(cm_ctx->vdev,
 					 WLAN_CRYPTO_PARAM_KEY_MGMT);
 

+ 12 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_util.c

@@ -274,6 +274,16 @@ void cm_store_fils_key(struct cnx_mgr *cm_ctx, bool unicast,
 		   crypto_key->cipher_type, crypto_key->keylen,
 		   crypto_key->keyix, QDF_MAC_ADDR_REF(crypto_key->macaddr));
 }
+static void cm_set_fils_connection_from_req(struct wlan_cm_connect_req *req,
+					    struct wlan_cm_connect_resp *resp)
+{
+	resp->is_fils_connection = req->fils_info.is_fils_connection;
+}
+#else
+static inline
+void cm_set_fils_connection_from_req(struct wlan_cm_connect_req *req,
+				     struct wlan_cm_connect_resp *resp)
+{}
 #endif
 
 bool cm_check_cmid_match_list_head(struct cnx_mgr *cm_ctx, wlan_cm_id *cm_id)
@@ -399,6 +409,8 @@ cm_fill_connect_resp_from_req(struct wlan_cm_connect_resp *resp,
 		resp->freq = req->chan_freq;
 
 	resp->ssid = req->ssid;
+
+	cm_set_fils_connection_from_req(req, resp);
 }
 
 /**

+ 15 - 0
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h

@@ -82,6 +82,20 @@ struct wlan_cm_connect_crypto_info {
 #define WLAN_CM_FILS_MAX_REALM_LEN 255
 #define WLAN_CM_FILS_MAX_RRK_LENGTH 64
 
+/**
+ * enum wlan_fils_auth_type - fils auth type info
+ * @FILS_SK_WITHOUT_PFS: without pfs
+ * @FILS_SK_WITH_PFS: with pfs
+ * @FILS_PK_AUTH: fils auth
+ * @FILS_PK_MAX: max value
+ */
+enum wlan_fils_auth_type {
+	FILS_SK_WITHOUT_PFS,
+	FILS_SK_WITH_PFS,
+	FILS_PK_AUTH,
+	FILS_PK_MAX,
+};
+
 /**
  * struct wlan_fils_con_info - fils connect req info
  * @is_fils_connection: is fils connection
@@ -102,6 +116,7 @@ struct wlan_fils_con_info {
 	uint16_t next_seq_num;
 	uint32_t rrk_len;
 	uint8_t rrk[WLAN_CM_FILS_MAX_RRK_LENGTH];
+	enum wlan_fils_auth_type auth_type;
 };
 #endif