Revert "[wpa_supplicant] Cumulative patch from c4e90da6d"

This reverts commit 39bc25d3a79c1375de430a7918d949c1a86f70c6.

Test: Compilation
Change-Id: Iae7670429466958911b5296cb1359bceecc0b03e
Exempt-From-Owner-Approval: Revert since it's breaking the build
diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
index 27c69d3..61d2f65 100644
--- a/src/ap/wnm_ap.c
+++ b/src/ap/wnm_ap.c
@@ -12,7 +12,6 @@
 #include "utils/eloop.h"
 #include "common/ieee802_11_defs.h"
 #include "common/wpa_ctrl.h"
-#include "common/ocv.h"
 #include "ap/hostapd.h"
 #include "ap/sta_info.h"
 #include "ap/ap_config.h"
@@ -55,8 +54,8 @@
 	size_t gtk_elem_len = 0;
 	size_t igtk_elem_len = 0;
 	struct wnm_sleep_element wnmsleep_ie;
-	u8 *wnmtfs_ie, *oci_ie;
-	u8 wnmsleep_ie_len, oci_ie_len;
+	u8 *wnmtfs_ie;
+	u8 wnmsleep_ie_len;
 	u16 wnmtfs_ie_len;
 	u8 *pos;
 	struct sta_info *sta;
@@ -89,42 +88,10 @@
 		wnmtfs_ie = NULL;
 	}
 
-	oci_ie = NULL;
-	oci_ie_len = 0;
-#ifdef CONFIG_OCV
-	if (action_type == WNM_SLEEP_MODE_EXIT &&
-	    wpa_auth_uses_ocv(sta->wpa_sm)) {
-		struct wpa_channel_info ci;
-
-		if (hostapd_drv_channel_info(hapd, &ci) != 0) {
-			wpa_printf(MSG_WARNING,
-				   "Failed to get channel info for OCI element in WNM-Sleep Mode frame");
-			os_free(wnmtfs_ie);
-			return -1;
-		}
-
-		oci_ie_len = OCV_OCI_EXTENDED_LEN;
-		oci_ie = os_zalloc(oci_ie_len);
-		if (!oci_ie) {
-			wpa_printf(MSG_WARNING,
-				   "Failed to allocate buffer for OCI element in WNM-Sleep Mode frame");
-			os_free(wnmtfs_ie);
-			return -1;
-		}
-
-		if (ocv_insert_extended_oci(&ci, oci_ie) < 0) {
-			os_free(wnmtfs_ie);
-			os_free(oci_ie);
-			return -1;
-		}
-	}
-#endif /* CONFIG_OCV */
-
 #define MAX_GTK_SUBELEM_LEN 45
 #define MAX_IGTK_SUBELEM_LEN 26
 	mgmt = os_zalloc(sizeof(*mgmt) + wnmsleep_ie_len +
-			 MAX_GTK_SUBELEM_LEN + MAX_IGTK_SUBELEM_LEN +
-			 oci_ie_len);
+			 MAX_GTK_SUBELEM_LEN + MAX_IGTK_SUBELEM_LEN);
 	if (mgmt == NULL) {
 		wpa_printf(MSG_DEBUG, "MLME: Failed to allocate buffer for "
 			   "WNM-Sleep Response action frame");
@@ -167,18 +134,11 @@
 	os_memcpy(pos, &wnmsleep_ie, wnmsleep_ie_len);
 	/* copy TFS IE here */
 	pos += wnmsleep_ie_len;
-	if (wnmtfs_ie) {
+	if (wnmtfs_ie)
 		os_memcpy(pos, wnmtfs_ie, wnmtfs_ie_len);
-		pos += wnmtfs_ie_len;
-	}
-#ifdef CONFIG_OCV
-	/* copy OCV OCI here */
-	if (oci_ie_len > 0)
-		os_memcpy(pos, oci_ie, oci_ie_len);
-#endif /* CONFIG_OCV */
 
 	len = 1 + sizeof(mgmt->u.action.u.wnm_sleep_resp) + gtk_elem_len +
-		igtk_elem_len + wnmsleep_ie_len + wnmtfs_ie_len + oci_ie_len;
+		igtk_elem_len + wnmsleep_ie_len + wnmtfs_ie_len;
 
 	/* In driver, response frame should be forced to sent when STA is in
 	 * PS mode */
@@ -225,7 +185,6 @@
 #undef MAX_IGTK_SUBELEM_LEN
 fail:
 	os_free(wnmtfs_ie);
-	os_free(oci_ie);
 	os_free(mgmt);
 	return res;
 }
@@ -242,11 +201,6 @@
 	u8 *tfsreq_ie_start = NULL;
 	u8 *tfsreq_ie_end = NULL;
 	u16 tfsreq_ie_len = 0;
-#ifdef CONFIG_OCV
-	struct sta_info *sta;
-	const u8 *oci_ie = NULL;
-	u8 oci_ie_len = 0;
-#endif /* CONFIG_OCV */
 
 	if (!hapd->conf->wnm_sleep_mode) {
 		wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from "
@@ -274,12 +228,6 @@
 			if (!tfsreq_ie_start)
 				tfsreq_ie_start = (u8 *) pos;
 			tfsreq_ie_end = (u8 *) pos;
-#ifdef CONFIG_OCV
-		} else if (*pos == WLAN_EID_EXTENSION && ie_len >= 1 &&
-			   pos[2] == WLAN_EID_EXT_OCV_OCI) {
-			oci_ie = pos + 3;
-			oci_ie_len = ie_len - 1;
-#endif /* CONFIG_OCV */
 		} else
 			wpa_printf(MSG_DEBUG, "WNM: EID %d not recognized",
 				   *pos);
@@ -291,27 +239,6 @@
 		return;
 	}
 
-#ifdef CONFIG_OCV
-	sta = ap_get_sta(hapd, addr);
-	if (wnmsleep_ie->action_type == WNM_SLEEP_MODE_EXIT &&
-	    sta && wpa_auth_uses_ocv(sta->wpa_sm)) {
-		struct wpa_channel_info ci;
-
-		if (hostapd_drv_channel_info(hapd, &ci) != 0) {
-			wpa_printf(MSG_WARNING,
-				   "Failed to get channel info to validate received OCI in WNM-Sleep Mode frame");
-			return;
-		}
-
-		if (ocv_verify_tx_params(oci_ie, oci_ie_len, &ci,
-					 channel_width_to_int(ci.chanwidth),
-					 ci.seg1_idx) != 0) {
-			wpa_msg(hapd, MSG_WARNING, "WNM: %s", ocv_errorstr);
-			return;
-		}
-	}
-#endif /* CONFIG_OCV */
-
 	if (wnmsleep_ie->action_type == WNM_SLEEP_MODE_ENTER &&
 	    tfsreq_ie_start && tfsreq_ie_end &&
 	    tfsreq_ie_end - tfsreq_ie_start >= 0) {