Index: hostapd-2016-10-02/hostapd/Makefile
===================================================================
--- hostapd-2016-10-02.orig/hostapd/Makefile	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/hostapd/Makefile	2017-04-24 13:32:15.229844897 +0530
@@ -219,6 +219,9 @@
 ifdef CONFIG_NO_CTRL_IFACE
 CFLAGS += -DCONFIG_NO_CTRL_IFACE
 else
+ifdef CONFIG_CTRL_IFACE_MIB
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
+endif
 ifeq ($(CONFIG_CTRL_IFACE), udp)
 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
 else
Index: hostapd-2016-10-02/hostapd/ctrl_iface.c
===================================================================
--- hostapd-2016-10-02.orig/hostapd/ctrl_iface.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/hostapd/ctrl_iface.c	2017-04-24 13:30:39.450553135 +0530
@@ -2364,6 +2364,7 @@
 						      reply_size);
 	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
 		reply_len = hostapd_drv_status(hapd, reply, reply_size);
+#ifdef CONFIG_CTRL_IFACE_MIB
 	} else if (os_strcmp(buf, "MIB") == 0) {
 		reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
 		if (reply_len >= 0) {
@@ -2405,6 +2406,7 @@
 	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
 		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
 							reply_size);
+#endif
 	} else if (os_strcmp(buf, "ATTACH") == 0) {
 		if (hostapd_ctrl_iface_attach(hapd, from, fromlen))
 			reply_len = -1;
Index: hostapd-2016-10-02/wpa_supplicant/Makefile
===================================================================
--- hostapd-2016-10-02.orig/wpa_supplicant/Makefile	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/wpa_supplicant/Makefile	2017-04-24 13:30:39.450553135 +0530
@@ -873,6 +873,9 @@
 OBJS += ../src/ap/mbo_ap.o
 endif
 ifdef CONFIG_CTRL_IFACE
+ifdef CONFIG_CTRL_IFACE_MIB
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
+endif
 OBJS += ../src/ap/ctrl_iface_ap.o
 endif
 
Index: hostapd-2016-10-02/wpa_supplicant/ctrl_iface.c
===================================================================
--- hostapd-2016-10-02.orig/wpa_supplicant/ctrl_iface.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/wpa_supplicant/ctrl_iface.c	2017-04-24 13:30:39.454553105 +0530
@@ -1905,7 +1905,7 @@
 			pos += ret;
 		}
 
-#ifdef CONFIG_AP
+#if defined(CONFIG_AP) && defined(CONFIG_CTRL_IFACE_MIB)
 		if (wpa_s->ap_iface) {
 			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
 							    end - pos,
@@ -8701,6 +8701,7 @@
 			reply_len = -1;
 	} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
 		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
+#ifdef CONFIG_CTRL_IFACE_MIB
 	} else if (os_strcmp(buf, "MIB") == 0) {
 		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
 		if (reply_len >= 0) {
@@ -8708,6 +8709,7 @@
 						      reply + reply_len,
 						      reply_size - reply_len);
 		}
+#endif
 	} else if (os_strncmp(buf, "STATUS", 6) == 0) {
 		reply_len = wpa_supplicant_ctrl_iface_status(
 			wpa_s, buf + 6, reply, reply_size);
@@ -9178,6 +9180,7 @@
 		reply_len = wpa_supplicant_ctrl_iface_bss(
 			wpa_s, buf + 4, reply, reply_size);
 #ifdef CONFIG_AP
+#ifdef CONFIG_CTRL_IFACE_MIB
 	} else if (os_strcmp(buf, "STA-FIRST") == 0) {
 		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
 	} else if (os_strncmp(buf, "STA ", 4) == 0) {
@@ -9186,12 +9189,15 @@
 	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
 		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
 						   reply_size);
+#endif
+#ifdef CONFIG_CTRL_IFACE_MIB
 	} else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
 		if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
 			reply_len = -1;
 	} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
 		if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13))
 			reply_len = -1;
+#endif
 	} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
 		if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12))
 			reply_len = -1;
Index: hostapd-2016-10-02/src/ap/ctrl_iface_ap.c
===================================================================
--- hostapd-2016-10-02.orig/src/ap/ctrl_iface_ap.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/src/ap/ctrl_iface_ap.c	2017-04-24 13:30:39.454553105 +0530
@@ -25,6 +25,7 @@
 #include "mbo_ap.h"
 #include "taxonomy.h"
 
+#ifdef CONFIG_CTRL_IFACE_MIB
 
 static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
 				 struct sta_info *sta,
@@ -250,6 +251,7 @@
 	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
 }
 
+#endif
 
 #ifdef CONFIG_P2P_MANAGER
 static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
Index: hostapd-2016-10-02/src/ap/ieee802_1x.c
===================================================================
--- hostapd-2016-10-02.orig/src/ap/ieee802_1x.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/src/ap/ieee802_1x.c	2017-04-24 13:30:39.454553105 +0530
@@ -2442,6 +2442,7 @@
 	return val ? "TRUE" : "FALSE";
 }
 
+#ifdef CONFIG_CTRL_IFACE_MIB
 
 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
 {
@@ -2617,6 +2618,7 @@
 	return len;
 }
 
+#endif
 
 #ifdef CONFIG_HS20
 static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
Index: hostapd-2016-10-02/src/ap/wpa_auth.c
===================================================================
--- hostapd-2016-10-02.orig/src/ap/wpa_auth.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/src/ap/wpa_auth.c	2017-04-24 13:30:39.454553105 +0530
@@ -3069,6 +3069,7 @@
 	return val ? "TRUE" : "FALSE";
 }
 
+#ifdef CONFIG_CTRL_IFACE_MIB
 
 #define RSN_SUITE "%02x-%02x-%02x-%d"
 #define RSN_SUITE_ARG(s) \
@@ -3213,7 +3214,7 @@
 
 	return len;
 }
-
+#endif
 
 void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
 {
Index: hostapd-2016-10-02/src/rsn_supp/wpa.c
===================================================================
--- hostapd-2016-10-02.orig/src/rsn_supp/wpa.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/src/rsn_supp/wpa.c	2017-04-24 13:30:39.458553076 +0530
@@ -2108,6 +2108,8 @@
 }
 
 
+#ifdef CONFIG_CTRL_IFACE_MIB
+
 #define RSN_SUITE "%02x-%02x-%02x-%d"
 #define RSN_SUITE_ARG(s) \
 ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
@@ -2191,6 +2193,7 @@
 
 	return (int) len;
 }
+#endif
 #endif /* CONFIG_CTRL_IFACE */
 
 
Index: hostapd-2016-10-02/wpa_supplicant/ap.c
===================================================================
--- hostapd-2016-10-02.orig/wpa_supplicant/ap.c	2017-04-24 13:30:39.458553076 +0530
+++ hostapd-2016-10-02/wpa_supplicant/ap.c	2017-04-24 13:30:39.458553076 +0530
@@ -1119,7 +1119,7 @@
 #endif /* CONFIG_WPS */
 
 
-#ifdef CONFIG_CTRL_IFACE
+#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB)
 
 int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
 			    char *buf, size_t buflen)
