summaryrefslogtreecommitdiff
path: root/drivers/mt5931
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mt5931')
-rwxr-xr-xdrivers/mt5931/Kconfig77
-rwxr-xr-xdrivers/mt5931/Makefile57
-rwxr-xr-xdrivers/mt5931/drv_wlan/GNUmakefile64
-rwxr-xr-xdrivers/mt5931/drv_wlan/GNUmakefile.inc53
-rwxr-xr-xdrivers/mt5931/drv_wlan/Makefile151
-rwxr-xr-xdrivers/mt5931/drv_wlan/common/makefile8
-rwxr-xr-xdrivers/mt5931/drv_wlan/common/sources.ce11
-rwxr-xr-xdrivers/mt5931/drv_wlan/common/sources.ddk11
-rwxr-xr-xdrivers/mt5931/drv_wlan/dirs6
-rwxr-xr-xdrivers/mt5931/drv_wlan/mgmt/makefile8
-rwxr-xr-xdrivers/mt5931/drv_wlan/mgmt/sources.ce11
-rwxr-xr-xdrivers/mt5931/drv_wlan/mgmt/sources.ddk11
-rwxr-xr-xdrivers/mt5931/drv_wlan/nic/makefile8
-rwxr-xr-xdrivers/mt5931/drv_wlan/nic/sources.ce11
-rwxr-xr-xdrivers/mt5931/drv_wlan/nic/sources.ddk11
-rwxr-xr-xdrivers/mt5931/drv_wlan/os/dirs3
-rwxr-xr-xdrivers/mt5931/drv_wlan/rules.make104
17 files changed, 605 insertions, 0 deletions
diff --git a/drivers/mt5931/Kconfig b/drivers/mt5931/Kconfig
new file mode 100755
index 00000000..4194a015
--- /dev/null
+++ b/drivers/mt5931/Kconfig
@@ -0,0 +1,77 @@
+menu "MediaTek Connectivity MT5931 Config"
+
+config MTK_MT5931
+ bool "MediaTek Connectivity MT5931 Support"
+ default y
+ help
+ MTK connectivity wifi chip driver for MT5931
+
+
+#choice
+# prompt "Select Chip"
+# depends on MTK_COMBO
+
+#config MTK_WIFI_CHIP_MT5931
+# bool "MT5931"
+#config MTK_COMBO_CHIP_MT6628
+# bool "MT6620"
+#config MTK_COMBO_CHIP_MT6628
+# bool "MT6628"
+#endchoice
+
+
+config MTK_MT5931_WIFI
+ tristate "MT5931 Wi-Fi"
+ depends on MTK_MT5931
+ depends on MMC
+ depends on IPV6
+ select WIRELESS_EXT
+ select WEXT_PRIV
+ default m
+ help
+ This module adds support for wireless adapters based on
+ MTK MT5931 chipset.
+
+ This driver uses the kernel's wireless extensions subsystem.
+
+ If you choose to build a module, it'll be called dhd. Say M if
+ unsure.
+
+
+config MTK_MT5931_DEBUG
+ depends on MTK_MT5931_WIFI
+ bool "Enable debug output from MT5931 driver"
+ default n
+ help
+ Enable debug messages output from MT5931 driver
+
+config MTK_MT5931_WLAN_PROC
+ depends on MTK_MT5931_WIFI
+ bool "Enable procfs support"
+ default n
+ help
+ Enable procfs support.
+
+config MTK_MT5931_SUPPORT_XLOG
+ depends on MTK_MT5931_WIFI
+ bool "Enable XLOG support in MT5931 driver"
+ default n
+ help
+ Enable XLOG support for devices using MT5931
+
+config MTK_MT5931_SUPPORT_AEE
+ depends on MTK_MT5931_WIFI
+ bool "Enable AEE support in MT5931 driver"
+ default n
+ help
+ Enable AEE support for devices using MT5931
+
+config MTK_MT5931_WAPI_SUPPORT
+ depends on MTK_MT5931_WIFI
+ bool "Enable WAPI support in MT5931 driver"
+ default n
+ help
+ Enable WAPI support for devices using MT5931
+
+
+endmenu
diff --git a/drivers/mt5931/Makefile b/drivers/mt5931/Makefile
new file mode 100755
index 00000000..edef4c4b
--- /dev/null
+++ b/drivers/mt5931/Makefile
@@ -0,0 +1,57 @@
+# 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) 2010. 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.
+#
+# The following software/firmware and/or related documentation ("MediaTek Software")
+# have been modified by MediaTek Inc. All revisions are subject to any receiver's
+# applicable license agreements with MediaTek Inc.
+
+
+# combo driver: MT6620
+# If KERNELRELEASE is defined, we've been invoked from the
+# kernel build system and can use its language.
+ifneq ($(KERNELRELEASE),)
+ #subdir-ccflags-y can be used in 2.6.34 in the future
+ #subdir-ccflags-y += -I$(src)/common/include -I$(src)/common/linux/include
+ #used for binary release script
+ #KERNEL_PATH := $(pwd)
+ #OBJ_PATH := $(pwd)
+
+ obj-$(CONFIG_MTK_MT5931) += drv_wlan/
+
+#obj-n += gps/
+
+# Otherwise we were called directly from the command
+# line; invoke the kernel build system.
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+endif
diff --git a/drivers/mt5931/drv_wlan/GNUmakefile b/drivers/mt5931/drv_wlan/GNUmakefile
new file mode 100755
index 00000000..cdf60c99
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/GNUmakefile
@@ -0,0 +1,64 @@
+# --------------------------------------------------------------------
+# Copyright (c) 2010 MediaTek Inc.
+#
+# All rights reserved. Copying, compilation, modification, distribution
+# or any other use whatsoever of this material is strictly prohibited
+# except in accordance with a Software License Agreement with
+# MediaTek Inc.
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+# This Makefile is major entrance for compiling driver module for
+# Linux Kernel 2.6
+# --------------------------------------------------------------------
+
+DRV_SRC_DIR := $(shell pwd)
+export DRV_SRC_DIR
+
+include $(DRV_SRC_DIR)/config.mk
+include $(DRV_SRC_DIR)/GNUmakefile.inc
+
+# Objects List for Linux 2.6
+COMMON_OBJS := $(patsubst %.o,$(COMMON_DIR)%.o,$(strip $(COMMON_OBJS)))
+NIC_OBJS := $(patsubst %.o,$(NIC_DIR)%.o,$(strip $(NIC_OBJS)))
+OS_OBJS := $(patsubst %.o,$(OS_DIR)%.o,$(strip $(OS_OBJS)))
+HIF_OBJS := $(patsubst %.o,$(HIF_DIR)%.o,$(strip $(HIF_OBJS)))
+MGMT_OBJS := $(patsubst %.o,$(MGMT_DIR)%.o,$(strip $(MGMT_OBJS)))
+
+
+.PHONY: all clean install info build
+all: build install
+
+build: info
+ @$(MAKE) -C $(LINUX_SRC) M=$(DRV_SRC_DIR) modules
+ @echo
+ @$(SIZE) -d $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE))
+ @echo
+
+
+clean:
+ @$(MAKE) -C $(LINUX_SRC) M=$(DRV_SRC_DIR) clean
+
+
+install:
+ifneq ($(INSTALL_PATH),)
+ @echo Install $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE)) to $(INSTALL_PATH)/$(INSTALL_MODULE_NAME)
+ @cp $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE)) $(INSTALL_PATH)/$(INSTALL_MODULE_NAME)
+else
+ @echo Warning INSTALL_PATH must be defined for 'make install' - check config.mk !
+endif
+ @echo
+
+
+info:
+ @echo ""
+ @echo "The following settings will be used for compilation:"
+ @echo "----------------------------------------------------"
+ @echo "PLATFORM : $(ARCH)"
+ @echo "COMPILE : $(LINUX26_CC)"
+ @echo "KERNEL PATH : $(LINUX_SRC)"
+ @echo "KERNEL VERSION : $(KERNEL_RELEASE)"
+ @echo "INSTALL PATH : $(INSTALL_PATH)"
+ @echo "INSTALL MODULE NAME : $(INSTALL_MODULE_NAME)"
+ @echo "----------------------------------------------------"
+ @echo ""
diff --git a/drivers/mt5931/drv_wlan/GNUmakefile.inc b/drivers/mt5931/drv_wlan/GNUmakefile.inc
new file mode 100755
index 00000000..caa2f1af
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/GNUmakefile.inc
@@ -0,0 +1,53 @@
+# --------------------------------------------------------------------
+# Copyright (c) 2007 MediaTek Inc.
+#
+# All rights reserved. Copying, compilation, modification, distribution
+# or any other use whatsoever of this material is strictly prohibited
+# except in accordance with a Software License Agreement with
+# MediaTek Inc.
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+# This file is used for identifying version of Linux Kernel
+# --------------------------------------------------------------------
+
+KCHECK_DIR := $(DRV_SRC_DIR)/os/linux/.kcheck
+
+ifndef LINUX_SRC
+$(error LINUX_SRC must be defined - check config.mk !)
+endif
+
+FULL_PATH_CC := $(shell which $(CC) 2> /dev/null)
+ifeq ($(FULL_PATH_CC), )
+$(error $(CC) is missing - check config.mk !)
+endif
+
+ifeq ($(shell cd $(LINUX_SRC) 2> /dev/null && pwd), )
+$(error $(LINUX_SRC) is missing - check config.mk !)
+endif
+
+ifndef KERNEL_RELEASE
+KERNEL_RELEASE := $(shell $(CC) -E -I $(LINUX_SRC)/include $(KCHECK_DIR)/.kversion.c | grep uts_release | cut -f2 -d'"')
+endif
+
+ifeq ($(filter-out 2.4%, $(KERNEL_RELEASE)), )
+LINUX24 = yes
+endif
+
+ifndef LINUX24
+LINUX26_CC := $(shell $(MAKE) -n -C $(LINUX_SRC) M=$(KCHECK_DIR) 2> /dev/null | grep cc)
+LINUX26_CC := $(filter-out -% '% "%,$(LINUX26_CC))
+LINUX26_CC := $(sort $(filter %cc,$(LINUX26_CC)))
+FULL_PATH_LINUX26_CC := $(shell which $(LINUX26_CC) 2> /dev/null)
+ifeq ($(FULL_PATH_LINUX26_CC), )
+LINUX26_CC := "\"$(LINUX26_CC)\" not found, check $(LINUX_SRC)/Makefile or \$$PATH in current SHELL !"
+else
+LINUX26_CC := $(FULL_PATH_LINUX26_CC)
+endif
+endif
+
+ifneq ($(INSTALL_PATH), )
+ifeq ($(shell cd $(INSTALL_PATH) 2> /dev/null && pwd), )
+INSTALL_PATH :=
+endif
+endif
diff --git a/drivers/mt5931/drv_wlan/Makefile b/drivers/mt5931/drv_wlan/Makefile
new file mode 100755
index 00000000..c63e17a5
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/Makefile
@@ -0,0 +1,151 @@
+# ---------------------------------------------------
+# Compile Options
+# ---------------------------------------------------
+
+#include $(MTK_PATH_BUILD)/Makefile
+ccflags-y += -DLINUX -DMT5931
+
+ifeq ($(CONFIG_MTK_MT5931_WAPI_SUPPORT), y)
+ ccflags-y += -DCFG_SUPPORT_WAPI=1
+else
+ ccflags-y += -DCFG_SUPPORT_WAPI=0
+endif
+
+ifeq ($(CONFIG_MTK_MT5931_SUPPORT_XLOG), y)
+ ccflags-y += -DCFG_SUPPORT_XLOG=1
+else
+ ccflags-y += -DCFG_SUPPORT_XLOG=0
+endif
+
+ifeq ($(CONFIG_MTK_MT5931_SUPPORT_AEE), y)
+ ccflags-y += -DCFG_SUPPORT_AEE=1
+else
+ ccflags-y += -DCFG_SUPPORT_AEE=0
+endif
+
+ifeq ($(CONFIG_MTK_MT5931_WLAN_PROC), y)
+ ccflags-y += -DWLAN_INCLUDE_PROC
+endif
+
+#ifeq ($(CONFIG_MTK_MT5931_WIFI_HIF_SDIO1), y)
+# ccflags-y += -D_HIF_SDIO=1
+#endif
+
+ccflags-y += -D_HIF_SDIO=1
+
+MODULE_NAME := wlan_mt5931
+
+ifeq ($(CONFIG_MTK_MT5931_DEBUG), yes)
+ ccflags-y += -DDBG=1
+else
+ ccflags-y += -DDBG=0
+endif
+
+ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/sdio/include
+ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt
+
+obj-$(CONFIG_MTK_MT5931_WIFI) += $(MODULE_NAME).o
+#obj-m += $(MODULE_NAME).o
+
+# ---------------------------------------------------
+# Directory List
+# ---------------------------------------------------
+COMMON_DIR := common/
+OS_DIR := os/linux/
+HIF_DIR := os/linux/hif/sdio/
+NIC_DIR := nic/
+MGMT_DIR := mgmt/
+
+
+# ---------------------------------------------------
+# Objects List
+# ---------------------------------------------------
+
+COMMON_OBJS := $(COMMON_DIR)dump.o \
+ $(COMMON_DIR)wlan_lib.o \
+ $(COMMON_DIR)wlan_oid.o \
+ $(COMMON_DIR)wlan_bow.o
+
+NIC_OBJS := $(NIC_DIR)nic.o \
+ $(NIC_DIR)nic_tx.o \
+ $(NIC_DIR)nic_rx.o \
+ $(NIC_DIR)nic_pwr_mgt.o \
+ $(NIC_DIR)cmd_buf.o \
+ $(NIC_DIR)que_mgt.o \
+ $(NIC_DIR)nic_cmd_event.o
+
+OS_OBJS := $(OS_DIR)gl_init.o \
+ $(OS_DIR)gl_kal.o \
+ $(OS_DIR)gl_bow.o \
+ $(OS_DIR)gl_wext.o \
+ $(OS_DIR)gl_wext_priv.o \
+ $(OS_DIR)gl_rst.o \
+ $(OS_DIR)gl_cfg80211.o \
+ $(OS_DIR)platform.o
+
+MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \
+ $(MGMT_DIR)aaa_fsm.o \
+ $(MGMT_DIR)assoc.o \
+ $(MGMT_DIR)auth.o \
+ $(MGMT_DIR)bss.o \
+ $(MGMT_DIR)cnm.o \
+ $(MGMT_DIR)cnm_timer.o \
+ $(MGMT_DIR)cnm_mem.o \
+ $(MGMT_DIR)hem_mbox.o \
+ $(MGMT_DIR)mib.o \
+ $(MGMT_DIR)privacy.o \
+ $(MGMT_DIR)rate.o \
+ $(MGMT_DIR)rlm.o \
+ $(MGMT_DIR)rlm_domain.o \
+ $(MGMT_DIR)rlm_obss.o \
+ $(MGMT_DIR)rlm_protection.o \
+ $(MGMT_DIR)rsn.o \
+ $(MGMT_DIR)saa_fsm.o \
+ $(MGMT_DIR)scan.o \
+ $(MGMT_DIR)scan_fsm.o \
+ $(MGMT_DIR)sec_fsm.o \
+ $(MGMT_DIR)swcr.o \
+ $(MGMT_DIR)roaming_fsm.o
+
+# ---------------------------------------------------
+# P2P Objects List
+# ---------------------------------------------------
+
+COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o
+
+NIC_OBJS += $(NIC_DIR)p2p_nic.o
+
+OS_OBJS += $(OS_DIR)gl_p2p.o \
+ $(OS_DIR)gl_p2p_cfg80211.o \
+ $(OS_DIR)gl_p2p_init.o \
+ $(OS_DIR)gl_p2p_kal.o
+
+MGMT_OBJS += $(MGMT_DIR)p2p_assoc.o \
+ $(MGMT_DIR)p2p_bss.o \
+ $(MGMT_DIR)p2p_fsm.o \
+ $(MGMT_DIR)p2p_func.o \
+ $(MGMT_DIR)p2p_rlm.o \
+ $(MGMT_DIR)p2p_rlm_obss.o \
+ $(MGMT_DIR)p2p_scan.o \
+ $(MGMT_DIR)p2p_ie.o \
+ $(MGMT_DIR)p2p_state.o
+
+
+ifeq ($(CONFIG_MTK_WAPI_SUPPORT), yes)
+MGMT_OBJS += $(MGMT_DIR)wapi.o
+endif
+
+ifeq ($(CONFIG_MTK_MT5931_WLAN_PROC), y)
+OS_OBJS += gl_proc.o
+endif
+
+HIF_OBJS := $(HIF_DIR)arm.o \
+ $(HIF_DIR)sdio.o
+
+$(MODULE_NAME)-objs += $(COMMON_OBJS)
+$(MODULE_NAME)-objs += $(NIC_OBJS)
+$(MODULE_NAME)-objs += $(OS_OBJS)
+$(MODULE_NAME)-objs += $(HIF_OBJS)
+$(MODULE_NAME)-objs += $(MGMT_OBJS)
+
+
diff --git a/drivers/mt5931/drv_wlan/common/makefile b/drivers/mt5931/drv_wlan/common/makefile
new file mode 100755
index 00000000..89b63909
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/common/makefile
@@ -0,0 +1,8 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the driver components of the Windows NT DDK
+#!INCLUDE $(NTMAKEENV)\makefile.def
+
+#!INCLUDE $(_MAKEENVROOT)\makefile.def
+!INCLUDE $(_WINDOW_MAKE_ROOT)\makefile.def
diff --git a/drivers/mt5931/drv_wlan/common/sources.ce b/drivers/mt5931/drv_wlan/common/sources.ce
new file mode 100755
index 00000000..59b0b291
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/common/sources.ce
@@ -0,0 +1,11 @@
+TARGETNAME=$(DRIVER_NAME)_cmn_$(WINCEDEBUG)_51
+TARGETTYPE=LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER
+
+C_DEFINES=$(C_DEFINES) -DNDIS51_MINIPORT=1 -D_WIN2K_COMPAT_SLIST_USAGE=1
+CDEFINES=$(CDEFINES) -D$(DEVICE_ID) -DNDIS51_MINIPORT=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_COMMON_FILES)
diff --git a/drivers/mt5931/drv_wlan/common/sources.ddk b/drivers/mt5931/drv_wlan/common/sources.ddk
new file mode 100755
index 00000000..d20e1b94
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/common/sources.ddk
@@ -0,0 +1,11 @@
+TARGETPATH=$(_LIB_PATH)
+TARGETNAME=$(DRIVER_NAME)_cmn_51
+TARGETTYPE=DRIVER_LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER -DNDIS51_MINIPORT=1
+C_DEFINES=$(C_DEFINES) -D_WIN2K_COMPAT_SLIST_USAGE=1
+C_DEFINES=$(C_DEFINES) -DNDIS_WDM=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_COMMON_FILES)
diff --git a/drivers/mt5931/drv_wlan/dirs b/drivers/mt5931/drv_wlan/dirs
new file mode 100755
index 00000000..b023688b
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/dirs
@@ -0,0 +1,6 @@
+OPTIONAL_DIRS= \
+ common \
+ os \
+ nic \
+ mgmt
+
diff --git a/drivers/mt5931/drv_wlan/mgmt/makefile b/drivers/mt5931/drv_wlan/mgmt/makefile
new file mode 100755
index 00000000..89b63909
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/mgmt/makefile
@@ -0,0 +1,8 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the driver components of the Windows NT DDK
+#!INCLUDE $(NTMAKEENV)\makefile.def
+
+#!INCLUDE $(_MAKEENVROOT)\makefile.def
+!INCLUDE $(_WINDOW_MAKE_ROOT)\makefile.def
diff --git a/drivers/mt5931/drv_wlan/mgmt/sources.ce b/drivers/mt5931/drv_wlan/mgmt/sources.ce
new file mode 100755
index 00000000..132fd5bd
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/mgmt/sources.ce
@@ -0,0 +1,11 @@
+TARGETNAME=$(DRIVER_NAME)_mgmt_$(WINCEDEBUG)_51
+TARGETTYPE=LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER
+
+C_DEFINES=$(C_DEFINES) -DNDIS51_MINIPORT=1 -D_WIN2K_COMPAT_SLIST_USAGE=1
+CDEFINES=$(CDEFINES) -D$(DEVICE_ID) -DNDIS51_MINIPORT=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_MGMT_FILES)
diff --git a/drivers/mt5931/drv_wlan/mgmt/sources.ddk b/drivers/mt5931/drv_wlan/mgmt/sources.ddk
new file mode 100755
index 00000000..2548266f
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/mgmt/sources.ddk
@@ -0,0 +1,11 @@
+TARGETPATH=$(_LIB_PATH)
+TARGETNAME=$(DRIVER_NAME)_mgmt_51
+TARGETTYPE=DRIVER_LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER -DNDIS51_MINIPORT=1
+C_DEFINES=$(C_DEFINES) -D_WIN2K_COMPAT_SLIST_USAGE=1
+C_DEFINES=$(C_DEFINES) -DNDIS_WDM=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_MGMT_FILES)
diff --git a/drivers/mt5931/drv_wlan/nic/makefile b/drivers/mt5931/drv_wlan/nic/makefile
new file mode 100755
index 00000000..89b63909
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/nic/makefile
@@ -0,0 +1,8 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the driver components of the Windows NT DDK
+#!INCLUDE $(NTMAKEENV)\makefile.def
+
+#!INCLUDE $(_MAKEENVROOT)\makefile.def
+!INCLUDE $(_WINDOW_MAKE_ROOT)\makefile.def
diff --git a/drivers/mt5931/drv_wlan/nic/sources.ce b/drivers/mt5931/drv_wlan/nic/sources.ce
new file mode 100755
index 00000000..4627c521
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/nic/sources.ce
@@ -0,0 +1,11 @@
+TARGETNAME=$(DRIVER_NAME)_nic_$(WINCEDEBUG)_51
+TARGETTYPE=LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER
+
+C_DEFINES=$(C_DEFINES) -DNDIS51_MINIPORT=1 -D_WIN2K_COMPAT_SLIST_USAGE=1
+CDEFINES=$(CDEFINES) -D$(DEVICE_ID) -DNDIS51_MINIPORT=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_NIC_FILES)
diff --git a/drivers/mt5931/drv_wlan/nic/sources.ddk b/drivers/mt5931/drv_wlan/nic/sources.ddk
new file mode 100755
index 00000000..a233fee2
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/nic/sources.ddk
@@ -0,0 +1,11 @@
+TARGETPATH=$(_LIB_PATH)
+TARGETNAME=$(DRIVER_NAME)_nic_51
+TARGETTYPE=DRIVER_LIBRARY
+
+INCLUDES=$(_INCLUDES_DIRS)
+
+C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER -DNDIS51_MINIPORT=1
+C_DEFINES=$(C_DEFINES) -D_WIN2K_COMPAT_SLIST_USAGE=1
+C_DEFINES=$(C_DEFINES) -DNDIS_WDM=1 $(_BUILD_MODULE_DEF)
+
+SOURCES= $(_NIC_FILES)
diff --git a/drivers/mt5931/drv_wlan/os/dirs b/drivers/mt5931/drv_wlan/os/dirs
new file mode 100755
index 00000000..3dc42d39
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/os/dirs
@@ -0,0 +1,3 @@
+DIRS= \
+ windows
+
diff --git a/drivers/mt5931/drv_wlan/rules.make b/drivers/mt5931/drv_wlan/rules.make
new file mode 100755
index 00000000..44b98711
--- /dev/null
+++ b/drivers/mt5931/drv_wlan/rules.make
@@ -0,0 +1,104 @@
+# --------------------------------------------------------------------
+# Copyright (c) 2007 MediaTek Inc.
+#
+# All rights reserved. Copying, compilation, modification, distribution
+# or any other use whatsoever of this material is strictly prohibited
+# except in accordance with a Software License Agreement with
+# MediaTek Inc.
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+# This file contains rules which are shared between multiple Makefiles.
+# --------------------------------------------------------------------
+
+#
+# False targets.
+#
+.PHONY: dummy
+
+#
+# Special variables which should not be exported
+#
+unexport O_TARGET
+unexport obj-y
+unexport subdir-y
+
+comma := ,
+
+
+#
+# Get things started.
+#
+first_rule: sub_dirs
+ @$(MAKE) all_targets
+
+SUB_DIRS := $(subdir-y)
+
+#
+# Common rules
+#
+%.o: %.c
+ @echo " [CC] $@"
+ @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+all_targets: $(O_TARGET)
+
+#
+# Rule to compile a set of .o files into one .o file
+#
+ifdef O_TARGET
+$(O_TARGET): $(obj-y)
+ @rm -f $@
+ ifneq "$(strip $(obj-y))" ""
+ @$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
+ else
+ @$(AR) rcs $@
+ endif
+ @ ( \
+ echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
+ echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
+ echo 'endif' \
+ ) > $(dir $@)/.$(notdir $@).flags
+endif # O_TARGET
+
+#
+# A rule to make subdirectories
+#
+subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS)))
+sub_dirs: dummy $(subdir-list)
+
+ifdef SUB_DIRS
+$(subdir-list) : dummy
+ @$(MAKE) -C $(patsubst _subdir_%,%,$@)
+endif
+
+
+#
+# A rule to do nothing
+#
+dummy:
+
+#
+# Find files whose flags have changed and force recompilation.
+# For safety, this works in the converse direction:
+# every file is forced, except those whose flags are positively up-to-date.
+#
+FILES_FLAGS_UP_TO_DATE :=
+
+# For use in expunging commas from flags, which mung our checking.
+comma = ,
+
+FILES_FLAGS_EXIST := $(wildcard .*.flags)
+ifneq ($(FILES_FLAGS_EXIST),)
+include $(FILES_FLAGS_EXIST)
+endif
+
+FILES_FLAGS_CHANGED := $(strip \
+ $(filter-out $(FILES_FLAGS_UP_TO_DATE), \
+ $(O_TARGET) \
+ ))
+
+ifneq ($(FILES_FLAGS_CHANGED),)
+$(FILES_FLAGS_CHANGED): dummy
+endif
+