Pārlūkot izejas kodu

Remove msm-5.4 propagated code

Remove unneeded changes against android12-5.10 that do not impact any
GKI kernel or vendor modules.

Change-Id: I6e2ac610b9caf5be30ae9f8f5e3b2202e8248a6b
Signed-off-by: Elliot Berman <[email protected]>
Elliot Berman 4 gadi atpakaļ
vecāks
revīzija
72f66988e5
37 mainītis faili ar 274 papildinājumiem un 2209 dzēšanām
  1. 1 1
      Makefile
  2. 3 8
      arch/arm64/Makefile
  3. 0 15
      arch/arm64/boot/Makefile
  4. 1 0
      arch/arm64/configs/rockpi4_defconfig
  5. 7 6
      arch/mips/include/asm/barrier.h
  6. 7 8
      arch/mips/include/asm/futex.h
  7. 0 7
      arch/powerpc/kvm/book3s_xive_native.c
  8. 0 5
      arch/x86/boot/compressed/head_64.S
  9. 0 2
      arch/x86/kvm/x86.c
  10. 0 22
      drivers/acpi/button.c
  11. 0 9
      drivers/acpi/sleep.c
  12. 0 4
      drivers/net/can/m_can/tcan4x5x.c
  13. 0 3
      drivers/net/dsa/microchip/ksz9477.c
  14. 0 2
      drivers/net/dsa/sja1105/sja1105_main.c
  15. 0 4
      drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
  16. 0 32
      drivers/net/wireless/ath/wil6210/Kconfig
  17. 0 8
      drivers/net/wireless/ath/wil6210/Makefile
  18. 21 737
      drivers/net/wireless/ath/wil6210/cfg80211.c
  19. 10 45
      drivers/net/wireless/ath/wil6210/debugfs.c
  20. 5 9
      drivers/net/wireless/ath/wil6210/interrupt.c
  21. 23 147
      drivers/net/wireless/ath/wil6210/main.c
  22. 6 90
      drivers/net/wireless/ath/wil6210/netdev.c
  23. 1 120
      drivers/net/wireless/ath/wil6210/pcie_bus.c
  24. 0 13
      drivers/net/wireless/ath/wil6210/pm.c
  25. 1 10
      drivers/net/wireless/ath/wil6210/txrx.h
  26. 60 144
      drivers/net/wireless/ath/wil6210/txrx_edma.c
  27. 1 9
      drivers/net/wireless/ath/wil6210/txrx_edma.h
  28. 8 131
      drivers/net/wireless/ath/wil6210/wil6210.h
  29. 3 6
      drivers/net/wireless/ath/wil6210/wil_platform.c
  30. 0 11
      drivers/net/wireless/ath/wil6210/wil_platform.h
  31. 44 404
      drivers/net/wireless/ath/wil6210/wmi.c
  32. 1 45
      drivers/net/wireless/ath/wil6210/wmi.h
  33. 1 1
      drivers/staging/octeon/octeon-ethernet.h
  34. 70 68
      drivers/staging/octeon/octeon-stubs.h
  35. 0 4
      scripts/Makefile.lib
  36. 0 3
      scripts/headers_install.sh
  37. 0 76
      scripts/link-vmlinux.sh

+ 1 - 1
Makefile

@@ -562,7 +562,7 @@ ifdef building_out_of_srctree
 	{ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
 
-ifneq ($(shell $(CC) --version 2>&1 | grep clang),)
+ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
 ifneq ($(CROSS_COMPILE),)
 CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))

+ 3 - 8
arch/arm64/Makefile

@@ -144,17 +144,12 @@ core-y		+= arch/arm64/
 libs-y		:= arch/arm64/lib/ $(libs-y)
 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
 
-ifeq ($(CONFIG_BUILD_ARM64_KERNEL_COMPRESSION_GZIP),y)
-KBUILD_TARGET   := Image.gz
-else
-KBUILD_TARGET   := Image
-endif
-
 # Default target when executing plain make
 boot		:= arch/arm64/boot
-KBUILD_IMAGE	:= $(boot)/$(KBUILD_TARGET)
+KBUILD_IMAGE	:= $(boot)/Image.gz
+
+all:	Image.gz
 
-all:	$(KBUILD_TARGET)
 
 Image: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

+ 0 - 15
arch/arm64/boot/Makefile

@@ -18,21 +18,6 @@ OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
 
 targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
 
-ifeq ($(CONFIG_QCOM_RTIC),y)
-# Add RTIC DTB to the DTB list if RTIC MPGen is enabled
-# Note, we keep this for compatibility with
-# BUILD_ARM64_APPENDED_DTB_IMAGE targets.
-# The rtic_mp.dts would be generated with the vmlinux if
-# MPGen enabled (RTIC_MPGEN defined).
-ifdef RTIC_MPGEN
-DTB_OBJS += rtic_mp.dtb
-endif
-
-rtic_mp.dtb: vmlinux FORCE
-	$(DTC) -O dtb -o rtic_mp.dtb -b 0 $(DTC_FLAGS) rtic_mp.dts
-
-endif
-
 $(obj)/Image: vmlinux FORCE
 	$(call if_changed,objcopy)
 

+ 1 - 0
arch/arm64/configs/rockpi4_defconfig

@@ -1,3 +1,4 @@
+CONFIG_LOCALVERSION="-mainline"
 CONFIG_AUDIT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y

+ 7 - 6
arch/mips/include/asm/barrier.h

@@ -95,13 +95,14 @@ static inline void wmb(void)
  * ordering will be done by smp_llsc_mb() and friends.
  */
 #if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
-#define __WEAK_LLSC_MB		"	sync	\n"
-#define smp_llsc_mb()		__asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
-#define __LLSC_CLOBBER
+# define __WEAK_LLSC_MB		sync
+# define smp_llsc_mb() \
+	__asm__ __volatile__(__stringify(__WEAK_LLSC_MB) : : :"memory")
+# define __LLSC_CLOBBER
 #else
-#define __WEAK_LLSC_MB		"		\n"
-#define smp_llsc_mb()		do { } while (0)
-#define __LLSC_CLOBBER		"memory"
+# define __WEAK_LLSC_MB
+# define smp_llsc_mb()		do { } while (0)
+# define __LLSC_CLOBBER		"memory"
 #endif
 
 #ifdef CONFIG_CPU_CAVIUM_OCTEON

+ 7 - 8
arch/mips/include/asm/futex.h

@@ -16,6 +16,7 @@
 #include <asm/barrier.h>
 #include <asm/compiler.h>
 #include <asm/errno.h>
+#include <asm/sync.h>
 #include <asm/war.h>
 
 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)		\
@@ -32,7 +33,7 @@
 		"	.set	arch=r4000			\n"	\
 		"2:	sc	$1, %2				\n"	\
 		"	beqzl	$1, 1b				\n"	\
-		__WEAK_LLSC_MB						\
+		__stringify(__WEAK_LLSC_MB) "			\n"	\
 		"3:						\n"	\
 		"	.insn					\n"	\
 		"	.set	pop				\n"	\
@@ -50,19 +51,19 @@
 		  "i" (-EFAULT)						\
 		: "memory");						\
 	} else if (cpu_has_llsc) {					\
-		loongson_llsc_mb();					\
 		__asm__ __volatile__(					\
 		"	.set	push				\n"	\
 		"	.set	noat				\n"	\
 		"	.set	push				\n"	\
 		"	.set	"MIPS_ISA_ARCH_LEVEL"		\n"	\
+		"	" __SYNC(full, loongson3_war) "		\n"	\
 		"1:	"user_ll("%1", "%4")" # __futex_atomic_op\n"	\
 		"	.set	pop				\n"	\
 		"	" insn	"				\n"	\
 		"	.set	"MIPS_ISA_ARCH_LEVEL"		\n"	\
 		"2:	"user_sc("$1", "%2")"			\n"	\
 		"	beqz	$1, 1b				\n"	\
-		__WEAK_LLSC_MB						\
+		__stringify(__WEAK_LLSC_MB) "			\n"	\
 		"3:						\n"	\
 		"	.insn					\n"	\
 		"	.set	pop				\n"	\
@@ -146,7 +147,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		"	.set	arch=r4000				\n"
 		"2:	sc	$1, %2					\n"
 		"	beqzl	$1, 1b					\n"
-		__WEAK_LLSC_MB
+		__stringify(__WEAK_LLSC_MB) "				\n"
 		"3:							\n"
 		"	.insn						\n"
 		"	.set	pop					\n"
@@ -163,13 +164,13 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		  "i" (-EFAULT)
 		: "memory");
 	} else if (cpu_has_llsc) {
-		loongson_llsc_mb();
 		__asm__ __volatile__(
 		"# futex_atomic_cmpxchg_inatomic			\n"
 		"	.set	push					\n"
 		"	.set	noat					\n"
 		"	.set	push					\n"
 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
+		"	" __SYNC(full, loongson3_war) "			\n"
 		"1:	"user_ll("%1", "%3")"				\n"
 		"	bne	%1, %z4, 3f				\n"
 		"	.set	pop					\n"
@@ -177,8 +178,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
 		"2:	"user_sc("$1", "%2")"				\n"
 		"	beqz	$1, 1b					\n"
-		__WEAK_LLSC_MB
-		"3:							\n"
+		"3:	" __SYNC_ELSE(full, loongson3_war, __WEAK_LLSC_MB) "\n"
 		"	.insn						\n"
 		"	.set	pop					\n"
 		"	.section .fixup,\"ax\"				\n"
@@ -193,7 +193,6 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		: GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval),
 		  "i" (-EFAULT)
 		: "memory");
-		loongson_llsc_mb();
 	} else
 		return -ENOSYS;
 

+ 0 - 7
arch/powerpc/kvm/book3s_xive_native.c

@@ -658,13 +658,6 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
 		return -EINVAL;
 	}
 
-	page = gfn_to_page(kvm, gfn);
-	if (is_error_page(page)) {
-		srcu_read_unlock(&kvm->srcu, srcu_idx);
-		pr_err("Couldn't get queue page %llx!\n", kvm_eq.qaddr);
-		return -EINVAL;
-	}
-
 	qaddr = page_to_virt(page) + (kvm_eq.qaddr & ~PAGE_MASK);
 	srcu_read_unlock(&kvm->srcu, srcu_idx);
 

+ 0 - 5
arch/x86/boot/compressed/head_64.S

@@ -300,11 +300,6 @@ SYM_INNER_LABEL(efi32_pe_stub_entry, SYM_L_LOCAL)
 	btrl	$X86_CR0_PG_BIT, %eax
 	movl	%eax, %cr0
 
-	/* Disable paging */
-	movl	%cr0, %eax
-	btrl	$X86_CR0_PG_BIT, %eax
-	movl	%eax, %cr0
-
 	jmp	startup_32
 SYM_FUNC_END(efi32_stub_entry)
 #endif

+ 0 - 2
arch/x86/kvm/x86.c

@@ -1386,8 +1386,6 @@ static u64 kvm_get_arch_capabilities(void)
 	else if (!boot_cpu_has_bug(X86_BUG_TAA))
 		data |= ARCH_CAP_TAA_NO;
 
-	/* KVM does not emulate MSR_IA32_TSX_CTRL.  */
-	data &= ~ARCH_CAP_TSX_CTRL_MSR;
 	return data;
 }
 

+ 0 - 22
drivers/acpi/button.c

@@ -115,28 +115,6 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
 		},
 		.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
 	},
-	{
-		/*
-		 * Medion Akoya E2215T, notification of the LID device only
-		 * happens on close, not on open and _LID always returns closed.
-		 */
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "E2215T MD60198"),
-		},
-		.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
-	},
-	{
-		/*
-		 * Razer Blade Stealth 13 late 2019, notification of the LID device
-		 * only happens on close, not on open and _LID always returns closed.
-		 */
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Razer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Razer Blade Stealth 13 Late 2019"),
-		},
-		.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
-	},
 	{}
 };
 

+ 0 - 9
drivers/acpi/sleep.c

@@ -1040,15 +1040,6 @@ static bool acpi_s2idle_wake(void)
 			return true;
 		}
 
-		/*
-		 * The SCI is in the "suspended" state now and it cannot produce
-		 * new wakeup events till the rearming below, so if any of them
-		 * are pending here, they must be resulting from the processing
-		 * of EC events above or coming from somewhere else.
-		 */
-		if (pm_wakeup_pending())
-			return true;
-
 		rearm_wake_irq(acpi_sci_irq);
 	}
 

+ 0 - 4
drivers/net/can/m_can/tcan4x5x.c

@@ -510,10 +510,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
 	if (ret)
 		goto out_power;
 
-	ret = tcan4x5x_init(mcan_class);
-	if (ret)
-		goto out_power;
-
 	ret = m_can_class_register(mcan_class);
 	if (ret)
 		goto out_power;

+ 0 - 3
drivers/net/dsa/microchip/ksz9477.c

@@ -511,9 +511,6 @@ static int ksz9477_port_vlan_filtering(struct dsa_switch *ds, int port,
 			     PORT_VLAN_LOOKUP_VID_0, false);
 	}
 
-	/* set the real number of ports */
-	dev->ds->num_ports = dev->port_cnt;
-
 	return 0;
 }
 

+ 0 - 2
drivers/net/dsa/sja1105/sja1105_main.c

@@ -1757,8 +1757,6 @@ int sja1105_static_config_reload(struct sja1105_private *priv,
 
 	mutex_lock(&priv->mgmt_lock);
 
-	mutex_lock(&priv->mgmt_lock);
-
 	mac = priv->static_config.tables[BLK_IDX_MAC_CONFIG].entries;
 
 	/* Back up the dynamic link speed changed by sja1105_adjust_port_config

+ 0 - 4
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

@@ -1439,10 +1439,6 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 		return NETDEV_TX_OK;
 	}
 
-	/* Hardware can only handle short frames above 32 bytes */
-	if (skb_put_padto(skb, HNS3_MIN_TX_LEN))
-		return NETDEV_TX_OK;
-
 	/* Prefetch the data used later */
 	prefetch(skb->data);
 

+ 0 - 32
drivers/net/wireless/ath/wil6210/Kconfig

@@ -42,18 +42,6 @@ config WIL6210_TRACING
 
 	  If unsure, say Y to make it easier to debug problems.
 
-config WIL6210_PLATFORM_MSM
-	bool "wil6210 MSM platform specific support"
-	depends on WIL6210
-	depends on ARCH_QCOM
-	default y
-	help
-	  Say Y here to enable wil6210 driver support for MSM
-	  Platform driver used to handle msm specific platform
-	  requirement for 11ad chipset connected to msm platform
-
-	  If unsure, say N.
-
 config WIL6210_DEBUGFS
 	bool "wil6210 debugfs support"
 	depends on WIL6210
@@ -65,23 +53,3 @@ config WIL6210_DEBUGFS
 	  option if you are interested in debugging the driver.
 
 	  If unsure, say Y to make it easier to debug problems.
-
-config WIL6210_WRITE_IOCTL
-	bool "wil6210 write ioctl to the device"
-	depends on WIL6210
-	default y
-	help
-	  Say Y here to allow write-access from user-space to
-	  the device memory through ioctl. This is useful for
-	  debugging purposes only.
-
-	  If unsure, say N.
-
-config WIL6210_IPA
-	bool "wil6210 IPA offload support"
-	depends on WIL6210
-	depends on ARCH_QCOM
-	default y
-	help
-	  Say Y here to enable wil6210 driver support for data path
-	  IPA offload

+ 0 - 8
drivers/net/wireless/ath/wil6210/Makefile

@@ -6,14 +6,12 @@ wil6210-y += netdev.o
 wil6210-y += cfg80211.o
 wil6210-y += pcie_bus.o
 wil6210-$(CONFIG_WIL6210_DEBUGFS) += debugfs.o
-wil6210-y += sysfs.o
 wil6210-y += wmi.o
 wil6210-y += interrupt.o
 wil6210-y += txrx.o
 wil6210-y += txrx_edma.o
 wil6210-y += debug.o
 wil6210-y += rx_reorder.o
-wil6210-y += ioctl.o
 wil6210-y += fw.o
 wil6210-y += pm.o
 wil6210-y += pmc.o
@@ -22,12 +20,6 @@ wil6210-y += wil_platform.o
 wil6210-y += ethtool.o
 wil6210-y += wil_crash_dump.o
 wil6210-y += p2p.o
-wil6210-y += ftm.o
-wil6210-$(CONFIG_WIL6210_IPA) += ipa.o
-wil6210-y += config.o
 
 # for tracing framework to find trace.h
 CFLAGS_trace.o := -I$(src)
-
-MSM_11AD_PATH = $(srctree)/drivers/platform/msm/msm_11ad/
-CFLAGS_wil_platform.o := -I$(MSM_11AD_PATH)

+ 21 - 737
drivers/net/wireless/ath/wil6210/cfg80211.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/etherdevice.h>
@@ -10,13 +10,9 @@
 #include <net/cfg80211.h>
 #include "wil6210.h"
 #include "wmi.h"
-#include "ftm.h"
 #include "fw.h"
-#include "ipa.h"
 
 #define WIL_MAX_ROC_DURATION_MS 5000
-#define WIL_BRD_SUFFIX_CN "CN"
-#define WIL_BRD_SUFFIX_FCC "FCC"
 
 #define WIL_EDMG_CHANNEL_9_SUBCHANNELS	(BIT(0) | BIT(1))
 #define WIL_EDMG_CHANNEL_10_SUBCHANNELS	(BIT(1) | BIT(2))
@@ -34,8 +30,6 @@
  */
 #define WIL_EDMG_CHANNELS (BIT(0) | BIT(1) | BIT(2) | BIT(3))
 
-#define WIL_DISABLE_EDMG 255
-
 bool disable_ap_sme;
 module_param(disable_ap_sme, bool, 0444);
 MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
@@ -46,15 +40,6 @@ static struct wiphy_wowlan_support wil_wowlan_support = {
 };
 #endif
 
-bool country_specific_board_file;
-module_param(country_specific_board_file, bool, 0444);
-MODULE_PARM_DESC(country_specific_board_file, " switch board file upon regulatory domain change (Default: false)");
-
-bool ignore_reg_hints = true;
-module_param(ignore_reg_hints, bool, 0444);
-MODULE_PARM_DESC(ignore_reg_hints,
-		 " Ignore OTA regulatory hints (Default: true)");
-
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -64,9 +49,6 @@ MODULE_PARM_DESC(ignore_reg_hints,
 	.max_power		= 40,				\
 }
 
-#define WIL_BRP_ANT_LIMIT_MIN	(1)
-#define WIL_BRP_ANT_LIMIT_MAX	(27)
-
 static struct ieee80211_channel wil_60ghz_channels[] = {
 	CHAN60G(1, 0),
 	CHAN60G(2, 0),
@@ -107,86 +89,6 @@ static int wil_tx_cb_mode_to_n_bonded(u8 cb_mode)
 	}
 }
 
