1 include $(TOPDIR)/rules.mk
4 PKG_VERSION:=2016-03-02
10 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
12 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
13 PKG_SOURCE_VERSION:=c190f15d6f4a112e795ac50391e8adc50a80fe91
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
16 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
19 include $(INCLUDE_DIR)/kernel.mk
20 include $(INCLUDE_DIR)/package.mk
22 define KernelPackage/mt76
23 SUBMENU:=Wireless Drivers
24 TITLE:=MediaTek MT76x2/MT7603 wireless driver
25 DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT
27 $(PKG_BUILD_DIR)/mt76.ko \
28 $(PKG_BUILD_DIR)/mt76x2e.ko \
29 $(PKG_BUILD_DIR)/mt7603e.ko
30 AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e mt7603e)
35 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
36 -I$(STAGING_DIR)/usr/include/mac80211-backport \
37 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
38 -I$(STAGING_DIR)/usr/include/mac80211 \
39 -include backport/autoconf.h \
40 -include backport/backport.h
42 ifdef CONFIG_PACKAGE_MAC80211_MESH
43 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
47 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
48 ARCH="$(LINUX_KARCH)" \
49 CROSS_COMPILE="$(TARGET_CROSS)" \
50 SUBDIRS="$(PKG_BUILD_DIR)" \
51 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
55 define KernelPackage/mt76/install
56 $(INSTALL_DIR) $(1)/lib/firmware
58 $(if $(CONFIG_TARGET_ramips_mt7628), \
59 $(PKG_BUILD_DIR)/firmware/mt7628_e1.bin \
60 $(PKG_BUILD_DIR)/firmware/mt7628_e2.bin \
62 $(PKG_BUILD_DIR)/firmware/mt7603_e1.bin \
63 $(PKG_BUILD_DIR)/firmware/mt7603_e2.bin \
64 $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
65 $(PKG_BUILD_DIR)/firmware/mt7662.bin \
69 $(eval $(call KernelPackage,mt76))