mt76: update to the latest version, adds some tx path and protection mode register...
[openwrt/openwrt.git] / package / kernel / mt76 / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=mt76
4 PKG_VERSION:=2016-01-28
5 PKG_RELEASE=1
6
7 PKG_LICENSE:=GPLv2
8 PKG_LICENSE_FILES:=
9
10 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
11 PKG_SOURCE_PROTO:=git
12 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
13 PKG_SOURCE_VERSION:=82510f818c1ccb7b0ea6b2e656bd69804abc0230
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
15
16 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
17 PKG_BUILD_PARALLEL:=1
18
19 include $(INCLUDE_DIR)/kernel.mk
20 include $(INCLUDE_DIR)/package.mk
21
22 define KernelPackage/mt76
23 SUBMENU:=Wireless Drivers
24 TITLE:=MediaTek MT76x2 wireless driver
25 DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT
26 FILES:=\
27 $(PKG_BUILD_DIR)/mt76.ko \
28 $(PKG_BUILD_DIR)/mt76x2e.ko
29 AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e)
30 endef
31
32 NOSTDINC_FLAGS = \
33 -I$(PKG_BUILD_DIR) \
34 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
35 -I$(STAGING_DIR)/usr/include/mac80211-backport \
36 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
37 -I$(STAGING_DIR)/usr/include/mac80211 \
38 -include backport/autoconf.h \
39 -include backport/backport.h
40
41 ifdef CONFIG_PACKAGE_MAC80211_MESH
42 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
43 endif
44
45 define Build/Compile
46 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
47 ARCH="$(LINUX_KARCH)" \
48 CROSS_COMPILE="$(TARGET_CROSS)" \
49 SUBDIRS="$(PKG_BUILD_DIR)" \
50 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
51 modules
52 endef
53
54 define KernelPackage/mt76/install
55 $(INSTALL_DIR) $(1)/lib/firmware
56 cp \
57 $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
58 $(PKG_BUILD_DIR)/firmware/mt7662.bin \
59 $(1)/lib/firmware
60 endef
61
62 $(eval $(call KernelPackage,mt76))