ソースを参照

qcacmn: Add support for 11az RTT

- target_if layer was calling UMAC layer wifi_pos_get_rx_ops(). This was
  leading to compilation errror in WIN platform. Hence, added target_if
  layer API target_if_wifi_pos_get_rx_ops().

- WMI_RX_SERIALIZER_CTX is used to register PASN peer create and delete.
  WIN platform does not use the above context. Hence, use WMI_RX_UMAC_CTX
  for WIN and WMI_RX_SERIALIZER_CTX for MCC.

- WIFI_POS rx_ops callbacks are registered in target_if layer. But, these
  callbacks are called by UMAC component. Hence, move this registration
  function to UMAC layer.

- Add an API to convert host PASN peer type value to target defined value.

Change-Id: I2a262121f959c2343e88158b94468d104b9e164c
CRs-Fixed: 3289852
Shashikala Prabhu 2 年 前
コミット
5e43636b8c

+ 6 - 0
target_if/core/inc/target_if.h

@@ -66,6 +66,12 @@
 #define targetif_nofl_debug(params...) \
 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
 
+#ifdef SERIALIZE_WMI_RX_EXECUTION_CTX
+#define WMI_RX_EXECUTION_CTX WMI_RX_SERIALIZER_CTX
+#else
+#define WMI_RX_EXECUTION_CTX WMI_RX_UMAC_CTX
+#endif /* SERIALIZE_WMI_RX_EXECUTION_CTX */
+
 typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)(
 			void *scn_handle);
 

+ 0 - 13
target_if/wifi_pos/inc/target_if_wifi_pos_rx_ops.h

@@ -104,15 +104,6 @@ int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
 						   uint8_t *buf,
 						   uint32_t len);
 
-/**
- * target_if_wifi_pos_register_rx_ops() - Register wifi pos module target_if
- * RX ops
- * @rx_ops: RX ops pointer
- *
- * Return: None
- */
-void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
-
 #else
 static inline
 int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
@@ -129,9 +120,5 @@ int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
 {
 	return 0;
 }
-
-static inline
-void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
-{}
 #endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
 #endif /* _WIFI_POS_TGT_IF_RX_OPS_H_ */

+ 16 - 17
target_if/wifi_pos/src/target_if_wifi_pos_rx_ops.c

@@ -154,6 +154,20 @@ int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
 }
 
 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+static struct wlan_lmac_if_wifi_pos_rx_ops *
+target_if_wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_lmac_if_rx_ops *rx_ops;
+
+	rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
+	if (!rx_ops) {
+		wifi_pos_err("rx_ops is NULL");
+		return NULL;
+	}
+
+	return &rx_ops->wifi_pos_rx_ops;
+}
+
 int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
 						   uint8_t *buf,
 						   uint32_t len)
@@ -201,7 +215,7 @@ int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
 		return -EINVAL;
 	}
 
-	rx_ops = wifi_pos_get_rx_ops(psoc);
+	rx_ops = target_if_wifi_pos_get_rx_ops(psoc);
 	if (!rx_ops || !rx_ops->wifi_pos_ranging_peer_create_cb) {
 		wifi_pos_err("%s is null",
 			     !rx_ops ? "rx_ops" : "rx_ops_cb");
@@ -259,7 +273,7 @@ int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	rx_ops = wifi_pos_get_rx_ops(psoc);
+	rx_ops = target_if_wifi_pos_get_rx_ops(psoc);
 	if (!rx_ops || !rx_ops->wifi_pos_ranging_peer_delete_cb) {
 		wifi_pos_err("%s is null",
 			     !rx_ops ? "rx_ops" : "rx_ops_cb");
@@ -277,20 +291,5 @@ int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
 
 	return 0;
 }
-
-void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
-{
-	struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops =
-					&rx_ops->wifi_pos_rx_ops;
-
-	wifi_pos_rx_ops->wifi_pos_ranging_peer_create_cb =
-			wifi_pos_handle_ranging_peer_create;
-	wifi_pos_rx_ops->wifi_pos_ranging_peer_create_rsp_cb =
-			wifi_pos_handle_ranging_peer_create_rsp;
-	wifi_pos_rx_ops->wifi_pos_ranging_peer_delete_cb =
-			wifi_pos_handle_ranging_peer_delete;
-	wifi_pos_rx_ops->wifi_pos_vdev_delete_all_ranging_peers_rsp_cb =
-			wifi_pos_vdev_delete_all_ranging_peers_rsp;
-}
 #endif
 

+ 2 - 4
target_if/wifi_pos/src/target_if_wifi_pos_tx_ops.c

@@ -168,7 +168,7 @@ target_if_wifi_pos_register_11az_events(struct wlan_objmgr_psoc *psoc)
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_rtt_pasn_peer_create_req_eventid,
 			target_if_wifi_pos_pasn_peer_create_ev_handler,
-			WMI_RX_SERIALIZER_CTX);
+			WMI_RX_EXECUTION_CTX);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		target_if_err("register pasn peer create event_handler failed");
 		return QDF_STATUS_E_INVAL;
