1 include $(TOPDIR)/rules.mk
9 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
11 PKG_SOURCE_DATE:=2017-06-16
12 PKG_SOURCE_VERSION:=70d225123fa106667fb96265fe62162339e36ddc
13 PKG_MIRROR_HASH:=f3ee626ac485398488ca6c549e44ffaff72dc8ac324f53af7994c9bb0ca8925f
15 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
18 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
20 include $(INCLUDE_DIR)/kernel.mk
21 include $(INCLUDE_DIR)/package.mk
23 define KernelPackage/mt76-default
24 SUBMENU:=Wireless Drivers
26 +kmod-mac80211 @PCI_SUPPORT @!LINUX_3_18 \
27 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
30 define KernelPackage/mt76
31 SUBMENU:=Wireless Drivers
32 TITLE:=MediaTek MT76x2/MT7603 wireless driver (metapackage)
34 +kmod-mt76-core +kmod-mt76x2 +kmod-mt7603
37 define KernelPackage/mt76-core
38 $(KernelPackage/mt76-default)
39 TITLE:=MediaTek MT76xx wireless driver
41 $(PKG_BUILD_DIR)/mt76.ko
42 AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76)
45 define KernelPackage/mt76x2
46 $(KernelPackage/mt76-default)
47 TITLE:=MediaTek MT76x2 wireless driver
48 DEPENDS+=+kmod-mt76-core
50 $(PKG_BUILD_DIR)/mt76x2e.ko
51 AUTOLOAD:=$(call AutoLoad,51,mt76x2e)
54 define KernelPackage/mt7603
55 $(KernelPackage/mt76-default)
56 TITLE:=MediaTek MT7603 wireless driver
57 DEPENDS+=+kmod-mt76-core
59 $(PKG_BUILD_DIR)/mt7603e.ko
60 AUTOLOAD:=$(call AutoLoad,51,mt7603e)
65 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
66 -I$(STAGING_DIR)/usr/include/mac80211-backport \
67 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
68 -I$(STAGING_DIR)/usr/include/mac80211 \
69 -include backport/autoconf.h \
70 -include backport/backport.h
72 ifdef CONFIG_PACKAGE_MAC80211_MESH
73 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
77 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
78 ARCH="$(LINUX_KARCH)" \
79 CROSS_COMPILE="$(TARGET_CROSS)" \
80 SUBDIRS="$(PKG_BUILD_DIR)" \
81 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
85 define Package/kmod-mt76/install
89 define KernelPackage/mt76x2/install
90 $(INSTALL_DIR) $(1)/lib/firmware
92 $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
93 $(PKG_BUILD_DIR)/firmware/mt7662.bin \
97 define KernelPackage/mt7603/install
98 $(INSTALL_DIR) $(1)/lib/firmware
99 cp $(if $(CONFIG_TARGET_ramips_mt7628)$(CONFIG_TARGET_ramips_mt7688), \
100 $(PKG_BUILD_DIR)/firmware/mt7628_e1.bin \
101 $(PKG_BUILD_DIR)/firmware/mt7628_e2.bin \
103 $(PKG_BUILD_DIR)/firmware/mt7603_e1.bin \
104 $(PKG_BUILD_DIR)/firmware/mt7603_e2.bin \
109 $(eval $(call KernelPackage,mt76-core))
110 $(eval $(call KernelPackage,mt76x2))
111 $(eval $(call KernelPackage,mt7603))
112 $(eval $(call KernelPackage,mt76))