From cbb3ec25236ba72f91cbdf23f8b78b9d1af0cedf Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Tue, 23 May 2023 23:03:09 +0000 Subject: mt76: update driver from upstream This is a set of updates of the mt76 driver based on wireless-testing (wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1), This adds support for mt7996 as well. (wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5), (wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3), (wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4). The current version of LinuxKPI lacks support for "page pool" which needs enhancing and updating a decade or so old shortcut mapping struct page directly to struct vm_page. MFC after: 20 days --- sys/modules/mt76/Makefile | 1 + sys/modules/mt76/core/Makefile | 20 ++++++++++++++++++-- sys/modules/mt76/mt7915/Makefile | 8 ++++++++ sys/modules/mt76/mt7921/Makefile | 5 ++--- sys/modules/mt76/mt7996/Makefile | 29 +++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 sys/modules/mt76/mt7996/Makefile (limited to 'sys/modules') diff --git a/sys/modules/mt76/Makefile b/sys/modules/mt76/Makefile index 3138ad3d5da1..95d6e10a6991 100644 --- a/sys/modules/mt76/Makefile +++ b/sys/modules/mt76/Makefile @@ -2,5 +2,6 @@ SUBDIR= core SUBDIR+= mt7915 SUBDIR+= mt7921 +SUBDIR+= mt7996 .include diff --git a/sys/modules/mt76/core/Makefile b/sys/modules/mt76/core/Makefile index ac47d8dd8815..9e915fc5f965 100644 --- a/sys/modules/mt76/core/Makefile +++ b/sys/modules/mt76/core/Makefile @@ -7,14 +7,30 @@ SRCS= mac80211.c mmio.c util.c dma.c eeprom.c tx.c agg-rx.c mcu.c # Bus stuff. SRCS+= pci.c -#SRCS+= usb.c # usb_trace.c +.if defined(WITH_USB) && ${WITH_USB} > 0 +SRCS+= usb.c # usb_trace.c +.endif #SRCS+= sdio.c sdio_txrx.c # Connac-Lib stuff. -SRCS+= mt76_connac_mac.c mt76_connac_mcu.c +SRCS+= mt76_connac_mac.c mt76_connac_mcu.c mt76_connac3_mac.c # MT76x02-Lib stuff (we don't need; that's for older chipsets not yet supported) +# XXX should this be a separate module? +# MT792X-LIB stuff. +SRCS+= mt792x_core.c mt792x_mac.c mt792x_dma.c +#SRCS+= mt792x_trace.c +.if defined(WITH_ACPI) && ${WITH_ACPI} > 0 +SRCS+= mt792x_acpi_sar.c +.endif +.if defined(WITH_USB) && ${WITH_USB} > 0 +SRCS+= mt792x_usb.c +.endif +.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0 +SRCS+= mt792x_debugfs.c +.endif + .if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0 SRCS+= debugfs.c .endif diff --git a/sys/modules/mt76/mt7915/Makefile b/sys/modules/mt76/mt7915/Makefile index 1cc587c163ee..8d5b17dbac1a 100644 --- a/sys/modules/mt76/mt7915/Makefile +++ b/sys/modules/mt76/mt7915/Makefile @@ -3,6 +3,9 @@ DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7915 .PATH: ${DEVDIR} +WITH_DEBUGFS= 0 +WITH_DEV_COREDUMP= 1 + KMOD= if_mt7915 # Common stuff. @@ -17,6 +20,11 @@ SRCS+= debugfs.c CFLAGS+= -DCONFIG_MT7915_DEBUGFS=${WITH_DEBUGFS} .endif +.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0 +SRCS+= coredump.c +CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP} +.endif + CFLAGS+= -DKBUILD_MODNAME='"mt7915"' CFLAGS+= -I${DEVDIR} diff --git a/sys/modules/mt76/mt7921/Makefile b/sys/modules/mt76/mt7921/Makefile index acf0b5a787e7..0fb5f0c26fb1 100644 --- a/sys/modules/mt76/mt7921/Makefile +++ b/sys/modules/mt76/mt7921/Makefile @@ -7,13 +7,12 @@ KMOD= if_mt7921 # Common stuff. SRCS= init.c main.c mac.c mcu.c -#SRCS+= trace.c # PCI stuff. -SRCS+= pci.c pci_mac.c pci_mcu.c dma.c +SRCS+= pci.c pci_mac.c pci_mcu.c # USB stuff. -#SRCS+= usb.c usb_mac.c +#SRCS+= usb.c # SDIO stuff. #SRCS+= sdio.c sdio_mac.c sdio_mcu.c diff --git a/sys/modules/mt76/mt7996/Makefile b/sys/modules/mt76/mt7996/Makefile new file mode 100644 index 000000000000..3a4a56d839a5 --- /dev/null +++ b/sys/modules/mt76/mt7996/Makefile @@ -0,0 +1,29 @@ +# $FreeBSD$ + +DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7996 + +.PATH: ${DEVDIR} + +WITH_DEBUGFS= 0 +WITH_DEV_COREDUMP= 1 + +KMOD= if_mt7996 + +# Common stuff. +SRCS= init.c main.c mac.c mcu.c mmio.c eeprom.c +SRCS+= pci.c dma.c + +.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0 +SRCS+= debugfs.c +CFLAGS+= -DCONFIG_MT7996_DEBUGFS=${WITH_DEBUGFS} +.endif + +.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0 +SRCS+= coredump.c +CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP} +.endif + +CFLAGS+= -DKBUILD_MODNAME='"mt7996"' +CFLAGS+= -I${DEVDIR} + +.include -- cgit v1.3