include $(TOPDIR)/rules.mk
PKG_NAME:=mt76
-PKG_RELEASE=2
+PKG_RELEASE=4
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2020-12-18
-PKG_SOURCE_VERSION:=4a90fdf6105e1517897aac1b451b73a54b3d9d0d
-PKG_MIRROR_HASH:=1ea778584d0fabbc75eb3b2f42aba0c0f2f5e6f0f5ae3084c17b9f02876ebdcc
+PKG_SOURCE_DATE:=2021-07-14
+PKG_SOURCE_VERSION:=4ccd42029519d2b3d3b4e0abcd59928841845caf
+PKG_MIRROR_HASH:=26f721abd55587b331bae371dd41820796fcc27554c1be50e03572dccc82413e
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_USE_NINJA:=0
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS += \
SUBMENU:=Wireless Drivers
DEPENDS:= \
+kmod-mac80211 \
- +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
+ +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT
endef
define KernelPackage/mt76
AUTOLOAD:=$(call AutoProbe,mt7603e)
endef
+define KernelPackage/mt76-connac
+ $(KernelPackage/mt76-default)
+ TITLE:=MediaTek MT7615/MT79xx wireless driver common code
+ HIDDEN:=1
+ DEPENDS+=+kmod-mt76-core
+ FILES:= $(PKG_BUILD_DIR)/mt76-connac-lib.ko
+endef
+
define KernelPackage/mt7615-common
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7615 wireless driver common code
HIDDEN:=1
- DEPENDS+=@PCI_SUPPORT +kmod-mt76-core
+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core
FILES:= $(PKG_BUILD_DIR)/mt7615/mt7615-common.ko
endef
define KernelPackage/mt7915e
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7915e wireless driver
- DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +@DRIVER_11AX_SUPPORT
+ DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT
FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
AUTOLOAD:=$(call AutoProbe,mt7915e)
endef
+define KernelPackage/mt7921e
+ $(KernelPackage/mt76-default)
+ TITLE:=MediaTek MT7921e wireless driver
+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac
+ FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921e.ko
+ AUTOLOAD:=$(call AutoProbe,mt7921e)
+endef
+
define Package/mt76-test
SECTION:=devel
CATEGORY:=Development
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
-NOSTDINC_FLAGS = \
+NOSTDINC_FLAGS := \
+ $(KERNEL_NOSTDINC_FLAGS) \
-I$(PKG_BUILD_DIR) \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
ifdef CONFIG_PACKAGE_kmod-mt7603
PKG_MAKE_FLAGS += CONFIG_MT7603E=m
endif
+ifdef CONFIG_PACKAGE_kmod-mt76-connac
+ PKG_MAKE_FLAGS += CONFIG_MT76_CONNAC_LIB=m
+endif
ifdef CONFIG_PACKAGE_kmod-mt7615-common
PKG_MAKE_FLAGS += CONFIG_MT7615_COMMON=m
endif
ifdef CONFIG_PACKAGE_kmod-mt7915e
PKG_MAKE_FLAGS += CONFIG_MT7915E=m
endif
+ifdef CONFIG_PACKAGE_kmod-mt7921e
+ PKG_MAKE_FLAGS += CONFIG_MT7921E=m
+endif
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(1)/lib/firmware/mediatek
endef
+define KernelPackage/mt7921e/install
+ $(INSTALL_DIR) $(1)/lib/firmware/mediatek
+ cp \
+ $(PKG_BUILD_DIR)/firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin \
+ $(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7961_1.bin \
+ $(1)/lib/firmware/mediatek
+endef
+
define Package/mt76-test/install
mkdir -p $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin
$(eval $(call KernelPackage,mt76x2u))
$(eval $(call KernelPackage,mt76x2))
$(eval $(call KernelPackage,mt7603))
+$(eval $(call KernelPackage,mt76-connac))
$(eval $(call KernelPackage,mt7615-common))
$(eval $(call KernelPackage,mt7615-firmware))
$(eval $(call KernelPackage,mt7615e))
$(eval $(call KernelPackage,mt7663u))
$(eval $(call KernelPackage,mt7663s))
$(eval $(call KernelPackage,mt7915e))
+$(eval $(call KernelPackage,mt7921e))
$(eval $(call KernelPackage,mt76))
$(eval $(call BuildPackage,mt76-test))