Revert "[wpa_supplicant] cumilative patch from commit 3a5d1a7e6"

Revert submission 26533062-Supplicant_merge_June24

Reason for revert: https://b.corp.google.com/issues/349780869

Reverted changes: /q/submissionid:26533062-Supplicant_merge_June24

Change-Id: I4a7a5b8ccb6b4822353bacc29649587cd5a3cb80
diff --git a/wpa_supplicant/robust_av.c b/wpa_supplicant/robust_av.c
index 658103d..58edd9b 100644
--- a/wpa_supplicant/robust_av.c
+++ b/wpa_supplicant/robust_av.c
@@ -665,91 +665,17 @@
 }
 
 
-/* Element ID Extension(1) + Request Type(1) + User Priority Control(2) +
- * Stream Timeout(4) */
-#define MSCS_DESCRIPTOR_FIXED_LEN 8
-
-static void wpas_parse_mscs_resp(struct wpa_supplicant *wpa_s,
-				 u16 status, const u8 *bssid,
-				 const u8 *mscs_desc_ie)
-{
-	struct robust_av_data robust_av;
-	const u8 *pos;
-
-	/* The MSCS Descriptor element is optional in the MSCS Response frame */
-	if (!mscs_desc_ie)
-		goto event_mscs_result;
-
-	if (mscs_desc_ie[1] < MSCS_DESCRIPTOR_FIXED_LEN) {
-		wpa_printf(MSG_INFO,
-			   "MSCS: Drop received frame: invalid MSCS Descriptor element length: %d",
-			   mscs_desc_ie[1]);
-		return;
-	}
-
-	os_memset(&robust_av, 0, sizeof(struct robust_av_data));
-
-	/* Skip Element ID, Length, and Element ID Extension */
-	pos = &mscs_desc_ie[3];
-
-	robust_av.request_type = *pos++;
-
-	switch (robust_av.request_type) {
-	case SCS_REQ_CHANGE:
-		/*
-		 * Inform the suggested set of parameters that could be accepted
-		 * by the AP in response to a subsequent request by the station.
-		 */
-		robust_av.up_bitmap = *pos++;
-		robust_av.up_limit = *pos++ & 0x07;
-		robust_av.stream_timeout = WPA_GET_LE32(pos);
-		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
-			" status_code=%u change up_bitmap=%u up_limit=%u stream_timeout=%u",
-			MAC2STR(bssid), status, robust_av.up_bitmap,
-			robust_av.up_limit, robust_av.stream_timeout);
-		wpa_s->mscs_setup_done = false;
-		return;
-	case SCS_REQ_ADD:
-		/*
-		 * This type is used in (Re)Association Response frame MSCS
-		 * Descriptor element if no change is required.
-		 */
-		break;
-	default:
-		wpa_printf(MSG_INFO,
-			   "MSCS: Drop received frame with unknown Request Type: %u",
-			   robust_av.request_type);
-		return;
-	}
-
-event_mscs_result:
-	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
-		" status_code=%u", MAC2STR(bssid), status);
-	wpa_s->mscs_setup_done = status == WLAN_STATUS_SUCCESS;
-}
-
-
 void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
 				       const u8 *src, const u8 *buf, size_t len)
 {
 	u8 dialog_token;
 	u16 status_code;
-	const u8 *mscs_desc_ie;
 
 	if (len < 3)
 		return;
 
 	dialog_token = *buf++;
-	len--;
-
-	/* AP sets dialog token to 0 for unsolicited response */
-	if (!dialog_token && !wpa_s->mscs_setup_done) {
-		wpa_printf(MSG_INFO,
-			   "MSCS: Drop unsolicited received frame: inactive");
-		return;
-	}
-
-	if (dialog_token && dialog_token != wpa_s->robust_av.dialog_token) {
+	if (dialog_token != wpa_s->robust_av.dialog_token) {
 		wpa_printf(MSG_INFO,
 			   "MSCS: Drop received frame due to dialog token mismatch: received:%u expected:%u",
 			   dialog_token, wpa_s->robust_av.dialog_token);
@@ -757,11 +683,9 @@
 	}
 
 	status_code = WPA_GET_LE16(buf);
-	buf += 2;
-	len -= 2;
-
-	mscs_desc_ie = get_ie_ext(buf, len, WLAN_EID_EXT_MSCS_DESCRIPTOR);
-	wpas_parse_mscs_resp(wpa_s, status_code, src, mscs_desc_ie);
+	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
+		" status_code=%u", MAC2STR(src), status_code);
+	wpa_s->mscs_setup_done = status_code == WLAN_STATUS_SUCCESS;
 }
 
 
@@ -777,19 +701,21 @@
 		return;
 
 	mscs_desc_ie = get_ie_ext(ies, ies_len, WLAN_EID_EXT_MSCS_DESCRIPTOR);
-	if (!mscs_desc_ie || mscs_desc_ie[1] <= MSCS_DESCRIPTOR_FIXED_LEN)
+	if (!mscs_desc_ie || mscs_desc_ie[1] <= 8)
 		return;
 
-	/* Subelements start after element header and fixed fields */
-	mscs_status = get_ie(&mscs_desc_ie[2 + MSCS_DESCRIPTOR_FIXED_LEN],
-			     mscs_desc_ie[1] - MSCS_DESCRIPTOR_FIXED_LEN,
+	/* Subelements start after (ie_id(1) + ie_len(1) + ext_id(1) +
+	 * request type(1) + upc(2) + stream timeout(4) =) 10.
+	 */
+	mscs_status = get_ie(&mscs_desc_ie[10], mscs_desc_ie[1] - 8,
 			     MCSC_SUBELEM_STATUS);
 	if (!mscs_status || mscs_status[1] < 2)
 		return;
 
 	status = WPA_GET_LE16(mscs_status + 2);
-
-	wpas_parse_mscs_resp(wpa_s, status, bssid, mscs_desc_ie);
+	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
+		" status_code=%u", MAC2STR(bssid), status);
+	wpa_s->mscs_setup_done = status == WLAN_STATUS_SUCCESS;
 }