Browse Source

qcacld-3.0: Fix sme_qos_is_ts_info_ack_policy_valid() param

Currently sme_qos_is_ts_info_ack_policy_valid() takes a tpAniSirGlobal
mac context param. However this is a global function that is called by
HDD, so it should be taking an opaque handle. Update the function and
all callers to use the appropriate type.

Change-Id: I71759ce184306a90f46e37d79d6bdd7a545c1bc2
CRs-Fixed: 2269181
Jeff Johnson 6 years ago
parent
commit
1021f89889
3 changed files with 21 additions and 25 deletions
  1. 2 3
      core/hdd/src/wlan_hdd_wmm.c
  2. 4 3
      core/sme/inc/sme_qos_api.h
  3. 15 19
      core/sme/src/qos/sme_qos.c

+ 2 - 3
core/hdd/src/wlan_hdd_wmm.c

@@ -1179,9 +1179,8 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work)
 
 	if (qosInfo.ts_info.ack_policy ==
 	    SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK) {
-		if (!sme_qos_is_ts_info_ack_policy_valid
-			    ((tpAniSirGlobal) mac_handle, &qosInfo,
-			    adapter->session_id)) {
+		if (!sme_qos_is_ts_info_ack_policy_valid(mac_handle, &qosInfo,
+							 adapter->session_id)) {
 			qosInfo.ts_info.ack_policy =
 				SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK;
 		}

+ 4 - 3
core/sme/inc/sme_qos_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 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
@@ -206,8 +206,9 @@ enum sme_qos_statustype sme_qos_modify_req(tHalHandle hHal,
 		struct sme_qos_wmmtspecinfo *pQoSInfo, uint32_t QosFlowID);
 enum sme_qos_statustype sme_qos_release_req(tHalHandle hHal, uint8_t session_id,
 				      uint32_t QosFlowID);
-bool sme_qos_is_ts_info_ack_policy_valid(tpAniSirGlobal pMac,
-		struct sme_qos_wmmtspecinfo *pQoSInfo, uint8_t sessionId);
+bool sme_qos_is_ts_info_ack_policy_valid(mac_handle_t mac_handle,
+					 struct sme_qos_wmmtspecinfo *pQoSInfo,
+					 uint8_t sessionId);
 void sme_qos_update_hand_off(uint8_t sessionId, bool updateHandOff);
 QDF_STATUS sme_update_dsc_pto_up_mapping(tHalHandle hHal,
 		enum sme_qos_wmmuptype *dscpmapping, uint8_t sessionId);

+ 15 - 19
core/sme/src/qos/sme_qos.c

@@ -7186,9 +7186,9 @@ void sme_qos_cleanup_ctrl_blk_for_handoff(tpAniSirGlobal pMac,
 
 /**
  * sme_qos_is_ts_info_ack_policy_valid() - check if ACK policy is allowed.
- * @pMac: The handle returned by mac_open.
+ * @mac_handle: The handle returned by mac_open.
  * @pQoSInfo: Pointer to struct sme_qos_wmmtspecinfo which contains the
- * @          WMM TSPEC related info, provided by HDD
+ *            WMM TSPEC related info, provided by HDD
  * @sessionId: sessionId returned by sme_open_session.
  *
  * The SME QoS API exposed to HDD to check if TS info ack policy field can be
@@ -7197,15 +7197,16 @@ void sme_qos_cleanup_ctrl_blk_for_handoff(tpAniSirGlobal pMac,
  * Return: true - Current Association is HT association and so TS info ack
  *                 policy can be set to "HT-immediate block acknowledgment"
  */
-bool sme_qos_is_ts_info_ack_policy_valid(tpAniSirGlobal pMac,
+bool sme_qos_is_ts_info_ack_policy_valid(mac_handle_t mac_handle,
 					 struct sme_qos_wmmtspecinfo *pQoSInfo,
 					 uint8_t sessionId)
 {
 	tDot11fBeaconIEs *pIes = NULL;
 	struct sme_qos_sessioninfo *pSession;
 	QDF_STATUS hstatus;
+	tpAniSirGlobal mac = MAC_CONTEXT(mac_handle);
 
-	if (!CSR_IS_SESSION_VALID(pMac, sessionId)) {
+	if (!CSR_IS_SESSION_VALID(mac, sessionId)) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: %d: Session Id %d is invalid",
 			  __func__, __LINE__, sessionId);
@@ -7228,7 +7229,7 @@ bool sme_qos_is_ts_info_ack_policy_valid(tpAniSirGlobal pMac,
 		return false;
 	}
 
-	hstatus = csr_get_parsed_bss_description_ies(pMac,
+	hstatus = csr_get_parsed_bss_description_ies(mac,
 						   pSession->assocInfo.pBssDesc,
 						      &pIes);
 	if (!QDF_IS_STATUS_SUCCESS(hstatus)) {
@@ -7255,22 +7256,17 @@ bool sme_qos_is_ts_info_ack_policy_valid(tpAniSirGlobal pMac,
 	return true;
 }
 
-static bool sme_qos_validate_requested_params(tpAniSirGlobal pMac,
-				       struct sme_qos_wmmtspecinfo *pQoSInfo,
-				       uint8_t sessionId)
+static bool sme_qos_validate_requested_params(tpAniSirGlobal mac,
+				       struct sme_qos_wmmtspecinfo *qos_info,
+				       uint8_t session_id)
 {
-	bool rc = false;
-
-	do {
-		if (SME_QOS_WMM_TS_DIR_RESV == pQoSInfo->ts_info.direction)
-			break;
-		if (!sme_qos_is_ts_info_ack_policy_valid(pMac, pQoSInfo,
-							sessionId))
-			break;
+	if (SME_QOS_WMM_TS_DIR_RESV == qos_info->ts_info.direction)
+		return false;
+	if (!sme_qos_is_ts_info_ack_policy_valid(MAC_HANDLE(mac),
+						 qos_info, session_id))
+		return false;
 
-		rc = true;
-	} while (0);
-	return rc;
+	return true;
 }
 
 static QDF_STATUS qos_issue_command(tpAniSirGlobal pMac, uint8_t sessionId,