[Add meta-cmf-filogic sdk cmf for rdkb development]

[Description]
Add meta-cmf-filogic sdk cmf for rdkb development
1. rdkb base on dunfell rdkb-next (> 2022q1)
2. cmf is mostly from meta-turris implementation
3. some 64bit support are port from rp4-64 cmf
4. arm64/arm 32bit bsp both can run on rdkb

[Release-log]
N/A

diff --git a/recipes-connectivity/hostapd/files/c89daaeca4ee90c8bc158e37acb1b679c823d7ab.patch b/recipes-connectivity/hostapd/files/c89daaeca4ee90c8bc158e37acb1b679c823d7ab.patch
new file mode 100644
index 0000000..6e2715a
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/c89daaeca4ee90c8bc158e37acb1b679c823d7ab.patch
@@ -0,0 +1,111 @@
+From c89daaeca4ee90c8bc158e37acb1b679c823d7ab Mon Sep 17 00:00:00 2001
+From: Helmut Schaa <helmut.schaa@googlemail.com>
+Date: Tue, 3 Dec 2013 14:51:43 +0100
+Subject: [PATCH] hostapd: Initial OVS support
+
+---
+ src/drivers/linux_ioctl.c | 67 ++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 66 insertions(+), 1 deletion(-)
+
+diff --git a/src/drivers/linux_ioctl.c b/src/drivers/linux_ioctl.c
+index 837971d2..e54aeb06 100644
+--- a/src/drivers/linux_ioctl.c
++++ b/src/drivers/linux_ioctl.c
+@@ -14,6 +14,62 @@
+ #include "utils/common.h"
+ #include "linux_ioctl.h"
+ 
++#define OPENVSWITCH
++#ifdef OPENVSWITCH
++#include <sys/wait.h>
++
++#define run_prog(p, ...) ({ \
++        int rc = -1, status; \
++        pid_t pid = fork(); \
++        if (!pid) \
++                exit(execl(p, p, ##__VA_ARGS__, NULL)); \
++        if (pid < 0) {\
++                rc = -1;\
++        } else {\
++                while ((rc = waitpid(pid, &status, 0)) == -1 && errno == EINTR); \
++		rc = (rc == pid && WIFEXITED(status)) ? WEXITSTATUS(status) : -1; \
++        }\
++        rc;\
++})
++
++int ovs_br_get(char *brname, const char *ifname)
++{
++	FILE *f;
++	char cmd[64];
++	char *c;
++
++	brname[0] = '\0';
++
++	sprintf(cmd, "/usr/bin/ovs-vsctl iface-to-br %s", ifname);
++	f = popen(cmd, "r");
++	if (!f)
++		return -1;
++	c = fgets(brname, IFNAMSIZ, f);
++	pclose(f);
++	if (c && strlen(brname)) {
++		/* Ignore newline */
++		if ((c = strchr(brname, '\n')))
++			*c = '\0';
++		return 0;
++	}
++	return -1;
++}
++
++int ovs_br_add_if(const char *brname, const char *ifname)
++{
++	if (run_prog("/usr/bin/ovs-vsctl", "add-port", brname, ifname))
++		return -1;
++	return 0;
++}
++
++int ovs_br_del_if(const char *brname, const char *ifname)
++{
++	if (run_prog("/usr/bin/ovs-vsctl", "del-port", brname, ifname))
++		return -1;
++	return 0;
++}
++
++#endif
+ 
+ int linux_set_iface_flags(int sock, const char *ifname, int dev_up)
+ {
+@@ -162,6 +217,9 @@ int linux_br_add_if(int sock, const char *brname, const char *ifname)
+ 	struct ifreq ifr;
+ 	int ifindex;
+ 
++	if (!ovs_br_add_if(brname, ifname))
++		return 0;
++
+ 	ifindex = if_nametoindex(ifname);
+ 	if (ifindex == 0)
+ 		return -1;
+@@ -184,6 +242,9 @@ int linux_br_del_if(int sock, const char *brname, const char *ifname)
+ 	struct ifreq ifr;
+ 	int ifindex;
+ 
++	if (!ovs_br_del_if(brname, ifname))
++		return 0;
++
+ 	ifindex = if_nametoindex(ifname);
+ 	if (ifindex == 0)
+ 		return -1;
+@@ -206,6 +267,9 @@ int linux_br_get(char *brname, const char *ifname)
+ 	char path[128], brlink[128], *pos;
+ 	ssize_t res;
+ 
++	if (!ovs_br_get(brname, ifname))
++		return 0;
++
+ 	os_snprintf(path, sizeof(path), "/sys/class/net/%s/brport/bridge",
+ 		    ifname);
+ 	res = readlink(path, brlink, sizeof(brlink));
+@@ -219,3 +283,4 @@ int linux_br_get(char *brname, const char *ifname)
+ 	os_strlcpy(brname, pos, IFNAMSIZ);
+ 	return 0;
+ }
++
diff --git a/recipes-connectivity/hostapd/files/defconfig b/recipes-connectivity/hostapd/files/defconfig
new file mode 100644
index 0000000..7b04cc3
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/defconfig
@@ -0,0 +1,391 @@
+# Example hostapd build time configuration
+#
+# This file lists the configuration options that are used when building the
+# hostapd binary. All lines starting with # are ignored. Configuration option
+# lines must be commented out complete, if they are not to be included, i.e.,
+# just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cass, these lines should use += in order not
+# to override previous values of the variables.
+
+# Driver interface for Host AP driver
+CONFIG_DRIVER_HOSTAP=y
+
+# Driver interface for wired authenticator
+CONFIG_DRIVER_WIRED=y
+
+# Driver interface for drivers using the nl80211 kernel interface
+CONFIG_DRIVER_NL80211=y
+
+# QCA vendor extensions to nl80211
+#CONFIG_DRIVER_NL80211_QCA=y
+
+# driver_nl80211.c requires libnl. If you are compiling it yourself
+# you may need to point hostapd to your version of libnl.
+#
+#CFLAGS += -I$<path to libnl include files>
+#LIBS += -L$<path to libnl library files>
+
+# Use libnl v2.0 (or 3.0) libraries.
+#CONFIG_LIBNL20=y
+
+# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
+CONFIG_LIBNL32=y
+
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
+
+# Driver interface for no driver (e.g., RADIUS server only)
+#CONFIG_DRIVER_NONE=y
+
+# IEEE 802.11F/IAPP
+CONFIG_IAPP=y
+
+# WPA2/IEEE 802.11i RSN pre-authentication
+CONFIG_RSN_PREAUTH=y
+
+# IEEE 802.11w (management frame protection)
+CONFIG_IEEE80211W=y
+
+# Support Operating Channel Validation
+#CONFIG_OCV=y
+
+# Integrated EAP server
+CONFIG_EAP=y
+
+# EAP Re-authentication Protocol (ERP) in integrated EAP server
+CONFIG_ERP=y
+
+# EAP-MD5 for the integrated EAP server
+CONFIG_EAP_MD5=y
+
+# EAP-TLS for the integrated EAP server
+CONFIG_EAP_TLS=y
+
+# EAP-MSCHAPv2 for the integrated EAP server
+CONFIG_EAP_MSCHAPV2=y
+
+# EAP-PEAP for the integrated EAP server
+CONFIG_EAP_PEAP=y
+
+# EAP-GTC for the integrated EAP server
+CONFIG_EAP_GTC=y
+
+# EAP-TTLS for the integrated EAP server
+CONFIG_EAP_TTLS=y
+
+# EAP-SIM for the integrated EAP server
+#CONFIG_EAP_SIM=y
+
+# EAP-AKA for the integrated EAP server
+#CONFIG_EAP_AKA=y
+
+# EAP-AKA' for the integrated EAP server
+# This requires CONFIG_EAP_AKA to be enabled, too.
+#CONFIG_EAP_AKA_PRIME=y
+
+# EAP-PAX for the integrated EAP server
+#CONFIG_EAP_PAX=y
+
+# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
+#CONFIG_EAP_PSK=y
+
+# EAP-pwd for the integrated EAP server (secure authentication with a password)
+#CONFIG_EAP_PWD=y
+
+# EAP-SAKE for the integrated EAP server
+#CONFIG_EAP_SAKE=y
+
+# EAP-GPSK for the integrated EAP server
+#CONFIG_EAP_GPSK=y
+# Include support for optional SHA256 cipher suite in EAP-GPSK
+#CONFIG_EAP_GPSK_SHA256=y
+
+# EAP-FAST for the integrated EAP server
+#CONFIG_EAP_FAST=y
+
+# EAP-TEAP for the integrated EAP server
+# Note: The current EAP-TEAP implementation is experimental and should not be
+# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
+# of conflicting statements and missing details and the implementation has
+# vendor specific workarounds for those and as such, may not interoperate with
+# any other implementation. This should not be used for anything else than
+# experimentation and interoperability testing until those issues has been
+# resolved.
+#CONFIG_EAP_TEAP=y
+
+# Wi-Fi Protected Setup (WPS)
+CONFIG_WPS=y
+# Enable UPnP support for external WPS Registrars
+CONFIG_WPS_UPNP=y
+# Enable WPS support with NFC config method
+CONFIG_WPS_NFC=y
+
+# EAP-IKEv2
+#CONFIG_EAP_IKEV2=y
+
+# Trusted Network Connect (EAP-TNC)
+#CONFIG_EAP_TNC=y
+
+# EAP-EKE for the integrated EAP server
+#CONFIG_EAP_EKE=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+CONFIG_PKCS12=y
+
+# RADIUS authentication server. This provides access to the integrated EAP
+# server from external hosts using RADIUS.
+CONFIG_RADIUS_SERVER=y
+
+# Build IPv6 support for RADIUS operations
+CONFIG_IPV6=y
+
+# IEEE Std 802.11r-2008 (Fast BSS Transition)
+CONFIG_IEEE80211R=y
+
+# Use the hostapd's IEEE 802.11 authentication (ACL), but without
+# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
+CONFIG_DRIVER_RADIUS_ACL=y
+
+# IEEE 802.11n (High Throughput) support
+CONFIG_IEEE80211N=y
+
+# Wireless Network Management (IEEE Std 802.11v-2011)
+# Note: This is experimental and not complete implementation.
+CONFIG_WNM=y
+
+# IEEE 802.11ac (Very High Throughput) support
+CONFIG_IEEE80211AC=y
+
+# IEEE 802.11ax HE support
+# Note: This is experimental and work in progress. The definitions are still
+# subject to change and this should not be expected to interoperate with the
+# final IEEE 802.11ax version.
+#CONFIG_IEEE80211AX=y
+
+# Remove debugging code that is printing out debug messages to stdout.
+# This can be used to reduce the size of the hostapd considerably if debugging
+# code is not needed.
+#CONFIG_NO_STDOUT_DEBUG=y
+
+# Add support for writing debug log to a file: -f /tmp/hostapd.log
+# Disabled by default.
+CONFIG_DEBUG_FILE=y
+
+# Send debug messages to syslog instead of stdout
+#CONFIG_DEBUG_SYSLOG=y
+
+# Add support for sending all debug messages (regardless of debug verbosity)
+# to the Linux kernel tracing facility. This helps debug the entire stack by
+# making it easy to record everything happening from the driver up into the
+# same file, e.g., using trace-cmd.
+#CONFIG_DEBUG_LINUX_TRACING=y
+
+# Remove support for RADIUS accounting
+#CONFIG_NO_ACCOUNTING=y
+
+# Remove support for RADIUS
+#CONFIG_NO_RADIUS=y
+
+# Remove support for VLANs
+#CONFIG_NO_VLAN=y
+
+# Enable support for fully dynamic VLANs. This enables hostapd to
+# automatically create bridge and VLAN interfaces if necessary.
+#CONFIG_FULL_DYNAMIC_VLAN=y
+
+# Use netlink-based kernel API for VLAN operations instead of ioctl()
+# Note: This requires libnl 3.1 or newer.
+#CONFIG_VLAN_NETLINK=y
+
+# Remove support for dumping internal state through control interface commands
+# This can be used to reduce binary size at the cost of disabling a debugging
+# option.
+#CONFIG_NO_DUMP_STATE=y
+
+# Enable tracing code for developer debugging
+# This tracks use of memory allocations and other registrations and reports
+# incorrect use with a backtrace of call (or allocation) location.
+#CONFIG_WPA_TRACE=y
+# For BSD, comment out these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
+
+# Use libbfd to get more details for developer debugging
+# This enables use of libbfd to get more detailed symbols for the backtraces
+# generated by CONFIG_WPA_TRACE=y.
+#CONFIG_WPA_TRACE_BFD=y
+# For BSD, comment out these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
+
+# hostapd depends on strong random number generation being available from the
+# operating system. os_get_random() function is used to fetch random data when
+# needed, e.g., for key generation. On Linux and BSD systems, this works by
+# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
+# properly initialized before hostapd is started. This is important especially
+# on embedded devices that do not have a hardware random number generator and
+# may by default start up with minimal entropy available for random number
+# generation.
+#
+# As a safety net, hostapd is by default trying to internally collect
+# additional entropy for generating random data to mix in with the data
+# fetched from the OS. This by itself is not considered to be very strong, but
+# it may help in cases where the system pool is not initialized properly.
+# However, it is very strongly recommended that the system pool is initialized
+# with enough entropy either by using hardware assisted random number
+# generator or by storing state over device reboots.
+#
+# hostapd can be configured to maintain its own entropy store over restarts to
+# enhance random number generation. This is not perfect, but it is much more
+# secure than using the same sequence of random numbers after every reboot.
+# This can be enabled with -e<entropy file> command line option. The specified
+# file needs to be readable and writable by hostapd.
+#
+# If the os_get_random() is known to provide strong random data (e.g., on
+# Linux/BSD, the board in question is known to have reliable source of random
+# data from /dev/urandom), the internal hostapd random pool can be disabled.
+# This will save some in binary size and CPU use. However, this should only be
+# considered for builds that are known to be used on devices that meet the
+# requirements described above.
+#CONFIG_NO_RANDOM_POOL=y
+
+# Should we attempt to use the getrandom(2) call that provides more reliable
+# yet secure randomness source than /dev/random on Linux 3.17 and newer.
+# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
+#CONFIG_GETRANDOM=y
+
+# Should we use poll instead of select? Select is used by default.
+#CONFIG_ELOOP_POLL=y
+
+# Should we use epoll instead of select? Select is used by default.
+#CONFIG_ELOOP_EPOLL=y
+
+# Should we use kqueue instead of select? Select is used by default.
+#CONFIG_ELOOP_KQUEUE=y
+
+# Select TLS implementation
+# openssl = OpenSSL (default)
+# gnutls = GnuTLS
+# internal = Internal TLSv1 implementation (experimental)
+# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
+# none = Empty template
+#CONFIG_TLS=openssl
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
+# can be enabled to get a stronger construction of messages when block ciphers
+# are used.
+#CONFIG_TLSV11=y
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
+# can be enabled to enable use of stronger crypto algorithms.
+#CONFIG_TLSV12=y
+
+# Select which ciphers to use by default with OpenSSL if the user does not
+# specify them.
+#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
+
+# If CONFIG_TLS=internal is used, additional library and include paths are
+# needed for LibTomMath. Alternatively, an integrated, minimal version of
+# LibTomMath can be used. See beginning of libtommath.c for details on benefits
+# and drawbacks of this option.
+#CONFIG_INTERNAL_LIBTOMMATH=y
+#ifndef CONFIG_INTERNAL_LIBTOMMATH
+#LTM_PATH=/usr/src/libtommath-0.39
+#CFLAGS += -I$(LTM_PATH)
+#LIBS += -L$(LTM_PATH)
+#LIBS_p += -L$(LTM_PATH)
+#endif
+# At the cost of about 4 kB of additional binary size, the internal LibTomMath
+# can be configured to include faster routines for exptmod, sqr, and div to
+# speed up DH and RSA calculation considerably
+#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
+
+# Interworking (IEEE 802.11u)
+# This can be used to enable functionality to improve interworking with
+# external networks.
+#CONFIG_INTERWORKING=y
+
+# Hotspot 2.0
+#CONFIG_HS20=y
+
+# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
+#CONFIG_SQLITE=y
+
+# Enable Fast Session Transfer (FST)
+#CONFIG_FST=y
+
+# Enable CLI commands for FST testing
+#CONFIG_FST_TEST=y
+
+# Testing options
+# This can be used to enable some testing options (see also the example
+# configuration file) that are really useful only for testing clients that
+# connect to this hostapd. These options allow, for example, to drop a
+# certain percentage of probe requests or auth/(re)assoc frames.
+#
+#CONFIG_TESTING_OPTIONS=y
+
+# Automatic Channel Selection
+# This will allow hostapd to pick the channel automatically when channel is set
+# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
+# similar way.
+#
+# Automatic selection is currently only done through initialization, later on
+# we hope to do background checks to keep us moving to more ideal channels as
+# time goes by. ACS is currently only supported through the nl80211 driver and
+# your driver must have survey dump capability that is filled by the driver
+# during scanning.
+#
+# You can customize the ACS survey algorithm with the hostapd.conf variable
+# acs_num_scans.
+#
+# Supported ACS drivers:
+# * ath9k
+# * ath5k
+# * ath10k
+#
+# For more details refer to:
+# http://wireless.kernel.org/en/users/Documentation/acs
+#
+CONFIG_ACS=y
+
+# Multiband Operation support
+# These extentions facilitate efficient use of multiple frequency bands
+# available to the AP and the devices that may associate with it.
+CONFIG_MBO=y
+
+# Client Taxonomy
+# Has the AP retain the Probe Request and (Re)Association Request frames from
+# a client, from which a signature can be produced which can identify the model
+# of client device like "Nexus 6P" or "iPhone 5s".
+CONFIG_TAXONOMY=y
+
+# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
+#CONFIG_FILS=y
+# FILS shared key authentication with PFS
+#CONFIG_FILS_SK_PFS=y
+
+# Include internal line edit mode in hostapd_cli. This can be used to provide
+# limited command line editing and history support.
+#CONFIG_WPA_CLI_EDIT=y
+
+# Opportunistic Wireless Encryption (OWE)
+# Experimental implementation of draft-harkins-owe-07.txt
+#CONFIG_OWE=y
+
+# Airtime policy support
+CONFIG_AIRTIME_POLICY=y
+
+# Override default value for the wpa_disable_eapol_key_retries configuration
+# parameter. See that parameter in hostapd.conf for more details.
+#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
diff --git a/recipes-connectivity/hostapd/files/hostapd-2G.conf b/recipes-connectivity/hostapd/files/hostapd-2G.conf
new file mode 100644
index 0000000..14cf67b
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-2G.conf
@@ -0,0 +1,48 @@
+driver=nl80211
+interface=wifi0
+bridge=brlan0
+ssid=TurrisOmnia
+
+country_code=US
+ieee80211d=1
+hw_mode=g
+beacon_int=100
+channel=11
+
+ieee80211n=1
+ht_capab=[SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1]
+
+ap_isolate=1
+bss_load_update_period=60
+#chan_util_avg_period=600
+disassoc_low_ack=1
+preamble=1
+wmm_enabled=1
+ignore_broadcast_ssid=0
+uapsd_advertisement_enabled=1
+auth_algs=1
+rrm_neighbor_report=1
+bss_transition=1
+macaddr_acl=0
+bssid=
+
+#Security parameters
+wpa=2
+wpa_pairwise=CCMP
+wpa_key_mgmt=WPA-PSK
+wpa_passphrase=rdk@1234
+
+#WPS configuration lines
+wps_state=0
+ap_setup_locked=1
+config_methods=virtual_push_button keypad
+wps_pin_requests=/var/run/hostapd_wps_pin_requests.log
+eap_server=1
+
+#Interface for separate control program. hostapd_cli command will use it when trying to connect with hostapd.
+ctrl_interface=/var/run/hostapd
+
+logger_syslog=127
+logger_syslog_level=2
+logger_stdout=127
+logger_stdout_level=2
diff --git a/recipes-connectivity/hostapd/files/hostapd-5G.conf b/recipes-connectivity/hostapd/files/hostapd-5G.conf
new file mode 100644
index 0000000..d3b6117
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-5G.conf
@@ -0,0 +1,54 @@
+driver=nl80211
+interface=wifi1
+bridge=brlan0
+ssid=TurrisOmnia
+
+country_code=US
+ieee80211d=1
+hw_mode=a
+beacon_int=100
+channel=36
+
+#ieee80211h=1
+ieee80211n=1
+ht_capab=[SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
+
+ieee80211ac=1
+#vht_oper_chwidth=1
+#vht_oper_centr_freq_seg0_idx=42
+vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP7]
+
+ap_isolate=1
+bss_load_update_period=60
+#chan_util_avg_period=600
+disassoc_low_ack=1
+preamble=1
+wmm_enabled=1
+ignore_broadcast_ssid=0
+uapsd_advertisement_enabled=1
+auth_algs=1
+rrm_neighbor_report=1
+bss_transition=1
+macaddr_acl=0
+bssid=
+
+#Security parameters
+wpa=2
+wpa_pairwise=CCMP
+wpa_key_mgmt=WPA-PSK
+wpa_passphrase=rdk@1234
+
+#WPS configuration lines, but WPS disabled by default
+wps_state=0
+ap_setup_locked=1
+config_methods=virtual_push_button keypad
+wps_pin_requests=/var/run/hostapd_wps_pin_requests.log
+eap_server=1
+
+#Interface for separate control program. hostapd_cli command will use it when trying to connect with hostapd.
+ctrl_interface=/var/run/hostapd
+
+logger_syslog=127
+logger_syslog_level=2
+logger_stdout=127
+logger_stdout_level=2
diff --git a/recipes-connectivity/hostapd/files/hostapd-bhaul2G.conf b/recipes-connectivity/hostapd/files/hostapd-bhaul2G.conf
new file mode 100644
index 0000000..38cafc5
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-bhaul2G.conf
@@ -0,0 +1,35 @@
+driver=nl80211
+logger_syslog=127
+logger_syslog_level=2
+logger_stdout=127
+logger_stdout_level=2
+country_code=US
+ieee80211d=1
+hw_mode=g
+beacon_int=100
+channel=11
+
+ieee80211n=1
+#ht_coex=0
+ht_capab=[SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
+
+interface=wifi2
+ctrl_interface=/var/run/hostapd
+ap_isolate=1
+bss_load_update_period=60
+#chan_util_avg_period=600
+disassoc_low_ack=1
+preamble=1
+wmm_enabled=1
+ignore_broadcast_ssid=1
+uapsd_advertisement_enabled=1
+auth_algs=1
+wpa=2
+bssid=
+wpa_pairwise=CCMP
+rrm_neighbor_report=1
+wpa_key_mgmt=WPA-PSK
+bss_transition=1
+
+macaddr_acl=1
+accept_mac_file=/tmp/hostapd-acl2
diff --git a/recipes-connectivity/hostapd/files/hostapd-bhaul5G.conf b/recipes-connectivity/hostapd/files/hostapd-bhaul5G.conf
new file mode 100644
index 0000000..8c5d9e0
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-bhaul5G.conf
@@ -0,0 +1,35 @@
+driver=nl80211
+logger_syslog=127
+logger_syslog_level=2
+logger_stdout=127
+logger_stdout_level=2
+country_code=US
+ieee80211d=1
+hw_mode=a
+beacon_int=100
+channel=36
+
+ieee80211n=1
+#ht_coex=0
+ht_capab=[SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
+
+interface=wifi3
+ctrl_interface=/var/run/hostapd
+ap_isolate=1
+bss_load_update_period=60
+#chan_util_avg_period=600
+disassoc_low_ack=1
+preamble=1
+wmm_enabled=1
+ignore_broadcast_ssid=1
+uapsd_advertisement_enabled=1
+auth_algs=1
+wpa=2
+bssid=
+wpa_pairwise=CCMP
+rrm_neighbor_report=1
+wpa_key_mgmt=WPA-PSK
+bss_transition=1
+
+macaddr_acl=1
+accept_mac_file=/tmp/hostapd-acl3
diff --git a/recipes-connectivity/hostapd/files/hostapd-enable-80211ac.patch b/recipes-connectivity/hostapd/files/hostapd-enable-80211ac.patch
new file mode 100644
index 0000000..824233d
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-enable-80211ac.patch
@@ -0,0 +1,14 @@
+diff -Naur 2.5-r0-orig/defconfig 2.5-r0/defconfig
+--- 2.5-r0-orig/defconfig	2019-07-15 11:06:28.150942350 +0000
++++ 2.5-r0/defconfig	2019-07-15 10:58:17.959429890 +0000
+@@ -139,6 +139,9 @@
+ # IEEE 802.11n (High Throughput) support
+ CONFIG_IEEE80211N=y
+ 
++CONFIG_IEEE80211AC=y
++CONFIG_ACS=y
++
+ # Remove debugging code that is printing out debug messages to stdout.
+ # This can be used to reduce the size of the hostapd considerably if debugging
+ # code is not needed.
+File 2.5-r0-orig/pseudo/pseudo.socket is a socket while file 2.5-r0/pseudo/pseudo.socket is a socket
diff --git a/recipes-connectivity/hostapd/files/hostapd-init.sh b/recipes-connectivity/hostapd/files/hostapd-init.sh
new file mode 100644
index 0000000..fd5532d
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd-init.sh
@@ -0,0 +1,222 @@
+# If not stated otherwise in this file or this component's LICENSE
+# file the following copyright and licenses apply:
+#
+#Copyright [2019] [RDK Management]
+#
+#Licensed under the Apache License, Version 2.0 (the "License");
+#you may not use this file except in compliance with the License.
+#You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing, software
+#distributed under the License is distributed on an "AS IS" BASIS,
+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#See the License for the specific language governing permissions and
+#limitations under the License.
+
+#!/bin/sh
+
+device_type=`cat /version.txt | grep imagename | cut -d':' -f2 | cut -d'-' -f3`
+echo "device_type: $device_type"
+if [ $device_type == "extender" ];
+then
+#Workaround: allowing devices initialization
+sleep 5;
+fi
+
+nvram_mounted=`mount | grep nvram -wc`
+if [ $nvram_mounted == 0 ]; then
+	mkdir -p /nvram
+	if [ -b /dev/mmcblk0p6 ]; then
+		#for Older Turris Omnia
+		mount /dev/mmcblk0p6 /nvram
+	else
+		#for Omnia2019 and  Omnia2020
+		mount /dev/mmcblk0p5 /nvram
+	fi
+fi
+
+WIFI0_MAC=`cat /sys/class/net/wlan0/address`
+WIFI1_MAC=`cat /sys/class/net/wlan1/address`
+echo "2.4GHz Radio MAC: $WIFI0_MAC"
+echo "5GHz   Radio MAC: $WIFI1_MAC"
+
+if [ ! -f /nvram/hostapd0.conf ]
+then
+	cp /etc/hostapd-2G.conf /nvram/hostapd0.conf
+	#Set bssid for wifi0
+        NEW_MAC=$(echo 0x$WIFI0_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+2, $2, $3, $4 ,$5, $6}')
+	sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd0.conf
+        echo "wpa_psk_file=/tmp/hostapd0.psk" >> /nvram/hostapd0.conf
+fi
+
+if [ ! -f /nvram/hostapd1.conf ]
+then
+	cp /etc/hostapd-5G.conf /nvram/hostapd1.conf
+	#Set bssid for wifi1
+        NEW_MAC=$(echo 0x$WIFI1_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+2, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd1.conf
+        echo "wpa_psk_file=/tmp/hostapd1.psk" >> /nvram/hostapd1.conf
+fi
+
+if [ ! -f /nvram/hostapd2.conf ]
+then
+	cp /etc/hostapd-bhaul2G.conf /nvram/hostapd2.conf
+	#Set bssid for wifi2
+        NEW_MAC=$(echo 0x$WIFI0_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+4, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd2.conf
+        echo "wpa_psk_file=/tmp/hostapd2.psk" >> /nvram/hostapd2.conf
+fi
+
+if [ ! -f /nvram/hostapd3.conf ]
+then
+	cp /etc/hostapd-bhaul5G.conf /nvram/hostapd3.conf
+	#Set bssid for wifi3
+        NEW_MAC=$(echo 0x$WIFI1_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+4, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd3.conf
+        echo "wpa_psk_file=/tmp/hostapd3.psk" >> /nvram/hostapd3.conf
+fi
+
+if [ ! -f /nvram/hostapd4.conf ]
+then
+	cp /etc/hostapd-bhaul2G.conf /nvram/hostapd4.conf
+	#Set bssid for wifi4
+        NEW_MAC=$(echo 0x$WIFI0_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+6, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd4.conf
+        sed -i "/^interface=/c\interface=wifi4" /nvram/hostapd4.conf
+        sed -i "/^accept_mac/c\accept_mac_file=/tmp/hostapd-acl4"  /nvram/hostapd4.conf
+        echo "wpa_psk_file=/tmp/hostapd4.psk" >> /nvram/hostapd4.conf
+fi
+
+if [ ! -f /nvram/hostapd5.conf ]
+then
+	cp /etc/hostapd-bhaul5G.conf /nvram/hostapd5.conf
+	#Set bssid for wifi5
+        NEW_MAC=$(echo 0x$WIFI1_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+6, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd5.conf
+        sed -i "/^interface=/c\interface=wifi5" /nvram/hostapd5.conf
+        sed -i "/^accept_mac/c\accept_mac_file=/tmp/hostapd-acl5" /nvram/hostapd5.conf
+        echo "wpa_psk_file=/tmp/hostapd5.psk" >> /nvram/hostapd5.conf
+fi
+
+if [ ! -f /nvram/hostapd6.conf ]
+then
+	cp /etc/hostapd-bhaul2G.conf /nvram/hostapd6.conf
+	#Set bssid for wifi6
+        NEW_MAC=$(echo 0x$WIFI1_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+8, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd6.conf
+        sed -i "/^interface=/c\interface=wifi6" /nvram/hostapd6.conf
+        sed -i "/^accept_mac/c\accept_mac_file=/tmp/hostapd-acl6"  /nvram/hostapd6.conf
+        echo "wpa_psk_file=/tmp/hostapd6.psk" >> /nvram/hostapd6.conf
+fi
+
+if [ ! -f /nvram/hostapd7.conf ]
+then
+	cp /etc/hostapd-bhaul5G.conf /nvram/hostapd7.conf
+	#Set bssid for wifi7
+        NEW_MAC=$(echo 0x$WIFI1_MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+8, $2, $3, $4 ,$5, $6}')
+        sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd7.conf
+        sed -i "/^interface=/c\interface=wifi7" /nvram/hostapd7.conf
+        sed -i "/^accept_mac/c\accept_mac_file=/tmp/hostapd-acl7"  /nvram/hostapd7.conf
+        echo "wpa_psk_file=/tmp/hostapd7.psk" >> /nvram/hostapd7.conf
+fi
+
+#Setting up VAP status file
+echo -e "wifi0=1\nwifi1=1\nwifi2=0\nwifi3=0\nwifi4=0\nwifi5=0\nwifi6=0\nwifi7=0" >/tmp/vap-status
+
+#Creating files for tracking AssociatedDevices
+touch /tmp/AllAssociated_Devices_2G.txt
+touch /tmp/AllAssociated_Devices_5G.txt
+
+if [ $device_type == "extender" ];
+then
+        ifconfig wlan0 down                                     
+        ifconfig wlan1 down 
+        exit 0;
+fi
+
+#Creating virtual interfaces wifi0 and wifi1 for Home APs
+iw dev wlan0 interface add wifi0 type __ap
+iw dev wlan1 interface add wifi1 type __ap
+
+#2.4GHz Virtual Access Points for backhaul connection
+iw dev wlan0 interface add wifi2 type __ap
+ip addr add 169.254.0.1/25 dev wifi2
+ifconfig wifi2 mtu 1600
+
+#5GHz Virtual Access Points for backhaul connection
+iw dev wlan1 interface add wifi3 type __ap
+ip addr add 169.254.1.1/25 dev wifi3
+ifconfig wifi3 mtu 1600
+
+#Creating virtual interfaces wifi4 and wifi5 for Guest APs
+iw dev wlan0 interface add wifi4 type __ap
+iw dev wlan1 interface add wifi5 type __ap
+
+#2.4GHz Virtual Access Points for Secure Onboard connection
+iw dev wlan0 interface add wifi6 type __ap
+ip addr add 169.254.0.129/25 dev wifi6
+ifconfig wifi6 mtu 1600
+
+#5GHz Virtual Access Points for onboard connection
+iw dev wlan1 interface add wifi7 type __ap
+ip addr add 169.254.1.129/25 dev wifi7
+ifconfig wifi7 mtu 1600
+
+#Creating virtual interfaces wifi8 and wifi9 for Service APs
+iw dev wlan0 interface add wifi8 type __ap
+iw dev wlan1 interface add wifi9 type __ap
+
+#Create empty acl list for hostapd
+touch /tmp/hostapd-acl0
+touch /tmp/hostapd-acl1
+touch /tmp/hostapd-acl2
+touch /tmp/hostapd-acl3
+touch /tmp/hostapd-acl4
+touch /tmp/hostapd-acl5
+touch /tmp/hostapd-acl6
+touch /tmp/hostapd-acl7
+touch /tmp/hostapd-acl8
+touch /tmp/hostapd-acl9
+
+#create empty psk files
+touch /tmp/hostapd0.psk
+touch /tmp/hostapd1.psk
+touch /tmp/hostapd2.psk
+touch /tmp/hostapd3.psk
+touch /tmp/hostapd6.psk
+touch /tmp/hostapd7.psk
+touch /tmp/hostapd8.psk
+touch /tmp/hostapd9.psk
+
+#Create wps pin request log file
+touch /var/run/hostapd_wps_pin_requests.log
+
+#Setting brlan0 bridge
+if [ ! -f /sys/class/net/brlan0 ]
+then
+    brctl addbr brlan0
+    ip link set brlan0 address `cat /sys/class/net/eth1/address`
+    ifconfig brlan0 10.0.0.1 netmask 255.255.255.0 up
+fi
+
+#Work around for Ethernet connected clients
+brctl addif brlan0 lan0
+brctl addif brlan0 lan1
+brctl addif brlan0 lan2
+brctl addif brlan0 lan3
+brctl addif brlan0 lan4
+
+ifconfig eth1 up
+ifconfig lan0 up
+ifconfig lan1 up
+ifconfig lan2 up
+ifconfig lan3 up
+ifconfig lan4 up
+
+#workaround: creating /opt/secure folder for ssh service
+mkdir /opt/secure
+
+exit 0
+
diff --git a/recipes-connectivity/hostapd/files/hostapd.service b/recipes-connectivity/hostapd/files/hostapd.service
new file mode 100644
index 0000000..7df478f
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Hostapd IEEE 802.11n AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
+After=CcspPandMSsp.service
+StartLimitIntervalSec=120
+
+[Service]
+Type=forking
+ExecStartPre=/bin/sh -c '(/lib/rdk/hostapd-init.sh)'
+PIDFile=/var/run/hostapd-global.pid
+ExecStart=/usr/sbin/hostapd -g /var/run/hostapd/global -B -P /var/run/hostapd-global.pid
+ExecStartPost=hostapd_cli -i global raw ADD bss_config=phy0:/nvram/hostapd0.conf
+ExecStartPost=hostapd_cli -i global raw ADD bss_config=phy1:/nvram/hostapd1.conf
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/recipes-connectivity/hostapd/files/hostapd_turris.patch b/recipes-connectivity/hostapd/files/hostapd_turris.patch
new file mode 100644
index 0000000..20b0885
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/hostapd_turris.patch
@@ -0,0 +1,12 @@
+--- hostapd-2.5/src/crypto/crypto_openssl.c	2015-09-27 19:02:05.000000000 +0000
++++ hostapd-2.5_mod/src/crypto/crypto_openssl.c	2019-03-12 12:38:40.032066497 +0000
+@@ -96,7 +96,8 @@
+ #ifndef CONFIG_FIPS
+ int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
+ {
+-	return openssl_digest_vector(EVP_md4(), num_elem, addr, len, mac);
++	//return openssl_digest_vector(EVP_md4(), num_elem, addr, len, mac);
++	 fprintf(stderr,"##################### We have commented the md4_vector implementation #################\n");
+ }
+ #endif /* CONFIG_FIPS */
+ 
diff --git a/recipes-connectivity/hostapd/files/nl80211-relax-bridge-setup.patch b/recipes-connectivity/hostapd/files/nl80211-relax-bridge-setup.patch
new file mode 100644
index 0000000..ff63ccd
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/nl80211-relax-bridge-setup.patch
@@ -0,0 +1,17 @@
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 96fd0aadd..77dbf94b5 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -6923,10 +6923,10 @@ static int i802_check_bridge(struct wpa_driver_nl80211_data *drv,
+ 	wpa_printf(MSG_DEBUG, "nl80211: Adding interface %s into bridge %s",
+ 		   ifname, brname);
+ 	if (linux_br_add_if(drv->global->ioctl_sock, brname, ifname) < 0) {
+-		wpa_printf(MSG_ERROR, "nl80211: Failed to add interface %s "
++		wpa_printf(MSG_WARNING, "nl80211: Failed to add interface %s "
+ 			   "into bridge %s: %s",
+ 			   ifname, brname, strerror(errno));
+-		return -1;
++		return 0;
+ 	}
+ 	bss->added_if_into_bridge = 1;
+ 
diff --git a/recipes-connectivity/hostapd/files/ut.py b/recipes-connectivity/hostapd/files/ut.py
new file mode 100644
index 0000000..e183c90
--- /dev/null
+++ b/recipes-connectivity/hostapd/files/ut.py
@@ -0,0 +1,426 @@
+
+# This Program
+import os
+import unittest
+import time
+from ctypes import *
+
+so_file = "/usr/lib/libhal_wifi.so.0.0.0"
+lib = CDLL(so_file)
+print ("Load Library is : " + str(lib))
+
+class HalTestCases(unittest.TestCase):
+    def test_wifi_getHalVersion(self):
+        ver = c_char_p("")
+        lib.wifi_getHalVersion(ver)
+        self.assertEqual(ver.value, "3.0.0",
+                         'incorrect HAL version')
+        self.assertEqual(ver.value,
+                         "3.0.0",
+                         'incorrect HAL version')
+
+
+class wifiBasicConfigTests(unittest.TestCase):
+    # Set up envirnment var by $ export AP_IDX=0 before running this script
+    def setUp(self):
+        self.ap_index = 0
+        self.ap_index = int(os.environ["AP_IDX"])
+    """
+    def test_wifi_getCountryCode(self):
+        code = c_char_p("")
+        lib.wifi_getRadioCountryCode(self.ap_index, code)
+        self.assertEqual(code.value.rstrip(), "US",
+                         'incorrect Country Code %s' %code.value)
+
+    def test_wifi_setAndgetCountryCode(self):
+        tw_code = c_char_p("TW")
+        lib.wifi_setRadioCountryCode(self.ap_index, tw_code)
+        time.sleep(1)
+
+        code = c_char_p("")
+        lib.wifi_getRadioCountryCode(self.ap_index, code)
+        self.assertEqual(code.value.rstrip(), "TW",
+                         'incorrect Country Code %s' %code.value)
+
+        tw_code = c_char_p("US")
+        lib.wifi_setRadioCountryCode(self.ap_index, tw_code)
+        time.sleep(1)
+
+        code = c_char_p("")
+        lib.wifi_getRadioCountryCode(self.ap_index, code)
+        self.assertEqual(code.value.rstrip(), "US",
+                         'incorrect Country Code %s' %code.value)
+
+    def test_wifi_getRadioChannel(self):
+        radio_channel_p = (c_ulong*2)()
+        lib.wifi_getRadioChannel(self.ap_index, radio_channel_p)
+        channel_str = str(radio_channel_p[0])
+        channel_int = int(channel_str)
+
+        # set radio channel as 1
+        lib.wifi_setRadioChannel(self.ap_index, 1)
+        lib.wifi_reset()
+
+        radio_channel_p = (c_ulong*2)()
+        lib.wifi_getRadioChannel(self.ap_index, radio_channel_p)
+        _radio_channel_str = str(radio_channel_p[0])
+
+        self.assertEqual(_radio_channel_str, "1",
+                         'Radio channel has to be 1 for wlan%s. Current channel is %s'
+                         %(self.ap_index, _radio_channel_str))
+
+        lib.wifi_setRadioChannel(self.ap_index, channel_str)
+        time.sleep(1)
+        lib.wifi_reset()
+        time.sleep(1)
+
+        radio_channel_p = (c_ulong*2)()
+        lib.wifi_getRadioChannel(self.ap_index, radio_channel_p)
+        _radio_channel_str = str(radio_channel_p[0])
+
+        self.assertEqual(_radio_channel_str, channel_str,
+                         'Radio channel has to be %s for wlan%s. Current channel is %s'
+                         %(channel_str, self.ap_index, _radio_channel_str))
+    """
+    def test_wifi_ApEnable(self):
+        lib.wifi_setApEnable(self.ap_index, 0)
+        ap_en = (c_ubyte*4)()
+        lib.wifi_getApEnable(self.ap_index, ap_en)
+        _ap_en_str = str(ap_en[0])
+
+        self.assertEqual(_ap_en_str, "0",
+                         'AP Enable has to be False. Current is %s.' %(_ap_en_str))
+
+        _ap_en_p = create_string_buffer(32)
+        lib.wifi_getApStatus(self.ap_index, _ap_en_p)
+        self.assertEqual(_ap_en_p.value, "Disabled")
+
+
+        lib.wifi_setApEnable(self.ap_index, 1)
+        ap_en[0] = 0
+        lib.wifi_getApEnable(self.ap_index, ap_en)
+        _ap_en_str = str(ap_en[0])
+
+        self.assertEqual(_ap_en_str, "1",
+                         'AP Enable has to be True. Current is %s.' %(_ap_en_str))
+
+        _ap_en_p = create_string_buffer(32)
+        lib.wifi_getApStatus(self.ap_index, _ap_en_p)
+        self.assertEqual(_ap_en_p.value, "Enabled")
+    """
+    def test_wifi_SecurityMFPConfig(self):
+        config = c_char_p("")
+        lib.wifi_getApSecurityMFPConfig(self.ap_index, config)
+        self.assertEqual(config.value.rstrip(), "Disabled",
+                         'MFP Config(ieee80211w) has to be Disabled, but current value is %s' %config.value)
+
+        lib.wifi_setApSecurityMFPConfig(self.ap_index, "Required")
+
+        config = c_char_p("")
+        lib.wifi_getApSecurityMFPConfig(self.ap_index, config)
+        self.assertEqual(config.value.rstrip(), "Required",
+                         'MFP Config(ieee80211w) has to be Required, but current value is %s' %config.value)
+
+        lib.wifi_setApSecurityMFPConfig(self.ap_index, "Disabled")
+        config = c_char_p("")
+        lib.wifi_getApSecurityMFPConfig(self.ap_index, config)
+        self.assertEqual(config.value.rstrip(), "Disabled",
+                         'MFP Config(ieee80211w) has to be Disabled, but current value is %s' %config.value)
+
+    def test_wifi_ApMaxAssociatedDevicesAndWatermark(self):
+        lib.wifi_setApMaxAssociatedDevices(self.ap_index, 45)
+        time.sleep(1)
+
+        device_num = (c_uint*2)()
+        lib.wifi_getApMaxAssociatedDevices(self.ap_index, device_num)
+        device_num_str = str(device_num[0])
+        self.assertEqual(device_num_str, "45",
+                         'max_num_sta has to be 45, but current value is %s'
+                         %device_num_str)
+
+        lib.wifi_setApMaxAssociatedDevices(self.ap_index, 0)
+        time.sleep(1)
+
+        device_num = (c_uint*2)()
+        lib.wifi_getApMaxAssociatedDevices(self.ap_index, device_num)
+        device_num_str = str(device_num[0])
+        self.assertEqual(device_num_str, "0",
+                         'max_num_sta has to be 0, but current value is %s'
+                         %device_num_str)
+
+        device_watermark = (c_uint*2)()
+        lib.wifi_getApAssociatedDevicesHighWatermarkThreshold(self.ap_index,
+                                                              device_watermark)
+        device_watermark_str = str(device_watermark[0])
+        self.assertEqual(device_watermark_str, "50",
+                         'ApAssociatedDevicesHighWatermarkThreshold has to be 50, but'\
+                         'current value is %s' %(device_watermark_str))
+
+    def test_wifi_WmmEnabled(self):
+
+        init_wmm_enabled = (c_ubyte*2)()
+        lib.wifi_getApWmmEnable(self.ap_index, init_wmm_enabled)
+        init_wmm_enabled_str = str(init_wmm_enabled[0])
+
+        lib.wifi_setApWmmEnable(self.ap_index, 1)
+        wmm_enabled = (c_ubyte*2)()
+        lib.wifi_getApWmmEnable(self.ap_index, wmm_enabled)
+        wmm_enabled_str = str(wmm_enabled[0])
+
+        self.assertEqual(wmm_enabled_str, "1",
+                         'wmm_enabled has to be True. Current is %s.' %(wmm_enabled_str))
+
+        lib.wifi_setApWmmEnable(self.ap_index, int(init_wmm_enabled_str))
+
+
+    def test_wifi_UapsdAdvertisementEnabled(self):
+
+        init_uapsd_enabled = (c_ubyte*2)()
+        lib.wifi_getApWmmUapsdEnable(self.ap_index, init_uapsd_enabled)
+        init_uapsd_enabled_str = str(init_uapsd_enabled[0])
+
+        lib.wifi_setApWmmUapsdEnable(self.ap_index, 1)
+        uapsd_enabled = (c_ubyte*2)()
+        lib.wifi_getApWmmUapsdEnable(self.ap_index, uapsd_enabled)
+        uapsd_enabled_str = str(uapsd_enabled[0])
+
+        self.assertEqual(uapsd_enabled_str, "1",
+                         'uapsd_enabled has to be True. Current is %s.' %(uapsd_enabled_str))
+
+        lib.wifi_setApWmmUapsdEnable(self.ap_index, int(init_uapsd_enabled_str))
+    """
+    def test_wifi_getApRadiIndex(self):
+        index = (c_int*2)()
+        lib.wifi_getApRadioIndex(3, index)
+        self.assertEqual(index[0], 1)
+
+        index = (c_int*2)()
+        lib.wifi_getApRadioIndex(4, index)
+        self.assertEqual(index[0], 0)
+
+    def test_wifi_ApIsolation(self):
+        ap_isolation_enabled = (c_ubyte*2)()
+        lib.wifi_getApIsolationEnable(self.ap_index, ap_isolation_enabled)
+        ori_ap_isolation_str = str(ap_isolation_enabled[0])
+
+        lib.wifi_setApIsolationEnable(self.ap_index, 0)
+        lib.wifi_reset()
+        time.sleep(1)
+        ap_isolation_enabled = (c_ubyte*2)()
+        lib.wifi_getApIsolationEnable(self.ap_index, ap_isolation_enabled)
+        ap_isolation_str = str(ap_isolation_enabled[0])
+        self.assertEqual(ap_isolation_str, "0",
+                         'ap_isolate shall be false, but current is %s.'
+                         %(ap_isolation_enabled))
+
+
+        lib.wifi_setApIsolationEnable(self.ap_index, 1)
+        lib.wifi_reset()
+        time.sleep(1)
+        ap_isolation_enabled = (c_ubyte*2)()
+        lib.wifi_getApIsolationEnable(self.ap_index, ap_isolation_enabled)
+        ap_isolation_str = str(ap_isolation_enabled[0])
+        self.assertEqual(ap_isolation_str, "1",
+                         'ap_isolate shall be true, but current is %s.'
+                         %(ap_isolation_enabled))
+
+        lib.wifi_setApIsolationEnable(self.ap_index, ori_ap_isolation_str)
+        lib.wifi_reset()
+        time.sleep(1)
+
+    def test_wifi_ApMacAddressControlMode(self):
+         ori_mode = (c_ubyte*2)()
+         lib.wifi_getApMacAddressControlMode(self.ap_index, ori_mode)
+         ori_mode_str = str(ori_mode[0])
+
+         lib.wifi_setApMacAddressControlMode(self.ap_index, 2)
+         mac_address_mode = (c_ubyte*2)()
+         lib.wifi_getApMacAddressControlMode(self.ap_index, mac_address_mode)
+         mac_address_mode_str = str(mac_address_mode[0])
+         self.assertEqual(mac_address_mode_str, "2",
+                         'MacAddressControlMode shall be 2, but current is %s'
+                          %(mac_address_mode_str))
+
+
+         lib.wifi_setApMacAddressControlMode(self.ap_index, 0)
+         mac_address_mode = (c_ubyte*2)()
+         lib.wifi_getApMacAddressControlMode(self.ap_index, mac_address_mode)
+         mac_address_mode_str = str(mac_address_mode[0])
+         self.assertEqual(mac_address_mode_str, "0",
+                         'MacAddressControlMode shall be 0, but current is %s'
+                          %(mac_address_mode_str))
+
+         lib.wifi_setApMacAddressControlMode(self.ap_index, ori_mode_str)
+
+    def test_wifi_getApName(self):
+        name = c_char_p("")
+        lib.wifi_getApName(0, name)
+        self.assertEqual(name.value.rstrip(), "wifi0",
+                         'AP Name shall be wifi0, but current is %s' %name.value.rstrip())
+
+        name = c_char_p("")
+        lib.wifi_getApName(10, name)
+        self.assertEqual(name.value.rstrip(), "wifi10",
+                         'AP Name shall be wifi10, but current is %s' %name.value.rstrip())
+
+
+    def test_wifi_ApSsidAdvertisementEnable(self):
+
+        init_ssidAdvertisement_enabled = (c_ubyte*2)()
+        lib.wifi_getApSsidAdvertisementEnable(self.ap_index, init_ssidAdvertisement_enabled)
+
+        lib.wifi_setApSsidAdvertisementEnable(self.ap_index, 1)
+        ssid_enabled = (c_ubyte*2)()
+        lib.wifi_getApSsidAdvertisementEnable(self.ap_index, ssid_enabled)
+        ssid_enabled_str = str(ssid_enabled[0])
+
+        self.assertEqual(ssid_enabled_str, "1",
+                         'ssid_enabled has to be True. Current is %s.' %(ssid_enabled_str))
+
+        lib.wifi_setApSsidAdvertisementEnable(self.ap_index, init_ssidAdvertisement_enabled[0])
+
+class wifiWPSTests(unittest.TestCase):
+    def setUp(self):
+        self.ap_index = 0
+        self.ap_index = int(os.environ["AP_IDX"])
+    """
+    def test_wifi_getApWpsEnable(self):
+        # at least 2 bytes
+        wps_en = (c_ubyte*2)()
+        lib.wifi_getApWpsEnable(self.ap_index, wps_en)
+        wps_en_str = str(wps_en[0])
+
+        self.assertEqual(wps_en_str, "0",
+                         'WPS state has to be unconfigured. Current state is %s.' %(wps_en_str))
+
+    def test_wifi_setAndGetApWpsEnable(self):
+        lib.wifi_setApWpsEnable(self.ap_index, 1)
+
+        wps_en = (c_ubyte*2)()
+        lib.wifi_getApWpsEnable(self.ap_index, wps_en)
+        wps_en_str = str(wps_en[0])
+
+        self.assertEqual(wps_en_str, "1",
+                         'WPS state has to be configured. Current state is %s.' %(wps_en_str))
+    """
+    def test_wifi_getApWpsConfigurationState(self):
+        lib.wifi_setApWpsEnable(self.ap_index, 1)
+
+        wps_state = create_string_buffer(32)
+        lib.wifi_getApWpsConfigurationState(self.ap_index, wps_state)
+        self.assertEqual(wps_state.value, "Configured",
+                         'WPS state has to be Configured. Current state is %s'
+                         %wps_state.value)
+
+    def test_wifi_ApWpsButtonPush(self):
+        lib.wifi_setApWpsEnable(self.ap_index, 1)
+
+        lib.wifi_setApWpsButtonPush(self.ap_index)
+        cmd= "hostapd_cli -i wifi%s wps_get_status | grep 'PBC Status' | cut -d ' ' -f3" %(str(self.ap_index))
+
+        pbc_status = os.popen(cmd).read()
+        self.assertEqual(pbc_status.rstrip(), "Active", 'wps status shall be Active, but'\
+                         'current is %s' %(pbc_status.rstrip()))
+
+        lib.wifi_cancelApWPS(self.ap_index)
+
+        pbc_status = os.popen(cmd).read()
+        self.assertEqual(pbc_status.rstrip(), "Timed-out", 'wps status shall be Timed-out, but'\
+                         ' current is %s' %(pbc_status.rstrip()))
+
+
+
+    def tearDown(self):
+        lib.wifi_setApWpsEnable(self.ap_index, 0)
+
+class wifiClientMgmt(unittest.TestCase):
+    def setUp(self):
+        self.ap_index = 0
+        self.ap_index = int(os.environ["AP_IDX"])
+
+    def test_wifi_BSSTransitionActivation(self):
+        init_bss_transition = (c_ubyte*2)()
+        lib.wifi_getBSSTransitionActivation(self.ap_index, init_bss_transition)
+
+        lib.wifi_setBSSTransitionActivation(self.ap_index, 1)
+        bss_transition = (c_ubyte*2)()
+        lib.wifi_getBSSTransitionActivation(self.ap_index, bss_transition)
+        bss_transition_str = str(bss_transition[0])
+        self.assertEqual(bss_transition_str, "1",
+                         'bss_transition shall be True, but current is %s'
+                         %(bss_transition_str))
+
+        lib.wifi_setBSSTransitionActivation(self.ap_index, init_bss_transition[0])
+
+    def test_wifi_NeighborReportActivation(self):
+        init_rrm = (c_ubyte*2)()
+        lib.wifi_getNeighborReportActivation(self.ap_index, init_rrm)
+
+        lib.wifi_setNeighborReportActivation(self.ap_index, 1)
+        rrm = (c_ubyte*2)()
+        lib.wifi_getNeighborReportActivation(self.ap_index, rrm)
+        rrm_str = str(rrm[0])
+        self.assertEqual(rrm_str, "1",
+                         'rrm_neighbor_report shall be true, but current is %s'
+                         %(rrm_str))
+
+        lib.wifi_setNeighborReportActivation(self.ap_index, init_rrm[0])
+
+class wifiExtender(unittest.TestCase):
+    def setUp(self):
+        self.ap_index = 0
+        self.ap_index = int(os.environ["AP_IDX"])
+
+    def test_wifi_getSSIDRadioIndex(self):
+        index = (c_int*2)()
+        lib.wifi_getSSIDRadioIndex(3, index)
+        self.assertEqual(index[0], 1)
+
+        index = (c_int*2)()
+        lib.wifi_getSSIDRadioIndex(6, index)
+        self.assertEqual(index[0], 0)
+
+class wifiRadio(unittest.TestCase):
+    def setUp(self):
+        self.ap_index = 0
+        self.ap_index = int(os.environ["AP_IDX"])
+
+    def test_wifi_getRadioIfName(self):
+        radio_name = create_string_buffer(64)
+        lib.wifi_getRadioIfName(1, radio_name)
+        self.assertEqual(radio_name.value, "wlan1",
+                         'Radio name shall be wifi1, but current is %s' %(radio_name.value))
+
+        rtn_val = lib.wifi_getRadioIfName(4, radio_name)
+        self.assertEqual(rtn_val, -1, 'The return value of wifi_getRadioIfName() shall'\
+                         'be -1, but current is %d.' %(rtn_val))
+
+    def test_wifi_RadioEnable(self):
+        init_radio = (c_ubyte*2)()
+        lib.wifi_getRadioEnable(self.ap_index, init_radio)
+
+        lib.wifi_setRadioEnable(self.ap_index, 0)
+        time.sleep(2)
+
+        radio_enable = (c_ubyte*2)()
+        lib.wifi_getRadioEnable(self.ap_index, radio_enable)
+        self.assertEqual(str(radio_enable[0]), "0", 'Radio%d shall be disabled, but'\
+                         'current is %s' %(self.ap_index,str(radio_enable[0])))
+
+
+        lib.wifi_setRadioEnable(self.ap_index, 1)
+        time.sleep(2)
+
+        radio_enable = (c_ubyte*2)()
+        lib.wifi_getRadioEnable(self.ap_index, radio_enable)
+        self.assertEqual(str(radio_enable[0]), "1", 'Radio%d shall be enabled, but'\
+                         ' current is %s' %(self.ap_index,str(radio_enable[0])))
+
+
+        lib.wifi_setRadioEnable(self.ap_index, init_radio[0])
+        time.sleep(2)
+
+if __name__ == '__main__':
+
+    unittest.main(verbosity=2)
+