Ver Fonte

qcacld-3.0: Remove unused tdls structures in pe

It alloc memory with structures in sir_api.h, and process/parse them
with structures in tdls component, which will cause memory corruption
potentially. So, this change refacor these functions and let them use
unified structures. Remove unused structures in sir_api.h
Here are these functions:
- lim_send_sme_tdls_add_sta_rsp
- lim_send_tdls_comp_mgmt_rsp
- lim_send_sme_tdls_del_sta_rsp
- lim_send_sme_mgmt_tx_completion

Remove below unused tdls structures:
- tSirTdlsDelAllPeerInd
- tSirTdlsDelStaInd
- tSirTdlsEventnotify
- tSirTdlsLinkEstablishReq
- tSirTdlsLinkEstablishReqRsp
- tSirTdlsAddStaRsp
- tSirTdlsDelStaRsp
- tSirMgmtTxCompletionInd

Change-Id: Ic595cadefcdbeb2df44f97563c4652db409213a2
CRs-Fixed: 2373706
Wu Gao há 6 anos atrás
pai
commit
48b3980813

+ 1 - 94
tdls/core/src/wlan_tdls_cmds_process.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. 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
@@ -29,53 +29,6 @@
 	((TDLS_SETUP_REQUEST <= action) && \
 	(TDLS_SETUP_CONFIRM >= action))
 
