Przeglądaj źródła

qcacmn: Don't set vdev packet type when vdev up

Vdev decap/encap type has been set when vdev create, don't need
set again when vdev up.

Vdev mlme mgmt.generic.rx_decap_type isn't initialized, can't be
used to set vdev decap type.

Add tgt_vdev_mgr_set_tx_rx_decap_type to set vdev tx/rx cap/decap
type by wlan_util_vdev_mlme_set_param.

Change-Id: If487a890eafd0e4e5e6cda31c22d459e342770de
CRs-Fixed: 2516997
Jianmin Zhu 5 lat temu
rodzic
commit
ce7b04766e

+ 31 - 0
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c

@@ -36,6 +36,7 @@
 #include <wlan_vdev_mgr_utils_api.h>
 #include <wlan_cmn.h>
 #include <wmi_unified_vdev_api.h>
+#include <cdp_txrx_ctrl.h>
 
 static QDF_STATUS target_if_vdev_mgr_register_event_handler(
 					struct wlan_objmgr_psoc *psoc)
@@ -320,6 +321,34 @@ target_if_vdev_mlme_id_2_wmi(uint32_t cfg_id)
 	return wmi_id;
 }
 
+static
+QDF_STATUS target_if_vdev_set_tx_rx_decap_type(struct wlan_objmgr_vdev *vdev,
+					       enum wlan_mlme_cfg_id param_id,
+					       uint32_t value)
+{
+	ol_txrx_soc_handle soc_txrx_handle;
+	struct cdp_vdev *vdev_txrx_handle;
+	struct wlan_objmgr_psoc *psoc;
+
+	psoc = wlan_vdev_get_psoc(vdev);
+	soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
+	vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev);
+
+	if (!soc_txrx_handle || !vdev_txrx_handle)
+		return QDF_STATUS_E_INVAL;
+
+	if (param_id ==  WLAN_MLME_CFG_TX_DECAP_TYPE)
+		cdp_set_tx_encap_type(soc_txrx_handle,
+				      (struct cdp_vdev *)vdev_txrx_handle,
+				      value);
+	else if (param_id == WLAN_MLME_CFG_RX_DECAP_TYPE)
+		cdp_set_vdev_rx_decap_type(soc_txrx_handle,
+					   (struct cdp_vdev *)vdev_txrx_handle,
+					   value);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 static QDF_STATUS target_if_vdev_mgr_set_param_send(
 					struct wlan_objmgr_vdev *vdev,
 					struct vdev_set_params *param)
@@ -1071,6 +1100,8 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	mlme_tx_ops->beacon_tmpl_send = target_if_vdev_mgr_beacon_tmpl_send;
 	mlme_tx_ops->vdev_set_param_send =
 			target_if_vdev_mgr_set_param_send;
+	mlme_tx_ops->vdev_set_tx_rx_decap_type =
+			target_if_vdev_set_tx_rx_decap_type;
 	mlme_tx_ops->vdev_sta_ps_param_send =
 			target_if_vdev_mgr_sta_ps_param_send;
 	mlme_tx_ops->vdev_mgr_rsp_timer_init =

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

@@ -180,7 +180,7 @@ struct wlan_lmac_if_ftm_tx_ops {
 				uint8_t *buf, uint32_t len, uint8_t mac_id);
 };
 
