[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/connectivity/network_cfg/LICENSE b/src/connectivity/network_cfg/LICENSE
new file mode 100644
index 0000000..77f59ed
--- /dev/null
+++ b/src/connectivity/network_cfg/LICENSE
@@ -0,0 +1,31 @@
+Copyright Statement:
+
+This software/firmware and related documentation ("MediaTek Software") are
+protected under relevant copyright laws. The information contained herein is
+confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+the prior written permission of MediaTek inc. and/or its licensors, any
+reproduction, modification, use or disclosure of MediaTek Software, and
+information contained herein, in whole or in part, shall be strictly
+prohibited.
+
+MediaTek Inc. (C) 2015. All rights reserved.
+
+BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
diff --git a/src/connectivity/network_cfg/dhcpd_conf/dhcpd.sample.conf b/src/connectivity/network_cfg/dhcpd_conf/dhcpd.sample.conf
new file mode 100644
index 0000000..2facf35
--- /dev/null
+++ b/src/connectivity/network_cfg/dhcpd_conf/dhcpd.sample.conf
@@ -0,0 +1,8 @@
+subnet 192.168.1.0 netmask 255.255.255.0 {
+    range 192.168.1.100 192.168.1.150;
+    option routers 192.168.1.1;
+    option subnet-mask 255.255.255.0;
+    option broadcast-address 192.168.1.255;
+    default-lease-time 600;
+    max-lease-time 7200;
+}
diff --git a/src/connectivity/network_cfg/dnsmasq_conf/dnsmasq_mtk.conf b/src/connectivity/network_cfg/dnsmasq_conf/dnsmasq_mtk.conf
new file mode 100644
index 0000000..e41e376
--- /dev/null
+++ b/src/connectivity/network_cfg/dnsmasq_conf/dnsmasq_mtk.conf
@@ -0,0 +1,293 @@
+#configuration file for dnsmasq.
+#
+# Format is one option per line, legal options are the same
+# as the long options legal on the command line. See
+# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
+interface=ap0
+listen-address=192.168.1.1
+bind-interfaces
+dhcp-range=192.168.1.10,192.168.1.100,12
+# Change these lines if you want dnsmasq to serve MX records.
+# Only one of mx-host and mx-target need be set, the other defaults
+# to the name of the host  running dnsmasq.
+#mx-host=
+#mx-target=
+#selfmx
+#localmx
+
+# The following two options make you a better netizen, since they 
+# tell dnsmasq to filter out queries which the public DNS cannot
+# answer, and which load the servers (especially the root servers) 
+# uneccessarily. If you have a dial-on-demand link they also stop
+# these requests from bringing up the link uneccessarily.
+
+# Never forward plain names (with a dot or domain part)
+domain-needed
+# Never forward addresses in the non-routed address spaces.
+bogus-priv
+
+
+# Uncomment this to filter useless windows-originated DNS requests
+# which can trigger dial-on-demand links needlessly.
+# Note that (amongst other things) this blocks all SRV requests, 
+# so don't use it if you use eg Kerberos.
+#filterwin2k
+
+# Change this line if you want dns to get its upstream servers from
+# somewhere other that /etc/resolv.conf 
+#resolv-file=
+
+# By  default,  dnsmasq  will  send queries to any of the upstream
+# servers it knows about and tries to favour servers to are  known
+# to  be  up.  Uncommenting this forces dnsmasq to try each query
+# with  each  server  strictly  in  the  order  they   appear   in
+# /etc/resolv.conf
+#strict-order
+
+# If you don't want dnsmasq to read /etc/resolv.conf or any other
+# file, getting its servers for this file instead (see below), then
+# uncomment this
+#no-resolv
+
+# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
+# files for changes and re-read them then uncomment this.
+#no-poll
+
+# Add other name servers here, with domain specs if they are for 
+# non-public domains.
+#server=/localnet/192.168.0.1
+
+# Add local-only domains here, queries in these domains are answered
+# from /etc/hosts or DHCP only.
+#local=/localnet/
+
+# Add domains which you want to force to an IP address here.
+# The example below send any host in doubleclick.net to a local
+# webserver.
+#address=/doubleclick.net/127.0.0.1
+
+# You no longer (as of version 1.7) need to set these to enable 
+# dnsmasq to read /etc/ppp/resolv.conf since dnsmasq now uses the
+# "dip" group to achieve this.
+#user=
+#group=
+
+# If you want dnsmasq to listen for requests only on specified interfaces
+# (and the loopback) give the name of the interface (eg eth0) here. 
+# Repeat the line for more than one interface.
+#interface=
+# Or you can specify which interface _not_ to listen on
+#except-interface=
+# Or which to listen on by address (remember to include 127.0.0.1 if
+# you use this.)
+#listen-address=127.0.0.1
+
+# On systems which support it, dnsmasq binds the wildcard address,
+# even when it is listening on only some interfaces. It then discards
+# requests that it shouldn't reply to. This has the advantage of 
+# working even when interfaces come and go and change address. If you
+# want dnsmasq to really bind only the interfaces it is listening on,
+# uncomment this option. About the only time you may need this is when 
+# running another nameserver on the same machine.
+#bind-interfaces 
+
+# If you don't want dnsmasq to read /etc/hosts, uncomment the
+# following line.
+#no-hosts
+# or if you want it to read another file, as well as /etc/hosts, use
+# this.
+#addn-hosts=/etc/banner_add_hosts
+
+# Set this (and domain: see below) if you want to have a domain
+# automatically added to simple names in a hosts-file.
+#expand-hosts
+
+# Set the domain for dnsmasq. this is optional, but if it is set, it
+# does the following things.
+# 1) Allows DHCP hosts to have fully qualified domain names, as long
+#     as the domain part matches this setting.
+# 2) Sets the "domain" DHCP option thereby potentially setting the
+#    domain of all systems configured by DHCP
+# 3) Provides the domain part for "expand-hosts"
+#domain=thekelleys.org.uk
+  
+# Uncomment this to enable the integrated DHCP server, you need
+# to supply the range of addresses available for lease and optionally 
+# a lease time. If you have more than one network, you will need to
+# repeat this for each network on which you want to supply DHCP
+# service.
+#dhcp-range=192.168.0.50,192.168.0.150,12h
+#dhcp-range=10.0.0.10,10.0.0.200,2h
+
+# This is an example of a DHCP range where the netmask is given. This
+# is needed for networks we reach the dnsmasq DHCP server via a relay 
+# agent. If you don't know what a DHCP relay agent is, you probably
+# don't need to worry about this.
+#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
+
+# This is an example of a DHCP range with a network-id, so that
+# some DHCP options may be set only for this network.
+#dhcp-range=red,192.168.0.50,192.168.0.150
+
+# Supply parameters for specified hosts using DHCP. There are lots
+# of valid alternatives, so we will give examples of each. Note that
+# IP addresses DO NOT have to be in the range given above, they just
+# need to be on the same network. The order of the parameters in these
+# do not matter, it's permissble to give name,adddress and MAC in any order
+
+# Always allocate the host with ethernet address 11:22:33:44:55:66 
+# The IP address 192.168.0.60
+#dhcp-host=11:22:33:44:55:66,192.168.0.60
+
+# Always set the name of the host with hardware address
+# 11:22:33:44:55:66 to be "fred"
+#dhcp-host=11:22:33:44:55:66,fred
+
+# Always give the host with ethernet address 11:22:33:44:55:66
+# the name fred and IP address 192.168.0.60 and lease time 45 minutes
+#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
+
+# Give the machine which says it's name is "bert" IP address
+# 192.168.0.70 and an infinite lease
+#dhcp-host=bert,192.168.0.70,infinite
+
+# Always give the host with client identifier 01:02:02:04 
+# the IP address 192.168.0.60
+#dhcp-host=id:01:02:02:04,192.168.0.60
+
+# Always give the host with client identifier "marjorie"
+# the IP address 192.168.0.60
+#dhcp-host=id:marjorie,192.168.0.60
+
+# Enable the address given for "judge" in /etc/hosts
+# to be given to a machine presenting the name "judge" when
+# it asks for a DHCP lease.
+#dhcp-host=judge
+
+# Never offer DHCP service to a machine whose ethernet 
+# address is 11:22:33:44:55:66
+#dhcp-host=11:22:33:44:55:66,ignore
+
+# Ignore any client-id presented by the machine with ethernet
+# address 11:22:33:44:55:66. This is useful to prevent a machine 
+# being treated differently when running under different OS's or
+# between PXE boot and OS boot.
+#dhcp-host=11:22:33:44:55:66,id:*
+
+# Send extra options which are tagged as "red" to 
+# the machine with ethernet address 11:22:33:44:55:66
+#dhcp-host=11:22:33:44:55:66,net:red
+
+# Send extra options which are tagged as "red" to any machine whose
+# DHCP vendorclass string includes the substring "Linux"
+#dhcp-vendorclass=red,Linux
+
+# Send extra options which are tagged as "red" to any machine one 
+# of whose DHCP userclass strings includes the substring "accounts"
+#dhcp-userclass=red,accounts
+
+# If this line is uncommented, dnsmasq will read /etc/ethers and act
+# on the ethernet-address/IP pairs found there just as if they had
+# been given as --dhcp-host options. Useful if you keep
+# MAC-address/host mappings there for other purposes.
+#read-ethers
+
+# Send options to hosts which ask for a DHCP lease.
+# See RFC 2132 for details of available options.
+# Note that all the common settings, such as netmask and
+# broadcast address, DNS server and default route, are given
+# sane defaults by dnsmasq. You very likely will not need any
+# any dhcp-options. If you use Windows clients and Samba, there
+# are some options which are recommended, they are detailed at the
+# end of this section.
+# For reference, the common options are:
+# subnet mask - 1
+# default router - 3
+# DNS server - 6
+# broadcast address - 28
+
+# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
+#dhcp-option=42,192.168.0.4,10.10.0.5
+
+# Set the NTP time server address to be the same machine as 
+# is running dnsmasq
+#dhcp-option=42,0.0.0.0
+
+# Set the NIS domain name to "welly"
+#dhcp-option=40,welly
+
+# Set the default time-to-live to 50
+#dhcp-option=23,50
+
+# Set the "all subnets are local" flag
+#dhcp-option=27,1
+
+# Send the etherboot magic flag and then etherboot options (a string).
+#dhcp-option=128,e4:45:74:68:00:00
+#dhcp-option=129,NIC=eepro100
+
+# Specify an option which will only be sent to the "red" network 
+# (see dhcp-range for the declaration of the "red" network)
+#dhcp-option=red,42,192.168.1.1
+
+# The following DHCP options set up dnsmasq in the same way as is specified
+# for the ISC dhcpcd in 
+# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
+# adapted for a typical dnsmasq installation where the host running
+# dnsmasq is also the host running samba.
+# you may want to uncomment them if you use Windows clients and Samba.
+#dhcp-option=19,0           # option ip-forwarding off 
+#dhcp-option=44,0.0.0.0     # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
+#dhcp-option=45,0.0.0.0     # netbios datagram distribution server
+#dhcp-option=46,8           # netbios node type
+#dhcp-option=47             # empty netbios scope.
+ 
+
+# Set the boot filename and tftpd server name and address
+# for BOOTP. You will only need this is you want to
+# boot machines over the network.
+#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
+
+# Set the limit on DHCP leases, the default is 150
+#dhcp-lease-max=150
+
+# The DHCP server needs somewhere on disk to keep its lease database.
+# This defaults to a sane location, but if you want to change it, use
+# the line below.
+dhcp-leasefile=/tmp/dnsmasq.leases
+
+# Set the cachesize here.
+#cache-size=150
+
+# If you want to disable negative caching, uncomment this.
+#no-negcache
+
+# Normally responses which come form /etc/hosts and the DHCP lease
+# file have Time-To-Live set as zero, which conventionally means
+# do not cache further. If you are happy to trade lower load on the 
+# server for potentially stale date, you can set a time-to-live (in 
+# seconds) here.
+#local-ttl=
+
+# If you want dnsmasq to detect attempts by Verisign to send queries
+# to unregistered .com and .net hosts to its sitefinder service and
+# have dnsmasq instead return the correct NXDOMAIN response, uncomment
+# this line. You can add similar lines to do the same for other
+# registries which have implemented wildcard A records.
+#bogus-nxdomain=64.94.110.11
+
+# If you want to fix up DNS results from upstream servers, use the
+# alias option. This only works for IPv4.
+# This alias makes a result of 1.2.3.4 appear as 5.6.7.8
+#alias=1.2.3.4,5.6.7.8
+# and this maps 1.2.3.x to 5.6.7.x
+#alias=1.2.3.0,5.6.7.0,255.255.255.0
+
+# For debugging purposes, log each DNS query as it passes through
+# dnsmasq.
+#log-queries
+
+# Include a another lot of configuration options.
+#conf-file=/etc/dnsmasq.more.conf
+ 
+ 
diff --git a/src/connectivity/network_cfg/hostapd_conf/hostapd.conf.in b/src/connectivity/network_cfg/hostapd_conf/hostapd.conf.in
new file mode 100644
index 0000000..f019645
--- /dev/null
+++ b/src/connectivity/network_cfg/hostapd_conf/hostapd.conf.in
@@ -0,0 +1,19 @@
+interface=ap0
+driver=nl80211
+ctrl_interface=/var/run/hostapd
+ctrl_interface_group=0
+ssid=Automatic_AP
+channel=1
+ieee80211n=1
+hw_mode=g
+ignore_broadcast_ssid=0
+max_num_sta=8
+device_name=MTK_Automatic
+manufacturer=MediaTek Inc.
+model_name=MTK Wireless Model
+model_number=66xx
+serial_number=1.0
+device_type=10-0050F204-5
+wpa=2
+rsn_pairwise=CCMP
+wpa_passphrase=12345678
diff --git a/src/connectivity/network_cfg/hostapd_conf/runap.sh b/src/connectivity/network_cfg/hostapd_conf/runap.sh
new file mode 100644
index 0000000..6222dbc
--- /dev/null
+++ b/src/connectivity/network_cfg/hostapd_conf/runap.sh
@@ -0,0 +1,7 @@
+#2635 AP mode
+echo AP > /dev/wmtWifi
+ifconfig ap0 up
+ifconfig ap0 192.168.1.1
+echo '' > /tmp/dhcpd.leases
+dhcpd -cf /etc/dhcpd.conf ap0 -lf /tmp/dhcpd.leases &
+hostapd /etc/hostapd_mtk.conf &
diff --git a/src/connectivity/network_cfg/udhcpd_conf/udhcpd.conf b/src/connectivity/network_cfg/udhcpd_conf/udhcpd.conf
new file mode 100644
index 0000000..368f4d4
--- /dev/null
+++ b/src/connectivity/network_cfg/udhcpd_conf/udhcpd.conf
@@ -0,0 +1,115 @@
+# Sample udhcpd configuration file (/etc/udhcpd.conf)
+# Values shown are defaults
+
+# The start and end of the IP lease block
+start	192.168.1.100
+end		192.168.1.254
+
+# The interface that udhcpd will use
+interface	ap0
+
+# The maximum number of leases (includes addresses reserved
+# by OFFER's, DECLINE's, and ARP conflicts). Will be corrected
+# if it's bigger than IP lease block, but it ok to make it
+# smaller than lease block.
+#max_leases	254
+
+# The amount of time that an IP will be reserved (leased to nobody)
+# if a DHCP decline message is received (seconds)
+#decline_time	3600
+
+# The amount of time that an IP will be reserved
+# if an ARP conflict occurs (seconds)
+#conflict_time	3600
+
+# How long an offered address is reserved (seconds)
+#offer_time	60
+
+# If client asks for lease below this value, it will be rounded up
+# to this value (seconds)
+#min_lease	60
+
+# The location of the pid file
+#pidfile	/var/run/udhcpd.pid
+
+# The location of the leases file
+#lease_file	/var/lib/misc/udhcpd.leases
+
+# The time period at which udhcpd will write out leases file.
+# If this is 0, udhcpd will never automatically write leases file.
+# Specified in seconds.
+#auto_time	7200
+
+# Every time udhcpd writes a leases file, the below script will be called
+#notify_file			# default: no script
+#notify_file	dumpleases	# useful for debugging
+
+# The following are bootp specific options
+# next server to use in bootstrap
+#siaddr		192.168.0.22	# default: 0.0.0.0 (none)
+# tftp server name
+#sname		zorak		# default: none
+# tftp file to download (e.g. kernel image)
+#boot_file	/var/nfs_root	# default: none
+
+# Static leases map
+#static_lease 00:60:08:11:CE:4E 192.168.0.54
+#static_lease 00:60:08:11:CE:3E 192.168.0.44
+
+# The remainder of options are DHCP options and can be specified with the
+# keyword 'opt' or 'option'. If an option can take multiple items, such
+# as the dns option, they can be listed on the same line, or multiple
+# lines.
+# Examples:
+#opt	dns	192.168.10.2 192.168.10.10
+option	subnet	255.255.255.0
+opt	router	192.168.1.1
+#opt	wins	192.168.10.10
+option	dns	192.168.1.1	# appended to above DNS servers for a total of 3
+#option	domain	local
+#option	lease	864000		# default: 10 days
+#option	msstaticroutes	10.0.0.0/8 10.127.0.1		# single static route
+#option	staticroutes	10.0.0.0/8 10.127.0.1, 10.11.12.0/24 10.11.12.1
+# Arbitrary option in hex form:
+#option	0x08	01020304	# option 8: "cookie server IP addr: 1.2.3.4"
+
+# Currently supported options (for more info, see options.c):
+#opt lease      NUM
+#opt subnet     IP
+#opt broadcast  IP
+#opt router     IP_LIST
+#opt ipttl      NUM
+#opt mtu        NUM
+#opt hostname   STRING		# client's hostname
+#opt domain     STRING		# client's domain suffix
+#opt search     STRING_LIST	# search domains
+#opt nisdomain  STRING
+#opt timezone   NUM		# (localtime - UTC_time) in seconds. signed
+#opt tftp       STRING		# tftp server name
+#opt bootfile   STRING		# tftp file to download (e.g. kernel image)
+#opt bootsize   NUM		# size of that file
+#opt rootpath   STRING		# (NFS) path to mount as root fs
+#opt wpad       STRING
+#opt serverid   IP		# default: server's IP
+#opt message    STRING		# error message (udhcpd sends it on success too)
+#opt vlanid     NUM		# 802.1P VLAN ID
+#opt vlanpriority NUM		# 802.1Q VLAN priority
+# Options specifying server(s)
+#opt dns        IP_LIST
+#opt wins       IP_LIST
+#opt nissrv     IP_LIST
+#opt ntpsrv     IP_LIST
+#opt lprsrv     IP_LIST
+#opt swapsrv    IP
+# Options specifying routes
+#opt routes     IP_PAIR_LIST
+#opt staticroutes   STATIC_ROUTES # RFC 3442 classless static route option
+#opt msstaticroutes STATIC_ROUTES # same, using MS option number
+# Obsolete options, no longer supported
+#opt logsrv     IP_LIST	# 704/UDP log server (not syslog!)
+#opt namesrv    IP_LIST	# IEN 116 name server, obsolete (August 1979!!!)
+#opt cookiesrv  IP_LIST	# RFC 865 "quote of the day" server, rarely (never?) used
+#opt timesrv    IP_LIST	# RFC 868 time server, rarely (never?) used
+# TODO: in development
+#opt userclass  STRING		# RFC 3004. set of LASCII strings. "I am a printer" etc
+#opt sipserv    STRING LIST	# RFC 3361. flag byte, then: 0: domain names, 1: IP addrs
diff --git a/src/connectivity/network_cfg/wifi_mac/Android.mk b/src/connectivity/network_cfg/wifi_mac/Android.mk
new file mode 100644
index 0000000..97990f0
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/Android.mk
@@ -0,0 +1,9 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE := wifi_bt_mac_write
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS += -Wall
+LOCAL_SRC_FILES := main.c
+LOCAL_C_INCLUDES = $(LOCAL_PATH)/../wifi_mac
+$(warning $(LOCAL_C_INCLUDES))
+include $(BUILD_EXECUTABLE)
diff --git a/src/connectivity/network_cfg/wifi_mac/COPYING b/src/connectivity/network_cfg/wifi_mac/COPYING
new file mode 100644
index 0000000..8acc0e7
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/COPYING
@@ -0,0 +1,31 @@
+Copyright Statement:
+
+This software/firmware and related documentation ("MediaTek Software") are
+protected under relevant copyright laws. The information contained herein is
+confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+the prior written permission of MediaTek inc. and/or its licensors, any
+reproduction, modification, use or disclosure of MediaTek Software, and
+information contained herein, in whole or in part, shall be strictly
+prohibited.
+
+MediaTek Inc. (C) <YEAR> All rights reserved.
+
+BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
diff --git a/src/connectivity/network_cfg/wifi_mac/Makefile b/src/connectivity/network_cfg/wifi_mac/Makefile
new file mode 100644
index 0000000..23d1f02
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/Makefile
@@ -0,0 +1,23 @@
+#
+# Makefile for libwifitest
+#
+
+# definitions
+# ------------------------------------------------------------------------------
+CFLAGS				 = -pipe -g -Os $(EXTRA_CFLAGS)
+
+# library info
+# ------------------------------------------------------------------------------
+
+# wifitest tool info
+PROGRAM				 = wifi_bt_mac_write
+# objects
+# ------------------------------------------------------------------------------
+
+# compiling and linking
+# ------------------------------------------------------------------------------
+all: $(PROGRAM)
+clean:
+	-rm -f $(OBJS) $(LIB) $(PROGRAM)
+$(PROGRAM): main.c
+	$(CC) -L . -lm -o $@ $<
diff --git a/src/connectivity/network_cfg/wifi_mac/README b/src/connectivity/network_cfg/wifi_mac/README
new file mode 100644
index 0000000..f550023
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/README
@@ -0,0 +1,27 @@
+This directory contains Wi-Fi test tool function
+
+
+WHAT IT DOES?
+=============
+It provide test tool for Wi-Fi HW related test
+
+
+HOW IT WAS BUILT?
+==================
+It needs the following libs from AOSP:
+1. libcutils
+
+and the following libs from MediaTek:
+1. libwifitest
+
+All source/dependency modules of this module are already put in
+'hardware/mediatek/wlan/wifi_hw_test_tool' folder.
+
+
+HOW TO USE IT?
+==============
+Files in this directory is used for Wi-Fi test tool
+
+
+All the source code of this directory were written by MediaTek co..
+
diff --git a/src/connectivity/network_cfg/wifi_mac/main.c b/src/connectivity/network_cfg/wifi_mac/main.c
new file mode 100644
index 0000000..0f3412f
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/main.c
@@ -0,0 +1,141 @@
+
+/******************************************************************************
+*                         C O M P I L E R   F L A G S
+*******************************************************************************
+*/
+
+/******************************************************************************
+*                    E X T E R N A L   R E F E R E N C E S
+*******************************************************************************
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/sendfile.h>
+#include <fcntl.h>
+#include <linux/types.h>
+#include <limits.h>
+#include <getopt.h>
+#include <errno.h>
+#include <time.h>
+
+/******************************************************************************
+*                              C O N S T A N T S
+*******************************************************************************
+*/
+/* !defined(ANDROID) */
+
+
+/******************************************************************************
+*                             D A T A   T Y P E S
+*******************************************************************************
+*/
+
+/******************************************************************************
+*                                 M A C R O S
+*******************************************************************************
+*/
+
+/******************************************************************************
+*                   F U N C T I O N   D E C L A R A T I O N S
+*******************************************************************************
+*/
+
+/******************************************************************************
+*                            P U B L I C   D A T A
+*******************************************************************************
+*/
+
+/******************************************************************************
+*                           P R I V A T E   D A T A
+*******************************************************************************
+*/
+char EEPROM_PATH[64] = "/data/misc/connectivity/EEPROM_MT7668.bin";
+
+/******************************************************************************
+*                              F U N C T I O N S
+*******************************************************************************
+*/
+int main(int argc, char *argv[]) {
+	FILE *fh = NULL, *frandom = NULL;
+	long random_value = 0;
+	int rc;
+	unsigned char uacEEPROMImage[6];
+
+	fh = fopen(EEPROM_PATH, "rb+");
+	if(fh != NULL) {
+		/*Check WIFI Mac address*/
+		fseek(fh, 0x4, SEEK_SET);
+		fread(uacEEPROMImage, sizeof(unsigned char), 6, fh);
+		if(uacEEPROMImage[0] == 0 && uacEEPROMImage[1] == 0 &&
+			uacEEPROMImage[2] == 0 && uacEEPROMImage[3] == 0 &&
+			uacEEPROMImage[4] == 0 && uacEEPROMImage[5] == 0)
+		{
+			//time(&timep);
+			/*Get Random value*/
+			frandom = fopen("/dev/urandom", "rb");
+			if (frandom == NULL) {
+				printf("Could not open /dev/urandom.\n");
+				return -1;
+			}
+			
+			rc = fread(&random_value, 1, sizeof(long), frandom);
+			fclose(frandom);
+	
+			//random_value = random();
+			printf("Time:%x\n", random_value);
+			uacEEPROMImage[0] = 0x00;
+			uacEEPROMImage[1] = 0x08;
+			uacEEPROMImage[2] = 0x22;
+			uacEEPROMImage[3] = random_value >> 16;
+			uacEEPROMImage[4] = random_value >> 8;
+			uacEEPROMImage[5] = random_value;
+
+			fseek(fh, 0x4, SEEK_SET);
+			fwrite(uacEEPROMImage, sizeof(unsigned char), 6, fh);
+		}
+
+		/*Check BT Mac Address*/
+		fseek(fh, 0x384, SEEK_SET);
+		fread(uacEEPROMImage, sizeof(unsigned char), 6, fh);
+		if(uacEEPROMImage[0] == 0 && uacEEPROMImage[1] == 0 &&
+			uacEEPROMImage[2] == 0 && uacEEPROMImage[3] == 0 &&
+			uacEEPROMImage[4] == 0 && uacEEPROMImage[5] == 0)
+		{
+			if (random_value == 0) {
+				frandom = fopen("/dev/urandom", "rb");
+				if (frandom == NULL) {
+					printf("Could not open /dev/urandom.\n");
+					return -1;
+				}
+			
+				rc = fread(&random_value, 1, sizeof(long), frandom);
+				fclose(frandom);
+			
+				uacEEPROMImage[0] = 0x00;
+				uacEEPROMImage[1] = 0x08;
+				uacEEPROMImage[2] = 0x22;
+				uacEEPROMImage[3] = random_value >> 16;
+				uacEEPROMImage[4] = random_value >> 8;
+				uacEEPROMImage[5] = random_value;
+			}
+			else {
+				uacEEPROMImage[0] = 0x00;
+				uacEEPROMImage[1] = 0x08;
+				uacEEPROMImage[2] = 0x22;
+				uacEEPROMImage[3] = random_value >> 16;
+				uacEEPROMImage[4] = random_value >> 8;
+				uacEEPROMImage[5] = random_value + 1;
+			}
+
+			fseek(fh, 0x384, SEEK_SET);
+			fwrite(uacEEPROMImage, sizeof(unsigned char), 6, fh);
+		}
+
+		fclose(fh);
+	}
+	return 0;
+}
diff --git a/src/connectivity/network_cfg/wifi_mac/wifi_bt_mac_write.service b/src/connectivity/network_cfg/wifi_mac/wifi_bt_mac_write.service
new file mode 100644
index 0000000..852f7d2
--- /dev/null
+++ b/src/connectivity/network_cfg/wifi_mac/wifi_bt_mac_write.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=wifi_bt_mac_write
+After=data-ubi-mnt.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=no
+ExecStart=/usr/sbin/wifi_bt_mac_write
+
+[Install]
+Alias=pwrwifid
+WantedBy=multi-user.target