瀏覽代碼

Merge "qcacmn: Parse Extended MLD CAP & OP of ML IE"

Linux Build Service Account 1 年之前
父節點
當前提交
38ceb24812
共有 2 個文件被更改,包括 28 次插入1 次删除
  1. 24 1
      umac/mlo_mgr/src/utils_mlo.c
  2. 4 0
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 24 - 1
umac/mlo_mgr/src/utils_mlo.c

@@ -228,8 +228,31 @@ util_parse_multi_link_ctrl(uint8_t *mlieseqpayload,
 		parsed_payload_len += WLAN_ML_BV_CINFO_MLDID_SIZE;
 	}
 
+	/* Check if Ext MLD CAP OP is present */
+	if (presence_bm & WLAN_ML_BV_CTRL_PBM_EXT_MLDCAPANDOP_P) {
+		if (mlieseqpayloadlen <
+				(parsed_payload_len +
+				 WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE)) {
+			mlo_err_rl("ML seq payload len %zu insufficient for Ext MLD CAP OP size %u after parsed payload len %zu.",
+				   mlieseqpayloadlen,
+				   WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE,
+				   parsed_payload_len);
+			return QDF_STATUS_E_PROTO;
+		}
+
+		parsed_payload_len += WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE;
+	}
+
 	exp_cinfo_len = parsed_payload_len - WLAN_ML_CTRL_SIZE;
-	if (cinfo_len != exp_cinfo_len) {
+	if (cinfo_len >= exp_cinfo_len) {
+		/* If common info length received is greater,
+		 *  skip through the additional bytes
+		 */
+		parsed_payload_len += (cinfo_len - exp_cinfo_len);
+		mlo_debug("ML seq common info len %u, parsed payload length %zu, expected common info len %u",
+			  cinfo_len, parsed_payload_len, exp_cinfo_len);
+	} else {
+		/* If cinfo_len < exp_cinfo_len return error */
 		mlo_err_rl("ML seq common info len %u doesn't match with expected common info len %u",
 			   cinfo_len, exp_cinfo_len);
 		return QDF_STATUS_E_PROTO;

+ 4 - 0
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -2169,6 +2169,10 @@ static uint8_t util_get_link_info_offset(uint8_t *ml_ie, bool *is_ml_ie_valid)
 	if (presencebm & WLAN_ML_BV_CTRL_PBM_MLDID_P)
 		parsed_ie_len += WLAN_ML_BV_CINFO_MLDID_SIZE;
 
+	/* Check if Extended MLD Cap and Op is present */
+	if (presencebm & WLAN_ML_BV_CTRL_PBM_EXT_MLDCAPANDOP_P)
+		parsed_ie_len += WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE;
+
 	/* Offset calculation starts from the beginning of the ML IE (including
 	 * EID) hence, adding the size of IE header to ML IE length.
 	 */