-
+enum wlan_mlme_cfg_id;
 /**
  * struct wlan_lmac_if_mlme_tx_ops - south bound tx function pointers for mlme
  * @scan_sta_power_events: function to handle STA power events
@@ -198,6 +198,7 @@ struct wlan_lmac_if_ftm_tx_ops {
  * @vdev_stop_send: function to send vdev stop
  * @vdev_down_send: function to send vdev down
  * @vdev_set_param_send: function to send vdev parameter
+ * @vdev_set_tx_rx_decap_type: function to send vdev tx rx cap/decap type
  * @vdev_set_nac_rssi_send: function to send nac rssi
  * @vdev_set_neighbour_rx_cmd_send: function to send vdev neighbour rx cmd
  * @vdev_sifs_trigger_send: function to send vdev sifs trigger
@@ -240,6 +241,9 @@ struct wlan_lmac_if_mlme_tx_ops {
 				     struct vdev_down_params *param);
 	QDF_STATUS (*vdev_set_param_send)(struct wlan_objmgr_vdev *vdev,
 					  struct vdev_set_params *param);
+	QDF_STATUS (*vdev_set_tx_rx_decap_type)(struct wlan_objmgr_vdev *vdev,
+						enum wlan_mlme_cfg_id param_id,
+						uint32_t value);
 	QDF_STATUS (*vdev_set_nac_rssi_send)(
 				struct wlan_objmgr_vdev *vdev,
 				struct vdev_scan_nac_rssi_params *param);

+ 12 - 0
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h

@@ -233,6 +233,18 @@ QDF_STATUS tgt_vdev_mgr_multiple_vdev_restart_send(
 				struct wlan_objmgr_pdev *pdev,
 				struct multiple_vdev_restart_params *param);
 
+/**
+ * tgt_vdev_mgr_set_tx_rx_decap_type() – API to send tx rx decap type
+ * @mlme_obj: pointer to vdev mlme obj
+ * @param_id: param id
+ * value: value to set for param id
+ *
+ * Return: QDF_STATUS - Success or Failure
+ */
+QDF_STATUS tgt_vdev_mgr_set_tx_rx_decap_type(struct vdev_mlme_obj *mlme_obj,
+					     enum wlan_mlme_cfg_id param_id,
+					     uint32_t value);
+
 /**
  * tgt_vdev_mgr_set_param_send() – API to send parameter cfg
  * @mlme_obj: pointer to vdev_mlme_obj

+ 29 - 7
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c

@@ -314,13 +314,6 @@ QDF_STATUS tgt_vdev_mgr_up_send(
 	if (!soc_txrx_handle || !vdev_txrx_handle)
 		return QDF_STATUS_E_INVAL;
 
-	cdp_set_vdev_rx_decap_type(soc_txrx_handle,
-				   (struct cdp_vdev *)vdev_txrx_handle,
-				   mlme_obj->mgmt.generic.rx_decap_type);
-	cdp_set_tx_encap_type(soc_txrx_handle,
-			      (struct cdp_vdev *)vdev_txrx_handle,
-			      mlme_obj->mgmt.generic.tx_decap_type);
-
 	status = txops->vdev_up_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
 		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
@@ -518,6 +511,35 @@ QDF_STATUS tgt_vdev_mgr_multiple_vdev_restart_send(
 	return status;
 }
 
+QDF_STATUS tgt_vdev_mgr_set_tx_rx_decap_type(struct vdev_mlme_obj *mlme_obj,
+					     enum wlan_mlme_cfg_id param_id,
+					     uint32_t value)
+{
+	QDF_STATUS status;
+	struct wlan_lmac_if_mlme_tx_ops *txops;
+	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
+
+	if (!mlme_obj) {
+		mlme_err("Invalid input");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
+	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
+	if (!txops || !txops->vdev_set_tx_rx_decap_type) {
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	status = txops->vdev_set_tx_rx_decap_type(vdev, param_id, value);
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
+
+	return status;
+}
+
 QDF_STATUS tgt_vdev_mgr_set_param_send(
 				struct vdev_mlme_obj *mlme_obj,
 				struct vdev_set_params *param)

+ 7 - 0
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c

@@ -27,6 +27,7 @@
 #include <cdp_txrx_cmn_struct.h>
 #include <wlan_mlme_dbg.h>
 #include <qdf_module.h>
+#include <wlan_vdev_mgr_tgt_if_tx_api.h>
 
 static QDF_STATUS vdev_mgr_config_ratemask_update(
 				struct vdev_mlme_obj *mlme_obj,
@@ -325,9 +326,15 @@ wlan_util_vdev_mlme_set_param(struct vdev_mlme_obj *vdev_mlme,
 		break;
 	case WLAN_MLME_CFG_TX_DECAP_TYPE:
 		mlme_mgmt->generic.tx_decap_type = mlme_cfg.value;
+		tgt_vdev_mgr_set_tx_rx_decap_type(vdev_mlme,
+						  WLAN_MLME_CFG_TX_DECAP_TYPE,
+						  mlme_cfg.value);
 		break;
 	case WLAN_MLME_CFG_RX_DECAP_TYPE:
 		mlme_mgmt->generic.rx_decap_type = mlme_cfg.value;
+		tgt_vdev_mgr_set_tx_rx_decap_type(vdev_mlme,
+						  WLAN_MLME_CFG_RX_DECAP_TYPE,
+						  mlme_cfg.value);
 		break;
 	case WLAN_MLME_CFG_RATEMASK_TYPE:
 		mlme_mgmt->rate_info.type = mlme_cfg.value;