Parcourir la source

qcacld-3.0: Fix wrong error code for Association Response

The Association Response with wrong status code(0x01: Unspecified
failure) to Association Request without rates IE.

Change to send the Association Response with status code 0x12(due
to requesting STA not supporting all of the data rates in the
BSSBasicRateSet) to deny this Association Request without rates
IE.

Change-Id: I16cc4d54fa62530bb049e4f3151ed22814a52b4b
CRs-Fixed: 3617022
Ke Huang il y a 1 an
Parent
commit
c6112edbb8

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

@@ -642,7 +642,7 @@ QDF_STATUS
 sir_convert_probe_frame2_struct(struct mac_context *mac, uint8_t *frame,
 				uint32_t len, tpSirProbeRespBeacon probe);
 
-QDF_STATUS
+enum wlan_status_code
 sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 				    uint8_t *frame, uint32_t len,
 				    tpSirAssocReq assoc);
@@ -665,7 +665,7 @@ sir_convert_assoc_resp_frame2_struct(struct mac_context *mac,
 				uint8_t *frame, uint32_t len,
 				tpSirAssocRsp assoc);
 
-QDF_STATUS
+enum wlan_status_code
 sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 				uint8_t *frame, uint32_t len,
 				tpSirAssocReq assoc);

+ 8 - 7
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -254,24 +254,25 @@ static bool lim_chk_assoc_req_parse_error(struct mac_context *mac_ctx,
 					  uint8_t sub_type, uint8_t *frm_body,
 					  uint32_t frame_len)
 {
-	QDF_STATUS status;
+	QDF_STATUS qdf_status;
+	enum wlan_status_code wlan_status;
 
 	if (sub_type == LIM_ASSOC)
-		status = sir_convert_assoc_req_frame2_struct(mac_ctx, frm_body,
+		wlan_status = sir_convert_assoc_req_frame2_struct(mac_ctx, frm_body,
 							     frame_len,
 							     assoc_req);
 	else
-		status = sir_convert_reassoc_req_frame2_struct(mac_ctx,
+		wlan_status = sir_convert_reassoc_req_frame2_struct(mac_ctx,
 						frm_body, frame_len, assoc_req);
 
-	if (status == QDF_STATUS_SUCCESS) {
-		status = lim_strip_and_decode_eht_cap(
+	if (wlan_status == STATUS_SUCCESS) {
+		qdf_status = lim_strip_and_decode_eht_cap(
 					frm_body + WLAN_ASSOC_REQ_IES_OFFSET,
 					frame_len - WLAN_ASSOC_REQ_IES_OFFSET,
 					&assoc_req->eht_cap,
 					assoc_req->he_cap,
 					session->curr_op_freq);
-		if (status != QDF_STATUS_SUCCESS) {
+		if (QDF_IS_STATUS_ERROR(qdf_status)) {
 			pe_err("Failed to extract eht cap");
 			return false;
 		}
@@ -281,7 +282,7 @@ static bool lim_chk_assoc_req_parse_error(struct mac_context *mac_ctx,
 
 	pe_warn("Assoc Req rejected: frame parsing error. source addr:"
 			QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(sa));
-	lim_send_assoc_rsp_mgmt_frame(mac_ctx, STATUS_UNSPECIFIED_FAILURE,
+	lim_send_assoc_rsp_mgmt_frame(mac_ctx, wlan_status,
 				      1, sa, sub_type, 0, session, false);
 	return false;
 }

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

@@ -3308,7 +3308,7 @@ sir_convert_assoc_req_frame2_mlo_struct(uint8_t *pFrame,
 }
 #endif
 
-QDF_STATUS
+enum wlan_status_code
 sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 				    uint8_t *pFrame,
 				    uint32_t nFrame, tpSirAssocReq pAssocReq)
@@ -3318,7 +3318,7 @@ sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 
 	ar = qdf_mem_malloc(sizeof(tDot11fAssocRequest));
 	if (!ar)
-		return QDF_STATUS_E_NOMEM;
+		return STATUS_UNSPECIFIED_FAILURE;
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_assoc_request(mac, pFrame, nFrame, ar, false);
@@ -3328,7 +3328,7 @@ sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
 				   pFrame, nFrame);
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_UNSPECIFIED_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		pe_debug("There were warnings while unpacking an Association Request (0x%08x, %d bytes):",
 			status, nFrame);
@@ -3450,13 +3450,13 @@ sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 	if (!pAssocReq->ssidPresent) {
 		pe_debug("Received Assoc without SSID IE");
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_UNSPECIFIED_FAILURE;
 	}
 
 	if (!pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent) {
 		pe_debug("Received Assoc without supp rate IE");
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_ASSOC_DENIED_RATES;
 	}
 	if (ar->VHTCaps.present) {
 		qdf_mem_copy(&pAssocReq->VHTCaps, &ar->VHTCaps,
@@ -3526,7 +3526,7 @@ sir_convert_assoc_req_frame2_struct(struct mac_context *mac,
 		 ar->eht_cap.present);
 
 	qdf_mem_free(ar);
-	return QDF_STATUS_SUCCESS;
+	return STATUS_SUCCESS;
 
 } /* End sir_convert_assoc_req_frame2_struct. */
 
@@ -4343,7 +4343,7 @@ sir_convert_reassoc_req_frame2_mlo_struct(uint8_t *pframe, uint32_t nframe,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
-QDF_STATUS
+enum wlan_status_code
 sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 				      uint8_t *pFrame,
 				      uint32_t nFrame, tpSirAssocReq pAssocReq)
@@ -4353,7 +4353,7 @@ sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 
 	ar = qdf_mem_malloc(sizeof(*ar));
 	if (!ar)
-		return QDF_STATUS_E_NOMEM;
+		return STATUS_UNSPECIFIED_FAILURE;
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_re_assoc_request(mac, pFrame, nFrame,
@@ -4364,7 +4364,7 @@ sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
 				   pFrame, nFrame);
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_UNSPECIFIED_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		pe_debug("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes):",
 			status, nFrame);
@@ -4462,13 +4462,13 @@ sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 	if (!pAssocReq->ssidPresent) {
 		pe_debug("Received Assoc without SSID IE");
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_UNSPECIFIED_FAILURE;
 	}
 
 	if (!pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent) {
 		pe_debug("Received Assoc without supp rate IE");
 		qdf_mem_free(ar);
-		return QDF_STATUS_E_FAILURE;
+		return STATUS_ASSOC_DENIED_RATES;
 	}
 	/* Why no call to 'updateAssocReqFromPropCapability' here, like */
 	/* there is in 'sir_convert_assoc_req_frame2_struct'? */
@@ -4537,7 +4537,7 @@ sir_convert_reassoc_req_frame2_struct(struct mac_context *mac,
 						  ar, pAssocReq);
 	qdf_mem_free(ar);
 
-	return QDF_STATUS_SUCCESS;
+	return STATUS_SUCCESS;
 
 } /* End sir_convert_reassoc_req_frame2_struct. */