Browse Source

qcacld-3.0: Modify wma_set_mlo_capability to send correct value

In api wma_set_mlo_capability(), the value for EMLSR
transition timeout value is sent as subfield value
instead in microseconds.

Modify wma_set_mlo_capability() api to send transition
timeout value in microseconds.

Change-Id: Ib8daecbb0d35bb43fb4706f3c39124a8b6cdffe6
CRs-Fixed: 3494498
Vijay Raj 1 year ago
parent
commit
c48f9003ac
1 changed files with 28 additions and 1 deletions
  1. 28 1
      core/wma/src/wma_mgmt.c

+ 28 - 1
core/wma/src/wma_mgmt.c

@@ -1385,6 +1385,33 @@ static void wma_objmgr_set_peer_mlme_type(tp_wma_handle wma,
 }
 
 #ifdef WLAN_FEATURE_11BE_MLO
+
+#define MIN_TIMEOUT_VAL 0
+#define MAX_TIMEOUT_VAL 11
+
+#define TIMEOUT_TO_US 6
+
+/*
+ * wma_convert_trans_timeout_us() - API to convert
+ * emlsr transition timeout to microseconds. Refer Table 9-401h
+ * of IEEE802.11be specification
+ * @timeout: EMLSR transition timeout
+ *
+ * Return: Timeout value in microseconds
+ */
+static inline uint32_t
+wma_convert_trans_timeout_us(uint16_t timeout)
+{
+	uint32_t us = 0;
+
+	if (timeout > MIN_TIMEOUT_VAL && timeout < MAX_TIMEOUT_VAL) {
+		/* timeout = 1 is for 128us*/
+		us = (1 << (timeout + TIMEOUT_TO_US));
+	}
+
+	return us;
+}
+
 /**
  * wma_set_mlo_capability() - set MLO caps to the peer assoc request
  * @wma: wma handle
@@ -1427,7 +1454,7 @@ static void wma_set_mlo_capability(tp_wma_handle wma,
 		req->mlo_params.ieee_link_id = params->link_id;
 		if (req->mlo_params.emlsr_support) {
 			req->mlo_params.trans_timeout_us =
-					params->emlsr_trans_timeout;
+			wma_convert_trans_timeout_us(params->emlsr_trans_timeout);
 		}
 		req->mlo_params.msd_cap_support = params->msd_caps_present;
 		req->mlo_params.medium_sync_duration =