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 <eberman@codeaurora.org>
This commit is contained in:
parent
fadf81d820
commit
72f66988e5
2
Makefile
2
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))
|
||||
|
@ -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)/$@
|
||||
|
@ -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,3 +1,4 @@
|
||||
CONFIG_LOCALVERSION="-mainline"
|
||||
CONFIG_AUDIT=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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),
|
||||
{},
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
struct wil_status_ring *sring = &wil->srings[wil->tx_sring_idx];
|
||||
|
||||
if (sring_idx >= WIL6210_MAX_STATUS_RINGS) {
|
||||
napi_complete(napi);
|
||||
if (!sring->va)
|
||||
return 0;
|
||||
}
|
||||
|
||||
sring = &wil->srings[sring_idx];
|
||||
if (!sring->va) {
|
||||
napi_complete(napi);
|
||||
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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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,63 +103,47 @@ 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)
|
||||
{
|
||||
struct wil_status_ring *sring = &wil->srings[sring_id];
|
||||
int rc;
|
||||
u8 irq_mode = WMI_RING_ADD_IRQ_MODE_ENABLE;
|
||||
|
||||
wil_dbg_misc(wil, "init TX sring: size=%u, sring_id=%u\n",
|
||||
status_ring_size, sring_id);
|
||||
|
||||
sring->is_rx = false;
|
||||
sring->size = status_ring_size;
|
||||
sring->elem_size = elem_size;
|
||||
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);
|
||||
if (rc)
|
||||
goto out_free;
|
||||
|
||||
sring->desc_rdy_pol = 1;
|
||||
|
||||
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;
|
||||
int ring_id = wil_find_free_sring(wil);
|
||||
struct wil_status_ring *sring;
|
||||
int rc;
|
||||
u16 status_ring_size;
|
||||
|
||||
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;
|
||||
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
|
||||
*/
|
||||
rc = wil_init_tx_sring(wil, sring_size,
|
||||
sizeof(struct wil_ring_tx_status), sring_id);
|
||||
if (!rc)
|
||||
wil->tx_sring_idx = sring_id;
|
||||
sring = &wil->srings[ring_id];
|
||||
|
||||
sring->is_rx = false;
|
||||
sring->size = status_ring_size;
|
||||
sring->elem_size = sizeof(struct wil_ring_tx_status);
|
||||
rc = wil_sring_alloc(wil, sring);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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 @@ int wil_init_rx_sring(struct wil6210_priv *wil, u16 status_ring_size,
|
||||
}
|
||||
|
||||
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 @@ static int wil_ring_alloc_desc_ring(struct wil6210_priv *wil,
|
||||
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 @@ void wil_ring_free_edma(struct wil6210_priv *wil, struct wil_ring *ring)
|
||||
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 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
|
||||
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];
|
||||
wil_dbg_misc(wil, "free TX sring\n");
|
||||
|
||||
if (!sring->va || sring->is_rx)
|
||||
continue;
|
||||
|
||||
wil_dbg_misc(wil, "free TX sring %d\n", i);
|
||||
|
||||
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);
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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 @@ static int __wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf,
|
||||
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 @@ bool wil_is_wmi_idle(struct wil6210_priv *wil)
|
||||
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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
static inline void cvmx_wqe_set_port(cvmx_wqe_t *work, int port)
|
||||
{ }
|
||||
|
||||
static inline void cvmx_wqe_set_qos(cvmx_wqe_t *work, int qos)
|
||||
{ }
|
||||
|
||||
static inline int cvmx_wqe_get_qos(cvmx_wqe_t *work)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void cvmx_wqe_set_grp(cvmx_wqe_t *work, int grp)
|
||||
static inline void cvmx_wqe_set_port(struct cvmx_wqe *work, int port)
|
||||
{ }
|
||||
|
||||
static inline void cvmx_pow_work_submit(cvmx_wqe_t *wqp, uint32_t tag,
|
||||
static inline void cvmx_wqe_set_qos(struct cvmx_wqe *work, int qos)
|
||||
{ }
|
||||
|
||||
static inline int cvmx_wqe_get_qos(struct cvmx_wqe *work)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void cvmx_wqe_set_grp(struct cvmx_wqe *work, int grp)
|
||||
{ }
|
||||
|
||||
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)
|
||||
|
@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user