Sfoglia il codice sorgente

qcacld-3.0: Converge on struct aggr_add_ts_param

The driver currently defines two different data structures to hold
aggregate AddTspec parameters:
- tAggrAddTsParams
- struct aggr_add_ts_param

In this case having two different structures to provide the same
functionality is pointless. Furthermore, due to the way in which these
structures are used, there is an implicit requirement that they be
exactly identical. This approach is very fragile. To align with the
converged software architecture and to improve code maintainability
remove the legacy typedef and exclusively use the unified WMI
structure.

Change-Id: I960bd79b04838ac675ad49e332a47671faccaaa7
CRs-Fixed: 2371912
Jeff Johnson 6 anni fa
parent
commit
5402441a01

+ 11 - 9
core/mac/src/pe/lim/lim_ft.c

@@ -826,7 +826,8 @@ bool lim_process_ft_update_key(struct mac_context *mac, uint32_t *pMsgBuf)
 
 static void
 lim_ft_send_aggr_qos_rsp(struct mac_context *mac, uint8_t rspReqd,
-			 tpAggrAddTsParams aggrQosRsp, uint8_t smesessionId)
+			 struct aggr_add_ts_param *aggrQosRsp,
+			 uint8_t smesessionId)
 {
 	tpSirAggrQosRsp rsp;
 	int i = 0;
@@ -860,7 +861,7 @@ lim_ft_send_aggr_qos_rsp(struct mac_context *mac, uint8_t rspReqd,
 void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
 				 struct scheduler_msg *limMsg)
 {
-	tpAggrAddTsParams pAggrQosRspMsg = NULL;
+	struct aggr_add_ts_param *pAggrQosRspMsg;
 	tAddTsParams addTsParam = { 0 };
 	tpDphHashNode pSta = NULL;
 	uint16_t assocId = 0;
@@ -871,7 +872,7 @@ void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
 
 	pe_debug(" Received AGGR_QOS_RSP from HAL");
 	SET_LIM_PROCESS_DEFD_MESGS(mac, true);
-	pAggrQosRspMsg = (tpAggrAddTsParams) (limMsg->bodyptr);
+	pAggrQosRspMsg = limMsg->bodyptr;
 	if (NULL == pAggrQosRspMsg) {
 		pe_err("NULL pAggrQosRspMsg");
 		return;
@@ -889,7 +890,7 @@ void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
 		pe_err("pe_session is not in STA mode");
 		return;
 	}
-	for (i = 0; i < HAL_QOS_NUM_AC_MAX; i++) {
+	for (i = 0; i < WMI_QOS_NUM_AC_MAX; i++) {
 		if ((((1 << i) & pAggrQosRspMsg->tspecIdx)) &&
 		    (pAggrQosRspMsg->status[i] != QDF_STATUS_SUCCESS)) {
 			sir_copy_mac_addr(peerMacAddr, pe_session->bssId);
@@ -921,11 +922,12 @@ void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
 	return;
 }
 
-QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac, uint32_t *pMsgBuf)
+QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac,
+				       uint32_t *pMsgBuf)
 {
 	struct scheduler_msg msg = {0};
 	tSirAggrQosReq *aggrQosReq = (tSirAggrQosReq *) pMsgBuf;
-	tpAggrAddTsParams pAggrAddTsParam;
+	struct aggr_add_ts_param *pAggrAddTsParam;
 	struct pe_session *pe_session = NULL;
 	tpLimTspecInfo tspecInfo;
 	uint8_t ac;
@@ -934,12 +936,12 @@ QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac, uint32_t *pMsgBu
 	uint8_t sessionId;
 	int i;
 
-	pAggrAddTsParam = qdf_mem_malloc(sizeof(tAggrAddTsParams));
+	pAggrAddTsParam = qdf_mem_malloc(sizeof(*pAggrAddTsParam));
 	if (!pAggrAddTsParam)
 		return QDF_STATUS_E_NOMEM;
 
 	pe_session = pe_find_session_by_bssid(mac, aggrQosReq->bssid.bytes,
-						 &sessionId);
+					      &sessionId);
 
 	if (pe_session == NULL) {
 		pe_err("psession Entry Null for sessionId: %d",
@@ -969,7 +971,7 @@ QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac, uint32_t *pMsgBu
 	pAggrAddTsParam->tspecIdx = aggrQosReq->aggrInfo.tspecIdx;
 	pAggrAddTsParam->vdev_id = pe_session->smeSessionId;
 
-	for (i = 0; i < HAL_QOS_NUM_AC_MAX; i++) {
+	for (i = 0; i < WMI_QOS_NUM_AC_MAX; i++) {
 		if (aggrQosReq->aggrInfo.tspecIdx & (1 << i)) {
 			struct mac_tspec_ie *pTspec =
 				&aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec;

+ 0 - 23
core/wma/inc/wma_if.h

@@ -987,29 +987,6 @@ typedef struct {
 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
 } tDelTsParams, *tpDelTsParams;
 
-
-#define HAL_QOS_NUM_TSPEC_MAX 2
-#define HAL_QOS_NUM_AC_MAX 4
-
-/**
- * struct tAggrAddTsParams - ADDTS parameters
- * @staIdx: station index
- * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
- * @tspec: tspec value
- * @status: QDF status
- * @sessionId: session id
- * @vdev_id: vdev id
- */
-typedef struct {
-	uint16_t staIdx;
-	uint16_t tspecIdx;
-	struct mac_tspec_ie tspec[HAL_QOS_NUM_AC_MAX];
-	QDF_STATUS status[HAL_QOS_NUM_AC_MAX];
-	uint8_t sessionId;
-	uint8_t vdev_id;
-} tAggrAddTsParams, *tpAggrAddTsParams;
-
-
 typedef QDF_STATUS (*tHalMsgCallback)(struct mac_context *mac, uint32_t mesgId,
 				      void *mesgParam);
 

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

@@ -1076,8 +1076,19 @@ int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
 
 void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
 
+/**
+ * wma_aggr_qos_req() - send aggr qos request to fw
+ * @wma: handle to wma
+ * @pAggrQosRspMsg - combined struct for all ADD_TS requests.
+ *
+ * A function to handle WMA_AGGR_QOS_REQ. This will send out
+ * ADD_TS requestes to firmware in loop for all the ACs with
+ * active flow.
+ *
+ * Return: none
+ */
 void wma_aggr_qos_req(tp_wma_handle wma,
-			     tAggrAddTsParams *pAggrQosRspMsg);
+		      struct aggr_add_ts_param *pAggrQosRspMsg);
 
 void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
 

+ 2 - 14
core/wma/src/wma_features.c

@@ -3013,22 +3013,10 @@ void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg)
 	qdf_mem_free(msg);
 }
 
-/**
- * wma_aggr_qos_req() - send aggr qos request to fw
- * @wma: handle to wma
- * @pAggrQosRspMsg - combined struct for all ADD_TS requests.
- *
- * A function to handle WMA_AGGR_QOS_REQ. This will send out
- * ADD_TS requestes to firmware in loop for all the ACs with
- * active flow.
- *
- * Return: none
- */
 void wma_aggr_qos_req(tp_wma_handle wma,
-		      tAggrAddTsParams *pAggrQosRspMsg)
+		      struct aggr_add_ts_param *pAggrQosRspMsg)
 {
-	wmi_unified_aggr_qos_cmd(wma->wmi_handle,
-			   (struct aggr_add_ts_param *)pAggrQosRspMsg);
+	wmi_unified_aggr_qos_cmd(wma->wmi_handle, pAggrQosRspMsg);
 	/* send response to upper layers from here only. */
 	wma_send_msg_high_priority(wma, WMA_AGGR_QOS_RSP, pAggrQosRspMsg, 0);
 }

+ 1 - 1
core/wma/src/wma_main.c

@@ -8182,7 +8182,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 		break;
 
 	case WMA_AGGR_QOS_REQ:
-		wma_aggr_qos_req(wma_handle, (tAggrAddTsParams *) msg->bodyptr);
+		wma_aggr_qos_req(wma_handle, msg->bodyptr);
 		break;
 
 	case WMA_8023_MULTICAST_LIST_REQ: