Quellcode durchsuchen

qcacld-3.0: Define lim APIs to handle EHT information elements

As part of 11be enhancements, EHT operation and EHT capability
information elements were added. To support 11be in host driver,
define new APIs to handle these information elements in lim layer.

Change-Id: If615251cf874902263fe3c4faaf924fc9a3d9e23
CRs-Fixed: 2907952
Bapiraju Alla vor 4 Jahren
Ursprung
Commit
fb9aa31f27
2 geänderte Dateien mit 383 neuen und 0 gelöschten Zeilen
  1. 132 0
      core/mac/src/pe/lim/lim_utils.c
  2. 251 0
      core/mac/src/pe/lim/lim_utils.h

+ 132 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -69,6 +69,9 @@
 #include <lim_assoc_utils.h>
 #include "wlan_mlme_ucfg_api.h"
 #include "nan_ucfg_api.h"
+#ifdef WLAN_FEATURE_11BE
+#include "wma_eht.h"
+#endif
 
 /** -------------------------------------------------------------
    \fn lim_delete_dialogue_token_list
@@ -7691,6 +7694,135 @@ QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11BE
+QDF_STATUS lim_populate_eht_mcs_set(struct mac_context *mac_ctx,
+				    struct supported_rates *rates,
+				    tDot11fIEeht_cap *peer_eht_caps,
+				    struct pe_session *session_entry,
+				    uint8_t nss)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+void lim_add_self_eht_cap(tpAddStaParams add_sta_params,
+			  struct pe_session *session)
+{
+}
+
+/**
+ * lim_intersect_eht_caps() - Intersect peer capability and self capability
+ * @rcvd_eht: pointer to received peer capability
+ * @peer_eht: pointer to Intersected capability
+ * @session: A pointer to session entry.
+ *
+ * Return: None
+ */
+static void lim_intersect_eht_caps(tDot11fIEeht_cap *rcvd_eht,
+				   tDot11fIEeht_cap *peer_eht,
+				   struct pe_session *session)
+{
+}
+
+void lim_update_usr_eht_cap(struct mac_context *mac_ctx,
+			    struct pe_session *session)
+{
+}
+
+static void
+lim_revise_req_eht_cap_per_band(struct mlme_legacy_priv *mlme_priv,
+				struct pe_session *session)
+{
+}
+
+void lim_copy_bss_eht_cap(struct pe_session *session)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(session->vdev);
+	if (!mlme_priv)
+		return;
+	lim_revise_req_eht_cap_per_band(mlme_priv, session);
+	qdf_mem_copy(&session->eht_config, &mlme_priv->eht_config,
+		     sizeof(session->eht_config));
+}
+
+void lim_copy_join_req_eht_cap(struct pe_session *session)
+{
+}
+
+void lim_add_eht_cap(struct mac_context *mac_ctx, struct pe_session *pe_session,
+		     tpAddStaParams add_sta_params, tpSirAssocReq assoc_req)
+{
+}
+
+void lim_intersect_ap_eht_caps(struct pe_session *session,
+			       struct bss_params *add_bss,
+			       tSchBeaconStruct *beacon,
+			       tpSirAssocRsp assoc_rsp)
+{
+}
+
+void lim_add_bss_eht_cap(struct bss_params *add_bss, tpSirAssocRsp assoc_rsp)
+{
+}
+
+void lim_intersect_sta_eht_caps(struct mac_context *mac_ctx,
+				tpSirAssocReq assoc_req,
+				struct pe_session *session,
+				tpDphHashNode sta_ds)
+{
+	tDot11fIEeht_cap *rcvd_eht = &assoc_req->eht_cap;
+	tDot11fIEeht_cap *peer_eht = &sta_ds->eht_config;
+
+	if (!sta_ds->mlmStaContext.eht_capable)
+		return;
+
+	/* If EHT is not supported, do not fill sta_ds and return */
+	if (!IS_DOT11_MODE_EHT(session->dot11mode))
+		return;
+
+	lim_intersect_eht_caps(rcvd_eht, peer_eht, session);
+}
+
+void lim_update_session_eht_capable(struct mac_context *mac,
+				    struct pe_session *session)
+{
+	session->eht_capable = true;
+	pe_debug("eht_capable: %d", session->eht_capable);
+}
+
+void lim_add_bss_eht_cfg(struct bss_params *add_bss, struct pe_session *session)
+{
+}
+
+void lim_decide_eht_op(struct mac_context *mac_ctx, uint32_t *mlme_eht_ops,
+		       struct pe_session *session)
+{
+	struct eht_ops_network_endian *eht_ops_from_ie;
+	tDot11fIEeht_op eht_ops = {0};
+	struct add_ie_params *add_ie = &session->add_ie_params;
+	uint8_t extracted_buff[DOT11F_IE_EHT_OP_MAX_LEN + 2];
+	QDF_STATUS status;
+
+	qdf_mem_zero(extracted_buff, sizeof(extracted_buff));
+	status = lim_strip_ie(mac_ctx, add_ie->probeRespBCNData_buff,
+			      &add_ie->probeRespBCNDataLen,
+			      DOT11F_EID_EHT_OP, ONE_BYTE,
+			      EHT_OP_OUI_TYPE, (uint8_t)EHT_OP_OUI_SIZE,
+			      extracted_buff, DOT11F_IE_EHT_OP_MAX_LEN);
+	if (QDF_STATUS_SUCCESS != status) {
+		pe_debug("Failed to strip EHT OP IE status: %d", status);
+		return;
+	}
+	eht_ops_from_ie = (struct eht_ops_network_endian *)
+					&extracted_buff[EHT_OP_OUI_SIZE + 2];
+
+	qdf_mem_copy(&session->eht_op, &eht_ops, sizeof(tDot11fIEeht_op));
+
+	wma_update_vdev_eht_ops(mlme_eht_ops, &eht_ops);
+}
+#endif
+
 #if defined(CONFIG_BAND_6GHZ) && defined(WLAN_FEATURE_11AX)
 QDF_STATUS lim_send_he_6g_band_caps_ie(struct mac_context *mac_ctx,
 				       struct pe_session *session,

+ 251 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -928,6 +928,9 @@ void lim_merge_extcap_struct(tDot11fIEExtCap *dst, tDot11fIEExtCap *src,
 void lim_strip_he_ies_from_add_ies(struct mac_context *mac_ctx,
 				   struct pe_session *session);
 
+void lim_strip_eht_ies_from_add_ies(struct mac_context *mac_ctx,
+				    struct pe_session *session);
+
 /**
  * lim_del_pmf_sa_query_timer() - This function deletes SA query timer
  * @mac_ctx: pointer to mac context
@@ -1569,6 +1572,254 @@ lim_update_he_6ghz_band_caps(struct mac_context *mac,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11BE
+static inline bool lim_is_session_eht_capable(struct pe_session *session)
+{
+	return session->eht_capable;
+}
+
+static inline bool lim_is_sta_eht_capable(tpDphHashNode sta_ds)
+{
+	return sta_ds->mlmStaContext.eht_capable;
+}
+
+/**
+ * lim_populate_eht_mcs_set() - function to populate EHT mcs rate set
+ * @mac_ctx: pointer to global mac structure
+ * @rates: pointer to supported rate set
+ * @peer_eht_caps: pointer to peer EHT capabilities
+ * @session_entry: pe session entry
+ * @nss: number of spatial streams
+ *
+ * Populates EHT mcs rate set based on peer and self capabilities
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS lim_populate_eht_mcs_set(struct mac_context *mac_ctx,
+				    struct supported_rates *rates,
+				    tDot11fIEeht_cap *peer_eht_caps,
+				    struct pe_session *session_entry,
+				    uint8_t nss);
+
+/**
+ * lim_update_eht_bw_cap_mcs(): Update eht mcs map per bandwidth
+ * @session_entry: pointer to PE session
+ * @beacon: pointer to beacon
+ *
+ * Return: None
+ */
+void lim_update_eht_bw_cap_mcs(struct pe_session *session,
+			       tSirProbeRespBeacon *beacon);
+
+/**
+ * lim_add_self_eht_cap() - Copy EHT capability into add sta from PE session
+ * @add_sta_params: pointer to add sta params
+ * @session: pointer to PE Session
+ *
+ * Return: None
+ */
+void lim_add_self_eht_cap(tpAddStaParams add_sta_params,
+			  struct pe_session *session);
+
+/**
+ * lim_update_usr_eht_cap() - Update EHT capability based on userspace
+ * @mac_ctx: global mac context
+ * @session: PE session entry
+ *
+ * Parse the EHT Capability IE and populate the fields to be
+ * sent to FW as part of add bss and update PE session.
+ */
+void lim_update_usr_eht_cap(struct mac_context *mac_ctx,
+			    struct pe_session *session);
+
+/**
+ * lim_copy_bss_eht_cap() - Copy EHT capability into PE session from start bss
+ * @session: pointer to PE session
+ *
+ * Return: None
+ */
+void lim_copy_bss_eht_cap(struct pe_session *session);
+
+/**
+ * lim_copy_join_req_eht_cap() - Copy EHT capability to PE session from Join req
+ * and update as per bandwidth supported
+ * @session: pointer to PE session
+ *
+ * Return: None
+ */
+void lim_copy_join_req_eht_cap(struct pe_session *session);
+
+/**
+ * lim_add_eht_cap() - Copy EHT capability into Add sta params
+ * @mac_ctx: Global MAC context
+ * @pe_session: pe session entry
+ * @add_sta_params: pointer to add sta params
+ * @assoc_req: pointer to Assoc request
+ *
+ * Return: None
+ */
+void lim_add_eht_cap(struct mac_context *mac_ctx, struct pe_session *pe_session,
+		     tpAddStaParams add_sta_params, tpSirAssocReq assoc_req);
+
+/**
+ * lim_intersect_ap_eht_caps() - Intersect AP and self STA EHT capabilities
+ * @session: pointer to PE session
+ * @add_bss: pointer to ADD BSS params
+ * @beacon: pointer to beacon
+ * @assoc_rsp: pointer to assoc response
+ *
+ * Return: None
+ */
+void lim_intersect_ap_eht_caps(struct pe_session *session,
+			       struct bss_params *add_bss,
+			       tSchBeaconStruct *pBeaconStruct,
+			       tpSirAssocRsp assoc_rsp);
+
+/**
+ * lim_add_bss_eht_cap() - Copy EHT capability into ADD BSS params
+ * @add_bss: pointer to add bss params
+ * @assoc_rsp: pointer to assoc response
+ *
+ * Return: None
+ */
+void lim_add_bss_eht_cap(struct bss_params *add_bss, tpSirAssocRsp assoc_rsp);
+
+/**
+ * lim_intersect_sta_eht_caps() - Intersect STA capability with SAP capability
+ * @mac_ctx: pointer to the MAC context
+ * @assoc_req: pointer to assoc request
+ * @session: pointer to PE session
+ * @sta_ds: pointer to STA dph hash table entry
+ *
+ * Return: None
+ */
+void lim_intersect_sta_eht_caps(struct mac_context *mac_ctx,
+				tpSirAssocReq assoc_req,
+				struct pe_session *session,
+				tpDphHashNode sta_ds);
+
+/**
+ * lim_update_session_eht_capable(): Update eht_capable in PE session
+ * @mac: pointer to MAC context
+ * @session: pointer to PE session
+ *
+ * Return: None
+ */
+void lim_update_session_eht_capable(struct mac_context *mac,
+				    struct pe_session *session);
+
+/**
+ * lim_add_bss_eht_cfg() - Set EHT config to BSS params
+ * @add_bss: pointer to add bss params
+ * @session: Pointer to Session entry struct
+ *
+ * Return: None
+ */
+void lim_add_bss_eht_cfg(struct bss_params *add_bss,
+			 struct pe_session *session);
+
+/**
+ * lim_decide_eht_op() - Determine EHT operation elements
+ * @mac_ctx: global mac context
+ * @eht_ops: mlme eht ops
+ * @session: PE session entry
+ *
+ * Parse the EHT Operation IE and populate the fields to be
+ * sent to FW as part of add bss.
+ */
+void lim_decide_eht_op(struct mac_context *mac_ctx, uint32_t *mlme_eht_ops,
+		       struct pe_session *session);
+
+#else
+static inline bool lim_is_session_eht_capable(struct pe_session *session)
+{
+	return false;
+}
+
+static inline bool lim_is_sta_eht_capable(tpDphHashNode sta_ds)
+{
+	return false;
+}
+
+static inline
+QDF_STATUS lim_populate_eht_mcs_set(struct mac_context *mac_ctx,
+				    struct supported_rates *rates,
+				    tDot11fIEeht_cap *peer_eht_caps,
+				    struct pe_session *session_entry,
+				    uint8_t nss)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline void lim_update_eht_bw_cap_mcs(struct pe_session *session,
+					     tSirProbeRespBeacon *beacon)
+{
+}
+
+static inline void lim_add_self_eht_cap(tpAddStaParams add_sta_params,
+					struct pe_session *session)
+{
+}
+
+static inline void lim_update_usr_eht_cap(struct mac_context *mac_ctx,
+					  struct pe_session *session)
+{
+}
+
+static inline void lim_copy_bss_eht_cap(struct pe_session *session)
+{
+}
+
+static inline void lim_copy_join_req_eht_cap(struct pe_session *session)
+{
+}
+
+static inline void lim_add_eht_cap(struct mac_context *mac_ctx,
+				   struct pe_session *pe_session,
+				   tpAddStaParams add_sta_params,
+				   tpSirAssocReq assoc_req)
+{
+}
+
+static inline void
+lim_intersect_ap_eht_caps(struct pe_session *session,
+			  struct bss_params *add_bss,
+			  tSchBeaconStruct *pBeaconStruct,
+			  tpSirAssocRsp assoc_rsp)
+{
+}
+
+static inline void lim_add_bss_eht_cap(struct bss_params *add_bss,
+				       tpSirAssocRsp assoc_rsp)
+{
+}
+
+static inline
+void lim_intersect_sta_eht_caps(struct mac_context *mac_ctx,
+				tpSirAssocReq assoc_req,
+				struct pe_session *session,
+				tpDphHashNode sta_ds)
+{
+}
+
+static inline
+void lim_update_session_eht_capable(struct mac_context *mac,
+				    struct pe_session *session)
+{
+}
+
+static inline void
+lim_add_bss_eht_cfg(struct bss_params *add_bss, struct pe_session *session)
+{
+}
+
+static inline void
+lim_decide_eht_op(struct mac_context *mac_ctx, uint32_t *mlme_eht_ops,
+		  struct pe_session *session)
+{
+}
+#endif /* WLAN_FEATURE_11BE */
+
 #if defined(CONFIG_BAND_6GHZ) && defined(WLAN_FEATURE_11AX)
 /**
  * lim_send_he_6g_band_caps_ie() - Send HE 6ghz band caps to FW