Revert "[wpa_supplicant] Cumulative patch from b8491ae5a"

This reverts commit 878cf7bcbf2d7d8f08c3d060b8c5fbfcf0743eda.

Reason for revert: git_master/sdk_phone_armv7-sdk

Change-Id: I6070fc5c1f9c20867f6dfce90e529e35578d572e
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 3158768..952a3d5 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -772,8 +772,7 @@
 
 
 void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
-			     int offset, int width, int cf1, int cf2,
-			     int finished)
+			     int offset, int width, int cf1, int cf2)
 {
 	/* TODO: If OCV is enabled deauth STAs that don't perform a SA Query */
 
@@ -784,8 +783,7 @@
 
 	hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
 		       HOSTAPD_LEVEL_INFO,
-		       "driver %s channel switch: freq=%d, ht=%d, vht_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d",
-		       finished ? "had" : "starting",
+		       "driver had channel switch: freq=%d, ht=%d, vht_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d",
 		       freq, ht, hapd->iconf->ch_switch_vht_config, offset,
 		       width, channel_width_to_string(width), cf1, cf2);
 
@@ -808,19 +806,19 @@
 
 	switch (width) {
 	case CHAN_WIDTH_80:
-		chwidth = CHANWIDTH_80MHZ;
+		chwidth = VHT_CHANWIDTH_80MHZ;
 		break;
 	case CHAN_WIDTH_80P80:
-		chwidth = CHANWIDTH_80P80MHZ;
+		chwidth = VHT_CHANWIDTH_80P80MHZ;
 		break;
 	case CHAN_WIDTH_160:
-		chwidth = CHANWIDTH_160MHZ;
+		chwidth = VHT_CHANWIDTH_160MHZ;
 		break;
 	case CHAN_WIDTH_20_NOHT:
 	case CHAN_WIDTH_20:
 	case CHAN_WIDTH_40:
 	default:
-		chwidth = CHANWIDTH_USE_HT;
+		chwidth = VHT_CHANWIDTH_USE_HT;
 		break;
 	}
 
@@ -853,22 +851,13 @@
 	hapd->iconf->ch_switch_vht_config = 0;
 
 	hapd->iconf->secondary_channel = offset;
-	hostapd_set_oper_chwidth(hapd->iconf, chwidth);
-	hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx);
-	hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx);
+	hapd->iconf->vht_oper_chwidth = chwidth;
+	hapd->iconf->vht_oper_centr_freq_seg0_idx = seg0_idx;
+	hapd->iconf->vht_oper_centr_freq_seg1_idx = seg1_idx;
 
 	is_dfs = ieee80211_is_dfs(freq, hapd->iface->hw_features,
 				  hapd->iface->num_hw_features);
 
-	wpa_msg(hapd->msg_ctx, MSG_INFO,
-		"%sfreq=%d ht_enabled=%d ch_offset=%d ch_width=%s cf1=%d cf2=%d dfs=%d",
-		finished ? WPA_EVENT_CHANNEL_SWITCH :
-		WPA_EVENT_CHANNEL_SWITCH_STARTED,
-		freq, ht, offset, channel_width_to_string(width),
-		cf1, cf2, is_dfs);
-	if (!finished)
-		return;
-
 	if (hapd->csa_in_progress &&
 	    freq == hapd->cs_freq_params.freq) {
 		hostapd_cleanup_cs_params(hapd);
@@ -960,31 +949,28 @@
 		goto out;
 	}
 
-	if (hapd->iface->conf->ieee80211ac || hapd->iface->conf->ieee80211ax) {
+	if (hapd->iface->conf->ieee80211ac) {
 		/* set defaults for backwards compatibility */
-		hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0);
-		hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, 0);
-		hostapd_set_oper_chwidth(hapd->iconf, CHANWIDTH_USE_HT);
+		hapd->iconf->vht_oper_centr_freq_seg1_idx = 0;
+		hapd->iconf->vht_oper_centr_freq_seg0_idx = 0;
+		hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
 		if (acs_res->ch_width == 80) {
-			hostapd_set_oper_centr_freq_seg0_idx(
-				hapd->iconf, acs_res->vht_seg0_center_ch);
-			hostapd_set_oper_chwidth(hapd->iconf, CHANWIDTH_80MHZ);
+			hapd->iconf->vht_oper_centr_freq_seg0_idx =
+				acs_res->vht_seg0_center_ch;
+			hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ;
 		} else if (acs_res->ch_width == 160) {
 			if (acs_res->vht_seg1_center_ch == 0) {
-				hostapd_set_oper_centr_freq_seg0_idx(
-					hapd->iconf,
-					acs_res->vht_seg0_center_ch);
-				hostapd_set_oper_chwidth(hapd->iconf,
-							 CHANWIDTH_160MHZ);
+				hapd->iconf->vht_oper_centr_freq_seg0_idx =
+					acs_res->vht_seg0_center_ch;
+				hapd->iconf->vht_oper_chwidth =
+					VHT_CHANWIDTH_160MHZ;
 			} else {
-				hostapd_set_oper_centr_freq_seg0_idx(
-					hapd->iconf,
-					acs_res->vht_seg0_center_ch);
-				hostapd_set_oper_centr_freq_seg1_idx(
-					hapd->iconf,
-					acs_res->vht_seg1_center_ch);
-				hostapd_set_oper_chwidth(hapd->iconf,
-							 CHANWIDTH_80P80MHZ);
+				hapd->iconf->vht_oper_centr_freq_seg0_idx =
+					acs_res->vht_seg0_center_ch;
+				hapd->iconf->vht_oper_centr_freq_seg1_idx =
+					acs_res->vht_seg1_center_ch;
+				hapd->iconf->vht_oper_chwidth =
+					VHT_CHANWIDTH_80P80MHZ;
 			}
 		}
 	}