-struct wil_regd_2_brd_suffix {
-	const char regdomain[3]; /* alpha2 */
-	const char *brd_suffix;
-};
-
-static struct wil_regd_2_brd_suffix wil_regd_2_brd_suffix_map[] = {
-	{"BO", WIL_BRD_SUFFIX_FCC},
-	{"CN", WIL_BRD_SUFFIX_CN},
-	{"EC", WIL_BRD_SUFFIX_FCC},
-	{"GU", WIL_BRD_SUFFIX_FCC},
-	{"HN", WIL_BRD_SUFFIX_FCC},
-	{"JM", WIL_BRD_SUFFIX_FCC},
-	{"MX", WIL_BRD_SUFFIX_FCC},
-	{"NI", WIL_BRD_SUFFIX_FCC},
-	{"PY", WIL_BRD_SUFFIX_FCC},
-	{"TT", WIL_BRD_SUFFIX_FCC},
-	{"US", WIL_BRD_SUFFIX_FCC},
-};
-
-enum wil_nl_60g_cmd_type {
-	NL_60G_CMD_FW_WMI,
-	NL_60G_CMD_DEBUG,
-	NL_60G_CMD_STATISTICS,
-	NL_60G_CMD_REGISTER,
-};
-
-enum wil_nl_60g_evt_type {
-	NL_60G_EVT_DRIVER_ERROR,
-	NL_60G_EVT_FW_ERROR,
-	NL_60G_EVT_FW_WMI,
-	NL_60G_EVT_DRIVER_SHUTOWN,
-	NL_60G_EVT_DRIVER_DEBUG_EVENT,
-};
-
-enum wil_nl_60g_debug_cmd {
-	NL_60G_DBG_FORCE_WMI_SEND,
-	NL_60G_GEN_RADAR_ALLOC_BUFFER,
-	NL_60G_GEN_FW_RESET,
-	NL_60G_GEN_GET_DRIVER_CAPA,
-};
-
-struct wil_nl_60g_send_receive_wmi {
-	u32 cmd_id; /* enum wmi_command_id or enum wmi_event_id */
-	u8 reserved[2];
-	u8 dev_id; /* mid */
-	u16 buf_len;
-	u8 buf[0];
-} __packed;
-
-enum wil_nl_60g_driver_capa {
-	NL_60G_DRIVER_CAPA_WMI_OVER_NL, /* NL command for WMI */
-	NL_60G_DRIVER_CAPA_FW_STATE, /* notifications of FW state changes */
-	/* ioctl to write to the device address space */
-	NL_60G_DRIVER_CAPA_IOCTL_WRITE,
-};
-
-struct wil_nl_60g_driver_capabilities_reply {
-	u32 drv_cap[0]; /* bit mask of wil_nl_60g_driver_capa */
-} __packed;
-
-enum qca_wlan_vendor_driver_capa {
-	QCA_WLAN_VENDOR_ATTR_DRIVER_CAPA,
-};
-
-struct wil_nl_60g_event {
-	u32 evt_type; /* wil_nl_60g_evt_type */
-	u32 buf_len;
-	u8 reserved[9];
-	u8 buf[0];
-} __packed;
-
-struct wil_nl_60g_debug { /* NL_60G_CMD_DEBUG */
-	u32 cmd_id; /* wil_nl_60g_debug_cmd */
-} __packed;
-
-struct wil_nl_60g_debug_force_wmi {
-	struct wil_nl_60g_debug hdr;
-	u32 enable;
-} __packed;
-
 static void
 wil_memdup_ie(u8 **pdst, size_t *pdst_len, const u8 *src, size_t src_len)
 {
@@ -240,24 +142,17 @@ void update_supported_bands(struct wil6210_priv *wil)
 #define WIL_MAX_RF_SECTORS (128)
 #define WIL_CID_ALL (0xff)
 
-enum qca_wlan_vendor_attr_wil {
+enum qca_wlan_vendor_attr_rf_sector {
 	QCA_ATTR_MAC_ADDR = 6,
-	QCA_ATTR_FEATURE_FLAGS = 7,
-	QCA_ATTR_TEST = 8,
 	QCA_ATTR_PAD = 13,
 	QCA_ATTR_TSF = 29,
 	QCA_ATTR_DMG_RF_SECTOR_INDEX = 30,
 	QCA_ATTR_DMG_RF_SECTOR_TYPE = 31,
 	QCA_ATTR_DMG_RF_MODULE_MASK = 32,
 	QCA_ATTR_DMG_RF_SECTOR_CFG = 33,
-	QCA_ATTR_BRP_ANT_LIMIT_MODE = 38,
-	QCA_ATTR_BRP_ANT_NUM_LIMIT = 39,
-	QCA_ATTR_WIL_MAX,
+	QCA_ATTR_DMG_RF_SECTOR_MAX,
 };
 
-#define WIL_ATTR_60G_CMD_TYPE QCA_ATTR_FEATURE_FLAGS
-#define WIL_ATTR_60G_BUF QCA_ATTR_TEST
-
 enum qca_wlan_vendor_attr_dmg_rf_sector_type {
 	QCA_ATTR_DMG_RF_SECTOR_TYPE_RX,
 	QCA_ATTR_DMG_RF_SECTOR_TYPE_TX,
@@ -280,22 +175,8 @@ enum qca_wlan_vendor_attr_dmg_rf_sector_cfg {
 	QCA_ATTR_DMG_RF_SECTOR_CFG_AFTER_LAST - 1
 };
 
-enum qca_wlan_vendor_attr_brp_ant_limit_mode {
-	QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_DISABLE,
-	QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_EFFECTIVE,
-	QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_FORCE,
-	QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODES_NUM
-};
-
 static const struct
-nla_policy wil_brp_ant_limit_policy[QCA_ATTR_WIL_MAX + 1] = {
-	[QCA_ATTR_MAC_ADDR] = { .len = ETH_ALEN },
-	[QCA_ATTR_BRP_ANT_NUM_LIMIT] = { .type = NLA_U8 },
-	[QCA_ATTR_BRP_ANT_LIMIT_MODE] = { .type = NLA_U8 },
-};
-
-static const struct
-nla_policy wil_rf_sector_policy[QCA_ATTR_WIL_MAX + 1] = {
+nla_policy wil_rf_sector_policy[QCA_ATTR_DMG_RF_SECTOR_MAX + 1] = {
 	[QCA_ATTR_MAC_ADDR] = { .len = ETH_ALEN },
 	[QCA_ATTR_DMG_RF_SECTOR_INDEX] = { .type = NLA_U16 },
 	[QCA_ATTR_DMG_RF_SECTOR_TYPE] = { .type = NLA_U8 },
@@ -314,28 +195,11 @@ nla_policy wil_rf_sector_cfg_policy[QCA_ATTR_DMG_RF_SECTOR_CFG_MAX + 1] = {
 	[QCA_ATTR_DMG_RF_SECTOR_CFG_DTYPE_X16] = { .type = NLA_U32 },
 };
 
-static const struct
-nla_policy wil_nl_60g_policy[QCA_ATTR_WIL_MAX + 1] = {
-	[WIL_ATTR_60G_CMD_TYPE] = { .type = NLA_U32 },
-	[WIL_ATTR_60G_BUF] = { .type = NLA_BINARY },
-};
-
 enum qca_nl80211_vendor_subcmds {
-	QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
-	QCA_NL80211_VENDOR_SUBCMD_LOC_GET_CAPA = 128,
-	QCA_NL80211_VENDOR_SUBCMD_FTM_START_SESSION = 129,
-	QCA_NL80211_VENDOR_SUBCMD_FTM_ABORT_SESSION = 130,
-	QCA_NL80211_VENDOR_SUBCMD_FTM_MEAS_RESULT = 131,
-	QCA_NL80211_VENDOR_SUBCMD_FTM_SESSION_DONE = 132,
-	QCA_NL80211_VENDOR_SUBCMD_FTM_CFG_RESPONDER = 133,
-	QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS = 134,
-	QCA_NL80211_VENDOR_SUBCMD_AOA_ABORT_MEAS = 135,
-	QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS_RESULT = 136,
 	QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG = 139,
 	QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SECTOR_CFG = 140,
 	QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SELECTED_SECTOR = 141,
 	QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR = 142,
-	QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT = 153,
 };
 
 static int wil_rf_sector_get_cfg(struct wiphy *wiphy,
@@ -350,61 +214,9 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy,
 static int wil_rf_sector_set_selected(struct wiphy *wiphy,
 				      struct wireless_dev *wdev,
 				      const void *data, int data_len);
-static int wil_brp_set_ant_limit(struct wiphy *wiphy, struct wireless_dev *wdev,
-				 const void *data, int data_len);
 
-static int wil_nl_60g_handle_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
-				 const void *data, int data_len);
 /* vendor specific commands */
 static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LOC_GET_CAPA,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = VENDOR_CMD_RAW_DATA,
-		.doit = wil_ftm_get_capabilities
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_START_SESSION,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = wil_nl80211_loc_policy,
-		.doit = wil_ftm_start_session
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_ABORT_SESSION,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = VENDOR_CMD_RAW_DATA,
-		.doit = wil_ftm_abort_session
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_CFG_RESPONDER,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = VENDOR_CMD_RAW_DATA,
-		.doit = wil_ftm_configure_responder
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = wil_nl80211_loc_policy,
-		.doit = wil_aoa_start_measurement
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AOA_ABORT_MEAS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = VENDOR_CMD_RAW_DATA,
-		.doit = wil_aoa_abort_measurement
-	},
 	{
 		.info.vendor_id = QCA_NL80211_VENDOR_ID,
 		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG,
@@ -439,42 +251,6 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
 		.policy = wil_rf_sector_policy,
 		.doit = wil_rf_sector_set_selected
 	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.policy = wil_brp_ant_limit_policy,
-		.doit = wil_brp_set_ant_limit
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_UNSPEC,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.policy = VENDOR_CMD_RAW_DATA,
-		.doit = wil_nl_60g_handle_cmd
-	},
-};
-
-/* vendor specific events */
-static const struct nl80211_vendor_cmd_info wil_nl80211_vendor_events[] = {
-	[QCA_EVENT_FTM_MEAS_RESULT_INDEX] = {
-			.vendor_id = QCA_NL80211_VENDOR_ID,
-			.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_MEAS_RESULT
-	},
-	[QCA_EVENT_FTM_SESSION_DONE_INDEX] = {
-			.vendor_id = QCA_NL80211_VENDOR_ID,
-			.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_SESSION_DONE
-	},
-	[QCA_EVENT_AOA_MEAS_RESULT_INDEX] = {
-			.vendor_id = QCA_NL80211_VENDOR_ID,
-			.subcmd = QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS_RESULT
-	},
-	[QCA_EVENT_UNSPEC_INDEX] = {
-			.vendor_id = QCA_NL80211_VENDOR_ID,
-			.subcmd = QCA_NL80211_VENDOR_SUBCMD_UNSPEC
-	},
 };
 
 static struct ieee80211_supported_band wil_band_60ghz = {
@@ -604,9 +380,6 @@ int wil_spec2wmi_ch(u8 spec_ch, u8 *wmi_ch)
 	case 12:
 		*wmi_ch = WMI_CHANNEL_12;
 		break;
-	case WIL_DISABLE_EDMG:
-		*wmi_ch = 0;
-		break;
 	default:
 		return -EINVAL;
 	}
@@ -1563,16 +1336,6 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
 	if (rc < 0)
 		return rc;
 
-	if (test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
-		if (wil->force_edmg_channel) {
-			rc = wil_spec2wmi_ch(wil->force_edmg_channel,
-					     &conn.edmg_channel);
-			if (rc)
-				wil_err(wil,
-					"wmi channel for channel %d not found",
-					wil->force_edmg_channel);
-		}
-
 	ether_addr_copy(conn.bssid, bss->bssid);
 	ether_addr_copy(conn.dst_mac, bss->bssid);
 
@@ -1581,14 +1344,8 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
 	rc = wmi_send(wil, WMI_CONNECT_CMDID, vif->mid, &conn, sizeof(conn));
 	if (rc == 0) {
 		netif_carrier_on(ndev);
-		if (!wil_has_other_active_ifaces(wil, ndev, false, true)) {
-			if (wil->force_edmg_channel)
-				wil6210_bus_request(wil,
-						    WIL_11AY_BUS_REQUEST_KBPS);
-			else
-				wil6210_bus_request(wil,
-						    WIL_11AD_BUS_REQUEST_KBPS);
-		}
+		if (!wil_has_other_active_ifaces(wil, ndev, false, true))
+			wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
 		vif->bss = bss;
 		/* Connect can take lots of time */
 		mod_timer(&vif->connect_timer,
@@ -2168,8 +1925,7 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
 	if (pbss)
 		wmi_nettype = WMI_NETTYPE_P2P;
 
-	wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d ap_ps=%d\n", vif->mid,
-		     is_go, wil->ap_ps);
+	wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d\n", vif->mid, is_go);
 	if (is_go && !pbss) {
 		wil_err(wil, "P2P GO must be in PBSS\n");
 		return -ENOTSUPP;
@@ -2199,22 +1955,7 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
 	mutex_lock(&wil->mutex);
 
 	if (!wil_has_other_active_ifaces(wil, ndev, true, false)) {
-		if (wil->ipa_handle) {
-			wil_ipa_uninit(wil->ipa_handle);
-			wil->ipa_handle = NULL;
-		}
-
 		__wil_down(wil);
-
-		if (wil_ipa_offload()) {
-			wil->ipa_handle = wil_ipa_init(wil);
-			if (!wil->ipa_handle) {
-				wil_err(wil, "wil_ipa_init failed\n");
-				rc = -ENOMEM;
-				goto out;
-			}
-		}
-
 		rc = __wil_up(wil);
 		if (rc)
 			goto out;
@@ -2237,20 +1978,9 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
 	memcpy(vif->ssid, ssid, ssid_len);
 	vif->ssid_len = ssid_len;
 
-	if (wil->ipa_handle) {
-		rc = wil_ipa_start_ap(wil->ipa_handle);
-		if (rc)
-			goto out;
-	}
-
 	netif_carrier_on(ndev);
-	if (!wil_has_other_active_ifaces(wil, ndev, false, true)) {
-		if (wil->force_edmg_channel)
-			wil6210_bus_request(wil, WIL_11AY_BUS_REQUEST_KBPS);
-		else
-			wil6210_bus_request(wil, WIL_11AD_BUS_REQUEST_KBPS);
-	}
-
+	if (!wil_has_other_active_ifaces(wil, ndev, false, true))
+		wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
 
 	rc = wmi_pcp_start(vif, bi, wmi_nettype, chan, wmi_edmg_channel,
 			   hidden_ssid, is_go);
@@ -2261,14 +1991,6 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
 	if (rc)
 		goto err_bcast;
 
-	if (test_bit(WMI_FW_CAPABILITY_AP_POWER_MANAGEMENT,
-		     wil->fw_capabilities)) {
-		enum wmi_ps_profile_type ps_profile = wil->ap_ps ?
-			wil->ps_profile : WMI_PS_PROFILE_TYPE_PS_DISABLED;
-
-		wil_ps_update(wil, ps_profile);
-	}
-
 	goto out; /* success */
 
 err_bcast:
@@ -2278,11 +2000,6 @@ err_pcp_start:
 	if (!wil_has_other_active_ifaces(wil, ndev, false, true))
 		wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
 out:
-	if (rc && wil->ipa_handle) {
-		wil_ipa_uninit(wil->ipa_handle);
-		wil->ipa_handle = NULL;
-	}
-
 	mutex_unlock(&wil->mutex);
 	return rc;
 }
@@ -2349,11 +2066,6 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
 	struct wil6210_vif *vif = ndev_to_vif(ndev);
 	int rc;
 	u32 privacy = 0;
-	u16 len = 0, proberesp_len = 0;
-	u8 *ies = NULL, *proberesp;
-	bool ssid_changed = false;
-	const u8 *ie;
-
 
 	wil_dbg_misc(wil, "change_beacon, mid=%d\n", vif->mid);
 	wil_print_bcon_data(bcon);
@@ -2366,27 +2078,6 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
 	memcpy(vif->ssid, wdev->ssid, wdev->ssid_len);
 	vif->ssid_len = wdev->ssid_len;
 
-	/* extract updated SSID from the probe response IE */
-	proberesp = _wil_cfg80211_get_proberesp_ies(bcon->probe_resp,
-						    bcon->probe_resp_len,
-						    &proberesp_len);
-	rc = _wil_cfg80211_merge_extra_ies(proberesp,
-					   proberesp_len,
-					   bcon->proberesp_ies,
-					   bcon->proberesp_ies_len,
-					   &ies, &len);
-
-	if (!rc) {
-		ie = cfg80211_find_ie(WLAN_EID_SSID, ies, len);
-		if (ie && ie[1] <= IEEE80211_MAX_SSID_LEN)
-			if (ie[1] != vif->ssid_len ||
-			    memcmp(&ie[2], vif->ssid, ie[1])) {
-				memcpy(vif->ssid, &ie[2], ie[1]);
-				vif->ssid_len = ie[1];
-				ssid_changed = true;
-			}
-	}
-
 	/* in case privacy has changed, need to restart the AP */
 	if (vif->privacy != privacy) {
 		wil_dbg_misc(wil, "privacy changed %d=>%d. Restarting AP\n",
@@ -2400,20 +2091,9 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
 					    vif->hidden_ssid,
 					    vif->pbss);
 	} else {
-		if (ssid_changed) {
-			rc = wmi_set_ssid(vif, vif->ssid_len, vif->ssid);
-			if (rc)
-				goto out;
-		}
 		rc = _wil_cfg80211_set_ies(vif, bcon);
 	}
 
-	if (ssid_changed) {
-		wdev->ssid_len = vif->ssid_len;
-		memcpy(wdev->ssid, vif->ssid, vif->ssid_len);
-	}
-
-out:
 	return rc;
 }
 
@@ -2510,10 +2190,6 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
 	memset(vif->gtk, 0, WMI_MAX_KEY_LEN);
 	vif->gtk_len = 0;
 
-	if (wil->ipa_handle) {
-		wil_ipa_uninit(wil->ipa_handle);
-		wil->ipa_handle = NULL;
-	}
 	if (last)
 		__wil_down(wil);
 	else
@@ -2733,10 +2409,6 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
 	enum wmi_ps_profile_type ps_profile;
 
-	if (wil->vr_profile != WMI_VR_PROFILE_DISABLED)
-		/* disallow in VR mode */
-		return -EINVAL;
-
 	wil_dbg_misc(wil, "enabled=%d, timeout=%d\n",
 		     enabled, timeout);
 
@@ -2769,7 +2441,6 @@ static int wil_cfg80211_suspend(struct wiphy *wiphy,
 
 	mutex_lock(&wil->mutex);
 	mutex_lock(&wil->vif_mutex);
-	wil_ftm_stop_operations(wil);
 	wil_p2p_stop_radio_operations(wil);
 	wil_abort_scan_all_vifs(wil, true);
 	mutex_unlock(&wil->vif_mutex);
@@ -2860,84 +2531,6 @@ wil_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev,
 	return 0;
 }
 
-static void wil_get_brd_reg_suffix(struct wil6210_priv *wil,
-				   const u8 *new_regdomain,
-				   char *brd_reg_suffix, size_t len)
-{
-	int i;
-	struct wil_regd_2_brd_suffix *entry;
-
-	for (i = 0; i < ARRAY_SIZE(wil_regd_2_brd_suffix_map); i++) {
-		entry = &wil_regd_2_brd_suffix_map[i];
-		if (!memcmp(entry->regdomain, new_regdomain, 2)) {
-			strlcpy(brd_reg_suffix, entry->brd_suffix, len);
-			return;
-		}
-	}
-
-	/* regdomain not found in our map, set suffix to none */
-	brd_reg_suffix[0] = '\0';
-}
-
-static int wil_switch_board_file(struct wil6210_priv *wil,
-				 const u8 *new_regdomain)
-{
-	int rc = 0;
-	char brd_reg_suffix[WIL_BRD_SUFFIX_LEN];
-
-	if (!country_specific_board_file)
-		return 0;
-
-	wil_get_brd_reg_suffix(wil, new_regdomain, brd_reg_suffix,
-			       sizeof(brd_reg_suffix));
-	if (!strcmp(wil->board_file_reg_suffix, brd_reg_suffix))
-		return 0;
-
-	wil_info(wil, "switch board file suffix '%s' => '%s'\n",
-		 wil->board_file_reg_suffix, brd_reg_suffix);
-	strlcpy(wil->board_file_reg_suffix, brd_reg_suffix,
-		sizeof(wil->board_file_reg_suffix));
-
-	/* need to switch board file - reset the device */
-
-	mutex_lock(&wil->mutex);
-
-	if (!wil_has_active_ifaces(wil, true, false) ||
-	    wil_is_recovery_blocked(wil))
-		/* new board file will be used in next FW load */
-		goto out;
-
-	__wil_down(wil);
-	rc = __wil_up(wil);
-
-out:
-	mutex_unlock(&wil->mutex);
-	return rc;
-}
-
-static void wil_cfg80211_reg_notify(struct wiphy *wiphy,
-				    struct regulatory_request *request)
-{
-	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
-	int rc;
-
-	wil_info(wil, "cfg reg_notify %c%c%s%s initiator %d hint_type %d\n",
-		 request->alpha2[0], request->alpha2[1],
-		 request->intersect ? " intersect" : "",
-		 request->processed ? " processed" : "",
-		 request->initiator, request->user_reg_hint_type);
-
-	if (memcmp(wil->regdomain, request->alpha2, 2) == 0)
-		/* reg domain did not change */
-		return;
-
-	rc = wil_switch_board_file(wil, request->alpha2);
-	if (rc)
-		wil_err(wil, "switch board file failed %d\n", rc);
-
-	memcpy(wil->regdomain, request->alpha2, 2);
-}
-
 static int
 wil_cfg80211_update_ft_ies(struct wiphy *wiphy, struct net_device *dev,
 			   struct cfg80211_update_ft_ies_params *ftie)
@@ -3058,10 +2651,8 @@ static const struct cfg80211_ops wil_cfg80211_ops = {
 	.set_multicast_to_unicast = wil_cfg80211_set_multicast_to_unicast,
 };
 
-void wil_wiphy_init(struct wil6210_priv *wil)
+static void wil_wiphy_init(struct wiphy *wiphy)
 {
-	struct wiphy *wiphy = wil_to_wiphy(wil);
-
 	wiphy->max_scan_ssids = 1;
 	wiphy->max_scan_ie_len = WMI_MAX_IE_LEN;
 	wiphy->max_remain_on_channel_duration = WIL_MAX_ROC_DURATION_MS;
@@ -3094,17 +2685,8 @@ void wil_wiphy_init(struct wil6210_priv *wil)
 	wiphy->mgmt_stypes = wil_mgmt_stypes;
 	wiphy->features |= NL80211_FEATURE_SK_TX_STATUS;
 
-	wiphy->reg_notifier = wil_cfg80211_reg_notify;
-
 	wiphy->n_vendor_commands = ARRAY_SIZE(wil_nl80211_vendor_commands);
 	wiphy->vendor_commands = wil_nl80211_vendor_commands;
-	wiphy->vendor_events = wil_nl80211_vendor_events;
-	wiphy->n_vendor_events = ARRAY_SIZE(wil_nl80211_vendor_events);
-
-	if (ignore_reg_hints) {
-		wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
-		wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
-	}
 
 #ifdef CONFIG_PM
 	wiphy->wowlan = &wil_wowlan_support;
@@ -3200,11 +2782,13 @@ struct wil6210_priv *wil_cfg80211_init(struct device *dev)
 		return ERR_PTR(-ENOMEM);
 
 	set_wiphy_dev(wiphy, dev);
+	wil_wiphy_init(wiphy);
+
 	wil = wiphy_to_wil(wiphy);
 	wil->wiphy = wiphy;
 
 	/* default monitor channel */
-	ch = wil_band_60ghz.channels;
+	ch = wiphy->bands[NL80211_BAND_60GHZ]->channels;
 	cfg80211_chandef_create(&wil->monitor_chandef, ch, NL80211_CHAN_NO_HT);
 
 	return wil;
@@ -3264,7 +2848,7 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wdev_to_wil(wdev);
 	struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
 	int rc;
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
+	struct nlattr *tb[QCA_ATTR_DMG_RF_SECTOR_MAX + 1];
 	u16 sector_index;
 	u8 sector_type;
 	u32 rf_modules_vec;
@@ -3283,7 +2867,7 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy,
 	if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
 		return -EOPNOTSUPP;
 
-	rc = nla_parse_deprecated(tb, QCA_ATTR_WIL_MAX, data,
+	rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
 				  data_len, wil_rf_sector_policy, NULL);
 	if (rc) {
 		wil_err(wil, "Invalid rf sector ATTR\n");
@@ -3385,7 +2969,7 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wdev_to_wil(wdev);
 	struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
 	int rc, tmp;
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
+	struct nlattr *tb[QCA_ATTR_DMG_RF_SECTOR_MAX + 1];
 	struct nlattr *tb2[QCA_ATTR_DMG_RF_SECTOR_CFG_MAX + 1];
 	u16 sector_index, rf_module_index;
 	u8 sector_type;
@@ -3403,7 +2987,7 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy,
 	if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
 		return -EOPNOTSUPP;
 
-	rc = nla_parse_deprecated(tb, QCA_ATTR_WIL_MAX, data,
+	rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
 				  data_len, wil_rf_sector_policy, NULL);
 	if (rc) {
 		wil_err(wil, "Invalid rf sector ATTR\n");
@@ -3497,7 +3081,7 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wdev_to_wil(wdev);
 	struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
 	int rc;
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
+	struct nlattr *tb[QCA_ATTR_DMG_RF_SECTOR_MAX + 1];
 	u8 sector_type, mac_addr[ETH_ALEN];
 	int cid = 0;
 	struct wmi_get_selected_rf_sector_index_cmd cmd;
@@ -3512,7 +3096,7 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy,
 	if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
 		return -EOPNOTSUPP;
 
-	rc = nla_parse_deprecated(tb, QCA_ATTR_WIL_MAX, data,
+	rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
 				  data_len, wil_rf_sector_policy, NULL);
 	if (rc) {
 		wil_err(wil, "Invalid rf sector ATTR\n");
@@ -3612,7 +3196,7 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wdev_to_wil(wdev);
 	struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
 	int rc;
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
+	struct nlattr *tb[QCA_ATTR_DMG_RF_SECTOR_MAX + 1];
 	u16 sector_index;
 	u8 sector_type, mac_addr[ETH_ALEN], i;
 	int cid = 0;
@@ -3620,7 +3204,7 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy,
 	if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
 		return -EOPNOTSUPP;
 
-	rc = nla_parse_deprecated(tb, QCA_ATTR_WIL_MAX, data,
+	rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
 				  data_len, wil_rf_sector_policy, NULL);
 	if (rc) {
 		wil_err(wil, "Invalid rf sector ATTR\n");
@@ -3702,303 +3286,3 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy,
 
 	return rc;
 }
-
-static int
-wil_brp_wmi_set_ant_limit(struct wil6210_priv *wil, u8 mid, u8 cid,
-			  u8 limit_mode, u8 antenna_num_limit)
-{
-	int rc;
-	struct wmi_brp_set_ant_limit_cmd cmd = {
-		.cid = cid,
-		.limit_mode = limit_mode,
-		.ant_limit = antenna_num_limit,
-	};
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_brp_set_ant_limit_event evt;
-	} __packed reply;
-
-	reply.evt.status = WMI_FW_STATUS_FAILURE;
-
-	rc = wmi_call(wil, WMI_BRP_SET_ANT_LIMIT_CMDID, mid, &cmd, sizeof(cmd),
-		      WMI_BRP_SET_ANT_LIMIT_EVENTID, &reply,
-		      sizeof(reply), 250);
-	if (rc)
-		return rc;
-
-	if (reply.evt.status != WMI_FW_STATUS_SUCCESS) {
-		wil_err(wil, "brp set antenna limit failed with status %d\n",
-			reply.evt.status);
-		rc = -EINVAL;
-	}
-
-	return rc;
-}
-
-static int wil_brp_set_ant_limit(struct wiphy *wiphy, struct wireless_dev *wdev,
-				 const void *data, int data_len)
-{
-	struct wil6210_priv *wil = wdev_to_wil(wdev);
-	struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
-	u8 mac_addr[ETH_ALEN];
-	u8 antenna_num_limit = 0;
-	u8 limit_mode;
-	int cid = 0;
-	int rc;
-
-	if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
-		return -ENOTSUPP;
-
-	rc = nla_parse(tb, QCA_ATTR_WIL_MAX, data, data_len,
-		       wil_brp_ant_limit_policy, NULL);
-	if (rc) {
-		wil_err(wil, "Invalid ant limit ATTR\n");
-		return rc;
-	}
-
-	if (!tb[QCA_ATTR_BRP_ANT_LIMIT_MODE] || !tb[QCA_ATTR_MAC_ADDR]) {
-		wil_err(wil, "Invalid antenna limit spec\n");
-		return -EINVAL;
-	}
-
-	limit_mode = nla_get_u8(tb[QCA_ATTR_BRP_ANT_LIMIT_MODE]);
-	if (limit_mode >= QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODES_NUM) {
-		wil_err(wil, "Invalid limit mode %d\n", limit_mode);
-		return -EINVAL;
-	}
-
-	if (limit_mode != QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_DISABLE) {
-		if (!tb[QCA_ATTR_BRP_ANT_NUM_LIMIT]) {
-			wil_err(wil, "Invalid limit number\n");
-			return -EINVAL;
-		}
-
-		antenna_num_limit = nla_get_u8(tb[QCA_ATTR_BRP_ANT_NUM_LIMIT]);
-		if (antenna_num_limit > WIL_BRP_ANT_LIMIT_MAX ||
-		    antenna_num_limit < WIL_BRP_ANT_LIMIT_MIN) {
-			wil_err(wil, "Invalid number of antenna limit: %d\n",
-				antenna_num_limit);
-			return -EINVAL;
-		}
-	}
-
-	ether_addr_copy(mac_addr, nla_data(tb[QCA_ATTR_MAC_ADDR]));
-	cid = wil_find_cid(wil, vif->mid, mac_addr);
-	if (cid < 0) {
-		wil_err(wil, "invalid MAC address %pM\n", mac_addr);
-		return -ENOENT;
-	}
-
-	return wil_brp_wmi_set_ant_limit(wil, vif->mid, cid, limit_mode,
-					 antenna_num_limit);
-}
-
-static int wil_nl_60g_handle_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
-				 const void *data, int data_len)
-{
-	struct wil6210_priv *wil = wdev_to_wil(wdev);
-	struct nlattr *tb[QCA_ATTR_WIL_MAX + 1];
-	struct wil_nl_60g_send_receive_wmi *cmd;
-	struct wil_nl_60g_debug_force_wmi debug_force_wmi;
-	int rc, len;
-	u32 wil_nl_60g_cmd_type, publish;
-
-	rc = nla_parse(tb, QCA_ATTR_WIL_MAX, data, data_len,
-		       wil_nl_60g_policy, NULL);
-	if (rc) {
-		wil_err(wil, "Invalid nl_60g_cmd ATTR\n");
-		return rc;
-	}
-
-	if (!tb[WIL_ATTR_60G_CMD_TYPE]) {
-		wil_err(wil, "Invalid nl_60g_cmd type\n");
-		return -EINVAL;
-	}
-
-	wil_nl_60g_cmd_type = nla_get_u32(tb[WIL_ATTR_60G_CMD_TYPE]);
-
-	switch (wil_nl_60g_cmd_type) {
-	case NL_60G_CMD_REGISTER:
-		if (!tb[WIL_ATTR_60G_BUF]) {
-			wil_err(wil, "Invalid nl_60g_cmd spec\n");
-			return -EINVAL;
-		}
-
-		len = nla_len(tb[WIL_ATTR_60G_BUF]);
-		if (len != sizeof(publish)) {
-			wil_err(wil, "cmd buffer wrong len %d\n", len);
-			return -EINVAL;
-		}
-		memcpy(&publish, nla_data(tb[WIL_ATTR_60G_BUF]), len);
-		wil->publish_nl_evt = publish;
-
-		wil_dbg_wmi(wil, "Publish wmi event %s\n",
-			    publish ? "enabled" : "disabled");
-		break;
-	case NL_60G_CMD_DEBUG:
-		if (!tb[WIL_ATTR_60G_BUF]) {
-			wil_err(wil, "Invalid nl_60g_cmd spec\n");
-			return -EINVAL;
-		}
-
-		len = nla_len(tb[WIL_ATTR_60G_BUF]);
-		if (len < sizeof(struct wil_nl_60g_debug)) {
-			wil_err(wil, "cmd buffer too short %d\n", len);
-			return -EINVAL;
-		}
-
-		memcpy(&debug_force_wmi, nla_data(tb[WIL_ATTR_60G_BUF]),
-		       sizeof(struct wil_nl_60g_debug));
-
-		switch (debug_force_wmi.hdr.cmd_id) {
-		case NL_60G_DBG_FORCE_WMI_SEND:
-			if (len != sizeof(debug_force_wmi)) {
-				wil_err(wil, "cmd buffer wrong len %d\n", len);
-				return -EINVAL;
-			}
-
-			memcpy(&debug_force_wmi, nla_data(tb[WIL_ATTR_60G_BUF]),
-			       sizeof(debug_force_wmi));
-			wil->force_wmi_send = debug_force_wmi.enable;
-
-			wil_dbg_wmi(wil, "force sending wmi commands %d\n",
-				    wil->force_wmi_send);
-			break;
-		case NL_60G_GEN_FW_RESET:
-			if (!test_bit(WMI_FW_CAPABILITY_WMI_ONLY,
-				      wil->fw_capabilities)) {
-				rc = -EOPNOTSUPP;
-				break;
-			}
-
-			wil_dbg_misc(wil,
-				     "NL_60G_GEN_FW_RESET, resetting...\n");
-
-			mutex_lock(&wil->mutex);
-			rc = wil_reset(wil, true);
-			mutex_unlock(&wil->mutex);
-
-			break;
-
-		case NL_60G_GEN_GET_DRIVER_CAPA:
-		{
-			struct sk_buff *skb;
-			u32 capa;
-
-			skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-								  sizeof(capa));
-			if (!skb)
-				return -ENOMEM;
-
-			capa = BIT(NL_60G_DRIVER_CAPA_FW_STATE) |
-#if defined(CONFIG_WIL6210_WRITE_IOCTL)
-			       BIT(NL_60G_DRIVER_CAPA_IOCTL_WRITE) |
-#endif
-			       BIT(NL_60G_DRIVER_CAPA_WMI_OVER_NL);
-			rc = nla_put_u32(skb,
-					 QCA_WLAN_VENDOR_ATTR_DRIVER_CAPA,
-					 capa);
-			if (rc) {
-				wil_err(wil,
-					"Failed to return driver capa\n");
-				kfree_skb(skb);
-				return rc;
-			}
-			return cfg80211_vendor_cmd_reply(skb);
-		}
-		default:
-			rc = -EINVAL;
-			wil_err(wil, "invalid debug_cmd id %d",
-				debug_force_wmi.hdr.cmd_id);
-		}
-		break;
-	case NL_60G_CMD_FW_WMI:
-		if (!tb[WIL_ATTR_60G_BUF]) {
-			wil_err(wil, "Invalid nl_60g_cmd spec\n");
-			return -EINVAL;
-		}
-
-		len = nla_len(tb[WIL_ATTR_60G_BUF]);
-		if (len < offsetof(struct wil_nl_60g_send_receive_wmi, buf)) {
-			wil_err(wil, "wmi cmd buffer too small\n");
-			return -EINVAL;
-		}
-
-		cmd = kmalloc(len, GFP_KERNEL);
-		if (!cmd)
-			return -ENOMEM;
-
-		memcpy(cmd, nla_data(tb[WIL_ATTR_60G_BUF]), (unsigned int)len);
-
-		wil_dbg_wmi(wil, "sending user-space command (0x%04x) [%d]\n",
-			    cmd->cmd_id, cmd->buf_len);
-
-		if (wil->force_wmi_send)
-			rc = wmi_force_send(wil, cmd->cmd_id, cmd->dev_id,
-					    cmd->buf, cmd->buf_len);
-		else
-			rc = wmi_send(wil, cmd->cmd_id, cmd->dev_id,
-				      cmd->buf, cmd->buf_len);
-
-		kfree(cmd);
-		break;
-	default:
-		rc = -EINVAL;
-		wil_err(wil, "invalid nl_60g_cmd type %d", wil_nl_60g_cmd_type);
-	}
-
-	return rc;
-}
-
-void wil_nl_60g_receive_wmi_evt(struct wil6210_priv *wil, u8 *cmd, int len)
-{
-	struct sk_buff *vendor_event = NULL;
-	struct wil_nl_60g_event *evt;
-	struct wil_nl_60g_send_receive_wmi *wmi_buf;
-	struct wmi_cmd_hdr *wmi_hdr = (struct wmi_cmd_hdr *)cmd;
-	int data_len;
-
-	if (!wil->publish_nl_evt)
-		return;
-
-	wil_dbg_wmi(wil, "report wmi event to user-space (0x%04x) [%d]\n",
-		    le16_to_cpu(wmi_hdr->command_id), len);
-
-	data_len = len - sizeof(struct wmi_cmd_hdr);
-
-	evt = kzalloc(sizeof(*evt) + sizeof(*wmi_buf) + data_len, GFP_KERNEL);
-	if (!evt)
-		return;
-
-	evt->evt_type = NL_60G_EVT_FW_WMI;
-	evt->buf_len = sizeof(*wmi_buf) + data_len;
-
-	wmi_buf = (struct wil_nl_60g_send_receive_wmi *)evt->buf;
-
-	wmi_buf->cmd_id = le16_to_cpu(wmi_hdr->command_id);
-	wmi_buf->dev_id = wmi_hdr->mid;
-	wmi_buf->buf_len = data_len;
-	memcpy(wmi_buf->buf, cmd + sizeof(struct wmi_cmd_hdr), data_len);
-
-	vendor_event =
-		cfg80211_vendor_event_alloc(wil_to_wiphy(wil),
-					    NULL,
-					    data_len + 4 + NLMSG_HDRLEN +
-					    sizeof(*evt) + sizeof(*wmi_buf),
-					    QCA_EVENT_UNSPEC_INDEX,
-					    GFP_KERNEL);
-	if (!vendor_event)
-		goto out;
-
-	if (nla_put(vendor_event, WIL_ATTR_60G_BUF,
-		    sizeof(*evt) + sizeof(*wmi_buf) + data_len, evt)) {
-		wil_err(wil, "failed to fill WIL_ATTR_60G_BUF\n");
-		goto out;
-	}
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-
-out:
-	kfree(evt);
-}

+ 10 - 45
drivers/net/wireless/ath/wil6210/debugfs.c

@@ -99,22 +99,6 @@ static void wil_print_ring(struct seq_file *s, struct wil6210_priv *wil,
 
 		v = (ring_id % 2 ? (v >> 16) : (v & 0xffff));
 		seq_printf(s, "  hwhead = %u\n", v);
-		if (!ring->is_rx) {
-			struct wil_ring_tx_data *txdata =
-				&wil->ring_tx_data[ring_id];
-
-			seq_printf(s, "  available = %d\n",
-				   wil_ring_avail_tx(ring) -
-				   txdata->tx_reserved_count);
-			seq_printf(s, "  used = %d\n",
-				   wil_ring_used_tx(ring));
-			seq_printf(s, "\n  tx_res_count = %d\n",
-				   txdata->tx_reserved_count);
-			seq_printf(s, "  tx_res_count_used = %d\n",
-				   txdata->tx_reserved_count_used);
-			seq_printf(s, "  tx_res_count_unavail = %d\n",
-				   txdata->tx_reserved_count_not_avail);
-		}
 	}
 	seq_printf(s, "  hwtail = [0x%08x] -> ", ring->hwtail);
 	x = wmi_addr(wil, ring->hwtail);
@@ -418,7 +402,7 @@ static int wil_debugfs_iomem_x32_get(void *data, u64 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = readl_relaxed((void __iomem *)d->offset);
+	*val = readl((void __iomem *)d->offset);
 
 	wil_pm_runtime_put(wil);
 
@@ -2118,29 +2102,6 @@ static const struct file_operations fops_led_cfg = {
 	.open  = simple_open,
 };
 
-int wil_led_blink_set(struct wil6210_priv *wil, const char *buf)
-{
-	int rc;
-
-	/* "<blink_on_slow> <blink_off_slow> <blink_on_med> <blink_off_med>
-	 * <blink_on_fast> <blink_off_fast>"
-	 */
-	rc = sscanf(buf, "%u %u %u %u %u %u",
-		    &led_blink_time[WIL_LED_TIME_SLOW].on_ms,
-		    &led_blink_time[WIL_LED_TIME_SLOW].off_ms,
-		    &led_blink_time[WIL_LED_TIME_MED].on_ms,
-		    &led_blink_time[WIL_LED_TIME_MED].off_ms,
-		    &led_blink_time[WIL_LED_TIME_FAST].on_ms,
-		    &led_blink_time[WIL_LED_TIME_FAST].off_ms);
-
-	if (rc < 0)
-		return rc;
-	if (rc < 6)
-		return -EINVAL;
-
-	return 0;
-}
-
 /* led_blink_time, write:
  * "<blink_on_slow> <blink_off_slow> <blink_on_med> <blink_off_med> <blink_on_fast> <blink_off_fast>
  */
@@ -2148,7 +2109,6 @@ static ssize_t wil_write_led_blink_time(struct file *file,
 					const char __user *buf,
 					size_t len, loff_t *ppos)
 {
-	struct wil6210_priv *wil = file->private_data;
 	int rc;
 	char *kbuf = kmalloc(len + 1, GFP_KERNEL);
 
@@ -2162,11 +2122,19 @@ static ssize_t wil_write_led_blink_time(struct file *file,
 	}
 
 	kbuf[len] = '\0';
-	rc = wil_led_blink_set(wil, kbuf);
+	rc = sscanf(kbuf, "%d %d %d %d %d %d",
+		    &led_blink_time[WIL_LED_TIME_SLOW].on_ms,
+		    &led_blink_time[WIL_LED_TIME_SLOW].off_ms,
+		    &led_blink_time[WIL_LED_TIME_MED].on_ms,
+		    &led_blink_time[WIL_LED_TIME_MED].off_ms,
+		    &led_blink_time[WIL_LED_TIME_FAST].on_ms,
+		    &led_blink_time[WIL_LED_TIME_FAST].off_ms);
 	kfree(kbuf);
 
 	if (rc < 0)
 		return rc;
+	if (rc < 6)
+		return -EINVAL;
 
 	return len;
 }
@@ -2475,9 +2443,6 @@ static const struct dbg_off dbg_wil_off[] = {
 	WIL_FIELD(tx_status_ring_order, 0644,	doff_u32),
 	WIL_FIELD(rx_buff_id_count, 0644,	doff_u32),
 	WIL_FIELD(amsdu_en, 0644,	doff_u8),
-	WIL_FIELD(force_edmg_channel, 0644,	doff_u8),
-	WIL_FIELD(ap_ps, 0644, doff_u8),
-	WIL_FIELD(tx_reserved_entries, 0644, doff_u32),
 	{},
 };
 

+ 5 - 9
drivers/net/wireless/ath/wil6210/interrupt.c

@@ -33,7 +33,7 @@
 				    (~(BIT_DMA_EP_RX_ICR_RX_HTRSH)))
 #define WIL6210_IMC_TX		(BIT_DMA_EP_TX_ICR_TX_DONE | \
 				BIT_DMA_EP_TX_ICR_TX_DONE_N(0))
-#define WIL6210_IMC_TX_EDMA		(0xFFFFFFFFUL)
+#define WIL6210_IMC_TX_EDMA		BIT_TX_STATUS_IRQ
 #define WIL6210_IMC_RX_EDMA		BIT_RX_STATUS_IRQ
 #define WIL6210_IMC_MISC_NO_HALP	(ISR_MISC_FW_READY | \
 					 ISR_MISC_MBOX_EVT | \
@@ -215,7 +215,6 @@ void wil_unmask_irq(struct wil6210_priv *wil)
 void wil_configure_interrupt_moderation_edma(struct wil6210_priv *wil)
 {
 	u32 moderation;
-	int i, num_int_lines = 2 /* Rx + Tx status */;
 
 	wil_s(wil, RGF_INT_GEN_IDLE_TIME_LIMIT, WIL_EDMA_IDLE_TIME_LIMIT_USEC);
 
@@ -224,11 +223,8 @@ void wil_configure_interrupt_moderation_edma(struct wil6210_priv *wil)
 	/* Update RX and TX moderation */
 	moderation = wil->rx_max_burst_duration |
 		(WIL_EDMA_AGG_WATERMARK << WIL_EDMA_AGG_WATERMARK_POS);
-	if (wil->ipa_handle)
-		/* additional int per client, for Tx desc ring */
-		num_int_lines += max_assoc_sta;
-	for (i = 0; i < num_int_lines; i++)
-		wil_w(wil, i * 4 + RGF_INT_CTRL_INT_GEN_CFG, moderation);
+	wil_w(wil, RGF_INT_CTRL_INT_GEN_CFG_0, moderation);
+	wil_w(wil, RGF_INT_CTRL_INT_GEN_CFG_1, moderation);
 
 	/* Treat special events as regular
 	 * (set bit 0 to 0x1 and clear bits 1-8)
@@ -534,7 +530,7 @@ static bool wil_validate_mbox_regs(struct wil6210_priv *wil)
 	return true;
 }
 
-irqreturn_t wil6210_irq_misc(int irq, void *cookie)
+static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
 {
 	struct wil6210_priv *wil = cookie;
 	u32 isr;
@@ -603,7 +599,7 @@ irqreturn_t wil6210_irq_misc(int irq, void *cookie)
 	}
 }
 
-irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie)
+static irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie)
 {
 	struct wil6210_priv *wil = cookie;
 	u32 isr = wil->isr_misc;

+ 23 - 147
drivers/net/wireless/ath/wil6210/main.c

@@ -14,20 +14,17 @@
 #include "txrx_edma.h"
 #include "wmi.h"
 #include "boot_loader.h"
-#include "ipa.h"
 
 #define WAIT_FOR_HALP_VOTE_MS 100
 #define WAIT_FOR_SCAN_ABORT_MS 1000
 #define WIL_DEFAULT_NUM_RX_STATUS_RINGS 1
 #define WIL_BOARD_FILE_MAX_NAMELEN 128
-#define WIL6210_ITR_VR_RX_MAX_BURST_DURATION (5) /* usec */
-#define WIL6210_VR_TX_RING_ORDER 10
 
 bool debug_fw; /* = false; */
 module_param(debug_fw, bool, 0444);
 MODULE_PARM_DESC(debug_fw, " do not perform card reset. For FW debug");
 
-u8 oob_mode;
+static u8 oob_mode;
 module_param(oob_mode, byte, 0444);
 MODULE_PARM_DESC(oob_mode,
 		 " enable out of the box (OOB) mode in FW, for diagnostics and certification");
@@ -73,9 +70,9 @@ static const struct kernel_param_ops mtu_max_ops = {
 module_param_cb(mtu_max, &mtu_max_ops, &mtu_max, 0444);
 MODULE_PARM_DESC(mtu_max, " Max MTU value.");
 
-uint rx_ring_order;
-uint tx_ring_order = WIL_TX_RING_SIZE_ORDER_DEFAULT;
-uint bcast_ring_order = WIL_BCAST_RING_SIZE_ORDER_DEFAULT;
+static uint rx_ring_order;
+static uint tx_ring_order = WIL_TX_RING_SIZE_ORDER_DEFAULT;
+static uint bcast_ring_order = WIL_BCAST_RING_SIZE_ORDER_DEFAULT;
 
 static int ring_order_set(const char *val, const struct kernel_param *kp)
 {
@@ -106,11 +103,6 @@ MODULE_PARM_DESC(tx_ring_order, " Tx ring order; size = 1 << order");
 module_param_cb(bcast_ring_order, &ring_order_ops, &bcast_ring_order, 0444);
 MODULE_PARM_DESC(bcast_ring_order, " Bcast ring order; size = 1 << order");
 
-static u8 support_sensing_over_spi;
-module_param(support_sensing_over_spi, byte, 0444);
-MODULE_PARM_DESC(support_sensing_over_spi,
-		 " notify FW to enable SPI for sensing");
-
 enum {
 	WIL_BOOT_ERR,
 	WIL_BOOT_VANILLA,
@@ -279,7 +271,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
 			break;
 		}
 		sta->status = wil_sta_unused;
-		sta->fst_link_loss = false;
 		sta->mid = U8_MAX;
 	}
 	/* reorder buffers */
@@ -297,16 +288,11 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
 	/* crypto context */
 	memset(sta->tid_crypto_rx, 0, sizeof(sta->tid_crypto_rx));
 	memset(&sta->group_crypto_rx, 0, sizeof(sta->group_crypto_rx));
-
-	if (wil->ipa_handle)
-		wil_ipa_disconn_client(wil->ipa_handle, cid);
-
 	/* release vrings */
 	for (i = min_ring_id; i < ARRAY_SIZE(wil->ring_tx); i++) {
 		if (wil->ring2cid_tid[i][0] == cid)
 			wil_ring_fini_tx(wil, i);
 	}
-
 	/* statistics */
 	memset(&sta->stats, 0, sizeof(sta->stats));
 	sta->stats.tx_latency_min_us = U32_MAX;
@@ -537,16 +523,22 @@ bool wil_is_recovery_blocked(struct wil6210_priv *wil)
 	return no_fw_recovery && (wil->recovery_state == fw_recovery_pending);
 }
 
-void wil_fw_recovery(struct wil6210_priv *wil)
+static void wil_fw_error_worker(struct work_struct *work)
 {
+	struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
+						fw_error_worker);
 	struct net_device *ndev = wil->main_ndev;
 	struct wireless_dev *wdev;
 
-	wil_dbg_misc(wil, "fw recovery\n");
+	wil_dbg_misc(wil, "fw error worker\n");
 
+	if (!ndev || !(ndev->flags & IFF_UP)) {
+		wil_info(wil, "No recovery - interface is down\n");
+		return;
+	}
 	wdev = ndev->ieee80211_ptr;
 
-	/* increment @recovery_count if less than WIL6210_FW_RECOVERY_TO
+	/* increment @recovery_count if less then WIL6210_FW_RECOVERY_TO
 	 * passed since last recovery attempt
 	 */
 	if (time_is_after_jiffies(wil->last_fw_recovery +
@@ -589,10 +581,6 @@ void wil_fw_recovery(struct wil6210_priv *wil)
 		if (no_fw_recovery) /* upper layers do recovery */
 			break;
 		/* silent recovery, upper layers will see disconnect */
-		if (wil->ipa_handle) {
-			wil_ipa_uninit(wil->ipa_handle);
-			wil->ipa_handle = NULL;
-		}
 		__wil_down(wil);
 		__wil_up(wil);
 		mutex_unlock(&wil->mutex);
@@ -610,22 +598,6 @@ void wil_fw_recovery(struct wil6210_priv *wil)
 	rtnl_unlock();
 }
 
-static void wil_fw_error_worker(struct work_struct *work)
-{
-	struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
-						fw_error_worker);
-	struct net_device *ndev = wil->main_ndev;
-
-	wil_dbg_misc(wil, "fw error worker\n");
-
-	if (!ndev || !(ndev->flags & IFF_UP)) {
-		wil_info(wil, "No recovery - interface is down\n");
-		return;
-	}
-
-	wil_fw_recovery(wil);
-}
-
 static int wil_find_free_ring(struct wil6210_priv *wil)
 {
 	int i;
@@ -641,7 +613,7 @@ static int wil_find_free_ring(struct wil6210_priv *wil)
 int wil_ring_init_tx(struct wil6210_vif *vif, int cid)
 {
 	struct wil6210_priv *wil = vif_to_wil(vif);
-	int rc = -EINVAL, ringid, ring_size;
+	int rc = -EINVAL, ringid;
 
 	if (cid < 0) {
 		wil_err(wil, "No connection pending\n");
@@ -656,9 +628,7 @@ int wil_ring_init_tx(struct wil6210_vif *vif, int cid)
 	wil_dbg_wmi(wil, "Configure for connection CID %d MID %d ring %d\n",
 		    cid, vif->mid, ringid);
 
-	ring_size = wil->ipa_handle ?
-		WIL_IPA_DESC_RING_SIZE : 1 << tx_ring_order;
-	rc = wil->txrx_ops.ring_init_tx(vif, ringid, ring_size,
+	rc = wil->txrx_ops.ring_init_tx(vif, ringid, 1 << tx_ring_order,
 					cid, 0);
 	if (rc)
 		wil_err(wil, "init TX for CID %d MID %d vring %d failed\n",
@@ -740,8 +710,6 @@ int wil_priv_init(struct wil6210_priv *wil)
 
 	INIT_WORK(&wil->wmi_event_worker, wmi_event_worker);
 	INIT_WORK(&wil->fw_error_worker, wil_fw_error_worker);
-	INIT_WORK(&wil->pci_linkdown_recovery_worker,
-		  wil_pci_linkdown_recovery_worker);
 
 	INIT_LIST_HEAD(&wil->pending_wmi_ev);
 	spin_lock_init(&wil->wmi_ev_lock);
@@ -860,11 +828,9 @@ void wil_priv_deinit(struct wil6210_priv *wil)
 
 	wil_set_recovery_state(wil, fw_recovery_idle);
 	cancel_work_sync(&wil->fw_error_worker);
-	cancel_work_sync(&wil->pci_linkdown_recovery_worker);
 	wmi_event_flush(wil);
 	destroy_workqueue(wil->wq_service);
 	destroy_workqueue(wil->wmi_wq);
-	kfree(wil->board_file);
 	kfree(wil->brd_info);
 }
 
@@ -1309,8 +1275,6 @@ void wil_refresh_fw_capabilities(struct wil6210_priv *wil)
 	}
 
 	update_supported_bands(wil);
-
-	wil->ap_ps = test_bit(WIL_PLATFORM_CAPA_AP_PS, wil->platform_capa);
 }
 
 void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
@@ -1326,8 +1290,6 @@ void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
 void wil_get_board_file(struct wil6210_priv *wil, char *buf, size_t len)
 {
 	const char *board_file;
-	const char *ext;
-	int prefix_len;
 	const char *wil_talyn_fw_name = ftm_mode ? WIL_FW_NAME_FTM_TALYN :
 			      WIL_FW_NAME_TALYN;
 
@@ -1343,21 +1305,7 @@ void wil_get_board_file(struct wil6210_priv *wil, char *buf, size_t len)
 			board_file = WIL_BOARD_FILE_NAME;
 	}
 
-	if (wil->board_file_reg_suffix[0] == '\0') {
-		strlcpy(buf, board_file, len);
-		return;
-	}
-
-	/* use country specific board file */
-	if (len < strlen(board_file) + 1 + WIL_BRD_SUFFIX_LEN) /* 1 for '_' */
-		return;
-
-	ext = strrchr(board_file, '.');
-	prefix_len = (ext ? ext - board_file : strlen(board_file));
-	snprintf(buf, len, "%.*s_%.3s",
-		 prefix_len, board_file, wil->board_file_reg_suffix);
-	if (ext)
-		strlcat(buf, ext, len);
+	strlcpy(buf, board_file, len);
 }
 
 static int wil_get_bl_info(struct wil6210_priv *wil)
@@ -1476,14 +1424,8 @@ static int wil_get_otp_info(struct wil6210_priv *wil)
 	}
 
 	if (!is_valid_ether_addr(mac)) {
-		u8 dummy_mac[ETH_ALEN] = {
-			0x00, 0xde, 0xad, 0x12, 0x34, 0x56,
-		};
-		if (!test_bit(WMI_FW_CAPABILITY_WMI_ONLY, wil->fw_capabilities))
-			get_random_bytes(dummy_mac + 3, 3);
-		wil_err(wil, "Invalid MAC %pM, using random %pM\n", mac,
-			dummy_mac);
-		ether_addr_copy(mac, dummy_mac);
+		wil_err(wil, "Invalid MAC %pM\n", mac);
+		return -EINVAL;
 	}
 
 	ether_addr_copy(ndev->perm_addr, mac);
@@ -1570,38 +1512,6 @@ int wil_ps_update(struct wil6210_priv *wil, enum wmi_ps_profile_type ps_profile)
 	return rc;
 }
 
-int wil_vr_update_profile(struct wil6210_priv *wil, u8 profile)
-{
-	int rc;
-
-	if (profile == WMI_VR_PROFILE_DISABLED) {
-		/* Switch from VR mode to normal (non-VR) mode is not
-		 * supported at runtime - it requires FW re-loading.
-		 * It is assumed here that FW is not running when VR disable
-		 * is requested
-		 */
-		wil->ps_profile = WMI_PS_PROFILE_TYPE_DEFAULT;
-		tx_ring_order = WIL_TX_RING_SIZE_ORDER_DEFAULT;
-		drop_if_ring_full = false;
-		wil->rx_max_burst_duration =
-			WIL6210_ITR_RX_MAX_BURST_DURATION_DEFAULT;
-
-		return 0;
-	}
-
-	rc = wmi_set_vr_profile(wil, profile);
-	if (rc)
-		return rc;
-
-	/* VR default configuration */
-	wil->ps_profile = WMI_PS_PROFILE_TYPE_PS_DISABLED;
-	tx_ring_order = WIL6210_VR_TX_RING_ORDER;
-	drop_if_ring_full = true;
-	wil->rx_max_burst_duration = WIL6210_ITR_VR_RX_MAX_BURST_DURATION;
-
-	return 0;
-}
-
 static void wil_pre_fw_config(struct wil6210_priv *wil)
 {
 	wil_clear_fw_log_addr(wil);
@@ -1717,15 +1627,6 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 		wil_s(wil, RGF_USER_USAGE_8, BIT_USER_EXT_CLK);
 	}
 
-	if (support_sensing_over_spi) {
-		wil_dbg_misc(wil, "notify FW to enable SPI for sensing\n");
-		wil_s(wil, RGF_USER_USAGE_6, BIT_SPI_SENSING_SUPPORT);
-		wmi_reset_spi_slave(wil);
-	} else {
-		wil_dbg_misc(wil, "notify FW to disable SPI for sensing\n");
-		wil_c(wil, RGF_USER_USAGE_6, BIT_SPI_SENSING_SUPPORT);
-	}
-
 	if (wil->platform_ops.notify) {
 		rc = wil->platform_ops.notify(wil->platform_handle,
 					      WIL_PLATFORM_EVT_PRE_RESET);
@@ -1768,8 +1669,6 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 
 	wmi_event_flush(wil);
 
-	wil->force_wmi_send = false;
-
 	flush_workqueue(wil->wq_service);
 	flush_workqueue(wil->wmi_wq);
 
@@ -1803,17 +1702,17 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 	if (load_fw) {
 		char board_file[WIL_BOARD_FILE_MAX_NAMELEN];
 
-		board_file[0] = '\0';
-		wil_get_board_file(wil, board_file, sizeof(board_file));
-		wil_info(wil, "Use firmware <%s> + board <%s>\n",
-			 wil->wil_fw_name, board_file);
-
 		if  (wil->secured_boot) {
 			wil_err(wil, "secured boot is not supported\n");
 			up_write(&wil->mem_lock);
 			return -ENOTSUPP;
 		}
 
+		board_file[0] = '\0';
+		wil_get_board_file(wil, board_file, sizeof(board_file));
+		wil_info(wil, "Use firmware <%s> + board <%s>\n",
+			 wil->wil_fw_name, board_file);
+
 		if (!no_flash)
 			wil_bl_prepare_halt(wil);
 
@@ -1858,10 +1757,6 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 			return rc;
 		}
 
-		/* Update VR mode before configuring interrupt moderation */
-		if (wil->vr_profile != WMI_VR_PROFILE_DISABLED)
-			wil_vr_update_profile(wil, wil->vr_profile);
-
 		wil->txrx_ops.configure_interrupt_moderation(wil);
 
 		/* Enable OFU rdy valid bug fix, to prevent hang in oful34_rx
@@ -1882,24 +1777,6 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 		if (wil->ps_profile != WMI_PS_PROFILE_TYPE_DEFAULT)
 			wil_ps_update(wil, wil->ps_profile);
 
-		if (wil->tt_data_set)
-			wmi_set_tt_cfg(wil, &wil->tt_data);
-
-		if (wil->snr_thresh.enabled)
-			wmi_set_snr_thresh(wil, wil->snr_thresh.omni,
-					   wil->snr_thresh.direct);
-
-		if (wil->ftm_txrx_offset.enabled) {
-			struct wil_ftm_offsets *ftm = &wil->ftm_txrx_offset;
-
-			wmi_set_tof_tx_rx_offset(wil, ftm->tx_offset,
-						 ftm->rx_offset);
-		}
-
-		wil->tx_reserved_entries = ((drop_if_ring_full || ac_queues) ?
-					    WIL_DEFAULT_TX_RESERVED_ENTRIES :
-					    0);
-
 		if (wil->platform_ops.notify) {
 			rc = wil->platform_ops.notify(wil->platform_handle,
 						      WIL_PLATFORM_EVT_FW_RDY);
@@ -2028,7 +1905,6 @@ int __wil_down(struct wil6210_priv *wil)
 	wil_enable_irq(wil);
 
 	mutex_lock(&wil->vif_mutex);
-	wil_ftm_stop_operations(wil);
 	wil_p2p_stop_radio_operations(wil);
 	wil_abort_scan_all_vifs(wil, false);
 	mutex_unlock(&wil->vif_mutex);

+ 6 - 90
drivers/net/wireless/ath/wil6210/netdev.c

@@ -4,24 +4,10 @@
  * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
-#include <linux/moduleparam.h>
 #include <linux/etherdevice.h>
 #include <linux/rtnetlink.h>
 #include "wil6210.h"
 #include "txrx.h"
-#include "ipa.h"
-#include "config.h"
-
-#define WIL6210_TX_QUEUES (4)
-
-static bool alt_ifname; /* = false; */
-module_param(alt_ifname, bool, 0444);
-MODULE_PARM_DESC(alt_ifname, " use an alternate interface name wigigN instead of wlanN");
-
-/* enable access category for transmit packets, this parameter may be controlled
- * via wigig.ini config file, default enabled
- */
-bool ac_queues = true;
 
 bool wil_has_other_active_ifaces(struct wil6210_priv *wil,
 				 struct net_device *ndev, bool up, bool ok)
@@ -94,54 +80,12 @@ static int wil_stop(struct net_device *ndev)
 	return rc;
 }
 
-static int wil_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
-{
-	struct wil6210_priv *wil = ndev_to_wil(ndev);
-
-	return wil_ioctl(wil, ifr->ifr_data, cmd);
-}
-
-/**
- * AC to queue mapping
- *
- * AC_VO -> queue 3
- * AC_VI -> queue 2
- * AC_BE -> queue 1
- * AC_BK -> queue 0
- */
-static u16 wil_select_queue(struct net_device *ndev,
-			    struct sk_buff *skb,
-			    struct net_device *sb_dev)
-{
-	static const u16 wil_1d_to_queue[8] = {1, 0, 0, 1, 2, 2, 3, 3};
-	struct wil6210_priv *wil = ndev_to_wil(ndev);
-	u16 qid;
-
-	if (!ac_queues)
-		return 0;
-
-	/* determine the priority */
-	if (wil_is_special_packet(skb))
-		skb->priority = 7;
-	else if (skb->priority == 0 || skb->priority > 7)
-		skb->priority = cfg80211_classify8021d(skb, NULL);
-
-	qid = wil_1d_to_queue[skb->priority];
-
-	wil_dbg_txrx(wil, "select queue for priority %d -> queue %d\n",
-		     skb->priority, qid);
-
-	return qid;
-}
-
 static const struct net_device_ops wil_netdev_ops = {
 	.ndo_open		= wil_open,
 	.ndo_stop		= wil_stop,
 	.ndo_start_xmit		= wil_start_xmit,
-	.ndo_select_queue	= wil_select_queue,
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_do_ioctl		= wil_do_ioctl,
 };
 
 static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget)
@@ -229,27 +173,16 @@ static int wil6210_netdev_poll_tx_edma(struct napi_struct *napi, int budget)
 						napi_tx);
 	int tx_done;
 	/* There is only one status TX ring */
-	struct wil_status_ring *sring;
-	int sring_idx = wil->ipa_handle ?
-		wil_ipa_get_bcast_sring_id(wil) : wil->tx_sring_idx;
-
-	if (sring_idx >= WIL6210_MAX_STATUS_RINGS) {
-		napi_complete(napi);
-		return 0;
-	}
+	struct wil_status_ring *sring = &wil->srings[wil->tx_sring_idx];
 
-	sring = &wil->srings[sring_idx];
-	if (!sring->va) {
-		napi_complete(napi);
+	if (!sring->va)
 		return 0;
-	}
 
 	tx_done = wil_tx_sring_handler(wil, sring);
 
 	if (tx_done < budget) {
 		napi_complete(napi);
-		if (!wil->ipa_handle)
-			wil6210_unmask_irq_tx_edma(wil);
+		wil6210_unmask_irq_tx_edma(wil);
 		wil_dbg_txrx(wil, "NAPI TX complete\n");
 	}
 
@@ -267,7 +200,6 @@ static void wil_dev_setup(struct net_device *dev)
 
 static void wil_vif_deinit(struct wil6210_vif *vif)
 {
-	wil_ftm_deinit(vif);
 	del_timer_sync(&vif->scan_timer);
 	del_timer_sync(&vif->p2p.discovery_timer);
 	cancel_work_sync(&vif->disconnect_worker);
@@ -347,8 +279,6 @@ static void wil_vif_init(struct wil6210_vif *vif)
 
 	INIT_LIST_HEAD(&vif->probe_client_pending);
 
-	wil_ftm_init(vif);
-
 	vif->net_queue_stopped = 1;
 }
 
@@ -379,12 +309,8 @@ wil_vif_alloc(struct wil6210_priv *wil, const char *name,
 		return ERR_PTR(-EINVAL);
 	}
 
-	if (ac_queues)
-		ndev = alloc_netdev_mqs(sizeof(*vif), name, name_assign_type,
-					wil_dev_setup, WIL6210_TX_QUEUES, 1);
-	else
-		ndev = alloc_netdev(sizeof(*vif), name, name_assign_type,
-				    wil_dev_setup);
+	ndev = alloc_netdev(sizeof(*vif), name, name_assign_type,
+			    wil_dev_setup);
 	if (!ndev) {
 		dev_err(wil_to_dev(wil), "alloc_netdev failed\n");
 		return ERR_PTR(-ENOMEM);
@@ -412,9 +338,6 @@ wil_vif_alloc(struct wil6210_priv *wil, const char *name,
 	ndev->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
 			    NETIF_F_SG | NETIF_F_GRO |
 			    NETIF_F_TSO | NETIF_F_TSO6;
-	if (wil_ipa_offload())
-		ndev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_TSO |
-				       NETIF_F_TSO6);
 
 	ndev->features |= ndev->hw_features;
 	SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
@@ -427,7 +350,6 @@ void *wil_if_alloc(struct device *dev)
 	struct wil6210_priv *wil;
 	struct wil6210_vif *vif;
 	int rc = 0;
-	const char *ifname = alt_ifname ? "wigig%d" : "wlan%d";
 
 	wil = wil_cfg80211_init(dev);
 	if (IS_ERR(wil)) {
@@ -441,13 +363,9 @@ void *wil_if_alloc(struct device *dev)
 		goto out_cfg;
 	}
 
-	/* read and parse ini file */
-	wil_parse_config_ini(wil);
-	wil_wiphy_init(wil);
-
 	wil_dbg_misc(wil, "if_alloc\n");
 
-	vif = wil_vif_alloc(wil, ifname, NET_NAME_UNKNOWN,
+	vif = wil_vif_alloc(wil, "wlan%d", NET_NAME_UNKNOWN,
 			    NL80211_IFTYPE_STATION);
 	if (IS_ERR(vif)) {
 		dev_err(dev, "wil_vif_alloc failed\n");
@@ -632,8 +550,6 @@ void wil_if_remove(struct wil6210_priv *wil)
 	wil_vif_remove(wil, 0);
 	rtnl_unlock();
 
-	wil_ipa_uninit(wil->ipa_handle);
-	wil->ipa_handle = NULL;
 	netif_napi_del(&wil->napi_tx);
 	netif_napi_del(&wil->napi_rx);
 

+ 1 - 120
drivers/net/wireless/ath/wil6210/pcie_bus.c

@@ -12,9 +12,8 @@
 #include "wil6210.h"
 #include <linux/rtnetlink.h>
 #include <linux/pm_runtime.h>
-#include "ipa.h"
 
-int n_msi = 3;
+static int n_msi = 3;
 module_param(n_msi, int, 0444);
 MODULE_PARM_DESC(n_msi, " Use MSI interrupt: 0 - use INTx, 1 - single, or 3 - (default) ");
 
@@ -99,9 +98,6 @@ int wil_set_capabilities(struct wil6210_priv *wil)
 		wil->use_enhanced_dma_hw = true;
 		wil->use_rx_hw_reordering = true;
 		wil->use_compressed_rx_status = true;
-		if (wil_ipa_offload())
-			/* IPA offload must use single MSI */
-			n_msi = 1;
 		wil_fw_name = ftm_mode ? WIL_FW_NAME_FTM_TALYN :
 			      WIL_FW_NAME_TALYN;
 		if (wil_fw_verify_file_exists(wil, wil_fw_name))
@@ -222,11 +218,6 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
 
 	wil->n_msi = n_msi;
 
-	if (wil->n_msi == 0 && wil_ipa_offload()) {
-		wil_err(wil, "IPA offload cannot use INTx\n");
-		rc = -ENODEV;
-		goto stop_master;
-	}
 	if (wil->n_msi == 0 && msi_only) {
 		wil_err(wil, "Interrupt pin not routed, unable to use INTx\n");
 		rc = -ENODEV;
@@ -294,108 +285,6 @@ static int wil_platform_rop_fw_recovery(void *wil_handle)
 	return 0;
 }
 
-void wil_pci_linkdown_recovery_worker(struct work_struct *work)
-{
-	struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
-						pci_linkdown_recovery_worker);
-	int rc, i;
-	struct wil6210_vif *vif;
-	struct net_device *ndev = wil->main_ndev;
-
-	wil_dbg_misc(wil, "starting pci_linkdown recovery\n");
-
-	rtnl_lock();
-	mutex_lock(&wil->mutex);
-	down_write(&wil->mem_lock);
-	clear_bit(wil_status_fwready, wil->status);
-	set_bit(wil_status_pci_linkdown, wil->status);
-	set_bit(wil_status_resetting, wil->status);
-	up_write(&wil->mem_lock);
-
-	if (test_and_clear_bit(wil_status_napi_en, wil->status)) {
-		napi_disable(&wil->napi_rx);
-		napi_disable(&wil->napi_tx);
-	}
-
-	mutex_unlock(&wil->mutex);
-	rtnl_unlock();
-
-	mutex_lock(&wil->mutex);
-
-	mutex_lock(&wil->vif_mutex);
-	wil_ftm_stop_operations(wil);
-	wil_p2p_stop_radio_operations(wil);
-	wil_abort_scan_all_vifs(wil, false);
-	mutex_unlock(&wil->vif_mutex);
-
-	for (i = 0; i < wil->max_vifs; i++) {
-		vif = wil->vifs[i];
-		if (vif) {
-			cancel_work_sync(&vif->disconnect_worker);
-			wil6210_disconnect(vif, NULL,
-					   WLAN_REASON_DEAUTH_LEAVING);
-		}
-	}
-
-	wmi_event_flush(wil);
-	flush_workqueue(wil->wq_service);
-	flush_workqueue(wil->wmi_wq);
-
-	/* Recover PCIe */
-	if (wil->platform_ops.pci_linkdown_recovery) {
-		rc =
-		 wil->platform_ops.pci_linkdown_recovery(wil->platform_handle);
-		if (rc) {
-			wil_err(wil,
-				"platform device failed to recover from pci linkdown (%d)\n",
-				rc);
-			mutex_unlock(&wil->mutex);
-			goto out;
-		}
-	} else {
-		wil_err(wil,
-			"platform device doesn't support pci_linkdown recovery\n");
-		mutex_unlock(&wil->mutex);
-		goto out;
-	}
-
-	if (!ndev || !(ndev->flags & IFF_UP)) {
-		wil_reset(wil, false);
-		mutex_unlock(&wil->mutex);
-	} else {
-		mutex_unlock(&wil->mutex);
-		wil->recovery_state = fw_recovery_pending;
-		wil_fw_recovery(wil);
-	}
-
-out:
-	return;
-}
-
-static int wil_platform_rop_notify(void *wil_handle,
-				   enum wil_platform_notif notif)
-{
-	struct wil6210_priv *wil = wil_handle;
-
-	if (!wil)
-		return -EINVAL;
-
-	switch (notif) {
-	case WIL_PLATFORM_NOTIF_PCI_LINKDOWN:
-		wil_info(wil, "received WIL_PLATFORM_NOTIF_PCI_LINKDOWN\n");
-		clear_bit(wil_status_fwready, wil->status);
-		set_bit(wil_status_resetting, wil->status);
-		set_bit(wil_status_pci_linkdown, wil->status);
-
-		schedule_work(&wil->pci_linkdown_recovery_worker);
-		break;
-	default:
-		break;
-	}
-
-	return 0;
-}
-
 static void wil_platform_ops_uninit(struct wil6210_priv *wil)
 {
 	if (wil->platform_ops.uninit)
@@ -411,7 +300,6 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	const struct wil_platform_rops rops = {
 		.ramdump = wil_platform_rop_ramdump,
 		.fw_recovery = wil_platform_rop_fw_recovery,
-		.notify = wil_platform_rop_notify,
 	};
 	u32 bar_size = pci_resource_len(pdev, 0);
 	int dma_addr_size[] = {64, 48, 40, 32}; /* keep descending order */
@@ -551,7 +439,6 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		wil_err(wil, "register_pm_notifier failed: %d\n", rc);
 
 	wil6210_debugfs_init(wil);
-	wil6210_sysfs_init(wil);
 
 	wil_pm_runtime_allow(wil);
 
@@ -584,7 +471,6 @@ static void wil_pcie_remove(struct pci_dev *pdev)
 
 	wil_pm_runtime_forbid(wil);
 
-	wil6210_sysfs_remove(wil);
 	wil6210_debugfs_remove(wil);
 	rtnl_lock();
 	wil_p2p_wdev_free(wil);
@@ -649,11 +535,6 @@ static int wil6210_resume(struct device *dev, bool is_runtime)
 	struct wil6210_priv *wil = pci_get_drvdata(pdev);
 	bool keep_radio_on, active_ifaces;
 
-	if (test_bit(wil_status_pci_linkdown, wil->status)) {
-		wil_dbg_pm(wil, "ignore resume during pci linkdown\n");
-		return 0;
-	}
-
 	wil_dbg_pm(wil, "resume: %s\n", is_runtime ? "runtime" : "system");
 
 	mutex_lock(&wil->vif_mutex);

+ 0 - 13
drivers/net/wireless/ath/wil6210/pm.c

@@ -51,13 +51,6 @@ wil_can_suspend_vif(struct wil6210_priv *wil, struct wil6210_vif *vif,
 
 	/* for STA-like interface, don't runtime suspend */
 	case NL80211_IFTYPE_STATION:
-		if (test_bit(wil_vif_fwconnected, vif->status) &&
-		    wil->vr_profile != WMI_VR_PROFILE_DISABLED) {
-			wil_dbg_pm(wil,
-				   "Reject suspend in VR mode when connected\n");
-			return false;
-		}
-		/* fallthrough */
 	case NL80211_IFTYPE_P2P_CLIENT:
 		if (test_bit(wil_vif_fwconnecting, vif->status)) {
 			wil_dbg_pm(wil, "Delay suspend when connecting\n");
@@ -97,12 +90,6 @@ int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime)
 		goto out;
 	}
 
-	if (test_bit(wil_status_pci_linkdown, wil->status)) {
-		wil_dbg_pm(wil, "Delay suspend during pci linkdown\n");
-		rc = -EBUSY;
-		goto out;
-	}
-
 	mutex_lock(&wil->vif_mutex);
 	active_ifaces = wil_has_active_ifaces(wil, true, false);
 	mutex_unlock(&wil->vif_mutex);

+ 1 - 10
drivers/net/wireless/ath/wil6210/txrx.h

@@ -674,12 +674,6 @@ static inline void wil_skb_set_cid(struct sk_buff *skb, u8 cid)
 	skb_rx_info->rx_info.cid = cid;
 }
 
-static inline
-void wil_tx_desc_set_nr_frags(struct vring_tx_desc *d, int nr_frags)
-{
-	d->mac.d[2] |= (nr_frags << MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
-}
-
 void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev);
 void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid,
 		  struct wil_net_stats *stats, bool gro);
@@ -690,12 +684,9 @@ struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil,
 						int size, u16 ssn);
 void wil_tid_ampdu_rx_free(struct wil6210_priv *wil,
 			   struct wil_tid_ampdu_rx *r);
-void wil_tx_data_init(const struct wil6210_priv *wil,
-		      struct wil_ring_tx_data *txdata);
+void wil_tx_data_init(struct wil_ring_tx_data *txdata);
 void wil_init_txrx_ops_legacy_dma(struct wil6210_priv *wil);
 void wil_tx_latency_calc(struct wil6210_priv *wil, struct sk_buff *skb,
 			 struct wil_sta_info *sta);
-int wil_get_cid_by_ring(struct wil6210_priv *wil, struct wil_ring *ring);
-bool wil_is_special_packet(const struct sk_buff *skb);
 
 #endif /* WIL6210_TXRX_H */

+ 60 - 144
drivers/net/wireless/ath/wil6210/txrx_edma.c

@@ -14,7 +14,6 @@
 #include "txrx_edma.h"
 #include "txrx.h"
 #include "trace.h"
-#include "ipa.h"
 
 /* Max number of entries (packets to complete) to update the hwtail of tx
  * status ring. Should be power of 2
@@ -45,7 +44,7 @@ static void wil_tx_desc_unmap_edma(struct device *dev,
 	}
 }
 
-int wil_find_free_sring(struct wil6210_priv *wil)
+static int wil_find_free_sring(struct wil6210_priv *wil)
 {
 	int i;
 
@@ -57,7 +56,8 @@ int wil_find_free_sring(struct wil6210_priv *wil)
 	return -EINVAL;
 }
 
-void wil_sring_free(struct wil6210_priv *wil, struct wil_status_ring *sring)
+static void wil_sring_free(struct wil6210_priv *wil,
+			   struct wil_status_ring *sring)
 {
 	struct device *dev = wil_to_dev(wil);
 	size_t sz;
@@ -103,66 +103,50 @@ static int wil_sring_alloc(struct wil6210_priv *wil,
 	return 0;
 }
 
-static int wil_init_tx_sring(struct wil6210_priv *wil, u16 status_ring_size,
-			     size_t elem_size, u16 sring_id)
+static int wil_tx_init_edma(struct wil6210_priv *wil)
 {
-	struct wil_status_ring *sring = &wil->srings[sring_id];
+	int ring_id = wil_find_free_sring(wil);
+	struct wil_status_ring *sring;
 	int rc;
-	u8 irq_mode = WMI_RING_ADD_IRQ_MODE_ENABLE;
+	u16 status_ring_size;
 
-	wil_dbg_misc(wil, "init TX sring: size=%u, sring_id=%u\n",
-		     status_ring_size, sring_id);
+	if (wil->tx_status_ring_order < WIL_SRING_SIZE_ORDER_MIN ||
+	    wil->tx_status_ring_order > WIL_SRING_SIZE_ORDER_MAX)
+		wil->tx_status_ring_order = WIL_TX_SRING_SIZE_ORDER_DEFAULT;
+
+	status_ring_size = 1 << wil->tx_status_ring_order;
+
+	wil_dbg_misc(wil, "init TX sring: size=%u, ring_id=%u\n",
+		     status_ring_size, ring_id);
+
+	if (ring_id < 0)
+		return ring_id;
+
+	/* Allocate Tx status ring. Tx descriptor rings will be
+	 * allocated on WMI connect event
+	 */
+	sring = &wil->srings[ring_id];
 
 	sring->is_rx = false;
 	sring->size = status_ring_size;
-	sring->elem_size = elem_size;
+	sring->elem_size = sizeof(struct wil_ring_tx_status);
 	rc = wil_sring_alloc(wil, sring);
 	if (rc)
 		return rc;
 
-	/* in IPA mode, use interrupts from desc ring instead of sring */
-	if (wil->ipa_handle)
-		irq_mode = WMI_RING_ADD_IRQ_MODE_DISABLE;
-
-	rc = wil_wmi_tx_sring_cfg(wil, sring_id, irq_mode);
+	rc = wil_wmi_tx_sring_cfg(wil, ring_id);
 	if (rc)
 		goto out_free;
 
 	sring->desc_rdy_pol = 1;
+	wil->tx_sring_idx = ring_id;
 
 	return 0;
-
 out_free:
 	wil_sring_free(wil, sring);
 	return rc;
 }
 
-static int wil_tx_init_edma(struct wil6210_priv *wil)
-{
-	int sring_id = wil_find_free_sring(wil), rc;
-	u16 sring_size;
-
-	if (sring_id < 0)
-		return sring_id;
-
-	if (wil->tx_status_ring_order < WIL_SRING_SIZE_ORDER_MIN ||
-	    wil->tx_status_ring_order > WIL_SRING_SIZE_ORDER_MAX)
-		wil->tx_status_ring_order = WIL_TX_SRING_SIZE_ORDER_DEFAULT;
-
-	sring_size = wil_ipa_offload() ?
-		WIL_IPA_STATUS_RING_SIZE : 1 << wil->tx_status_ring_order;
-
-	/* Allocate Tx status ring. Tx descriptor rings will be
-	 * allocated on WMI connect event
-	 */
-	rc = wil_init_tx_sring(wil, sring_size,
-			       sizeof(struct wil_ring_tx_status), sring_id);
-	if (!rc)
-		wil->tx_sring_idx = sring_id;
-
-	return rc;
-}
-
 /* Allocate one skb for Rx descriptor RING */
 static int wil_ring_alloc_skb_edma(struct wil6210_priv *wil,
 				   struct wil_ring *ring, u32 i)
@@ -185,11 +169,10 @@ static int wil_ring_alloc_skb_edma(struct wil6210_priv *wil,
 		return -EAGAIN;
 	}
 
-	skb = dev_alloc_skb(sz + headroom_size);
+	skb = dev_alloc_skb(sz);
 	if (unlikely(!skb))
 		return -ENOMEM;
 
-	skb_reserve(skb, headroom_size);
 	skb_put(skb, sz);
 
 	/**
@@ -355,8 +338,10 @@ static int wil_init_rx_buff_arr(struct wil6210_priv *wil,
 	return 0;
 }
 
-int wil_init_rx_sring(struct wil6210_priv *wil, u16 status_ring_size,
-		      size_t elem_size, u16 ring_id)
+static int wil_init_rx_sring(struct wil6210_priv *wil,
+			     u16 status_ring_size,
+			     size_t elem_size,
+			     u16 ring_id)
 {
 	struct wil_status_ring *sring = &wil->srings[ring_id];
 	int rc;
@@ -386,8 +371,7 @@ out_free:
 }
 
 static int wil_ring_alloc_desc_ring(struct wil6210_priv *wil,
-				    struct wil_ring *ring,
-				    bool alloc_ctx)
+				    struct wil_ring *ring)
 {
 	struct device *dev = wil_to_dev(wil);
 	size_t sz = ring->size * sizeof(ring->va[0]);
@@ -398,15 +382,9 @@ static int wil_ring_alloc_desc_ring(struct wil6210_priv *wil,
 
 	ring->swhead = 0;
 	ring->swtail = 0;
-
-	if (alloc_ctx) {
-		ring->ctx = kcalloc(ring->size, sizeof(ring->ctx[0]),
-				    GFP_KERNEL);
-		if (!ring->ctx)
-			goto err;
-	} else {
-		ring->ctx = NULL;
-	}
+	ring->ctx = kcalloc(ring->size, sizeof(ring->ctx[0]), GFP_KERNEL);
+	if (!ring->ctx)
+		goto err;
 
 	ring->va = dma_alloc_coherent(dev, sz, &ring->pa, GFP_KERNEL);
 	if (!ring->va)
@@ -437,7 +415,7 @@ err:
 	return -ENOMEM;
 }
 
-void wil_ring_free_edma(struct wil6210_priv *wil, struct wil_ring *ring)
+static void wil_ring_free_edma(struct wil6210_priv *wil, struct wil_ring *ring)
 {
 	struct device *dev = wil_to_dev(wil);
 	size_t sz;
@@ -491,18 +469,6 @@ void wil_ring_free_edma(struct wil6210_priv *wil, struct wil_ring *ring)
 		ring->swtail = wil_ring_next_tail(ring);
 	}
 
-	if (wil->ipa_handle) {
-		int bcast_sring_id = wil_ipa_get_bcast_sring_id(wil);
-
-		/* when freeing bcast desc ring, free the bcast status ring */
-		if (wil->ring2cid_tid[ring_index][0] == WIL6210_MAX_CID &&
-		    bcast_sring_id < WIL6210_MAX_STATUS_RINGS) {
-			wil_sring_free(wil, &wil->srings[bcast_sring_id]);
-			wil_ipa_set_bcast_sring_id(wil,
-						   WIL6210_MAX_STATUS_RINGS);
-		}
-	}
-
 out:
 	dma_free_coherent(dev, sz, (void *)ring->va, ring->pa);
 	kfree(ring->ctx);
@@ -511,8 +477,8 @@ out:
 	ring->ctx = NULL;
 }
 
