Revert "[wpa_supplicant] Cumulative patch from commit 0c5ededed"

This reverts commit 1a1e642fd6c1200e7e1979ea70103c484062f3a9.

Reason for revert: Droidcop: Potential culprit for Bug 154881734 - verifying through Forrest before revert submission

Change-Id: I85f75adeb43554b0ebbf295fea51e1b68b169ed2
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 089830f..d429496 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1640,10 +1640,6 @@
 	if (ssid->sae_password_id && sae_pwe != 3)
 		sae_pwe = 1;
 	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SAE_PWE, sae_pwe);
-#ifdef CONFIG_TESTING_OPTIONS
-	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_FT_RSNXE_USED,
-			 wpa_s->ft_rsnxe_used);
-#endif /* CONFIG_TESTING_OPTIONS */
 
 	/* Extended Key ID is only supported in infrastructure BSS so far */
 	if (ssid->mode == WPAS_MODE_INFRA && wpa_s->conf->extended_key_id &&
@@ -4762,13 +4758,6 @@
 }
 
 
-static int wpas_eapol_needs_l2_packet(struct wpa_supplicant *wpa_s)
-{
-	return !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_CONTROL_PORT) ||
-		!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX);
-}
-
-
 int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
 {
 	if ((!wpa_s->p2p_mgmt ||
@@ -4778,9 +4767,7 @@
 		wpa_s->l2 = l2_packet_init(wpa_s->ifname,
 					   wpa_drv_get_mac_addr(wpa_s),
 					   ETH_P_EAPOL,
-					   wpas_eapol_needs_l2_packet(wpa_s) ?
-					   wpa_supplicant_rx_eapol : NULL,
-					   wpa_s, 0);
+					   wpa_supplicant_rx_eapol, wpa_s, 0);
 		if (wpa_s->l2 == NULL)
 			return -1;
 
@@ -4788,18 +4775,17 @@
 						L2_PACKET_FILTER_PKTTYPE))
 			wpa_dbg(wpa_s, MSG_DEBUG,
 				"Failed to attach pkt_type filter");
-
-		if (l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
-			wpa_msg(wpa_s, MSG_ERROR,
-				"Failed to get own L2 address");
-			return -1;
-		}
 	} else {
 		const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
 		if (addr)
 			os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
 	}
 
+	if (wpa_s->l2 && l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
+		wpa_msg(wpa_s, MSG_ERROR, "Failed to get own L2 address");
+		return -1;
+	}
+
 	wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
 	wpas_wps_update_mac_addr(wpa_s);
 
@@ -4858,7 +4844,7 @@
 	os_memcpy(wpa_s->perm_addr, wpa_s->own_addr, ETH_ALEN);
 	wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
 
-	if (wpa_s->bridge_ifname[0] && wpas_eapol_needs_l2_packet(wpa_s)) {
+	if (wpa_s->bridge_ifname[0]) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "Receiving packets from bridge "
 			"interface '%s'", wpa_s->bridge_ifname);
 		wpa_s->l2_br = l2_packet_init_bridge(
@@ -6254,7 +6240,6 @@
 	if (capa_res == 0) {
 		wpa_s->drv_capa_known = 1;
 		wpa_s->drv_flags = capa.flags;
-		wpa_s->drv_flags2 = capa.flags2;
 		wpa_s->drv_enc = capa.enc;
 		wpa_s->drv_rrm_flags = capa.rrm_flags;
 		wpa_s->probe_resp_offloads = capa.probe_resp_offloads;