Browse Source

qcacld-3.0: Set vdev tx data callback properly

When WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE enabled and user space sets
mac address, host will detach vdev and attach again without setting
vdev tx data callback. Then host tx TDLS discovery request timeout
since lim_mgmt_tdls_tx_complete isn't called, finally TDLS link
establish failed. This change set vdev tx data callback after dp vdev
detach and attach done.

Change-Id: Iada58ba2df0612a92503ccfa5f246f7cca9db9ad
CRs-Fixed: 3112831
Wu Gao 3 years ago
parent
commit
5924885bea

+ 1 - 0
core/hdd/src/wlan_hdd_main.c

@@ -5392,6 +5392,7 @@ status_ret:
 		hdd_err("Failed to attach CDP vdev. status:%d", qdf_ret_status);
 		return qdf_status_to_os_return(qdf_ret_status);
 	}
+	sme_vdev_set_data_tx_callback(adapter->vdev);
 
 	return ret;
 }

+ 11 - 0
core/sme/inc/sme_api.h

@@ -404,6 +404,17 @@ struct wlan_objmgr_vdev *sme_vdev_create(mac_handle_t mac_handle,
  */
 QDF_STATUS sme_vdev_post_vdev_create_setup(mac_handle_t mac_handle,
 					   struct wlan_objmgr_vdev *vdev);
+
+/**
+ * sme_vdev_set_data_tx_callback() - Set dp vdev tx callback
+ * @vdev: Object manger vdev
+ *
+ * This api will setup the dp vdev tx data callbaack.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS sme_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev);
+
 /**
  * sme_vdev_delete() - Delete vdev for given id
  * @mac_handle: The handle returned by mac_open.

+ 5 - 0
core/sme/src/common/sme_api.c

@@ -4681,6 +4681,11 @@ cleanup_wma:
 	return status;
 }
 
+QDF_STATUS sme_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev)
+{
+	return wma_vdev_set_data_tx_callback(vdev);
+}
+
 struct wlan_objmgr_vdev
 *sme_vdev_create(mac_handle_t mac_handle,
 		 struct wlan_vdev_create_params *vdev_params)

+ 12 - 1
core/wma/inc/wma_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -685,6 +685,17 @@ QDF_STATUS wma_sta_mlme_vdev_down_send(struct vdev_mlme_obj *vdev_mlme,
  */
 QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * wma_vdev_set_data_tx_callback() - Set dp vdev tx callback
+ * @vdev: vdev obj
+ *
+ * This API is used to set dp dev tx callback.
+ *
+ * Return: SUCCESS on successful post vdev operations, FAILURE, if it
+ *         fails due to any
+ */
+QDF_STATUS wma_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev);
+
 /**
  * wma_mon_mlme_vdev_start_continue() - VDEV start response handling
  * @vdev_mlme_obj:  VDEV MLME comp object

+ 21 - 5
core/wma/src/wma_dev_if.c

@@ -2664,7 +2664,6 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 	QDF_STATUS ret;
 	struct mlme_ht_capabilities_info *ht_cap_info;
 	u_int8_t vdev_id;
-	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct wlan_mlme_qos *qos_aggr;
 	struct vdev_mlme_obj *vdev_mlme;
 	tp_wma_handle wma_handle;
@@ -2673,7 +2672,7 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 		return QDF_STATUS_E_FAILURE;
 
 	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
-	if (!wma_handle || !soc)
+	if (!wma_handle)
 		return QDF_STATUS_E_FAILURE;
 
 	if (wlan_objmgr_vdev_try_get_ref(vdev, WLAN_LEGACY_WMA_ID) !=
@@ -2892,9 +2891,7 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 			wma_err("Failed to configure active APF mode");
 	}
 
-	cdp_data_tx_cb_set(soc, vdev_id,
-			   wma_data_tx_ack_comp_hdlr,
-			   wma_handle);
+	wma_vdev_set_data_tx_callback(vdev);
 
 	return QDF_STATUS_SUCCESS;
 
@@ -2903,6 +2900,25 @@ end:
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS wma_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev)
+{
+	u_int8_t vdev_id;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+	tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+
+	if (!vdev || !wma_handle || !soc) {
+		wma_err("null vdev, wma_handle or soc");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	cdp_data_tx_cb_set(soc, vdev_id,
+			   wma_data_tx_ack_comp_hdlr,
+			   wma_handle);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 enum mlme_bcn_tx_rate_code wma_get_bcn_rate_code(uint16_t rate)
 {
 	/* rate in multiples of 100 Kbps */