@@ -178,7 +178,7 @@ target_if_wifi_pos_register_11az_events(struct wlan_objmgr_psoc *psoc)
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_rtt_pasn_peer_delete_eventid,
 			target_if_wifi_pos_pasn_peer_delete_ev_handler,
-			WMI_RX_SERIALIZER_CTX);
+			WMI_RX_EXECUTION_CTX);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		target_if_err("register pasn peer delete event_handler failed");
 		return status;
@@ -313,8 +313,6 @@ void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	wifi_pos_tx_ops->data_req_tx = target_if_wifi_pos_oem_data_req;
 	wifi_pos_tx_ops->wifi_pos_parse_measreq_chan_info =
 			target_if_wifi_pos_parse_measreq_chan_info;
-	wifi_pos_tx_ops->wifi_pos_vdev_delete_all_ranging_peers_cb =
-			wifi_pos_vdev_delete_all_ranging_peers;
 
 	target_if_wifi_pos_register_11az_ops(wifi_pos_tx_ops);
 }

+ 5 - 5
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -907,9 +907,6 @@ struct wlan_lmac_if_iot_sim_tx_ops {
  *                                    request buffer.
  * @send_rtt_pasn_auth_status: Send PASN peers authentication status
  * @send_rtt_pasn_deauth: Send PASN peer deauth command
- * @wifi_pos_delete_all_vdev_ranging_peers_cb: Delete all ranging peers for
- * given vdev. This is called before vdev delete to cleanup all the ranging
- * peers of that vdev.
  */
 struct wlan_lmac_if_wifi_pos_tx_ops {
 	QDF_STATUS (*wifi_pos_register_events)(struct wlan_objmgr_psoc *psoc);
@@ -932,8 +929,6 @@ struct wlan_lmac_if_wifi_pos_tx_ops {
 			 struct wlan_pasn_auth_status *data);
 	QDF_STATUS (*send_rtt_pasn_deauth)(struct wlan_objmgr_psoc *psoc,
 					   struct qdf_mac_addr *peer_mac);
-	QDF_STATUS (*wifi_pos_vdev_delete_all_ranging_peers_cb)
-					(struct wlan_objmgr_vdev *vdev);
 };
 #endif
 
@@ -2013,6 +2008,9 @@ struct wlan_lmac_if_iot_sim_rx_ops {
  * pointer.
  * @wifi_pos_vdev_delete_all_ranging_peers_rsp_cb: Callback to handle vdev
  * delete all ranging peers response
+ * @wifi_pos_vdev_delete_all_ranging_peers_cb: Delete all ranging peers for
+ * given vdev. This is called before vdev delete to cleanup all the ranging
+ * peers of that vdev.
  */
 struct wlan_lmac_if_wifi_pos_rx_ops {
 	int (*oem_rsp_event_rx)(struct wlan_objmgr_psoc *psoc,
@@ -2032,6 +2030,8 @@ struct wlan_lmac_if_wifi_pos_rx_ops {
 			 uint8_t vdev_id, uint8_t num_peers);
 	QDF_STATUS (*wifi_pos_vdev_delete_all_ranging_peers_rsp_cb)
 			(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
+	QDF_STATUS (*wifi_pos_vdev_delete_all_ranging_peers_cb)
+					(struct wlan_objmgr_vdev *vdev);
 };
 #endif
 

+ 14 - 1
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -91,6 +91,9 @@
 #ifdef WLAN_FEATURE_DBAM_CONFIG
 #include "target_if_coex.h"
 #endif
+#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+#include <wifi_pos_pasn_api.h>
+#endif
 
 #include "target_if.h"
 
@@ -321,7 +324,17 @@ wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 static void
 wlan_lmac_if_wifi_pos_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
 {
-	target_if_wifi_pos_register_rx_ops(rx_ops);
+	struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops =
+		&rx_ops->wifi_pos_rx_ops;
+
+	wifi_pos_rx_ops->wifi_pos_ranging_peer_create_cb =
+			wifi_pos_handle_ranging_peer_create;
+	wifi_pos_rx_ops->wifi_pos_ranging_peer_create_rsp_cb =
+			wifi_pos_handle_ranging_peer_create_rsp;
+	wifi_pos_rx_ops->wifi_pos_ranging_peer_delete_cb =
+			wifi_pos_handle_ranging_peer_delete;
+	wifi_pos_rx_ops->wifi_pos_vdev_delete_all_ranging_peers_rsp_cb =
+			wifi_pos_vdev_delete_all_ranging_peers_rsp;
 }
 #else
 static inline void

+ 3 - 10
umac/wifi_pos/inc/wifi_pos_api.h

@@ -422,12 +422,10 @@ struct wlan_objmgr_psoc *wifi_pos_get_psoc(void);
 
 /**
  * wifi_pos_get_legacy_ops() - Get wifi pos legacy ops
- * @psoc: PSOC pointer
  *
  * Return: Pointer to legacy ops
  */
-struct wifi_pos_legacy_ops *
-wifi_pos_get_legacy_ops(struct wlan_objmgr_psoc *psoc);
+struct wifi_pos_legacy_ops *wifi_pos_get_legacy_ops(void);
 
 /**
  * wifi_pos_set_legacy_ops() - Set Wifi Pos legacy ops
@@ -651,23 +649,18 @@ wifi_pos_get_peer_private_object(struct wlan_objmgr_peer *peer);
 
 /**
  * wifi_pos_register_osif_callbacks() - Register OSIF callbacks
- * @psoc: Pointer to psoc object
  * @ops: Osif callbacks pointer
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS
-wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
-				 struct wifi_pos_osif_ops *ops);
+QDF_STATUS wifi_pos_register_osif_callbacks(struct wifi_pos_osif_ops *ops);
 
 /**
  * wifi_pos_get_osif_callbacks() - Get OS IF callbacks
- * @psoc: Pointer to PSOC object
  *
  * Return: struct wifi_pos_osif_ops pointer
  */
-struct wifi_pos_osif_ops *
-wifi_pos_get_osif_callbacks(struct wlan_objmgr_psoc *psoc);
+struct wifi_pos_osif_ops *wifi_pos_get_osif_callbacks(void);
 #endif /* WIFI_POS_CONVERGED */
 
 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)

+ 2 - 2
umac/wifi_pos/inc/wifi_pos_ucfg_i.h

@@ -61,7 +61,7 @@ static inline QDF_STATUS
 ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
 				      struct wifi_pos_osif_ops *osif_ops)
 {
-	return wifi_pos_register_osif_callbacks(psoc, osif_ops);
+	return wifi_pos_register_osif_callbacks(osif_ops);
 }
 
 /**
@@ -74,7 +74,7 @@ ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
 static inline QDF_STATUS
 ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc *psoc)
 {
-	return wifi_pos_register_osif_callbacks(psoc, NULL);
+	return wifi_pos_register_osif_callbacks(NULL);
 }
 #else
 static inline QDF_STATUS

+ 7 - 11
umac/wifi_pos/src/wifi_pos_api.c

@@ -52,11 +52,10 @@ wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc)
 	return &rx_ops->wifi_pos_rx_ops;
 }
 
-struct wifi_pos_legacy_ops *
-wifi_pos_get_legacy_ops(struct wlan_objmgr_psoc *psoc)
+struct wifi_pos_legacy_ops *wifi_pos_get_legacy_ops(void)
 {
 	struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
-			wifi_pos_get_psoc_priv_obj(psoc);
+			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
 
 	if (!wifi_pos_obj)
 		return NULL;
@@ -69,7 +68,7 @@ wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc,
 			struct wifi_pos_legacy_ops *legacy_ops)
 {
 	struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
-			wifi_pos_get_psoc_priv_obj(psoc);
+			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
 
 	if (!wifi_pos_obj)
 		return QDF_STATUS_E_FAILURE;
@@ -673,12 +672,10 @@ QDF_STATUS wifi_pos_register_send_action(
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS
-wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
-				 struct wifi_pos_osif_ops *ops)
+QDF_STATUS wifi_pos_register_osif_callbacks(struct wifi_pos_osif_ops *ops)
 {
 	struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
-			wifi_pos_get_psoc_priv_obj(psoc);
+			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
 
 	if (!wifi_pos_obj) {
 		wifi_pos_err("wifi_pos priv obj is null");
@@ -690,11 +687,10 @@ wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
-struct wifi_pos_osif_ops *
-wifi_pos_get_osif_callbacks(struct wlan_objmgr_psoc *psoc)
+struct wifi_pos_osif_ops *wifi_pos_get_osif_callbacks(void)
 {
 	struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
-			wifi_pos_get_psoc_priv_obj(psoc);
+			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
 
 	if (!wifi_pos_obj) {
 		wifi_pos_err("wifi_pos priv obj is null");

+ 2 - 0
umac/wifi_pos/src/wifi_pos_main.c

@@ -1237,6 +1237,8 @@ void wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
 
 	wifi_pos_rx_ops = &rx_ops->wifi_pos_rx_ops;
 	wifi_pos_rx_ops->oem_rsp_event_rx = wifi_pos_oem_rsp_handler;
+	wifi_pos_rx_ops->wifi_pos_vdev_delete_all_ranging_peers_cb =
+			wifi_pos_vdev_delete_all_ranging_peers;
 }
 
 QDF_STATUS wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,

+ 5 - 5
umac/wifi_pos/src/wifi_pos_pasn_api.c

@@ -266,7 +266,7 @@ wifi_pos_request_external_pasn_auth(struct wlan_objmgr_psoc *psoc,
 	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE)
 		return QDF_STATUS_E_INVAL;
 
-	osif_cb = wifi_pos_get_osif_callbacks(psoc);
+	osif_cb = wifi_pos_get_osif_callbacks();
 	if (!osif_cb || !osif_cb->osif_initiate_pasn_cb) {
 		wifi_pos_err("OSIF %s cb is NULL",
 			     !osif_cb ? "" : "PASN");
@@ -297,7 +297,7 @@ wifi_pos_request_flush_pasn_keys(struct wlan_objmgr_psoc *psoc,
 	struct wifi_pos_osif_ops *osif_cb;
 	QDF_STATUS status;
 
-	osif_cb = wifi_pos_get_osif_callbacks(psoc);
+	osif_cb = wifi_pos_get_osif_callbacks();
 	if (!osif_cb || !osif_cb->osif_initiate_pasn_cb) {
 		wifi_pos_err("OSIF %s cb is NULL",
 			     !osif_cb ? "" : "PASN");
@@ -354,7 +354,7 @@ QDF_STATUS wifi_pos_handle_ranging_peer_create(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t i;
 
-	legacy_cb = wifi_pos_get_legacy_ops(psoc);
+	legacy_cb = wifi_pos_get_legacy_ops();
 	if (!legacy_cb || !legacy_cb->pasn_peer_create_cb) {
 		wifi_pos_err("legacy callbacks is not registered");
 		return QDF_STATUS_E_FAILURE;
@@ -532,7 +532,7 @@ QDF_STATUS wifi_pos_handle_ranging_peer_delete(struct wlan_objmgr_psoc *psoc,
 	}
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_WIFI_POS_CORE_ID);
 
-	legacy_cb = wifi_pos_get_legacy_ops(psoc);
+	legacy_cb = wifi_pos_get_legacy_ops();
 	if (!legacy_cb || !legacy_cb->pasn_peer_delete_cb) {
 		wifi_pos_err("legacy callback is not registered");
 		return QDF_STATUS_E_FAILURE;
@@ -823,7 +823,7 @@ wifi_pos_vdev_delete_all_ranging_peers_rsp(struct wlan_objmgr_psoc *psoc,
 
 	vdev_pos_obj->is_delete_all_pasn_peer_in_progress = false;
 
-	legacy_cb = wifi_pos_get_legacy_ops(psoc);
+	legacy_cb = wifi_pos_get_legacy_ops();
 	if (!legacy_cb || !legacy_cb->pasn_vdev_delete_resume_cb) {
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_WIFI_POS_CORE_ID);
 		wifi_pos_err("legacy callbacks is not registered");

+ 18 - 1
wmi/src/wmi_unified_tlv.c

@@ -1874,6 +1874,23 @@ static QDF_STATUS send_vdev_up_cmd_tlv(wmi_unified_t wmi,
 	return 0;
 }
 
+#ifdef ENABLE_HOST_TO_TARGET_CONVERSION
+static uint32_t convert_peer_type_host_to_target(uint32_t peer_type)
+{
+	/* Host sets the peer_type as 0 for the peer create command sent to FW
+	 * other than PASN peer create command.
+	 */
+	if (peer_type == WLAN_PEER_RTT_PASN)
+		return WMI_PEER_TYPE_PASN;
+
+	return peer_type;
+}
+#else
+static uint32_t convert_peer_type_host_to_target(uint32_t peer_type)
+{
+	return peer_type;
+}
+#endif
 /**
  * send_peer_create_cmd_tlv() - send peer create command to fw
  * @wmi: wmi handle
@@ -1902,7 +1919,7 @@ static QDF_STATUS send_peer_create_cmd_tlv(wmi_unified_t wmi,
 		       WMITLV_GET_STRUCT_TLVLEN
 			       (wmi_peer_create_cmd_fixed_param));
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(param->peer_addr, &cmd->peer_macaddr);
-	cmd->peer_type = param->peer_type;
+	cmd->peer_type = convert_peer_type_host_to_target(param->peer_type);
 	cmd->vdev_id = param->vdev_id;
 
 	buf_ptr = (uint8_t *)wmi_buf_data(buf);