android.config :

CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL32=y

android.mk :

LOCAL_LDLIBS  += -lcutils -llog -lcrypto -lssl -lkeystore_binder -lnl
comment LOCAL_SHARED_LIBRARIES : #LOCAL_SHARED_LIBRARIES := libcutils liblog


config.c :
// allow imsi and sim_slot options pushed from android

int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
		   int line)
{
	size_t i;
	int ret = 0;

	// MODDED
	// silently succeed
	if (!strcmp(var,"imsi") || !strcmp(var,"sim_slot"))
		return 0;


put includes to : sysroot/usr/include
put so from target system to : platforms/android-XX/arch-XX/usr/lib


# android sends STA_AUTOCONNECT 0 and wifi drops in sleep mode
ctrl_iface.c :
else if (os_strncmp(buf, "STA_AUTOCONNECT ", 16) == 0) {
   //wpa_s->auto_reconnect_disabled = atoi(buf + 16) == 0;



../../ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk APP_ABI=armeabi-v7a APP_PLATFORM=android-22
~/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin/strip libs/armeabi-v7a/*


hostapd :

CONFIG_IEEE80211N=y
CONFIG_IEEE80211AC=y
CONFIG_HS20=y

either enable CONFIG_ACS to support channel=0
OR sometimes wifi driver does not support it, then hardcode chan to config.c :


#ifndef CONFIG_ACS

// MODDED
// ACS not working on old mediatek driver in irbis TZ55
// force predefined channel

//			wpa_printf(MSG_ERROR, "Line %d: tries to enable ACS but CONFIG_ACS disabled",
//				   line);
//			return 1;
			conf->channel = 11;
#else /* CONFIG_ACS */
			conf->acs = 1;
			conf->channel = 0;
#endif /* CONFIG_ACS */
		} else {
			conf->channel = atoi(pos);

			// MODDED
			if (!conf->channel) conf->channel=11;

			conf->acs = conf->channel == 0;
		}