@@ -1589,73 +1575,6 @@
 }
 
 
-#ifdef CONFIG_OWE
-static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd,
-				      const u8 *peer, const u8 *ie,
-				      size_t ie_len)
-{
-	u16 status;
-	struct sta_info *sta;
-	struct ieee802_11_elems elems;
-
-	if (!hapd || !hapd->wpa_auth) {
-		wpa_printf(MSG_DEBUG, "OWE: Invalid hapd context");
-		return -1;
-	}
-	if (!peer) {
-		wpa_printf(MSG_DEBUG, "OWE: Peer unknown");
-		return -1;
-	}
-	if (!(hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE)) {
-		wpa_printf(MSG_DEBUG, "OWE: No OWE AKM configured");
-		status = WLAN_STATUS_AKMP_NOT_VALID;
-		goto err;
-	}
-	if (ieee802_11_parse_elems(ie, ie_len, &elems, 1) == ParseFailed) {
-		wpa_printf(MSG_DEBUG, "OWE: Failed to parse OWE IE for "
-			   MACSTR, MAC2STR(peer));
-		status = WLAN_STATUS_UNSPECIFIED_FAILURE;
-		goto err;
-	}
-	status = owe_validate_request(hapd, peer, elems.rsn_ie,
-				      elems.rsn_ie_len,
-				      elems.owe_dh, elems.owe_dh_len);
-	if (status != WLAN_STATUS_SUCCESS)
-		goto err;
-
-	sta = ap_get_sta(hapd, peer);
-	if (sta) {
-		ap_sta_no_session_timeout(hapd, sta);
-		accounting_sta_stop(hapd, sta);
-
-		/*
-		 * Make sure that the previously registered inactivity timer
-		 * will not remove the STA immediately.
-		 */
-		sta->timeout_next = STA_NULLFUNC;
-	} else {
-		sta = ap_sta_add(hapd, peer);
-		if (!sta) {
-			status = WLAN_STATUS_UNSPECIFIED_FAILURE;
-			goto err;
-		}
-	}
-	sta->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS | WLAN_STA_WPS2);
-
-	status = owe_process_rsn_ie(hapd, sta, elems.rsn_ie,
-				    elems.rsn_ie_len, elems.owe_dh,
-				    elems.owe_dh_len);
-	if (status != WLAN_STATUS_SUCCESS)
-		ap_free_sta(hapd, sta);
-
-	return 0;
-err:
-	hostapd_drv_update_dh_ie(hapd, peer, status, NULL, 0);
-	return 0;
-}
-#endif /* CONFIG_OWE */
-
-
 void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 			  union wpa_event_data *data)
 {
@@ -1761,15 +1680,6 @@
 				    data->assoc_info.req_ies_len,
 				    data->assoc_info.reassoc);
 		break;
-#ifdef CONFIG_OWE
-	case EVENT_UPDATE_DH:
-		if (!data)
-			return;
-		hostapd_notif_update_dh_ie(hapd, data->update_dh.peer,
-					   data->update_dh.ie,
-					   data->update_dh.ie_len);
-		break;
-#endif /* CONFIG_OWE */
 	case EVENT_DISASSOC:
 		if (data)
 			hostapd_notif_disassoc(hapd, data->disassoc_info.addr);
@@ -1786,7 +1696,6 @@
 	case EVENT_AUTH:
 		hostapd_notif_auth(hapd, &data->auth);
 		break;
-	case EVENT_CH_SWITCH_STARTED:
 	case EVENT_CH_SWITCH:
 		if (!data)
 			break;
@@ -1795,8 +1704,7 @@
 					data->ch_switch.ch_offset,
 					data->ch_switch.ch_width,
 					data->ch_switch.cf1,
-					data->ch_switch.cf2,
-					event == EVENT_CH_SWITCH);
+					data->ch_switch.cf2);
 		break;
 	case EVENT_CONNECT_FAILED_REASON:
 		if (!data)