-int wil_init_rx_desc_ring(struct wil6210_priv *wil, u16 desc_ring_size,
-			  int status_ring_id)
+static int wil_init_rx_desc_ring(struct wil6210_priv *wil, u16 desc_ring_size,
+				 int status_ring_id)
 {
 	struct wil_ring *ring = &wil->ring_rx;
 	int rc;
@@ -521,7 +487,7 @@ int wil_init_rx_desc_ring(struct wil6210_priv *wil, u16 desc_ring_size,
 
 	ring->size = desc_ring_size;
 	ring->is_rx = true;
-	rc = wil_ring_alloc_desc_ring(wil, ring, true);
+	rc = wil_ring_alloc_desc_ring(wil, ring);
 	if (rc)
 		return rc;
 
@@ -642,10 +608,6 @@ static int wil_rx_init_edma(struct wil6210_priv *wil, uint desc_ring_order)
 		sizeof(struct wil_rx_status_extended);
 	int i;
 
-	if (wil->ipa_handle)
-		/* in ipa offload, this is done as part of wil_ipa_start_ap */
-		return 0;
-
 	/* In SW reorder one must use extended status messages */
 	if (wil->use_compressed_rx_status && !wil->use_rx_hw_reordering) {
 		wil_err(wil,
@@ -677,7 +639,7 @@ static int wil_rx_init_edma(struct wil6210_priv *wil, uint desc_ring_order)
 	wil_dbg_misc(wil, "rx_init: allocate %d status rings\n",
 		     wil->num_rx_status_rings);
 
-	rc = wil_wmi_cfg_def_rx_offload(wil, wil->rx_buf_len, true);
+	rc = wil_wmi_cfg_def_rx_offload(wil, wil->rx_buf_len);
 	if (rc)
 		return rc;
 
@@ -693,13 +655,11 @@ static int wil_rx_init_edma(struct wil6210_priv *wil, uint desc_ring_order)
 				       sring_id);
 		if (rc)
 			goto err_free_status;
-
-		if (i == 0)
-			wil->rx_sring_idx = sring_id;
 	}
 
 	/* Allocate descriptor ring */
-	rc = wil_init_rx_desc_ring(wil, desc_ring_size, wil->rx_sring_idx);
+	rc = wil_init_rx_desc_ring(wil, desc_ring_size,
+				   WIL_DEFAULT_RX_STATUS_RING_ID);
 	if (rc)
 		goto err_free_status;
 
@@ -740,7 +700,6 @@ static int wil_ring_init_tx_edma(struct wil6210_vif *vif, int ring_id,
 	int rc;
 	struct wil_ring *ring = &wil->ring_tx[ring_id];
 	struct wil_ring_tx_data *txdata = &wil->ring_tx_data[ring_id];
-	u8 irq_mode = WMI_RING_ADD_IRQ_MODE_DISABLE;
 
 	lockdep_assert_held(&wil->mutex);
 
@@ -748,9 +707,9 @@ static int wil_ring_init_tx_edma(struct wil6210_vif *vif, int ring_id,
 		     "init TX ring: ring_id=%u, cid=%u, tid=%u, sring_id=%u\n",
 		     ring_id, cid, tid, wil->tx_sring_idx);
 
-	wil_tx_data_init(wil, txdata);
+	wil_tx_data_init(txdata);
 	ring->size = size;
-	rc = wil_ring_alloc_desc_ring(wil, ring, true);
+	rc = wil_ring_alloc_desc_ring(wil, ring);
 	if (rc)
 		goto out;
 
@@ -759,24 +718,12 @@ static int wil_ring_init_tx_edma(struct wil6210_vif *vif, int ring_id,
 	if (!vif->privacy)
 		txdata->dot1x_open = true;
 
-	/* in IPA mode, use interrupts from desc ring instead of sring */
-	if (wil->ipa_handle)
-		irq_mode = WMI_RING_ADD_IRQ_MODE_ENABLE;
-
-	rc = wil_wmi_tx_desc_ring_add(vif, ring_id, cid, tid, wil->tx_sring_idx,
-				      irq_mode);
+	rc = wil_wmi_tx_desc_ring_add(vif, ring_id, cid, tid);
 	if (rc) {
 		wil_err(wil, "WMI_TX_DESC_RING_ADD_CMD failed\n");
 		goto out_free;
 	}
 
-	if (wil->ipa_handle) {
-		rc = wil_ipa_conn_client(wil->ipa_handle, cid, ring_id,
-					 wil->tx_sring_idx);
-		if (rc)
-			goto out_free;
-	}
-
 	if (txdata->dot1x_open && agg_wsize >= 0)
 		wil_addba_tx_request(wil, ring_id, agg_wsize);
 
@@ -955,7 +902,7 @@ again:
 		wil_err(wil, "Corrupt buff_id=%d, sring->swhead=%d\n",
 			buff_id, sring->swhead);
 		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
-			       (void *)msg, wil->use_compressed_rx_status ?
+			       msg, wil->use_compressed_rx_status ?
 			       sizeof(struct wil_rx_status_compressed) :
 			       sizeof(struct wil_rx_status_extended), false);
 
@@ -1166,8 +1113,10 @@ void wil_rx_handle_edma(struct wil6210_priv *wil, int *quota)
 	wil_rx_refill_edma(wil);
 }
 
-int wil_tx_desc_map_edma(union wil_tx_desc *desc, dma_addr_t pa, u32 len,
-			 int ring_index)
+static int wil_tx_desc_map_edma(union wil_tx_desc *desc,
+				dma_addr_t pa,
+				u32 len,
+				int ring_index)
 {
 	struct wil_tx_enhanced_desc *d =
 		(struct wil_tx_enhanced_desc *)&desc->enhanced;
@@ -1292,9 +1241,6 @@ int wil_tx_sring_handler(struct wil6210_priv *wil,
 					  (const void *)&msg, sizeof(msg),
 					  false);
 
-			if (ctx->flags & WIL_CTX_FLAG_RESERVED_USED)
-				txdata->tx_reserved_count++;
-
 			wil_tx_desc_unmap_edma(dev,
 					       (union wil_tx_desc *)d,
 					       ctx);
@@ -1460,7 +1406,7 @@ static int __wil_tx_ring_tso_edma(struct wil6210_priv *wil,
 	struct wil_ring_tx_data *txdata = &wil->ring_tx_data[ring_index];
 	int nr_frags = skb_shinfo(skb)->nr_frags;
 	int min_desc_required = nr_frags + 2; /* Headers, Head, Fragments */
-	int used, avail = wil_ring_avail_tx(ring) - txdata->tx_reserved_count;
+	int used, avail = wil_ring_avail_tx(ring);
 	int f, hdrlen, headlen;
 	int gso_type;
 	bool is_ipv4;
@@ -1600,32 +1546,18 @@ static int wil_ring_init_bcast_edma(struct wil6210_vif *vif, int ring_id,
 {
 	struct wil6210_priv *wil = vif_to_wil(vif);
 	struct wil_ring *ring = &wil->ring_tx[ring_id];
-	int rc, sring_id = wil->tx_sring_idx;
+	int rc;
 	struct wil_ring_tx_data *txdata = &wil->ring_tx_data[ring_id];
 
-	wil_dbg_misc(wil, "init bcast: ring_id=%d\n", ring_id);
+	wil_dbg_misc(wil, "init bcast: ring_id=%d, sring_id=%d\n",
+		     ring_id, wil->tx_sring_idx);
 
 	lockdep_assert_held(&wil->mutex);
 
-	if (wil->ipa_handle) {
-		/* alloc bcast status ring */
-		sring_id = wil_find_free_sring(wil);
-		if (sring_id < 0)
-			return sring_id;
-
-		rc = wil_init_tx_sring(wil, WIL_IPA_BCAST_SRING_SIZE,
-				       sizeof(struct wil_ring_tx_status),
-				       sring_id);
-		if (rc)
-			return rc;
-
-		wil_ipa_set_bcast_sring_id(wil, sring_id);
-	}
-
-	wil_tx_data_init(wil, txdata);
+	wil_tx_data_init(txdata);
 	ring->size = size;
 	ring->is_rx = false;
-	rc = wil_ring_alloc_desc_ring(wil, ring, true);
+	rc = wil_ring_alloc_desc_ring(wil, ring);
 	if (rc)
 		goto out;
 
@@ -1634,7 +1566,7 @@ static int wil_ring_init_bcast_edma(struct wil6210_vif *vif, int ring_id,
 	if (!vif->privacy)
 		txdata->dot1x_open = true;
 
-	rc = wil_wmi_bcast_desc_ring_add(vif, ring_id, sring_id);
+	rc = wil_wmi_bcast_desc_ring_add(vif, ring_id);
 	if (rc)
 		goto out_free;
 
@@ -1648,28 +1580,16 @@ static int wil_ring_init_bcast_edma(struct wil6210_vif *vif, int ring_id,
 	wil_ring_free_edma(wil, ring);
 
 out:
-	if (wil->ipa_handle) {
-		wil_sring_free(wil, &wil->srings[sring_id]);
-		wil_ipa_set_bcast_sring_id(wil, WIL6210_MAX_STATUS_RINGS);
-	}
-
 	return rc;
 }
 
 static void wil_tx_fini_edma(struct wil6210_priv *wil)
 {
-	int i;
+	struct wil_status_ring *sring = &wil->srings[wil->tx_sring_idx];
 
-	for (i = 0; i < WIL6210_MAX_STATUS_RINGS; i++) {
-		struct wil_status_ring *sring = &wil->srings[i];
-
-		if (!sring->va || sring->is_rx)
-			continue;
-
-		wil_dbg_misc(wil, "free TX sring %d\n", i);
+	wil_dbg_misc(wil, "free TX sring\n");
 
-		wil_sring_free(wil, sring);
-	}
+	wil_sring_free(wil, sring);
 }
 
 static void wil_rx_data_free(struct wil_status_ring *sring)
@@ -1686,10 +1606,6 @@ static void wil_rx_fini_edma(struct wil6210_priv *wil)
 	struct wil_ring *ring = &wil->ring_rx;
 	int i;
 
-	if (wil->ipa_handle)
-		/* in ipa offload, this is done part of wil_ipa_uninit */
-		return;
-
 	wil_dbg_misc(wil, "rx_fini_edma\n");
 
 	wil_ring_free_edma(wil, ring);

+ 1 - 9
drivers/net/wireless/ath/wil6210/txrx_edma.h

@@ -16,6 +16,7 @@
 #define WIL_TX_SRING_SIZE_ORDER_DEFAULT	(14)
 #define WIL_RX_BUFF_ARR_SIZE_DEFAULT (2600)
 
+#define WIL_DEFAULT_RX_STATUS_RING_ID 0
 #define WIL_RX_DESC_RING_ID 0
 #define WIL_RX_STATUS_IRQ_IDX 0
 #define WIL_TX_STATUS_IRQ_IDX 1
@@ -596,15 +597,6 @@ int wil_tx_sring_handler(struct wil6210_priv *wil,
 			 struct wil_status_ring *sring);
 void wil_rx_handle_edma(struct wil6210_priv *wil, int *quota);
 void wil_init_txrx_ops_edma(struct wil6210_priv *wil);
-int wil_find_free_sring(struct wil6210_priv *wil);
-int wil_init_rx_desc_ring(struct wil6210_priv *wil, u16 desc_ring_size,
-			  int status_ring_id);
-int wil_init_rx_sring(struct wil6210_priv *wil, u16 status_ring_size,
-		      size_t elem_size, u16 ring_id);
-void wil_sring_free(struct wil6210_priv *wil, struct wil_status_ring *sring);
-void wil_ring_free_edma(struct wil6210_priv *wil, struct wil_ring *ring);
-int wil_tx_desc_map_edma(union wil_tx_desc *desc, dma_addr_t pa, u32 len,
-			 int ring_index);
 
 #endif /* WIL6210_TXRX_EDMA_H */
 

+ 8 - 131
drivers/net/wireless/ath/wil6210/wil6210.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: ISC */
 /*
  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __WIL6210_H__
@@ -14,17 +14,11 @@
 #include <linux/timex.h>
 #include <linux/types.h>
 #include <linux/irqreturn.h>
-#include <net/netlink.h>
 #include "wmi.h"
 #include "wil_platform.h"
-#include "ftm.h"
 #include "fw.h"
 
 extern bool no_fw_recovery;
-extern bool country_specific_board_file;
-extern bool ignore_reg_hints;
-extern bool debug_fw;
-extern u8 oob_mode;
 extern unsigned int mtu_max;
 extern unsigned short rx_ring_overflow_thrsh;
 extern int agg_wsize;
@@ -33,15 +27,8 @@ extern bool rx_large_buf;
 extern bool debug_fw;
 extern bool disable_ap_sme;
 extern bool ftm_mode;
-extern ushort headroom_size;
 extern bool drop_if_ring_full;
-extern int n_msi;
 extern uint max_assoc_sta;
-extern bool drop_if_ring_full;
-extern bool ac_queues;
-extern uint rx_ring_order;
-extern uint tx_ring_order;
-extern uint bcast_ring_order;
 
 struct wil6210_priv;
 struct wil6210_vif;
@@ -63,8 +50,6 @@ union wil_tx_desc;
 
 #define WIL_DEFAULT_BUS_REQUEST_KBPS 128000 /* ~1Gbps */
 #define WIL_MAX_BUS_REQUEST_KBPS 800000 /* ~6.1Gbps */
-#define WIL_11AD_BUS_REQUEST_KBPS 600000 /* ~4.6Gbps */
-#define WIL_11AY_BUS_REQUEST_KBPS 1300000 /* ~10.1Gbps */
 
 #define WIL_NUM_LATENCY_BINS 200
 
@@ -73,8 +58,6 @@ union wil_tx_desc;
  */
 #define WIL_MAX_VIFS 4
 
-#define WIL_BRD_SUFFIX_LEN 4 /* max 3 letters + terminating null */
-
 /**
  * extract bits [@b0:@b1] (inclusive) from the value @x
  * it should be @b0 <= @b1, or result is incorrect
@@ -105,9 +88,7 @@ static inline u32 WIL_GET_BITS(u32 x, int b0, int b1)
 #define WIL_MAX_AMPDU_SIZE_128	(128 * 1024) /* FW/HW limit */
 #define WIL_MAX_AGG_WSIZE_64	(64) /* FW/HW limit */
 #define WIL6210_MAX_STATUS_RINGS	(8)
-#define WIL6210_MAX_HEADROOM_SIZE      (256)
 #define WIL_WMI_CALL_GENERAL_TO_MS 100
-#define WIL_DEFAULT_TX_RESERVED_ENTRIES (16)
 
 /* Hardware offload block adds the following:
  * 26 bytes - 3-address QoS data header
@@ -196,7 +177,6 @@ struct RGF_ICR {
 #define RGF_USER_USAGE_1		(0x880004)
 #define RGF_USER_USAGE_2		(0x880008)
 #define RGF_USER_USAGE_6		(0x880018)
-	#define BIT_SPI_SENSING_SUPPORT		BIT(28)
 	#define BIT_USER_OOB_MODE		BIT(31)
 	#define BIT_USER_OOB_R2_MODE		BIT(30)
 #define RGF_USER_USAGE_8		(0x880020)
@@ -352,7 +332,8 @@ struct RGF_ICR {
 
 #define RGF_INT_COUNT_ON_SPECIAL_EVT	(0x8b62d8)
 
-#define RGF_INT_CTRL_INT_GEN_CFG	(0x8bc000)
+#define RGF_INT_CTRL_INT_GEN_CFG_0	(0x8bc000)
+#define RGF_INT_CTRL_INT_GEN_CFG_1	(0x8bc004)
 #define RGF_INT_GEN_TIME_UNIT_LIMIT	(0x8bc0c8)
 
 #define RGF_INT_GEN_CTRL		(0x8bc0ec)
@@ -517,17 +498,13 @@ enum { /* for wil_ctx.mapped_as */
 	wil_mapped_as_page = 2,
 };
 
-/* for wil_ctx.flags */
-#define WIL_CTX_FLAG_RESERVED_USED 0x01
-
 /**
  * struct wil_ctx - software context for ring descriptor
  */
 struct wil_ctx {
 	struct sk_buff *skb;
 	u8 nr_frags;
-	u8 mapped_as:4;
-	u8 flags:4;
+	u8 mapped_as;
 };
 
 struct wil_desc_ring_rx_swtail { /* relevant for enhanced DMA only */
@@ -661,9 +638,6 @@ struct wil_ring_tx_data {
 	bool addba_in_progress; /* if set, agg_xxx is for request in progress */
 	u8 mid;
 	spinlock_t lock;
-	u32 tx_reserved_count; /* available reserved tx entries */
-	u32 tx_reserved_count_used;
-	u32 tx_reserved_count_not_avail;
 };
 
 enum { /* for wil6210_priv.status */
@@ -676,7 +650,6 @@ enum { /* for wil6210_priv.status */
 	wil_status_suspending, /* suspend in progress */
 	wil_status_suspended, /* suspend completed, device is suspended */
 	wil_status_resuming, /* resume in progress */
-	wil_status_pci_linkdown, /* pci linkdown occurred */
 	wil_status_last /* keep last */
 };
 
@@ -782,7 +755,6 @@ struct wil_sta_info {
 	struct wil_tid_crypto_rx tid_crypto_rx[WIL_STA_TID_NUM];
 	struct wil_tid_crypto_rx group_crypto_rx;
 	u8 aid; /* 1-254; 0 if unknown/not reported */
-	u8 fst_link_loss;
 };
 
 enum {
@@ -895,8 +867,6 @@ struct wil6210_vif {
 	struct cfg80211_scan_request *scan_request;
 	struct timer_list scan_timer; /* detect scan timeout */
 	struct wil_p2p_info p2p;
-	/* fine timing measurement */
-	struct wil_ftm_priv ftm;
 	/* keep alive */
 	struct list_head probe_client_pending;
 	struct mutex probe_client_mutex; /* protect @probe_client_pending */
@@ -946,12 +916,6 @@ struct wil_brd_info {
 	u32 file_max_size;
 };
 
-struct wil_ftm_offsets {
-	u8 enabled;
-	unsigned int tx_offset;
-	unsigned int rx_offset;
-};
-
 struct wil6210_priv {
 	struct pci_dev *pdev;
 	u32 bar_size;
@@ -966,7 +930,6 @@ struct wil6210_priv {
 	const char *hw_name;
 	const char *wil_fw_name;
 	char *board_file;
-	char board_file_reg_suffix[WIL_BRD_SUFFIX_LEN]; /* empty or CN or FCC */
 	u32 num_of_brd_entries;
 	struct wil_brd_info *brd_info;
 	DECLARE_BITMAP(hw_capa, hw_capa_last);
@@ -1028,7 +991,6 @@ struct wil6210_priv {
 	struct wil_status_ring srings[WIL6210_MAX_STATUS_RINGS];
 	u8 num_rx_status_rings;
 	int tx_sring_idx;
-	int rx_sring_idx;
 	u8 ring2cid_tid[WIL6210_MAX_TX_RINGS][2]; /* [0] - CID, [1] - TID */
 	struct wil_sta_info sta[WIL6210_MAX_CID];
 	u32 ring_idle_trsh; /* HW fetches up to 16 descriptors at once  */
@@ -1050,15 +1012,12 @@ struct wil6210_priv {
 	u8 wakeup_trigger;
 	struct wil_suspend_stats suspend_stats;
 	struct wil_debugfs_data dbg_data;
-	/* set to WIL_EDMG_DISABLE to force disable EDMG */
-	u8 force_edmg_channel;
 	bool tx_latency; /* collect TX latency measurements */
 	size_t tx_latency_res; /* bin resolution in usec */
 
 	void *platform_handle;
 	struct wil_platform_ops platform_ops;
 	bool keep_radio_on_during_sleep;
-	u8 ap_ps; /* AP mode power save enabled */
 
 	struct pmc_ctx pmc;
 
@@ -1074,21 +1033,6 @@ struct wil6210_priv {
 	enum wmi_ps_profile_type ps_profile;
 
 	int fw_calib_result;
-	u8 tt_data_set;
-	struct wmi_tt_data tt_data;
-	struct {
-		u8 enabled;
-		short omni;
-		short direct;
-	} snr_thresh;
-
-	struct wil_ftm_offsets ftm_txrx_offset;
-
-	/* VR profile, VR is disabled on profile 0 */
-	u8 vr_profile;
-
-	/* current reg domain configured in kernel */
-	char regdomain[3]; /* alpha2 */
 
 	struct notifier_block pm_notify;
 
@@ -1101,9 +1045,6 @@ struct wil6210_priv {
 	u32 rgf_ucode_assert_code_addr;
 	u32 iccm_base;
 
-	u8 publish_nl_evt; /* deliver WMI events to user space */
-	u8 force_wmi_send; /* allow WMI command while FW in sysassert */
-
 	/* relevant only for eDMA */
 	bool use_compressed_rx_status;
 	u32 rx_status_ring_order;
@@ -1120,11 +1061,6 @@ struct wil6210_priv {
 	u32 max_ampdu_size;
 	u8 multicast_to_unicast;
 	s32 cqm_rssi_thold;
-
-	struct work_struct pci_linkdown_recovery_worker;
-	void *ipa_handle;
-
-	u32 tx_reserved_entries; /* Used only in Talyn code-path */
 };
 
 #define wil_to_wiphy(i) (i->wiphy)
@@ -1264,7 +1200,6 @@ void wil_memcpy_toio_32(volatile void __iomem *dst, const void *src,
 int wil_mem_access_lock(struct wil6210_priv *wil);
 void wil_mem_access_unlock(struct wil6210_priv *wil);
 
-void wil_wiphy_init(struct wil6210_priv *wil);
 struct wil6210_vif *
 wil_vif_alloc(struct wil6210_priv *wil, const char *name,
 	      unsigned char name_assign_type, enum nl80211_iftype iftype);
@@ -1295,7 +1230,6 @@ void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r);
 int wil_find_cid(struct wil6210_priv *wil, u8 mid, const u8 *mac);
 int wil_find_cid_by_idx(struct wil6210_priv *wil, u8 mid, int idx);
 void wil_set_ethtoolops(struct net_device *ndev);
-int wil_vr_update_profile(struct wil6210_priv *wil, u8 profile);
 
 struct fw_map *wil_find_fw_mapping(const char *section);
 void __iomem *wmi_buffer_block(struct wil6210_priv *wil, __le32 ptr, u32 size);
@@ -1304,8 +1238,6 @@ void __iomem *wmi_addr(struct wil6210_priv *wil, u32 ptr);
 int wmi_read_hdr(struct wil6210_priv *wil, __le32 ptr,
 		 struct wil6210_mbox_hdr *hdr);
 int wmi_send(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len);
-int wmi_force_send(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf,
-		   u16 len);
 void wmi_recv_cmd(struct wil6210_priv *wil);
 int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len,
 	     u16 reply_id, void *reply, u16 reply_size, int to_msec);
@@ -1343,14 +1275,10 @@ int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil,
 int wmi_set_mgmt_retry(struct wil6210_priv *wil, u8 retry_short);
 int wmi_get_mgmt_retry(struct wil6210_priv *wil, u8 *retry_short);
 int wmi_new_sta(struct wil6210_vif *vif, const u8 *mac, u8 aid);
-int wmi_set_tt_cfg(struct wil6210_priv *wil, struct wmi_tt_data *tt_data);
-int wmi_get_tt_cfg(struct wil6210_priv *wil, struct wmi_tt_data *tt_data);
 int wmi_port_allocate(struct wil6210_priv *wil, u8 mid,
 		      const u8 *mac, enum nl80211_iftype iftype);
 int wmi_port_delete(struct wil6210_priv *wil, u8 mid);
 int wmi_link_stats_cfg(struct wil6210_vif *vif, u32 type, u8 cid, u32 interval);
-int wmi_set_tof_tx_rx_offset(struct wil6210_priv *wil, u32 tx_offset,
-			     u32 rx_offset);
 int wil_addba_rx_request(struct wil6210_priv *wil, u8 mid, u8 cid, u8 tid,
 			 u8 dialog_token, __le16 ba_param_set,
 			 __le16 ba_timeout, __le16 ba_seq_ctrl);
@@ -1365,8 +1293,6 @@ void wil_configure_interrupt_moderation(struct wil6210_priv *wil);
 void wil_disable_irq(struct wil6210_priv *wil);
 void wil_enable_irq(struct wil6210_priv *wil);
 void wil6210_mask_halp(struct wil6210_priv *wil);
-irqreturn_t wil6210_irq_misc(int irq, void *cookie);
-irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie);
 
 /* P2P */
 bool wil_p2p_is_social_scan(struct cfg80211_scan_request *request);
@@ -1405,19 +1331,6 @@ static inline int wil6210_debugfs_init(struct wil6210_priv *wil) { return 0; }
 static inline void wil6210_debugfs_remove(struct wil6210_priv *wil) {}
 #endif
 
-int wil6210_sysfs_init(struct wil6210_priv *wil);
-void wil6210_sysfs_remove(struct wil6210_priv *wil);
-
-int wil_board_file_set(struct wil6210_priv *wil, const char *buf,
-		       size_t count);
-int wil_snr_thresh_set(struct wil6210_priv *wil, const char *buf);
-int wil_ftm_offset_set(struct wil6210_priv *wil, const char *buf);
-int wil_tt_set(struct wil6210_priv *wil, const char *buf,
-	       size_t count);
-int wil_qos_weights_set(struct wil6210_priv *wil, const char *buf,
-			size_t count);
-int wil_led_blink_set(struct wil6210_priv *wil, const char *buf);
-
 int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid,
 		       struct station_info *sinfo);
 
@@ -1434,8 +1347,6 @@ int wmi_abort_scan(struct wil6210_vif *vif);
 void wil_abort_scan(struct wil6210_vif *vif, bool sync);
 void wil_abort_scan_all_vifs(struct wil6210_priv *wil, bool sync);
 void wil6210_bus_request(struct wil6210_priv *wil, u32 kbps);
-int wmi_aoa_meas(struct wil6210_priv *wil, const void *mac_addr, u8 chan,
-		 u8 type);
 void wil6210_disconnect(struct wil6210_vif *vif, const u8 *bssid,
 			u16 reason_code);
 void wil6210_disconnect_complete(struct wil6210_vif *vif, const u8 *bssid,
@@ -1447,9 +1358,6 @@ void wil_enable_tx_key_worker(struct work_struct *work);
 
 void wil_init_txrx_ops(struct wil6210_priv *wil);
 
-void wil_fw_recovery(struct wil6210_priv *wil);
-void wil_pci_linkdown_recovery_worker(struct work_struct *work);
-
 /* TX API */
 int wil_ring_init_tx(struct wil6210_vif *vif, int cid);
 int wil_vring_init_bcast(struct wil6210_vif *vif, int id, int size);
@@ -1478,7 +1386,6 @@ void wil_set_crypto_rx(u8 key_index, enum wmi_key_usage key_usage,
 
 int wil_iftype_nl2wmi(enum nl80211_iftype type);
 
-int wil_ioctl(struct wil6210_priv *wil, void __user *data, int cmd);
 int wil_request_firmware(struct wil6210_priv *wil, const char *name,
 			 bool load);
 int wil_request_board(struct wil6210_priv *wil, const char *name);
@@ -1505,31 +1412,6 @@ void wil_halp_unvote(struct wil6210_priv *wil);
 void wil6210_set_halp(struct wil6210_priv *wil);
 void wil6210_clear_halp(struct wil6210_priv *wil);
 
-int wmi_set_vr_profile(struct wil6210_priv *wil, u8 profile);
-const char *
-wil_get_vr_profile_name(enum wmi_vr_profile profile);
-
-void wil_ftm_init(struct wil6210_vif *vif);
-void wil_ftm_deinit(struct wil6210_vif *vif);
-void wil_ftm_stop_operations(struct wil6210_priv *wil);
-void wil_aoa_cfg80211_meas_result(struct wil6210_vif *vif,
-				  struct wil_aoa_meas_result *result);
-
-void wil_ftm_evt_session_ended(struct wil6210_vif *vif,
-			       struct wmi_tof_session_end_event *evt);
-void wil_ftm_evt_per_dest_res(struct wil6210_vif *vif,
-			      struct wmi_tof_ftm_per_dest_res_event *evt);
-void wil_aoa_evt_meas(struct wil6210_vif *vif,
-		      struct wmi_aoa_meas_event *evt,
-		      int len);
-void wil_nl_60g_receive_wmi_evt(struct wil6210_priv *wil, u8 *cmd, int len);
-/* link loss */
-int wmi_link_maintain_cfg_write(struct wil6210_priv *wil,
-				const u8 *addr,
-				bool fst_link_loss);
-
-int wmi_set_snr_thresh(struct wil6210_priv *wil, short omni, short direct);
-
 int wmi_start_sched_scan(struct wil6210_priv *wil,
 			 struct cfg80211_sched_scan_request *request);
 int wmi_stop_sched_scan(struct wil6210_priv *wil);
@@ -1542,27 +1424,22 @@ int wil_wmi2spec_ch(u8 wmi_ch, u8 *spec_ch);
 int wil_spec2wmi_ch(u8 spec_ch, u8 *wmi_ch);
 void wil_update_supported_bands(struct wil6210_priv *wil);
 
-int wil_wmi2spec_ch(u8 wmi_ch, u8 *spec_ch);
-int wil_spec2wmi_ch(u8 spec_ch, u8 *wmi_ch);
-
 int reverse_memcmp(const void *cs, const void *ct, size_t count);
 
 /* WMI for enhanced DMA */
-int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id, u8 irq_mode);
+int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id);
 int wil_wmi_cfg_def_rx_offload(struct wil6210_priv *wil,
-			       u16 max_rx_pl_per_desc, bool checksum);
+			       u16 max_rx_pl_per_desc);
 int wil_wmi_rx_sring_add(struct wil6210_priv *wil, u16 ring_id);
 int wil_wmi_rx_desc_ring_add(struct wil6210_priv *wil, int status_ring_id);
 int wil_wmi_tx_desc_ring_add(struct wil6210_vif *vif, int ring_id, int cid,
-			     int tid, int sring_id, u8 irq_mode);
-int wil_wmi_bcast_desc_ring_add(struct wil6210_vif *vif, int ring_id,
-				int sring_id);
+			     int tid);
+int wil_wmi_bcast_desc_ring_add(struct wil6210_vif *vif, int ring_id);
 int wmi_addba_rx_resp_edma(struct wil6210_priv *wil, u8 mid, u8 cid,
 			   u8 tid, u8 token, u16 status, bool amsdu,
 			   u16 agg_wsize, u16 timeout);
 
 void update_supported_bands(struct wil6210_priv *wil);
-int wmi_reset_spi_slave(struct wil6210_priv *wil);
 
 void wil_clear_fw_log_addr(struct wil6210_priv *wil);
 int wmi_set_cqm_rssi_config(struct wil6210_priv *wil,

+ 3 - 6
drivers/net/wireless/ath/wil6210/wil_platform.c

@@ -1,21 +1,18 @@
 // SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2014-2016 Qualcomm Atheros, Inc.
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/device.h>
 #include "wil_platform.h"
-#include "msm_11ad.h"
 
 int __init wil_platform_modinit(void)
 {
-	return msm_11ad_modinit();
+	return 0;
 }
 
 void wil_platform_modexit(void)
 {
-	msm_11ad_modexit();
 }
 
 /* wil_platform_init() - wil6210 platform module init
@@ -27,7 +24,7 @@ void wil_platform_modexit(void)
 void *wil_platform_init(struct device *dev, struct wil_platform_ops *ops,
 			const struct wil_platform_rops *rops, void *wil_handle)
 {
-	void *handle;
+	void *handle = ops; /* to return some non-NULL for 'void' impl. */
 
 	if (!ops) {
 		dev_err(dev,
@@ -35,7 +32,7 @@ void *wil_platform_init(struct device *dev, struct wil_platform_ops *ops,
 		return NULL;
 	}
 
-	handle = msm_11ad_dev_init(dev, ops, rops, wil_handle);
+	/* platform specific init functions should be called here */
 
 	return handle;
 }

+ 0 - 11
drivers/net/wireless/ath/wil6210/wil_platform.h

@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: ISC */
 /*
  * Copyright (c) 2014-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __WIL_PLATFORM_H__
@@ -17,10 +16,6 @@ enum wil_platform_event {
 	WIL_PLATFORM_EVT_POST_SUSPEND = 4,
 };
 
-enum wil_platform_notif {
-	WIL_PLATFORM_NOTIF_PCI_LINKDOWN = 0,
-};
-
 enum wil_platform_features {
 	WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL = 0,
 	WIL_PLATFORM_FEATURE_TRIPLE_MSI = 1,
@@ -31,8 +26,6 @@ enum wil_platform_capa {
 	WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND = 0,
 	WIL_PLATFORM_CAPA_T_PWR_ON_0 = 1,
 	WIL_PLATFORM_CAPA_EXT_CLK = 2,
-	WIL_PLATFORM_CAPA_SMMU = 3,
-	WIL_PLATFORM_CAPA_AP_PS = 4,
 	WIL_PLATFORM_CAPA_MAX,
 };
 
@@ -48,7 +41,6 @@ struct wil_platform_ops {
 	int (*notify)(void *handle, enum wil_platform_event evt);
 	int (*get_capa)(void *handle);
 	void (*set_features)(void *handle, int features);
-	int (*pci_linkdown_recovery)(void *handle);
 };
 
 /**
@@ -60,13 +52,10 @@ struct wil_platform_ops {
  * @fw_recovery: start a firmware recovery process. Called as
  *      part of a crash recovery process which may include other
  *      related platform subsystems.
- * @notify: get notifications from the Platform driver, such as
- *      pci linkdown
  */
 struct wil_platform_rops {
 	int (*ramdump)(void *wil_handle, void *buf, uint32_t size);
 	int (*fw_recovery)(void *wil_handle);
-	int (*notify)(void *wil_handle, enum wil_platform_notif notif);
 };
 
 /**

+ 44 - 404
drivers/net/wireless/ath/wil6210/wmi.c

@@ -12,8 +12,6 @@
 #include "txrx.h"
 #include "wmi.h"
 #include "trace.h"
-#include "ftm.h"
-#include "ipa.h"
 
 /* set the default max assoc sta to max supported by driver */
 uint max_assoc_sta = WIL6210_MAX_CID;
@@ -32,7 +30,6 @@ MODULE_PARM_DESC(led_id,
 
 #define WIL_WAIT_FOR_SUSPEND_RESUME_COMP 200
 #define WIL_WMI_PCP_STOP_TO_MS 5000
-#define WIL_WMI_SPI_SLAVE_RESET_TO_MS 500
 
 /**
  * DOC: WMI event receiving - theory of operations
@@ -476,10 +473,6 @@ static const char *cmdid2name(u16 cmdid)
 		return "WMI_TEMP_SENSE_ALL_CMDID";
 	case WMI_SET_LINK_MONITOR_CMDID:
 		return "WMI_SET_LINK_MONITOR_CMD";
-	case WMI_SET_VR_PROFILE_CMDID:
-		return "WMI_SET_VR_PROFILE_CMD";
-	case WMI_RESET_SPI_SLAVE_CMDID:
-		return "WMI_RESET_SPI_SLAVE_CMD";
 	default:
 		return "Untracked CMD";
 	}
@@ -632,17 +625,13 @@ static const char *eventid2name(u16 eventid)
 		return "WMI_SET_LINK_MONITOR_EVENT";
 	case WMI_LINK_MONITOR_EVENTID:
 		return "WMI_LINK_MONITOR_EVENT";
-	case WMI_SET_VR_PROFILE_EVENTID:
-		return "WMI_SET_VR_PROFILE_EVENT";
-	case WMI_RESET_SPI_SLAVE_EVENTID:
-		return "WMI_RESET_SPI_SLAVE_EVENT";
 	default:
 		return "Untracked EVENT";
 	}
 }
 
 static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, u8 mid,
-		      void *buf, u16 len, bool force_send)
+		      void *buf, u16 len)
 {
 	struct {
 		struct wil6210_mbox_hdr hdr;
@@ -674,7 +663,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, u8 mid,
 
 	might_sleep();
 
-	if (!test_bit(wil_status_fwready, wil->status) && !force_send) {
+	if (!test_bit(wil_status_fwready, wil->status)) {
 		wil_err(wil, "WMI: cannot send command while FW not ready\n");
 		return -EAGAIN;
 	}
@@ -713,7 +702,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, u8 mid,
 	wil_dbg_wmi(wil, "Head 0x%08x -> 0x%08x\n", r->head, next_head);
 	/* wait till FW finish with previous command */
 	for (retry = 5; retry > 0; retry--) {
-		if (!test_bit(wil_status_fwready, wil->status) && !force_send) {
+		if (!test_bit(wil_status_fwready, wil->status)) {
 			wil_err(wil, "WMI: cannot send command while FW not ready\n");
 			rc = -EAGAIN;
 			goto out;
@@ -768,19 +757,7 @@ int wmi_send(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len)
 	int rc;
 
 	mutex_lock(&wil->wmi_mutex);
-	rc = __wmi_send(wil, cmdid, mid, buf, len, false);
-	mutex_unlock(&wil->wmi_mutex);
-
-	return rc;
-}
-
-int wmi_force_send(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf,
-		   u16 len)
-{
-	int rc;
-
-	mutex_lock(&wil->wmi_mutex);
-	rc = __wmi_send(wil, cmdid, mid, buf, len, true);
+	rc = __wmi_send(wil, cmdid, mid, buf, len);
 	mutex_unlock(&wil->wmi_mutex);
 
 	return rc;
@@ -849,7 +826,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
 	s32 signal;
 	__le16 fc;
 	u32 d_len;
-	s16 snr;
+	u16 d_status;
 
 	if (flen < 0) {
 		wil_err(wil, "MGMT Rx: short event, len %d\n", len);
@@ -871,13 +848,13 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
 		signal = 100 * data->info.rssi;
 	else
 		signal = data->info.sqi;
-	snr = le16_to_cpu(data->info.snr); /* 1/4 dB units */
+	d_status = le16_to_cpu(data->info.status);
 	fc = rx_mgmt_frame->frame_control;
 
 	wil_dbg_wmi(wil, "MGMT Rx: channel %d MCS %d RSSI %d SQI %d%%\n",
 		    data->info.channel, data->info.mcs, data->info.rssi,
 		    data->info.sqi);
-	wil_dbg_wmi(wil, "snr %ddB len %d fc 0x%04x\n", snr / 4, d_len,
+	wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len,
 		    le16_to_cpu(fc));
 	wil_dbg_wmi(wil, "qid %d mid %d cid %d\n",
 		    data->info.qid, data->info.mid, data->info.cid);
@@ -911,11 +888,6 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
 
 		wil_dbg_wmi(wil, "Capability info : 0x%04x\n", cap);
 
-		if (wil->snr_thresh.enabled && snr < wil->snr_thresh.omni) {
-			wil_dbg_wmi(wil, "snr below threshold. dropping\n");
-			return;
-		}
-
 		bss = cfg80211_inform_bss_frame_data(wiphy, &bss_data,
 						     rx_mgmt_frame,
 						     d_len, GFP_KERNEL);
@@ -985,7 +957,6 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
 	struct wireless_dev *wdev = vif_to_wdev(vif);
 	struct wmi_connect_event *evt = d;
 	int ch; /* channel number */
-	u8 spec_ch = 0; /* spec channel number */
 	struct station_info *sinfo;
 	u8 *assoc_req_ie, *assoc_resp_ie;
 	size_t assoc_req_ielen, assoc_resp_ielen;
@@ -1013,16 +984,8 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
 	}
 
 	ch = evt->channel + 1;
-	if (evt->edmg_channel &&
-	    test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
-		wil_wmi2spec_ch(evt->edmg_channel, &spec_ch);
-	if (spec_ch)
-		wil_info(wil, "Connect %pM EDMG channel [%d] primary channel [%d] cid %d aid %d\n",
-			 evt->bssid, spec_ch, ch, evt->cid, evt->aid);
-	else
-		wil_info(wil, "Connect %pM channel [%d] cid %d aid %d\n",
-			 evt->bssid, ch, evt->cid, evt->aid);
-
+	wil_info(wil, "Connect %pM channel [%d] cid %d aid %d\n",
+		 evt->bssid, ch, evt->cid, evt->aid);
 	wil_hex_dump_wmi("connect AI : ", DUMP_PREFIX_OFFSET, 16, 1,
 			 evt->assoc_info, len - sizeof(*evt), true);
 
@@ -1070,24 +1033,6 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
 			mutex_unlock(&wil->mutex);
 			return;
 		}
-
-		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
-		if (!sinfo) {
-			wmi_disconnect_sta(vif, wil->sta[evt->cid].addr,
-					   WLAN_REASON_UNSPECIFIED, false);
-			rc = -ENOMEM;
-			goto out;
-		}
-
-		sinfo->generation = wil->sinfo_gen++;
-
-		if (assoc_req_ie) {
-			sinfo->assoc_req_ies = assoc_req_ie;
-			sinfo->assoc_req_ies_len = assoc_req_ielen;
-		}
-
-		cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL);
-		kfree(sinfo);
 	}
 
 	ether_addr_copy(wil->sta[evt->cid].addr, evt->bssid);
@@ -1130,10 +1075,28 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
 		   (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
 
 		if (rc) {
-			/* notify new_sta has failed */
-			cfg80211_del_sta(ndev, evt->bssid, GFP_KERNEL);
+			if (disable_ap_sme)
+				/* notify new_sta has failed */
+				cfg80211_del_sta(ndev, evt->bssid, GFP_KERNEL);
+			goto out;
+		}
+
+		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
+		if (!sinfo) {
+			rc = -ENOMEM;
 			goto out;
 		}
+
+		sinfo->generation = wil->sinfo_gen++;
+
+		if (assoc_req_ie) {
+			sinfo->assoc_req_ies = assoc_req_ie;
+			sinfo->assoc_req_ies_len = assoc_req_ielen;
+		}
+
+		cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL);
+
+		kfree(sinfo);
 	} else {
 		wil_err(wil, "unhandled iftype %d for CID %d\n", wdev->iftype,
 			evt->cid);
@@ -1409,29 +1372,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
 	spin_unlock_bh(&sta->tid_rx_lock);
 }
 
-static void wmi_evt_aoa_meas(struct wil6210_vif *vif, int id, void *d, int len)
-{
-	struct wmi_aoa_meas_event *evt = d;
-
-	wil_aoa_evt_meas(vif, evt, len);
-}
-
-static void wmi_evt_ftm_session_ended(struct wil6210_vif *vif, int id,
-				      void *d, int len)
-{
-	struct wmi_tof_session_end_event *evt = d;
-
-	wil_ftm_evt_session_ended(vif, evt);
-}
-
-static void wmi_evt_per_dest_res(struct wil6210_vif *vif, int id,
-				 void *d, int len)
-{
-	struct wmi_tof_ftm_per_dest_res_event *evt = d;
-
-	wil_ftm_evt_per_dest_res(vif, evt);
-}
-
 static void
 wmi_evt_sched_scan_result(struct wil6210_vif *vif, int id, void *d, int len)
 {
@@ -1950,13 +1890,6 @@ static const struct {
 	{WMI_DELBA_EVENTID,		wmi_evt_delba},
 	{WMI_RING_EN_EVENTID,		wmi_evt_ring_en},
 	{WMI_DATA_PORT_OPEN_EVENTID,		wmi_evt_ignore},
-	{WMI_AOA_MEAS_EVENTID,			wmi_evt_aoa_meas},
-	{WMI_TOF_SESSION_END_EVENTID,		wmi_evt_ftm_session_ended},
-	{WMI_TOF_GET_CAPABILITIES_EVENTID,	wmi_evt_ignore},
-	{WMI_TOF_SET_LCR_EVENTID,		wmi_evt_ignore},
-	{WMI_TOF_SET_LCI_EVENTID,		wmi_evt_ignore},
-	{WMI_TOF_FTM_PER_DEST_RES_EVENTID,	wmi_evt_per_dest_res},
-	{WMI_TOF_CHANNEL_INFO_EVENTID,		wmi_evt_ignore},
 	{WMI_SCHED_SCAN_RESULT_EVENTID,		wmi_evt_sched_scan_result},
 	{WMI_LINK_STATS_EVENTID,		wmi_evt_link_stats},
 	{WMI_FT_AUTH_STATUS_EVENTID,		wmi_evt_auth_status},
@@ -2045,7 +1978,6 @@ void wmi_recv_cmd(struct wil6210_priv *wil)
 			u16 id = le16_to_cpu(wmi->command_id);
 			u8 mid = wmi->mid;
 			u32 tstamp = le32_to_cpu(wmi->fw_timestamp);
-			wil_nl_60g_receive_wmi_evt(wil, cmd, len);
 			if (test_bit(wil_status_resuming, wil->status)) {
 				if (id == WMI_TRAFFIC_RESUME_EVENTID)
 					clear_bit(wil_status_resuming,
@@ -2105,9 +2037,8 @@ void wmi_recv_cmd(struct wil6210_priv *wil)
 		    n - num_immed_reply, num_immed_reply);
 }
 
-static int __wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf,
-		      u16 len, u16 reply_id, void *reply, u16 reply_size,
-		      int to_msec, bool force_send)
+int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len,
+	     u16 reply_id, void *reply, u16 reply_size, int to_msec)
 {
 	int rc;
 	unsigned long remain;
@@ -2123,7 +2054,7 @@ static int __wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf,
 	reinit_completion(&wil->wmi_call);
 	spin_unlock_irqrestore(&wil->wmi_ev_lock, flags);
 
-	rc = __wmi_send(wil, cmdid, mid, buf, len, force_send);
+	rc = __wmi_send(wil, cmdid, mid, buf, len);
 	if (rc)
 		goto out;
 
@@ -2153,13 +2084,6 @@ out:
 	return rc;
 }
 
-int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len,
-	     u16 reply_id, void *reply, u16 reply_size, int to_msec)
-{
-	return __wmi_call(wil, cmdid, mid, buf, len, reply_id, reply,
-			  reply_size, to_msec, false);
-}
-
 int wmi_echo(struct wil6210_priv *wil)
 {
 	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
@@ -2300,16 +2224,6 @@ int wmi_pcp_start(struct wil6210_vif *vif, int bi, u8 wmi_nettype,
 		.evt = {.status = WMI_FW_STATUS_FAILURE},
 	};
 
-	if (test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
-		if (wil->force_edmg_channel) {
-			rc = wil_spec2wmi_ch(wil->force_edmg_channel,
-					     &cmd.edmg_channel);
-			if (rc)
-				wil_err(wil,
-					"wmi channel for channel %d not found",
-					wil->force_edmg_channel);
-		}
-
 	if (!vif->privacy)
 		cmd.disable_sec = 1;
 
@@ -2320,9 +2234,6 @@ int wmi_pcp_start(struct wil6210_vif *vif, int bi, u8 wmi_nettype,
 		return -EOPNOTSUPP;
 	}
 
-	if (wil->ipa_handle && cmd.pcp_max_assoc_sta > WIL_IPA_MAX_ASSOC_STA)
-		cmd.pcp_max_assoc_sta = WIL_IPA_MAX_ASSOC_STA;
-
 	if (disable_ap_sme &&
 	    !test_bit(WMI_FW_CAPABILITY_AP_SME_OFFLOAD_PARTIAL,
 		      wil->fw_capabilities)) {
@@ -2993,8 +2904,8 @@ int wmi_addba_rx_resp_edma(struct wil6210_priv *wil, u8 mid, u8 cid, u8 tid,
 		.ba_param_set = cpu_to_le16((amsdu ? 1 : 0) | (tid << 2) |
 					    (agg_wsize << 6)),
 		.ba_timeout = cpu_to_le16(timeout),
-		/* route all the connections to same Rx status ring */
-		.status_ring_id = wil->rx_sring_idx,
+		/* route all the connections to status ring 0 */
+		.status_ring_id = WIL_DEFAULT_RX_STATUS_RING_ID,
 	};
 	struct {
 		struct wmi_cmd_hdr wmi;
@@ -3006,7 +2917,7 @@ int wmi_addba_rx_resp_edma(struct wil6210_priv *wil, u8 mid, u8 cid, u8 tid,
 	wil_dbg_wmi(wil,
 		    "ADDBA response for CID %d TID %d size %d timeout %d status %d AMSDU%s, sring_id %d\n",
 		    cid, tid, agg_wsize, timeout, status, amsdu ? "+" : "-",
-		    cmd.status_ring_id);
+		    WIL_DEFAULT_RX_STATUS_RING_ID);
 
 	rc = wmi_call(wil, WMI_RCP_ADDBA_RESP_EDMA_CMDID, mid, &cmd,
 		      sizeof(cmd), WMI_RCP_ADDBA_RESP_SENT_EVENTID, &reply,
@@ -3154,101 +3065,6 @@ int wmi_new_sta(struct wil6210_vif *vif, const u8 *mac, u8 aid)
 	return rc;
 }
 
-int wmi_set_tt_cfg(struct wil6210_priv *wil, struct wmi_tt_data *tt_data)
-{
-	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
-	int rc;
-	struct wmi_set_thermal_throttling_cfg_cmd cmd = {
-		.tt_data = *tt_data,
-	};
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_set_thermal_throttling_cfg_event evt;
-	} __packed reply;
-
-	if (!test_bit(WMI_FW_CAPABILITY_THERMAL_THROTTLING,
-		      wil->fw_capabilities))
-		return -EOPNOTSUPP;
-
-	memset(&reply, 0, sizeof(reply));
-
-	rc = wmi_call(wil, WMI_SET_THERMAL_THROTTLING_CFG_CMDID, vif->mid,
-		      &cmd, sizeof(cmd),
-		      WMI_SET_THERMAL_THROTTLING_CFG_EVENTID,
-		      &reply, sizeof(reply), 100);
-	if (rc) {
-		wil_err(wil, "failed to set thermal throttling\n");
-		return rc;
-	}
-	if (reply.evt.status) {
-		wil_err(wil, "set thermal throttling failed, error %d\n",
-			reply.evt.status);
-		return -EIO;
-	}
-
-	return 0;
-}
-
-int wmi_get_tt_cfg(struct wil6210_priv *wil, struct wmi_tt_data *tt_data)
-{
-	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
-	int rc;
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_get_thermal_throttling_cfg_event evt;
-	} __packed reply;
-
-	if (!test_bit(WMI_FW_CAPABILITY_THERMAL_THROTTLING,
-		      wil->fw_capabilities))
-		return -EOPNOTSUPP;
-
-	rc = wmi_call(wil, WMI_GET_THERMAL_THROTTLING_CFG_CMDID, vif->mid,
-		      NULL, 0, WMI_GET_THERMAL_THROTTLING_CFG_EVENTID, &reply,
-		      sizeof(reply), 100);
-	if (rc) {
-		wil_err(wil, "failed to get thermal throttling\n");
-		return rc;
-	}
-
-	if (tt_data)
-		*tt_data = reply.evt.tt_data;
-
-	return 0;
-}
-
-int wmi_set_tof_tx_rx_offset(struct wil6210_priv *wil, u32 tx_offset,
-			     u32 rx_offset)
-{
-	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
-	struct wmi_tof_set_tx_rx_offset_cmd cmd;
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_tof_set_tx_rx_offset_event evt;
-	} __packed reply = {
-		.evt = {.status = WMI_FW_STATUS_FAILURE},
-	};
-	int rc;
-
-	if (!test_bit(WMI_FW_CAPABILITY_FTM, wil->fw_capabilities))
-		return -EOPNOTSUPP;
-
-	memset(&cmd, 0, sizeof(cmd));
-	cmd.tx_offset = cpu_to_le32(tx_offset);
-	cmd.rx_offset = cpu_to_le32(rx_offset);
-	rc = wmi_call(wil, WMI_TOF_SET_TX_RX_OFFSET_CMDID, vif->mid,
-		      &cmd, sizeof(cmd), WMI_TOF_SET_TX_RX_OFFSET_EVENTID,
-		      &reply, sizeof(reply), 100);
-	if (rc < 0)
-		return rc;
-	if (reply.evt.status) {
-		wil_err(wil, "set_tof_tx_rx_offset failed, error %d\n",
-			reply.evt.status);
-		return -EIO;
-	}
-
-	return 0;
-}
-
 void wmi_event_flush(struct wil6210_priv *wil)
 {
 	ulong flags;
@@ -3397,65 +3213,6 @@ int wmi_resume(struct wil6210_priv *wil)
 	return reply.evt.status;
 }
 
-int wmi_link_maintain_cfg_write(struct wil6210_priv *wil,
-				const u8 *addr,
-				bool fst_link_loss)
-{
-	struct net_device *ndev = wil->main_ndev;
-	struct wireless_dev *wdev = ndev->ieee80211_ptr;
-	struct wil6210_vif *vif = ndev_to_vif(ndev);
-	int rc;
-	int cid = wil_find_cid(wil, vif->mid, addr);
-	u32 cfg_type;
-	struct wmi_link_maintain_cfg_write_cmd cmd;
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_link_maintain_cfg_write_done_event evt;
-	} __packed reply;
-
-	if (cid < 0)
-		return cid;
-
-	switch (wdev->iftype) {
-	case NL80211_IFTYPE_STATION:
-		cfg_type = fst_link_loss ?
-			   WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA :
-			   WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA;
-		break;
-	case NL80211_IFTYPE_AP:
-		cfg_type = fst_link_loss ?
-			   WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP :
-			   WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP;
-		break;
-	default:
-		wil_err(wil, "Unsupported for iftype %d", wdev->iftype);
-		return -EINVAL;
-	}
-
-	wil_dbg_misc(wil, "Setting cid:%d with cfg_type:%d\n", cid, cfg_type);
-
-	cmd.cfg_type = cpu_to_le32(cfg_type);
-	cmd.cid = cpu_to_le32(cid);
-
-	reply.evt.status = cpu_to_le32(WMI_FW_STATUS_FAILURE);
-
-	rc = wmi_call(wil, WMI_LINK_MAINTAIN_CFG_WRITE_CMDID, vif->mid,
-		      &cmd, sizeof(cmd),
-		      WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID, &reply,
-		      sizeof(reply), 250);
-	if (rc) {
-		wil_err(wil, "Failed to %s FST link loss",
-			fst_link_loss ? "enable" : "disable");
-	} else if (reply.evt.status == WMI_FW_STATUS_SUCCESS) {
-		wil->sta[cid].fst_link_loss = fst_link_loss;
-	} else {
-		wil_err(wil, "WMI_LINK_MAINTAIN_CFG_WRITE_CMDID returned status %d",
-			reply.evt.status);
-		rc = -EINVAL;
-	}
-	return rc;
-}
-
 int wmi_port_allocate(struct wil6210_priv *wil, u8 mid,
 		      const u8 *mac, enum nl80211_iftype iftype)
 {
@@ -3696,37 +3453,6 @@ out:
 	return rc;
 }
 
-int wmi_set_snr_thresh(struct wil6210_priv *wil, short omni, short direct)
-{
-	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
-	int rc;
-	struct wmi_set_connect_snr_thr_cmd cmd = {
-		.enable = true,
-		.omni_snr_thr = cpu_to_le16(omni),
-		.direct_snr_thr = cpu_to_le16(direct),
-	};
-
-	if (!test_bit(WMI_FW_CAPABILITY_CONNECT_SNR_THR, wil->fw_capabilities))
-		return -ENOTSUPP;
-
-	if (omni == 0 && direct == 0)
-		cmd.enable = false;
-
-	wil_dbg_wmi(wil, "%s snr thresh omni=%d, direct=%d (1/4 dB units)\n",
-		    cmd.enable ? "enable" : "disable", omni, direct);
-
-	rc = wmi_send(wil, WMI_SET_CONNECT_SNR_THR_CMDID, vif->mid,
-		      &cmd, sizeof(cmd));
-	if (rc)
-		return rc;
-
-	wil->snr_thresh.enabled = cmd.enable;
-	wil->snr_thresh.omni = omni;
-	wil->snr_thresh.direct = direct;
-
-	return 0;
-}
-
 static void
 wmi_sched_scan_set_ssids(struct wil6210_priv *wil,
 			 struct wmi_start_sched_scan_cmd *cmd,
@@ -3988,7 +3714,7 @@ int wmi_mgmt_tx_ext(struct wil6210_vif *vif, const u8 *buf, size_t len,
 	return rc;
 }
 
-int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id, u8 irq_mode)
+int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id)
 {
 	int rc;
 	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
@@ -3997,8 +3723,7 @@ int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id, u8 irq_mode)
 		.ring_cfg = {
 			.ring_size = cpu_to_le16(sring->size),
 		},
-		.irq_index = WIL_TX_STATUS_IRQ_IDX,
-		.irq_mode = irq_mode,
+		.irq_index = WIL_TX_STATUS_IRQ_IDX
 	};
 	struct {
 		struct wmi_cmd_hdr hdr;
@@ -4029,8 +3754,7 @@ int wil_wmi_tx_sring_cfg(struct wil6210_priv *wil, int ring_id, u8 irq_mode)
 	return 0;
 }
 
-int wil_wmi_cfg_def_rx_offload(struct wil6210_priv *wil,
-			       u16 max_rx_pl_per_desc, bool checksum)
+int wil_wmi_cfg_def_rx_offload(struct wil6210_priv *wil, u16 max_rx_pl_per_desc)
 {
 	struct net_device *ndev = wil->main_ndev;
 	struct wil6210_vif *vif = ndev_to_vif(ndev);
@@ -4040,8 +3764,7 @@ int wil_wmi_cfg_def_rx_offload(struct wil6210_priv *wil,
 		.max_rx_pl_per_desc = cpu_to_le16(max_rx_pl_per_desc),
 		.decap_trans_type = WMI_DECAP_TYPE_802_3,
 		.l2_802_3_offload_ctrl = 0,
-		.l3_l4_ctrl =
-			(checksum ? 1 << L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS : 0),
+		.l3_l4_ctrl = 1 << L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS,
 	};
 	struct {
 		struct wmi_cmd_hdr hdr;
@@ -4153,9 +3876,10 @@ int wil_wmi_rx_desc_ring_add(struct wil6210_priv *wil, int status_ring_id)
 }
 
 int wil_wmi_tx_desc_ring_add(struct wil6210_vif *vif, int ring_id, int cid,
-			     int tid, int sring_id, u8 irq_mode)
+			     int tid)
 {
 	struct wil6210_priv *wil = vif_to_wil(vif);
+	int sring_id = wil->tx_sring_idx; /* there is only one TX sring */
 	int rc;
 	struct wil_ring *ring = &wil->ring_tx[ring_id];
 	struct wil_ring_tx_data *txdata = &wil->ring_tx_data[ring_id];
@@ -4172,9 +3896,7 @@ int wil_wmi_tx_desc_ring_add(struct wil6210_vif *vif, int ring_id, int cid,
 		.schd_params = {
 			.priority = cpu_to_le16(0),
 			.timeslot_us = cpu_to_le16(0xfff),
-		},
-		.irq_index = ring_id,
-		.irq_mode = irq_mode,
+		}
 	};
 	struct {
 		struct wmi_cmd_hdr hdr;
@@ -4207,8 +3929,7 @@ int wil_wmi_tx_desc_ring_add(struct wil6210_vif *vif, int ring_id, int cid,
 	return 0;
 }
 
-int wil_wmi_bcast_desc_ring_add(struct wil6210_vif *vif, int ring_id,
-				int sring_id)
+int wil_wmi_bcast_desc_ring_add(struct wil6210_vif *vif, int ring_id)
 {
 	struct wil6210_priv *wil = vif_to_wil(vif);
 	struct wil_ring *ring = &wil->ring_tx[ring_id];
@@ -4219,7 +3940,7 @@ int wil_wmi_bcast_desc_ring_add(struct wil6210_vif *vif, int ring_id,
 			.ring_id = ring_id,
 		},
 		.max_msdu_size = cpu_to_le16(wil_mtu2macbuf(mtu_max)),
-		.status_ring_id = sring_id,
+		.status_ring_id = wil->tx_sring_idx,
 		.encap_trans_type = WMI_VRING_ENC_TYPE_802_3,
 	};
 	struct {
@@ -4330,84 +4051,3 @@ int wmi_set_cqm_rssi_config(struct wil6210_priv *wil,
 
 	return 0;
 }
-
-const char *
-wil_get_vr_profile_name(enum wmi_vr_profile profile)
-{
-	switch (profile) {
-	case WMI_VR_PROFILE_DISABLED:
-		return "DISABLED";
-	case WMI_VR_PROFILE_COMMON_AP:
-		return "COMMON_AP";
-	case WMI_VR_PROFILE_COMMON_STA:
-		return "COMMON_STA";
-	default:
-		return "unknown";
-	}
-}
-
-int wmi_set_vr_profile(struct wil6210_priv *wil, u8 profile)
-{
-	int rc;
-	struct net_device *ndev = wil->main_ndev;
-	struct wil6210_vif *vif = ndev_to_vif(ndev);
-	struct wmi_set_vr_profile_cmd cmd = {0};
-	struct {
-		struct wmi_cmd_hdr hdr;
-		struct wmi_set_vr_profile_event evt;
-	} __packed reply = {
-		.evt = {.status = WMI_FW_STATUS_FAILURE},
-	};
-
-	cmd.profile = profile;
-	wil_info(wil, "sending set vr config command, profile=%d\n", profile);
-	rc = wmi_call(wil, WMI_SET_VR_PROFILE_CMDID, vif->mid, &cmd,
-		      sizeof(cmd), WMI_SET_VR_PROFILE_EVENTID,
-		      &reply, sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS);
-	if (rc) {
-		wil_err(wil, "WMI_SET_VR_PROFILE_CMDID failed, rc %d\n", rc);
-		return rc;
-	}
-
-	if (reply.evt.status != WMI_FW_STATUS_SUCCESS) {
-		wil_err(wil, "set vr profile failed, status %d\n",
-			reply.evt.status);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-int wmi_reset_spi_slave(struct wil6210_priv *wil)
-{
-	struct net_device *ndev = wil->main_ndev;
-	struct wil6210_vif *vif = ndev_to_vif(ndev);
-	struct wmi_reset_spi_slave_cmd cmd = { {0} };
-	struct {
-		struct wmi_cmd_hdr wmi;
-		struct wmi_reset_spi_slave_event evt;
-	} __packed reply = {
-		.evt = {.status = WMI_FW_STATUS_FAILURE},
-	};
-	int rc;
-
-	if (!(ndev->flags & IFF_UP))
-		return 0;
-
-	/* Force sending SPI slave reset to guarantee safe SPI reset */
-	rc = __wmi_call(wil, WMI_RESET_SPI_SLAVE_CMDID, vif->mid, &cmd,
-			sizeof(cmd), WMI_RESET_SPI_SLAVE_EVENTID, &reply,
-			sizeof(reply), WIL_WMI_SPI_SLAVE_RESET_TO_MS, true);
-	if (rc) {
-		wil_err(wil, "WMI_RESET_SPI_SLAVE_CMDID failed, rc %d\n", rc);
-		return rc;
-	}
-
-	if (reply.evt.status != WMI_FW_STATUS_SUCCESS) {
-		wil_err(wil, "spi slave reset failed, status %d\n",
-			reply.evt.status);
-		return -EINVAL;
-	}
-
-	return 0;
-}

+ 1 - 45
drivers/net/wireless/ath/wil6210/wmi.h

@@ -86,7 +86,6 @@ enum wmi_fw_capability {
 	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
 	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
 	WMI_FW_CAPABILITY_PNO				= 15,
-	WMI_FW_CAPABILITY_CONNECT_SNR_THR		= 16,
 	WMI_FW_CAPABILITY_CHANNEL_BONDING		= 17,
 	WMI_FW_CAPABILITY_REF_CLOCK_CONTROL		= 18,
 	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_NONE		= 19,
@@ -100,7 +99,6 @@ enum wmi_fw_capability {
 	WMI_FW_CAPABILITY_IPA				= 27,
 	WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF		= 30,
 	WMI_FW_CAPABILITY_SPLIT_REKEY			= 31,
-	WMI_FW_CAPABILITY_AP_POWER_MANAGEMENT		= 32,
 	WMI_FW_CAPABILITY_MAX,
 };
 
@@ -141,7 +139,6 @@ enum wmi_command_id {
 	WMI_RADAR_SET_MODE_CMDID			= 0x103,
 	WMI_RADAR_CONTROL_CMDID				= 0x104,
 	WMI_RADAR_PCI_CONTROL_CMDID			= 0x105,
-	WMI_RESET_SPI_SLAVE_CMDID			= 0x106,
 	WMI_MEM_READ_CMDID				= 0x800,
 	WMI_MEM_WR_CMDID				= 0x801,
 	WMI_ECHO_CMDID					= 0x803,
@@ -287,7 +284,6 @@ enum wmi_command_id {
 	WMI_GET_ASSOC_LIST_CMDID			= 0xA06,
 	WMI_GET_CCA_INDICATIONS_CMDID			= 0xA07,
 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID	= 0xA08,
-	WMI_SET_VR_PROFILE_CMDID			= 0xA09,
 	WMI_INTERNAL_FW_IOCTL_CMDID			= 0xA0B,
 	WMI_LINK_STATS_CMDID				= 0xA0C,
 	WMI_SET_GRANT_MCS_CMDID				= 0xA0E,
@@ -696,11 +692,6 @@ struct wmi_radar_pci_control_cmd {
 	__le32 reserved;
 } __packed;
 
-/* WMI_RESET_SPI_SLAVE_CMDID */
-struct wmi_reset_spi_slave_cmd {
-	u8 reserved[4];
-} __packed;
-
 /* WMI_RF_MGMT_CMDID */
 enum wmi_rf_mgmt_type {
 	WMI_RF_MGMT_W_DISABLE	= 0x00,
@@ -1743,13 +1734,6 @@ struct wmi_radar_pci_control_event {
 	u8 reserved[3];
 } __packed;
 
-/* WMI_RESET_SPI_SLAVE_EVENTID */
-struct wmi_reset_spi_slave_event {
-	/* wmi_fw_status */
-	u8 status;
-	u8 reserved[3];
-} __packed;
-
 /* WMI_SET_LONG_RANGE_CONFIG_CMDID */
 struct wmi_set_long_range_config_cmd {
 	__le32 reserved;
@@ -1997,7 +1981,6 @@ enum wmi_event_id {
 	WMI_RADAR_SET_MODE_EVENTID			= 0x1103,
 	WMI_RADAR_CONTROL_EVENTID			= 0x1104,
 	WMI_RADAR_PCI_CONTROL_EVENTID			= 0x1105,
-	WMI_RESET_SPI_SLAVE_EVENTID			= 0x1106,
 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
 	WMI_FW_READY_EVENTID				= 0x1801,
 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
@@ -2129,7 +2112,6 @@ enum wmi_event_id {
 	WMI_GET_ASSOC_LIST_RES_EVENTID			= 0x1A06,
 	WMI_GET_CCA_INDICATIONS_EVENTID			= 0x1A07,
 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID	= 0x1A08,
-	WMI_SET_VR_PROFILE_EVENTID			= 0x1A09,
 	WMI_INTERNAL_FW_EVENT_EVENTID			= 0x1A0A,
 	WMI_INTERNAL_FW_IOCTL_EVENTID			= 0x1A0B,
 	WMI_LINK_STATS_CONFIG_DONE_EVENTID		= 0x1A0C,
@@ -2446,7 +2428,7 @@ struct wmi_rx_mgmt_info {
 	u8 range;
 	u8 sqi;
 	__le16 stype;
-	__le16 snr;
+	__le16 status;
 	__le32 len;
 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
 	u8 qid;
@@ -4208,32 +4190,6 @@ struct wmi_rbufcap_cfg_cmd {
 	__le16 rx_desc_threshold;
 } __packed;
 
-enum wmi_vr_profile {
-	WMI_VR_PROFILE_DISABLED		= 0,
-	WMI_VR_PROFILE_COMMON_AP	= 1,
-	WMI_VR_PROFILE_COMMON_STA	= 2,
-	WMI_VR_PROFILE_RESERVED0	= 250,
-	WMI_VR_PROFILE_RESERVED1	= 251,
-	WMI_VR_PROFILE_RESERVED2	= 252,
-	WMI_VR_PROFILE_RESERVED3	= 253,
-	WMI_VR_PROFILE_RESERVED4	= 254,
-	WMI_VR_PROFILE_RESERVED5	= 255,
-};
-
-/* WMI_SET_VR_PROFILE_CMDID */
-struct wmi_set_vr_profile_cmd {
-	/* enum wmi_vr_profile */
-	u8 profile;
-	u8 reserved[3];
-} __packed;
-
-/* WMI_SET_VR_PROFILE_EVENTID */
-struct wmi_set_vr_profile_event {
-	/* enum wmi_fw_status */
-	u8 status;
-	u8 reserved[3];
-} __packed;
-
 /* WMI_RBUFCAP_CFG_EVENTID */
 struct wmi_rbufcap_cfg_event {
 	/* enum wmi_fw_status */

+ 1 - 1
drivers/staging/octeon/octeon-ethernet.h

@@ -91,7 +91,7 @@ int cvm_oct_common_stop(struct net_device *dev);
 int cvm_oct_common_open(struct net_device *dev,
 			void (*link_poll)(struct net_device *));
 void cvm_oct_note_carrier(struct octeon_ethernet *priv,
-			  cvmx_helper_link_info_t li);
+			  union cvmx_helper_link_info li);
 void cvm_oct_link_poll(struct net_device *dev);
 
 extern int always_use_pow;

+ 70 - 68
drivers/staging/octeon/octeon-stubs.h

@@ -12,7 +12,7 @@
 #define octeon_has_feature(x)	0
 #define octeon_get_clock_rate()	0
 
-#define CVMX_SYNCIOBDMA		do { } while(0)
+#define CVMX_SYNCIOBDMA		do { } while (0)
 
 #define CVMX_HELPER_INPUT_TAG_TYPE	0
 #define CVMX_HELPER_FIRST_MBUFF_SKIP	7
@@ -23,11 +23,11 @@
 #define CVMX_FPA_PACKET_POOL_SIZE	    16
 #define CVMX_FPA_WQE_POOL		    (1)
 #define CVMX_FPA_WQE_POOL_SIZE		    16
-#define CVMX_GMXX_RXX_ADR_CAM_EN(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CTL(a, b)	((a)+(b))
-#define CVMX_GMXX_PRTX_CFG(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_FRM_MAX(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_JABBER(a, b)	((a)+(b))
+#define CVMX_GMXX_RXX_ADR_CAM_EN(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CTL(a, b)	((a) + (b))
+#define CVMX_GMXX_PRTX_CFG(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_FRM_MAX(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_JABBER(a, b)	((a) + (b))
 #define CVMX_IPD_CTL_STATUS		0
 #define CVMX_PIP_FRM_LEN_CHKX(a)	(a)
 #define CVMX_PIP_NUM_INPUT_PORTS	1
@@ -42,7 +42,7 @@
 #define CVMX_NPI_RSL_INT_BLOCKS		0
 #define CVMX_POW_WQ_INT_PC		0
 
-typedef union {
+union cvmx_pip_wqe_word2 {
 	uint64_t u64;
 	struct {
 		uint64_t bufs:8;
@@ -118,13 +118,13 @@ typedef union {
 		uint64_t err_code:8;
 	} snoip;
 
-} cvmx_pip_wqe_word2;
+};
 
 union cvmx_pip_wqe_word0 {
 	struct {
 		uint64_t next_ptr:40;
 		uint8_t unused;
-		uint16_t hw_chksum;
+		__wsum hw_chksum;
 	} cn38xx;
 	struct {
 		uint64_t pknd:6;        /* 0..5 */
@@ -184,15 +184,15 @@ union cvmx_buf_ptr {
 	} s;
 };
 
-typedef struct {
+struct cvmx_wqe {
 	union cvmx_wqe_word0 word0;
 	union cvmx_wqe_word1 word1;
-	cvmx_pip_wqe_word2 word2;
+	union cvmx_pip_wqe_word2 word2;
 	union cvmx_buf_ptr packet_ptr;
 	uint8_t packet_data[96];
-} cvmx_wqe_t;
+};
 
-typedef union {
+union cvmx_helper_link_info {
 	uint64_t u64;
 	struct {
 		uint64_t reserved_20_63:44;
@@ -200,18 +200,18 @@ typedef union {
 		uint64_t full_duplex:1;	    /**< 1 if the link is full duplex */
 		uint64_t speed:18;	    /**< Speed of the link in Mbps */
 	} s;
-} cvmx_helper_link_info_t;
+};
 
-typedef enum {
+enum cvmx_fau_reg_32 {
 	CVMX_FAU_REG_32_START	= 0,
-} cvmx_fau_reg_32_t;
+};
 
-typedef enum {
+enum cvmx_fau_op_size {
 	CVMX_FAU_OP_SIZE_8 = 0,
 	CVMX_FAU_OP_SIZE_16 = 1,
 	CVMX_FAU_OP_SIZE_32 = 2,
 	CVMX_FAU_OP_SIZE_64 = 3
-} cvmx_fau_op_size_t;
+};
 
 typedef enum {
 	CVMX_SPI_MODE_UNKNOWN = 0,
@@ -383,6 +383,7 @@ union cvmx_ipd_sub_port_qos_cnt {
 		uint64_t reserved_41_63:23;
 	} s;
 };
+
 typedef struct {
 	uint32_t dropped_octets;
 	uint32_t dropped_packets;
@@ -1138,27 +1139,27 @@ union cvmx_npi_rsl_int_blocks {
 	} cn50xx;
 };
 
-typedef union {
+union cvmx_pko_command_word0 {
 	uint64_t u64;
 	struct {
-	        uint64_t total_bytes:16;
-	        uint64_t segs:6;
-	        uint64_t dontfree:1;
-	        uint64_t ignore_i:1;
-	        uint64_t ipoffp1:7;
-	        uint64_t gather:1;
-	        uint64_t rsp:1;
-	        uint64_t wqp:1;
-	        uint64_t n2:1;
-	        uint64_t le:1;
-	        uint64_t reg0:11;
-	        uint64_t subone0:1;
-	        uint64_t reg1:11;
-	        uint64_t subone1:1;
-	        uint64_t size0:2;
-	        uint64_t size1:2;
+		uint64_t total_bytes:16;
+		uint64_t segs:6;
+		uint64_t dontfree:1;
+		uint64_t ignore_i:1;
+		uint64_t ipoffp1:7;
+		uint64_t gather:1;
+		uint64_t rsp:1;
+		uint64_t wqp:1;
+		uint64_t n2:1;
+		uint64_t le:1;
+		uint64_t reg0:11;
+		uint64_t subone0:1;
+		uint64_t reg1:11;
+		uint64_t subone1:1;
+		uint64_t size0:2;
+		uint64_t size1:2;
 	} s;
-} cvmx_pko_command_word0_t;
+};
 
 union cvmx_ciu_timx {
 	uint64_t u64;
@@ -1179,16 +1180,18 @@ union cvmx_gmxx_rxx_rx_inbnd {
 	} s;
 };
 
-static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg,
+static inline int32_t cvmx_fau_fetch_and_add32(enum cvmx_fau_reg_32 reg,
 					       int32_t value)
 {
 	return value;
 }
 
-static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value)
+static inline void cvmx_fau_atomic_add32(enum cvmx_fau_reg_32 reg,
+					 int32_t value)
 { }
 
-static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value)
+static inline void cvmx_fau_atomic_write32(enum cvmx_fau_reg_32 reg,
+					   int32_t value)
 { }
 
 static inline uint64_t cvmx_scratch_read64(uint64_t address)
@@ -1199,7 +1202,7 @@ static inline uint64_t cvmx_scratch_read64(uint64_t address)
 static inline void cvmx_scratch_write64(uint64_t address, uint64_t value)
 { }
 
-static inline int cvmx_wqe_get_grp(cvmx_wqe_t *work)
+static inline int cvmx_wqe_get_grp(struct cvmx_wqe *work)
 {
 	return 0;
 }
@@ -1268,15 +1271,15 @@ static inline cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
 	return 0;
 }
 
-static inline cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port)
+static inline union cvmx_helper_link_info cvmx_helper_link_get(int ipd_port)
 {
-	cvmx_helper_link_info_t ret = { .u64 = 0 };
+	union cvmx_helper_link_info ret = { .u64 = 0 };
 
 	return ret;
 }
 
 static inline int cvmx_helper_link_set(int ipd_port,
-				cvmx_helper_link_info_t link_info)
+				       union cvmx_helper_link_info link_info)
 {
 	return 0;
 }
@@ -1343,17 +1346,17 @@ static inline void cvmx_pow_work_request_async_nocheck(int scr_addr,
 { }
 
 static inline void cvmx_pow_work_request_async(int scr_addr,
-						       cvmx_pow_wait_t wait)
+					       cvmx_pow_wait_t wait)
 { }
 
-static inline cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr)
+static inline struct cvmx_wqe *cvmx_pow_work_response_async(int scr_addr)
 {
-	cvmx_wqe_t *wqe = (void *)(unsigned long)scr_addr;
+	struct cvmx_wqe *wqe = (void *)(unsigned long)scr_addr;
 
 	return wqe;
 }
 
-static inline cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait)
+static inline struct cvmx_wqe *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait)
 {
 	return (void *)(unsigned long)wait;
 }
@@ -1365,7 +1368,7 @@ static inline int cvmx_spi_restart_interface(int interface,
 }
 
 static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr,
-						  cvmx_fau_reg_32_t reg,
+						  enum cvmx_fau_reg_32 reg,
 						  int32_t value)
 { }
 
@@ -1374,6 +1377,7 @@ static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed(
 	int port)
 {
 	union cvmx_gmxx_rxx_rx_inbnd r;
+
 	r.u64 = 0;
 	return r;
 }
@@ -1383,45 +1387,43 @@ static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue,
 { }
 
 static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
-		uint64_t queue, cvmx_pko_command_word0_t pko_command,
+		uint64_t queue, union cvmx_pko_command_word0 pko_command,
 		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
 {
-	cvmx_pko_status_t ret = 0;
-
-	return ret;
+	return 0;
 }
 
-static inline void cvmx_wqe_set_port(cvmx_wqe_t *work, int port)
+static inline void cvmx_wqe_set_port(struct cvmx_wqe *work, int port)
 { }
 
-static inline void cvmx_wqe_set_qos(cvmx_wqe_t *work, int qos)
+static inline void cvmx_wqe_set_qos(struct cvmx_wqe *work, int qos)
 { }
 
-static inline int cvmx_wqe_get_qos(cvmx_wqe_t *work)
+static inline int cvmx_wqe_get_qos(struct cvmx_wqe *work)
 {
 	return 0;
 }
 
-static inline void cvmx_wqe_set_grp(cvmx_wqe_t *work, int grp)
+static inline void cvmx_wqe_set_grp(struct cvmx_wqe *work, int grp)
 { }
 
-static inline void cvmx_pow_work_submit(cvmx_wqe_t *wqp, uint32_t tag,
+static inline void cvmx_pow_work_submit(struct cvmx_wqe *wqp, uint32_t tag,
 					enum cvmx_pow_tag_type tag_type,
 					uint64_t qos, uint64_t grp)
 { }
 
-#define CVMX_ASXX_RX_CLK_SETX(a, b)	((a)+(b))
-#define CVMX_ASXX_TX_CLK_SETX(a, b)	((a)+(b))
+#define CVMX_ASXX_RX_CLK_SETX(a, b)	((a) + (b))
+#define CVMX_ASXX_TX_CLK_SETX(a, b)	((a) + (b))
 #define CVMX_CIU_TIMX(a)		(a)
-#define CVMX_GMXX_RXX_ADR_CAM0(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CAM1(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CAM2(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CAM3(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CAM4(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_ADR_CAM5(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_FRM_CTL(a, b)	((a)+(b))
-#define CVMX_GMXX_RXX_INT_REG(a, b)	((a)+(b))
-#define CVMX_GMXX_SMACX(a, b)		((a)+(b))
+#define CVMX_GMXX_RXX_ADR_CAM0(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CAM1(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CAM2(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CAM3(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CAM4(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_ADR_CAM5(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_FRM_CTL(a, b)	((a) + (b))
+#define CVMX_GMXX_RXX_INT_REG(a, b)	((a) + (b))
+#define CVMX_GMXX_SMACX(a, b)		((a) + (b))
 #define CVMX_PIP_PRT_TAGX(a)		(a)
 #define CVMX_POW_PP_GRP_MSKX(a)		(a)
 #define CVMX_POW_WQ_INT_THRX(a)		(a)

+ 0 - 4
scripts/Makefile.lib

@@ -373,10 +373,6 @@ $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
 
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
 
-# Concatentate multiple files together
-quiet_cmd_cat = CAT $@
-cmd_cat = (cat $(filter-out FORCE,$^) > $@) || (rm -f $@; false)
-
 # Bzip2
 # ---------------------------------------------------------------------------
 

+ 0 - 3
scripts/headers_install.sh

@@ -75,7 +75,6 @@ arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K
 arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K
 arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE
 arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8
-arch/arm64/include/uapi/asm/sigcontext.h:CONFIG_64BIT
 arch/hexagon/include/uapi/asm/ptrace.h:CONFIG_HEXAGON_ARCH_VERSION
 arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION
 arch/ia64/include/uapi/asm/cmpxchg.h:CONFIG_IA64_DEBUG_CMPXCHG
@@ -87,8 +86,6 @@ arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64
 arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
 include/uapi/asm-generic/fcntl.h:CONFIG_64BIT
 include/uapi/linux/atmdev.h:CONFIG_COMPAT
-include/uapi/linux/sysstats.h:CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
-include/uapi/linux/taskstats.h:CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
 include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP
 include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
 include/uapi/linux/pktcdvd.h:CONFIG_CDROM_PKTCDVD_WCACHE

+ 0 - 76
scripts/link-vmlinux.sh

@@ -281,33 +281,6 @@ kallsyms_step()
 	      -c -o ${kallsymso} ${kallsyms_S}
 }
 
-# Generates ${2} .o file with RTIC MP's from the ${1} object file (vmlinux)
-# ${3} the file name where the sizes of the RTIC MP structure are stored
-# just in case, save copy of the RTIC mp to ${4}
-# Note: RTIC_MPGEN has to be set if MPGen is available
-rtic_mp()
-{
-	if [ -n "${CONFIG_QCOM_RTIC}" ]; then
-	# assume that RTIC_MP_O generation may fail
-	RTIC_MP_O=
-
-	local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL}               \
-		${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
-
-	${RTIC_MPGEN} --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \
-	--binpath='' --vmlinux=${1} --config=${KCONFIG_CONFIG} && \
-	cat rtic_mp.c | ${CC} ${aflags} -c -o ${2} -x c - && \
-	cp rtic_mp.c ${4} && \
-	${NM} --print-size --size-sort ${2} > ${3} && \
-	RTIC_MP_O=${2} || echo “RTIC MP generation has failed”
-	# NM - save generated variable sizes for verification
-	# RTIC_MP_O is our retval - great success if set to generated .o file
-	# Echo statement above prints the error message in case any of the
-	# above RTIC MP generation commands fail and it ensures rtic mp failure
-	# does not cause kernel compilation to fail.
-	fi
-}
-
 # Create map file with all symbols from ${1}
 # See mksymap for additional details
 mksysmap()
@@ -331,10 +304,6 @@ cleanup()
 	rm -f System.map
 	rm -f vmlinux
 	rm -f vmlinux.o
-if [ -n "${CONFIG_QCOM_RTIC}" ]; then
-	rm -f .tmp_rtic_mp_sz*
-	rm -f rtic_mp.*
-fi
 }
 
 on_exit()
@@ -403,16 +372,6 @@ if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
 	fi
 fi
 
-if [ -n "${CONFIG_QCOM_RTIC}" ]; then
-	# Generate RTIC MP placeholder compile unit of the correct size
-	# and add it to the list of link objects
-	# this needs to be done before generating kallsyms
-	if [ ! -z ${RTIC_MPGEN+x} ]; then
-		rtic_mp vmlinux.o rtic_mp.o .tmp_rtic_mp_sz1 .tmp_rtic_mp1.c
-		KBUILD_VMLINUX_LIBS=$KBUILD_VMLINUX_LIBS" "$RTIC_MP_O
-	fi
-fi
-
 kallsymso=""
 kallsymso_prev=""
 kallsyms_vmlinux=""
@@ -453,24 +412,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
 	fi
 fi
 
-if [ -n "${CONFIG_QCOM_RTIC}" ]; then
-	# Update RTIC MP object by replacing the place holder
-	# with actual MP data of the same size
-	# Also double check that object size did not change
-	# Note: Check initilally if RTIC_MP_O is not empty or uninitialized,
-	# as incase RTIC_MPGEN is set and failure occurs in RTIC_MP_O
-	# generation, below check for comparing object sizes fails
-	# due to an empty RTIC_MP_O object.
-	if [ ! -z ${RTIC_MP_O} ]; then
-		rtic_mp "${kallsyms_vmlinux}" rtic_mp.o .tmp_rtic_mp_sz2 \
-			.tmp_rtic_mp2.c
-		if ! cmp -s .tmp_rtic_mp_sz1 .tmp_rtic_mp_sz2; then
-			echo >&2 'ERROR: RTIC MP object files size mismatch'
-			exit 1
-		fi
-	fi
-fi
-
 vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
 
 # fill in BTF IDs
@@ -500,20 +441,3 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
 		exit 1
 	fi
 fi
-
-if [ -n "${CONFIG_QCOM_RTIC}" ]; then
-	# Starting Android Q, the DTB's are part of dtb.img and not part
-	# of the kernel image. RTIC DTS relies on the kernel environment
-	# and could not build outside of the kernel. Generate RTIC DTS after
-	# successful kernel build if MPGen is enabled. The DTB will be
-	# generated with dtb.img in kernel_definitions.mk.
-	if [ ! -z ${RTIC_MPGEN+x} ]; then
-		${RTIC_MPGEN} --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \
-		--binpath="" --vmlinux="vmlinux" --config=${KCONFIG_CONFIG} \
-		--cc="${CC} ${KBUILD_AFLAGS}" --dts=rtic_mp.dts \
-		|| echo “RTIC MP DTS generation has failed”
-		# Echo statement above prints the error message in case above
-		# RTIC MP DTS generation command fails and it ensures rtic mp
-		# failure does not cause kernel compilation to fail.
-	fi
-fi