فهرست منبع

qcacld-3.0: Converge on struct mac_ts_info

The driver currently defines two different data structures to hold
a TS Info field:
- tSirMacTSInfo
- struct mac_ts_info

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: I95bcb4364ee7e3108137c8ceeedf05c7a53bc393
CRs-Fixed: 2371910
Jeff Johnson 6 سال پیش
والد
کامیت
312348f6ff

+ 1 - 1
core/mac/inc/sir_api.h

@@ -1641,7 +1641,7 @@ typedef struct sSirAddtsRspInfo {
 } tSirAddtsRspInfo, *tpSirAddtsRspInfo;
 
 typedef struct sSirDeltsReqInfo {
-	tSirMacTSInfo tsinfo;
+	struct mac_ts_info tsinfo;
 	tSirMacTspecIE tspec;
 	uint8_t wmeTspecPresent:1;
 	uint8_t wsmTspecPresent:1;

+ 1 - 46
core/mac/inc/sir_mac_prot_def.h

@@ -1211,55 +1211,10 @@ typedef struct sSirMacQoSParams {
 #define SIR_MAC_ACCESSPOLICY_HCCA   2
 #define SIR_MAC_ACCESSPOLICY_BOTH   3
 
-typedef struct sSirMacTSInfoTfc {
-#ifndef ANI_LITTLE_BIT_ENDIAN
-	uint8_t burstSizeDefn:1;
-	uint8_t reserved:7;
-#else
-	uint8_t reserved:7;
-	uint8_t burstSizeDefn:1;
-#endif
-
-#ifndef ANI_LITTLE_BIT_ENDIAN
-	uint16_t ackPolicy:2;
-	uint16_t userPrio:3;
-	uint16_t psb:1;
-	uint16_t aggregation:1;
-	uint16_t accessPolicy:2;
-	uint16_t direction:2;
-	uint16_t tsid:4;
-	uint16_t trafficType:1;
-#else
-	uint16_t trafficType:1;
-	uint16_t tsid:4;
-	uint16_t direction:2;
-	uint16_t accessPolicy:2;
-	uint16_t aggregation:1;
-	uint16_t psb:1;
-	uint16_t userPrio:3;
-	uint16_t ackPolicy:2;
-#endif
-} qdf_packed tSirMacTSInfoTfc;
-
-typedef struct sSirMacTSInfoSch {
-#ifndef ANI_LITTLE_BIT_ENDIAN
-	uint8_t rsvd:7;
-	uint8_t schedule:1;
-#else
-	uint8_t schedule:1;
-	uint8_t rsvd:7;
-#endif
-} qdf_packed tSirMacTSInfoSch;
-
-typedef struct sSirMacTSInfo {
-	tSirMacTSInfoTfc traffic;
-	tSirMacTSInfoSch schedule;
-} qdf_packed tSirMacTSInfo;
-
 typedef struct sSirMacTspecIE {
 	uint8_t type;
 	uint8_t length;
-	tSirMacTSInfo tsinfo;
+	struct mac_ts_info tsinfo;
 	uint16_t nomMsduSz;
 	uint16_t maxMsduSz;
 	uint32_t minSvcInterval;

+ 2 - 1
core/mac/src/include/parser_api.h

@@ -875,7 +875,8 @@ QDF_STATUS populate_dot11f_tpc_report(struct mac_context *mac,
 					struct pe_session *pe_session);
 
 /* / Populate a tDot11FfTSInfo */
-void populate_dot11f_ts_info(tSirMacTSInfo *pInfo, tDot11fFfTSInfo *pDot11f);
+void populate_dot11f_ts_info(struct mac_ts_info *pInfo,
+			     tDot11fFfTSInfo *pDot11f);
 
 void populate_dot11f_wmm(struct mac_context *mac,
 			tDot11fIEWMMInfoAp *pInfo,

+ 1 - 1
core/mac/src/pe/include/lim_admit_control.h

@@ -67,7 +67,7 @@ lim_admit_control_delete_sta(struct mac_context *mac, uint16_t assocId);
 extern QDF_STATUS
 lim_admit_control_delete_ts(struct mac_context *mac,
 			    uint16_t assocId,
-			    tSirMacTSInfo *tsinfo,
+			    struct mac_ts_info *tsinfo,
 			    uint8_t *tsStatus, uint8_t *tspecIdx);
 
 QDF_STATUS lim_admit_control_init(struct mac_context *mac);

+ 4 - 4
core/mac/src/pe/lim/lim_admit_control.c

@@ -471,7 +471,7 @@ lim_tspec_find_by_assoc_id(struct mac_context *mac,
    \brief finding a TSPEC entry with assocId, tsinfo.direction and tsinfo.tsid
    \param    uint16_t               assocId
    \param     struct mac_context *   mac
-   \param     tSirMacTSInfo   *pTsInfo
+   \param     struct mac_ts_info   *pTsInfo
    \param         tpLimTspecInfo    pTspecList
    \param         tpLimTspecInfo   *ppInfo
    \return QDF_STATUS - status of the comparison
@@ -480,7 +480,7 @@ lim_tspec_find_by_assoc_id(struct mac_context *mac,
 static QDF_STATUS
 lim_find_tspec(struct mac_context *mac,
 	       uint16_t assocId,
-	       tSirMacTSInfo *pTsInfo,
+	       struct mac_ts_info *pTsInfo,
 	       tpLimTspecInfo pTspecList, tpLimTspecInfo *ppInfo)
 {
 	int ctspec;
@@ -746,7 +746,7 @@ QDF_STATUS lim_admit_control_add_ts(struct mac_context *mac, uint8_t *pAddr,
    \brief Delete the specified Tspec for the specified STA
    \param   struct mac_context *mac
    \param       uint16_t               assocId
-   \param       tSirMacTSInfo    *pTsInfo
+   \param       struct mac_ts_info    *pTsInfo
    \param       uint8_t               *pTsStatus
    \param       uint8_t             *ptspecIdx
    \return QDF_STATUS - status
@@ -755,7 +755,7 @@ QDF_STATUS lim_admit_control_add_ts(struct mac_context *mac, uint8_t *pAddr,
 QDF_STATUS
 lim_admit_control_delete_ts(struct mac_context *mac,
 			    uint16_t assocId,
-			    tSirMacTSInfo *pTsInfo,
+			    struct mac_ts_info *pTsInfo,
 			    uint8_t *pTsStatus, uint8_t *ptspecIdx)
 {
 	tpLimTspecInfo pTspecInfo = NULL;

+ 1 - 1
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -903,7 +903,7 @@ static void __lim_process_del_ts_req(struct mac_context *mac_ctx,
 	uint16_t aid;
 	uint8_t *body_ptr;
 	uint8_t ts_status;
-	tSirMacTSInfo *tsinfo;
+	struct mac_ts_info *tsinfo;
 	uint8_t tspec_idx;
 	uint8_t ac;
 	tpDphHashNode sta_ds_ptr = NULL;

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -3512,7 +3512,7 @@ static void __lim_process_sme_delts_req(struct mac_context *mac, uint32_t *pMsgB
 {
 	tSirMacAddr peerMacAddr;
 	uint8_t ac;
-	tSirMacTSInfo *pTsinfo;
+	struct mac_ts_info *pTsinfo;
 	tpSirDeltsReq pDeltsReq = (tpSirDeltsReq) pMsgBuf;
 	tpDphHashNode pStaDs = NULL;
 	struct pe_session *pe_session;

+ 8 - 6
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -1387,8 +1387,9 @@ void
 lim_send_delts_req_action_frame(struct mac_context *mac,
 				tSirMacAddr peer,
 				uint8_t wmmTspecPresent,
-				tSirMacTSInfo *pTsinfo,
-				tSirMacTspecIE *pTspecIe, struct pe_session *pe_session)
+				struct mac_ts_info *pTsinfo,
+				tSirMacTspecIE *pTspecIe,
+				struct pe_session *pe_session)
 {
 	uint8_t *pFrame;
 	tpSirMacMgmtHdr pMacHdr;
@@ -1400,9 +1401,8 @@ lim_send_delts_req_action_frame(struct mac_context *mac,
 	uint8_t txFlag = 0;
 	uint8_t smeSessionId = 0;
 
-	if (NULL == pe_session) {
+	if (!pe_session)
 		return;
-	}
 
 	smeSessionId = pe_session->smeSessionId;
 
@@ -1415,7 +1415,8 @@ lim_send_delts_req_action_frame(struct mac_context *mac,
 
 		nStatus = dot11f_get_packed_del_ts_size(mac, &DelTS, &nPayload);
 		if (DOT11F_FAILED(nStatus)) {
-			pe_err("Failed to calculate the packed size for a Del TS (0x%08x)", nStatus);
+			pe_err("Failed to calculate the packed size for a Del TS (0x%08x)",
+			       nStatus);
 			/* We'll fall back on the worst case scenario: */
 			nPayload = sizeof(tDot11fDelTS);
 		} else if (DOT11F_WARNED(nStatus)) {
@@ -1433,7 +1434,8 @@ lim_send_delts_req_action_frame(struct mac_context *mac,
 		nStatus =
 			dot11f_get_packed_wmm_del_ts_size(mac, &WMMDelTS, &nPayload);
 		if (DOT11F_FAILED(nStatus)) {
-			pe_err("Failed to calculate the packed size for a WMM Del TS (0x%08x)", nStatus);
+			pe_err("Failed to calculate the packed size for a WMM Del TS (0x%08x)",
+			       nStatus);
 			/* We'll fall back on the worst case scenario: */
 			nPayload = sizeof(tDot11fDelTS);
 		} else if (DOT11F_WARNED(nStatus)) {

+ 1 - 1
core/mac/src/pe/lim/lim_types.h

@@ -606,7 +606,7 @@ static inline void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx
 #endif
 void lim_send_delts_req_action_frame(struct mac_context *mac, tSirMacAddr peer,
 				     uint8_t wmmTspecPresent,
-				     tSirMacTSInfo * pTsinfo,
+				     struct mac_ts_info * pTsinfo,
 				     tSirMacTspecIE * pTspecIe,
 				     struct pe_session *pe_session);
 void lim_send_addts_req_action_frame(struct mac_context *mac, tSirMacAddr peerMacAddr,

+ 13 - 10
core/mac/src/pe/lim/lim_utils.c

@@ -4225,6 +4225,7 @@ void lim_update_sta_run_time_ht_info(struct mac_context *mac,
  * @mac_ctx: pointer to Global Mac structure
  * @delts_req: pointer to delete traffic stream structure
  * @peer_mac_addr: variable for peer mac address
+ * @session: pe session entry
  *
  * Function validates DelTs req originated by SME or by HAL and also
  * sends halMsg_DelTs to HAL
@@ -4234,11 +4235,12 @@ void lim_update_sta_run_time_ht_info(struct mac_context *mac,
 
 QDF_STATUS
 lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
-		       tSirMacAddr peer_mac_addr, struct pe_session *psession_entry)
+		       tSirMacAddr peer_mac_addr,
+		       struct pe_session *session)
 {
 	tpDphHashNode sta;
 	uint8_t ts_status;
-	tSirMacTSInfo *tsinfo;
+	struct mac_ts_info *tsinfo;
 	uint32_t i;
 	uint8_t tspec_idx;
 
@@ -4255,15 +4257,15 @@ lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (LIM_IS_STA_ROLE(psession_entry)) {
+	if (LIM_IS_STA_ROLE(session)) {
 		uint32_t val;
 
 		/* station always talks to the AP */
 		sta = dph_get_hash_entry(mac_ctx, DPH_STA_HASH_INDEX_PEER,
-					&psession_entry->dph.dphHashTable);
+					&session->dph.dphHashTable);
 
 		val = sizeof(tSirMacAddr);
-		sir_copy_mac_addr(peer_mac_addr, psession_entry->bssId);
+		sir_copy_mac_addr(peer_mac_addr, session->bssId);
 
 	} else {
 		uint16_t associd;
@@ -4272,12 +4274,12 @@ lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
 		associd = delts_req->aid;
 		if (associd != 0)
 			sta = dph_get_hash_entry(mac_ctx, associd,
-					&psession_entry->dph.dphHashTable);
+					&session->dph.dphHashTable);
 		else
 			sta = dph_lookup_hash_entry(mac_ctx,
 						delts_req->macaddr.bytes,
 						&associd,
-						&psession_entry->dph.
+						&session->dph.
 							dphHashTable);
 
 		if (sta != NULL)
@@ -4339,8 +4341,8 @@ lim_validate_delts_req(struct mac_context *mac_ctx, tpSirDeltsReq delts_req,
 		if (QDF_STATUS_SUCCESS !=
 			lim_send_hal_msg_del_ts(mac_ctx, sta->staIndex,
 						tspec_idx, delts_req->req,
-						psession_entry->peSessionId,
-						psession_entry->bssId)) {
+						session->peSessionId,
+						session->bssId)) {
 			pe_warn("DelTs with UP: %d failed in lim_send_hal_msg_del_ts - ignoring request",
 				tsinfo->traffic.userPrio);
 			return QDF_STATUS_E_FAILURE;
@@ -4705,7 +4707,8 @@ uint8_t lim_get_channel_from_beacon(struct mac_context *mac, tpSchBeaconStruct p
 
 void lim_set_tspec_uapsd_mask_per_session(struct mac_context *mac,
 					  struct pe_session *pe_session,
-					  tSirMacTSInfo *pTsInfo, uint32_t action)
+					  struct mac_ts_info *pTsInfo,
+					  uint32_t action)
 {
 	uint8_t userPrio = (uint8_t) pTsInfo->traffic.userPrio;
 	uint16_t direction = pTsInfo->traffic.direction;

+ 1 - 1
core/mac/src/pe/lim/lim_utils.h

@@ -497,7 +497,7 @@ tSirNwType lim_get_nw_type(struct mac_context *mac, uint8_t channelNum,
 
 void lim_set_tspec_uapsd_mask_per_session(struct mac_context *mac,
 		struct pe_session *pe_session,
-		tSirMacTSInfo *pTsInfo, uint32_t action);
+		struct mac_ts_info *pTsInfo, uint32_t action);
 
 void lim_handle_heart_beat_timeout_for_session(struct mac_context *mac,
 		struct pe_session *pe_session);

+ 2 - 3
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -1655,8 +1655,6 @@ populate_dot11f_tpc_report(struct mac_context *mac,
 			nSirStatus);
 		return QDF_STATUS_E_FAILURE;
 	}
-	/* FramesToDo: This function was "misplaced" in the move to Gen4_TVM... */
-	/* txPower = halGetRateToPwrValue( mac, staid, mac->lim.gLimCurrentChannelId, isBeacon ); */
 	tx_power = cfg_get_regulatory_max_transmit_power(mac,
 				pe_session->currentOperChannel);
 	pDot11f->tx_power = tx_power;
@@ -1666,7 +1664,8 @@ populate_dot11f_tpc_report(struct mac_context *mac,
 	return QDF_STATUS_SUCCESS;
 } /* End populate_dot11f_tpc_report. */
 
-void populate_dot11f_ts_info(tSirMacTSInfo *pInfo, tDot11fFfTSInfo *pDot11f)
+void populate_dot11f_ts_info(struct mac_ts_info *pInfo,
+			     tDot11fFfTSInfo *pDot11f)
 {
 	pDot11f->traffic_type = pInfo->traffic.trafficType;
 	pDot11f->tsid = pInfo->traffic.tsid;

+ 7 - 5
core/sme/inc/sme_power_save_api.h

@@ -34,15 +34,17 @@ QDF_STATUS sme_ps_uapsd_enable(mac_handle_t mac_handle, uint32_t session_id);
 QDF_STATUS sme_ps_uapsd_disable(mac_handle_t mac_handle, uint32_t session_id);
 
 /* Condition check if driver is ready to enter in PS */
-QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx, uint32_t session_id);
+QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
+				   uint32_t session_id);
 
 QDF_STATUS sme_ps_process_command(struct mac_context *mac_ctx,
-		uint32_t session_id,
-		enum sme_ps_cmd command);
+				  uint32_t session_id,
+				  enum sme_ps_cmd command);
 
 void sme_set_tspec_uapsd_mask_per_session(struct mac_context *mac_ctx,
-		tSirMacTSInfo *ts_info,
-		uint8_t session_id);
+					  struct mac_ts_info *ts_info,
+					  uint8_t session_id);
+
 /* Full Power Req Callback */
 typedef void (*uapsd_start_indication_cb)(void *callback_context,
 		uint32_t session_id, QDF_STATUS status);

+ 2 - 2
core/sme/src/common/sme_power_save.c

@@ -507,8 +507,8 @@ QDF_STATUS sme_ps_uapsd_disable(mac_handle_t mac_handle, uint32_t session_id)
  * Return: QDF_STATUS
  */
 void sme_set_tspec_uapsd_mask_per_session(struct mac_context *mac_ctx,
-		tSirMacTSInfo *ts_info,
-		uint8_t session_id)
+					  struct mac_ts_info *ts_info,
+					  uint8_t session_id)
 {
 	uint8_t user_prio = (uint8_t) ts_info->traffic.userPrio;
 	uint16_t direction = ts_info->traffic.direction;

+ 3 - 2
core/sme/src/qos/sme_qos.c

@@ -4145,7 +4145,8 @@ static QDF_STATUS sme_qos_process_del_ts_rsp(struct mac_context *mac, void *pMsg
  *
  * Return QDF_STATUS
  */
-static QDF_STATUS sme_qos_process_del_ts_ind(struct mac_context *mac, void *pMsgBuf)
+static QDF_STATUS sme_qos_process_del_ts_ind(struct mac_context *mac,
+					     void *pMsgBuf)
 {
 	tpSirDeltsRsp pdeltsind = (tpSirDeltsRsp) pMsgBuf;
 	struct sme_qos_sessioninfo *pSession;
@@ -4153,7 +4154,7 @@ static QDF_STATUS sme_qos_process_del_ts_ind(struct mac_context *mac, void *pMsg
 	uint8_t sessionId = pdeltsind->sessionId;
 	sme_QosEdcaAcType ac;
 	struct sme_qos_searchinfo search_key;
-	tSirMacTSInfo *tsinfo;
+	struct mac_ts_info *tsinfo;
 	enum sme_qos_wmmuptype up =
 		(enum sme_qos_wmmuptype)
 		pdeltsind->rsp.tspec.tsinfo.traffic.userPrio;