-/**
- * enum legacy_result_code - defined to comply with tSirResultCodes, need refine
- *                           when mlme converged.
- * @legacy_result_success: success
- * @legacy_result_max: max result value
- */
-enum legacy_result_code {
-	legacy_result_success,
-	legacy_result_max = 0x7FFFFFFF
-};
-
-/**
- * struct tdls_send_mgmt_rsp - TDLS Response struct PE --> TDLS module
- *                           same as struct tSirSmeRsp
- * @message_type: message type eWNI_SME_TDLS_SEND_MGMT_RSP
- * @length: message length
- * @session_id: session id
- * @transaction_id: transaction id
- * @status_code: status code as tSirResultCodes
- * @psoc: soc object
- */
-struct tdls_send_mgmt_rsp {
-	uint16_t message_type;
-	uint16_t length;
-	uint8_t session_id;
-	uint16_t transaction_id;
-	enum legacy_result_code status_code;
-	struct wlan_objmgr_psoc *psoc;
-};
-
-/**
- * struct tdls_mgmt_tx_completion_ind - TDLS TX completion PE --> TDLS module
- *                           same as struct sSirMgmtTxCompletionInd
- * @message_type: message type eWNI_SME_MGMT_FRM_TX_COMPLETION_IND
- * @length: message length
- * @session_id: session id
- * @tx_complete_status: tx complete status
- * @psoc: soc object
- */
-struct tdls_mgmt_tx_completion_ind {
-	uint16_t message_type;
-	uint16_t length;
-	uint8_t session_id;      /* Session ID */
-	uint32_t tx_complete_status;
-	struct wlan_objmgr_psoc *psoc;
-};
-
 /**
  * struct tdls_add_sta_req - TDLS request struct TDLS module --> PE
  *                           same as struct tSirTdlsAddStaReq;
@@ -117,31 +70,6 @@ struct tdls_add_sta_req {
 	uint8_t max_sp;
 };
 
-/**
- * struct tdls_add_sta_rsp - TDLS Response struct PE --> TDLS module
- *                           same as struct sSirTdlsAddStaRsp
- * @message_type: message type eWNI_SME_TDLS_ADD_STA_RSP
- * @length: message length
- * @status_code: status code as tSirResultCodes
- * @peermac: MAC address of the TDLS peer
- * @session_id: session id
- * @sta_id: sta id
- * @sta_type: sta type
- * @tdls_oper: add peer type
- * @psoc: soc object
- */
-struct tdls_add_sta_rsp {
-	uint16_t message_type;
-	uint16_t length;
-	QDF_STATUS status_code;
-	struct qdf_mac_addr peermac;
-	uint8_t session_id;
-	uint16_t sta_id;
-	uint16_t sta_type;
-	enum tdls_add_oper tdls_oper;
-	struct wlan_objmgr_psoc *psoc;
-};
-
 /**
  * struct tdls_del_sta_req - TDLS Request struct TDLS module --> PE
  *                           same as sSirTdlsDelStaReq
@@ -161,27 +89,6 @@ struct tdls_del_sta_req {
 	struct qdf_mac_addr peermac;
 };
 
-/**
- * struct tdls_del_sta_rsp - TDLS Response struct PE --> TDLS module
- *                           same as sSirTdlsDelStaRsp
- * @message_type: message type eWNI_SME_TDLS_DEL_STA_RSP
- * @length: message length
- * @session_id: session id
- * @status_code: status code as tSirResultCodes
- * @peermac: MAC address of the TDLS peer
- * @sta_id: sta id
- * @psoc: soc object
- */
-struct tdls_del_sta_rsp {
-	uint16_t message_type;
-	uint16_t length;
-	uint8_t session_id;
-	QDF_STATUS status_code;
-	struct qdf_mac_addr peermac;
-	uint16_t sta_id;
-	struct wlan_objmgr_psoc *psoc;
-};
-
 /**
  * tdls_process_add_peer() - add TDLS peer
  * @req: TDLS add peer request

+ 78 - 1
tdls/dispatcher/inc/wlan_tdls_public_structs.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. 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
@@ -1167,4 +1167,81 @@ struct tdls_set_secoffchanneloffset {
 	tdls_offchan_parms_callback callback;
 };
 
+/**
+ * enum legacy_result_code - defined to comply with tSirResultCodes, need refine
+ *                           when mlme converged.
+ * @legacy_result_success: success
+ * @legacy_result_max: max result value
+ */
+enum legacy_result_code {
+	legacy_result_success,
+	legacy_result_max = 0x7FFFFFFF
+};
+
+/**
+ * struct tdls_send_mgmt_rsp - TDLS Response struct PE --> TDLS module
+ *                           same as struct tSirSmeRsp
+ * @session_id: session id
+ * @transaction_id: transaction id
+ * @status_code: status code as tSirResultCodes
+ * @psoc: soc object
+ */
+struct tdls_send_mgmt_rsp {
+	uint8_t session_id;
+	uint16_t transaction_id;
+	enum legacy_result_code status_code;
+	struct wlan_objmgr_psoc *psoc;
+};
+
+/**
+ * struct tdls_mgmt_tx_completion_ind - TDLS TX completion PE --> TDLS module
+ *                           same as struct sSirMgmtTxCompletionInd
+ * @session_id: session id
+ * @tx_complete_status: tx complete status
+ * @psoc: soc object
+ */
+struct tdls_mgmt_tx_completion_ind {
+	uint8_t session_id;      /* Session ID */
+	uint32_t tx_complete_status;
+	struct wlan_objmgr_psoc *psoc;
+};
+
+/**
+ * struct tdls_add_sta_rsp - TDLS Response struct PE --> TDLS module
+ *                           same as struct sSirTdlsAddStaRsp
+ * @status_code: status code as tSirResultCodes
+ * @peermac: MAC address of the TDLS peer
+ * @session_id: session id
+ * @sta_id: sta id
+ * @sta_type: sta type
+ * @tdls_oper: add peer type
+ * @psoc: soc object
+ */
+struct tdls_add_sta_rsp {
+	QDF_STATUS status_code;
+	struct qdf_mac_addr peermac;
+	uint8_t session_id;
+	uint16_t sta_id;
+	uint16_t sta_type;
+	enum tdls_add_oper tdls_oper;
+	struct wlan_objmgr_psoc *psoc;
+};
+
+/**
+ * struct tdls_del_sta_rsp - TDLS Response struct PE --> TDLS module
+ *                           same as sSirTdlsDelStaRsp
+ * @session_id: session id
+ * @status_code: status code as tSirResultCodes
+ * @peermac: MAC address of the TDLS peer
+ * @sta_id: sta id
+ * @psoc: soc object
+ */
+struct tdls_del_sta_rsp {
+	uint8_t session_id;
+	QDF_STATUS status_code;
+	struct qdf_mac_addr peermac;
+	uint16_t sta_id;
+	struct wlan_objmgr_psoc *psoc;
+};
+
 #endif