diff --git a/feeds/ipq807x/qca-nss-clients/Makefile b/feeds/ipq807x/qca-nss-clients/Makefile index dd123c16d..4ca34ccc9 100644 --- a/feeds/ipq807x/qca-nss-clients/Makefile +++ b/feeds/ipq807x/qca-nss-clients/Makefile @@ -6,7 +6,7 @@ PKG_SOURCE_PROTO:=git PKG_BRANCH:=master PKG_RELEASE:=2 PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-clients/ -PKG_VERSION:=9136ef60bf68ceed760781d3acbeddb05470e432 +PKG_VERSION:=153998d70fdba508a59a28c13a606032cbf32686 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) @@ -24,17 +24,10 @@ else subtarget:=$(CONFIG_TARGET_BOARD) endif -ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_ipq807x" "ipq60xx" "ipq807x_ipq60xx")) # DTLS Manager v2.0 for Hawkeye/Cypress DTLSMGR_DIR:=v2.0 # IPsec Manager v2.0 for Hawkeye/Cypress IPSECMGR_DIR:=v2.0 -else -# DTLS Manager v1.0 for Akronite. - DTLSMGR_DIR:=v1.0 -# IPsec Manager v1.0 for Akronite. - IPSECMGR_DIR:=v1.0 -endif define KernelPackage/qca-nss-drv-tun6rd SECTION:=kernel @@ -437,6 +430,20 @@ define Build/InstallDev/qca-nss-clients $(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-clients/ endef +define KernelPackage/qca-nss-drv-wifi-meshmgr + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Devices + DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 + TITLE:=NSS WiFi-Mesh Manager for QCA NSS driver + FILES:=$(PKG_BUILD_DIR)/wifi_meshmgr/qca-nss-wifi-meshmgr.ko + AUTOLOAD:=$(call AutoLoad,51,qca-nss-wifi-meshmgr) +endef + +define KernelPackage/qca-nss-drv-wifi-meshmgr/Description +Kernel module for WiFi Mesh manager +endef + define Build/InstallDev $(call Build/InstallDev/qca-nss-clients,$(1)) endef @@ -585,6 +592,10 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mirror),) MAKE_OPTS+=mirror=y endif +ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr),) +MAKE_OPTS+=wifi-meshmgr=y +endif + define Build/Compile $(MAKE) -C "$(LINUX_DIR)" $(strip $(MAKE_OPTS)) \ CROSS_COMPILE="$(TARGET_CROSS)" \ @@ -624,3 +635,4 @@ $(eval $(call KernelPackage,qca-nss-drv-vxlanmgr)) $(eval $(call KernelPackage,qca-nss-drv-match)) #$(eval $(call KernelPackage,qca-nss-drv-tlsmgr)) $(eval $(call KernelPackage,qca-nss-drv-mirror)) +$(eval $(call KernelPackage,qca-nss-drv-wifi-meshmgr)) diff --git a/feeds/ipq807x/qca-nss-dp/src/Makefile b/feeds/ipq807x/qca-nss-dp/src/Makefile index b7ddcc1d4..04e6a4531 100644 --- a/feeds/ipq807x/qca-nss-dp/src/Makefile +++ b/feeds/ipq807x/qca-nss-dp/src/Makefile @@ -30,7 +30,7 @@ NSS_DP_INCLUDE += -I$(obj)/hal/gmac_hal_ops/syn/gmac endif ccflags-y += $(NSS_DP_INCLUDE) -ccflags-y += -Werror +ccflags-y += -Wall -Werror ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64)) ccflags-y += -DNSS_DP_PPE_SUPPORT @@ -43,7 +43,7 @@ endif ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64)) qca-nss-dp-objs += hal/arch/ipq807x/nss_ipq807x.o -ccflags-y += -DNSS_DP_IPQ807X +ccflags-y += -DNSS_DP_IPQ807X -DNSS_DP_EDMA_TX_SMALL_PKT_WAR endif ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64)) diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c index ba32ae85f..8ddfee8d9 100644 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c +++ b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c @@ -68,8 +68,13 @@ static void nss_dp_hal_tcsr_set(void) * If TZ is not enabled, we can write to the register directly. */ if (qcom_scm_is_available()) { +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) err = qcom_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET), TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE); +#else + err = qti_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET), + TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE); +#endif if (err) { pr_err("%s: SCM TCSR write error: %d\n", __func__, err); } diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c index d51c7f07b..cbaee4fc4 100644 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c +++ b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -67,6 +67,76 @@ void edma_reg_write(uint32_t reg_off, uint32_t val) writel(val, edma_hw.reg_base + reg_off); } +/* + * edma_disable_interrupts() + * Disable EDMA RX/TX interrupt masks. + */ +static void edma_disable_interrupts(void) +{ + struct edma_rxdesc_ring *rxdesc_ring = NULL; + struct edma_rxfill_ring *rxfill_ring = NULL; + struct edma_txcmpl_ring *txcmpl_ring = NULL; + int i; + + for (i = 0; i < edma_hw.rxdesc_rings; i++) { + rxdesc_ring = &edma_hw.rxdesc_ring[i]; + edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), + EDMA_MASK_INT_CLEAR); + } + + for (i = 0; i < edma_hw.txcmpl_rings; i++) { + txcmpl_ring = &edma_hw.txcmpl_ring[i]; + edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), + EDMA_MASK_INT_CLEAR); + } + + for (i = 0; i < edma_hw.rxfill_rings; i++) { + rxfill_ring = &edma_hw.rxfill_ring[i]; + edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), + EDMA_MASK_INT_CLEAR); + } + + /* + * Clear MISC interrupt mask. + */ + edma_reg_write(EDMA_REG_MISC_INT_MASK, EDMA_MASK_INT_CLEAR); +} + +/* + * edma_enable_interrupts() + * Enable RX/TX EDMA interrupt masks. + */ +static void edma_enable_interrupts(void) +{ + struct edma_rxdesc_ring *rxdesc_ring = NULL; + struct edma_rxfill_ring *rxfill_ring = NULL; + struct edma_txcmpl_ring *txcmpl_ring = NULL; + int i; + + for (i = 0; i < edma_hw.rxfill_rings; i++) { + rxfill_ring = &edma_hw.rxfill_ring[i]; + edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), + edma_hw.rxfill_intr_mask); + } + + for (i = 0; i < edma_hw.txcmpl_rings; i++) { + txcmpl_ring = &edma_hw.txcmpl_ring[i]; + edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), + edma_hw.txcmpl_intr_mask); + } + + for (i = 0; i < edma_hw.rxdesc_rings; i++) { + rxdesc_ring = &edma_hw.rxdesc_ring[i]; + edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), + edma_hw.rxdesc_intr_mask); + } + + /* + * Enable MISC interrupt mask. + */ + edma_reg_write(EDMA_REG_MISC_INT_MASK, edma_hw.misc_intr_mask); +} + /* * nss_dp_edma_if_open() * Do slow path data plane open @@ -85,6 +155,12 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc, return NSS_DP_SUCCESS; napi_enable(&edma_hw.napi); + + /* + * Enable the interrupt masks. + */ + edma_enable_interrupts(); + return NSS_DP_SUCCESS; } @@ -97,6 +173,11 @@ static int edma_if_close(struct nss_dp_data_plane_ctx *dpc) if (--edma_hw.active != 0) return NSS_DP_SUCCESS; + /* + * Disable the interrupt masks. + */ + edma_disable_interrupts(); + /* * Disable NAPI */ @@ -311,9 +392,6 @@ static int edma_if_deinit(struct nss_dp_data_plane_ctx *dpc) */ static int edma_irq_init(void) { - struct edma_rxdesc_ring *rxdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - struct edma_txcmpl_ring *txcmpl_ring = NULL; int err; uint32_t entry_num, i; @@ -433,28 +511,6 @@ static int edma_irq_init(void) goto misc_intr_req_fail; } - /* - * Set interrupt mask - */ - for (i = 0; i < edma_hw.rxfill_rings; i++) { - rxfill_ring = &edma_hw.rxfill_ring[i]; - edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), - edma_hw.rxfill_intr_mask); - } - - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - txcmpl_ring = &edma_hw.txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - edma_hw.txcmpl_intr_mask); - } - - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - rxdesc_ring = &edma_hw.rxdesc_ring[i]; - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - edma_hw.rxdesc_intr_mask); - } - - edma_reg_write(EDMA_REG_MISC_INT_MASK, edma_hw.misc_intr_mask); return 0; misc_intr_req_fail: diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h index 226c024fb..ac6593ac2 100644 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h +++ b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016, 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016, 2018-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -30,7 +30,7 @@ #define EDMA_NAPI_WORK 100 #define EDMA_START_GMACS NSS_DP_START_IFNUM #define EDMA_MAX_GMACS NSS_DP_HAL_MAX_PORTS -#define EDMA_TX_PKT_MIN_SIZE 33 +#define EDMA_TX_PKT_MIN_SIZE 33 /* IPQ807x EDMA needs a minimum packet size of 33 bytes */ #if defined(NSS_DP_IPQ60XX) #define EDMA_MAX_TXCMPL_RINGS 24 /* Max TxCmpl rings */ #else diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c index eeae567d1..0f42a7e50 100644 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c +++ b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018, 2020-21, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -524,7 +524,7 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw, { struct nss_dp_dev *dp_dev = netdev_priv(netdev); struct edma_txdesc_desc *txdesc = NULL; - uint16_t buf_len = skb_headlen(skb); + uint16_t buf_len; uint16_t hw_next_to_use, hw_next_to_clean, chk_idx; uint32_t data; uint32_t store_index = 0; @@ -560,6 +560,28 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw, return EDMA_TX_DESC; } +#if defined(NSS_DP_EDMA_TX_SMALL_PKT_WAR) + /* + * IPQ807x EDMA hardware can't process the packet if the packet size is + * less than EDMA_TX_PKT_MIN_SIZE (33 Byte). So, if the packet size + * is indeed less than EDMA_TX_PKT_MIN_SIZE, perform padding + * (if possible), otherwise drop the packet. + * Using skb_padto() API for padding the packet. This API will drop + * the packet if the padding is not possible. + */ + if (unlikely(skb->len < EDMA_TX_PKT_MIN_SIZE)) { + if (skb_padto(skb, EDMA_TX_PKT_MIN_SIZE)) { + netdev_dbg(netdev, "padding couldn't happen, skb is freed.\n"); + netdev->stats.tx_dropped++; + spin_unlock_bh(&txdesc_ring->tx_lock); + return EDMA_TX_OK; + } + skb->len = EDMA_TX_PKT_MIN_SIZE; + } +#endif + + buf_len = skb_headlen(skb); + /* * Deliver the ptp packet to phy driver for TX timestamping */ diff --git a/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c b/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c index 8c63a4988..68bc7697f 100644 --- a/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c +++ b/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -208,6 +208,10 @@ static int nss_dp_attr_set(struct net_device *dev, struct switchdev_trans *trans) { struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev); + struct net_device *upper_dev; + struct vlan_dev_priv *vlan; + struct list_head *iter; + uint32_t stp_state = attr->u.stp_state; if (switchdev_trans_ph_prepare(trans)) return 0; @@ -218,7 +222,33 @@ static int nss_dp_attr_set(struct net_device *dev, netdev_dbg(dev, "set brport_flags %lu\n", attr->u.brport_flags); return 0; case SWITCHDEV_ATTR_ID_PORT_STP_STATE: - return nss_dp_stp_state_set(dp_priv, attr->u.stp_state); + /* + * The stp state is not changed to FAL_STP_DISABLED if + * the net_device (dev) has any vlan configured. Otherwise + * traffic on other vlan(s) will not work. + * + * Note: STP for VLANs is not supported by PPE. + */ + if ((stp_state == BR_STATE_DISABLED) || + (stp_state == BR_STATE_BLOCKING)) { + rcu_read_lock(); + netdev_for_each_upper_dev_rcu(dev, upper_dev, iter) { + if (!is_vlan_dev(upper_dev)) + continue; + + vlan = vlan_dev_priv(upper_dev); + if (vlan->real_dev == dev) { + rcu_read_unlock(); + netdev_dbg(dev, "Do not update stp state to: %u since vlan id: %d is configured on netdevice: %s\n", + stp_state, vlan->vlan_id, vlan->real_dev->name); + return 0; + } + } + + rcu_read_unlock(); + } + + return nss_dp_stp_state_set(dp_priv, stp_state); default: return -EOPNOTSUPP; } diff --git a/feeds/ipq807x/qca-nss-drv/Makefile b/feeds/ipq807x/qca-nss-drv/Makefile index 7854aa08b..71d73b564 100644 --- a/feeds/ipq807x/qca-nss-drv/Makefile +++ b/feeds/ipq807x/qca-nss-drv/Makefile @@ -46,7 +46,7 @@ ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64 endif endef -EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp +EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp -I$(STAGING_DIR)/usr/include/qca-ssdk # Keeping default as ipq806x for branches that does not have subtarget framework subtarget:=$(SUBTARGET) diff --git a/feeds/ipq807x/qca-nss-drv/src/Makefile b/feeds/ipq807x/qca-nss-drv/src/Makefile index c70fb90d2..f5c4b9040 100644 --- a/feeds/ipq807x/qca-nss-drv/src/Makefile +++ b/feeds/ipq807x/qca-nss-drv/src/Makefile @@ -8,8 +8,6 @@ obj-m += qca-nss-drv.o # List the files that belong to the driver in alphabetical order. # qca-nss-drv-objs := \ - nss_bridge.o \ - nss_bridge_log.o \ nss_cmn.o \ nss_core.o \ nss_coredump.o \ @@ -29,16 +27,6 @@ qca-nss-drv-objs := \ nss_ipv4_stats.o \ nss_ipv4_strings.o \ nss_ipv4_log.o \ - nss_ipv4_reasm.o \ - nss_ipv4_reasm_stats.o \ - nss_ipv4_reasm_strings.o \ - nss_ipv6.o \ - nss_ipv6_stats.o \ - nss_ipv6_strings.o \ - nss_ipv6_log.o \ - nss_ipv6_reasm.o \ - nss_ipv6_reasm_stats.o \ - nss_ipv6_reasm_strings.o \ nss_log.o \ nss_lso_rx.o \ nss_lso_rx_stats.o \ @@ -70,21 +58,48 @@ qca-nss-drv-objs := \ nss_wifi_log.o \ nss_wifi_stats.o \ nss_wifi_vdev.o \ - nss_wifi_if.o \ - nss_wifi_if_stats.o \ nss_wifili.o \ nss_wifili_log.o \ nss_wifili_stats.o \ nss_wifili_strings.o \ - nss_wifi_mac_db.o \ - nss_wifi_ext_vdev.o \ - nss_wifi_ext_vdev_stats.o \ - nss_wifi_ext_vdev_log.o + nss_wifi_mac_db.o # Base NSS data plane/HAL support qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o qca-nss-drv-objs += nss_hal/nss_hal.o +ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n" +ccflags-y += -DNSS_DRV_BRIDGE_ENABLE +qca-nss-drv-objs += \ + nss_bridge.o \ + nss_bridge_log.o +endif + +ifneq "$(NSS_DRV_WIFI_EXT_VDEV_ENABLE)" "n" +ccflags-y += -DNSS_DRV_WIFI_EXT_VDEV_ENABLE +qca-nss-drv-objs += \ + nss_wifi_ext_vdev.o \ + nss_wifi_ext_vdev_stats.o \ + nss_wifi_ext_vdev_log.o +endif + +ifneq "$(NSS_DRV_WIFI_MESH_ENABLE)" "n" +ccflags-y += -DNSS_DRV_WIFI_MESH_ENABLE +qca-nss-drv-objs += \ + nss_wifi_mesh.o \ + nss_wifi_mesh_log.o \ + nss_wifi_mesh_stats.o \ + nss_wifi_mesh_strings.o +endif + +ifneq "$(NSS_DRV_IPV4_REASM_ENABLE)" "n" +ccflags-y += -DNSS_DRV_IPV4_REASM_ENABLE +qca-nss-drv-objs += \ + nss_ipv4_reasm.o \ + nss_ipv4_reasm_stats.o \ + nss_ipv4_reasm_strings.o +endif + ifneq "$(NSS_DRV_L2TP_ENABLE)" "n" ccflags-y += -DNSS_DRV_L2TP_ENABLE qca-nss-drv-objs += \ @@ -109,6 +124,22 @@ qca-nss-drv-objs += \ nss_pvxlan_stats.o endif +ifneq "$(NSS_DRV_IPV6_ENABLE)" "n" +ccflags-y += -DNSS_DRV_IPV6_ENABLE +qca-nss-drv-objs += \ + nss_ipv6.o \ + nss_ipv6_stats.o \ + nss_ipv6_strings.o \ + nss_ipv6_log.o +ifneq "$(NSS_DRV_IPV6_REASM_ENABLE)" "n" +ccflags-y += -DNSS_DRV_IPV6_REASM_ENABLE +qca-nss-drv-objs += \ + nss_ipv6_reasm.o \ + nss_ipv6_reasm_stats.o \ + nss_ipv6_reasm_strings.o +endif +endif + ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n" ccflags-y += -DNSS_DRV_TSTAMP_ENABLE qca-nss-drv-objs += \ @@ -121,7 +152,8 @@ ccflags-y += -DNSS_DRV_GRE_ENABLE qca-nss-drv-objs += \ nss_gre.o \ nss_gre_log.o \ - nss_gre_stats.o + nss_gre_stats.o \ + nss_gre_strings.o endif ifneq "$(NSS_DRV_GRE_REDIR_ENABLE)" "n" @@ -132,13 +164,17 @@ qca-nss-drv-objs += \ nss_gre_redir_lag_ds.o \ nss_gre_redir_lag_ds_log.o \ nss_gre_redir_lag_ds_stats.o \ + nss_gre_redir_lag_ds_strings.o \ nss_gre_redir_lag_us.o \ nss_gre_redir_lag_us_log.o \ nss_gre_redir_lag_us_stats.o \ + nss_gre_redir_lag_us_strings.o \ nss_gre_redir_stats.o \ + nss_gre_redir_strings.o \ nss_gre_redir_mark.o \ nss_gre_redir_mark_log.o \ - nss_gre_redir_mark_stats.o + nss_gre_redir_mark_stats.o \ + nss_gre_redir_mark_strings.o endif ifneq "$(NSS_DRV_GRE_TUNNEL_ENABLE)" "n" @@ -146,7 +182,8 @@ ccflags-y += -DNSS_DRV_GRE_TUNNEL_ENABLE qca-nss-drv-objs += \ nss_gre_tunnel.o \ nss_gre_tunnel_log.o \ - nss_gre_tunnel_stats.o + nss_gre_tunnel_stats.o \ + nss_gre_tunnel_strings.o endif ifneq "$(NSS_DRV_CAPWAP_ENABLE)" "n" @@ -255,7 +292,8 @@ ccflags-y += -DNSS_DRV_CLMAP_ENABLE qca-nss-drv-objs += \ nss_clmap.o \ nss_clmap_log.o \ - nss_clmap_stats.o + nss_clmap_stats.o \ + nss_clmap_strings.o endif @@ -272,7 +310,8 @@ ccflags-y += -DNSS_DRV_MATCH_ENABLE qca-nss-drv-objs += \ nss_match.o \ nss_match_log.o \ - nss_match_stats.o + nss_match_stats.o \ + nss_match_strings.o endif ifneq "$(NSS_DRV_MIRROR_ENABLE)" "n" @@ -280,7 +319,17 @@ ccflags-y += -DNSS_DRV_MIRROR_ENABLE qca-nss-drv-objs += \ nss_mirror.o \ nss_mirror_log.o \ - nss_mirror_stats.o + nss_mirror_stats.o \ + nss_mirror_strings.o +endif + +ifneq "$(NSS_DRV_UDP_ST_ENABLE)" "n" +ccflags-y += -DNSS_DRV_UDP_ST_ENABLE +qca-nss-drv-objs += \ + nss_udp_st.o \ + nss_udp_st_log.o \ + nss_udp_st_stats.o \ + nss_udp_st_strings.o endif ifeq ($(SoC),$(filter $(SoC),ipq806x)) @@ -330,6 +379,7 @@ qca-nss-drv-objs += nss_data_plane/nss_data_plane.o \ nss_ppe.o \ nss_ppe_log.o \ nss_ppe_stats.o \ + nss_ppe_strings.o \ nss_ppe_vp.o \ nss_ppe_vp_log.o \ nss_ppe_vp_stats.o @@ -341,7 +391,9 @@ ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n" ccflags-y += -DNSS_DRV_IPSEC_ENABLE qca-nss-drv-objs += \ nss_ipsec_cmn_log.o \ - nss_ipsec_cmn.o + nss_ipsec_cmn.o \ + nss_ipsec_cmn_stats.o \ + nss_ipsec_cmn_strings.o endif ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n" @@ -351,6 +403,8 @@ ccflags-y += -DNSS_DRV_DMA_ENABLE qca-nss-drv-objs += \ nss_crypto_cmn.o \ nss_crypto_cmn_log.o \ + nss_crypto_cmn_stats.o \ + nss_crypto_cmn_strings.o \ nss_dma.o \ nss_dma_log.o \ nss_dma_stats.o \ @@ -361,21 +415,26 @@ ifneq "$(NSS_DRV_DTLS_ENABLE)" "n" ccflags-y += -DNSS_DRV_DTLS_ENABLE qca-nss-drv-objs += \ nss_dtls_cmn.o \ - nss_dtls_cmn_log.o + nss_dtls_cmn_log.o \ + nss_dtls_cmn_stats.o \ + nss_dtls_cmn_strings.o endif ifneq "$(NSS_DRV_QVPN_ENABLE)" "n" ccflags-y += -DNSS_DRV_QVPN_ENABLE qca-nss-drv-objs += \ - nss_qvpn.o \ - nss_qvpn_stats.o \ - nss_qvpn_log.o + nss_qvpn.o \ + nss_qvpn_log.o \ + nss_qvpn_stats.o \ + nss_qvpn_strings.o endif ifneq "$(NSS_DRV_TLS_ENABLE)" "n" ccflags-y += -DNSS_DRV_TLS_ENABLE qca-nss-drv-objs += \ nss_tls.o \ - nss_tls_log.o + nss_tls_log.o \ + nss_tls_stats.o \ + nss_tls_strings.o endif endif @@ -411,21 +470,27 @@ ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n" ccflags-y += -DNSS_DRV_IPSEC_ENABLE qca-nss-drv-objs += \ nss_ipsec_cmn_log.o \ - nss_ipsec_cmn.o + nss_ipsec_cmn.o \ + nss_ipsec_cmn_stats.o \ + nss_ipsec_cmn_strings.o endif ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n" ccflags-y += -DNSS_DRV_CRYPTO_ENABLE qca-nss-drv-objs += \ nss_crypto_cmn.o \ - nss_crypto_cmn_log.o + nss_crypto_cmn_log.o \ + nss_crypto_cmn_stats.o \ + nss_crypto_cmn_strings.o endif ifneq "$(NSS_DRV_DTLS_ENABLE)" "n" ccflags-y += -DNSS_DRV_DTLS_ENABLE qca-nss-drv-objs += \ nss_dtls_cmn.o \ - nss_dtls_cmn_log.o + nss_dtls_cmn_log.o \ + nss_dtls_cmn_stats.o \ + nss_dtls_cmn_strings.o endif ccflags-y += -I$(obj)/nss_hal/ipq50xx -DNSS_HAL_IPQ50XX_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT endif @@ -433,7 +498,7 @@ endif ccflags-y += -I$(obj)/nss_hal/include -I$(obj)/nss_data_plane/include -I$(obj)/exports -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1 ccflags-y += -I$(obj)/nss_data_plane/hal/include ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1 -ccflags-y += -Werror +ccflags-y += -Wall -Werror KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION))) diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h old mode 100644 new mode 100755 index 1fa491972..ddf6b7c68 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h +++ b/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -65,7 +65,6 @@ #include "nss_wifi_vdev.h" #include "nss_n2h.h" #include "nss_rps.h" -#include "nss_wifi_if.h" #include "nss_portid.h" #include "nss_oam.h" #include "nss_dtls.h" @@ -100,6 +99,10 @@ #include "nss_lso_rx.h" #include "nss_wifi_mac_db_if.h" #include "nss_wifi_ext_vdev_if.h" +#include "nss_wifili_if.h" +#include "nss_ppe_vp.h" +#include "nss_wifi_mesh.h" +#include "nss_udp_st.h" #endif #endif /*__KERNEL__ */ @@ -120,7 +123,7 @@ #define NSS_MAX_PHYSICAL_INTERFACES 8 /**< Maximum number of physical interfaces. */ #define NSS_MAX_VIRTUAL_INTERFACES 16 /**< Maximum number of virtual interfaces. */ #define NSS_MAX_TUNNEL_INTERFACES 4 /**< Maximum number of tunnel interfaces. */ -#define NSS_MAX_SPECIAL_INTERFACES 68 /**< Maximum number of special interfaces. */ +#define NSS_MAX_SPECIAL_INTERFACES 69 /**< Maximum number of special interfaces. */ #define NSS_MAX_WIFI_RADIO_INTERFACES 3 /**< Maximum number of radio interfaces. */ /* @@ -271,511 +274,12 @@ #define NSS_DMA_INTERFACE (NSS_SPECIAL_IF_START + 66) /**< Special interface number for the DMA interface. */ #define NSS_WIFI_EXT_VDEV_INTERFACE (NSS_SPECIAL_IF_START + 67) - /**< Special interface number for WiFi extended virtual interface. */ - + /**< Special interface number for the Wi-Fi extended virtual interface. */ +#define NSS_UDP_ST_INTERFACE (NSS_SPECIAL_IF_START + 68) + /**< Special interface number for the UDP speed test interface. */ #ifdef __KERNEL__ /* only kernel will use. */ -/** - * Wireless Multimedia Extention Access Category to TID. @hideinitializer - */ -#define NSS_WIFILI_WME_AC_TO_TID(_ac) ( \ - ((_ac) == NSS_WIFILI_WME_AC_VO) ? 6 : \ - (((_ac) == NSS_WIFILI_WME_AC_VI) ? 5 : \ - (((_ac) == NSS_WIFILI_WME_AC_BK) ? 1 : \ - 0))) - -/** - * Wireless TID to Wireless Extension Multimedia Access Category. @hideinitializer - */ -#define NSS_WIFILI_TID_TO_WME_AC(_tid) ( \ - (((_tid) == 0) || ((_tid) == 3)) ? NSS_WIFILI_WME_AC_BE : \ - ((((_tid) == 1) || ((_tid) == 2)) ? NSS_WIFILI_WME_AC_BK : \ - ((((_tid) == 4) || ((_tid) == 5)) ? NSS_WIFILI_WME_AC_VI : \ - NSS_WIFILI_WME_AC_VO))) - -/** - * Converts the format of an IPv6 address from Linux to NSS. @hideinitializer - */ -#define IN6_ADDR_TO_IPV6_ADDR(ipv6, in6) \ - { \ - ((uint32_t *)ipv6)[0] = in6.in6_u.u6_addr32[0]; \ - ((uint32_t *)ipv6)[1] = in6.in6_u.u6_addr32[1]; \ - ((uint32_t *)ipv6)[2] = in6.in6_u.u6_addr32[2]; \ - ((uint32_t *)ipv6)[3] = in6.in6_u.u6_addr32[3]; \ - } - -/** - * Converts the format of an IPv6 address from NSS to Linux. @hideinitializer - */ -#define IPV6_ADDR_TO_IN6_ADDR(in6, ipv6) \ - { \ - in6.in6_u.u6_addr32[0] = ((uint32_t *)ipv6)[0]; \ - in6.in6_u.u6_addr32[1] = ((uint32_t *)ipv6)[1]; \ - in6.in6_u.u6_addr32[2] = ((uint32_t *)ipv6)[2]; \ - in6.in6_u.u6_addr32[3] = ((uint32_t *)ipv6)[3]; \ - } - -/** - * Format of an IPv6 address (16 * 8 bits). - */ -#define IPV6_ADDR_OCTAL_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" - -/** - * Prints an IPv6 address (16 * 8 bits). - */ -#define IPV6_ADDR_TO_OCTAL(ipv6) ((uint16_t *)ipv6)[0], ((uint16_t *)ipv6)[1], ((uint16_t *)ipv6)[2], ((uint16_t *)ipv6)[3], ((uint16_t *)ipv6)[4], ((uint16_t *)ipv6)[5], ((uint16_t *)ipv6)[6], ((uint16_t *)ipv6)[7] - -/* - * IPv4 rule sync reasons. - */ -#define NSS_IPV4_SYNC_REASON_STATS 0 /**< Rule for synchronizing statistics. */ -#define NSS_IPV4_SYNC_REASON_FLUSH 1 /**< Rule for flushing a cache entry. */ -#define NSS_IPV4_SYNC_REASON_EVICT 2 /**< Rule for evicting a cache entry. */ -#define NSS_IPV4_SYNC_REASON_DESTROY 3 - /**< Rule for destroying a cache entry (requested by the host OS). */ -#define NSS_IPV4_SYNC_REASON_PPPOE_DESTROY 4 - /**< Rule for destroying a cache entry that belongs to a PPPoE session. */ - -/** - * nss_ipv4_create - * Information for an IPv4 flow or connection create rule. - * - * All fields must be passed in host-endian order. - */ -struct nss_ipv4_create { - int32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - int32_t dest_interface_num; - /**< Destination interface number (virtual or physical). */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t flags; /**< Flags (if any) associated with this rule. */ - uint32_t from_mtu; /**< MTU of the incoming interface. */ - uint32_t to_mtu; /**< MTU of the outgoing interface. */ - uint32_t src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t src_ip_xlate; /**< Translated source IP address (used with SNAT). */ - int32_t src_port_xlate; /**< Translated source L4 port (used with SNAT). */ - uint32_t dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip_xlate; - /**< Translated destination IP address (used with DNAT). */ - int32_t dest_port_xlate; - /**< Translated destination L4 port (used with DNAT). */ - uint8_t src_mac[ETH_ALEN]; - /**< Source MAC address. */ - uint8_t dest_mac[ETH_ALEN]; - /**< Destination MAC address. */ - uint8_t src_mac_xlate[ETH_ALEN]; - /**< Translated source MAC address (post-routing). */ - uint8_t dest_mac_xlate[ETH_ALEN]; - /**< Translated destination MAC address (post-routing). */ - uint8_t flow_window_scale; /**< Window scaling factor (TCP). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_pppoe_if_exist; - /**< Flow direction: PPPoE interface exist flag. */ - int32_t flow_pppoe_if_num; - /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; /**< Ingress VLAN tag expected for this flow. */ - uint8_t return_window_scale; - /**< Window scaling factor of the return direction (TCP). */ - uint32_t return_max_window; - /**< Maximum window size of the return direction. */ - uint32_t return_end; - /**< Flow end for the return direction. */ - uint32_t return_max_end; - /**< Flow maximum end for the return direction. */ - uint32_t return_pppoe_if_exist; - /**< Return direction: PPPoE interface existence flag. */ - int32_t return_pppoe_if_num; - /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< Egress VLAN tag expected for this flow. */ - uint8_t spo_needed; /**< Indicates whether SPO is required. */ - uint32_t param_a0; /**< Custom parameter 0. */ - uint32_t param_a1; /**< Custom parameter 1. */ - uint32_t param_a2; /**< Custom parameter 2. */ - uint32_t param_a3; /**< Custom parameter 3. */ - uint32_t param_a4; /**< Custom parameter 4. */ - uint32_t qos_tag; /**< Deprecated, will be removed soon. */ - uint32_t flow_qos_tag; /**< QoS tag value for the flow direction. */ - uint32_t return_qos_tag; /**< QoS tag value for the return direction. */ - uint8_t dscp_itag; /**< DSCP marking tag. */ - uint8_t dscp_imask; /**< DSCP marking input mask. */ - uint8_t dscp_omask; /**< DSCP marking output mask. */ - uint8_t dscp_oval; /**< DSCP marking output value. */ - uint16_t vlan_itag; /**< VLAN marking tag. */ - uint16_t vlan_imask; /**< VLAN marking input mask. */ - uint16_t vlan_omask; /**< VLAN marking output mask. */ - uint16_t vlan_oval; /**< VLAN marking output value. */ - uint32_t in_vlan_tag[MAX_VLAN_DEPTH]; - /**< Ingress VLAN tag expected for this flow. */ - uint32_t out_vlan_tag[MAX_VLAN_DEPTH]; - /**< Egress VLAN tag expected for this flow. */ - uint8_t flow_dscp; /**< IP DSCP value for the flow direction. */ - uint8_t return_dscp; /**< IP DSCP value for the return direction. */ -}; - -/* - * IPv4 connection flags (to be used with nss_ipv4_create::flags). - */ -#define NSS_IPV4_CREATE_FLAG_NO_SEQ_CHECK 0x01 - /**< Rule for not checking sequence numbers. */ -#define NSS_IPV4_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< Rule that indicates pure bridge flow (no routing is involved). */ -#define NSS_IPV4_CREATE_FLAG_ROUTED 0x04 /**< Rule for a routed connection. */ - -#define NSS_IPV4_CREATE_FLAG_DSCP_MARKING 0x08 /**< Rule for DSCP marking. */ -#define NSS_IPV4_CREATE_FLAG_VLAN_MARKING 0x10 /**< Rule for VLAN marking. */ -#define NSS_IPV4_CREATE_FLAG_QOS_VALID 0x20 /**< Rule for QoS is valid. */ - -/** - * nss_ipv4_destroy - * Information for an IPv4 flow or connection destroy rule. - */ -struct nss_ipv4_destroy { - int32_t protocol; /**< L4 protocol ID. */ - uint32_t src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ -}; - -/* - * IPv6 rule sync reasons. - */ -#define NSS_IPV6_SYNC_REASON_STATS 0 /**< Rule for synchronizing statistics. */ -#define NSS_IPV6_SYNC_REASON_FLUSH 1 /**< Rule for flushing a cache entry. */ -#define NSS_IPV6_SYNC_REASON_EVICT 2 /**< Rule for evicting a cache entry. */ -#define NSS_IPV6_SYNC_REASON_DESTROY 3 - /**< Rule for destroying a cache entry (requested by the host OS). */ -#define NSS_IPV6_SYNC_REASON_PPPOE_DESTROY 4 - /**< Rule for destroying a cache entry that belongs to a PPPoE session. */ - -/** - * nss_ipv6_create - * Information for an IPv6 flow or connection create rule. - * - * All fields must be passed in host-endian order. - */ -struct nss_ipv6_create { - int32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - int32_t dest_interface_num; - /**< Destination interface number (virtual or physical). */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t flags; /**< Flags (if any) associated with this rule. */ - uint32_t from_mtu; /**< MTU of the incoming interface. */ - uint32_t to_mtu; /**< MTU of the outgoing interface. */ - uint32_t src_ip[4]; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip[4]; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint8_t src_mac[ETH_ALEN]; /**< Source MAC address. */ - uint8_t dest_mac[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t flow_window_scale; /**< Window scaling factor (TCP). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_pppoe_if_exist; - /**< Flow direction: PPPoE interface existence flag. */ - int32_t flow_pppoe_if_num; - /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; - /**< Ingress VLAN tag expected for this flow. */ - uint8_t return_window_scale; - /**< Window scaling factor (TCP) for the return direction. */ - uint32_t return_max_window; - /**< Maximum window size (TCP) for the return direction. */ - uint32_t return_end; - /**< End for the return direction. */ - uint32_t return_max_end; - /**< Maximum end for the return direction. */ - uint32_t return_pppoe_if_exist; - /**< Return direction: PPPoE interface exist flag. */ - int32_t return_pppoe_if_num; - /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< Egress VLAN tag expected for this flow. */ - uint32_t qos_tag; /**< Deprecated; will be removed soon. */ - uint32_t flow_qos_tag; /**< QoS tag value for flow direction. */ - uint32_t return_qos_tag; /**< QoS tag value for the return direction. */ - uint8_t dscp_itag; /**< DSCP marking tag. */ - uint8_t dscp_imask; /**< DSCP marking input mask. */ - uint8_t dscp_omask; /**< DSCP marking output mask. */ - uint8_t dscp_oval; /**< DSCP marking output value. */ - uint16_t vlan_itag; /**< VLAN marking tag. */ - uint16_t vlan_imask; /**< VLAN marking input mask. */ - uint16_t vlan_omask; /**< VLAN marking output mask. */ - uint16_t vlan_oval; /**< VLAN marking output value. */ - uint32_t in_vlan_tag[MAX_VLAN_DEPTH]; - /**< Ingress VLAN tag expected for this flow. */ - uint32_t out_vlan_tag[MAX_VLAN_DEPTH]; - /**< Egress VLAN tag expected for this flow. */ - uint8_t flow_dscp; /**< IP DSCP value for flow direction. */ - uint8_t return_dscp; /**< IP DSCP value for the return direction. */ -}; - -/* - * IPv6 connection flags (to be used with nss_ipv6_create::flags. - */ -#define NSS_IPV6_CREATE_FLAG_NO_SEQ_CHECK 0x1 - /**< Indicates that sequence numbers are not to be checked. */ -#define NSS_IPV6_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< Indicates that this is a pure bridge flow (no routing is involved). */ -#define NSS_IPV6_CREATE_FLAG_ROUTED 0x04 /**< Rule is for a routed connection. */ -#define NSS_IPV6_CREATE_FLAG_DSCP_MARKING 0x08 /**< Rule for DSCP marking. */ -#define NSS_IPV6_CREATE_FLAG_VLAN_MARKING 0x10 /**< Rule for VLAN marking. */ -#define NSS_IPV6_CREATE_FLAG_QOS_VALID 0x20 /**< Rule for Valid QoS. */ - -/** - * nss_ipv6_destroy - * Information for an IPv6 flow or connection destroy rule. - */ -struct nss_ipv6_destroy { - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t src_ip[4]; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip[4]; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ -}; - -/** - * nss_ipv4_sync - * Defines packet statistics for IPv4 and also keeps the connection entry alive. - * - * Statistics are bytes and packets seen over a connection. - * - * The addresses are NON-NAT addresses (i.e., true endpoint - * addressing). - * - * The source (src) creates the connection. - */ -struct nss_ipv4_sync { - uint32_t index; /**< Slot ID for cache statistics to host OS. */ - /*TODO: use an opaque information as host and NSS - may be using a different mechanism to store rules. */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t src_ip_xlate; /**< Translated source IP address (used with SNAT). */ - int32_t src_port_xlate; /**< Translated source L4 port (used with SNAT). */ - uint32_t dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip_xlate; - /**< Translated destination IP address (used with DNAT). */ - int32_t dest_port_xlate; - /**< Translated destination L4 port (used with DNAT). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_rx_packet_count; /**< Rx packet count for the flow interface. */ - uint32_t flow_rx_byte_count; /**< Rx byte count for the flow interface. */ - uint32_t flow_tx_packet_count; /**< Tx packet count for the flow interface. */ - uint32_t flow_tx_byte_count; /**< Tx byte count for the flow interface. */ - uint32_t return_max_window; - /**< Maximum window size (TCP) for the return direction. */ - uint32_t return_end; - /**< End for the return direction. */ - uint32_t return_max_end; - /**< Maximum end for the return direction. */ - uint32_t return_rx_packet_count; - /**< Rx packet count for the return direction. */ - uint32_t return_rx_byte_count; - /**< Rx byte count for the return direction. */ - uint32_t return_tx_packet_count; - /**< Tx packet count for the return direction. */ - uint32_t return_tx_byte_count; - /**< Tx byte count for the return direction. */ - - /** - * Time in Linux jiffies to be added to the current timeout to keep the - * connection alive. - */ - unsigned long int delta_jiffies; - - uint8_t reason; /**< Reason for synchronization. */ - uint32_t param_a0; /**< Custom parameter 0. */ - uint32_t param_a1; /**< Custom parameter 1. */ - uint32_t param_a2; /**< Custom parameter 2. */ - uint32_t param_a3; /**< Custom parameter 3. */ - uint32_t param_a4; /**< Custom parameter 4. */ - - uint8_t flags; /**< Flags indicating the status of the flow. */ - uint32_t qos_tag; /**< QoS value of the flow. */ -}; - -/** - * nss_ipv4_establish - * Defines connection-established message parameters for IPv4. - */ -struct nss_ipv4_establish { - uint32_t index; /**< Slot ID for cache statistics to host OS. */ - /*TODO: use an opaque information as host and NSS - may be using a different mechanism to store rules. */ - uint8_t protocol; /**< Protocol number. */ - uint8_t reserved[3]; /**< Padding for word alignment. */ - int32_t flow_interface; /**< Flow interface number. */ - uint32_t flow_mtu; /**< MTU for the flow interface. */ - uint32_t flow_ip; /**< Flow IP address. */ - uint32_t flow_ip_xlate; /**< Translated flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., port). */ - uint32_t flow_ident_xlate; /**< Translated flow identifier (e.g., port). */ - uint16_t flow_mac[3]; /**< Source MAC address for the flow direction. */ - uint32_t flow_pppoe_if_exist; /**< Flow direction: PPPoE interface existence flag. */ - int32_t flow_pppoe_if_num; /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; /**< Ingress VLAN tag. */ - int32_t return_interface; /**< Return interface number. */ - uint32_t return_mtu; /**< MTU for the return interface. */ - uint32_t return_ip; /**< Return IP address. */ - uint32_t return_ip_xlate; /**< Translated return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., port). */ - uint32_t return_ident_xlate; /**< Translated return identifier (e.g., port). */ - uint16_t return_mac[3]; /**< Source MAC address for the return direction. */ - uint32_t return_pppoe_if_exist; /**< Return direction: PPPoE interface existence flag. */ - int32_t return_pppoe_if_num; /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< Egress VLAN tag. */ - uint8_t flags; /**< Flags indicating the status of the flow. */ - uint32_t qos_tag; /**< QoS value of the flow. */ -}; - -/** - * nss_ipv4_cb_reason - * Reasons for an IPv4 callback. - */ -enum nss_ipv4_cb_reason { - NSS_IPV4_CB_REASON_ESTABLISH = 0, - NSS_IPV4_CB_REASON_SYNC, - NSS_IPV4_CB_REASON_ESTABLISH_FAIL, -}; - -/** - * nss_ipv4_cb_params - * Message parameters for an IPv4 callback. - */ -struct nss_ipv4_cb_params { - enum nss_ipv4_cb_reason reason; /**< Reason for the callback. */ - - /** - * Message parameters for an IPv4 callback. - */ - union { - struct nss_ipv4_sync sync; - /**< Parameters for synchronization. */ - struct nss_ipv4_establish establish; - /**< Parameters for establishing a connection. */ - } params; /**< Payload of parameters. */ -}; - -/** - * nss_ipv6_sync - * Update packet statistics (bytes and packets seen over a connection) and also keep the connection entry alive. - * - * The addresses are NON-NAT addresses (i.e., true endpoint addressing). - * - * The source (src) creates the connection. - */ -struct nss_ipv6_sync { - uint32_t index; /**< Slot ID for cache statistics to the host OS. */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t src_ip[4]; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip[4]; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_rx_packet_count; /**< Rx packet count for the flow interface. */ - uint32_t flow_rx_byte_count; /**< Rx byte count for the flow interface. */ - uint32_t flow_tx_packet_count; /**< Tx packet count for the flow interface. */ - uint32_t flow_tx_byte_count; /**< Tx byte count for the flow interface. */ - uint32_t return_max_window; - /**< Maximum window size (TCP) for the return direction. */ - uint32_t return_end; - /**< End for the return direction. */ - uint32_t return_max_end; - /**< Maximum end for the return direction. */ - uint32_t return_rx_packet_count; - /**< Rx packet count for the return direction. */ - uint32_t return_rx_byte_count; - /**< Rx byte count for the return direction. */ - uint32_t return_tx_packet_count; - /**< Tx packet count for the return direction. */ - uint32_t return_tx_byte_count; - /**< Tx byte count for the return direction. */ - - /** - * Time in Linux jiffies to be added to the current timeout to keep the - * connection alive. - */ - unsigned long int delta_jiffies; - - /** - * Non-zero when the NA has ceased to accelerate the given connection. - */ - uint8_t final_sync; - - uint8_t evicted; /**< Non-zero if the connection is evicted. */ - - uint8_t flags; /**< Flags indicating the status of the flow. */ - uint32_t qos_tag; /**< QoS value of the flow. */ -}; - -/** - * nss_ipv6_establish - * Defines connection-established message parameters for IPv6. - */ -struct nss_ipv6_establish { - uint32_t index; /**< Slot ID for cache statistics to the host OS. */ - uint8_t protocol; /**< Protocol number. */ - int32_t flow_interface; /**< Flow interface number. */ - uint32_t flow_mtu; /**< MTU for the flow interface. */ - uint32_t flow_ip[4]; /**< Flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., port). */ - uint16_t flow_mac[3]; /**< Source MAC address for the flow direction. */ - uint32_t flow_pppoe_if_exist; /**< Flow direction: PPPoE interface existence flag. */ - int32_t flow_pppoe_if_num; /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; /**< Ingress VLAN tag. */ - int32_t return_interface; /**< Return interface number. */ - uint32_t return_mtu; /**< MTU for the return interface. */ - uint32_t return_ip[4]; /**< Return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., port). */ - uint16_t return_mac[3]; /**< Source MAC address for the return direction. */ - uint32_t return_pppoe_if_exist; /**< Return direction: PPPoE interface existence flag. */ - int32_t return_pppoe_if_num; /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< VLAN tag to be inserted for egress direction. */ - uint8_t flags; /**< Flags indicating the status of the flow. */ - uint32_t qos_tag; /**< QoS value of the flow. */ -}; - -/** - * nss_ipv6_cb_reason - * Reasons for an IPv6 callback. - */ -enum nss_ipv6_cb_reason { - NSS_IPV6_CB_REASON_ESTABLISH = 0, - NSS_IPV6_CB_REASON_SYNC, - NSS_IPV6_CB_REASON_ESTABLISH_FAIL, -}; - -/** - * nss_ipv6_cb_params - * Message parameters for an IPv6 callback. - */ -struct nss_ipv6_cb_params { - enum nss_ipv6_cb_reason reason; /**< Reason for the callback. */ - - /** - * Message parameters for an IPv6 callback. - */ - union { - struct nss_ipv6_sync sync; - /**< Parameters for synchronization. */ - struct nss_ipv6_establish establish; - /**< Parameters for establishing a connection. */ - } params; /**< Callback parameters. */ -}; - /* * General utilities */ @@ -791,16 +295,6 @@ struct nss_ipv6_cb_params { */ typedef void (*nss_if_rx_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); -/** - * Callback function for IPv4 connection synchronization messages. - * - * @datatypes - * nss_ipv4_cb_params - * - * @param[in] nicb Pointer to the parameter structure for an NSS IPv4 callback. - */ -typedef void (*nss_ipv4_callback_t)(struct nss_ipv4_cb_params *nicb); - /** * nss_get_state * Gets the NSS state. diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h index 375b3504f..525fff524 100644 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h +++ b/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h @@ -139,8 +139,8 @@ struct nss_capwap_stats_msg { uint32_t rx_frag_timeout_drops; /**< Packets dropped because of a reassembly timeout. */ - uint32_t rx_queue_full_drops; - /**< Packets dropped because the queue is full. */ + uint32_t rx_n2h_drops; + /**< Packets dropped because of error in packet processing. */ uint32_t rx_n2h_queue_full_drops; /**< Packets dropped because the NSS-to-host queue is full. */ uint32_t rx_csum_drops; @@ -297,6 +297,14 @@ struct nss_capwap_flow_rule_msg { uint32_t flow_id; /**< Flow identification. */ }; +/** + * nss_capwap_enable_tunnel_msg + * Structure to update sibling interface number. + */ +struct nss_capwap_enable_tunnel_msg { + uint32_t sibling_if_num; /**< Sibling interface Number. */ +}; + /** * nss_capwap_msg * Data for sending and receiving CAPWAP messages. @@ -322,6 +330,8 @@ struct nss_capwap_msg { /**< Flow rule add message. */ struct nss_capwap_flow_rule_msg flow_rule_del; /**< Flow rule delete message. */ + struct nss_capwap_enable_tunnel_msg enable_tunnel; + /**< Enable tunnel message. */ } msg; /**< Message payload. */ }; @@ -358,8 +368,8 @@ struct nss_capwap_tunnel_stats { uint64_t rx_frag_timeout_drops; /**< Packets dropped because of a reassembly timeout. */ - uint64_t rx_queue_full_drops; - /**< Packets dropped because the queue is full. */ + uint64_t rx_n2h_drops; + /**< Packets dropped because of error in processing the packet. */ uint64_t rx_n2h_queue_full_drops; /**< Packets dropped because the NSS-to-host queue is full. */ uint64_t rx_csum_drops; @@ -374,6 +384,7 @@ struct nss_capwap_tunnel_stats { /* * Tx/encap stats */ + uint64_t tx_dropped_inner; /**refcnt); @@ -133,45 +149,62 @@ static nss_capwap_msg_callback_t nss_capwap_get_msg_callback(int32_t if_num, voi } /* - * nss_capwapmgr_update_stats() + * nss_capwap_update_stats() * Update per-tunnel stats for each CAPWAP interface. */ -static void nss_capwapmgr_update_stats(struct nss_capwap_handle *handle, struct nss_capwap_stats_msg *fstats) +static void nss_capwap_update_stats(struct nss_capwap_handle *handle, struct nss_capwap_stats_msg *fstats) { struct nss_capwap_tunnel_stats *stats; + enum nss_dynamic_interface_type type; stats = &handle->stats; + type = nss_capwap_get_interface_type(handle->if_num); - stats->rx_segments += fstats->rx_segments; - stats->dtls_pkts += fstats->dtls_pkts; + switch(type) { + case NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER: + stats->rx_segments += fstats->rx_segments; + stats->dtls_pkts += fstats->dtls_pkts; + stats->rx_dup_frag += fstats->rx_dup_frag; + stats->rx_oversize_drops += fstats->rx_oversize_drops; + stats->rx_frag_timeout_drops += fstats->rx_frag_timeout_drops; + stats->rx_n2h_drops += fstats->rx_n2h_drops; + stats->rx_n2h_queue_full_drops += fstats->rx_n2h_queue_full_drops; + stats->rx_mem_failure_drops += fstats->rx_mem_failure_drops; + stats->rx_csum_drops += fstats->rx_csum_drops; + stats->rx_malformed += fstats->rx_malformed; + stats->rx_frag_gap_drops += fstats->rx_frag_gap_drops; - stats->rx_dup_frag += fstats->rx_dup_frag; - stats->rx_oversize_drops += fstats->rx_oversize_drops; - stats->rx_frag_timeout_drops += fstats->rx_frag_timeout_drops; - stats->rx_queue_full_drops += fstats->rx_queue_full_drops; - stats->rx_n2h_queue_full_drops += fstats->rx_n2h_queue_full_drops; - stats->rx_mem_failure_drops += fstats->rx_mem_failure_drops; - stats->rx_csum_drops += fstats->rx_csum_drops; - stats->rx_malformed += fstats->rx_malformed; - stats->rx_frag_gap_drops += fstats->rx_frag_gap_drops; + /* + * Update pnode rx stats for OUTER node. + */ + stats->pnode_stats.rx_packets += fstats->pnode_stats.rx_packets; + stats->pnode_stats.rx_bytes += fstats->pnode_stats.rx_bytes; + stats->pnode_stats.rx_dropped += nss_cmn_rx_dropped_sum(&fstats->pnode_stats); + break; - stats->tx_segments += fstats->tx_segments; - stats->tx_queue_full_drops += fstats->tx_queue_full_drops; - stats->tx_mem_failure_drops += fstats->tx_mem_failure_drops; - stats->tx_dropped_sg_ref += fstats->tx_dropped_sg_ref; - stats->tx_dropped_ver_mis += fstats->tx_dropped_ver_mis; - stats->tx_dropped_hroom += fstats->tx_dropped_hroom; - stats->tx_dropped_dtls += fstats->tx_dropped_dtls; - stats->tx_dropped_nwireless += fstats->tx_dropped_nwireless; + case NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER: + stats->tx_segments += fstats->tx_segments; + stats->tx_queue_full_drops += fstats->tx_queue_full_drops; + stats->tx_mem_failure_drops += fstats->tx_mem_failure_drops; + stats->tx_dropped_sg_ref += fstats->tx_dropped_sg_ref; + stats->tx_dropped_ver_mis += fstats->tx_dropped_ver_mis; + stats->tx_dropped_hroom += fstats->tx_dropped_hroom; + stats->tx_dropped_dtls += fstats->tx_dropped_dtls; + stats->tx_dropped_nwireless += fstats->tx_dropped_nwireless; - /* - * add pnode stats now. - */ - stats->pnode_stats.rx_packets += fstats->pnode_stats.rx_packets; - stats->pnode_stats.rx_bytes += fstats->pnode_stats.rx_bytes; - stats->pnode_stats.rx_dropped += nss_cmn_rx_dropped_sum(&fstats->pnode_stats); - stats->pnode_stats.tx_packets += fstats->pnode_stats.tx_packets; - stats->pnode_stats.tx_bytes += fstats->pnode_stats.tx_bytes; + /* + * Update pnode tx stats for INNER node. + */ + stats->pnode_stats.tx_packets += fstats->pnode_stats.tx_packets; + stats->pnode_stats.tx_bytes += fstats->pnode_stats.tx_bytes; + stats->tx_dropped_inner += nss_cmn_rx_dropped_sum(&fstats->pnode_stats); + break; + + default: + nss_warning("%px: Received invalid dynamic interface type: %d", handle, type); + nss_assert(0); + return; + } /* * Set to 1 when the tunnel is operating in fast memory. @@ -217,7 +250,7 @@ static void nss_capwap_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_ /* * Update driver statistics and send statistics notifications to the registered modules. */ - nss_capwapmgr_update_stats(nss_capwap_hdl[if_num], &ntm->msg.stats); + nss_capwap_update_stats(nss_capwap_hdl[if_num], &ntm->msg.stats); nss_capwap_stats_notify(ncm->interface, nss_ctx->id); } } @@ -262,23 +295,23 @@ static bool nss_capwap_instance_alloc(struct nss_ctx_instance *nss_ctx, uint32_t memset(h, 0, sizeof(struct nss_capwap_handle)); h->if_num = if_num; - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); kfree(h); nss_warning("%px: Another thread is already allocated instance for :%d", nss_ctx, if_num); return false; } nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] = h; - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return true; } /* * nss_capwap_tx_msg() - * Transmit a CAPWAP message to NSS FW. Don't call this from softirq/interrupts. + * Transmit a CAPWAP message to NSS FW. Don't call this from softirq/interrupts. */ nss_tx_status_t nss_capwap_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_capwap_msg *msg) { @@ -299,14 +332,14 @@ nss_tx_status_t nss_capwap_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_c } if_num = msg->cm.interface - NSS_DYNAMIC_IF_START; - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (!nss_capwap_hdl[if_num]) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); nss_warning("%px: capwap tunnel if_num is not there: %d", nss_ctx, msg->cm.interface); return NSS_TX_FAILURE_BAD_PARAM; } nss_capwap_refcnt_inc(msg->cm.interface); - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); /* * Trace messages. @@ -348,14 +381,14 @@ bool nss_capwap_get_stats(uint32_t if_num, struct nss_capwap_tunnel_stats *stats } if_num = if_num - NSS_DYNAMIC_IF_START; - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (nss_capwap_hdl[if_num] == NULL) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return false; } memcpy(stats, &nss_capwap_hdl[if_num]->stats, sizeof(struct nss_capwap_tunnel_stats)); - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return true; } EXPORT_SYMBOL(nss_capwap_get_stats); @@ -376,13 +409,13 @@ struct nss_ctx_instance *nss_capwap_notify_register(uint32_t if_num, nss_capwap_ return NULL; } - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); nss_warning("%px: notfiy register tunnel already exists for interface %d", nss_ctx, if_num); return NULL; } - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return nss_ctx; } @@ -410,9 +443,9 @@ nss_tx_status_t nss_capwap_notify_unregister(struct nss_ctx_instance *nss_ctx, u } index = if_num - NSS_DYNAMIC_IF_START; - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (nss_capwap_hdl[index] == NULL) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); nss_warning("%px: notify unregister received for unallocated if_num: %d", nss_ctx, if_num); return NSS_TX_FAILURE_BAD_PARAM; } @@ -421,14 +454,14 @@ nss_tx_status_t nss_capwap_notify_unregister(struct nss_ctx_instance *nss_ctx, u * It's the responsibility of caller to wait and call us again. We return failure saying * that we can't remove msg handler now. */ - if (nss_capwap_refcnt(if_num) != 0) { - spin_unlock(&nss_capwap_spinlock); + if (nss_capwap_refcnt_get(if_num) != 0) { + spin_unlock_bh(&nss_capwap_spinlock); nss_warning("%px: notify unregister tunnel %d: has reference", nss_ctx, if_num); return NSS_TX_FAILURE_QUEUE; } nss_capwap_set_msg_callback(if_num, NULL, NULL); - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return NSS_TX_SUCCESS; } @@ -449,12 +482,12 @@ struct nss_ctx_instance *nss_capwap_data_register(uint32_t if_num, nss_capwap_bu return NULL; } - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); if (nss_ctx->subsys_dp_register[if_num].ndev != NULL) { - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); return NULL; } - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); core_status = nss_core_register_handler(nss_ctx, if_num, nss_capwap_msg_handler, NULL); if (core_status != NSS_CORE_STATUS_SUCCESS) { @@ -488,18 +521,18 @@ bool nss_capwap_data_unregister(uint32_t if_num) return false; } - spin_lock(&nss_capwap_spinlock); + spin_lock_bh(&nss_capwap_spinlock); /* * It's the responsibility of caller to wait and call us again. */ - if (nss_capwap_refcnt(if_num) != 0) { - spin_unlock(&nss_capwap_spinlock); + if (nss_capwap_refcnt_get(if_num) != 0) { + spin_unlock_bh(&nss_capwap_spinlock); nss_warning("%px: notify unregister tunnel %d: has reference", nss_ctx, if_num); return false; } h = nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START]; nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] = NULL; - spin_unlock(&nss_capwap_spinlock); + spin_unlock_bh(&nss_capwap_spinlock); (void) nss_core_unregister_handler(nss_ctx, if_num); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c index af8d3671e..1d4387808 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c @@ -50,7 +50,7 @@ static ssize_t nss_capwap_stats_encap(char *line, int len, int i, struct nss_cap tcnt = s->tx_dropped_ver_mis; break; case 5: - tcnt = 0; + tcnt = s->tx_dropped_inner; break; case 6: tcnt = s->tx_dropped_hroom; @@ -114,7 +114,7 @@ static ssize_t nss_capwap_stats_decap(char *line, int len, int i, struct nss_cap tcnt = s->rx_frag_gap_drops; break; case 9: - tcnt = s->rx_queue_full_drops; + tcnt = s->rx_n2h_drops; return snprintf(line, len, "%s = %llu (n2h = %llu)\n", nss_capwap_strings_decap_stats[i].stats_name, tcnt, s->rx_n2h_queue_full_drops); case 10: tcnt = s->rx_n2h_queue_full_drops; @@ -166,12 +166,22 @@ static ssize_t nss_capwap_stats_read(struct file *fp, char __user *ubuf, size_t for (; if_num <= max_if_num; if_num++) { bool isthere; + enum nss_dynamic_interface_type dtype; if (nss_is_dynamic_interface(if_num) == false) { continue; } - if (nss_dynamic_interface_get_type(nss_capwap_get_ctx(), if_num) != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP) { + dtype = nss_dynamic_interface_get_type(nss_capwap_get_ctx(), if_num); + + /* + * Read encap stats from inner node and decap stats from outer node. + */ + if ((type == 1) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER)) { + continue; + } + + if ((type == 0) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER)) { continue; } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c index 6ed5b2a01..266cd50b8 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c @@ -32,7 +32,7 @@ struct nss_stats_info nss_capwap_strings_encap_stats[NSS_CAPWAP_STATS_ENCAP_MAX] {"tx_segments", NSS_STATS_TYPE_SPECIAL}, {"tx_drop_seg_ref", NSS_STATS_TYPE_DROP}, {"tx_drop_ver_mismatch",NSS_STATS_TYPE_DROP}, - {"tx_drop_unalign", NSS_STATS_TYPE_DROP}, + {"tx_dropped_inner", NSS_STATS_TYPE_DROP}, {"tx_drop_hroom", NSS_STATS_TYPE_DROP}, {"tx_drop_DTLS", NSS_STATS_TYPE_DROP}, {"tx_drop_nwireless", NSS_STATS_TYPE_DROP}, @@ -69,7 +69,7 @@ struct nss_stats_info nss_capwap_strings_decap_stats[NSS_CAPWAP_STATS_DECAP_MAX] {"rx_drop_frag_timeout",NSS_STATS_TYPE_DROP}, {"rx_drop_frag_dup", NSS_STATS_TYPE_DROP}, {"rx_drop_frag_gap", NSS_STATS_TYPE_DROP}, - {"rx_drop_qfull", NSS_STATS_TYPE_DROP}, + {"rx_drop_n2h", NSS_STATS_TYPE_DROP}, {"rx_drop_n2h_qfull", NSS_STATS_TYPE_DROP}, {"rx_drop_mem_fail", NSS_STATS_TYPE_DROP}, {"rx_drop_csum", NSS_STATS_TYPE_DROP}, diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c index 0d78a719a..777b71936 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -23,6 +23,7 @@ #include "nss_cmn.h" #include "nss_tx_rx_common.h" #include "nss_clmap_stats.h" +#include "nss_clmap_strings.h" #include "nss_clmap_log.h" #define NSS_CLMAP_TX_TIMEOUT 3000 @@ -106,6 +107,7 @@ static void nss_clmap_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_c switch (nclm->cm.type) { case NSS_CLMAP_MSG_TYPE_SYNC_STATS: nss_clmap_stats_sync(nss_ctx, &nclm->msg.stats, ncm->interface); + nss_clmap_stats_notify(nss_ctx, ncm->interface); break; } @@ -336,7 +338,9 @@ EXPORT_SYMBOL(nss_clmap_get_ctx); */ void nss_clmap_init() { - nss_clmap_stats_dentry_create(); sema_init(&clmap_pvt.sem, 1); init_completion(&clmap_pvt.complete); + + nss_clmap_stats_dentry_create(); + nss_clmap_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c index 717e697f0..a75bffffe 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -15,15 +15,25 @@ */ #include "nss_tx_rx_common.h" +#include "nss_clmap.h" #include "nss_clmap_stats.h" +#include "nss_clmap_strings.h" +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_clmap_stats_notifier); + +/* + * Spinlock to protect clmap statistics update/read + */ DEFINE_SPINLOCK(nss_clmap_stats_lock); struct nss_clmap_stats *stats_db[NSS_CLMAP_MAX_DEBUG_INTERFACES] = {NULL}; /* * nss_clmap_interface_type_str - * Clmap interface type string. + * Clmap interface type string. */ static char *nss_clmap_interface_type_str[NSS_CLMAP_INTERFACE_TYPE_MAX] = { "Upstream", @@ -31,34 +41,23 @@ static char *nss_clmap_interface_type_str[NSS_CLMAP_INTERFACE_TYPE_MAX] = { }; /* - * nss_clmap_stats_str - * Clmap statistics strings for nss tunnel stats + * nss_clmap_stats_session_unregister + * Unregister debug statistic for clmap session. */ -static char *nss_clmap_stats_str[NSS_CLMAP_INTERFACE_STATS_MAX] = { - "rx_pkts", - "rx_bytes", - "tx_pkts", - "tx_bytes", - "rx_queue_0_dropped", - "rx_queue_1_dropped", - "rx_queue_2_dropped", - "rx_queue_3_dropped", - "MAC DB look up failed", - "Invalid packet count", - "Headroom drop", - "Next node queue full drop", - "Pbuf alloc failed drop", - "Linear failed drop", - "Shared packet count", - "Ethernet frame error", - "Macdb create requests count", - "Macdb create failures MAC exists count", - "Macdb create failures MAC table full count", - "Macdb destroy requests count", - "Macdb destroy failures MAC not found count", - "Macdb destroy failures MAC unhashed count", - "Macdb flush requests count" -}; +void nss_clmap_stats_session_unregister(uint32_t if_num) +{ + uint32_t i; + + spin_lock_bh(&nss_clmap_stats_lock); + for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { + if (stats_db[i] && (stats_db[i]->nss_if_num == if_num)) { + kfree(stats_db[i]); + stats_db[i] = NULL; + break; + } + } + spin_unlock_bh(&nss_clmap_stats_lock); +} /* * nss_clmap_stats_session_register @@ -94,25 +93,6 @@ bool nss_clmap_stats_session_register(uint32_t if_num, uint32_t if_type, struct return stats_status; } -/* - * nss_clmap_stats_session_unregister - * Unregister debug statistic for clmap session. - */ -void nss_clmap_stats_session_unregister(uint32_t if_num) -{ - uint32_t i; - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (stats_db[i] && (stats_db[i]->nss_if_num == if_num)) { - kfree(stats_db[i]); - stats_db[i] = NULL; - break; - } - } - spin_unlock_bh(&nss_clmap_stats_lock); -} - /* * nss_clmap_get_debug_stats() * Get clmap debug statistics. @@ -142,12 +122,12 @@ static int nss_clmap_get_debug_stats(struct nss_clmap_stats *stats) static ssize_t nss_clmap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { - uint32_t max_output_lines = 2 + (NSS_CLMAP_INTERFACE_STATS_MAX * NSS_CLMAP_MAX_DEBUG_INTERFACES + 2) + 2; + uint32_t max_output_lines = (NSS_CLMAP_INTERFACE_STATS_MAX * NSS_CLMAP_MAX_DEBUG_INTERFACES) + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; struct net_device *dev; - uint32_t id, i; + uint32_t id; struct nss_clmap_stats *clmap_stats = NULL; int interface_cnt; @@ -171,8 +151,7 @@ static ssize_t nss_clmap_stats_read(struct file *fp, char __user *ubuf, * Get clmap statistics. */ interface_cnt = nss_clmap_get_debug_stats(clmap_stats); - size_wr = scnprintf(lbuf + size_wr, size_al - size_wr, - "\n clmap Interface statistics start:\n\n"); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "clmap stats", NSS_STATS_SINGLE_CORE); for (id = 0; id < interface_cnt; id++) { struct nss_clmap_stats *clmsp = clmap_stats + id; @@ -190,16 +169,10 @@ static ssize_t nss_clmap_stats_read(struct file *fp, char __user *ubuf, clmsp->nss_if_num, nss_clmap_interface_type_str[clmsp->nss_if_type], dev->name); dev_put(dev); - for (i = 0; i < NSS_CLMAP_INTERFACE_STATS_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", nss_clmap_stats_str[i], - clmsp->stats[i]); - } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); + size_wr += nss_stats_print("clmap", NULL, NSS_STATS_SINGLE_INSTANCE, nss_clmap_strings_stats, + clmsp->stats, NSS_CLMAP_INTERFACE_STATS_MAX, lbuf, size_wr, size_al); } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\n clmap Interface statistics end\n"); bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); kfree(clmap_stats); @@ -272,3 +245,52 @@ void nss_clmap_stats_dentry_create(void) { nss_stats_create_dentry("clmap", &nss_clmap_stats_ops); } + +/* + * nss_clmap_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_clmap_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_clmap_stats_notification clmap_stats; + struct nss_clmap_stats *s = NULL; + int i; + + spin_lock_bh(&nss_clmap_stats_lock); + for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { + if (!stats_db[i] || (stats_db[i]->nss_if_num != if_num)) { + continue; + } + + s = stats_db[i]; + clmap_stats.core_id = nss_ctx->id; + clmap_stats.if_num = if_num; + memcpy(clmap_stats.stats_ctx, s->stats, sizeof(clmap_stats.stats_ctx)); + spin_unlock_bh(&nss_clmap_stats_lock); + atomic_notifier_call_chain(&nss_clmap_stats_notifier, NSS_STATS_EVENT_NOTIFY, &clmap_stats); + return; + } + spin_unlock_bh(&nss_clmap_stats_lock); +} + +/* + * nss_clmap_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_clmap_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_clmap_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_clmap_stats_unregister_notifier); + +/* + * nss_clmap_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_clmap_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_clmap_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_clmap_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h index 4a1e1a33c..89f687dab 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -19,51 +19,12 @@ #define NSS_CLMAP_MAX_DEBUG_INTERFACES 2 * NSS_CLMAP_MAX_INTERFACES -/* - * Clmap NSS interface type. - */ -enum nss_clmap_interface_type { - NSS_CLMAP_INTERFACE_TYPE_US, - NSS_CLMAP_INTERFACE_TYPE_DS, - NSS_CLMAP_INTERFACE_TYPE_MAX -}; - -/* - * Clmap statistic counters. - */ -enum nss_clmap_stats_type { - NSS_CLMAP_INTERFACE_STATS_RX_PKTS, - NSS_CLMAP_INTERFACE_STATS_RX_BYTES, - NSS_CLMAP_INTERFACE_STATS_TX_PKTS, - NSS_CLMAP_INTERFACE_STATS_TX_BYTES, - NSS_CLMAP_INTERFACE_STATS_RX_QUEUE_0_DROPPED, - NSS_CLMAP_INTERFACE_STATS_RX_QUEUE_1_DROPPED, - NSS_CLMAP_INTERFACE_STATS_RX_QUEUE_2_DROPPED, - NSS_CLMAP_INTERFACE_STATS_RX_QUEUE_3_DROPPED, - NSS_CLMAP_INTERFACE_STATS_DROPPED_MACDB_LOOKUP_FAILED, - NSS_CLMAP_INTERFACE_STATS_DROPPED_INVALID_PACKET_SIZE, - NSS_CLMAP_INTERFACE_STATS_DROPPED_LOW_HEADROOM, - NSS_CLMAP_INTERFACE_STATS_DROPPED_NEXT_NODE_QUEUE_FULL, - NSS_CLMAP_INTERFACE_STATS_DROPPED_PBUF_ALLOC_FAILED, - NSS_CLMAP_INTERFACE_STATS_DROPPED_LINEAR_FAILED, - NSS_CLMAP_INTERFACE_STATS_SHARED_PACKET_CNT, - NSS_CLMAP_INTERFACE_STATS_ETHERNET_FRAME_ERROR, - NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_REQUESTS_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_MAC_EXISTS_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_MAC_TABLE_FULL_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_REQUESTS_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_MAC_NOT_FOUND_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_MAC_UNHASHED_CNT, - NSS_CLMAP_INTERFACE_STATS_MACDB_FLUSH_REQUESTS_CNT, - NSS_CLMAP_INTERFACE_STATS_MAX, -}; - /* * Clmap session debug statistics. */ struct nss_clmap_stats { - uint64_t stats[NSS_CLMAP_INTERFACE_STATS_MAX]; - int32_t if_index; + uint64_t stats[NSS_CLMAP_INTERFACE_STATS_MAX]; /* Clmap statistics. */ + int32_t if_index; /* Interface index. */ uint32_t nss_if_num; /* NSS interface number. */ enum nss_clmap_interface_type nss_if_type; /* NSS interface type. */ bool valid; @@ -72,6 +33,7 @@ struct nss_clmap_stats { /* * Clmap statistics APIs. */ +extern void nss_clmap_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); extern bool nss_clmap_stats_session_register(uint32_t if_num, enum nss_clmap_interface_type if_type, struct net_device *netdev); extern void nss_clmap_stats_session_unregister(uint32_t if_num); extern void nss_clmap_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_clmap_stats_msg *stats_msg, uint32_t if_num); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c new file mode 100644 index 000000000..4a52b489a --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c @@ -0,0 +1,73 @@ +/* + ************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_clmap_strings.h" + +/* + * nss_clmap_strings_stats + * Clmap statistics strings for nss tunnel stats + */ +struct nss_stats_info nss_clmap_strings_stats[NSS_CLMAP_INTERFACE_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_bytes", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_bytes", NSS_STATS_TYPE_COMMON}, + {"rx_queue_0_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_1_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_2_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_3_dropped", NSS_STATS_TYPE_DROP}, + {"MAC DB look up failed", NSS_STATS_TYPE_SPECIAL}, + {"Invalid packet count", NSS_STATS_TYPE_SPECIAL}, + {"Headroom drop", NSS_STATS_TYPE_SPECIAL}, + {"Next node queue full drop", NSS_STATS_TYPE_SPECIAL}, + {"Pbuf alloc failed drop", NSS_STATS_TYPE_SPECIAL}, + {"Linear failed drop", NSS_STATS_TYPE_SPECIAL}, + {"Shared packet count", NSS_STATS_TYPE_SPECIAL}, + {"Ethernet frame error", NSS_STATS_TYPE_SPECIAL}, + {"Macdb create requests count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb create failures MAC exists count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb create failures MAC table full count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb destroy requests count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb destroy failures MAC not found count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb destroy failures MAC unhashed count", NSS_STATS_TYPE_SPECIAL}, + {"Macdb flush requests count", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_clmap_strings_read() + * Read clmap statistics names + */ +static ssize_t nss_clmap_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_clmap_strings_stats, NSS_CLMAP_INTERFACE_STATS_MAX); +} + +/* + * nss_clmap_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(clmap); + +/* + * nss_clmap_strings_dentry_create() + * Create clmap statistics strings debug entry. + */ +void nss_clmap_strings_dentry_create(void) +{ + nss_strings_create_dentry("clmap", &nss_clmap_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h new file mode 100644 index 000000000..dbdffba98 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h @@ -0,0 +1,25 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_CLMAP_STRINGS_H +#define __NSS_CLMAP_STRINGS_H + +#include "nss_clmap_stats.h" + +extern struct nss_stats_info nss_clmap_strings_stats[NSS_CLMAP_INTERFACE_STATS_MAX]; +extern void nss_clmap_strings_dentry_create(void); + +#endif /* __NSS_CLMAP_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c index 920a0e56f..258994f1d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -197,8 +197,7 @@ bool nss_cmn_interface_is_redirect(struct nss_ctx_instance *nss_ctx, int32_t int { enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_ctx, interface_num); - return type == NSS_DYNAMIC_INTERFACE_TYPE_WIFI - || type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H + return type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H || type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N || type == NSS_DYNAMIC_INTERFACE_TYPE_VIRTIF_DEPRECATED; } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_core.c b/feeds/ipq807x/qca-nss-drv/src/nss_core.c index 758004c17..eaea9ec15 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_core.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_core.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -1064,6 +1064,21 @@ static inline void nss_core_rx_pbuf(struct nss_ctx_instance *nss_ctx, struct n2h } } +/* + * nss_core_set_skb_classify() + * Set skb field to avoid ingress shaping. + */ +static inline void nss_core_set_skb_classify(struct sk_buff *nbuf) +{ +#ifdef CONFIG_NET_CLS_ACT +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) + nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); +#else + skb_set_tc_classify_offload(nbuf); +#endif +#endif +} + /* * nss_core_handle_nrfrag_skb() * Handled the processing of fragmented skb's @@ -1111,20 +1126,16 @@ static inline bool nss_core_handle_nr_frag_skb(struct nss_ctx_instance *nss_ctx, nbuf->len = payload_len; nbuf->priority = desc->pri; -/* - * TODO: Remove kernel version check when IGS is ported - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) #ifdef CONFIG_NET_CLS_ACT /* * Skip the ingress QoS for the packet if the descriptor has * ingress shaped flag set. */ if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); + nss_core_set_skb_classify(nbuf); } #endif -#endif + goto pull; } @@ -1156,19 +1167,14 @@ static inline bool nss_core_handle_nr_frag_skb(struct nss_ctx_instance *nss_ctx, nbuf->len = payload_len; nbuf->priority = desc->pri; -/* - * TODO: Remove kernel version check when IGS is ported - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) #ifdef CONFIG_NET_CLS_ACT /* * Skip the ingress QoS for the packet if the descriptor has * ingress shaped flag set. */ if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); + nss_core_set_skb_classify(nbuf); } -#endif #endif /* @@ -1276,19 +1282,14 @@ static inline bool nss_core_handle_linear_skb(struct nss_ctx_instance *nss_ctx, nbuf->priority = desc->pri; -/* - * TODO: Remove kernel version check when IGS is ported - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) #ifdef CONFIG_NET_CLS_ACT /* * Skip the ingress QoS for the packet if the descriptor has * ingress shaped flag set. */ if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); + nss_core_set_skb_classify(nbuf); } -#endif #endif /* @@ -1339,19 +1340,14 @@ static inline bool nss_core_handle_linear_skb(struct nss_ctx_instance *nss_ctx, nbuf->truesize = desc->payload_len; nbuf->priority = desc->pri; -/* - * TODO: Remove kernel version check when IGS is ported - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) #ifdef CONFIG_NET_CLS_ACT /* * Skip the ingress QoS for the packet if the descriptor has * ingress shaped flag set. */ if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); + nss_core_set_skb_classify(nbuf); } -#endif #endif *head_ptr = nbuf; @@ -1735,9 +1731,11 @@ static void nss_core_init_nss(struct nss_ctx_instance *nss_ctx, struct nss_if_me * connections supported by the accelerator. */ nss_ipv4_conn_cfg = max_ipv4_conn; +#ifdef NSS_DRV_IPV6_ENABLE nss_ipv6_conn_cfg = max_ipv6_conn; - nss_ipv4_update_conn_count(max_ipv4_conn); nss_ipv6_update_conn_count(max_ipv6_conn); +#endif + nss_ipv4_update_conn_count(max_ipv4_conn); #ifdef NSS_MEM_PROFILE_LOW /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_core.h b/feeds/ipq807x/qca-nss-drv/src/nss_core.h index 4c39bdaa7..d7f62feff 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_core.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_core.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -568,6 +568,7 @@ struct nss_top_instance { uint8_t mirror_handler_id; uint8_t wmdb_handler_id; uint8_t dma_handler_id; + uint8_t udp_st_handler_id; /* * Data/Message callbacks for various interfaces @@ -903,6 +904,8 @@ struct nss_platform_data { /* Does this core handle TLS Tunnel ? */ enum nss_feature_enabled mirror_enabled; /* Does this core handle mirror? */ + enum nss_feature_enabled udp_st_enabled; + /* Does this core handle udp st? */ }; #endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c index 4e6196983..35c4c8c86 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c @@ -21,6 +21,8 @@ #include "nss_tx_rx_common.h" #include "nss_crypto_cmn.h" +#include "nss_crypto_cmn_strings.h" +#include "nss_crypto_cmn_stats.h" #include "nss_crypto_cmn_log.h" /* @@ -94,6 +96,18 @@ static void nss_crypto_cmn_msg_handler(struct nss_ctx_instance *nss_ctx, struct */ nss_crypto_cmn_log_rx_msg(nim); + switch (nim->cm.type) { + case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_NODE_STATS: + case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_ENG_STATS: + case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_CTX_STATS: + /* + * Update driver statistics and send statistics + * notification to the registered modules. + */ + nss_crypto_cmn_stats_sync(nss_ctx, &nim->msg.stats); + nss_crypto_cmn_stats_notify(nss_ctx); + break; + } /* * Load, Test & call */ @@ -357,6 +371,9 @@ void nss_crypto_cmn_register_handler(void) sema_init(&g_nss_crypto_cmn.sem, 1); init_completion(&g_nss_crypto_cmn.complete); nss_core_register_handler(nss_ctx, NSS_CRYPTO_CMN_INTERFACE, nss_crypto_cmn_msg_handler, NULL); + + nss_crypto_cmn_stats_dentry_create(); + nss_crypto_cmn_strings_dentry_create(); } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c new file mode 100644 index 000000000..c30416634 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c @@ -0,0 +1,166 @@ +/* + ************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_core.h" +#include "nss_crypto_cmn_stats.h" +#include "nss_crypto_cmn_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_crypto_cmn_stats_notifier); + +/* + * Spinlock to protect CRYPTO_CMN statistics update/read + */ +DEFINE_SPINLOCK(nss_crypto_cmn_stats_lock); + +/* + * nss_crypto_cmn_stats + * crypto common statistics + */ +uint64_t nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_MAX]; + +/* + * nss_crypto_cmn_stats_read() + * Read crypto common statistics + */ +static ssize_t nss_crypto_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + int32_t i; + + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_CRYPTO_CMN_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; + size_t size_wr = 0; + ssize_t bytes_read = 0; + uint64_t *stats_shadow; + + char *lbuf = vzalloc(size_al); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return -ENOMEM; + } + + stats_shadow = vzalloc(NSS_CRYPTO_CMN_STATS_MAX * 8); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + vfree(lbuf); + return -ENOMEM; + } + + /* + * crypto common statistics + */ + spin_lock_bh(&nss_crypto_cmn_stats_lock); + for (i = 0; i < NSS_CRYPTO_CMN_STATS_MAX; i++) + stats_shadow[i] = nss_crypto_cmn_stats[i]; + + spin_unlock_bh(&nss_crypto_cmn_stats_lock); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "crypto_cmn", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_print("crypto_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_crypto_cmn_strings_stats, + stats_shadow, NSS_CRYPTO_CMN_STATS_MAX, lbuf, size_wr, size_al); + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + vfree(lbuf); + vfree(stats_shadow); + + return bytes_read; +} + +/* + * nss_crypto_cmn_stats_ops + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(crypto_cmn); + +/* + * nss_crypto_cmn_stats_dentry_create() + * Create crypto common statistics debug entry. + */ +void nss_crypto_cmn_stats_dentry_create(void) +{ + nss_stats_create_dentry("crypto_cmn", &nss_crypto_cmn_stats_ops); +} + +/* + * nss_crypto_cmn_stats_sync() + * Handle the syncing of NSS crypto common statistics. + */ +void nss_crypto_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_stats *nct) +{ + int j; + + spin_lock_bh(&nss_crypto_cmn_stats_lock); + + /* + * Common node stats + */ + nss_crypto_cmn_stats[NSS_STATS_NODE_RX_PKTS] += nct->nstats.rx_packets; + nss_crypto_cmn_stats[NSS_STATS_NODE_RX_BYTES] += nct->nstats.rx_bytes; + nss_crypto_cmn_stats[NSS_STATS_NODE_TX_PKTS] += nct->nstats.tx_packets; + nss_crypto_cmn_stats[NSS_STATS_NODE_TX_BYTES] += nct->nstats.tx_bytes; + + for (j = 0; j < NSS_MAX_NUM_PRI; j++) + nss_crypto_cmn_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nct->nstats.rx_dropped[j]; + + /* + * crypto common statistics + */ + nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_VERSION] += nct->fail_version; + nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_CTX] += nct->fail_ctx; + nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_DMA] += nct->fail_dma; + + spin_unlock_bh(&nss_crypto_cmn_stats_lock); +} + +/* + * nss_crypto_cmn_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_crypto_cmn_stats_notify(struct nss_ctx_instance *nss_ctx) +{ + struct nss_crypto_cmn_stats_notification crypto_cmn_stats; + + crypto_cmn_stats.core_id = nss_ctx->id; + memcpy(crypto_cmn_stats.stats, nss_crypto_cmn_stats, sizeof(crypto_cmn_stats.stats)); + atomic_notifier_call_chain(&nss_crypto_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &crypto_cmn_stats); +} + +/* + * nss_crypto_cmn_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_crypto_cmn_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_crypto_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_crypto_cmn_stats_register_notifier); + +/* + * nss_crypto_cmn_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_crypto_cmn_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_crypto_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_crypto_cmn_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h new file mode 100644 index 000000000..6319c2cbb --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h @@ -0,0 +1,77 @@ +/* + ****************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * **************************************************************************** + */ + +#ifndef __NSS_CRYPTO_CMN_STATS_H +#define __NSS_CRYPTO_CMN_STATS_H + +#include + +/** + * nss_crypto_cmn_stats_types + * crypto common transmission node statistics + */ +enum nss_crypto_cmn_stats_types { + NSS_CRYPTO_CMN_STATS_FAIL_VERSION = NSS_STATS_NODE_MAX, /* version mismatch failures */ + NSS_CRYPTO_CMN_STATS_FAIL_CTX, /* context related failures */ + NSS_CRYPTO_CMN_STATS_FAIL_DMA, /* dma descriptor full */ + NSS_CRYPTO_CMN_STATS_MAX, /* Maximum message type */ +}; + +/** + * nss_crypto_cmn_stats_notification + * crypto common transmission statistics structure + */ +struct nss_crypto_cmn_stats_notification { + uint32_t core_id; /* core ID */ + uint64_t stats[NSS_CRYPTO_CMN_STATS_MAX]; /* transmission statistics */ +}; + +/* + * crypto common statistics APIs + */ +extern void nss_crypto_cmn_stats_notify(struct nss_ctx_instance *nss_ctx); +extern void nss_crypto_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_stats *nct); +extern void nss_crypto_cmn_stats_dentry_create(void); + +/** + * nss_crypto_cmn_stats_register_notifier + * Registers a statistics notifier. + * + * @datatypes + * notifier_block + * + * @param[in] nb Notifier block. + * + * @return + * 0 on success or -2 on failure. + */ +extern int nss_crypto_cmn_stats_register_notifier(struct notifier_block *nb); + +/** + * nss_crypto_cmn_stats_unregister_notifier + * Deregisters a statistics notifier. + * + * @datatypes + * notifier_block + * + * @param[in] nb Notifier block. + * + * @return + * 0 on success or -2 on failure. + */ +extern int nss_crypto_cmn_stats_unregister_notifier(struct notifier_block *nb); + +#endif /* __NSS_CRYPTO_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c new file mode 100644 index 000000000..42e8d8b85 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c @@ -0,0 +1,61 @@ +/* + ************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_crypto_cmn_strings.h" + +/* + * nss_crypto_cmn_strings_stats + * crypto common statistics strings. + */ +struct nss_stats_info nss_crypto_cmn_strings_stats[NSS_CRYPTO_CMN_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, + {"fail_version", NSS_STATS_TYPE_SPECIAL}, + {"fail_ctx", NSS_STATS_TYPE_SPECIAL}, + {"fail_dma", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_crypto_cmn_strings_read() + * Read crypto common node statistics names + */ +static ssize_t nss_crypto_cmn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_crypto_cmn_strings_stats, NSS_CRYPTO_CMN_STATS_MAX); +} + +/* + * nss_crypto_cmn_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(crypto_cmn); + +/* + * nss_crypto_cmn_strings_dentry_create() + * Create crypto common statistics strings debug entry. + */ +void nss_crypto_cmn_strings_dentry_create(void) +{ + nss_strings_create_dentry("crypto_cmn", &nss_crypto_cmn_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h new file mode 100644 index 000000000..aae067764 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h @@ -0,0 +1,25 @@ +/* + ************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_CRYPTO_CMN_STRINGS_H +#define __NSS_CRYPTO_CMN_STRINGS_H + +#include "nss_crypto_cmn_stats.h" + +extern struct nss_stats_info nss_crypto_cmn_strings_stats[NSS_CRYPTO_CMN_STATS_MAX]; +extern void nss_crypto_cmn_strings_dentry_create(void); + +#endif /* __NSS_CRYPTO_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h index 05bd6b5ad..aa46eadc7 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h @@ -17,6 +17,22 @@ #include "nss_phys_if.h" #include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) +#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ + | NETIF_F_HW_CSUM \ + | NETIF_F_RXCSUM \ + | NETIF_F_SG \ + | NETIF_F_FRAGLIST \ + | (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) +#else +#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ + | NETIF_F_HW_CSUM \ + | NETIF_F_RXCSUM \ + | NETIF_F_SG \ + | NETIF_F_FRAGLIST \ + | (NETIF_F_TSO | NETIF_F_TSO6)) +#endif + /* * nss_data_plane_param */ @@ -33,5 +49,6 @@ struct nss_data_plane_param { void nss_data_plane_hal_add_dp_ops(struct nss_dp_data_plane_ops *dp_ops); void nss_data_plane_hal_register(struct nss_ctx_instance *nss_ctx); void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx); +void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc); uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu); void nss_data_plane_hal_stats_sync(struct nss_data_plane_param *ndpp, struct nss_phys_if_stats *stats); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c index 1a07e8bde..980a06b62 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c @@ -55,6 +55,23 @@ void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) { } +/* + * nss_data_plane_hal_set_features + */ +void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) +{ + dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + + /* + * Synopsys GMAC does not support checksum offload for QinQ VLANs. + * Hence, we do not advertise checksum offload support for VLANs. + */ + dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES & + (~(NETIF_F_RXCSUM | NETIF_F_HW_CSUM)); +} + /* * nss_data_plane_hal_stats_sync() */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c index 2e2c3ea1b..d74df4cf8 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c @@ -83,6 +83,17 @@ void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) NSS_PTP_EVENT_SERVICE_CODE); } +/* + * nss_data_plane_hal_set_features + */ +void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) +{ + dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; +} + /* * nss_data_plane_hal_stats_sync() */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c index 1f97cbc0d..82fe2b0a1 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c @@ -83,6 +83,17 @@ void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) NSS_PTP_EVENT_SERVICE_CODE); } +/* + * nss_data_plane_hal_set_features + */ +void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) +{ + dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; +} + /* * nss_data_plane_hal_stats_sync() */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c index da116435b..16b7cbbc6 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c @@ -19,22 +19,6 @@ #include "nss_tx_rx_common.h" #include "nss_data_plane_hal.h" -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ - | NETIF_F_HW_CSUM \ - | NETIF_F_RXCSUM \ - | NETIF_F_SG \ - | NETIF_F_FRAGLIST \ - | (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) -#else -#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ - | NETIF_F_HW_CSUM \ - | NETIF_F_RXCSUM \ - | NETIF_F_SG \ - | NETIF_F_FRAGLIST \ - | (NETIF_F_TSO | NETIF_F_TSO6)) -#endif - /* * nss_data_plane_param */ @@ -228,10 +212,7 @@ drop: */ static void __nss_data_plane_set_features(struct nss_dp_data_plane_ctx *dpc) { - dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; + nss_data_plane_hal_set_features(dpc); } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma.c index a3c36f80b..e88e7c668 100755 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dma.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -120,7 +120,7 @@ static void nss_dma_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn */ if (ndm->cm.type == NSS_DMA_MSG_TYPE_SYNC_STATS) { nss_dma_stats_sync(nss_ctx, &ndm->msg.stats); - + nss_dma_stats_notify(nss_ctx); } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c index b38b4d2c5..12812e4e5 100755 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -17,9 +17,15 @@ */ #include "nss_core.h" +#include "nss_dma.h" #include "nss_dma_stats.h" #include "nss_dma_strings.h" +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_dma_stats_notifier); + /* * Spinlock to protect DMA statistics update/read */ @@ -117,3 +123,41 @@ void nss_dma_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_dma_stats * spin_unlock_bh(&nss_dma_stats_lock); } + +/* + * nss_dma_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_dma_stats_notify(struct nss_ctx_instance *nss_ctx) +{ + struct nss_dma_stats_notification dma_stats; + + spin_lock_bh(&nss_dma_stats_lock); + dma_stats.core_id = nss_ctx->id; + memcpy(dma_stats.stats_ctx, nss_dma_stats, sizeof(dma_stats.stats_ctx)); + spin_unlock_bh(&nss_dma_stats_lock); + + atomic_notifier_call_chain(&nss_dma_stats_notifier, NSS_STATS_EVENT_NOTIFY, &dma_stats); +} + +/* + * nss_dma_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_dma_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_dma_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_dma_stats_unregister_notifier); + +/* + * nss_dma_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_dma_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_dma_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_dma_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h index 548108e0f..a7fc1d859 100755 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -21,44 +21,10 @@ #include -/** - * nss_dma_stats_types - * DMA node statistics. - */ -enum nss_dma_stats_types { - NSS_DMA_STATS_NO_REQ = NSS_STATS_NODE_MAX, /**< Request descriptor not available. */ - NSS_DMA_STATS_NO_DESC, /**< DMA descriptors not available. */ - NSS_DMA_STATS_NEXTHOP, /**< Failed to retrive next hop. */ - NSS_DMA_STATS_FAIL_NEXTHOP_QUEUE, /**< Failed to queue next hop. */ - NSS_DMA_STATS_FAIL_LINEAR_SZ, /**< Failed to get memory for linearization. */ - NSS_DMA_STATS_FAIL_LINEAR_ALLOC, /**< Failed to allocate buffer for linearization. */ - NSS_DMA_STATS_FAIL_LINEAR_NO_SG, /**< Skip linearization due to non-SG packet. */ - NSS_DMA_STATS_FAIL_SPLIT_SZ, /**< Failed to spliting buffer into multiple buffers. */ - NSS_DMA_STATS_FAIL_SPLIT_ALLOC, /**< Failed to allocate buffer for split. */ - NSS_DMA_STATS_FAIL_SYNC_ALLOC, /**< Failed to allocate buffer for sending statistics. */ - NSS_DMA_STATS_FAIL_CTX_ACTIVE, /**< Failed to queue as the node is not active. */ - NSS_DMA_STATS_FAIL_HW_E0, /**< Failed to process in HW, error code E0. */ - NSS_DMA_STATS_FAIL_HW_E1, /**< Failed to process in HW, error code E1. */ - NSS_DMA_STATS_FAIL_HW_E2, /**< Failed to process in HW, error code E2. */ - NSS_DMA_STATS_FAIL_HW_E3, /**< Failed to process in HW, error code E3. */ - NSS_DMA_STATS_FAIL_HW_E4, /**< Failed to process in HW, error code E4. */ - NSS_DMA_STATS_FAIL_HW_E5, /**< Failed to process in HW, error code E5. */ - NSS_DMA_STATS_FAIL_HW_E6, /**< Failed to process in HW, error code E6. */ - NSS_DMA_STATS_FAIL_HW_E7, /**< Failed to process in HW, error code E7. */ - NSS_DMA_STATS_FAIL_HW_E8, /**< Failed to process in HW, error code E8. */ - NSS_DMA_STATS_FAIL_HW_E9, /**< Failed to process in HW, error code E9. */ - NSS_DMA_STATS_FAIL_HW_E10, /**< Failed to process in HW, error code E10. */ - NSS_DMA_STATS_FAIL_HW_E11, /**< Failed to process in HW, error code E11. */ - NSS_DMA_STATS_FAIL_HW_E12, /**< Failed to process in HW, error code E12. */ - NSS_DMA_STATS_FAIL_HW_E13, /**< Failed to process in HW, error code E13. */ - NSS_DMA_STATS_FAIL_HW_E14, /**< Failed to process in HW, error code E14. */ - NSS_DMA_STATS_FAIL_HW_E15, /**< Failed to process in HW, error code E15. */ - NSS_DMA_STATS_MAX, /**< Maximum message type. */ -}; - /* * DMA statistics APIs */ +extern void nss_dma_stats_notify(struct nss_ctx_instance *nss_ctx); extern void nss_dma_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_dma_stats *nds); extern void nss_dma_stats_dentry_create(void); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c index a70f23332..024d217d5 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -16,106 +16,22 @@ #include "nss_tx_rx_common.h" #include "nss_dtls_cmn_log.h" +#include "nss_dtls_cmn_stats.h" +#include "nss_dtls_cmn_strings.h" #define NSS_DTLS_CMN_TX_TIMEOUT 3000 /* 3 Seconds */ #define NSS_DTLS_CMN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) -#define NSS_DTLS_CMN_STATS_MAX_LINES (NSS_STATS_NODE_MAX + 32) -#define NSS_DTLS_CMN_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_DTLS_CMN_STATS_MAX_LINES) + /* * Private data structure. */ -static struct nss_dtls_cmn_cmn_pvt { +static struct nss_dtls_cmn_pvt { struct semaphore sem; struct completion complete; enum nss_dtls_cmn_error resp; unsigned long if_map[NSS_DTLS_CMN_INTERFACE_MAX_LONG]; } dtls_cmn_pvt; -/* - * nss_dtls_cmn_stats_sync() - * Update dtls_cmn node statistics. - */ -static void nss_dtls_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_dtls_cmn_msg *ndcm = (struct nss_dtls_cmn_msg *)ncm; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_dtls_cmn_ctx_stats *msg_stats = &ndcm->msg.stats; - uint64_t *if_stats; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats, - * Note: DTLS only supports a single queue for RX. - */ - if_stats = nss_top->stats_node[ncm->interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->pkt.rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->pkt.rx_bytes; - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED] += msg_stats->pkt.rx_dropped[0]; - - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->pkt.tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->pkt.tx_bytes; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_dtls_cmn_stats_read() - * Read dtls_cmn node statiistics. - */ -static ssize_t nss_dtls_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; - char *buf; - - size = NSS_DTLS_CMN_STATS_SIZE_PER_IF * bitmap_weight(dtls_cmn_pvt.if_map, NSS_MAX_NET_INTERFACES); - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Common node stats for each DTLS dynamic interface. - */ - for_each_set_bit(if_num, dtls_cmn_pvt.if_map, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - default: - len += scnprintf(buf + len, size - len, "\nUnknown(%d) if_num:%03u", type, if_num); - break; - } - - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "dtls_cmn"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - kfree(buf); - - return bytes_read; -} - -/* - * nss_dtls_cmn_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(dtls_cmn) - /* * nss_dtls_cmn_verify_ifnum() * Verify if the interface number is a DTLS interface. @@ -162,8 +78,10 @@ static void nss_dtls_cmn_handler(struct nss_ctx_instance *nss_ctx, struct nss_cm return; } - if (ncm->type == NSS_DTLS_CMN_MSG_TYPE_SYNC_STATS) + if (ncm->type == NSS_DTLS_CMN_MSG_TYPE_SYNC_STATS) { nss_dtls_cmn_stats_sync(nss_ctx, ncm); + nss_dtls_cmn_stats_notify(nss_ctx, ncm->interface); + } /* * Update the callback and app_data for NOTIFY messages. @@ -220,6 +138,15 @@ static void nss_dtls_cmn_callback(void *app_data, struct nss_cmn_msg *ncm) return; } +/* + * nss_dtls_cmn_ifmap_get() + * Return DTLS common active interfaces map. + */ +unsigned long *nss_dtls_cmn_ifmap_get(void) +{ + return dtls_cmn_pvt.if_map; +} + /* * nss_dtls_cmn_tx_buf() * Transmit buffer over DTLS interface. @@ -519,5 +446,6 @@ void nss_dtls_cmn_register_handler(void) { sema_init(&dtls_cmn_pvt.sem, 1); init_completion(&dtls_cmn_pvt.complete); - nss_stats_create_dentry("dtls_cmn", &nss_dtls_cmn_stats_ops); + nss_dtls_cmn_stats_dentry_create(); + nss_dtls_cmn_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c new file mode 100644 index 000000000..2908b28e3 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c @@ -0,0 +1,215 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_core.h" +#include "nss_dtls_cmn.h" +#include "nss_dtls_cmn_stats.h" +#include "nss_dtls_cmn_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_dtls_cmn_stats_notifier); + +/* + * Spinlock to protect dtls common statistics update/read + */ +DEFINE_SPINLOCK(nss_dtls_cmn_stats_lock); + +unsigned long *nss_dtls_cmn_ifmap_get(void); + +/* + * nss_dtls_cmn_ctx_stats + * dtls common ctx statistics + */ +uint64_t nss_dtls_cmn_ctx_stats[NSS_MAX_NET_INTERFACES][NSS_DTLS_CMN_CTX_STATS_MAX]; + +/* + * nss_dtls_cmn_stats_iface_type() + * Return a string for each interface type. + */ +static const char *nss_dtls_cmn_stats_iface_type(enum nss_dynamic_interface_type type) +{ + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER: + return "dtls_cmn_inner"; + + case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER: + return "dtls_cmn_outer"; + + default: + return "invalid_interface"; + + } +} + +/* + * nss_dtls_cmn_stats_read() + * Read dtls common node statistics. + */ +static ssize_t nss_dtls_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_DTLS_CMN_CTX_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; + struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); + enum nss_dynamic_interface_type type; + unsigned long *ifmap; + uint64_t *stats_shadow; + ssize_t bytes_read = 0; + size_t size_wr = 0; + uint32_t if_num; + int32_t i; + int count; + char *lbuf; + + ifmap = nss_dtls_cmn_ifmap_get(); + count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); + if (count) { + size_al = size_al * count; + } + + lbuf = vzalloc(size_al); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return -ENOMEM; + } + + stats_shadow = vzalloc(NSS_DTLS_CMN_CTX_STATS_MAX * 8); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + vfree(lbuf); + return -ENOMEM; + } + + /* + * Common node stats for each DTLS dynamic interface. + */ + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "dtls_cmn stats", NSS_STATS_SINGLE_CORE); + for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { + + type = nss_dynamic_interface_get_type(nss_ctx, if_num); + if ((type != NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER) && + (type != NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER)) { + continue; + } + + spin_lock_bh(&nss_dtls_cmn_stats_lock); + for (i = 0; i < NSS_DTLS_CMN_CTX_STATS_MAX; i++) { + stats_shadow[i] = nss_dtls_cmn_ctx_stats[if_num][i]; + } + spin_unlock_bh(&nss_dtls_cmn_stats_lock); + + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", + nss_dtls_cmn_stats_iface_type(type), if_num); + size_wr += nss_stats_print("dtls_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_dtls_cmn_ctx_stats_str, + stats_shadow, NSS_DTLS_CMN_CTX_STATS_MAX, lbuf, size_wr, size_al); + } + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + vfree(lbuf); + vfree(stats_shadow); + + return bytes_read; +} + +/* + * nss_dtls_cmn_stats_ops. + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(dtls_cmn); + +/* + * nss_dtls_cmn_stats_dentry_create() + * Create dtls common statistics debug entry. + */ +void nss_dtls_cmn_stats_dentry_create(void) +{ + nss_stats_create_dentry("dtls_cmn", &nss_dtls_cmn_stats_ops); +} + +/* + * nss_dtls_cmn_stats_sync() + * Update dtls common node statistics. + */ +void nss_dtls_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) +{ + struct nss_dtls_cmn_msg *ndcm = (struct nss_dtls_cmn_msg *)ncm; + struct nss_dtls_cmn_ctx_stats *ndccs = &ndcm->msg.stats; + uint64_t *ctx_stats; + uint32_t *msg_stats; + uint16_t i = 0; + + spin_lock_bh(&nss_dtls_cmn_stats_lock); + + msg_stats = (uint32_t *)ndccs; + ctx_stats = nss_dtls_cmn_ctx_stats[ncm->interface]; + + for (i = 0; i < NSS_DTLS_CMN_CTX_STATS_MAX; i++, ctx_stats++, msg_stats++) { + *ctx_stats += *msg_stats; + } + + spin_unlock_bh(&nss_dtls_cmn_stats_lock); +} + +/* + * nss_dtls_cmn_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_dtls_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_dtls_cmn_stats_notification *dtls_cmn_stats; + + dtls_cmn_stats = kmalloc(sizeof(struct nss_dtls_cmn_stats_notification), GFP_ATOMIC); + if (!dtls_cmn_stats) { + nss_warning("Unable to allocate memory for stats notification\n"); + return; + } + + spin_lock_bh(&nss_dtls_cmn_stats_lock); + dtls_cmn_stats->core_id = nss_ctx->id; + dtls_cmn_stats->if_num = if_num; + memcpy(dtls_cmn_stats->stats_ctx, nss_dtls_cmn_ctx_stats[if_num], sizeof(dtls_cmn_stats->stats_ctx)); + spin_unlock_bh(&nss_dtls_cmn_stats_lock); + + atomic_notifier_call_chain(&nss_dtls_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, dtls_cmn_stats); + kfree(dtls_cmn_stats); +} + +/* + * nss_dtls_cmn_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_dtls_cmn_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_dtls_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_dtls_cmn_stats_unregister_notifier); + +/* + * nss_dtls_cmn_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_dtls_cmn_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_dtls_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_dtls_cmn_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h new file mode 100644 index 000000000..80e6edfa4 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h @@ -0,0 +1,26 @@ +/* + **************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_DTLS_CMN_STATS_H +#define __NSS_DTLS_CMN_STATS_H + +#include + +extern void nss_dtls_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_dtls_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); +extern void nss_dtls_cmn_stats_dentry_create(void); + +#endif /* __NSS_DTLS_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c new file mode 100644 index 000000000..8fc91976a --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c @@ -0,0 +1,128 @@ +/* + **************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_dtls_cmn_strings.h" + +/* + * nss_dtls_cmn_ctx_stats_str + * dtls common ctx statistics strings. + */ +struct nss_stats_info nss_dtls_cmn_ctx_stats_str[NSS_DTLS_CMN_CTX_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, + {"rx_single_rec", NSS_STATS_TYPE_SPECIAL}, + {"rx_multi_rec", NSS_STATS_TYPE_SPECIAL}, + {"fail_crypto_resource", NSS_STATS_TYPE_DROP}, + {"fail_crypto_enqueue", NSS_STATS_TYPE_DROP}, + {"fail_headroom", NSS_STATS_TYPE_DROP}, + {"fail_tailroom", NSS_STATS_TYPE_DROP}, + {"fail_ver", NSS_STATS_TYPE_DROP}, + {"fail_epoch", NSS_STATS_TYPE_DROP}, + {"fail_dtls_record", NSS_STATS_TYPE_DROP}, + {"fail_capwap", NSS_STATS_TYPE_DROP}, + {"fail_replay", NSS_STATS_TYPE_DROP}, + {"fail_replay_dup", NSS_STATS_TYPE_DROP}, + {"fail_replay_win", NSS_STATS_TYPE_DROP}, + {"fail_queue", NSS_STATS_TYPE_DROP}, + {"fail_queue_nexthop", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_alloc", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_linear", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_stats", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_align", NSS_STATS_TYPE_DROP}, + {"fail_ctx_active", NSS_STATS_TYPE_DROP}, + {"fail_hwctx_active", NSS_STATS_TYPE_DROP}, + {"fail_cipher", NSS_STATS_TYPE_EXCEPTION}, + {"fail_auth", NSS_STATS_TYPE_EXCEPTION}, + {"fail_seq_ovf", NSS_STATS_TYPE_DROP}, + {"fail_blk_len", NSS_STATS_TYPE_DROP}, + {"fail_hash_len", NSS_STATS_TYPE_DROP}, + {"len_error", NSS_STATS_TYPE_DROP}, + {"token_error", NSS_STATS_TYPE_DROP}, + {"bypass_error", NSS_STATS_TYPE_DROP}, + {"config_error", NSS_STATS_TYPE_DROP}, + {"algo_error", NSS_STATS_TYPE_DROP}, + {"hash_ovf_error", NSS_STATS_TYPE_DROP}, + {"ttl_error", NSS_STATS_TYPE_DROP}, + {"csum_error", NSS_STATS_TYPE_DROP}, + {"timeout_error", NSS_STATS_TYPE_DROP}, + {"fail_cle_[0]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[1]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[2]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[3]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[4]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[5]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[6]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[7]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[8]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[9]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[10]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[11]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[12]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[13]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[14]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[15]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[16]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[17]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[18]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[19]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[20]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[21]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[22]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[23]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[24]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[25]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[26]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[27]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[28]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[29]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[30]", NSS_STATS_TYPE_DROP}, + {"fail_cle_[31]", NSS_STATS_TYPE_DROP}, + {"seq_low", NSS_STATS_TYPE_SPECIAL}, + {"seq_high", NSS_STATS_TYPE_SPECIAL}, + {"epoch", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_dtls_cmn_ctx_stats_str_strings_read() + * Read dtls common ctx statistics names + */ +static ssize_t nss_dtls_cmn_ctx_stats_str_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_dtls_cmn_ctx_stats_str, NSS_DTLS_CMN_CTX_STATS_MAX); +} + +/* + * nss_dtls_cmn_ctx_stats_str_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(dtls_cmn_ctx_stats_str); + +/* + * nss_dtls_cmn_strings_dentry_create() + * Create dtls common statistics strings debug entry. + */ +void nss_dtls_cmn_strings_dentry_create(void) +{ + nss_strings_create_dentry("dtls_cmn_ctx_stats_str", &nss_dtls_cmn_ctx_stats_str_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h new file mode 100644 index 000000000..0c0bc448d --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h @@ -0,0 +1,25 @@ +/* + **************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_DTLS_CMN_STRINGS_H +#define __NSS_DTLS_CMN_STRINGS_H + +#include "nss_dtls_cmn_stats.h" + +extern struct nss_stats_info nss_dtls_cmn_ctx_stats_str[NSS_DTLS_CMN_CTX_STATS_MAX]; +extern void nss_dtls_cmn_strings_dentry_create(void); + +#endif /* __NSS_DTLS_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c index b905a0576..1f190b645 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c @@ -26,10 +26,10 @@ const char *nss_dynamic_interface_type_names[NSS_DYNAMIC_INTERFACE_TYPE_MAX] = { "NSS_DYNAMIC_INTERFACE_TYPE_NONE", "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR", - "NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP", + "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_5", "NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER", "NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_WIFI", + "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED", "NSS_DYNAMIC_INTERFACE_TYPE_VAP", "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_0", "NSS_DYNAMIC_INTERFACE_TYPE_PPPOE", @@ -87,6 +87,8 @@ const char *nss_dynamic_interface_type_names[NSS_DYNAMIC_INTERFACE_TYPE_MAX] = { "NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N", "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0", "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1", + "NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER", + "NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER", }; /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c index bff4e5ccb..abb338e2a 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -732,6 +732,7 @@ void nss_edma_metadata_ring_stats_sync(struct nss_ctx_instance *nss_ctx, struct edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_DESC] += nerss->rx_ring[i].desc_cnt; edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_QOS_ERR] += nerss->rx_ring[i].qos_err; edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_SRC_PORT_INVALID] += nerss->rx_ring[i].rx_src_port_invalid; + edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_SRC_IF_INVALID] += nerss->rx_ring[i].rx_src_if_invalid; } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c index c441114e7..3d9c23352 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -78,7 +78,8 @@ struct nss_stats_info nss_edma_strings_stats_rx[NSS_EDMA_STATS_RX_MAX] = { {"rx_csum_err" , NSS_STATS_TYPE_ERROR}, {"desc_cnt" , NSS_STATS_TYPE_SPECIAL}, {"qos_err" , NSS_STATS_TYPE_DROP}, - {"rx_src_port_invalid" , NSS_STATS_TYPE_DROP} + {"rx_src_port_invalid" , NSS_STATS_TYPE_DROP}, + {"rx_src_interface_invalid" , NSS_STATS_TYPE_DROP} }; /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre.c index 0ab55c29f..46cd72c71 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,6 +17,7 @@ #include "nss_tx_rx_common.h" #include "nss_gre_stats.h" #include "nss_gre_log.h" +#include "nss_gre_strings.h" #define NSS_GRE_TX_TIMEOUT 3000 /* 3 Seconds */ @@ -115,11 +116,13 @@ static void nss_gre_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn /* * debug stats embedded in stats msg */ - nss_gre_stats_session_debug_sync(nss_ctx, &ntm->msg.sstats, ncm->interface); + nss_gre_stats_session_sync(nss_ctx, &ntm->msg.sstats, ncm->interface); + nss_gre_stats_session_notify(nss_ctx, ncm->interface); break; case NSS_GRE_MSG_BASE_STATS: - nss_gre_stats_base_debug_sync(nss_ctx, &ntm->msg.bstats); + nss_gre_stats_base_sync(nss_ctx, &ntm->msg.bstats); + nss_gre_stats_base_notify(nss_ctx); break; default: @@ -404,4 +407,5 @@ void nss_gre_register_handler(void) init_completion(&nss_gre_pvt.complete); nss_core_register_handler(nss_ctx, NSS_GRE_INTERFACE, nss_gre_msg_handler, NULL); nss_gre_stats_dentry_create(); + nss_gre_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c index 20bb69645..73e7c9fc3 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -16,6 +16,7 @@ #include "nss_tx_rx_common.h" #include "nss_gre_redir_stats.h" +#include "nss_gre_redir_strings.h" #include "nss_gre_redir_log.h" #define NSS_GRE_REDIR_TX_TIMEOUT 3000 /* 3 Seconds */ @@ -30,15 +31,10 @@ static struct { int response; } nss_gre_redir_pvt; -/* - * Spinlock to update tunnel stats. - */ -static DEFINE_SPINLOCK(nss_gre_redir_stats_lock); - /* * Array to hold tunnel stats along with if_num */ -static struct nss_gre_redir_tunnel_stats tun_stats[NSS_GRE_REDIR_MAX_INTERFACES]; +struct nss_gre_redir_tunnel_stats tun_stats[NSS_GRE_REDIR_MAX_INTERFACES]; /* * nss_gre_callback() @@ -59,7 +55,7 @@ static void nss_gre_redir_msg_sync_callback(void *app_data, struct nss_gre_redir * nss_gre_redir_verify_ifnum() * Verify interface type. */ -static bool nss_gre_redir_verify_ifnum(uint32_t if_num) +bool nss_gre_redir_verify_ifnum(uint32_t if_num) { uint32_t type; @@ -72,92 +68,6 @@ static bool nss_gre_redir_verify_ifnum(uint32_t if_num) type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS; } -/* - * nss_gre_redir_tunnel_update_stats() - * Update gre_redir tunnel stats. - */ -static void nss_gre_redir_tunnel_update_stats(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_stats_sync_msg *ngss) -{ - int i, j; - uint32_t type; - struct net_device *dev; - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return; - } - - if (!nss_gre_redir_verify_ifnum(if_num)) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - return; - } - - spin_lock_bh(&nss_gre_redir_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { - if (tun_stats[i].dev == dev) { - break; - } - } - - if (i == NSS_GRE_REDIR_MAX_INTERFACES) { - nss_warning("%px: Unable to find tunnel stats instance for interface %d\n", nss_ctx, if_num); - return; - } - - nss_assert(tun_stats[i].ref_count); - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER: - tun_stats[i].node_stats.tx_packets += ngss->node_stats.tx_packets; - tun_stats[i].node_stats.tx_bytes += ngss->node_stats.tx_bytes; - tun_stats[i].sjack_tx_packets += ngss->sjack_rx_packets; - tun_stats[i].encap_sg_alloc_drop += ngss->encap_sg_alloc_drop; - tun_stats[i].tx_dropped += nss_cmn_rx_dropped_sum(&(ngss->node_stats)); - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - tun_stats[i].offl_tx_pkts[j] += ngss->offl_rx_pkts[j]; - } - - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER: - tun_stats[i].node_stats.rx_packets += ngss->node_stats.rx_packets; - tun_stats[i].node_stats.rx_bytes += ngss->node_stats.rx_bytes; - tun_stats[i].sjack_rx_packets += ngss->sjack_rx_packets; - tun_stats[i].decap_fail_drop += ngss->decap_fail_drop; - tun_stats[i].decap_split_drop += ngss->decap_split_drop; - tun_stats[i].split_sg_alloc_fail += ngss->split_sg_alloc_fail; - tun_stats[i].split_linear_copy_fail += ngss->split_linear_copy_fail; - tun_stats[i].split_not_enough_tailroom += ngss->split_not_enough_tailroom; - tun_stats[i].decap_eapol_frames += ngss->decap_eapol_frames; - tun_stats[i].node_stats.rx_dropped[0] += nss_cmn_rx_dropped_sum(&(ngss->node_stats)); - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - tun_stats[i].offl_rx_pkts[j] += ngss->offl_rx_pkts[j]; - } - - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US: - tun_stats[i].exception_us_rx += ngss->node_stats.rx_packets; - tun_stats[i].exception_us_tx += ngss->node_stats.tx_packets; - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS: - tun_stats[i].exception_ds_rx += ngss->node_stats.rx_packets; - tun_stats[i].exception_ds_tx += ngss->node_stats.tx_packets; - tun_stats[i].exception_ds_invalid_dst_drop += ngss->exception_ds_invalid_dst_drop; - tun_stats[i].exception_ds_inv_appid += ngss->exception_ds_inv_appid; - tun_stats[i].headroom_unavail += ngss->headroom_unavail; - tun_stats[i].tx_completion_success += ngss->tx_completion_success; - tun_stats[i].tx_completion_drop += ngss->tx_completion_drop; - break; - } - - spin_unlock_bh(&nss_gre_redir_stats_lock); -} - /* * nss_gre_redir_handler() * Handle NSS -> HLOS messages for GRE tunnel. @@ -209,7 +119,8 @@ static void nss_gre_redir_msg_handler(struct nss_ctx_instance *nss_ctx, struct n switch (ncm->type) { case NSS_GRE_REDIR_RX_STATS_SYNC_MSG: - nss_gre_redir_tunnel_update_stats(nss_ctx, ncm->interface, &ngrm->msg.stats_sync); + nss_gre_redir_stats_sync(nss_ctx, ncm->interface, &ngrm->msg.stats_sync); + nss_gre_redir_stats_notify(nss_ctx, ncm->interface); break; } @@ -540,24 +451,6 @@ nss_tx_status_t nss_gre_redir_configure_outer_node(int ifnum, } EXPORT_SYMBOL(nss_gre_redir_configure_outer_node); -/* - * nss_gre_redir_get_stats() - * Get gre_redir tunnel stats. - */ -bool nss_gre_redir_get_stats(int index, struct nss_gre_redir_tunnel_stats *stats) -{ - spin_lock_bh(&nss_gre_redir_stats_lock); - if (tun_stats[index].ref_count == 0) { - spin_unlock_bh(&nss_gre_redir_stats_lock); - return false; - } - - memcpy(stats, &tun_stats[index], sizeof(struct nss_gre_redir_tunnel_stats)); - spin_unlock_bh(&nss_gre_redir_stats_lock); - return true; -} -EXPORT_SYMBOL(nss_gre_redir_get_stats); - /* * nss_gre_redir_tx_msg() * Transmit a GRE message to NSS FW. @@ -775,4 +668,6 @@ void nss_gre_redir_register_handler(void) nss_warning("%px: Not able to register handler for gre_redir base interface with NSS core\n", nss_ctx); return; } + + nss_gre_redir_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c index 2dc6b687b..ea4132013 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c @@ -1,6 +1,6 @@ /* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. + **************************************************************************** + * Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -11,17 +11,18 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** + **************************************************************************** */ #include "nss_tx_rx_common.h" +#include "nss_gre_redir_lag.h" #include "nss_gre_redir_lag_ds_stats.h" #include "nss_gre_redir_lag_ds_log.h" +#include "nss_gre_redir_lag_ds_strings.h" #define NSS_GRE_REDIR_LAG_DS_TX_TIMEOUT 3000 /* 3 Seconds */ -static struct nss_gre_redir_lag_ds_tun_stats tun_stats[NSS_GRE_REDIR_LAG_MAX_NODE]; -static DEFINE_SPINLOCK(nss_gre_redir_lag_ds_stats_lock); +struct nss_gre_redir_lag_ds_tun_stats tun_ds_stats[NSS_GRE_REDIR_LAG_MAX_NODE]; /* * Private data structure @@ -64,11 +65,11 @@ static void nss_gre_redir_lag_ds_callback(void *app_data, struct nss_gre_redir_l * nss_gre_redir_lag_ds_get_node_idx() * Returns index of statistics context. */ -static inline bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *idx) +bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *idx) { uint32_t node_idx; for (node_idx = 0; node_idx < NSS_GRE_REDIR_LAG_MAX_NODE; node_idx++) { - if ((tun_stats[node_idx].valid) && (tun_stats[node_idx].ifnum == ifnum)) { + if ((tun_ds_stats[node_idx].valid) && (tun_ds_stats[node_idx].ifnum == ifnum)) { *idx = node_idx; return true; } @@ -77,38 +78,11 @@ static inline bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *i return false; } -/* - * nss_gre_redir_lag_ds_update_sync_stats() - * Update synchonized statistics. - */ -static void nss_gre_redir_lag_ds_update_sync_stats(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_sync_stats_msg *ngss, uint32_t ifnum) -{ - int idx, j; - - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!nss_gre_redir_lag_ds_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - return; - } - - tun_stats[idx].tx_packets += ngss->node_stats.tx_packets; - tun_stats[idx].tx_bytes += ngss->node_stats.tx_bytes; - tun_stats[idx].rx_packets += ngss->node_stats.rx_packets; - tun_stats[idx].rx_bytes += ngss->node_stats.rx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - tun_stats[idx].rx_dropped[j] += ngss->node_stats.rx_dropped[j]; - } - tun_stats[idx].dst_invalid += ngss->ds_stats.dst_invalid; - tun_stats[idx].exception_cnt += ngss->ds_stats.exception_cnt; - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); -} - /* * nss_gre_redir_lag_ds_verify_ifnum() * Verify interface type. */ -static bool nss_gre_redir_lag_ds_verify_ifnum(uint32_t if_num) +bool nss_gre_redir_lag_ds_verify_ifnum(uint32_t if_num) { return nss_dynamic_interface_get_type(nss_gre_redir_lag_ds_get_context(), if_num) == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS; } @@ -162,7 +136,8 @@ static void nss_gre_redir_lag_ds_msg_handler(struct nss_ctx_instance *nss_ctx, s switch (ncm->type) { case NSS_GRE_REDIR_LAG_DS_STATS_SYNC_MSG: - nss_gre_redir_lag_ds_update_sync_stats(nss_ctx, &ngrm->msg.ds_sync_stats, ncm->interface); + nss_gre_redir_lag_ds_stats_sync(nss_ctx, &ngrm->msg.ds_sync_stats, ncm->interface); + nss_gre_redir_lag_ds_stats_notify(nss_ctx, ncm->interface); break; } @@ -217,7 +192,7 @@ static enum nss_gre_redir_lag_err_types nss_gre_redir_lag_ds_unregister_if(uint3 return NSS_GRE_REDIR_LAG_ERR_STATS_INDEX_NOT_FOUND; } - tun_stats[idx].valid = false; + tun_ds_stats[idx].valid = false; spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); return NSS_GRE_REDIR_LAG_SUCCESS; } @@ -258,9 +233,9 @@ static struct nss_ctx_instance *nss_gre_redir_lag_ds_register_if(uint32_t if_num nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); for (i = 0; i < NSS_GRE_REDIR_LAG_MAX_NODE; i++) { - if (!tun_stats[i].valid) { - tun_stats[i].ifnum = if_num; - tun_stats[i].valid = true; + if (!tun_ds_stats[i].valid) { + tun_ds_stats[i].ifnum = if_num; + tun_ds_stats[i].valid = true; break; } } @@ -280,26 +255,6 @@ struct nss_ctx_instance *nss_gre_redir_lag_ds_get_context(void) } EXPORT_SYMBOL(nss_gre_redir_lag_ds_get_context); -/* - * nss_gre_redir_lag_ds_get_cmn_stats() - * Get statistics for downstream LAG node. - */ -bool nss_gre_redir_lag_ds_get_cmn_stats(struct nss_gre_redir_lag_ds_tun_stats *cmn_stats, uint32_t index) -{ - if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) { - return false; - } - - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!tun_stats[index].valid) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - return false; - } - memcpy((void *)cmn_stats, (void *)&tun_stats[index], sizeof(*cmn_stats)); - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - return true; -} - /* * nss_gre_redir_lag_ds_tx_msg() * Transmit a gre message to NSS. @@ -441,6 +396,7 @@ void nss_gre_redir_lag_ds_register_handler(void) return; } + nss_gre_redir_lag_ds_strings_dentry_create(); nss_gre_redir_lag_ds_pvt.cb = NULL; nss_gre_redir_lag_ds_pvt.app_data = NULL; sema_init(&nss_gre_redir_lag_ds_pvt.sem, 1); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c index edba01527..76b3d7f83 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,69 +17,38 @@ #include "nss_core.h" #include "nss_gre_redir_lag.h" #include "nss_gre_redir_lag_ds_stats.h" +#include "nss_gre_redir_lag_ds_strings.h" /* - * nss_gre_redir_lag_ds_stats_str - * GRE REDIR LAG DS common statistics strings. + * Declare atomic notifier data structure for statistics. */ -static uint8_t *nss_gre_redir_lag_ds_stats_str[NSS_GRE_REDIR_LAG_DS_STATS_MAX] = { - "rx_packets", - "rx_bytes", - "tx_packets", - "tx_bytes", - "rx_queue_0_dropped", - "rx_queue_1_dropped", - "rx_queue_2_dropped", - "rx_queue_3_dropped", - "dst_invalid", - "exception_packets" -}; +ATOMIC_NOTIFIER_HEAD(nss_gre_redir_lag_ds_stats_notifier); /* - * nss_gre_redir_lag_ds_tunnel_stats() - * Make a row for GRE_REDIR LAG DS stats. + * Spinlock to protect GRE redirect lag ds statistics update/read */ -static ssize_t nss_gre_redir_lag_ds_cmn_stats_read_entry(char *line, int len, int type, struct nss_gre_redir_lag_ds_tun_stats *s) +DEFINE_SPINLOCK(nss_gre_redir_lag_ds_stats_lock); + +extern struct nss_gre_redir_lag_ds_tun_stats tun_ds_stats[NSS_GRE_REDIR_LAG_MAX_NODE]; + +/* + * nss_gre_redir_lag_ds_stats_get() + * Get statistics for downstream LAG node. + */ +bool nss_gre_redir_lag_ds_stats_get(struct nss_gre_redir_lag_ds_tun_stats *cmn_stats, uint32_t index) { - uint64_t tcnt = 0; + if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) + return false; - switch (type) { - case NSS_STATS_NODE_RX_PKTS: - tcnt = s->rx_packets; - return snprintf(line, len, "Common node stats start:\n\n%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_BYTES: - tcnt = s->rx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_TX_PKTS: - tcnt = s->tx_packets; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_TX_BYTES: - tcnt = s->tx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_0_DROPPED: - tcnt = s->rx_dropped[0]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); -#if (NSS_MAX_NUM_PRI > 1) - case NSS_STATS_NODE_RX_QUEUE_1_DROPPED: - tcnt = s->rx_dropped[1]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_2_DROPPED: - tcnt = s->rx_dropped[2]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_3_DROPPED: - tcnt = s->rx_dropped[3]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); -#endif - case NSS_GRE_REDIR_LAG_DS_STATS_DST_INVALID: - tcnt = s->dst_invalid; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_DS_STATS_EXCEPTION_PKT: - tcnt = s->exception_cnt; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_ds_stats_str[type], tcnt); - - default: - return 0; + spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); + if (!tun_ds_stats[index].valid) { + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); + return false; } + + memcpy((void *)cmn_stats, (void *)&tun_ds_stats[index], sizeof(*cmn_stats)); + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); + return true; } /* @@ -88,47 +57,45 @@ static ssize_t nss_gre_redir_lag_ds_cmn_stats_read_entry(char *line, int len, in */ static ssize_t nss_gre_redir_lag_ds_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { - ssize_t bytes_read = 0; + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_GRE_REDIR_LAG_DS_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; struct nss_stats_data *data = fp->private_data; struct nss_gre_redir_lag_ds_tun_stats stats; - size_t bytes; - char line[80]; - int start; + ssize_t bytes_read = 0; + size_t size_wr = 0; + + char *lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return 0; + } while (data->index < NSS_GRE_REDIR_LAG_MAX_NODE) { - if (nss_gre_redir_lag_ds_get_cmn_stats(&stats, data->index)) { + if (nss_gre_redir_lag_ds_stats_get(&stats, data->index)) { break; } data->index++; } - if (data->index == NSS_GRE_REDIR_LAG_MAX_NODE) { + if (data->index >= NSS_GRE_REDIR_LAG_MAX_NODE) { + kfree(lbuf); return 0; } - bytes = snprintf(line, sizeof(line), "\nTunnel stats for \n"); - if (copy_to_user(ubuf, line, bytes) != 0) { - return -EFAULT; - } - - bytes_read += bytes; - start = NSS_STATS_NODE_RX_PKTS; - while (bytes_read < sz && start < NSS_GRE_REDIR_LAG_DS_STATS_MAX) { - bytes = nss_gre_redir_lag_ds_cmn_stats_read_entry(line, sizeof(line), start, &stats); - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - return -EFAULT; - } - - bytes_read += bytes; - start++; - } + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_lag_ds stats", NSS_STATS_SINGLE_CORE); + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nTunnel stats for %03u\n", stats.ifnum); + size_wr += nss_stats_print("gre_redir_lag_ds", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_lag_ds_strings_stats, + &stats.rx_packets, NSS_GRE_REDIR_LAG_DS_STATS_MAX, lbuf, size_wr, size_al); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); data->index++; + kfree(lbuf); return bytes_read; } @@ -161,3 +128,84 @@ struct dentry *nss_gre_redir_lag_ds_stats_dentry_create(void) return cmn_stats; } + +/* + * nss_gre_redir_lag_ds_stats_sync() + * Update synchonized statistics. + */ +void nss_gre_redir_lag_ds_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_sync_stats_msg *ngss, uint32_t ifnum) +{ + int idx, j; + + spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); + if (!nss_gre_redir_lag_ds_get_node_idx(ifnum, &idx)) { + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); + nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); + return; + } + + tun_ds_stats[idx].tx_packets += ngss->node_stats.tx_packets; + tun_ds_stats[idx].tx_bytes += ngss->node_stats.tx_bytes; + tun_ds_stats[idx].rx_packets += ngss->node_stats.rx_packets; + tun_ds_stats[idx].rx_bytes += ngss->node_stats.rx_bytes; + for (j = 0; j < NSS_MAX_NUM_PRI; j++) { + tun_ds_stats[idx].rx_dropped[j] += ngss->node_stats.rx_dropped[j]; + } + + tun_ds_stats[idx].dst_invalid += ngss->ds_stats.dst_invalid; + tun_ds_stats[idx].exception_cnt += ngss->ds_stats.exception_cnt; + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); +} + +/* + * nss_gre_redir_lag_ds_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_redir_lag_ds_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_redir_lag_ds_stats_notification *stats_notify; + int idx; + + stats_notify = kzalloc(sizeof(struct nss_gre_redir_lag_ds_stats_notification), GFP_ATOMIC); + if (!stats_notify) { + nss_warning("Unable to allocate memory for stats notification\n"); + return; + } + + spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); + if (!nss_gre_redir_lag_ds_get_node_idx(if_num, &idx)) { + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); + nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); + kfree(stats_notify); + return; + } + + stats_notify->core_id = nss_ctx->id; + stats_notify->if_num = if_num; + memcpy(&(stats_notify->stats_ctx), &(tun_ds_stats[idx]), sizeof(stats_notify->stats_ctx)); + spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); + atomic_notifier_call_chain(&nss_gre_redir_lag_ds_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); + kfree(stats_notify); +} + +/* + * nss_gre_redir_lag_ds_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_gre_redir_lag_ds_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_redir_lag_ds_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_lag_ds_stats_unregister_notifier); + +/* + * nss_gre_redir_lag_ds_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_redir_lag_ds_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_redir_lag_ds_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_lag_ds_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h index fe79016cc..127f0082a 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h @@ -1,6 +1,6 @@ /* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. + ************************************************************************** + * Copyright (c) 2018, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -11,20 +11,18 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** + * ************************************************************************ */ #ifndef __NSS_GRE_REDIR_LAG_DS_STATS_H__ #define __NSS_GRE_REDIR_LAG_DS_STATS_H__ -/* - * GRE redirect LAG downstream statistics - */ -enum nss_gre_redir_lag_ds_stats_types { - NSS_GRE_REDIR_LAG_DS_STATS_DST_INVALID = NSS_STATS_NODE_MAX, - NSS_GRE_REDIR_LAG_DS_STATS_EXCEPTION_PKT, - NSS_GRE_REDIR_LAG_DS_STATS_MAX, -}; - +extern spinlock_t nss_gre_redir_lag_ds_stats_lock; +extern void nss_gre_redir_lag_ds_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern bool nss_gre_redir_lag_ds_verify_ifnum(uint32_t if_num); +extern bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *idx); +extern void nss_gre_redir_lag_ds_stats_sync(struct nss_ctx_instance *nss_ctx, + struct nss_gre_redir_lag_ds_sync_stats_msg *ngss, uint32_t ifnum); extern struct dentry *nss_gre_redir_lag_ds_stats_dentry_create(void); + #endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c new file mode 100644 index 000000000..185189996 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c @@ -0,0 +1,60 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_redir_lag_ds_strings.h" + +/* + * nss_gre_redir_lag_ds_strings_stats + * GRE REDIR LAG DS common statistics strings. + */ +struct nss_stats_info nss_gre_redir_lag_ds_strings_stats[NSS_GRE_REDIR_LAG_DS_STATS_MAX] = { + {"rx_packets", NSS_STATS_TYPE_COMMON}, + {"rx_bytes", NSS_STATS_TYPE_COMMON}, + {"tx_packets", NSS_STATS_TYPE_COMMON}, + {"tx_bytes", NSS_STATS_TYPE_COMMON}, + {"rx_dropped_0", NSS_STATS_TYPE_DROP}, + {"rx_dropped_1", NSS_STATS_TYPE_DROP}, + {"rx_dropped_2", NSS_STATS_TYPE_DROP}, + {"rx_dropped_3", NSS_STATS_TYPE_DROP}, + {"dst_invalid", NSS_STATS_TYPE_EXCEPTION}, + {"exception_packets", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_gre_redir_lag_ds_strings_read() + * Read gre_redir_lag_ds statistics names + */ +static ssize_t nss_gre_redir_lag_ds_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_lag_ds_strings_stats, NSS_GRE_REDIR_LAG_DS_STATS_MAX); +} + +/* + * nss_gre_redir_lag_ds_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_lag_ds); + +/* + * nss_gre_redir_lag_ds_strings_dentry_create() + * Create gre_redir_lag_ds statistics strings debug entry. + */ +void nss_gre_redir_lag_ds_strings_dentry_create(void) +{ + nss_strings_create_dentry("gre_redir_lag_ds", &nss_gre_redir_lag_ds_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h new file mode 100644 index 000000000..c85bc7721 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h @@ -0,0 +1,25 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_GRE_REDIR_LAG_DS_STRINGS_H +#define __NSS_GRE_REDIR_LAG_DS_STRINGS_H + +#include "nss_gre_redir_lag_ds_stats.h" + +extern struct nss_stats_info nss_gre_redir_lag_ds_strings_stats[NSS_GRE_REDIR_LAG_DS_STATS_MAX]; +extern void nss_gre_redir_lag_ds_strings_dentry_create(void); + +#endif /* __NSS_GRE_REDIR_LAG_DS_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c index 63a63adac..8e1b7588e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c @@ -1,6 +1,6 @@ /* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. + **************************************************************************** + * Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -11,39 +11,19 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** + **************************************************************************** */ #include "nss_tx_rx_common.h" #include "nss_gre_redir_lag_us_stats.h" #include "nss_gre_redir_lag_us_log.h" +#include "nss_gre_redir_lag_us_strings.h" #define NSS_GRE_REDIR_LAG_US_TX_TIMEOUT 3000 /* 3 Seconds */ #define NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD msecs_to_jiffies(4000) #define NSS_GRE_REDIR_LAG_US_STATS_SYNC_UDELAY 4000 -/* - * nss_gre_redir_lag_us_pvt_sync_stats - * Hash statistics synchronization context. - */ -struct nss_gre_redir_lag_us_pvt_sync_stats { - struct delayed_work nss_gre_redir_lag_us_work; /**< Delayed work per LAG US node. */ - struct nss_gre_redir_lag_us_msg db_sync_msg; /**< Hash statistics message. */ - struct nss_gre_redir_lag_us_tunnel_stats tun_stats; /**< GRE redirect LAG common statistics. */ - nss_gre_redir_lag_us_msg_callback_t cb; /**< Callback for hash query message. */ - void *app_data; /**< app_data for hash query message. */ - uint32_t ifnum; /**< NSS interface number. */ - bool valid; /**< Valid flag. */ -}; - -/* - * Common context for stats update. - */ -static struct nss_gre_redir_lag_us_cmn_ctx { - spinlock_t nss_gre_redir_lag_us_stats_lock; /**< Spin lock. */ - struct workqueue_struct *nss_gre_redir_lag_us_wq; /**< Work queue. */ - struct nss_gre_redir_lag_us_pvt_sync_stats stats_ctx[NSS_GRE_REDIR_LAG_MAX_NODE]; -} cmn_ctx; +struct nss_gre_redir_lag_us_cmn_ctx cmn_ctx; /* * Sync response context. @@ -82,61 +62,6 @@ static void nss_gre_redir_lag_us_callback(void *app_data, struct nss_gre_redir_l complete(&nss_gre_redir_lag_us_sync_ctx.complete); } -/* - * nss_gre_redir_lag_us_get_node_idx() - * Returns index of statistics context. - */ -static bool nss_gre_redir_lag_us_get_node_idx(uint32_t ifnum, uint32_t *idx) -{ - uint32_t node_idx; - for (node_idx = 0; node_idx < NSS_GRE_REDIR_LAG_MAX_NODE; node_idx++) { - if ((cmn_ctx.stats_ctx[node_idx].valid) && (cmn_ctx.stats_ctx[node_idx].ifnum == ifnum)) { - *idx = node_idx; - return true; - } - } - - return false; -} - -/* - * nss_gre_redir_lag_us_update_sync_stats() - * Update synchonized statistics. - */ -static void nss_gre_redir_lag_us_update_sync_stats(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_cmn_sync_stats_msg *ngss, - uint32_t ifnum) -{ - int idx, j; - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - return; - } - - cmn_ctx.stats_ctx[idx].tun_stats.tx_packets += ngss->node_stats.tx_packets; - cmn_ctx.stats_ctx[idx].tun_stats.tx_bytes += ngss->node_stats.tx_bytes; - cmn_ctx.stats_ctx[idx].tun_stats.rx_packets += ngss->node_stats.rx_packets; - cmn_ctx.stats_ctx[idx].tun_stats.rx_bytes += ngss->node_stats.rx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - cmn_ctx.stats_ctx[idx].tun_stats.rx_dropped[j] += ngss->node_stats.rx_dropped[j]; - } - cmn_ctx.stats_ctx[idx].tun_stats.us_stats.amsdu_pkts += ngss->us_stats.amsdu_pkts; - cmn_ctx.stats_ctx[idx].tun_stats.us_stats.amsdu_pkts_enqueued += ngss->us_stats.amsdu_pkts_enqueued; - cmn_ctx.stats_ctx[idx].tun_stats.us_stats.amsdu_pkts_exceptioned += ngss->us_stats.amsdu_pkts_exceptioned; - cmn_ctx.stats_ctx[idx].tun_stats.us_stats.exceptioned += ngss->us_stats.exceptioned; - cmn_ctx.stats_ctx[idx].tun_stats.us_stats.freed += ngss->us_stats.freed; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.add_attempt += ngss->db_stats.add_attempt; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.add_success += ngss->db_stats.add_success; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.add_fail_table_full += ngss->db_stats.add_fail_table_full; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.add_fail_exists += ngss->db_stats.add_fail_exists; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.del_attempt += ngss->db_stats.del_attempt; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.del_success += ngss->db_stats.del_success; - cmn_ctx.stats_ctx[idx].tun_stats.db_stats.del_fail_not_found += ngss->db_stats.del_fail_not_found; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); -} - /* * nss_gre_redir_lag_us_hash_update_stats_req() * Update query hash message's index for next request. @@ -167,24 +92,13 @@ static void nss_gre_redir_lag_us_hash_update_stats_req(struct nss_ctx_instance * * If more hash entries are to be fetched from FW, queue work with delay of one eighth of * the polling period. Else, schedule work with a delay of polling period. */ - if (cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats.db_entry_idx) { + if (cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats.db_entry_idx) sync_delay = NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD / 8; - } - queue_delayed_work(cmn_ctx.nss_gre_redir_lag_us_wq, &(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work), - sync_delay); + queue_delayed_work(cmn_ctx.nss_gre_redir_lag_us_wq, &(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work), sync_delay); spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); } -/* - * nss_gre_redir_lag_us_verify_ifnum() - * Verify interface type. - */ -static bool nss_gre_redir_lag_us_verify_ifnum(uint32_t if_num) -{ - return nss_dynamic_interface_get_type(nss_gre_redir_lag_us_get_context(), if_num) == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US; -} - /* * nss_gre_redir_lag_us_handler() * Handle NSS -> HLOS messages for gre tunnel @@ -234,7 +148,8 @@ static void nss_gre_redir_lag_us_msg_handler(struct nss_ctx_instance *nss_ctx, s switch (ncm->type) { case NSS_GRE_REDIR_LAG_US_CMN_STATS_SYNC_MSG: - nss_gre_redir_lag_us_update_sync_stats(nss_ctx, &ngrm->msg.us_sync_stats, ncm->interface); + nss_gre_redir_lag_us_stats_sync(nss_ctx, &ngrm->msg.us_sync_stats, ncm->interface); + nss_gre_redir_lag_us_stats_notify(nss_ctx, ncm->interface); break; case NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG: @@ -513,6 +428,32 @@ static struct nss_ctx_instance *nss_gre_redir_lag_us_register_if(uint32_t if_num return nss_ctx; } +/* + * nss_gre_redir_lag_us_get_node_idx() + * Returns index of statistics context. + */ +bool nss_gre_redir_lag_us_get_node_idx(uint32_t ifnum, uint32_t *idx) +{ + uint32_t node_idx; + for (node_idx = 0; node_idx < NSS_GRE_REDIR_LAG_MAX_NODE; node_idx++) { + if ((cmn_ctx.stats_ctx[node_idx].valid) && (cmn_ctx.stats_ctx[node_idx].ifnum == ifnum)) { + *idx = node_idx; + return true; + } + } + + return false; +} + +/* + * nss_gre_redir_lag_us_verify_ifnum() + * Verify interface type. + */ +bool nss_gre_redir_lag_us_verify_ifnum(uint32_t if_num) +{ + return nss_dynamic_interface_get_type(nss_gre_redir_lag_us_get_context(), if_num) == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US; +} + /* * nss_gre_redir_lag_us_get_context() * Retrieve context for GRE redirect LAG upstream node. @@ -605,29 +546,6 @@ bool nss_gre_redir_lag_us_configure_node(uint32_t ifnum, } EXPORT_SYMBOL(nss_gre_redir_lag_us_configure_node); -/* - * nss_gre_redir_lag_us_get_cmn_stats() - * Common upstream statistics. - */ -bool nss_gre_redir_lag_us_get_cmn_stats(struct nss_gre_redir_lag_us_tunnel_stats *cmn_stats, uint32_t index) -{ - if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) { - nss_warning("Index is out of valid range %u\n", index); - return false; - } - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!cmn_ctx.stats_ctx[index].valid) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("Common context not found for the index %u\n", index); - return false; - } - - memcpy((void *)cmn_stats, (void *)&(cmn_ctx.stats_ctx[index].tun_stats), sizeof(*cmn_stats)); - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - return true; -} - /* * nss_gre_redir_lag_us_tx_msg() * Transmit a GRE LAG message to NSS firmware asynchronously. @@ -738,6 +656,7 @@ void nss_gre_redir_lag_us_register_handler(void) return; } + nss_gre_redir_lag_us_strings_dentry_create(); nss_gre_redir_lag_us_sync_ctx.cb = NULL; nss_gre_redir_lag_us_sync_ctx.app_data = NULL; sema_init(&nss_gre_redir_lag_us_sync_ctx.sem, 1); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c index 68ef37bf7..2b291bfd3 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,109 +17,39 @@ #include "nss_core.h" #include "nss_gre_redir_lag.h" #include "nss_gre_redir_lag_us_stats.h" +#include "nss_gre_redir_lag_us_strings.h" + +#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD msecs_to_jiffies(4000) +#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_UDELAY 4000 /* - * nss_gre_redir_lag_us_stats_str - * GRE REDIR LAG US common statistics strings. + * Declare atomic notifier data structure for statistics. */ -static uint8_t *nss_gre_redir_lag_us_stats_str[NSS_GRE_REDIR_LAG_US_STATS_MAX] = { - "rx_packets", - "rx_bytes", - "tx_packets", - "tx_bytes", - "rx_queue_0_dropped", - "rx_queue_1_dropped", - "rx_queue_2_dropped", - "rx_queue_3_dropped", - "Amsdu pkts", - "Amsdu pkts enqueued", - "Amsdu pkts exceptioned", - "Exceptioned", - "Freed", - "add attempt", - "add success", - "add fail table full", - "add fail exists", - "del attempt", - "del success", - "del fail not found", -}; +ATOMIC_NOTIFIER_HEAD(nss_gre_redir_lag_us_stats_notifier); + +extern struct nss_gre_redir_lag_us_cmn_ctx cmn_ctx; /* - * nss_gre_redir_lag_us_tunnel_stats() - * Make a row for GRE_REDIR LAG US stats. + * nss_gre_redir_lag_us_stats_get + * Get the common upstream statistics. */ -static ssize_t nss_gre_redir_lag_us_cmn_stats_read_entry(char *line, int len, int type, struct nss_gre_redir_lag_us_tunnel_stats *s) +bool nss_gre_redir_lag_us_stats_get(struct nss_gre_redir_lag_us_tunnel_stats *cmn_stats, uint32_t index) { - uint64_t tcnt = 0; - - switch (type) { - case NSS_STATS_NODE_RX_PKTS: - tcnt = s->rx_packets; - return snprintf(line, len, "Common node stats start:\n\n%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_BYTES: - tcnt = s->rx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_TX_PKTS: - tcnt = s->tx_packets; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_TX_BYTES: - tcnt = s->tx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_0_DROPPED: - tcnt = s->rx_dropped[0]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); -#if (NSS_MAX_NUM_PRI > 1) - case NSS_STATS_NODE_RX_QUEUE_1_DROPPED: - tcnt = s->rx_dropped[1]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_2_DROPPED: - tcnt = s->rx_dropped[2]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_STATS_NODE_RX_QUEUE_3_DROPPED: - tcnt = s->rx_dropped[3]; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); -#endif - case NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS: - tcnt = s->us_stats.amsdu_pkts; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_ENQUEUED: - tcnt = s->us_stats.amsdu_pkts_enqueued; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_EXCEPTIONED: - tcnt = s->us_stats.amsdu_pkts_exceptioned; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_EXCEPTIONED: - tcnt = s->us_stats.exceptioned; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_FREED: - tcnt = s->us_stats.freed; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_ADD_ATTEMPT: - tcnt = s->db_stats.add_attempt; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_ADD_SUCCESS: - tcnt = s->db_stats.add_success; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_TABLE_FULL: - tcnt = s->db_stats.add_fail_table_full; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_EXISTS: - tcnt = s->db_stats.add_fail_exists; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_DEL_ATTEMPT: - tcnt = s->db_stats.del_attempt; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_DEL_SUCCESS: - tcnt = s->db_stats.del_success; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - case NSS_GRE_REDIR_LAG_US_STATS_DEL_FAIL_NOT_FOUND: - tcnt = s->db_stats.del_fail_not_found; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_lag_us_stats_str[type], tcnt); - default: - nss_warning("Unknown tunnel stats type.\n"); - return 0; + if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) { + nss_warning("Index is out of valid range %u\n", index); + return false; } + + spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + if (!cmn_ctx.stats_ctx[index].valid) { + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + nss_warning("Common context not found for the index %u\n", index); + return false; + } + + memcpy((void *)cmn_stats, (void *)&(cmn_ctx.stats_ctx[index].tun_stats), sizeof(*cmn_stats)); + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + return true; } /* @@ -128,15 +58,26 @@ static ssize_t nss_gre_redir_lag_us_cmn_stats_read_entry(char *line, int len, in */ static ssize_t nss_gre_redir_lag_us_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { - ssize_t bytes_read = 0; + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_GRE_REDIR_LAG_US_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; struct nss_stats_data *data = fp->private_data; struct nss_gre_redir_lag_us_tunnel_stats stats; - size_t bytes; - char line[80]; - int start; + ssize_t bytes_read = 0; + size_t size_wr = 0; + + char *lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return 0; + } while (data->index < NSS_GRE_REDIR_LAG_MAX_NODE) { - if (nss_gre_redir_lag_us_get_cmn_stats(&stats, data->index)) { + if (nss_gre_redir_lag_us_stats_get(&stats, data->index)) { break; } @@ -144,31 +85,17 @@ static ssize_t nss_gre_redir_lag_us_cmn_stats_read(struct file *fp, char __user } if (data->index == NSS_GRE_REDIR_LAG_MAX_NODE) { + kfree(lbuf); return 0; } - bytes = snprintf(line, sizeof(line), "\nTunnel stats"); - if (copy_to_user(ubuf, line, bytes) != 0) { - return -EFAULT; - } - - bytes_read += bytes; - start = NSS_STATS_NODE_RX_PKTS; - while (bytes_read < sz && start <= NSS_GRE_REDIR_LAG_US_STATS_DEL_FAIL_NOT_FOUND) { - bytes = nss_gre_redir_lag_us_cmn_stats_read_entry(line, sizeof(line), start, &stats); - if ((bytes_read + bytes) > sz) { - break; - } - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - return -EFAULT; - } - - bytes_read += bytes; - start++; - } + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_lag_us stats", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_print("gre_redir_lag_us", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_lag_us_strings_stats, + &stats.rx_packets, NSS_GRE_REDIR_LAG_US_STATS_MAX, lbuf, size_wr, size_al); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); data->index++; + kfree(lbuf); return bytes_read; } @@ -201,3 +128,99 @@ struct dentry *nss_gre_redir_lag_us_stats_dentry_create(void) return cmn_stats; } + +/* + * nss_gre_redir_lag_us_stats_sync() + * Update synchonized statistics. + */ +void nss_gre_redir_lag_us_stats_sync(struct nss_ctx_instance *nss_ctx, + struct nss_gre_redir_lag_us_cmn_sync_stats_msg *ngss, uint32_t ifnum) +{ + int idx, j; + struct nss_gre_redir_lag_us_tunnel_stats *node_stats; + + spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + if (!nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); + return; + } + + node_stats = &cmn_ctx.stats_ctx[idx].tun_stats; + + node_stats->tx_packets += ngss->node_stats.tx_packets; + node_stats->tx_bytes += ngss->node_stats.tx_bytes; + node_stats->rx_packets += ngss->node_stats.rx_packets; + node_stats->rx_bytes += ngss->node_stats.rx_bytes; + for (j = 0; j < NSS_MAX_NUM_PRI; j++) { + node_stats->rx_dropped[j] += ngss->node_stats.rx_dropped[j]; + } + + node_stats->us_stats.amsdu_pkts += ngss->us_stats.amsdu_pkts; + node_stats->us_stats.amsdu_pkts_enqueued += ngss->us_stats.amsdu_pkts_enqueued; + node_stats->us_stats.amsdu_pkts_exceptioned += ngss->us_stats.amsdu_pkts_exceptioned; + node_stats->us_stats.exceptioned += ngss->us_stats.exceptioned; + node_stats->us_stats.freed += ngss->us_stats.freed; + node_stats->db_stats.add_attempt += ngss->db_stats.add_attempt; + node_stats->db_stats.add_success += ngss->db_stats.add_success; + node_stats->db_stats.add_fail_table_full += ngss->db_stats.add_fail_table_full; + node_stats->db_stats.add_fail_exists += ngss->db_stats.add_fail_exists; + node_stats->db_stats.del_attempt += ngss->db_stats.del_attempt; + node_stats->db_stats.del_success += ngss->db_stats.del_success; + node_stats->db_stats.del_fail_not_found += ngss->db_stats.del_fail_not_found; + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); +} + +/* + * nss_gre_redir_lag_us_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_redir_lag_us_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_redir_lag_us_stats_notification *stats_notify; + int idx; + + stats_notify = kzalloc(sizeof(struct nss_gre_redir_lag_us_stats_notification), GFP_ATOMIC); + if (!stats_notify) { + nss_warning("Unable to allocate memory for stats notification\n"); + return; + } + + spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + if (!nss_gre_redir_lag_us_get_node_idx(if_num, &idx)) { + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); + kfree(stats_notify); + return; + } + + stats_notify->core_id = nss_ctx->id; + stats_notify->if_num = if_num; + memcpy(&(stats_notify->stats_ctx), &(cmn_ctx.stats_ctx[idx].tun_stats), sizeof(stats_notify->stats_ctx)); + spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); + atomic_notifier_call_chain(&nss_gre_redir_lag_us_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); + kfree(stats_notify); +} + +/* + * nss_gre_redir_lag_us_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_gre_redir_lag_us_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_redir_lag_us_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_lag_us_stats_unregister_notifier); + +/* + * nss_gre_redir_lag_us_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_redir_lag_us_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_redir_lag_us_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_lag_us_stats_register_notifier); + diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h index c0e4a9d45..9f223122d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2018, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -18,23 +18,33 @@ #define __NSS_GRE_REDIR_LAG_US_STATS_H__ /* - * GRE redirect LAG upstream statistics + * nss_gre_redir_lag_us_pvt_sync_stats + * Hash statistics synchronization context. */ -enum nss_gre_redir_lag_us_stats_types { - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS = NSS_STATS_NODE_MAX, - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_ENQUEUED, - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_EXCEPTIONED, - NSS_GRE_REDIR_LAG_US_STATS_EXCEPTIONED, - NSS_GRE_REDIR_LAG_US_STATS_FREED, - NSS_GRE_REDIR_LAG_US_STATS_ADD_ATTEMPT, - NSS_GRE_REDIR_LAG_US_STATS_ADD_SUCCESS, - NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_TABLE_FULL, - NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_EXISTS, - NSS_GRE_REDIR_LAG_US_STATS_DEL_ATTEMPT, - NSS_GRE_REDIR_LAG_US_STATS_DEL_SUCCESS, - NSS_GRE_REDIR_LAG_US_STATS_DEL_FAIL_NOT_FOUND, - NSS_GRE_REDIR_LAG_US_STATS_MAX, +struct nss_gre_redir_lag_us_pvt_sync_stats { + struct delayed_work nss_gre_redir_lag_us_work; /**< Delayed work per LAG US node. */ + struct nss_gre_redir_lag_us_msg db_sync_msg; /**< Hash statistics message. */ + struct nss_gre_redir_lag_us_tunnel_stats tun_stats; /**< GRE redirect LAG common statistics. */ + nss_gre_redir_lag_us_msg_callback_t cb; /**< Callback for hash query message. */ + void *app_data; /**< app_data for hash query message. */ + uint32_t ifnum; /**< NSS interface number. */ + bool valid; /**< Valid flag. */ }; +/* + * Common context for stats update. + */ +struct nss_gre_redir_lag_us_cmn_ctx { + struct workqueue_struct *nss_gre_redir_lag_us_wq; /**< Work queue. */ + spinlock_t nss_gre_redir_lag_us_stats_lock; /**< Spin lock. */ + struct nss_gre_redir_lag_us_pvt_sync_stats stats_ctx[NSS_GRE_REDIR_LAG_MAX_NODE]; +}; + +extern void nss_gre_redir_lag_us_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern bool nss_gre_redir_lag_us_get_node_idx(uint32_t ifnum, uint32_t *idx); +extern bool nss_gre_redir_lag_us_verify_ifnum(uint32_t if_num); +extern void nss_gre_redir_lag_us_stats_sync(struct nss_ctx_instance *nss_ctx, + struct nss_gre_redir_lag_us_cmn_sync_stats_msg *ngss, uint32_t ifnum); extern struct dentry *nss_gre_redir_lag_us_stats_dentry_create(void); + #endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c new file mode 100644 index 000000000..c1dca2bad --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c @@ -0,0 +1,71 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_redir_lag_us_strings.h" + +/* + * nss_gre_redir_lag_us_strings_stats + * GRE REDIR LAG US common statistics strings. + */ +struct nss_stats_info nss_gre_redir_lag_us_strings_stats[NSS_GRE_REDIR_LAG_US_STATS_MAX] = { + {"rx_packets", NSS_STATS_TYPE_COMMON}, + {"rx_bytes", NSS_STATS_TYPE_COMMON}, + {"tx_packets", NSS_STATS_TYPE_COMMON}, + {"tx_bytes", NSS_STATS_TYPE_COMMON}, + {"rx_dropped_0", NSS_STATS_TYPE_DROP}, + {"rx_dropped_1", NSS_STATS_TYPE_DROP}, + {"rx_dropped_2", NSS_STATS_TYPE_DROP}, + {"rx_dropped_3", NSS_STATS_TYPE_DROP}, + {"Amsdu pkts", NSS_STATS_TYPE_SPECIAL}, + {"Amsdu pkts enqueued", NSS_STATS_TYPE_SPECIAL}, + {"Amsdu pkts exceptioned", NSS_STATS_TYPE_EXCEPTION}, + {"Exceptioned", NSS_STATS_TYPE_EXCEPTION}, + {"Freed", NSS_STATS_TYPE_SPECIAL}, + {"add attempt", NSS_STATS_TYPE_SPECIAL}, + {"add success", NSS_STATS_TYPE_SPECIAL}, + {"add fail table full", NSS_STATS_TYPE_SPECIAL}, + {"add fail exists", NSS_STATS_TYPE_SPECIAL}, + {"del attempt", NSS_STATS_TYPE_SPECIAL}, + {"del success", NSS_STATS_TYPE_SPECIAL}, + {"del fail not found", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_gre_redir_lag_us_strings_read() + * Read gre_redir_lag_us statistics names + */ +static ssize_t nss_gre_redir_lag_us_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_lag_us_strings_stats, NSS_GRE_REDIR_LAG_US_STATS_MAX); +} + +/* + * nss_gre_redir_lag_us_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_lag_us); + +/* + * nss_gre_redir_lag_us_strings_dentry_create() + * Create gre_redir_lag_us statistics strings debug entry. + */ +void nss_gre_redir_lag_us_strings_dentry_create(void) +{ + nss_strings_create_dentry("gre_redir_lag_us", &nss_gre_redir_lag_us_strings_ops); +} + diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h new file mode 100644 index 000000000..74c1054de --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h @@ -0,0 +1,25 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_GRE_REDIR_LAG_US_STRINGS_H +#define __NSS_GRE_REDIR_LAG_US_STRINGS_H + +#include "nss_gre_redir_lag_us_stats.h" + +extern struct nss_stats_info nss_gre_redir_lag_us_strings_stats[NSS_GRE_REDIR_LAG_US_STATS_MAX]; +extern void nss_gre_redir_lag_us_strings_dentry_create(void); + +#endif /* __NSS_GRE_REDIR_LAG_US_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c index 4a79b55fc..0b8524f7c 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -15,6 +15,7 @@ */ #include "nss_tx_rx_common.h" +#include "nss_gre_redir_mark_strings.h" #include "nss_gre_redir_mark_stats.h" #include "nss_gre_redir_mark_log.h" #define NSS_GRE_REDIR_MARK_TX_TIMEOUT 3000 /* 3 Seconds */ @@ -28,16 +29,6 @@ static struct { int response; } nss_gre_redir_mark_pvt; -/* - * Spinlock to update GRE redir mark stats. - */ -static DEFINE_SPINLOCK(nss_gre_redir_mark_stats_lock); - -/* - * Global GRE redir mark stats structure. - */ -static struct nss_gre_redir_mark_stats gre_mark_stats; - /* * nss_gre_redir_mark_msg_sync_callback() * Callback to handle the completion of HLOS-->NSS messages. @@ -53,54 +44,6 @@ static void nss_gre_redir_mark_msg_sync_callback(void *app_data, struct nss_gre_ complete(&nss_gre_redir_mark_pvt.complete); } -/* - * nss_gre_redir_mark_stats_sync() - * Update GRE redir mark stats. - */ -static void nss_gre_redir_mark_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_mark_stats_sync_msg *ngss) -{ - struct net_device *dev; - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return; - } - - if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - return; - } - - /* - * Update the stats in exclusive mode to prevent the read from the process - * context through debug fs. - */ - spin_lock_bh(&nss_gre_redir_mark_stats_lock); - - /* - * Update the common node stats - */ - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_PKTS] += ngss->node_stats.tx_packets; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_BYTES] += ngss->node_stats.tx_bytes; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_RX_PKTS] += ngss->node_stats.rx_packets; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_RX_BYTES] += ngss->node_stats.rx_bytes; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_RX_DROPS] += nss_cmn_rx_dropped_sum(&(ngss->node_stats)); - - /* - * Update the GRE redir mark specific stats - */ - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED] += ngss->hlos_magic_fail; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS] += ngss->invalid_dst_drop; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE] += ngss->dst_enqueue_success; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS] += ngss->dst_enqueue_drop; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_APPID] += ngss->inv_appid; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE] += ngss->headroom_unavail; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS] += ngss->tx_completion_success; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS] += ngss->tx_completion_drop; - - spin_unlock_bh(&nss_gre_redir_mark_stats_lock); -} - /* * nss_gre_redir_mark_handler() * Handle NSS to HLOS messages for GRE redir mark @@ -137,6 +80,7 @@ static void nss_gre_redir_mark_handler(struct nss_ctx_instance *nss_ctx, struct if (ncm->type == NSS_GRE_REDIR_MARK_STATS_SYNC_MSG) { nss_gre_redir_mark_stats_sync(nss_ctx, ncm->interface, &ngrm->msg.stats_sync); + nss_gre_redir_mark_stats_notify(nss_ctx, ncm->interface); } /* @@ -160,28 +104,6 @@ static void nss_gre_redir_mark_handler(struct nss_ctx_instance *nss_ctx, struct cb((void *)ncm->app_data, ncm); } -/* - * nss_gre_redir_mark_get_stats() - * Get gre_redir tunnel stats. - */ -bool nss_gre_redir_mark_get_stats(void *stats_mem) -{ - struct nss_gre_redir_mark_stats *stats = (struct nss_gre_redir_mark_stats *)stats_mem; - if (!stats) { - nss_warning("No memory to copy GRE redir mark stats"); - return false; - } - - /* - * Copy the GRE redir mark stats in the memory. - */ - spin_lock_bh(&nss_gre_redir_mark_stats_lock); - memcpy(stats, &gre_mark_stats, sizeof(struct nss_gre_redir_mark_stats)); - spin_unlock_bh(&nss_gre_redir_mark_stats_lock); - return true; -} -EXPORT_SYMBOL(nss_gre_redir_mark_get_stats); - /* * nss_gre_redir_mark_reg_cb() * Configure a callback on VAP. @@ -404,6 +326,7 @@ void nss_gre_redir_mark_register_handler(void) return; } + nss_gre_redir_mark_strings_dentry_create(); sema_init(&nss_gre_redir_mark_pvt.sem, 1); init_completion(&nss_gre_redir_mark_pvt.complete); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c index c9b2a9dc8..da0f64621 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -18,95 +18,64 @@ #include "nss_stats.h" #include "nss_gre_redir_mark.h" #include "nss_gre_redir_mark_stats.h" +#include "nss_gre_redir_mark_strings.h" #define NSS_GRE_REDIR_MARK_STATS_STR_LEN 50 #define NSS_GRE_REDIR_MARK_STATS_LEN ((NSS_GRE_REDIR_MARK_STATS_MAX + 7 ) * NSS_GRE_REDIR_MARK_STATS_STR_LEN) -/* - * nss_gre_redir_mark_stats_str - * GRE redir mark statistics string - */ -static int8_t *nss_gre_redir_mark_stats_str[NSS_GRE_REDIR_MARK_STATS_MAX] = { - "TX Packets", - "TX Bytes", - "RX Packets", - "RX Bytes", - "RX Drops", - "HLOS Magic Failed", - "Tx Inv_dst_if Drops", - "Tx Dst_if Enqueue", - "Tx Dst_if Enqueue Drops", - "Invalid Appid", - "Headroom Unavailable", - "Tx Completion Host Enqueue Success", - "Tx Completion Host Enqueue Drops", -}; /* - * nss_gre_redir_mark_stats_cpy() - * Fill the stats. + * Declare atomic notifier data structure for statistics. */ -static ssize_t nss_gre_redir_mark_stats_cpy(char *lbuf, int len, int i, struct nss_gre_redir_mark_stats *s) +ATOMIC_NOTIFIER_HEAD(nss_gre_redir_mark_stats_notifier); + +/* + * Spinlock to protect GRE redirect mark statistics update/read + */ +DEFINE_SPINLOCK(nss_gre_redir_mark_stats_lock); + +/* + * Global GRE redirect mark stats structure. + */ +struct nss_gre_redir_mark_stats gre_mark_stats; + +/* + * nss_gre_redir_mark_stats_get() + * Get gre_redir tunnel stats. + */ +bool nss_gre_redir_mark_stats_get(struct nss_gre_redir_mark_stats *stats_mem) { - uint64_t tcnt = 0; - - switch (i) { - case NSS_GRE_REDIR_MARK_STATS_TX_PKTS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_TX_PKTS]; - return scnprintf(lbuf, len, "Common node stats start:\n\n%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_TX_BYTES: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_TX_BYTES]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_RX_PKTS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_RX_PKTS]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_RX_BYTES: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_RX_BYTES]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_RX_DROPS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_RX_DROPS]; - return scnprintf(lbuf, len, "%s = %llu\nCommon node stats end.\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED]; - return scnprintf(lbuf, len, "Offload stats start:\n\n%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_INV_APPID: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_INV_APPID]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS]; - return scnprintf(lbuf, len, "%s = %llu\n", nss_gre_redir_mark_stats_str[i], tcnt); - case NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS: - tcnt = s->stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS]; - return scnprintf(lbuf, len, "%s = %llu\nOffload stats end.\n", nss_gre_redir_mark_stats_str[i], tcnt); - default: - nss_warning("Unknown stats type %d.\n", i); - return 0; + if (!stats_mem) { + nss_warning("No memory to copy GRE redir mark stats"); + return false; } -} -/* + /* + * Copy the GRE redir mark stats in the memory. + */ + spin_lock_bh(&nss_gre_redir_mark_stats_lock); + memcpy(stats_mem, &gre_mark_stats, sizeof(struct nss_gre_redir_mark_stats)); + spin_unlock_bh(&nss_gre_redir_mark_stats_lock); + return true; +} +EXPORT_SYMBOL(nss_gre_redir_mark_stats_get); + +/** * nss_gre_redir_mark_stats_read() * READ GRE redir mark stats. */ static ssize_t nss_gre_redir_mark_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_GRE_REDIR_MARK_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; struct nss_gre_redir_mark_stats stats; size_t size_wr = 0; - int start, end; ssize_t bytes_read = 0; bool isthere; - size_t size_al = ((NSS_GRE_REDIR_MARK_STATS_MAX + 7 ) * NSS_GRE_REDIR_MARK_STATS_STR_LEN); char *lbuf = kzalloc(size_al, GFP_KERNEL); if (unlikely(!lbuf)) { @@ -117,21 +86,16 @@ static ssize_t nss_gre_redir_mark_stats_read(struct file *fp, char __user *ubuf, /* * If GRE redir mark does not exists, then (isthere) will be false. */ - isthere = nss_gre_redir_mark_get_stats((void*)&stats); + isthere = nss_gre_redir_mark_stats_get(&stats); if (!isthere) { nss_warning("Could not get GRE redirect stats"); kfree(lbuf); return 0; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nGRE redir mark stats\n"); - - start = NSS_GRE_REDIR_MARK_STATS_TX_PKTS; - end = NSS_GRE_REDIR_MARK_STATS_MAX; - while (start < end) { - size_wr += nss_gre_redir_mark_stats_cpy(lbuf + size_wr, size_al - size_wr, start, &stats); - start++; - } + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_mark stats", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_print("gre_redir_mark", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_mark_strings_stats, + stats.stats, NSS_GRE_REDIR_MARK_STATS_MAX, lbuf, size_wr, size_al); bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); @@ -161,3 +125,106 @@ struct dentry *nss_gre_redir_mark_stats_dentry_create(void) return gre_redir_mark; } + +/* + * nss_gre_redir_mark_stats_sync() + * Update GRE redir mark stats. + */ +void nss_gre_redir_mark_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_mark_stats_sync_msg *ngss) +{ + int i; + struct net_device *dev; + dev = nss_cmn_get_interface_dev(nss_ctx, if_num); + if (!dev) { + nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); + return; + } + + if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { + nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); + return; + } + + /* + * Update the stats in exclusive mode to prevent the read from the process + * context through debug fs. + */ + spin_lock_bh(&nss_gre_redir_mark_stats_lock); + + /* + * Update the common node stats + */ + gre_mark_stats.stats[NSS_STATS_NODE_TX_PKTS] += ngss->node_stats.tx_packets; + gre_mark_stats.stats[NSS_STATS_NODE_TX_BYTES] += ngss->node_stats.tx_bytes; + gre_mark_stats.stats[NSS_STATS_NODE_RX_PKTS] += ngss->node_stats.rx_packets; + gre_mark_stats.stats[NSS_STATS_NODE_RX_BYTES] += ngss->node_stats.rx_bytes; + for (i = 0; i < NSS_MAX_NUM_PRI; i++) { + gre_mark_stats.stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += ngss->node_stats.rx_dropped[i]; + } + + /* + * Update the GRE redir mark specific stats + */ + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED] += ngss->hlos_magic_fail; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS] += ngss->invalid_dst_drop; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE] += ngss->dst_enqueue_success; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS] += ngss->dst_enqueue_drop; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_APPID] += ngss->inv_appid; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE] += ngss->headroom_unavail; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS] += ngss->tx_completion_success; + gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS] += ngss->tx_completion_drop; + + spin_unlock_bh(&nss_gre_redir_mark_stats_lock); +} + +/* + * nss_gre_redir_mark_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_redir_mark_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_redir_mark_stats_notification *stats_notify; + + stats_notify = kzalloc(sizeof(struct nss_gre_redir_mark_stats_notification), GFP_ATOMIC); + if (!stats_notify) { + nss_warning("Unable to allocate memory for stats notification\n"); + return; + } + + if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { + nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); + kfree(stats_notify); + return; + } + + spin_lock_bh(&nss_gre_redir_mark_stats_lock); + stats_notify->core_id = nss_ctx->id; + stats_notify->if_num = if_num; + memcpy(stats_notify->stats_ctx, gre_mark_stats.stats, sizeof(stats_notify->stats_ctx)); + spin_unlock_bh(&nss_gre_redir_mark_stats_lock); + + atomic_notifier_call_chain(&nss_gre_redir_mark_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); + kfree(stats_notify); +} + +/* + * nss_gre_redir_mark_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_gre_redir_mark_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_redir_mark_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_mark_stats_unregister_notifier); + +/* + * nss_gre_redir_mark_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_redir_mark_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_redir_mark_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_mark_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h index 8017f6d20..cacb3d218 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,26 +17,6 @@ #ifndef __NSS_GRE_REDIR_MARK_STATS_H__ #define __NSS_GRE_REDIR_MARK_STATS_H__ -/* - * GRE REDIR statistics types - */ -enum nss_gre_redir_mark_stats_types { - NSS_GRE_REDIR_MARK_STATS_TX_PKTS, - NSS_GRE_REDIR_MARK_STATS_TX_BYTES, - NSS_GRE_REDIR_MARK_STATS_RX_PKTS, - NSS_GRE_REDIR_MARK_STATS_RX_BYTES, - NSS_GRE_REDIR_MARK_STATS_RX_DROPS, - NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED, - NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS, - NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE, - NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS, - NSS_GRE_REDIR_MARK_STATS_INV_APPID, - NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE, - NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS, - NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS, - NSS_GRE_REDIR_MARK_STATS_MAX -}; - /* * NSS core stats -- for H2N/N2H gre_redir_mark debug stats */ @@ -47,6 +27,9 @@ struct nss_gre_redir_mark_stats { /* * NSS GRE REDIR Mark statistics APIs */ +extern void nss_gre_redir_mark_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_gre_redir_mark_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, + struct nss_gre_redir_mark_stats_sync_msg *ngss); extern struct dentry *nss_gre_redir_mark_stats_dentry_create(void); #endif /* __NSS_GRE_REDIR_MARK_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c new file mode 100644 index 000000000..a8d5a9859 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c @@ -0,0 +1,66 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_redir_mark_strings.h" + +/* + * nss_gre_redir_mark_strings_stats + * GRE redir mark statistics string + */ +struct nss_stats_info nss_gre_redir_mark_strings_stats[NSS_GRE_REDIR_MARK_STATS_MAX] = { + {"rx Packets", NSS_STATS_TYPE_COMMON}, + {"rx Bytes", NSS_STATS_TYPE_COMMON}, + {"tx Packets", NSS_STATS_TYPE_COMMON}, + {"tx Bytes", NSS_STATS_TYPE_COMMON}, + {"rx_dropped_0", NSS_STATS_TYPE_DROP}, + {"rx_dropped_1", NSS_STATS_TYPE_DROP}, + {"rx_dropped_2", NSS_STATS_TYPE_DROP}, + {"rx_dropped_3", NSS_STATS_TYPE_DROP}, + {"HLOS Magic Failed", NSS_STATS_TYPE_SPECIAL}, + {"tx Inv_dst_if Drops", NSS_STATS_TYPE_DROP}, + {"tx Dst_if Enqueue", NSS_STATS_TYPE_SPECIAL}, + {"tx Dst_if Enqueue Drops", NSS_STATS_TYPE_DROP}, + {"Invalid Appid", NSS_STATS_TYPE_SPECIAL}, + {"Headroom Unavailable", NSS_STATS_TYPE_EXCEPTION}, + {"tx Completion Host Enqueue Success", NSS_STATS_TYPE_SPECIAL}, + {"tx Completion Host Enqueue Drops", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_gre_redir_mark_strings_read() + * Read gre_redir_mark statistics names + */ +static ssize_t nss_gre_redir_mark_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_mark_strings_stats, NSS_GRE_REDIR_MARK_STATS_MAX); +} + +/* + * nss_gre_redir_mark_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_mark); + +/* + * nss_gre_redir_mark_strings_dentry_create() + * Create gre_redir_mark statistics strings debug entry. + */ +void nss_gre_redir_mark_strings_dentry_create(void) +{ + nss_strings_create_dentry("gre_redir_mark", &nss_gre_redir_mark_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h new file mode 100644 index 000000000..98ed33204 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h @@ -0,0 +1,25 @@ +/* + **************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_GRE_REDIR_MARK_STRINGS_H +#define __NSS_GRE_REDIR_MARK_STRINGS_H + +#include "nss_gre_redir_mark_stats.h" + +extern struct nss_stats_info nss_gre_redir_mark_strings_stats[NSS_GRE_REDIR_MARK_STATS_MAX]; +extern void nss_gre_redir_mark_strings_dentry_create(void); + +#endif /* __NSS_GRE_REDIR_MARK_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c index 4b83cee73..6adb3534c 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c @@ -1,6 +1,6 @@ /* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + **************************************************************************** + * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -11,146 +11,46 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** + **************************************************************************** */ #include "nss_core.h" #include "nss_gre_redir.h" #include "nss_gre_redir_stats.h" +#include "nss_gre_redir_strings.h" /* - * nss_gre_redir_stats_str - * GRE REDIR statistics string + * Declare atomic notifier data structure for statistics. */ -static int8_t *nss_gre_redir_stats_str[NSS_GRE_REDIR_STATS_MAX] = { - "TX Packets", - "TX Bytes", - "TX Drops", - "RX Packets", - "RX Bytes", - "RX Drops", - "TX Sjack Packets", - "RX Sjack packets", - "TX Offload Packets", - "RX Offload Packets", - "US exception RX Packets", - "US exception TX Packets", - "DS exception RX Packets", - "DS exception TX Packets", - "Encap SG alloc drop", - "Decap fail drop", - "Decap split drop", - "Split SG alloc fail", - "Split linear copy fail", - "Split not enough tailroom", - "Exception ds invalid dst", - "Decap eapol frames", - "Exception ds invalid appid", - "Headroom Unavailable", - "Exception ds Tx completion Success", - "Exception ds Tx completion drop" -}; +ATOMIC_NOTIFIER_HEAD(nss_gre_redir_stats_notifier); /* - * nss_gre_redir_stats() - * Make a row for GRE_REDIR stats. + * Spinlock to protect GRE redirect statistics update/read */ -static ssize_t nss_gre_redir_stats(char *line, int len, int i, struct nss_gre_redir_tunnel_stats *s) +DEFINE_SPINLOCK(nss_gre_redir_stats_lock); + +/* + * Array to hold tunnel stats along with if_num + */ +extern struct nss_gre_redir_tunnel_stats tun_stats[NSS_GRE_REDIR_MAX_INTERFACES]; + +/* + * nss_gre_redir_stats_get() + * Get GRE redirect tunnel stats. + */ +bool nss_gre_redir_stats_get(int index, struct nss_gre_redir_tunnel_stats *stats) { - char name[40]; - uint64_t tcnt = 0; - int j = 0; - - switch (i) { - case NSS_GRE_REDIR_STATS_TX_PKTS: - tcnt = s->node_stats.tx_packets; - return snprintf(line, len, "Common node stats start:\n\n%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_TX_BYTES: - tcnt = s->node_stats.tx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_TX_DROPS: - tcnt = s->tx_dropped; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_RX_PKTS: - tcnt = s->node_stats.rx_packets; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_RX_BYTES: - tcnt = s->node_stats.rx_bytes; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_RX_DROPS: - tcnt = s->node_stats.rx_dropped[0]; - return snprintf(line, len, "%s = %llu\nCommon node stats end.\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_SJACK_TX_PKTS: - tcnt = s->sjack_tx_packets; - return snprintf(line, len, "Offload stats start:\n\n%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS: - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - scnprintf(name, sizeof(name), "TX offload pkts for radio %d", j); - tcnt += snprintf(line + tcnt, len - tcnt, "%s = %llu\n", name, s->offl_tx_pkts[j]); - } - return tcnt; - case NSS_GRE_REDIR_STATS_SJACK_RX_PKTS: - tcnt = s->sjack_rx_packets; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS: - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - scnprintf(name, sizeof(name), "RX offload pkts for radio %d", j); - tcnt += snprintf(line + tcnt, len - tcnt, "%s = %llu\n", name, s->offl_rx_pkts[j]); - } - return tcnt; - case NSS_GRE_REDIR_STATS_EXCEPTION_US_RX_PKTS: - tcnt = s->exception_us_rx; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_EXCEPTION_US_TX_PKTS: - tcnt = s->exception_us_tx; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_EXCEPTION_DS_RX_PKTS: - tcnt = s->exception_ds_rx; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_EXCEPTION_DS_TX_PKTS: - tcnt = s->exception_ds_tx; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_ENCAP_SG_ALLOC_DROP: - tcnt = s->encap_sg_alloc_drop; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_DECAP_FAIL_DROP: - tcnt = s->decap_fail_drop; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_DECAP_SPLIT_DROP: - tcnt = s->decap_split_drop; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_SPLIT_SG_ALLOC_FAIL: - tcnt = s->split_sg_alloc_fail; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_SPLIT_LINEAR_COPY_FAIL: - tcnt = s->split_linear_copy_fail; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_SPLIT_NOT_ENOUGH_TAILROOM: - tcnt = s->split_not_enough_tailroom; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_EXCEPTION_DS_INVALID_DST_DROP: - tcnt = s->exception_ds_invalid_dst_drop; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_DECAP_EAPOL_FRAMES: - tcnt = s->decap_eapol_frames; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_EXCEPTION_DS_INV_APPID: - tcnt = s->exception_ds_inv_appid; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_HEADROOM_UNAVAILABLE: - tcnt = s->headroom_unavail; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_TX_COMPLETION_SUCCESS: - tcnt = s->tx_completion_success; - return snprintf(line, len, "%s = %llu\n", nss_gre_redir_stats_str[i], tcnt); - case NSS_GRE_REDIR_STATS_TX_COMPLETION_DROP: - tcnt = s->tx_completion_drop; - return snprintf(line, len, "%s = %llu\nOffload stats end.\n", nss_gre_redir_stats_str[i], tcnt); - default: - nss_warning("Unknown stats type %d.\n", i); - return 0; + spin_lock_bh(&nss_gre_redir_stats_lock); + if (tun_stats[index].ref_count == 0) { + spin_unlock_bh(&nss_gre_redir_stats_lock); + return false; } + + memcpy(stats, &tun_stats[index], sizeof(struct nss_gre_redir_tunnel_stats)); + spin_unlock_bh(&nss_gre_redir_stats_lock); + return true; } +EXPORT_SYMBOL(nss_gre_redir_stats_get); /* * nss_gre_redir_stats_read() @@ -158,14 +58,25 @@ static ssize_t nss_gre_redir_stats(char *line, int len, int i, struct nss_gre_re */ static ssize_t nss_gre_redir_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_GRE_REDIR_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * NSS_GRE_REDIR_MAX_INTERFACES; struct nss_stats_data *data = fp->private_data; - ssize_t bytes_read = 0; struct nss_gre_redir_tunnel_stats stats; - size_t bytes; - char line[80 * NSS_GRE_REDIR_MAX_RADIO]; - int start, end; + ssize_t bytes_read = 0; + size_t size_wr = 0; int index = 0; + char *lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return 0; + } + if (data) { index = data->index; } @@ -174,6 +85,7 @@ static ssize_t nss_gre_redir_stats_read(struct file *fp, char __user *ubuf, size * If we are done accomodating all the GRE_REDIR tunnels. */ if (index >= NSS_GRE_REDIR_MAX_INTERFACES) { + kfree(lbuf); return 0; } @@ -183,48 +95,23 @@ static ssize_t nss_gre_redir_stats_read(struct file *fp, char __user *ubuf, size /* * If gre_redir tunnel does not exists, then isthere will be false. */ - isthere = nss_gre_redir_get_stats(index, &stats); + isthere = nss_gre_redir_stats_get(index, &stats); if (!isthere) { continue; } - bytes = snprintf(line, sizeof(line), "\nTunnel stats for %s\n", stats.dev->name); - if ((bytes_read + bytes) > sz) { - break; - } - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto fail; - } - bytes_read += bytes; - start = NSS_GRE_REDIR_STATS_TX_PKTS; - end = NSS_GRE_REDIR_STATS_MAX; - while (bytes_read < sz && start < end) { - bytes = nss_gre_redir_stats(line, sizeof(line), start, &stats); - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto fail; - } - - bytes_read += bytes; - start++; - } - } - - if (bytes_read > 0) { - *ppos = bytes_read; + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir stats", NSS_STATS_SINGLE_CORE); + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nTunnel stats for %s\n", stats.dev->name); + size_wr += nss_stats_print("gre_redir", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_strings_stats, + &stats.tstats.rx_packets, NSS_GRE_REDIR_STATS_MAX, lbuf, size_wr, size_al); } + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); if (data) { data->index = index; } -fail: + kfree(lbuf); return bytes_read; } @@ -258,3 +145,168 @@ struct dentry *nss_gre_redir_stats_dentry_create(void) return gre_redir; } + +/* + * nss_gre_redir_stats_sync() + * Update gre_redir tunnel stats. + */ +void nss_gre_redir_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_stats_sync_msg *ngss) +{ + int i, j; + uint32_t type; + struct net_device *dev; + struct nss_gre_redir_tun_stats *node_stats; + + type = nss_dynamic_interface_get_type(nss_ctx, if_num); + dev = nss_cmn_get_interface_dev(nss_ctx, if_num); + if (!dev) { + nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); + return; + } + + if (!nss_gre_redir_verify_ifnum(if_num)) { + nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); + return; + } + + spin_lock_bh(&nss_gre_redir_stats_lock); + for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { + if (tun_stats[i].dev == dev) { + break; + } + } + + if (i == NSS_GRE_REDIR_MAX_INTERFACES) { + nss_warning("%px: Unable to find tunnel stats instance for interface %d\n", nss_ctx, if_num); + spin_unlock_bh(&nss_gre_redir_stats_lock); + return; + } + + nss_assert(tun_stats[i].ref_count); + node_stats = &tun_stats[i].tstats; + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER: + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER: + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER: + node_stats->tx_packets += ngss->node_stats.tx_packets; + node_stats->tx_bytes += ngss->node_stats.tx_bytes; + node_stats->sjack_tx_packets += ngss->sjack_rx_packets; + node_stats->encap_sg_alloc_drop += ngss->encap_sg_alloc_drop; + node_stats->tx_dropped += nss_cmn_rx_dropped_sum(&(ngss->node_stats)); + for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { + node_stats->offl_tx_pkts[j] += ngss->offl_rx_pkts[j]; + } + + break; + + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER: + node_stats->rx_packets += ngss->node_stats.rx_packets; + node_stats->rx_bytes += ngss->node_stats.rx_bytes; + node_stats->sjack_rx_packets += ngss->sjack_rx_packets; + node_stats->decap_fail_drop += ngss->decap_fail_drop; + node_stats->decap_split_drop += ngss->decap_split_drop; + node_stats->split_sg_alloc_fail += ngss->split_sg_alloc_fail; + node_stats->split_linear_copy_fail += ngss->split_linear_copy_fail; + node_stats->split_not_enough_tailroom += ngss->split_not_enough_tailroom; + node_stats->decap_eapol_frames += ngss->decap_eapol_frames; + for (j = 0; j < NSS_MAX_NUM_PRI; j++) { + node_stats->rx_dropped[j] += ngss->node_stats.rx_dropped[j]; + } + + for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { + node_stats->offl_rx_pkts[j] += ngss->offl_rx_pkts[j]; + } + + break; + + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US: + node_stats->exception_us_rx += ngss->node_stats.rx_packets; + node_stats->exception_us_tx += ngss->node_stats.tx_packets; + break; + + case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS: + node_stats->exception_ds_rx += ngss->node_stats.rx_packets; + node_stats->exception_ds_tx += ngss->node_stats.tx_packets; + node_stats->exception_ds_invalid_dst_drop += ngss->exception_ds_invalid_dst_drop; + node_stats->exception_ds_inv_appid += ngss->exception_ds_inv_appid; + node_stats->headroom_unavail += ngss->headroom_unavail; + node_stats->tx_completion_success += ngss->tx_completion_success; + node_stats->tx_completion_drop += ngss->tx_completion_drop; + break; + } + + spin_unlock_bh(&nss_gre_redir_stats_lock); +} + +/* + * nss_gre_redir_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_redir_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_redir_stats_notification *stats_notify; + struct net_device *dev; + int i; + + stats_notify = kzalloc(sizeof(struct nss_gre_redir_stats_notification), GFP_ATOMIC); + if (!stats_notify) { + nss_warning("Unable to allocate memory for stats notification\n"); + return; + } + + dev = nss_cmn_get_interface_dev(nss_ctx, if_num); + if (!dev) { + nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); + kfree(stats_notify); + return; + } + + if (!nss_gre_redir_verify_ifnum(if_num)) { + nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); + kfree(stats_notify); + return; + } + + spin_lock_bh(&nss_gre_redir_stats_lock); + for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { + if (tun_stats[i].dev == dev) { + break; + } + } + + if (i == NSS_GRE_REDIR_MAX_INTERFACES) { + nss_warning("%px: Unable to find tunnel stats instance for interface %d\n", nss_ctx, if_num); + spin_unlock_bh(&nss_gre_redir_stats_lock); + kfree(stats_notify); + return; + } + + stats_notify->core_id = nss_ctx->id; + stats_notify->if_num = if_num; + memcpy(&(stats_notify->stats_ctx), &(tun_stats[i]), sizeof(stats_notify->stats_ctx)); + spin_unlock_bh(&nss_gre_redir_stats_lock); + atomic_notifier_call_chain(&nss_gre_redir_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); + kfree(stats_notify); +} + +/* + * nss_gre_redir_stats_unregister_notifier() + * Degisters statistics notifier. + */ +int nss_gre_redir_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_redir_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_stats_unregister_notifier); + +/* + * nss_gre_redir_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_redir_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_redir_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_redir_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h index d7a96aed2..28f8fae3e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,42 +17,14 @@ #ifndef __NSS_GRE_REDIR_STATS_H__ #define __NSS_GRE_REDIR_STATS_H__ -/* - * GRE REDIR statistics - */ -enum nss_gre_redir_stats_types { - NSS_GRE_REDIR_STATS_TX_PKTS, - NSS_GRE_REDIR_STATS_TX_BYTES, - NSS_GRE_REDIR_STATS_TX_DROPS, - NSS_GRE_REDIR_STATS_RX_PKTS, - NSS_GRE_REDIR_STATS_RX_BYTES, - NSS_GRE_REDIR_STATS_RX_DROPS, - NSS_GRE_REDIR_STATS_SJACK_TX_PKTS, - NSS_GRE_REDIR_STATS_SJACK_RX_PKTS, - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS, - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS, - NSS_GRE_REDIR_STATS_EXCEPTION_US_RX_PKTS, - NSS_GRE_REDIR_STATS_EXCEPTION_US_TX_PKTS, - NSS_GRE_REDIR_STATS_EXCEPTION_DS_RX_PKTS, - NSS_GRE_REDIR_STATS_EXCEPTION_DS_TX_PKTS, - NSS_GRE_REDIR_STATS_ENCAP_SG_ALLOC_DROP, - NSS_GRE_REDIR_STATS_DECAP_FAIL_DROP, - NSS_GRE_REDIR_STATS_DECAP_SPLIT_DROP, - NSS_GRE_REDIR_STATS_SPLIT_SG_ALLOC_FAIL, - NSS_GRE_REDIR_STATS_SPLIT_LINEAR_COPY_FAIL, - NSS_GRE_REDIR_STATS_SPLIT_NOT_ENOUGH_TAILROOM, - NSS_GRE_REDIR_STATS_EXCEPTION_DS_INVALID_DST_DROP, - NSS_GRE_REDIR_STATS_DECAP_EAPOL_FRAMES, - NSS_GRE_REDIR_STATS_EXCEPTION_DS_INV_APPID, - NSS_GRE_REDIR_STATS_HEADROOM_UNAVAILABLE, - NSS_GRE_REDIR_STATS_TX_COMPLETION_SUCCESS, - NSS_GRE_REDIR_STATS_TX_COMPLETION_DROP, - NSS_GRE_REDIR_STATS_MAX -}; - /* * NSS GRE REDIR statistics APIs */ +extern spinlock_t nss_gre_redir_stats_lock; +extern bool nss_gre_redir_verify_ifnum(uint32_t if_num); +extern void nss_gre_redir_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_gre_redir_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, + struct nss_gre_redir_stats_sync_msg *ngss); extern struct dentry *nss_gre_redir_stats_dentry_create(void); #endif /* __NSS_GRE_REDIR_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c new file mode 100644 index 000000000..319be274e --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c @@ -0,0 +1,87 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_redir_strings.h" + +/* + * nss_gre_redir_strings_stats + * GRE redirect statistics string. + */ +struct nss_stats_info nss_gre_redir_strings_stats[NSS_GRE_REDIR_STATS_MAX] = { + {"RX Packets", NSS_STATS_TYPE_COMMON}, + {"RX Bytes", NSS_STATS_TYPE_COMMON}, + {"TX Packets", NSS_STATS_TYPE_COMMON}, + {"TX Bytes", NSS_STATS_TYPE_COMMON}, + {"RX Drops_[0]", NSS_STATS_TYPE_DROP}, + {"RX Drops_[1]", NSS_STATS_TYPE_DROP}, + {"RX Drops_[2]", NSS_STATS_TYPE_DROP}, + {"RX Drops_[3]", NSS_STATS_TYPE_DROP}, + {"TX Drops", NSS_STATS_TYPE_DROP}, + {"RX Sjack Packets", NSS_STATS_TYPE_SPECIAL}, + {"TX Sjack packets", NSS_STATS_TYPE_SPECIAL}, + {"RX Offload Packets_[0]", NSS_STATS_TYPE_SPECIAL}, + {"RX Offload Packets_[1]", NSS_STATS_TYPE_SPECIAL}, + {"RX Offload Packets_[2]", NSS_STATS_TYPE_SPECIAL}, + {"RX Offload Packets_[3]", NSS_STATS_TYPE_SPECIAL}, + {"RX Offload Packets_[4]", NSS_STATS_TYPE_SPECIAL}, + {"TX Offload Packets_[0]", NSS_STATS_TYPE_SPECIAL}, + {"TX Offload Packets_[1]", NSS_STATS_TYPE_SPECIAL}, + {"TX Offload Packets_[2]", NSS_STATS_TYPE_SPECIAL}, + {"TX Offload Packets_[3]", NSS_STATS_TYPE_SPECIAL}, + {"TX Offload Packets_[4]", NSS_STATS_TYPE_SPECIAL}, + {"US exception RX Packets", NSS_STATS_TYPE_EXCEPTION}, + {"US exception TX Packets", NSS_STATS_TYPE_EXCEPTION}, + {"DS exception RX Packets", NSS_STATS_TYPE_EXCEPTION}, + {"DS exception TX Packets", NSS_STATS_TYPE_EXCEPTION}, + {"Encap SG alloc drop", NSS_STATS_TYPE_DROP}, + {"Decap fail drop", NSS_STATS_TYPE_DROP}, + {"Decap split drop", NSS_STATS_TYPE_SPECIAL}, + {"Split SG alloc fail", NSS_STATS_TYPE_SPECIAL}, + {"Split linear copy fail", NSS_STATS_TYPE_SPECIAL}, + {"Split not enough tailroom", NSS_STATS_TYPE_EXCEPTION}, + {"Exception ds invalid dst", NSS_STATS_TYPE_SPECIAL}, + {"Decap eapol frames", NSS_STATS_TYPE_SPECIAL}, + {"Exception ds invalid appid", NSS_STATS_TYPE_EXCEPTION}, + {"Headroom Unavailable", NSS_STATS_TYPE_EXCEPTION}, + {"Exception ds Tx completion Success", NSS_STATS_TYPE_SPECIAL}, + {"Exception ds Tx completion drop", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_gre_redir_strings_read() + * Read GRE redirect statistics names. + */ +static ssize_t nss_gre_redir_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_strings_stats, NSS_GRE_REDIR_STATS_MAX); +} + +/* + * nss_gre_redir_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir); + +/* + * nss_gre_redir_strings_dentry_create() + * Create GRE redirect statistics strings debug entry. + */ +void nss_gre_redir_strings_dentry_create(void) +{ + nss_strings_create_dentry("gre_redir", &nss_gre_redir_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h new file mode 100644 index 000000000..b0f0ba340 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h @@ -0,0 +1,25 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_GRE_REDIR_STRINGS_H +#define __NSS_GRE_REDIR_STRINGS_H + +#include "nss_gre_redir_stats.h" + +extern struct nss_stats_info nss_gre_redir_strings_stats[NSS_GRE_REDIR_STATS_MAX]; +extern void nss_gre_redir_strings_dentry_create(void); + +#endif /* __NSS_GRE_REDIR_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c index 08a9279dc..3808e5e93 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -21,83 +21,26 @@ */ #include "nss_tx_rx_common.h" +#include "nss_gre.h" #include "nss_gre_stats.h" +#include "nss_gre_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_gre_stats_notifier); /* * Data structures to store GRE nss debug stats */ static DEFINE_SPINLOCK(nss_gre_stats_lock); -static struct nss_gre_stats_session_debug session_debug_stats[NSS_GRE_MAX_DEBUG_SESSION_STATS]; -static struct nss_gre_stats_base_debug base_debug_stats; - -/* - * nss_gre_stats_base_debug_str - * GRE debug statistics strings for base types - */ -struct nss_stats_info nss_gre_stats_base_debug_str[NSS_GRE_STATS_BASE_DEBUG_MAX] = { - {"base_rx_pkts" ,NSS_STATS_TYPE_COMMON}, - {"base_rx_drops" ,NSS_STATS_TYPE_DROP}, - {"base_exp_eth_hdr_missing" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_eth_type_non_ip" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_unknown_protocol" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_header_incomplete" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_bad_total_length" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_bad_checksum" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_datagram_incomplete" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_fragment" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_options_incomplete" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_with_options" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ipv6_unknown_protocol" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ipv6_header_incomplete" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_unknown_session" ,NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_node_inactive" ,NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_gre_stats_session_debug_str - * GRE debug statistics strings for sessions - */ -struct nss_stats_info nss_gre_stats_session_debug_str[NSS_GRE_STATS_SESSION_DEBUG_MAX] = { - {"session_pbuf_alloc_fail" , NSS_STATS_TYPE_ERROR}, - {"session_decap_forward_enqueue_fail" , NSS_STATS_TYPE_DROP}, - {"session_encap_forward_enqueue_fail" , NSS_STATS_TYPE_DROP}, - {"session_decap_tx_forwarded" , NSS_STATS_TYPE_SPECIAL}, - {"session_encap_rx_received" , NSS_STATS_TYPE_SPECIAL}, - {"session_encap_rx_drops" , NSS_STATS_TYPE_DROP}, - {"session_encap_rx_linear_fail" , NSS_STATS_TYPE_DROP}, - {"session_exp_rx_key_error" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_seq_error" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_cs_error" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_flag_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_malformed" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_invalid_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_no_headroom" , NSS_STATS_TYPE_EXCEPTION} -}; +static struct nss_gre_stats_session session_stats[NSS_GRE_MAX_DEBUG_SESSION_STATS]; +static struct nss_gre_stats_base base_stats; /* * GRE statistics APIs */ -/* - * nss_gre_stats_session_register() - * Register debug statistic for GRE session. - */ -void nss_gre_stats_session_register(uint32_t if_num, struct net_device *netdev) -{ - int i; - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (!session_debug_stats[i].valid) { - session_debug_stats[i].valid = true; - session_debug_stats[i].if_num = if_num; - session_debug_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_gre_stats_lock); -} - /* * nss_gre_stats_session_unregister() * Unregister debug statistic for GRE session. @@ -108,8 +51,8 @@ void nss_gre_stats_session_unregister(uint32_t if_num) spin_lock_bh(&nss_gre_stats_lock); for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_debug_stats[i].if_num == if_num) { - memset(&session_debug_stats[i], 0, sizeof(struct nss_gre_stats_session_debug)); + if (session_stats[i].if_num == if_num) { + memset(&session_stats[i], 0, sizeof(struct nss_gre_stats_session)); break; } } @@ -117,25 +60,45 @@ void nss_gre_stats_session_unregister(uint32_t if_num) } /* - * nss_gre_stats_session_debug_sync() + * nss_gre_stats_session_register() + * Register debug statistic for GRE session. + */ +void nss_gre_stats_session_register(uint32_t if_num, struct net_device *netdev) +{ + int i; + + spin_lock_bh(&nss_gre_stats_lock); + for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { + if (!session_stats[i].valid) { + session_stats[i].valid = true; + session_stats[i].if_num = if_num; + session_stats[i].if_index = netdev->ifindex; + break; + } + } + spin_unlock_bh(&nss_gre_stats_lock); +} + +/* + * nss_gre_stats_session_sync() * debug statistics sync for GRE session. */ -void nss_gre_stats_session_debug_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num) +void nss_gre_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num) { int i, j; enum nss_dynamic_interface_type interface_type = nss_dynamic_interface_get_type(nss_ctx, if_num); spin_lock_bh(&nss_gre_stats_lock); for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_debug_stats[i].if_num == if_num) { - for (j = 0; j < NSS_GRE_STATS_SESSION_DEBUG_MAX; j++) { - session_debug_stats[i].stats[j] += sstats->stats[j]; + if (session_stats[i].if_num == if_num) { + for (j = 0; j < NSS_GRE_SESSION_DEBUG_MAX; j++) { + session_stats[i].stats[j] += sstats->stats[j]; } if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER) { - session_debug_stats[i].stats[NSS_GRE_STATS_SESSION_ENCAP_RX_RECEIVED] += sstats->node_stats.rx_packets; + session_stats[i].stats[NSS_GRE_SESSION_ENCAP_RX_RECEIVED] += sstats->node_stats.rx_packets; } else if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER) { - session_debug_stats[i].stats[NSS_GRE_STATS_SESSION_DECAP_TX_FORWARDED] += sstats->node_stats.tx_packets; + session_stats[i].stats[NSS_GRE_SESSION_DECAP_TX_FORWARDED] += sstats->node_stats.tx_packets; } break; } @@ -144,38 +107,38 @@ void nss_gre_stats_session_debug_sync(struct nss_ctx_instance *nss_ctx, struct n } /* - * nss_gre_stats_base_debug_sync() + * nss_gre_stats_base_sync() * Debug statistics sync for GRE base node. */ -void nss_gre_stats_base_debug_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats) +void nss_gre_stats_base_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats) { int i; spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_STATS_BASE_DEBUG_MAX; i++) { - base_debug_stats.stats[i] += bstats->stats[i]; + for (i = 0; i < NSS_GRE_BASE_DEBUG_MAX; i++) { + base_stats.stats[i] += bstats->stats[i]; } spin_unlock_bh(&nss_gre_stats_lock); } /* - * nss_gre_stats_session_debug_get() + * nss_gre_stats_session_get() * Get GRE session debug statistics. */ -static void nss_gre_stats_session_debug_get(void *stats_mem, int size) +static void nss_gre_stats_session_get(void *stats_mem, int size) { - struct nss_gre_stats_session_debug *stats = (struct nss_gre_stats_session_debug *)stats_mem; + struct nss_gre_stats_session *stats = (struct nss_gre_stats_session *)stats_mem; int i; - if (!stats || (size < (sizeof(struct nss_gre_stats_session_debug) * NSS_GRE_MAX_DEBUG_SESSION_STATS))) { + if (!stats || (size < (sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS))) { nss_warning("No memory to copy gre stats"); return; } spin_lock_bh(&nss_gre_stats_lock); for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_debug_stats[i].valid) { - memcpy(stats, &session_debug_stats[i], sizeof(struct nss_gre_stats_session_debug)); + if (session_stats[i].valid) { + memcpy(stats, &session_stats[i], sizeof(struct nss_gre_stats_session)); stats++; } } @@ -183,25 +146,25 @@ static void nss_gre_stats_session_debug_get(void *stats_mem, int size) } /* - * nss_gre_stats_base_debug_get() + * nss_gre_stats_base_get() * Get GRE debug base statistics. */ -static void nss_gre_stats_base_debug_get(void *stats_mem, int size) +static void nss_gre_stats_base_get(void *stats_mem, int size) { - struct nss_gre_stats_base_debug *stats = (struct nss_gre_stats_base_debug *)stats_mem; + struct nss_gre_stats_base *stats = (struct nss_gre_stats_base *)stats_mem; if (!stats) { nss_warning("No memory to copy GRE base stats\n"); return; } - if (size < sizeof(struct nss_gre_stats_base_debug)) { + if (size < sizeof(struct nss_gre_stats_base)) { nss_warning("Not enough memory to copy GRE base stats\n"); return; } spin_lock_bh(&nss_gre_stats_lock); - memcpy(stats, &base_debug_stats, sizeof(struct nss_gre_stats_base_debug)); + memcpy(stats, &base_stats, sizeof(struct nss_gre_stats_base)); spin_unlock_bh(&nss_gre_stats_lock); } @@ -213,15 +176,15 @@ static ssize_t nss_gre_stats_read(struct file *fp, char __user *ubuf, size_t sz, { uint32_t max_output_lines = 2 /* header & footer for base debug stats */ + 2 /* header & footer for session debug stats */ - + NSS_GRE_STATS_BASE_DEBUG_MAX /* Base debug */ - + NSS_GRE_MAX_DEBUG_SESSION_STATS * (NSS_GRE_STATS_SESSION_DEBUG_MAX + 2) /*session stats */ + + NSS_GRE_BASE_DEBUG_MAX /* Base debug */ + + NSS_GRE_MAX_DEBUG_SESSION_STATS * (NSS_GRE_SESSION_DEBUG_MAX + 2) /*session stats */ + 2; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; struct net_device *dev; - struct nss_gre_stats_session_debug *sstats; - struct nss_gre_stats_base_debug *bstats; + struct nss_gre_stats_session *sstats; + struct nss_gre_stats_base *bstats; int id; char *lbuf = kzalloc(size_al, GFP_KERNEL); @@ -230,14 +193,14 @@ static ssize_t nss_gre_stats_read(struct file *fp, char __user *ubuf, size_t sz, return 0; } - bstats = kzalloc(sizeof(struct nss_gre_stats_base_debug), GFP_KERNEL); + bstats = kzalloc(sizeof(struct nss_gre_stats_base), GFP_KERNEL); if (unlikely(!bstats)) { nss_warning("Could not allocate memory for base debug statistics buffer"); kfree(lbuf); return 0; } - sstats = kzalloc(sizeof(struct nss_gre_stats_session_debug) * NSS_GRE_MAX_DEBUG_SESSION_STATS, GFP_KERNEL); + sstats = kzalloc(sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS, GFP_KERNEL); if (unlikely(!sstats)) { nss_warning("Could not allocate memory for base debug statistics buffer"); kfree(lbuf); @@ -250,18 +213,18 @@ static ssize_t nss_gre_stats_read(struct file *fp, char __user *ubuf, size_t sz, /* * Get all base stats */ - nss_gre_stats_base_debug_get((void *)bstats, sizeof(struct nss_gre_stats_base_debug)); + nss_gre_stats_base_get((void *)bstats, sizeof(struct nss_gre_stats_base)); size_wr += nss_stats_print("gre", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_gre_stats_base_debug_str + , nss_gre_strings_base_stats , bstats->stats - , NSS_GRE_STATS_BASE_DEBUG_MAX + , NSS_GRE_BASE_DEBUG_MAX , lbuf, size_wr, size_al); /* * Get all session stats */ - nss_gre_stats_session_debug_get(sstats, sizeof(struct nss_gre_stats_session_debug) * NSS_GRE_MAX_DEBUG_SESSION_STATS); + nss_gre_stats_session_get(sstats, sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS); for (id = 0; id < NSS_GRE_MAX_DEBUG_SESSION_STATS; id++) { @@ -280,9 +243,9 @@ static ssize_t nss_gre_stats_read(struct file *fp, char __user *ubuf, size_t sz, (sstats + id)->if_num); } size_wr += nss_stats_print("gre_session", NULL, id - , nss_gre_stats_session_debug_str + , nss_gre_strings_session_stats , (sstats + id)->stats - , NSS_GRE_STATS_SESSION_DEBUG_MAX + , NSS_GRE_SESSION_DEBUG_MAX , lbuf, size_wr, size_al); size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); } @@ -309,3 +272,67 @@ void nss_gre_stats_dentry_create(void) nss_stats_create_dentry("gre", &nss_gre_stats_ops); } +/* + * nss_gre_stats_base_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_stats_base_notify(struct nss_ctx_instance *nss_ctx) +{ + struct nss_gre_base_stats_notification gre_stats; + + spin_lock_bh(&nss_gre_stats_lock); + gre_stats.core_id = nss_ctx->id; + memcpy(gre_stats.stats_base_ctx, base_stats.stats, sizeof(gre_stats.stats_base_ctx)); + spin_unlock_bh(&nss_gre_stats_lock); + + atomic_notifier_call_chain(&nss_gre_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_stats); +} + +/* + * nss_gre_stats_session_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_stats_session_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_session_stats_notification gre_stats; + int i; + + spin_lock_bh(&nss_gre_stats_lock); + for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { + if (session_stats[i].if_num != if_num) { + continue; + } + + memcpy(gre_stats.stats_session_ctx, session_stats[i].stats, sizeof(gre_stats.stats_session_ctx)); + gre_stats.core_id = nss_ctx->id; + gre_stats.if_num = if_num; + spin_unlock_bh(&nss_gre_stats_lock); + atomic_notifier_call_chain(&nss_gre_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_stats); + return; + } + spin_unlock_bh(&nss_gre_stats_lock); +} + +/* + * nss_gre_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_gre_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_stats_unregister_notifier); + +/* + * nss_gre_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h index a16bd3454..7feb1d679 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -22,72 +22,32 @@ #ifndef __NSS_GRE_STATS_H #define __NSS_GRE_STATS_H -/* - * GRE base debug statistics types - */ -enum nss_gre_stats_base_debug_types { - NSS_GRE_STATS_BASE_RX_PACKETS, /**< Rx packet count. */ - NSS_GRE_STATS_BASE_RX_DROPPED, /**< Rx dropped count. */ - NSS_GRE_STATS_BASE_EXP_ETH_HDR_MISSING, /**< Ethernet header missing. */ - NSS_GRE_STATS_BASE_EXP_ETH_TYPE_NON_IP, /**< Not IPV4 or IPV6 packet. */ - NSS_GRE_STATS_BASE_EXP_IP_UNKNOWN_PROTOCOL, /**< Unknown protocol. */ - NSS_GRE_STATS_BASE_EXP_IP_HEADER_INCOMPLETE, /**< Bad IP header. */ - NSS_GRE_STATS_BASE_EXP_IP_BAD_TOTAL_LENGTH, /**< Invalid IP packet length. */ - NSS_GRE_STATS_BASE_EXP_IP_BAD_CHECKSUM, /**< Bad packet checksum. */ - NSS_GRE_STATS_BASE_EXP_IP_DATAGRAM_INCOMPLETE, /**< Bad packet. */ - NSS_GRE_STATS_BASE_EXP_IP_FRAGMENT, /**< IP fragment. */ - NSS_GRE_STATS_BASE_EXP_IP_OPTIONS_INCOMPLETE, /**< Invalid IP options. */ - NSS_GRE_STATS_BASE_EXP_IP_WITH_OPTIONS, /**< IP packet with options. */ - NSS_GRE_STATS_BASE_EXP_IPV6_UNKNOWN_PROTOCOL, /**< Unknown protocol. */ - NSS_GRE_STATS_BASE_EXP_IPV6_HEADER_INCOMPLETE, /**< Incomplete IPV6 header. */ - NSS_GRE_STATS_BASE_EXP_GRE_UNKNOWN_SESSION, /**< Unknown GRE session. */ - NSS_GRE_STATS_BASE_EXP_GRE_NODE_INACTIVE, /**< GRE node inactive. */ - NSS_GRE_STATS_BASE_DEBUG_MAX, /**< GRE base error max. */ -}; +#include /* * GRE base debug statistics */ -struct nss_gre_stats_base_debug { - uint64_t stats[NSS_GRE_STATS_BASE_DEBUG_MAX]; /**< GRE debug statistics. */ -}; - -/* - * GRE session debug statistics types - */ -enum nss_gre_stats_session_debug_types { - NSS_GRE_STATS_SESSION_PBUF_ALLOC_FAIL, /**< Pbuf alloc failure. */ - NSS_GRE_STATS_SESSION_DECAP_FORWARD_ENQUEUE_FAIL, /**< Rx forward enqueue failure. */ - NSS_GRE_STATS_SESSION_ENCAP_FORWARD_ENQUEUE_FAIL, /**< Tx forward enqueue failure. */ - NSS_GRE_STATS_SESSION_DECAP_TX_FORWARDED, /**< Packets forwarded after decap. */ - NSS_GRE_STATS_SESSION_ENCAP_RX_RECEIVED, /**< Packets received for encap. */ - NSS_GRE_STATS_SESSION_ENCAP_RX_DROPPED, /**< Packets dropped while enqueue for encap. */ - NSS_GRE_STATS_SESSION_ENCAP_RX_LINEAR_FAIL, /**< Packets dropped during encap linearization. */ - NSS_GRE_STATS_SESSION_EXP_RX_KEY_ERROR, /**< Rx KEY error. */ - NSS_GRE_STATS_SESSION_EXP_RX_SEQ_ERROR, /**< Rx sequence number error. */ - NSS_GRE_STATS_SESSION_EXP_RX_CS_ERROR, /**< Rx checksum error. */ - NSS_GRE_STATS_SESSION_EXP_RX_FLAG_MISMATCH, /**< Rx flag mismatch. */ - NSS_GRE_STATS_SESSION_EXP_RX_MALFORMED, /**< Rx malformed packet. */ - NSS_GRE_STATS_SESSION_EXP_RX_INVALID_PROTOCOL, /**< Rx invalid protocol. */ - NSS_GRE_STATS_SESSION_EXP_RX_NO_HEADROOM, /**< Rx no headroom. */ - NSS_GRE_STATS_SESSION_DEBUG_MAX, /**< Session debug max. */ +struct nss_gre_stats_base { + uint64_t stats[NSS_GRE_BASE_DEBUG_MAX]; /**< GRE debug statistics. */ }; /* * GRE session debug statistics */ -struct nss_gre_stats_session_debug { - uint64_t stats[NSS_GRE_STATS_SESSION_DEBUG_MAX]; /**< Session debug statistics. */ - int32_t if_index; /**< Netdevice's ifindex. */ - uint32_t if_num; /**< NSS interface number. */ - bool valid; /**< Is node valid ? */ +struct nss_gre_stats_session { + uint64_t stats[NSS_GRE_SESSION_DEBUG_MAX]; /**< Session debug statistics. */ + int32_t if_index; /**< Netdevice's ifindex. */ + uint32_t if_num; /**< NSS interface number. */ + bool valid; /**< Is node valid ? */ }; /* * GRE statistics APIs */ -extern void nss_gre_stats_session_debug_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num); -extern void nss_gre_stats_base_debug_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats); +extern void nss_gre_stats_base_notify(struct nss_ctx_instance *nss_ctx); +extern void nss_gre_stats_session_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_gre_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num); +extern void nss_gre_stats_base_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats); extern void nss_gre_stats_session_register(uint32_t if_num, struct net_device *netdev); extern void nss_gre_stats_session_unregister(uint32_t if_num); extern void nss_gre_stats_dentry_create(void); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c new file mode 100644 index 000000000..26c652d75 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c @@ -0,0 +1,124 @@ +/* + *************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_strings.h" + +/* + * nss_gre_strings_base_stats + * GRE debug statistics strings for base types + */ +struct nss_stats_info nss_gre_strings_base_stats[NSS_GRE_BASE_DEBUG_MAX] = { + {"base_rx_pkts", NSS_STATS_TYPE_COMMON}, + {"base_rx_drops", NSS_STATS_TYPE_DROP}, + {"base_exp_eth_hdr_missing", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_eth_type_non_ip", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_unknown_protocol", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_header_incomplete", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_bad_total_length", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_bad_checksum", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_datagram_incomplete", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_fragment", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_options_incomplete", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ip_with_options", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ipv6_unknown_protocol", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_ipv6_header_incomplete", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_unknown_session", NSS_STATS_TYPE_EXCEPTION}, + {"base_exp_node_inactive", NSS_STATS_TYPE_EXCEPTION} +}; + +/* + * nss_gre_base_strings_read() + * Read GRE base debug statistics names + */ +static ssize_t nss_gre_base_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_strings_base_stats, NSS_GRE_BASE_DEBUG_MAX); +} + +/* + * nss_gre_base_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_base); + +/* + * nss_gre_strings_session_stats + * GRE debug statistics strings for sessions + */ +struct nss_stats_info nss_gre_strings_session_stats[NSS_GRE_SESSION_DEBUG_MAX] = { + {"session_pbuf_alloc_fail", NSS_STATS_TYPE_ERROR}, + {"session_decap_forward_enqueue_fail", NSS_STATS_TYPE_DROP}, + {"session_encap_forward_enqueue_fail", NSS_STATS_TYPE_DROP}, + {"session_decap_tx_forwarded", NSS_STATS_TYPE_SPECIAL}, + {"session_encap_rx_received", NSS_STATS_TYPE_SPECIAL}, + {"session_encap_rx_drops", NSS_STATS_TYPE_DROP}, + {"session_encap_rx_linear_fail", NSS_STATS_TYPE_DROP}, + {"session_exp_rx_key_error", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_seq_error", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_cs_error", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_flag_mismatch", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_malformed", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_invalid_protocol", NSS_STATS_TYPE_EXCEPTION}, + {"session_exp_rx_no_headroom", NSS_STATS_TYPE_EXCEPTION} +}; + +/* + * nss_gre_session_strings_read() + * Read GRE session debug statistics names + */ +static ssize_t nss_gre_session_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_strings_session_stats, NSS_GRE_SESSION_DEBUG_MAX); +} + +/* + * nss_gre_session_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_session); + +/* + * nss_gre_strings_dentry_create() + * Create gre statistics strings debug entry. + */ +void nss_gre_strings_dentry_create(void) +{ + struct dentry *gre_d = NULL; + + if (!nss_top_main.strings_dentry) { + nss_warning("qca-nss-drv/strings is not present"); + return; + } + + gre_d = debugfs_create_dir("gre", nss_top_main.strings_dentry); + if (!gre_d) { + nss_warning("Failed to create qca-nss-drv/strings/gre directory"); + return; + } + + if (!debugfs_create_file("gre_base", 0400, gre_d, &nss_top_main, &nss_gre_base_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/gre/gre_base file"); + debugfs_remove_recursive(gre_d); + return; + } + + if (!debugfs_create_file("gre_session", 0400, gre_d, &nss_top_main, &nss_gre_session_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/gre/gre_session file"); + debugfs_remove_recursive(gre_d); + return; + } +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h new file mode 100644 index 000000000..e8a421fce --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h @@ -0,0 +1,26 @@ +/* + **************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_GRE_STRINGS_H +#define __NSS_GRE_STRINGS_H + +#include "nss_gre_stats.h" + +extern struct nss_stats_info nss_gre_strings_base_stats[NSS_GRE_BASE_DEBUG_MAX]; +extern struct nss_stats_info nss_gre_strings_session_stats[NSS_GRE_SESSION_DEBUG_MAX]; +extern void nss_gre_strings_dentry_create(void); + +#endif /* __NSS_GRE_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c index 07e7860af..1e9a22a72 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,6 +17,7 @@ #include "nss_tx_rx_common.h" #include "nss_gre_tunnel_stats.h" #include "nss_gre_tunnel_log.h" +#include "nss_gre_tunnel_strings.h" #define NSS_GRE_TUNNEL_TX_TIMEOUT 3000 /* 3 Seconds */ @@ -89,6 +90,7 @@ static void nss_gre_tunnel_handler(struct nss_ctx_instance *nss_ctx, struct nss_ switch (ngtm->cm.type) { case NSS_GRE_TUNNEL_MSG_STATS: nss_gre_tunnel_stats_session_sync(nss_ctx, &ngtm->msg.stats, ncm->interface); + nss_gre_tunnel_stats_notify(nss_ctx, ncm->interface); break; } @@ -318,16 +320,16 @@ struct nss_ctx_instance *nss_gre_tunnel_register_if(uint32_t if_num, BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - spin_lock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_lock_bh(&nss_gre_tunnel_stats_lock); for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (!nss_gre_tunnel_session_debug_stats[i].valid) { - nss_gre_tunnel_session_debug_stats[i].valid = true; - nss_gre_tunnel_session_debug_stats[i].if_num = if_num; - nss_gre_tunnel_session_debug_stats[i].if_index = netdev->ifindex; + if (!session_stats[i].valid) { + session_stats[i].valid = true; + session_stats[i].if_num = if_num; + session_stats[i].if_index = netdev->ifindex; break; } } - spin_unlock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); if (i == NSS_MAX_GRE_TUNNEL_SESSIONS) { nss_warning("%px: Cannot find free slot for GRE Tunnel session stats, I/F:%u\n", nss_ctx, if_num); @@ -336,9 +338,9 @@ struct nss_ctx_instance *nss_gre_tunnel_register_if(uint32_t if_num, if (nss_ctx->subsys_dp_register[if_num].ndev) { nss_warning("%px: Cannot find free slot for GRE Tunnel NSS I/F:%u\n", nss_ctx, if_num); - nss_gre_tunnel_session_debug_stats[i].valid = false; - nss_gre_tunnel_session_debug_stats[i].if_num = 0; - nss_gre_tunnel_session_debug_stats[i].if_index = 0; + session_stats[i].valid = false; + session_stats[i].if_num = 0; + session_stats[i].if_index = 0; return NULL; } @@ -347,6 +349,7 @@ struct nss_ctx_instance *nss_gre_tunnel_register_if(uint32_t if_num, nss_top_main.gre_tunnel_msg_callback = ev_cb; nss_core_register_handler(nss_ctx, if_num, nss_gre_tunnel_handler, app_ctx); nss_gre_tunnel_stats_dentry_create(); + nss_gre_tunnel_strings_dentry_create(); return nss_ctx; } @@ -363,15 +366,15 @@ void nss_gre_tunnel_unregister_if(uint32_t if_num) BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - spin_lock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_lock_bh(&nss_gre_tunnel_stats_lock); for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (nss_gre_tunnel_session_debug_stats[i].if_num == if_num) { - memset(&nss_gre_tunnel_session_debug_stats[i], 0, - sizeof(struct nss_gre_tunnel_stats_session_debug)); + if (session_stats[i].if_num == if_num) { + memset(&session_stats[i], 0, + sizeof(struct nss_gre_tunnel_stats_session)); break; } } - spin_unlock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); if (i == NSS_MAX_GRE_TUNNEL_SESSIONS) { nss_warning("%px: Cannot find debug stats for GRE Tunnel session: %d\n", nss_ctx, if_num); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c index 8a957f26e..c3e53bf85 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c @@ -1,6 +1,6 @@ /* - ************************************************************************** - * Copyright (c) 2017, 2020, The Linux Foundation. All rights reserved. + **************************************************************************** + * Copyright (c) 2017, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -11,48 +11,25 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** + **************************************************************************** */ #include "nss_tx_rx_common.h" +#include "nss_gre_tunnel.h" #include "nss_gre_tunnel_stats.h" - -DEFINE_SPINLOCK(nss_gre_tunnel_stats_session_debug_lock); -struct nss_gre_tunnel_stats_session_debug nss_gre_tunnel_session_debug_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; +#include "nss_gre_tunnel_strings.h" /* - * nss_gre_tunnel_stats_session_debug_str - * GRE Tunnel statistics strings for nss session stats + * Declare atomic notifier data structure for statistics. */ -static int8_t *nss_gre_tunnel_stats_session_debug_str[NSS_GRE_TUNNEL_STATS_SESSION_MAX] = { - "RX_PKTS", - "TX_PKTS", - "RX_QUEUE_0_DROPPED", - "RX_QUEUE_1_DROPPED", - "RX_QUEUE_2_DROPPED", - "RX_QUEUE_3_DROPPED", - "RX_MALFORMED", - "RX_INVALID_PROT", - "DECAP_QUEUE_FULL", - "RX_SINGLE_REC_DGRAM", - "RX_INVALID_REC_DGRAM", - "BUFFER_ALLOC_FAIL", - "BUFFER_COPY_FAIL", - "OUTFLOW_QUEUE_FULL", - "TX_DROPPED_HROOM", - "RX_CBUFFER_ALLOC_FAIL", - "RX_CENQUEUE_FAIL", - "RX_DECRYPT_DONE", - "RX_FORWARD_ENQUEUE_FAIL", - "TX_CBUFFER_ALLOC_FAIL", - "TX_CENQUEUE_FAIL", - "TX_DROPPED_TROOM", - "TX_FORWARD_ENQUEUE_FAIL", - "TX_CIPHER_DONE", - "CRYPTO_NOSUPP", - "RX_DROPPED_MH_VERSION", - "RX_UNALIGNED_PKT", -}; +ATOMIC_NOTIFIER_HEAD(nss_gre_tunnel_stats_notifier); + +/* + * Spinlock to protect gre tunnel statistics update/read + */ +DEFINE_SPINLOCK(nss_gre_tunnel_stats_lock); + +struct nss_gre_tunnel_stats_session session_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; /* * nss_gre_tunnel_stats_session_sync() @@ -62,20 +39,20 @@ void nss_gre_tunnel_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct uint16_t if_num) { int i; - struct nss_gre_tunnel_stats_session_debug *s = NULL; + struct nss_gre_tunnel_stats_session *s = NULL; NSS_VERIFY_CTX_MAGIC(nss_ctx); - spin_lock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_lock_bh(&nss_gre_tunnel_stats_lock); for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (nss_gre_tunnel_session_debug_stats[i].if_num == if_num) { - s = &nss_gre_tunnel_session_debug_stats[i]; + if (session_stats[i].if_num == if_num) { + s = &session_stats[i]; break; } } if (!s) { - spin_unlock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); nss_warning("%px: Session not found: %u", nss_ctx, if_num); return; } @@ -118,14 +95,14 @@ void nss_gre_tunnel_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct #endif } - spin_unlock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); } /* - * nss_gre_tunnel_stats_session_debug_get() + * nss_gre_tunnel_stats_session_get() * Get session GRE Tunnel statitics. */ -static void nss_gre_tunnel_stats_session_debug_get(struct nss_gre_tunnel_stats_session_debug *stats) +static void nss_gre_tunnel_stats_session_get(struct nss_gre_tunnel_stats_session *stats) { int i; @@ -134,15 +111,15 @@ static void nss_gre_tunnel_stats_session_debug_get(struct nss_gre_tunnel_stats_s return; } - spin_lock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_lock_bh(&nss_gre_tunnel_stats_lock); for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (nss_gre_tunnel_session_debug_stats[i].valid) { - memcpy(stats, &nss_gre_tunnel_session_debug_stats[i], - sizeof(struct nss_gre_tunnel_stats_session_debug)); + if (session_stats[i].valid) { + memcpy(stats, &session_stats[i], + sizeof(struct nss_gre_tunnel_stats_session)); stats++; } } - spin_unlock_bh(&nss_gre_tunnel_stats_session_debug_lock); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); } /* @@ -157,9 +134,10 @@ static ssize_t nss_gre_tunnel_stats_read(struct file *fp, char __user *ubuf, size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; struct net_device *dev; int id, i; - struct nss_gre_tunnel_stats_session_debug *gre_tunnel_session_stats = NULL; + struct nss_gre_tunnel_stats_session *gre_tunnel_session_stats = NULL; char *lbuf = kzalloc(size_al, GFP_KERNEL); if (unlikely(lbuf == NULL)) { @@ -167,24 +145,31 @@ static ssize_t nss_gre_tunnel_stats_read(struct file *fp, char __user *ubuf, return 0; } - gre_tunnel_session_stats = kzalloc((sizeof(struct nss_gre_tunnel_stats_session_debug) + stats_shadow = kzalloc(NSS_CRYPTO_CMN_RESP_ERROR_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + return 0; + } + + gre_tunnel_session_stats = kzalloc((sizeof(struct nss_gre_tunnel_stats_session) * NSS_MAX_GRE_TUNNEL_SESSIONS), GFP_KERNEL); if (unlikely(gre_tunnel_session_stats == NULL)) { nss_warning("Could not allocate memory for populating GRE Tunnel stats"); kfree(lbuf); + kfree(stats_shadow); return 0; } /* * Get all stats */ - nss_gre_tunnel_stats_session_debug_get(gre_tunnel_session_stats); + nss_gre_tunnel_stats_session_get(gre_tunnel_session_stats); /* * Session stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\nGRE Tunnel session stats start:\n\n"); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "GRE tunnel stats", NSS_STATS_SINGLE_CORE); for (id = 0; id < NSS_MAX_GRE_TUNNEL_SESSIONS; id++) { if (!gre_tunnel_session_stats[id].valid) @@ -203,34 +188,33 @@ static ssize_t nss_gre_tunnel_stats_read(struct file *fp, char __user *ubuf, gre_tunnel_session_stats[id].if_num); } - for (i = 0; i < NSS_GRE_TUNNEL_STATS_SESSION_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", - nss_gre_tunnel_stats_session_debug_str[i], - gre_tunnel_session_stats[id].stats[i]); - } + size_wr += nss_stats_print("gre_tunnel", NULL, NSS_STATS_SINGLE_INSTANCE, + nss_gre_tunnel_strings_stats, gre_tunnel_session_stats[id].stats, + NSS_GRE_TUNNEL_STATS_SESSION_MAX, lbuf, size_wr, size_al); /* * Print crypto resp err stats. * TODO: We are not printing with the right enum string for crypto. This * is intentional since we atleast want to see some stats for now. */ + spin_lock_bh(&nss_gre_tunnel_stats_lock); for (i = 0; i < NSS_CRYPTO_CMN_RESP_ERROR_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", - nss_gre_tunnel_stats_session_debug_str[i], - gre_tunnel_session_stats[id].stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + i]); + stats_shadow[i] = gre_tunnel_session_stats[id].stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + i]; } + spin_unlock_bh(&nss_gre_tunnel_stats_lock); + size_wr += nss_stats_print("gre_tunnel", NULL, NSS_STATS_SINGLE_INSTANCE, + nss_gre_tunnel_strings_stats, stats_shadow, + NSS_CRYPTO_CMN_RESP_ERROR_MAX, lbuf, size_wr, size_al); + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\nGRE Tunnel session stats end\n"); bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); kfree(gre_tunnel_session_stats); kfree(lbuf); + kfree(stats_shadow); return bytes_read; } @@ -247,3 +231,52 @@ void nss_gre_tunnel_stats_dentry_create(void) { nss_stats_create_dentry("gre_tunnel", &nss_gre_tunnel_stats_ops); } + +/* + * nss_gre_tunnel_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_gre_tunnel_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_gre_tunnel_stats_notification gre_tunnel_stats; + struct nss_gre_tunnel_stats_session *s = NULL; + int i; + + spin_lock_bh(&nss_gre_tunnel_stats_lock); + for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { + if (session_stats[i].if_num != if_num) { + continue; + } + + s = &session_stats[i]; + gre_tunnel_stats.core_id = nss_ctx->id; + gre_tunnel_stats.if_num = if_num; + memcpy(gre_tunnel_stats.stats_ctx, s->stats, sizeof(gre_tunnel_stats.stats_ctx)); + spin_unlock_bh(&nss_gre_tunnel_stats_lock); + atomic_notifier_call_chain(&nss_gre_tunnel_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_tunnel_stats); + return; + } + spin_unlock_bh(&nss_gre_tunnel_stats_lock); +} + +/* + * nss_gre_tunnel_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_gre_tunnel_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_gre_tunnel_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_tunnel_stats_unregister_notifier); + +/* + * nss_gre_tunnel_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_gre_tunnel_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_gre_tunnel_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_gre_tunnel_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h index c20ed930c..cdee4788d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,59 +17,27 @@ #ifndef __NSS_GRE_TUNNEL_STATS_H #define __NSS_GRE_TUNNEL_STATS_H -/* - * GRE Tunnel session debug statistic counters - */ -enum nss_gre_tunnel_stats_session { - NSS_GRE_TUNNEL_STATS_SESSION_RX_PKTS, - NSS_GRE_TUNNEL_STATS_SESSION_TX_PKTS, - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_0_DROPPED, - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_1_DROPPED, - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_2_DROPPED, - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_3_DROPPED, - NSS_GRE_TUNNEL_STATS_SESSION_RX_MALFORMED, - NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_PROT, - NSS_GRE_TUNNEL_STATS_SESSION_DECAP_QUEUE_FULL, - NSS_GRE_TUNNEL_STATS_SESSION_RX_SINGLE_REC_DGRAM, - NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_REC_DGRAM, - NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_ALLOC_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_COPY_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_OUTFLOW_QUEUE_FULL, - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_HROOM, - NSS_GRE_TUNNEL_STATS_SESSION_RX_CBUFFER_ALLOC_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_RX_CENQUEUE_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_RX_DECRYPT_DONE, - NSS_GRE_TUNNEL_STATS_SESSION_RX_FORWARD_ENQUEUE_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_TX_CBUFFER_ALLOC_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_TX_CENQUEUE_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_TROOM, - NSS_GRE_TUNNEL_STATS_SESSION_TX_FORWARD_ENQUEUE_FAIL, - NSS_GRE_TUNNEL_STATS_SESSION_TX_CIPHER_DONE, - NSS_GRE_TUNNEL_STATS_SESSION_CRYPTO_NOSUPP, - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_MH_VERSION, - NSS_GRE_TUNNEL_STATS_SESSION_RX_UNALIGNED_PKT, - NSS_GRE_TUNNEL_STATS_SESSION_MAX, -}; - /* * GRE Tunnel session debug statistics */ -struct nss_gre_tunnel_stats_session_debug { +struct nss_gre_tunnel_stats_session { uint64_t stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + NSS_CRYPTO_CMN_RESP_ERROR_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ + /* GRE tunnel statistics */ + int32_t if_index; /* Interface index */ + uint32_t if_num; /* NSS interface number */ bool valid; }; /* * Data structures to store GRE Tunnel nss debug stats */ -extern spinlock_t nss_gre_tunnel_stats_session_debug_lock; -extern struct nss_gre_tunnel_stats_session_debug nss_gre_tunnel_session_debug_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; +extern spinlock_t nss_gre_tunnel_stats_lock; +extern struct nss_gre_tunnel_stats_session session_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; /* * GRE Tunnel statistics APIs */ +extern void nss_gre_tunnel_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); extern void nss_gre_tunnel_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_stats *stats_msg, uint16_t if_num); extern void nss_gre_tunnel_stats_dentry_create(void); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c new file mode 100644 index 000000000..402182e61 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c @@ -0,0 +1,77 @@ +/* + **************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_gre_tunnel_strings.h" + +/* + * nss_gre_tunnel_strings_stats + * GRE Tunnel statistics strings for nss session stats + */ +struct nss_stats_info nss_gre_tunnel_strings_stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_queue_0_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_1_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_2_dropped", NSS_STATS_TYPE_DROP}, + {"rx_queue_3_dropped", NSS_STATS_TYPE_DROP}, + {"rx_malformed", NSS_STATS_TYPE_SPECIAL}, + {"rx_invalid_prot", NSS_STATS_TYPE_SPECIAL}, + {"decap_queue_full", NSS_STATS_TYPE_SPECIAL}, + {"rx_single_rec_dgram", NSS_STATS_TYPE_SPECIAL}, + {"rx_invalid_rec_dgram", NSS_STATS_TYPE_SPECIAL}, + {"buffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, + {"buffer_copy_fail", NSS_STATS_TYPE_SPECIAL}, + {"outflow_queue_full", NSS_STATS_TYPE_SPECIAL}, + {"tx_dropped_hroom", NSS_STATS_TYPE_DROP}, + {"rx_cbuffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, + {"rx_cenqueue_fail", NSS_STATS_TYPE_SPECIAL}, + {"rx_decrypt_done", NSS_STATS_TYPE_SPECIAL}, + {"rx_forward_enqueue_fail", NSS_STATS_TYPE_SPECIAL}, + {"tx_cbuffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, + {"tx_cenqueue_fail", NSS_STATS_TYPE_SPECIAL}, + {"rx_dropped_troom", NSS_STATS_TYPE_DROP}, + {"tx_forward_enqueue_fail", NSS_STATS_TYPE_SPECIAL}, + {"tx_cipher_done", NSS_STATS_TYPE_SPECIAL}, + {"crypto_nosupp", NSS_STATS_TYPE_SPECIAL}, + {"rx_dropped_mh_version", NSS_STATS_TYPE_SPECIAL}, + {"rx_unaligned_pkt", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_gre_tunnel_strings_read() + * Read gre_tunnel session debug statistics names + */ +static ssize_t nss_gre_tunnel_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_gre_tunnel_strings_stats, NSS_GRE_TUNNEL_STATS_SESSION_MAX); +} + +/* + * nss_gre_tunnel_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_tunnel); + +/* + * nss_gre_tunnel_strings_dentry_create() + * Create gre_tunnel statistics strings debug entry. + */ +void nss_gre_tunnel_strings_dentry_create(void) +{ + nss_strings_create_dentry("gre_tunnel", &nss_gre_tunnel_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h new file mode 100644 index 000000000..829469492 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h @@ -0,0 +1,25 @@ +/* + **************************************************************************** + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_GRE_TUNNEL_STRINGS_H +#define __NSS_GRE_TUNNEL_STRINGS_H + +#include "nss_gre_tunnel_stats.h" + +extern struct nss_stats_info nss_gre_tunnel_strings_stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX]; +extern void nss_gre_tunnel_strings_dentry_create(void); + +#endif /* __NSS_GRE_TUNNEL_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c index ab3b8ec6d..4a72d3d82 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -151,6 +151,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device * goto out; } + nss_assert(npd->vphys); npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); if (!npd->vmap) { nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c index d49fdfaf5..b8733e04b 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013, 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013, 2015-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -464,6 +464,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device * goto out; } + nss_assert(npd->vphys); npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); if (!npd->vmap) { nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c index e5cf1b94b..b95a23c4b 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -240,6 +240,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device * goto out; } + nss_assert(npd->vphys); npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); if (!npd->vmap) { nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c index 7172e2a77..30085e010 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -137,6 +137,7 @@ void nss_hal_dt_parse_features(struct device_node *np, struct nss_platform_data npd->wifioffload_enabled = of_property_read_bool(np, "qcom,wlan-dataplane-offload-enabled"); npd->match_enabled = of_property_read_bool(np, "qcom,match-enabled"); npd->mirror_enabled = of_property_read_bool(np, "qcom,mirror-enabled"); + npd->udp_st_enabled = of_property_read_bool(np, "qcom,udp-st-enabled"); } /* * nss_hal_clean_up_irq() @@ -292,7 +293,6 @@ int nss_hal_probe(struct platform_device *nss_dev) * Physical address of logical registers space */ nss_ctx->vphys = npd->vphys; - nss_assert(nss_ctx->vphys); nss_info("%d:ctx=%px, vphys=%x, vmap=%px, nphys=%x, nmap=%px", nss_ctx->id, nss_ctx, nss_ctx->vphys, nss_ctx->vmap, nss_ctx->nphys, nss_ctx->nmap); @@ -385,24 +385,31 @@ int nss_hal_probe(struct platform_device *nss_dev) #ifdef NSS_DRV_CAPWAP_ENABLE if (npd->capwap_enabled == NSS_FEATURE_ENABLED) { nss_top->capwap_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP] = nss_dev->id; + nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER] = nss_dev->id; + nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER] = nss_dev->id; } #endif +#ifdef NSS_DRV_IPV4_REASM_ENABLE if (npd->ipv4_reasm_enabled == NSS_FEATURE_ENABLED) { nss_top->ipv4_reasm_handler_id = nss_dev->id; nss_ipv4_reasm_register_handler(); } +#endif +#ifdef NSS_DRV_IPV6_ENABLE if (npd->ipv6_enabled == NSS_FEATURE_ENABLED) { nss_top->ipv6_handler_id = nss_dev->id; nss_ipv6_register_handler(); } +#ifdef NSS_DRV_IPV6_REASM_ENABLE if (npd->ipv6_reasm_enabled == NSS_FEATURE_ENABLED) { nss_top->ipv6_reasm_handler_id = nss_dev->id; nss_ipv6_reasm_register_handler(); } +#endif +#endif #ifdef NSS_DRV_CRYPTO_ENABLE /* @@ -561,11 +568,16 @@ int nss_hal_probe(struct platform_device *nss_dev) nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id; nss_wifi_register_handler(); nss_wifili_register_handler(); +#ifdef NSS_DRV_WIFI_EXT_VDEV_ENABLE nss_wifi_ext_vdev_register_handler(); +#endif nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL] = nss_dev->id; nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0] = nss_dev->id; nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1] = nss_dev->id; nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS] = nss_dev->id; + nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN] = nss_dev->id; + nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER] = nss_dev->id; + nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER] = nss_dev->id; /* * Register wifi mac database when offload enabled @@ -586,11 +598,13 @@ int nss_hal_probe(struct platform_device *nss_dev) } #endif +#ifdef NSS_DRV_BRIDGE_ENABLE if (npd->bridge_enabled == NSS_FEATURE_ENABLED) { nss_top->bridge_handler_id = nss_dev->id; nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE] = nss_dev->id; nss_bridge_init(); } +#endif if (npd->vlan_enabled == NSS_FEATURE_ENABLED) { nss_top->vlan_handler_id = nss_dev->id; @@ -679,6 +693,13 @@ int nss_hal_probe(struct platform_device *nss_dev) #endif +#ifdef NSS_DRV_UDP_ST_ENABLE + if (npd->udp_st_enabled == NSS_FEATURE_ENABLED) { + nss_top->udp_st_handler_id = nss_dev->id; + nss_udp_st_register_handler(nss_ctx); + } +#endif + if (nss_ctx->id == 0) { #if (NSS_FREQ_SCALE_SUPPORT == 1) nss_freq_register_handler(); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h b/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h index d8ffbe332..fdcf21b8c 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -33,7 +33,11 @@ */ #if defined (NSS_MEM_PROFILE_LOW) #define NSS_DEFAULT_NUM_CONN 512 /* Default number of connections for IPv4 and IPv6 each, for low memory profile */ +#if defined (NSS_DRV_IPV6_ENABLE) #define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 1024 /* MAX Connection shared between IPv4 and IPv6 for low memory profile */ +#else +#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 512 /* MAX Connection for IPv4 for low memory profile */ +#endif #define NSS_LOW_MEM_EMPTY_POOL_BUF_SZ 4096 /* Default empty buffer pool size for low profile */ #elif defined (NSS_MEM_PROFILE_MEDIUM) #define NSS_DEFAULT_NUM_CONN 2048 /* Default number of connections for IPv4 and IPv6 each, for medium memory profile */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_if.c b/feeds/ipq807x/qca-nss-drv/src/nss_if.c index 9747fb73b..0c370b119 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_if.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_if.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2014-2016, 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016, 2018-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -265,6 +265,90 @@ nss_tx_status_t nss_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if } EXPORT_SYMBOL(nss_if_set_nexthop); +/* + * nss_if_change_mtu() + * Change the MTU of the interface. + */ +nss_tx_status_t nss_if_change_mtu(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint16_t mtu) +{ + struct nss_if_msg nim; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + nss_trace("%px: NSS If MTU will be changed to %u, of NSS if num: %u\n", nss_ctx, mtu, if_num); + + nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_MTU_CHANGE, + sizeof(struct nss_if_mtu_change), nss_if_callback, NULL); + + nim.msg.mtu_change.min_buf_size = mtu; + + return nss_if_msg_sync(nss_ctx, &nim); +} +EXPORT_SYMBOL(nss_if_change_mtu); + +/* + * nss_if_change_mac_addr() + * Change the MAC address of the interface. + */ +nss_tx_status_t nss_if_change_mac_addr(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint8_t *mac_addr) +{ + struct nss_if_msg nim; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + nss_trace("%px: NSS If MAC address will be changed to %s, of NSS if num: %u\n", nss_ctx, mac_addr, if_num); + + nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_MAC_ADDR_SET, + sizeof(struct nss_if_mac_address_set), nss_if_callback, NULL); + + memcpy(nim.msg.mac_address_set.mac_addr, mac_addr, ETH_ALEN); + + return nss_if_msg_sync(nss_ctx, &nim); +} +EXPORT_SYMBOL(nss_if_change_mac_addr); + +/* + * nss_if_vsi_unassign() + * API to send VSI detach message to NSS FW. + */ +nss_tx_status_t nss_if_vsi_unassign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi) +{ + struct nss_if_msg nim; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + nss_trace("%px: VSI to be unassigned is %u\n", nss_ctx, vsi); + + nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_VSI_UNASSIGN, + sizeof(struct nss_if_vsi_unassign), nss_if_callback, NULL); + + nim.msg.vsi_unassign.vsi = vsi; + + return nss_if_msg_sync(nss_ctx, &nim); +} +EXPORT_SYMBOL(nss_if_vsi_unassign); + +/* + * nss_if_vsi_assign() + * API to send VSI attach message to NSS FW. + */ +nss_tx_status_t nss_if_vsi_assign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi) +{ + struct nss_if_msg nim; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + nss_trace("%px: VSI to be assigned is %u\n", nss_ctx, vsi); + + nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_VSI_ASSIGN, + sizeof(struct nss_if_vsi_assign), nss_if_callback, NULL); + + nim.msg.vsi_assign.vsi = vsi; + + return nss_if_msg_sync(nss_ctx, &nim); +} +EXPORT_SYMBOL(nss_if_vsi_assign); + EXPORT_SYMBOL(nss_if_tx_msg); EXPORT_SYMBOL(nss_if_register); EXPORT_SYMBOL(nss_if_unregister); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_init.c b/feeds/ipq807x/qca-nss-drv/src/nss_init.c index 4f569a254..ebd2a12fb 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_init.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_init.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -740,7 +740,9 @@ static int __init nss_init(void) * Registering sysctl for ipv4/6 specific config. */ nss_ipv4_register_sysctl(); +#ifdef NSS_DRV_IPV6_ENABLE nss_ipv6_register_sysctl(); +#endif /* * Registering sysctl for n2h specific config. @@ -870,6 +872,13 @@ static int __init nss_init(void) nss_dma_init(); #endif + /* + * Init Wi-Fi mesh + */ +#ifdef NSS_DRV_WIFI_MESH_ENABLE + nss_wifi_mesh_init(); +#endif + /* * Register platform_driver */ @@ -910,16 +919,15 @@ static void __exit nss_cleanup(void) nss_pppoe_unregister_sysctl(); /* - * Unregister ipv4/6 specific sysctl + * Unregister ipv4/6 specific sysctl and free allocated to connection tables */ nss_ipv4_unregister_sysctl(); - nss_ipv6_unregister_sysctl(); - - /* - * Free Memory allocated for connection tables - */ nss_ipv4_free_conn_tables(); + +#ifdef NSS_DRV_IPV6_ENABLE + nss_ipv6_unregister_sysctl(); nss_ipv6_free_conn_tables(); +#endif nss_project_unregister_sysctl(); nss_data_plane_destroy_delay_work(); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c index 0b6185776..c5f520da1 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -19,11 +19,11 @@ #include "nss_ipsec_cmn.h" #include "nss_ppe.h" #include "nss_ipsec_cmn_log.h" +#include "nss_ipsec_cmn_stats.h" +#include "nss_ipsec_cmn_strings.h" #define NSS_IPSEC_CMN_TX_TIMEOUT 3000 /* 3 Seconds */ #define NSS_IPSEC_CMN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) -#define NSS_IPSEC_CMN_STATS_MAX_LINES (NSS_STATS_NODE_MAX + 32) -#define NSS_IPSEC_CMN_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_IPSEC_CMN_STATS_MAX_LINES) /* * Private data structure for handling synchronous messaging. @@ -35,104 +35,6 @@ static struct nss_ipsec_cmn_pvt { unsigned long if_map[NSS_IPSEC_CMN_INTERFACE_MAX_LONG]; } ipsec_cmn_pvt; -/* - * nss_ipsec_cmn_stats_sync() - * Update ipsec_cmn node statistics. - */ -static void nss_ipsec_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_ipsec_cmn_msg *nicm = (struct nss_ipsec_cmn_msg *)ncm; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_cmn_node_stats *msg_stats = &nicm->msg.ctx_sync.stats.cmn_stats; - uint64_t *if_stats; - int8_t i; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats, - * Note: DTLS only supports a single queue for RX - */ - if_stats = nss_top->stats_node[ncm->interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->rx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += msg_stats->rx_dropped[i]; - } - - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->tx_bytes; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipsec_cmn_stats_read() - * Read ipsec_cmn node statistics. - */ -static ssize_t nss_ipsec_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; - char *buf; - - size = NSS_IPSEC_CMN_STATS_SIZE_PER_IF * bitmap_weight(ipsec_cmn_pvt.if_map, NSS_MAX_NET_INTERFACES); - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) { - nss_warning("Could not allocate memory for local statistics buffer\n"); - return 0; - } - - len += nss_stats_banner(buf, len, size, "ipsec_cmn", NSS_STATS_SINGLE_CORE); - - /* - * Common node stats for each IPSEC dynamic interface. - */ - for_each_set_bit(if_num, ipsec_cmn_pvt.if_map, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER: - len += scnprintf(buf + len, size - len, "\nMetadata inner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER: - len += scnprintf(buf + len, size - len, "\nMetadata outer if_num:%03u", if_num); - break; - - default: - len += scnprintf(buf + len, size - len, "\nUnknown(%d) if_num:%03u", type, if_num); - break; - } - - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "ipsec_cmn"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - kfree(buf); - - return bytes_read; -} - -/* - * nss_ipsec_cmn_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipsec_cmn) - /* * nss_ipsec_cmn_verify_ifnum() * Verify if the interface number is a IPsec interface. @@ -189,8 +91,10 @@ static void nss_ipsec_cmn_msg_handler(struct nss_ctx_instance *nss_ctx, struct n return; } - if (ncm->type == NSS_IPSEC_CMN_MSG_TYPE_CTX_SYNC) + if (ncm->type == NSS_IPSEC_CMN_MSG_TYPE_CTX_SYNC) { nss_ipsec_cmn_stats_sync(nss_ctx, ncm); + nss_ipsec_cmn_stats_notify(nss_ctx, ncm->interface); + } /* * Update the callback and app_data for NOTIFY messages, ipsec_cmn sends all notify messages @@ -246,6 +150,15 @@ static void nss_ipsec_cmn_sync_resp(void *app_data, struct nss_cmn_msg *ncm) complete(&ipsec_cmn_pvt.complete); } +/* + * nss_ipsec_cmn_ifmap_get() + * Return IPsec common active interfaces map. + */ +unsigned long *nss_ipsec_cmn_ifmap_get(void) +{ + return ipsec_cmn_pvt.if_map; +} + /* * nss_ipsec_cmn_get_context() * Retrieve context for IPSEC redir. @@ -607,5 +520,6 @@ void nss_ipsec_cmn_register_handler(void) { sema_init(&ipsec_cmn_pvt.sem, 1); init_completion(&ipsec_cmn_pvt.complete); - nss_stats_create_dentry("ipsec_cmn", &nss_ipsec_cmn_stats_ops); + nss_ipsec_cmn_stats_dentry_create(); + nss_ipsec_cmn_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c new file mode 100644 index 000000000..192f2291a --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c @@ -0,0 +1,219 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_core.h" +#include "nss_ipsec_cmn.h" +#include "nss_ipsec_cmn_stats.h" +#include "nss_ipsec_cmn_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_ipsec_cmn_stats_notifier); + +/* + * Spinlock to protect IPsec common statistics update/read + */ +DEFINE_SPINLOCK(nss_ipsec_cmn_stats_lock); + +unsigned long *nss_ipsec_cmn_ifmap_get(void); +const char *nss_ipsec_cmn_stats_iface_type(enum nss_dynamic_interface_type type); + +/* + * nss_ipsec_cmn_stats + * ipsec common statistics + */ +uint64_t nss_ipsec_cmn_stats[NSS_MAX_NET_INTERFACES][NSS_IPSEC_CMN_STATS_MAX]; + +/* + * nss_ipsec_cmn_stats_read() + * Read ipsec_cmn node statistics. + */ +static ssize_t nss_ipsec_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_IPSEC_CMN_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; + struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); + enum nss_dynamic_interface_type type; + unsigned long *ifmap; + uint64_t *stats_shadow; + ssize_t bytes_read = 0; + size_t size_wr = 0; + uint32_t if_num; + int32_t i; + int count; + char *lbuf; + + ifmap = nss_ipsec_cmn_ifmap_get(); + count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); + if (count) { + size_al = size_al * count; + } + + lbuf = vzalloc(size_al); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return -ENOMEM; + } + + stats_shadow = vzalloc(NSS_IPSEC_CMN_STATS_MAX * 8); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + vfree(lbuf); + return -ENOMEM; + } + + /* + * Common node stats for each IPSEC dynamic interface. + */ + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipsec_cmn stats", NSS_STATS_SINGLE_CORE); + for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { + + type = nss_dynamic_interface_get_type(nss_ctx, if_num); + if ((type < NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER) || + (type > NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT)) { + continue; + } + + spin_lock_bh(&nss_ipsec_cmn_stats_lock); + for (i = 0; i < NSS_IPSEC_CMN_STATS_MAX; i++) { + stats_shadow[i] = nss_ipsec_cmn_stats[if_num][i]; + } + spin_unlock_bh(&nss_ipsec_cmn_stats_lock); + + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", + nss_ipsec_cmn_stats_iface_type(type), if_num); + size_wr += nss_stats_print("ipsec_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_ipsec_cmn_strings_stats, + stats_shadow, NSS_IPSEC_CMN_STATS_MAX, lbuf, size_wr, size_al); + } + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + vfree(lbuf); + vfree(stats_shadow); + + return bytes_read; +} + +/* + * nss_ipsec_cmn_stats_ops. + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(ipsec_cmn); + +/* + * nss_ipsec_cmn_stats_sync() + * Update ipsec_cmn node statistics. + */ +void nss_ipsec_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) +{ + struct nss_ipsec_cmn_msg *nicm = (struct nss_ipsec_cmn_msg *)ncm; + struct nss_ipsec_cmn_ctx_stats *ndccs = &nicm->msg.ctx_sync.stats; + uint64_t *ctx_stats; + uint32_t *msg_stats; + uint16_t i = 0; + + spin_lock_bh(&nss_ipsec_cmn_stats_lock); + + msg_stats = (uint32_t *)ndccs; + ctx_stats = nss_ipsec_cmn_stats[ncm->interface]; + + for (i = 0; i < NSS_IPSEC_CMN_STATS_MAX; i++, ctx_stats++, msg_stats++) { + *ctx_stats += *msg_stats; + } + + spin_unlock_bh(&nss_ipsec_cmn_stats_lock); +} + +/* + * nss_ipsec_cmn_stats_iface_type() + * Return a string for each interface type. + */ +const char *nss_ipsec_cmn_stats_iface_type(enum nss_dynamic_interface_type type) +{ + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER: + return "ipsec_cmn_inner"; + + case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER: + return "ipsec_cmn_mdata_inner"; + + case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER: + return "ipsec_cmn_outer"; + + case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER: + return "ipsec_cmn_mdata_outer"; + + case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT: + return "ipsec_cmn_redirect"; + + default: + return "invalid_interface"; + } +} + +/* + * nss_ipsec_cmn_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_ipsec_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_ipsec_cmn_stats_notification ipsec_cmn_stats; + + spin_lock_bh(&nss_ipsec_cmn_stats_lock); + ipsec_cmn_stats.core_id = nss_ctx->id; + ipsec_cmn_stats.if_num = if_num; + memcpy(ipsec_cmn_stats.stats_ctx, nss_ipsec_cmn_stats[if_num], sizeof(ipsec_cmn_stats.stats_ctx)); + spin_unlock_bh(&nss_ipsec_cmn_stats_lock); + + atomic_notifier_call_chain(&nss_ipsec_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &ipsec_cmn_stats); +} + +/* + * nss_ipsec_cmn_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_ipsec_cmn_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_ipsec_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_ipsec_cmn_stats_unregister_notifier); + +/* + * nss_ipsec_cmn_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_ipsec_cmn_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_ipsec_cmn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_ipsec_cmn_stats_register_notifier); + +/* + * nss_ipsec_cmn_stats_dentry_create() + * Create ipsec common statistics debug entry. + */ +void nss_ipsec_cmn_stats_dentry_create(void) +{ + nss_stats_create_dentry("ipsec_cmn", &nss_ipsec_cmn_stats_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h new file mode 100644 index 000000000..511056802 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h @@ -0,0 +1,28 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_IPSEC_CMN_STATS_H +#define __NSS_IPSEC_CMN_STATS_H + +#include + +extern void nss_ipsec_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_ipsec_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); +extern void nss_ipsec_cmn_stats_dentry_create(void); + +#endif /* __NSS_IPSEC_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c new file mode 100644 index 000000000..bf2cff6c5 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c @@ -0,0 +1,82 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_ipsec_cmn_strings.h" + +/* + * nss_ipsec_cmn_strings_stats + * ipsec common statistics strings. + */ +struct nss_stats_info nss_ipsec_cmn_strings_stats[NSS_IPSEC_CMN_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, + {"fail_headroom", NSS_STATS_TYPE_DROP}, + {"fail_tailroom", NSS_STATS_TYPE_DROP}, + {"fail_replay", NSS_STATS_TYPE_DROP}, + {"fail_replay_dup", NSS_STATS_TYPE_DROP}, + {"fail_replay_win", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_crypto", NSS_STATS_TYPE_DROP}, + {"fail_queue", NSS_STATS_TYPE_DROP}, + {"fail_queue_crypto", NSS_STATS_TYPE_DROP}, + {"fail_queue_nexthop", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_alloc", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_linear", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_stats", NSS_STATS_TYPE_DROP}, + {"fail_pbuf_align", NSS_STATS_TYPE_DROP}, + {"fail_cipher", NSS_STATS_TYPE_EXCEPTION}, + {"fail_auth", NSS_STATS_TYPE_EXCEPTION}, + {"fail_seq_ovf", NSS_STATS_TYPE_DROP}, + {"fail_blk_len", NSS_STATS_TYPE_DROP}, + {"fail_hash_len", NSS_STATS_TYPE_DROP}, + {"fail_transform", NSS_STATS_TYPE_DROP}, + {"fail_crypto", NSS_STATS_TYPE_DROP}, + {"fail_cle", NSS_STATS_TYPE_DROP}, + {"is_stopped", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_ipsec_cmn_strings_read() + * Read ipsec common statistics names + */ +static ssize_t nss_ipsec_cmn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ipsec_cmn_strings_stats, NSS_IPSEC_CMN_STATS_MAX); +} + +/* + * nss_ipsec_cmn_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipsec_cmn); + +/* + * nss_ipsec_cmn_strings_dentry_create() + * Create ipsec common statistics strings debug entry. + */ +void nss_ipsec_cmn_strings_dentry_create(void) +{ + nss_strings_create_dentry("ipsec_cmn", &nss_ipsec_cmn_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h new file mode 100644 index 000000000..c22f4c0f1 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h @@ -0,0 +1,27 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_IPSEC_CMN_STRINGS_H +#define __NSS_IPSEC_CMN_STRINGS_H + +#include "nss_ipsec_cmn_stats.h" + +extern struct nss_stats_info nss_ipsec_cmn_strings_stats[NSS_IPSEC_CMN_STATS_MAX]; +extern void nss_ipsec_cmn_strings_dentry_create(void); + +#endif /* __NSS_IPSEC_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c index 579bc4449..e1e045206 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -69,6 +69,20 @@ static inline void nss_ipv4_dscp_map_usage(void) NSS_DSCP_MAP_PRIORITY_MAX - 1); } +/* + * nss_ipv4_get_total_conn_count() + * Returns the sum of IPv4 and IPv6 connections. + */ +static uint32_t nss_ipv4_get_total_conn_count(int ipv4_num_conn) +{ + +#ifdef NSS_DRV_IPV6_ENABLE + return ipv4_num_conn + nss_ipv6_conn_cfg; +#else + return ipv4_num_conn; +#endif +} + /* * nss_ipv4_rx_msg_handler() * Handle NSS -> HLOS messages for IPv4 bridge/route @@ -424,7 +438,7 @@ static int nss_ipv4_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) nss_info("%px: IPv4 supported connections: %d\n", nss_ctx, conn); - nss_ipv4_ct_info.ce_mem = __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, + nss_ipv4_ct_info.ce_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, get_order(nss_ipv4_ct_info.ce_table_size)); if (!nss_ipv4_ct_info.ce_mem) { nss_warning("%px: Memory allocation failed for IPv4 Connections: %d\n", @@ -433,7 +447,7 @@ static int nss_ipv4_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) goto fail; } - nss_ipv4_ct_info.cme_mem = __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, + nss_ipv4_ct_info.cme_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, get_order(nss_ipv4_ct_info.cme_table_size)); if (!nss_ipv4_ct_info.ce_mem) { nss_warning("%px: Memory allocation failed for IPv4 Connections: %d\n", @@ -532,7 +546,8 @@ int nss_ipv4_update_conn_count(int ipv4_num_conn) * Min. value should be at least 256 connections. This is the * minimum connections we will support for each of them. */ - sum_of_conn = ipv4_num_conn + nss_ipv6_conn_cfg; + sum_of_conn = nss_ipv4_get_total_conn_count(ipv4_num_conn); + if ((ipv4_num_conn & NSS_NUM_CONN_QUANTA_MASK) || (sum_of_conn > NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6) || (ipv4_num_conn < NSS_MIN_NUM_CONN)) { diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c index f32235bc7..08414051d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016, 2018, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016, 2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -88,7 +88,9 @@ static void nss_ipv4_log_rule_create_msg(struct nss_ipv4_msg *nim) "flow_qos_tag: %x (%u)\n" "return_qos_tag: %x (%u)\n" "flow_dscp: %x\n" - "return_dscp: %x\n", + "return_dscp: %x\n" + "flow_mirror_ifnum: %u\n" + "return_mirror_ifnum: %u\n", nim, nircm->tuple.protocol, nircm->conn_rule.flow_mtu, @@ -114,7 +116,9 @@ static void nss_ipv4_log_rule_create_msg(struct nss_ipv4_msg *nim) nircm->qos_rule.flow_qos_tag, nircm->qos_rule.flow_qos_tag, nircm->qos_rule.return_qos_tag, nircm->qos_rule.return_qos_tag, nircm->dscp_rule.flow_dscp, - nircm->dscp_rule.return_dscp); + nircm->dscp_rule.return_dscp, + nircm->mirror_rule.flow_ifnum, + nircm->mirror_rule.return_ifnum); } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c index 08def22c4..39b162c7e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -177,6 +177,9 @@ void nss_ipv4_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_ nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_mc_connection_destroy_requests; nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv4_mc_connection_destroy_misses; nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_FLUSHES] += nins->ipv4_mc_connection_flushes; + nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv4_connection_create_invalid_mirror_ifnum; + nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv4_connection_create_invalid_mirror_iftype; + nss_ipv4_stats[NSS_IPV4_STATS_MIRROR_FAILURES] += nins->ipv4_mirror_failures; for (i = 0; i < NSS_IPV4_EXCEPTION_EVENT_MAX; i++) { nss_ipv4_exception_stats[i] += nins->exception_events[i]; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c index 434a4e054..77ff3520b 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -136,7 +136,10 @@ struct nss_stats_info nss_ipv4_strings_stats[NSS_IPV4_STATS_MAX] = { {"mc_create_invalid_interface" , NSS_STATS_TYPE_SPECIAL}, {"mc_destroy_requests" , NSS_STATS_TYPE_SPECIAL}, {"mc_destroy_misses" , NSS_STATS_TYPE_SPECIAL}, - {"mc_flushes" , NSS_STATS_TYPE_SPECIAL} + {"mc_flushes" , NSS_STATS_TYPE_SPECIAL}, + {"mirror_invalid_ifnum_conn_create_req" , NSS_STATS_TYPE_SPECIAL}, + {"mirror_invalid_iftype_conn_create_req" , NSS_STATS_TYPE_SPECIAL}, + {"mirror_failures" , NSS_STATS_TYPE_SPECIAL}, }; /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c index 4ee3f69d9..2f9f14b9a 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -428,7 +428,7 @@ static int nss_ipv6_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) nss_info("%px: IPv6 supported connections: %d\n", nss_ctx, conn); - nss_ipv6_ct_info.ce_mem = __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, + nss_ipv6_ct_info.ce_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, get_order(nss_ipv6_ct_info.ce_table_size)); if (!nss_ipv6_ct_info.ce_mem) { nss_warning("%px: Memory allocation failed for IPv6 Connections: %d\n", @@ -440,7 +440,7 @@ static int nss_ipv6_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) nss_ctx, conn); - nss_ipv6_ct_info.cme_mem = __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, + nss_ipv6_ct_info.cme_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, get_order(nss_ipv6_ct_info.cme_table_size)); if (!nss_ipv6_ct_info.cme_mem) { nss_warning("%px: Memory allocation failed for IPv6 Connections: %d\n", diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c index f04d1db39..ed606104e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016, 2018, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016, 2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -103,7 +103,9 @@ static void nss_ipv6_log_rule_create_msg(struct nss_ipv6_msg *nim) "flow_qos_tag: %x (%u)\n" "return_qos_tag: %x (%u)\n" "flow_dscp: %x\n" - "return_dscp: %x\n", + "return_dscp: %x\n" + "flow_mirror_ifnum: %u\n" + "return_mirror_ifnum: %u\n", nim, nircm->tuple.protocol, nircm->conn_rule.flow_mtu, @@ -127,7 +129,9 @@ static void nss_ipv6_log_rule_create_msg(struct nss_ipv6_msg *nim) nircm->qos_rule.flow_qos_tag, nircm->qos_rule.flow_qos_tag, nircm->qos_rule.return_qos_tag, nircm->qos_rule.return_qos_tag, nircm->dscp_rule.flow_dscp, - nircm->dscp_rule.return_dscp); + nircm->dscp_rule.return_dscp, + nircm->mirror_rule.flow_ifnum, + nircm->mirror_rule.return_ifnum); } /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c index 5f59ec8e6..617f55b73 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -180,6 +180,9 @@ void nss_ipv6_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_ nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv6_mc_connection_destroy_requests; nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv6_mc_connection_destroy_misses; nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_FLUSHES] += nins->ipv6_mc_connection_flushes; + nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv6_connection_create_invalid_mirror_ifnum; + nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv6_connection_create_invalid_mirror_iftype; + nss_ipv6_stats[NSS_IPV6_STATS_MIRROR_FAILURES] += nins->ipv6_mirror_failures; for (i = 0; i < NSS_IPV6_EXCEPTION_EVENT_MAX; i++) { nss_ipv6_exception_stats[i] += nins->exception_events[i]; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c index 00751dc4b..57b100f7b 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -114,7 +114,10 @@ struct nss_stats_info nss_ipv6_strings_stats[NSS_IPV6_STATS_MAX] = { {"mc_create_invalid_interface" ,NSS_STATS_TYPE_SPECIAL}, {"mc_destroy_requests" ,NSS_STATS_TYPE_SPECIAL}, {"mc_destroy_misses" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_flushes" ,NSS_STATS_TYPE_SPECIAL} + {"mc_flushes" ,NSS_STATS_TYPE_SPECIAL}, + {"mirror_invalid_ifnum_conn_create_req" ,NSS_STATS_TYPE_SPECIAL}, + {"mirror_invalid_iftype_conn_create_req" ,NSS_STATS_TYPE_SPECIAL}, + {"mirror_failures" ,NSS_STATS_TYPE_SPECIAL}, }; /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c index 9b213441d..2dc4d9fa6 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017,2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -60,7 +60,7 @@ static ssize_t nss_map_t_stats_read(struct file *fp, char __user *ubuf, size_t s for (id = 0; id < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; id++) { if (!map_t_instance_stats[id].valid) { - break; + continue; } dev = dev_get_by_index(&init_net, map_t_instance_stats[id].if_index); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match.c b/feeds/ipq807x/qca-nss-drv/src/nss_match.c index 74f30a25a..dcdfa6cba 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_match.c @@ -1,6 +1,6 @@ /* *************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,6 +23,7 @@ #include "nss_tx_rx_common.h" #include "nss_match_log.h" #include "nss_match_stats.h" +#include "nss_match_strings.h" #define NSS_MATCH_TX_TIMEOUT 1000 /* 1 Seconds */ @@ -148,6 +149,7 @@ static void nss_match_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_m * Update common node statistics */ nss_match_stats_sync(nss_ctx, nem); + nss_match_stats_notify(nss_ctx, nem->cm.interface); } if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { @@ -208,6 +210,36 @@ nss_tx_status_t nss_match_msg_tx_sync(struct nss_ctx_instance *nss_ctx, struct n } EXPORT_SYMBOL(nss_match_msg_tx_sync); +/* + * nss_match_unregister_instance() + * Unregisters match instance. + */ +bool nss_match_unregister_instance(int if_num) +{ + struct nss_ctx_instance *nss_ctx; + uint32_t status; + + nss_ctx = nss_match_get_context(); + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + if (!nss_match_verify_if_num(if_num)) { + nss_warning("%px: Incorrect interface number: %d", nss_ctx, if_num); + return false; + } + + nss_core_unregister_handler(nss_ctx, if_num); + status = nss_core_unregister_msg_handler(nss_ctx, if_num); + if (status != NSS_CORE_STATUS_SUCCESS) { + nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); + return false; + } + + nss_match_ifnum_delete(if_num); + + return true; +} +EXPORT_SYMBOL(nss_match_unregister_instance); + /* * nss_match_register_instance() * Registers match instance. @@ -243,36 +275,6 @@ struct nss_ctx_instance *nss_match_register_instance(int if_num, nss_match_msg_s } EXPORT_SYMBOL(nss_match_register_instance); -/* - * nss_match_unregister_instance() - * Unregisters match instance. - */ -bool nss_match_unregister_instance(int if_num) -{ - struct nss_ctx_instance *nss_ctx; - uint32_t status; - - nss_ctx = nss_match_get_context(); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_match_verify_if_num(if_num)) { - nss_warning("%px: Incorrect interface number: %d", nss_ctx, if_num); - return false; - } - - nss_core_unregister_handler(nss_ctx, if_num); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); - return false; - } - - nss_match_ifnum_delete(if_num); - - return true; -} -EXPORT_SYMBOL(nss_match_unregister_instance); - /* * nss_match_msg_init() * Initialize match message. @@ -291,6 +293,7 @@ EXPORT_SYMBOL(nss_match_msg_init); void nss_match_init() { nss_match_stats_dentry_create(); + nss_match_strings_dentry_create(); sema_init(&match_pvt.sem, 1); init_completion(&match_pvt.complete); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c index f599ea941..29782342f 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c @@ -1,6 +1,6 @@ /* *************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,61 +23,19 @@ #include "nss_stats.h" #include #include "nss_match_stats.h" +#include "nss_match_strings.h" #define NSS_MATCH_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_STATS_NODE_MAX) /* Total number of statistics per match interface. */ int match_ifnum[NSS_MATCH_INSTANCE_MAX] = {0}; +uint64_t nss_match_stats[NSS_MATCH_INSTANCE_MAX][NSS_MATCH_STATS_MAX]; static DEFINE_SPINLOCK(nss_match_stats_lock); /* - * nss_match_ifnum_add() + * Declare atomic notifier data structure for statistics. */ -bool nss_match_ifnum_add(int if_num) -{ - int index = 0; - - spin_lock(&nss_match_stats_lock); - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - if (match_ifnum[index]) { - continue; - } - - match_ifnum[index] = if_num; - - spin_unlock(&nss_match_stats_lock); - return true; - } - - spin_unlock(&nss_match_stats_lock); - return false; -} - -/* - * nss_match_ifnum_delete() - */ -bool nss_match_ifnum_delete(int if_num) -{ - int index = 0; - - spin_lock(&nss_match_stats_lock); - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - if (match_ifnum[index] != if_num) { - continue; - } - - match_ifnum[index] = 0; - - spin_unlock(&nss_match_stats_lock); - return true; - } - - spin_unlock(&nss_match_stats_lock); - return false; -} - +ATOMIC_NOTIFIER_HEAD(nss_match_stats_notifier); /* * nss_match_stats_read() @@ -85,19 +43,25 @@ bool nss_match_ifnum_delete(int if_num) */ static ssize_t nss_match_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_MATCH_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * NSS_MATCH_INSTANCE_MAX; ssize_t bytes_read = 0; - uint32_t index, if_num; - char *lbuf; - size_t size_al = NSS_MATCH_STATS_SIZE_PER_IF * NSS_MATCH_INSTANCE_MAX; size_t size_wr = 0; + uint32_t if_num; + int index; - lbuf = kzalloc(size_al, GFP_KERNEL); - if (!lbuf) { - nss_warning("Could not allocate memory for local statistics buffer\n"); + char *lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); return 0; } - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "match", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "match stats", NSS_STATS_SINGLE_CORE); /* * Common node stats for each match dynamic interface. @@ -111,7 +75,8 @@ static ssize_t nss_match_stats_read(struct file *fp, char __user *ubuf, size_t s if (if_num) { size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nMatch node if_num:%03u", if_num); size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n ---------------------- \n"); - size_wr += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "match"); + size_wr += nss_stats_print("match", NULL, NSS_STATS_SINGLE_INSTANCE, nss_match_strings_stats, + nss_match_stats[index], NSS_MATCH_STATS_MAX, lbuf, size_wr, size_al); continue; } } @@ -128,27 +93,37 @@ static ssize_t nss_match_stats_read(struct file *fp, char __user *ubuf, size_t s */ void nss_match_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *nmm) { - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_match_stats_sync *msg_stats = &nmm->msg.stats; - uint64_t *if_stats; + struct nss_match_stats_sync *ndccs = &nmm->msg.stats; + uint64_t *ctx_stats; + uint32_t *msg_stats; + uint32_t if_num; + uint16_t i = 0; int index; - spin_lock_bh(&nss_top->stats_lock); + for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { + spin_lock_bh(&nss_match_stats_lock); + if_num = match_ifnum[index]; + spin_unlock_bh(&nss_match_stats_lock); - /* - * Update common node stats - */ - if_stats = nss_top->stats_node[nmm->cm.interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->p_stats.rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->p_stats.rx_bytes; - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->p_stats.tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->p_stats.tx_bytes; - - for (index = 0; index < NSS_MAX_NUM_PRI; index++) { - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + index] += msg_stats->p_stats.rx_dropped[index]; + if (if_num == nmm->cm.interface) { + break; + } } - spin_unlock_bh(&nss_top->stats_lock); + if (index == NSS_MATCH_INSTANCE_MAX) { + nss_warning("Invalid Match index\n"); + return; + } + + spin_lock_bh(&nss_match_stats_lock); + msg_stats = (uint32_t *)ndccs; + ctx_stats = nss_match_stats[index]; + + for (i = 0; i < NSS_MATCH_STATS_MAX; i++, ctx_stats++, msg_stats++) { + *ctx_stats += *msg_stats; + } + + spin_unlock_bh(&nss_match_stats_lock); } /* @@ -156,6 +131,110 @@ void nss_match_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg */ NSS_STATS_DECLARE_FILE_OPERATIONS(match) +/* + * nss_match_ifnum_add() + * Add match node interface ID. + */ +bool nss_match_ifnum_add(int if_num) +{ + int index = 0; + + spin_lock_bh(&nss_match_stats_lock); + + for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { + if (match_ifnum[index]) { + continue; + } + + match_ifnum[index] = if_num; + + spin_unlock_bh(&nss_match_stats_lock); + return true; + } + + spin_unlock_bh(&nss_match_stats_lock); + return false; +} + +/* + * nss_match_ifnum_delete() + * Delete match node interface ID. + */ +bool nss_match_ifnum_delete(int if_num) +{ + int index = 0; + + spin_lock_bh(&nss_match_stats_lock); + + for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { + if (match_ifnum[index] != if_num) { + continue; + } + + match_ifnum[index] = 0; + + spin_unlock_bh(&nss_match_stats_lock); + return true; + } + + spin_unlock_bh(&nss_match_stats_lock); + return false; +} + +/* + * nss_match_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_match_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_match_stats_notification match_stats; + uint32_t interface; + int index; + + match_stats.core_id = nss_ctx->id; + match_stats.if_num = if_num; + + for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { + spin_lock_bh(&nss_match_stats_lock); + interface = match_ifnum[index]; + spin_unlock_bh(&nss_match_stats_lock); + + if (interface == if_num) { + break; + } + } + + if (index == NSS_MATCH_INSTANCE_MAX) { + nss_warning("Invalid Match index\n"); + return; + } + + spin_lock_bh(&nss_match_stats_lock); + memcpy(match_stats.stats_ctx, nss_match_stats[index], sizeof(match_stats.stats_ctx)); + spin_unlock_bh(&nss_match_stats_lock); + atomic_notifier_call_chain(&nss_match_stats_notifier, NSS_STATS_EVENT_NOTIFY, &match_stats); +} + +/* + * nss_match_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_match_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_match_stats_notifier, nb); +} + +/* + * nss_match_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_match_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_match_stats_notifier, nb); +} + /* * nss_match_stats_dentry_create() * Create match statistics debug entry. diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h index 23e9d47d1..3cbc74629 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h @@ -1,6 +1,6 @@ /* *************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -19,9 +19,63 @@ #ifndef __NSS_MATCH_STATS_H__ #define __NSS_MATCH_STATS_H__ +/** + * nss_match_stats_types + * Match statistics types. + */ +enum nss_match_stats_types { + NSS_MATCH_STATS_HIT_COUNT_0 = NSS_STATS_NODE_MAX, + /**< Hit count of rule ID 1. */ + NSS_MATCH_STATS_HIT_COUNT_1, /**< Hit count of rule ID 2. */ + NSS_MATCH_STATS_HIT_COUNT_2, /**< Hit count of rule ID 3. */ + NSS_MATCH_STATS_HIT_COUNT_3, /**< Hit count of rule ID 4. */ + NSS_MATCH_STATS_HIT_COUNT_4, /**< Hit count of rule ID 5. */ + NSS_MATCH_STATS_HIT_COUNT_5, /**< Hit count of rule ID 6. */ + NSS_MATCH_STATS_HIT_COUNT_6, /**< Hit count of rule ID 7. */ + NSS_MATCH_STATS_HIT_COUNT_7, /**< Hit count of rule ID 8. */ + NSS_MATCH_STATS_HIT_COUNT_8, /**< Hit count of rule ID 9. */ + NSS_MATCH_STATS_HIT_COUNT_9, /**< Hit count of rule ID 10. */ + NSS_MATCH_STATS_HIT_COUNT_10, /**< Hit count of rule ID 11. */ + NSS_MATCH_STATS_HIT_COUNT_11, /**< Hit count of rule ID 12. */ + NSS_MATCH_STATS_HIT_COUNT_12, /**< Hit count of rule ID 13. */ + NSS_MATCH_STATS_HIT_COUNT_13, /**< Hit count of rule ID 14. */ + NSS_MATCH_STATS_HIT_COUNT_14, /**< Hit count of rule ID 15. */ + NSS_MATCH_STATS_HIT_COUNT_15, /**< Hit count of rule ID 16. */ + NSS_MATCH_STATS_HIT_COUNT_16, /**< Hit count of rule ID 17. */ + NSS_MATCH_STATS_HIT_COUNT_17, /**< Hit count of rule ID 18. */ + NSS_MATCH_STATS_HIT_COUNT_18, /**< Hit count of rule ID 19. */ + NSS_MATCH_STATS_HIT_COUNT_19, /**< Hit count of rule ID 20. */ + NSS_MATCH_STATS_HIT_COUNT_20, /**< Hit count of rule ID 21. */ + NSS_MATCH_STATS_HIT_COUNT_21, /**< Hit count of rule ID 22. */ + NSS_MATCH_STATS_HIT_COUNT_22, /**< Hit count of rule ID 23. */ + NSS_MATCH_STATS_HIT_COUNT_23, /**< Hit count of rule ID 24. */ + NSS_MATCH_STATS_HIT_COUNT_24, /**< Hit count of rule ID 25. */ + NSS_MATCH_STATS_HIT_COUNT_25, /**< Hit count of rule ID 26. */ + NSS_MATCH_STATS_HIT_COUNT_26, /**< Hit count of rule ID 27. */ + NSS_MATCH_STATS_HIT_COUNT_27, /**< Hit count of rule ID 28. */ + NSS_MATCH_STATS_HIT_COUNT_28, /**< Hit count of rule ID 29. */ + NSS_MATCH_STATS_HIT_COUNT_29, /**< Hit count of rule ID 30. */ + NSS_MATCH_STATS_HIT_COUNT_30, /**< Hit count of rule ID 31. */ + NSS_MATCH_STATS_HIT_COUNT_31, /**< Hit count of rule ID 32. */ + NSS_MATCH_STATS_MAX, /**< Maximum statistics type. */ +}; + +/** + * nss_match_stats_notification + * Match transmission statistics structure. + */ +struct nss_match_stats_notification { + uint64_t stats_ctx[NSS_MATCH_STATS_MAX]; /**< Context transmission statistics. */ + uint32_t core_id; /**< Core ID. */ + uint32_t if_num; /**< Interface number. */ +}; + extern bool nss_match_ifnum_add(int if_num); extern bool nss_match_ifnum_delete(int if_num); +extern void nss_match_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); extern void nss_match_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *nmm); extern void nss_match_stats_dentry_create(void); +extern int nss_match_stats_unregister_notifier(struct notifier_block *nb); +extern int nss_match_stats_register_notifier(struct notifier_block *nb); #endif /* __NSS_MATCH_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c new file mode 100644 index 000000000..67d8451dd --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c @@ -0,0 +1,92 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_match_strings.h" + +/* + * nss_match_strings_stats + * match statistics strings. + */ +struct nss_stats_info nss_match_strings_stats[NSS_MATCH_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, + {"hit_count[0]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[1]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[2]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[3]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[4]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[5]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[6]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[7]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[8]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[9]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[10]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[11]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[12]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[13]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[14]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[15]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[16]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[17]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[18]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[19]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[20]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[21]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[22]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[23]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[24]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[25]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[26]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[27]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[28]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[29]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[30]", NSS_STATS_TYPE_SPECIAL}, + {"hit_count[31]", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_match_stats_strings_read() + * Read match statistics names + */ +static ssize_t nss_match_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_match_strings_stats, NSS_MATCH_STATS_MAX); +} + +/* + * nss_match_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(match); + +/* + * nss_match_strings_dentry_create() + * Create match statistics strings debug entry. + */ +void nss_match_strings_dentry_create(void) +{ + nss_strings_create_dentry("match", &nss_match_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h new file mode 100644 index 000000000..9eb9f621a --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h @@ -0,0 +1,27 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_MATCH_STRINGS_H +#define __NSS_MATCH_STRINGS_H + +#include "nss_match_stats.h" + +extern struct nss_stats_info nss_match_strings_stats[NSS_MATCH_STATS_MAX]; +extern void nss_match_strings_dentry_create(void); + +#endif /* __NSS_MATCH_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c b/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c index de550ce18..e24e6be4e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -310,6 +310,15 @@ static bool nss_meminfo_init_block_lists(struct nss_ctx_instance *nss_ctx) switch (mtype) { case NSS_MEMINFO_MEMTYPE_IMEM: + /* + * For SOC's where TCM is not present + */ + if (!nss_ctx->vphys) { + nss_info_always("%px:IMEM requested but TCM not defined " + "for this SOC\n", nss_ctx); + goto cleanup; + } + /* * Return SoC real address for IMEM as DMA address. */ @@ -453,6 +462,15 @@ static bool nss_meminfo_allocate_n2h_h2n_rings(struct nss_ctx_instance *nss_ctx, } break; case NSS_MEMINFO_MEMTYPE_IMEM: + /* + * For SOC's where TCM is not present + */ + if (!nss_ctx->vphys) { + nss_info_always("%px:IMEM requested but TCM not defined " + "for this SOC\n", nss_ctx); + return false; + } + info->dma_addr = nss_meminfo_alloc_imem(nss_ctx, info->total_size, L1_CACHE_BYTES); if (!info->dma_addr) return false; @@ -705,7 +723,6 @@ bool nss_meminfo_init(struct nss_ctx_instance *nss_ctx) struct nss_meminfo_map *map; struct nss_top_instance *nss_top = &nss_top_main; - NSS_VERIFY_CTX_MAGIC(nss_ctx); mem_ctx = &nss_ctx->meminfo_ctx; /* diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c index b27f10e4f..a2e506128 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -18,6 +18,7 @@ #include "nss_tx_rx_common.h" #include "nss_mirror_stats.h" +#include "nss_mirror_strings.h" #include "nss_mirror_log.h" #define NSS_MIRROR_TX_TIMEOUT 3000 /* 3 Seconds */ @@ -89,6 +90,7 @@ static void nss_mirror_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_ * Debug stats embedded in stats msg. */ nss_mirror_stats_sync(nss_ctx, nmm, ncm->interface); + nss_mirror_stats_notify(nss_ctx, ncm->interface); break; } @@ -290,4 +292,5 @@ void nss_mirror_register_handler(void) init_completion(&nss_mirror_pvt.complete); nss_mirror_stats_dentry_create(); + nss_mirror_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c index 574312bac..51fa93c38 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -18,28 +18,19 @@ #include "nss_stats.h" #include "nss_core.h" +#include "nss_mirror.h" #include "nss_mirror_stats.h" +#include "nss_mirror_strings.h" static struct nss_mirror_stats_debug_instance *stats_db[NSS_MAX_MIRROR_DYNAMIC_INTERFACES]; /* Mirror stats data structure. */ /* - * Data structures to store mirror interface stats. + * Atomic notifier data structure for statistics */ -static DEFINE_SPINLOCK(nss_mirror_stats_debug_lock); +ATOMIC_NOTIFIER_HEAD(nss_mirror_stats_notifier); -/* - * nss_mirror_stats_str - * Mirror statistics strings for nss session stats. - */ -struct nss_stats_info nss_mirror_stats_str[NSS_MIRROR_STATS_MAX] = { - {"MIRROR_STATS_PKTS" , NSS_STATS_TYPE_SPECIAL}, - {"MIRROR_STATS_BYTES" , NSS_STATS_TYPE_SPECIAL}, - {"MIRROR_STATS_TX_FAIL" , NSS_STATS_TYPE_DROP}, - {"MIRROR_STATS_DEST_LOOKUP_FAIL" , NSS_STATS_TYPE_DROP}, - {"MIRROR_STATS_MEM_ALLOC_FAIL" , NSS_STATS_TYPE_ERROR}, - {"MIRROR_STATS_COPY_FAIL" , NSS_STATS_TYPE_ERROR}, -}; +static DEFINE_SPINLOCK(nss_mirror_stats_lock); /* * nss_mirror_stats_get() @@ -55,7 +46,7 @@ static void nss_mirror_stats_get(void *stats_mem, uint32_t stats_num) return; } - spin_lock_bh(&nss_mirror_stats_debug_lock); + spin_lock_bh(&nss_mirror_stats_lock); for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { /* @@ -71,7 +62,7 @@ static void nss_mirror_stats_get(void *stats_mem, uint32_t stats_num) } } } - spin_unlock_bh(&nss_mirror_stats_debug_lock); + spin_unlock_bh(&nss_mirror_stats_lock); } /* @@ -115,7 +106,7 @@ static ssize_t nss_mirror_stats_read(struct file *fp, char __user *ubuf, size_t * Get all stats */ nss_mirror_stats_get((void *)mirror_shadow_stats, mirror_active_instances); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "mirror", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "mirror stats", NSS_STATS_SINGLE_CORE); /* * Session stats @@ -137,13 +128,12 @@ static ssize_t nss_mirror_stats_read(struct file *fp, char __user *ubuf, size_t /* * Mirror interface exception stats. */ - size_wr += nss_stats_print("mirror", "mirror exception stats start", + size_wr += nss_stats_print("mirror", "mirror exception stats", id, - nss_mirror_stats_str, + nss_mirror_strings_stats, mirror_shadow_stats[id].stats, NSS_MIRROR_STATS_MAX, lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); } bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); @@ -166,7 +156,7 @@ void nss_mirror_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_node_stats *node_stats_ptr = &stats_msg->node_stats; uint32_t *mirror_stats_ptr = (uint32_t *)&stats_msg->mirror_stats; - spin_lock_bh(&nss_mirror_stats_debug_lock); + spin_lock_bh(&nss_mirror_stats_lock); for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { continue; @@ -178,16 +168,16 @@ void nss_mirror_stats_sync(struct nss_ctx_instance *nss_ctx, */ stats_db[i]->stats[j] += mirror_stats_ptr[j]; } - spin_unlock_bh(&nss_mirror_stats_debug_lock); + spin_unlock_bh(&nss_mirror_stats_lock); goto sync_cmn_stats; } + spin_unlock_bh(&nss_mirror_stats_lock); nss_warning("Invalid mirror stats sync message received for %d interface\n", if_num); - spin_unlock_bh(&nss_mirror_stats_debug_lock); return; sync_cmn_stats: - spin_lock_bh(&nss_top->stats_lock); + spin_lock_bh(&nss_mirror_stats_lock); /* * Sync common stats. @@ -202,7 +192,7 @@ sync_cmn_stats: node_stats_ptr->rx_dropped[i]; } - spin_unlock_bh(&nss_top->stats_lock); + spin_unlock_bh(&nss_mirror_stats_lock); } /* @@ -222,7 +212,7 @@ void nss_mirror_stats_reset(uint32_t if_num) /* * Reset mirror stats. */ - spin_lock_bh(&nss_mirror_stats_debug_lock); + spin_lock_bh(&nss_mirror_stats_lock); for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { continue; @@ -232,7 +222,7 @@ void nss_mirror_stats_reset(uint32_t if_num) stats_db[i] = NULL; break; } - spin_unlock_bh(&nss_mirror_stats_debug_lock); + spin_unlock_bh(&nss_mirror_stats_lock); if (mirror_debug_instance) { vfree(mirror_debug_instance); @@ -255,7 +245,7 @@ int nss_mirror_stats_init(uint32_t if_num, struct net_device *netdev) return -1; } - spin_lock_bh(&nss_mirror_stats_debug_lock); + spin_lock_bh(&nss_mirror_stats_lock); for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { if (stats_db[i] != NULL) { continue; @@ -264,10 +254,10 @@ int nss_mirror_stats_init(uint32_t if_num, struct net_device *netdev) stats_db[i] = mirror_debug_instance; stats_db[i]->if_num = if_num; stats_db[i]->if_index = netdev->ifindex; - spin_unlock_bh(&nss_mirror_stats_debug_lock); + spin_unlock_bh(&nss_mirror_stats_lock); return 0; } - spin_unlock_bh(&nss_mirror_stats_debug_lock); + spin_unlock_bh(&nss_mirror_stats_lock); vfree(mirror_debug_instance); return -1; } @@ -285,3 +275,50 @@ void nss_mirror_stats_dentry_create(void) { nss_stats_create_dentry("mirror", &nss_mirror_stats_ops); } + +/* + * nss_mirror_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_mirror_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_mirror_stats_notification mirror_stats; + int i; + + spin_lock_bh(&nss_mirror_stats_lock); + for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { + if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { + continue; + } + + memcpy(mirror_stats.stats_ctx, stats_db[i]->stats, sizeof(mirror_stats.stats_ctx)); + mirror_stats.core_id = nss_ctx->id; + mirror_stats.if_num = if_num; + spin_unlock_bh(&nss_mirror_stats_lock); + atomic_notifier_call_chain(&nss_mirror_stats_notifier, NSS_STATS_EVENT_NOTIFY, &mirror_stats); + return; + } + spin_unlock_bh(&nss_mirror_stats_lock); +} + +/* + * nss_mirror_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_mirror_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_mirror_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_mirror_stats_unregister_notifier); + +/* + * nss_mirror_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_mirror_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_mirror_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_mirror_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h index 477b31ca6..22622a550 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h @@ -1,6 +1,6 @@ /* ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -24,20 +24,6 @@ */ extern atomic_t nss_mirror_num_instances; -/* - * nss_mirror_stats - * Mirror interface debug statistics. - */ -enum nss_mirror_stats { - NSS_MIRROR_STATS_PKTS, /* Number of packets exceptioned to host. */ - NSS_MIRROR_STATS_BYTES, /* Number of bytes exceptioned to host. */ - NSS_MIRROR_STATS_TX_SEND_FAIL, /* Transmit send failures. */ - NSS_MIRROR_STATS_DEST_LOOKUP_FAIL, /* Destination lookup failures. */ - NSS_MIRROR_STATS_MEM_ALLOC_FAIL, /* Memory allocation failures. */ - NSS_MIRROR_STATS_COPY_FAIL, /* Copy failures. */ - NSS_MIRROR_STATS_MAX /* Maximum statistics count. */ -}; - /* * nss_mirror_stats_debug_instance * Stucture for H2N/N2H mirror interface debug stats. @@ -48,29 +34,11 @@ struct nss_mirror_stats_debug_instance { uint32_t if_num; /* Mirror instance NSS interface number */ }; -/* - * nss_mirror_stats_sync() - * API to sync statistics for mirror interface. - */ extern void nss_mirror_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_mirror_msg *nmm, uint16_t if_num); - -/* - * nss_mirror_stats_reset() - * API to reset the mirror interface stats. - */ extern void nss_mirror_stats_reset(uint32_t if_num); - -/* - * nss_mirror_stats_init() - * API to initialize mirror debug instance statistics. - */ extern int nss_mirror_stats_init(uint32_t if_num, struct net_device *netdev); - -/* - * nss_mirror_stats_dentry_create() - * Create mirror interface statistics debug entry. - */ extern void nss_mirror_stats_dentry_create(void); +extern void nss_mirror_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); #endif /* __NSS_MIRROR_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c new file mode 100644 index 000000000..fb68e0461 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c @@ -0,0 +1,58 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_mirror_strings.h" + +/* + * nss_mirror_strings_stats + * Mirror statistics strings for nss session stats. + */ +struct nss_stats_info nss_mirror_strings_stats[NSS_MIRROR_STATS_MAX] = { + {"pkts", NSS_STATS_TYPE_SPECIAL}, + {"bytes", NSS_STATS_TYPE_SPECIAL}, + {"tx_fail", NSS_STATS_TYPE_DROP}, + {"dest_lookup_fail", NSS_STATS_TYPE_DROP}, + {"mem_alloc_fail", NSS_STATS_TYPE_ERROR}, + {"copy_fail", NSS_STATS_TYPE_ERROR}, +}; + +/* + * nss_mirror_strings_read() + * Read mirror statistics names + */ +static ssize_t nss_mirror_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_mirror_strings_stats, NSS_MIRROR_STATS_MAX); +} + +/* + * nss_mirror_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(mirror); + +/* + * nss_mirror_strings_dentry_create() + * Create mirror statistics strings debug entry. + */ +void nss_mirror_strings_dentry_create(void) +{ + nss_strings_create_dentry("mirror", &nss_mirror_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h new file mode 100644 index 000000000..24b73f4c9 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h @@ -0,0 +1,27 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_MIRROR_STRINGS_H +#define __NSS_MIRROR_STRINGS_H + +#include "nss_mirror_stats.h" + +extern struct nss_stats_info nss_mirror_strings_stats[NSS_MIRROR_STATS_MAX]; +extern void nss_mirror_strings_dentry_create(void); + +#endif /* __NSS_MIRROR_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c index b3d70431b..46ce217b6 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -16,6 +16,7 @@ #include "nss_ppe.h" #include "nss_ppe_stats.h" +#include "nss_ppe_strings.h" DEFINE_SPINLOCK(nss_ppe_stats_lock); @@ -271,6 +272,7 @@ static void nss_ppe_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg * session debug stats embeded in session stats msg */ nss_ppe_stats_sync(nss_ctx, &msg->msg.stats, ncm->interface); + nss_ppe_stats_notify(nss_ctx, ncm->interface); return; } @@ -309,6 +311,7 @@ void nss_ppe_register_handler(void) if (nss_ppe_debug_stats.valid) { nss_ppe_stats_dentry_create(); + nss_ppe_strings_dentry_create(); } } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c index 8f387dfd1..e544856ed 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,6 +17,12 @@ #include "nss_core.h" #include "nss_ppe.h" #include "nss_ppe_stats.h" +#include "nss_ppe_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_ppe_stats_notifier); static uint8_t ppe_cc_nonexception[NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX] = { NSS_PPE_STATS_CPU_CODE_EXP_FAKE_L2_PROT_ERR, @@ -103,371 +109,10 @@ static uint8_t ppe_cc_nonexception[NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX] = { }; /* - * nss_ppe_stats_str_conn - * PPE statistics strings for nss flow stats + * nss_ppe_stats_str_sc_type + * PPE service-code stats type */ -static int8_t *nss_ppe_stats_str_conn[NSS_PPE_STATS_CONN_MAX] = { - "v4 routed flows", - "v4 bridge flows", - "v4 conn create req", - "v4 conn create fail", - "v4 conn destroy req", - "v4 conn destroy fail", - "v4 conn MC create req", - "v4 conn MC create fail", - "v4 conn MC update req", - "v4 conn MC update fail", - "v4 conn MC delete req", - "v4 conn MC delete fail", - "v4 conn unknown if", - - "v6 routed flows", - "v6 bridge flows", - "v6 conn create req", - "v6 conn create fail", - "v6 conn destroy req", - "v6 conn destroy fail", - "v6 conn MC create req", - "v6 conn MC create fail", - "v6 conn MC update req", - "v6 conn MC update fail", - "v6 conn MC delete req", - "v6 conn MC delete fail", - "v6 conn unknown if", - - "conn fail - vp full", - "conn fail - nexthop full", - "conn fail - flow full", - "conn fail - host full", - "conn fail - pub-ip full", - "conn fail - port not setup", - "conn fail - rw fifo full", - "conn fail - flow cmd failure", - "conn fail - unknown proto", - "conn fail - ppe not responding", - "conn fail - CE opaque invalid", - "conn fail - fqg full" -}; - -/* - * nss_ppe_stats_str_l3 - * PPE statistics strings for nss debug stats - */ -static int8_t *nss_ppe_stats_str_l3[NSS_PPE_STATS_L3_MAX] = { - "PPE L3 dbg reg 0", - "PPE L3 dbg reg 1", - "PPE L3 dbg reg 2", - "PPE L3 dbg reg 3", - "PPE L3 dbg reg 4", - "PPE L3 dbg reg port", -}; - -/* - * nss_ppe_stats_str_code - * PPE statistics strings for nss debug stats - */ -static int8_t *nss_ppe_stats_str_code[NSS_PPE_STATS_CODE_MAX] = { - "PPE CPU_CODE", - "PPE DROP_CODE", -}; - -/* - * nss_ppe_stats_str_dc - * PPE statistics strings for drop code - */ -static int8_t *nss_ppe_stats_str_dc[NSS_PPE_STATS_DROP_CODE_MAX] = { - "PPE_DROP_CODE_NONE", - "PPE_DROP_CODE_EXP_UNKNOWN_L2_PORT", - "PPE_DROP_CODE_EXP_PPPOE_WRONG_VER_TYPE", - "PPE_DROP_CODE_EXP_PPPOE_WRONG_CODE", - "PPE_DROP_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", - "PPE_DROP_CODE_EXP_IPV4_WRONG_VER", - "PPE_DROP_CODE_EXP_IPV4_SMALL_IHL", - "PPE_DROP_CODE_EXP_IPV4_WITH_OPTION", - "PPE_DROP_CODE_EXP_IPV4_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV4_BAD_TOTAL_LEN", - "PPE_DROP_CODE_EXP_IPV4_DATA_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV4_FRAG", - "PPE_DROP_CODE_EXP_IPV4_PING_OF_DEATH", - "PPE_DROP_CODE_EXP_IPV4_SNALL_TTL", - "PPE_DROP_CODE_EXP_IPV4_UNK_IP_PROT", - "PPE_DROP_CODE_EXP_IPV4_CHECKSUM_ERR", - "PPE_DROP_CODE_EXP_IPV4_INV_SIP", - "PPE_DROP_CODE_EXP_IPV4_INV_DIP", - "PPE_DROP_CODE_EXP_IPV4_LAND_ATTACK", - "PPE_DROP_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV4_AH_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_WRONG_VER", - "PPE_DROP_CODE_EXP_IPV6_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", - "PPE_DROP_CODE_EXP_IPV6_DATA_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_WITH_EXT_HDR", - "PPE_DROP_CODE_EXP_IPV6_SMALL_HOP_LIMIT", - "PPE_DROP_CODE_EXP_IPV6_INV_SIP", - "PPE_DROP_CODE_EXP_IPV6_INV_DIP", - "PPE_DROP_CODE_EXP_IPV6_LAND_ATTACK", - "PPE_DROP_CODE_EXP_IPV6_FRAG", - "PPE_DROP_CODE_EXP_IPV6_PING_OF_DEATH", - "PPE_DROP_CODE_EXP_IPV6_WITH_MORE_EXT_HDR", - "PPE_DROP_CODE_EXP_IPV6_UNK_LAST_NEXT_HDR", - "PPE_DROP_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_MOBILITY_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_AH_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_ESP_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_TCP_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_TCP_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_TCP_SMAE_SP_DP", - "PPE_DROP_CODE_EXP_TCP_SMALL_DATA_OFFSET", - "PPE_DROP_CODE_EXP_TCP_FLAGS_0", - "PPE_DROP_CODE_EXP_TCP_FLAGS_1", - "PPE_DROP_CODE_EXP_TCP_FLAGS_2", - "PPE_DROP_CODE_EXP_TCP_FLAGS_3", - "PPE_DROP_CODE_EXP_TCP_FLAGS_4", - "PPE_DROP_CODE_EXP_TCP_FLAGS_5", - "PPE_DROP_CODE_EXP_TCP_FLAGS_6", - "PPE_DROP_CODE_EXP_TCP_FLAGS_7", - "PPE_DROP_CODE_EXP_TCP_CHECKSUM_ERR", - "PPE_DROP_CODE_EXP_UDP_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_UDP_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_UDP_SMAE_SP_DP", - "PPE_DROP_CODE_EXP_UDP_BAD_LEN", - "PPE_DROP_CODE_EXP_UDP_DATA_INCOMPLETE", - "PPE_DROP_CODE_EXP_UDP_CHECKSUM_ERR", - "PPE_DROP_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", - "PPE_DROP_CODE_EXP_UDP_LITE_HDR_CROSS_BORDER", - "PPE_DROP_CODE_EXP_UDP_LITE_SMAE_SP_DP", - "PPE_DROP_CODE_EXP_UDP_LITE_CSM_COV_1_TO_7", - "PPE_DROP_CODE_EXP_UDP_LITE_CSM_COV_TOO_LONG", - "PPE_DROP_CODE_EXP_UDP_LITE_CSM_COV_CROSS_BORDER", - "PPE_DROP_CODE_EXP_UDP_LITE_CHECKSUM_ERR", - "PPE_DROP_CODE_L3_MC_BRIDGE_ACTION", - "PPE_DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION", - "PPE_DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR", - "PPE_DROP_CODE_L3_ROUTE_ACTION", - "PPE_DROP_CODE_L3_NO_ROUTE_ACTION", - "PPE_DROP_CODE_L3_NO_ROUTE_NH_INVALID_ACTION", - "PPE_DROP_CODE_L3_NO_ROUTE_PREHEAD_ACTION", - "PPE_DROP_CODE_L3_BRIDGE_ACTION", - "PPE_DROP_CODE_L3_FLOW_ACTION", - "PPE_DROP_CODE_L3_FLOW_MISS_ACTION", - "PPE_DROP_CODE_L2_EXP_MRU_FAIL", - "PPE_DROP_CODE_L2_EXP_MTU_FAIL", - "PPE_DROP_CODE_L3_EXP_IP_PREFIX_BC", - "PPE_DROP_CODE_L3_EXP_MTU_FAIL", - "PPE_DROP_CODE_L3_EXP_MRU_FAIL", - "PPE_DROP_CODE_L3_EXP_ICMP_RDT", - "PPE_DROP_CODE_FAKE_MAC_HEADER_ERR", - "PPE_DROP_CODE_L3_EXP_IP_RT_TTL_ZERO", - "PPE_DROP_CODE_L3_FLOW_SERVICE_CODE_LOOP", - "PPE_DROP_CODE_L3_FLOW_DE_ACCELEARTE", - "PPE_DROP_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL", - "PPE_DROP_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", - "PPE_DROP_CODE_L3_EXP_MTU_DF_FAIL", - "PPE_DROP_CODE_L3_EXP_PPPOE_MULTICAST", - "PPE_DROP_CODE_IPV4_SG_UNKNOWN", - "PPE_DROP_CODE_IPV6_SG_UNKNOWN", - "PPE_DROP_CODE_ARP_SG_UNKNOWN", - "PPE_DROP_CODE_ND_SG_UNKNOWN", - "PPE_DROP_CODE_IPV4_SG_VIO", - "PPE_DROP_CODE_IPV6_SG_VIO", - "PPE_DROP_CODE_ARP_SG_VIO", - "PPE_DROP_CODE_ND_SG_VIO", - "PPE_DROP_CODE_L2_NEW_MAC_ADDRESS", - "PPE_DROP_CODE_L2_HASH_COLLISION", - "PPE_DROP_CODE_L2_STATION_MOVE", - "PPE_DROP_CODE_L2_LEARN_LIMIT", - "PPE_DROP_CODE_L2_SA_LOOKUP_ACTION", - "PPE_DROP_CODE_L2_DA_LOOKUP_ACTION", - "PPE_DROP_CODE_APP_CTRL_ACTION", - "PPE_DROP_CODE_IN_VLAN_FILTER_ACTION", - "PPE_DROP_CODE_IN_VLAN_XLT_MISS", - "PPE_DROP_CODE_EG_VLAN_FILTER_DROP", - "PPE_DROP_CODE_ACL_PRE_ACTION", - "PPE_DROP_CODE_ACL_POST_ACTION", - "PPE_DROP_CODE_MC_BC_SA", - "PPE_DROP_CODE_NO_DESTINATION", - "PPE_DROP_CODE_STG_IN_FILTER", - "PPE_DROP_CODE_STG_EG_FILTER", - "PPE_DROP_CODE_SOURCE_FILTER_FAIL", - "PPE_DROP_CODE_TRUNK_SEL_FAIL", - "PPE_DROP_CODE_TX_EN_FAIL", - "PPE_DROP_CODE_VLAN_TAG_FMT", - "PPE_DROP_CODE_CRC_ERR", - "PPE_DROP_CODE_PAUSE_FRAME", - "PPE_DROP_CODE_PROMISC", - "PPE_DROP_CODE_ISOLATION", - "PPE_DROP_CODE_MGMT_APP", - "PPE_DROP_CODE_FAKE_L2_PROT_ERR", - "PPE_DROP_CODE_POLICER", -}; - -/* - * nss_ppe_stats_str_cc - * PPE statistics strings for cpu code - */ -static int8_t *nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_MAX] = { - "PPE_CPU_CODE_FORWARDING", - "PPE_CPU_CODE_EXP_UNKNOWN_L2_PROT", - "PPE_CPU_CODE_EXP_PPPOE_WRONG_VER_TYPE", - "PPE_CPU_CODE_EXP_WRONG_CODE", - "PPE_CPU_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", - "PPE_CPU_CODE_EXP_WRONG_VER", - "PPE_CPU_CODE_EXP_SMALL_IHL", - "PPE_CPU_CODE_EXP_WITH_OPTION", - "PPE_CPU_CODE_EXP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV4_BAD_TOTAL_LEN", - "PPE_CPU_CODE_EXP_DATA_INCOMPLETE", - "PPE_CPU_CODE_IPV4_FRAG", - "PPE_CPU_CODE_EXP_IPV4_PING_OF_DEATH", - "PPE_CPU_CODE_EXP_SNALL_TTL", - "PPE_CPU_CODE_EXP_IPV4_UNK_IP_PROT", - "PPE_CPU_CODE_EXP_CHECKSUM_ERR", - "PPE_CPU_CODE_EXP_INV_SIP", - "PPE_CPU_CODE_EXP_INV_DIP", - "PPE_CPU_CODE_EXP_LAND_ATTACK", - "PPE_CPU_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV4_AH_CROSS_BORDER", - "PPE_CPU_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_WRONG_VER", - "PPE_CPU_CODE_EXP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", - "PPE_CPU_CODE_EXP_DATA_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_WITH_EXT_HDR", - "PPE_CPU_CODE_EXP_IPV6_SMALL_HOP_LIMIT", - "PPE_CPU_CODE_EXP_INV_SIP", - "PPE_CPU_CODE_EXP_INV_DIP", - "PPE_CPU_CODE_EXP_LAND_ATTACK", - "PPE_CPU_CODE_IPV6_FRAG", - "PPE_CPU_CODE_EXP_IPV6_PING_OF_DEATH", - "PPE_CPU_CODE_EXP_IPV6_WITH_EXT_HDR", - "PPE_CPU_CODE_EXP_IPV6_UNK_NEXT_HDR", - "PPE_CPU_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_MOBILITY_CROSS_BORDER", - "PPE_CPU_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_AH_CROSS_BORDER", - "PPE_CPU_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_ESP_CROSS_BORDER", - "PPE_CPU_CODE_EXP_IPV6_OTHER_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_IPV6_OTHER_EXT_CROSS_BORDER", - "PPE_CPU_CODE_EXP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_TCP_HDR_CROSS_BORDER", - "PPE_CPU_CODE_EXP_TCP_SMAE_SP_DP", - "PPE_CPU_CODE_EXP_TCP_SMALL_DATA_OFFSET", - "PPE_CPU_CODE_EXP_FLAGS_0", - "PPE_CPU_CODE_EXP_FLAGS_1", - "PPE_CPU_CODE_EXP_FLAGS_2", - "PPE_CPU_CODE_EXP_FLAGS_3", - "PPE_CPU_CODE_EXP_FLAGS_4", - "PPE_CPU_CODE_EXP_FLAGS_5", - "PPE_CPU_CODE_EXP_FLAGS_6", - "PPE_CPU_CODE_EXP_FLAGS_7", - "PPE_CPU_CODE_EXP_CHECKSUM_ERR", - "PPE_CPU_CODE_EXP_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_UDP_HDR_CROSS_BORDER", - "PPE_CPU_CODE_EXP_UDP_SMAE_SP_DP", - "PPE_CPU_CODE_EXP_BAD_LEN", - "PPE_CPU_CODE_EXP_DATA_INCOMPLETE", - "PPE_CPU_CODE_EXP_CHECKSUM_ERR", - "PPE_CPU_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", - "PPE_CPU_CODE_EXP_UDP_LITE_CROSS_BORDER", - "PPE_CPU_CODE_EXP_UDP_LITE_SP_DP", - "PPE_CPU_CODE_EXP_UDP_LITE_CSM_COV_TO_7", - "PPE_CPU_CODE_EXP_UDP_LITE_CSM_TOO_LONG", - "PPE_CPU_CODE_EXP_UDP_LITE_CSM_CROSS_BORDER", - "PPE_CPU_CODE_EXP_UDP_LITE_CHECKSUM_ERR", - "PPE_CPU_CODE_EXP_FAKE_L2_PROT_ERR", - "PPE_CPU_CODE_EXP_FAKE_MAC_HEADER_ERR", - "PPE_CPU_CODE_BITMAP_MAX", - "PPE_CPU_CODE_L2_MRU_FAIL", - "PPE_CPU_CODE_L2_MTU_FAIL", - "PPE_CPU_CODE_L3_EXP_IP_PREFIX_BC", - "PPE_CPU_CODE_L3_MTU_FAIL", - "PPE_CPU_CODE_L3_MRU_FAIL", - "PPE_CPU_CODE_L3_ICMP_RDT", - "PPE_CPU_CODE_L3_EXP_IP_RT_TO_ME", - "PPE_CPU_CODE_L3_EXP_IP_TTL_ZERO", - "PPE_CPU_CODE_L3_FLOW_SERVICE_CODE_LOOP", - "PPE_CPU_CODE_L3_DE_ACCELERATE", - "PPE_CPU_CODE_L3_EXP_FLOW_SRC_CHK_FAIL", - "PPE_CPU_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", - "PPE_CPU_CODE_L3_EXP_MTU_DF_FAIL", - "PPE_CPU_CODE_L3_PPPOE_MULTICAST", - "PPE_CPU_CODE_MGMT_OFFSET", - "PPE_CPU_CODE_MGMT_EAPOL", - "PPE_CPU_CODE_PPPOE_DIS", - "PPE_CPU_CODE_MGMT_IGMP", - "PPE_CPU_CODE_ARP_REQ", - "PPE_CPU_CODE_ARP_REP", - "PPE_CPU_CODE_MGMT_DHCPv4", - "PPE_CPU_CODE_MGMT_MLD", - "PPE_CPU_CODE_MGMT_NS", - "PPE_CPU_CODE_MGMT_NA", - "PPE_CPU_CODE_MGMT_DHCPv6", - "PPE_CPU_CODE_PTP_OFFSET", - "PPE_CPU_CODE_PTP_SYNC", - "PPE_CPU_CODE_FOLLOW_UP", - "PPE_CPU_CODE_DELAY_REQ", - "PPE_CPU_CODE_DELAY_RESP", - "PPE_CPU_CODE_PDELAY_REQ", - "PPE_CPU_CODE_PDELAY_RESP", - "PPE_CPU_CODE_PTP_PDELAY_RESP_FOLLOW_UP", - "PPE_CPU_CODE_PTP_ANNOUNCE", - "PPE_CPU_CODE_PTP_MANAGEMENT", - "PPE_CPU_CODE_PTP_SIGNALING", - "PPE_CPU_CODE_PTP_RSV_MSG", - "PPE_CPU_CODE_SG_UNKNOWN", - "PPE_CPU_CODE_SG_UNKNOWN", - "PPE_CPU_CODE_SG_UNKNOWN", - "PPE_CPU_CODE_SG_UNKNOWN", - "PPE_CPU_CODE_SG_VIO", - "PPE_CPU_CODE_SG_VIO", - "PPE_CPU_CODE_SG_VIO", - "PPE_CPU_CODE_SG_VIO", - "PPE_CPU_CODE_L3_ROUTING_IP_TO_ME", - "PPE_CPU_CODE_L3_SNAT_ACTION", - "PPE_CPU_CODE_L3_DNAT_ACTION", - "PPE_CPU_CODE_L3_RT_ACTION", - "PPE_CPU_CODE_L3_BR_ACTION", - "PPE_CPU_CODE_L3_BRIDGE_ACTION", - "PPE_CPU_CODE_L3_ROUTE_PREHEAD_RT_ACTION", - "PPE_CPU_CODE_L3_ROUTE_PREHEAD_SNAPT_ACTION", - "PPE_CPU_CODE_L3_ROUTE_PREHEAD_DNAPT_ACTION", - "PPE_CPU_CODE_L3_ROUTE_PREHEAD_SNAT_ACTION", - "PPE_CPU_CODE_L3_ROUTE_PREHEAD_DNAT_ACTION", - "PPE_CPU_CODE_L3_NO_ROUTE_NAT_ACTION", - "PPE_CPU_CODE_L3_NO_ROUTE_NAT_ERROR", - "PPE_CPU_CODE_ROUTE_ACTION", - "PPE_CPU_CODE_L3_ROUTE_ACTION", - "PPE_CPU_CODE_L3_NO_ROUTE_INVALID_ACTION", - "PPE_CPU_CODE_L3_NO_ROUTE_PREHEAD_ACTION", - "PPE_CPU_CODE_BRIDGE_ACTION", - "PPE_CPU_CODE_FLOW_ACTION", - "PPE_CPU_CODE_L3_MISS_ACTION", - "PPE_CPU_CODE_L2_MAC_ADDRESS", - "PPE_CPU_CODE_HASH_COLLISION", - "PPE_CPU_CODE_STATION_MOVE", - "PPE_CPU_CODE_LEARN_LIMIT", - "PPE_CPU_CODE_L2_LOOKUP_ACTION", - "PPE_CPU_CODE_L2_LOOKUP_ACTION", - "PPE_CPU_CODE_CTRL_ACTION", - "PPE_CPU_CODE_IN_FILTER_ACTION", - "PPE_CPU_CODE_IN_XLT_MISS", - "PPE_CPU_CODE_EG_FILTER_DROP", - "PPE_CPU_CODE_PRE_ACTION", - "PPE_CPU_CODE_POST_ACTION", - "PPE_CPU_CODE_CODE_ACTION", -}; - -/* - * nss_ppe_stats_str_sc - * PPE statistics strings for service-code stats - */ -static int8_t *nss_ppe_stats_str_sc[NSS_PPE_SC_MAX] = { +static int8_t *nss_ppe_stats_str_sc_type[NSS_PPE_SC_MAX] = { "SC_NONE ", "SC_BYPASS_ALL ", "SC_ADV_QOS_BRIDGED", @@ -490,8 +135,8 @@ void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_st { uint32_t sc; spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L3_FLOWS] += stats_msg->stats.nss_ppe_v4_l3_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L2_FLOWS] += stats_msg->stats.nss_ppe_v4_l2_flows; + nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L3_FLOWS] = stats_msg->stats.nss_ppe_v4_l3_flows; + nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L2_FLOWS] = stats_msg->stats.nss_ppe_v4_l2_flows; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_CREATE_REQ] += stats_msg->stats.nss_ppe_v4_create_req; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_CREATE_FAIL] += stats_msg->stats.nss_ppe_v4_create_fail; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_DESTROY_REQ] += stats_msg->stats.nss_ppe_v4_destroy_req; @@ -504,8 +149,8 @@ void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_st nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_DESTROY_FAIL] += stats_msg->stats.nss_ppe_v4_mc_destroy_fail; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_UNKNOWN_INTERFACE] += stats_msg->stats.nss_ppe_v4_unknown_interface; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L3_FLOWS] += stats_msg->stats.nss_ppe_v6_l3_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L2_FLOWS] += stats_msg->stats.nss_ppe_v6_l2_flows; + nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L3_FLOWS] = stats_msg->stats.nss_ppe_v6_l3_flows; + nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L2_FLOWS] = stats_msg->stats.nss_ppe_v6_l2_flows; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_CREATE_REQ] += stats_msg->stats.nss_ppe_v6_create_req; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_CREATE_FAIL] += stats_msg->stats.nss_ppe_v6_create_fail; nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_DESTROY_REQ] += stats_msg->stats.nss_ppe_v6_destroy_req; @@ -547,7 +192,7 @@ void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_st * nss_ppe_stats_conn_get() * Get PPE connection statistics. */ -static void nss_ppe_stats_conn_get(uint32_t *stats) +static void nss_ppe_stats_conn_get(uint64_t *stats) { if (!stats) { nss_warning("No memory to copy ppe connection stats"); @@ -558,7 +203,7 @@ static void nss_ppe_stats_conn_get(uint32_t *stats) * Get flow stats */ spin_lock_bh(&nss_ppe_stats_lock); - memcpy(stats, nss_ppe_debug_stats.conn_stats, (sizeof(uint32_t) * NSS_PPE_STATS_CONN_MAX)); + memcpy(stats, nss_ppe_debug_stats.conn_stats, (sizeof(uint64_t) * NSS_PPE_STATS_CONN_MAX)); spin_unlock_bh(&nss_ppe_stats_lock); } @@ -569,7 +214,7 @@ static void nss_ppe_stats_conn_get(uint32_t *stats) static void nss_ppe_stats_sc_get(struct nss_ppe_sc_stats_debug *sc_stats) { if (!sc_stats) { - nss_warning("No memory to copy ppe connection stats"); + nss_warning("No memory to copy ppe service code stats"); return; } @@ -725,10 +370,9 @@ static ssize_t nss_ppe_conn_stats_read(struct file *fp, char __user *ubuf, size_ char *lbuf = NULL; size_t size_wr = 0; ssize_t bytes_read = 0; - uint32_t ppe_stats[NSS_PPE_STATS_CONN_MAX]; - uint32_t max_output_lines = 2 /* header & footer for session stats */ - + NSS_PPE_STATS_CONN_MAX /* PPE flow counters */ - + 2; + uint64_t *stats_shadow; + uint64_t ppe_stats[NSS_PPE_STATS_CONN_MAX]; + uint32_t max_output_lines = NSS_PPE_STATS_CONN_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; lbuf = kzalloc(size_al, GFP_KERNEL); @@ -737,7 +381,14 @@ static ssize_t nss_ppe_conn_stats_read(struct file *fp, char __user *ubuf, size_ return 0; } - memset(ppe_stats, 0, sizeof(uint32_t) * NSS_PPE_STATS_CONN_MAX); + stats_shadow = kzalloc(NSS_PPE_STATS_CONN_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + return 0; + } + + memset(ppe_stats, 0, sizeof(uint64_t) * NSS_PPE_STATS_CONN_MAX); /* * Get all stats @@ -747,20 +398,19 @@ static ssize_t nss_ppe_conn_stats_read(struct file *fp, char __user *ubuf, size_ /* * flow stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe flow counters start:\n\n"); - + spin_lock_bh(&nss_ppe_stats_lock); for (i = 0; i < NSS_PPE_STATS_CONN_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_conn[i], - ppe_stats[i]); + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe flow counters", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_conn, stats_shadow, + NSS_PPE_STATS_CONN_MAX, lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe flow counters end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(lbuf); + kfree(stats_shadow); return bytes_read; } @@ -775,9 +425,7 @@ static ssize_t nss_ppe_sc_stats_read(struct file *fp, char __user *ubuf, size_t size_t size_wr = 0; ssize_t bytes_read = 0; struct nss_ppe_sc_stats_debug sc_stats[NSS_PPE_SC_MAX]; - uint32_t max_output_lines = 2 /* header & footer for sc stats */ - + NSS_PPE_SC_MAX /* PPE service-code counters */ - + 2; + uint32_t max_output_lines = (NSS_PPE_SC_MAX * NSS_PPE_STATS_SERVICE_CODE_MAX) + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; lbuf = kzalloc(size_al, GFP_KERNEL); @@ -796,20 +444,16 @@ static ssize_t nss_ppe_sc_stats_read(struct file *fp, char __user *ubuf, size_t /* * service code stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe service code counters start:\n\n"); for (i = 0; i < NSS_PPE_SC_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s \tcb_unregister:%llu process_ok:%llu process_fail:%llu\n", - nss_ppe_stats_str_sc[i], sc_stats[i].nss_ppe_sc_cb_unregister, - sc_stats[i].nss_ppe_sc_cb_success, sc_stats[i].nss_ppe_sc_cb_failure); + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "ppe service code type: %s\n", + nss_ppe_stats_str_sc_type[i]); + size_wr += nss_stats_print("ppe", "ppe service code counters", NSS_STATS_SINGLE_INSTANCE, + nss_ppe_stats_str_sc, &sc_stats[i].nss_ppe_sc_cb_unregister, + NSS_PPE_STATS_SERVICE_CODE_MAX, lbuf, size_wr, size_al); } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe service code counters end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(lbuf); return bytes_read; } @@ -824,10 +468,9 @@ static ssize_t nss_ppe_l3_stats_read(struct file *fp, char __user *ubuf, size_t char *lbuf = NULL; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; uint32_t ppe_stats[NSS_PPE_STATS_L3_MAX]; - uint32_t max_output_lines = 2 /* header & footer for session stats */ - + NSS_PPE_STATS_L3_MAX /* PPE flow counters */ - + 2; + uint32_t max_output_lines = NSS_PPE_STATS_L3_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; lbuf = kzalloc(size_al, GFP_KERNEL); @@ -836,6 +479,13 @@ static ssize_t nss_ppe_l3_stats_read(struct file *fp, char __user *ubuf, size_t return 0; } + stats_shadow = kzalloc(NSS_PPE_STATS_L3_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + return 0; + } + memset(ppe_stats, 0, sizeof(uint32_t) * NSS_PPE_STATS_L3_MAX); /* @@ -846,20 +496,18 @@ static ssize_t nss_ppe_l3_stats_read(struct file *fp, char __user *ubuf, size_t /* * flow stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe l3 debug stats start:\n\n"); - + spin_lock_bh(&nss_ppe_stats_lock); for (i = 0; i < NSS_PPE_STATS_L3_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = 0x%x\n", nss_ppe_stats_str_l3[i], - ppe_stats[i]); + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe l3 debug stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe l3 debug stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_l3, + stats_shadow, NSS_PPE_STATS_L3_MAX, lbuf, size_wr, size_al); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(lbuf); + kfree(stats_shadow); return bytes_read; } @@ -873,10 +521,9 @@ static ssize_t nss_ppe_code_stats_read(struct file *fp, char __user *ubuf, size_ char *lbuf = NULL; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; uint32_t ppe_stats[NSS_PPE_STATS_CODE_MAX]; - uint32_t max_output_lines = 2 /* header & footer for session stats */ - + NSS_PPE_STATS_CODE_MAX /* PPE flow counters */ - + 2; + uint32_t max_output_lines = NSS_PPE_STATS_CODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; lbuf = kzalloc(size_al, GFP_KERNEL); @@ -885,6 +532,13 @@ static ssize_t nss_ppe_code_stats_read(struct file *fp, char __user *ubuf, size_ return 0; } + stats_shadow = kzalloc(NSS_PPE_STATS_CODE_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + return 0; + } + memset(ppe_stats, 0, sizeof(uint32_t) * NSS_PPE_STATS_CODE_MAX); /* @@ -895,20 +549,19 @@ static ssize_t nss_ppe_code_stats_read(struct file *fp, char __user *ubuf, size_ /* * flow stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe session stats start:\n\n"); - + spin_lock_bh(&nss_ppe_stats_lock); for (i = 0; i < NSS_PPE_STATS_CODE_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_code[i], - ppe_stats[i]); + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe session stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_code, stats_shadow, + NSS_PPE_STATS_CODE_MAX, lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe session stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(lbuf); + kfree(stats_shadow); return bytes_read; } @@ -921,12 +574,13 @@ static ssize_t nss_ppe_port_dc_stats_read(struct file *fp, char __user *ubuf, si int32_t i; /* - * max output lines = #stats + 2 start tag line + 2 end tag line + five blank lines + * max output lines = #stats + few blank lines for future reference to add new stats. */ - uint32_t max_output_lines = (NSS_PPE_STATS_DROP_CODE_MAX + 4) + 5; + uint32_t max_output_lines = NSS_PPE_STATS_DROP_CODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; struct nss_stats_data *data = fp->private_data; uint32_t *ppe_stats; @@ -943,38 +597,35 @@ static ssize_t nss_ppe_port_dc_stats_read(struct file *fp, char __user *ubuf, si return 0; } + stats_shadow = kzalloc((NSS_PPE_STATS_DROP_CODE_MAX) * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + kfree(ppe_stats); + return 0; + } + /* * Get drop code counters for specific port */ nss_ppe_port_drop_code_get(ppe_stats, data->edma_id); - size_wr = scnprintf(lbuf, size_al, "ppe no drop code stats start:\n\n"); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_dc[0], - ppe_stats[0]); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe no drop code stats end\n\n"); /* * Drop code stats */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "ppe non-zero drop code stats start:\n\n"); - for (i = 1; i < NSS_PPE_STATS_DROP_CODE_MAX; i++) { - /* - * Print only non-zero stats. - */ - if (!ppe_stats[i]) { - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_dc[i], - ppe_stats[i]); + spin_lock_bh(&nss_ppe_stats_lock); + for (i = 0; i < NSS_PPE_STATS_DROP_CODE_MAX; i++) { + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe non-zero drop code stats end\n\n"); + + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe drop code stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_dc, + stats_shadow, NSS_PPE_STATS_DROP_CODE_MAX, lbuf, size_wr, size_al); bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(ppe_stats); kfree(lbuf); - + kfree(stats_shadow); return bytes_read; } @@ -987,12 +638,13 @@ static ssize_t nss_ppe_exception_cc_stats_read(struct file *fp, char __user *ubu int32_t i; /* - * max output lines = #stats + start tag line + end tag line + three blank lines + * max output lines = #stats + few blank lines for future reference to add new stats. */ - uint32_t max_output_lines = (NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX + 2) + 3; + uint32_t max_output_lines = NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; uint32_t *ppe_stats; char *lbuf = kzalloc(size_al, GFP_KERNEL); @@ -1008,34 +660,36 @@ static ssize_t nss_ppe_exception_cc_stats_read(struct file *fp, char __user *ubu return 0; } + stats_shadow = kzalloc(NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + kfree(ppe_stats); + return 0; + } + /* * Get CPU code counters for flow specific exceptions */ nss_ppe_cpu_code_exception_get(ppe_stats); - size_wr = scnprintf(lbuf, size_al, "ppe non-zero cpu code flow-exception stats start:\n\n"); - /* * CPU code stats */ + spin_lock_bh(&nss_ppe_stats_lock); for (i = 0; i < NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX; i++) { - /* - * Print only non-zero stats. - */ - if (!ppe_stats[i]) { - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_cc[i], - ppe_stats[i]); + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe non-zero cpu code flow-exception stats end\n\n"); + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe cpu code flow-exception stats", NSS_STATS_SINGLE_INSTANCE, + nss_ppe_stats_str_cc, stats_shadow, NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX, + lbuf, size_wr, size_al); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(ppe_stats); kfree(lbuf); - + kfree(stats_shadow); return bytes_read; } @@ -1048,12 +702,13 @@ static ssize_t nss_ppe_nonexception_cc_stats_read(struct file *fp, char __user * int32_t i; /* - * max output lines = #stats + start tag line + end tag line + three blank lines + * max output lines = #stats + few blank lines for future reference to add new stats. */ - uint32_t max_output_lines = (NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX + 2) + 3; + uint32_t max_output_lines = NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; size_t size_wr = 0; ssize_t bytes_read = 0; + uint64_t *stats_shadow; uint32_t *ppe_stats; char *lbuf = kzalloc(size_al, GFP_KERNEL); @@ -1069,6 +724,14 @@ static ssize_t nss_ppe_nonexception_cc_stats_read(struct file *fp, char __user * return 0; } + stats_shadow = kzalloc(NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX * 8, GFP_KERNEL); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + kfree(ppe_stats); + return 0; + } + /* * Get CPU code counters for non flow exceptions */ @@ -1077,23 +740,20 @@ static ssize_t nss_ppe_nonexception_cc_stats_read(struct file *fp, char __user * /* * CPU code stats */ - size_wr = scnprintf(lbuf, size_al, "ppe non-zero cpu code non-flow exception stats start:\n\n"); - for (i = 0; i < NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX; i++) { - /* - * Print only non-zero stats. - */ - if (!ppe_stats[i]) { - continue; - } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %u\n", nss_ppe_stats_str_cc[i + NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_START], - ppe_stats[i]); + spin_lock_bh(&nss_ppe_stats_lock); + for (i = 0; i < NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX; i++) { + stats_shadow[i] = ppe_stats[i]; } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nppe non-zero cpu code non-flow exception stats end\n\n"); + spin_unlock_bh(&nss_ppe_stats_lock); + size_wr += nss_stats_print("ppe", "ppe cpu code non-flow exception stats", NSS_STATS_SINGLE_INSTANCE, + &nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_START], + stats_shadow, NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX, lbuf, size_wr, size_al); + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); kfree(ppe_stats); + kfree(stats_shadow); kfree(lbuf); return bytes_read; @@ -1141,49 +801,38 @@ void nss_ppe_stats_dentry_create(void) { int i; struct dentry *ppe_dentry = NULL; - struct dentry *ppe_conn_d = NULL; - struct dentry *ppe_sc_d = NULL; - struct dentry *ppe_l3_d = NULL; - struct dentry *ppe_ppe_code_d = NULL; struct dentry *ppe_code_d = NULL; struct dentry *ppe_drop_d = NULL; - struct dentry *ppe_port_dc_d = NULL; struct dentry *ppe_cpu_d = NULL; - struct dentry *ppe_exception_d = NULL; - struct dentry *ppe_nonexception_d = NULL; char file_name[10]; ppe_dentry = debugfs_create_dir("ppe", nss_top_main.stats_dentry); - if (unlikely(ppe_dentry == NULL)) { + if (!ppe_dentry) { nss_warning("Failed to create qca-nss-drv/stats/ppe directory"); return; } - ppe_conn_d = debugfs_create_file("connection", 0400, ppe_dentry, - &nss_top_main, &nss_ppe_conn_stats_ops); - if (unlikely(ppe_conn_d == NULL)) { + if (!debugfs_create_file("connection", 0400, ppe_dentry, &nss_top_main, &nss_ppe_conn_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/connection file"); + debugfs_remove_recursive(ppe_dentry); return; } - ppe_sc_d = debugfs_create_file("sc_stats", 0400, ppe_dentry, - &nss_top_main, &nss_ppe_sc_stats_ops); - if (unlikely(ppe_sc_d == NULL)) { + if (!debugfs_create_file("sc_stats", 0400, ppe_dentry, &nss_top_main, &nss_ppe_sc_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/sc_stats file"); + debugfs_remove_recursive(ppe_dentry); return; } - ppe_l3_d = debugfs_create_file("l3", 0400, ppe_dentry, - &nss_top_main, &nss_ppe_l3_stats_ops); - if (unlikely(ppe_l3_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/l3 filed"); + if (!debugfs_create_file("l3", 0400, ppe_dentry, &nss_top_main, &nss_ppe_l3_stats_ops)) { + nss_warning("Failed to create qca-nss-drv/stats/ppe/l3 file"); + debugfs_remove_recursive(ppe_dentry); return; } - ppe_ppe_code_d = debugfs_create_file("ppe_code", 0400, ppe_dentry, - &nss_top_main, &nss_ppe_code_stats_ops); - if (unlikely(ppe_ppe_code_d == NULL)) { + if (!debugfs_create_file("ppe_code", 0400, ppe_dentry, &nss_top_main, &nss_ppe_code_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/ppe_code file"); + debugfs_remove_recursive(ppe_dentry); return; } @@ -1191,33 +840,31 @@ void nss_ppe_stats_dentry_create(void) * ppe exception and drop code stats */ ppe_code_d = debugfs_create_dir("code", ppe_dentry); - if (unlikely(ppe_code_d == NULL)) { + if (!ppe_code_d) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code directory"); return; } ppe_cpu_d = debugfs_create_dir("cpu", ppe_code_d); - if (unlikely(ppe_cpu_d == NULL)) { + if (!ppe_cpu_d) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code/cpu directory"); return; } - ppe_exception_d = debugfs_create_file("exception", 0400, ppe_cpu_d, - &nss_top_main, &nss_ppe_exception_cc_stats_ops); - if (unlikely(ppe_exception_d == NULL)) { + if (!debugfs_create_file("exception", 0400, ppe_cpu_d, &nss_top_main, &nss_ppe_exception_cc_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code/exception file"); + debugfs_remove_recursive(ppe_cpu_d); return; } - ppe_nonexception_d = debugfs_create_file("non-exception", 0400, ppe_cpu_d, - &nss_top_main, &nss_ppe_nonexception_cc_stats_ops); - if (unlikely(ppe_nonexception_d == NULL)) { + if (!debugfs_create_file("non-exception", 0400, ppe_cpu_d, &nss_top_main, &nss_ppe_nonexception_cc_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code/non-exception file"); + debugfs_remove_recursive(ppe_cpu_d); return; } ppe_drop_d = debugfs_create_dir("drop", ppe_code_d); - if (unlikely(ppe_drop_d == NULL)) { + if (!ppe_drop_d) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code/drop directory"); return; } @@ -1228,11 +875,51 @@ void nss_ppe_stats_dentry_create(void) snprintf(file_name, sizeof(file_name), "%d", i); } - ppe_port_dc_d = debugfs_create_file((i == 0) ? "cpu" : file_name, 0400, ppe_drop_d, - (void *)(nss_ptr_t)i, &nss_ppe_port_dc_stats_ops); - if (unlikely(ppe_port_dc_d == NULL)) { + if (!debugfs_create_file((i == 0) ? "cpu" : file_name, 0400, ppe_drop_d, + (void *)(nss_ptr_t)i, &nss_ppe_port_dc_stats_ops)) { nss_warning("Failed to create qca-nss-drv/stats/ppe/code/drop/%d file", i); + debugfs_remove_recursive(ppe_drop_d); return; } } } + +/* + * nss_ppe_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_ppe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_ppe_stats_notification ppe_stats; + + spin_lock_bh(&nss_ppe_stats_lock); + ppe_stats.core_id = nss_ctx->id; + ppe_stats.if_num = if_num; + memcpy(ppe_stats.ppe_stats_conn, nss_ppe_debug_stats.conn_stats, sizeof(ppe_stats.ppe_stats_conn)); + memcpy(ppe_stats.ppe_stats_sc, nss_ppe_debug_stats.sc_stats, sizeof(ppe_stats.ppe_stats_sc)); + spin_unlock_bh(&nss_ppe_stats_lock); + + atomic_notifier_call_chain(&nss_ppe_stats_notifier, NSS_STATS_EVENT_NOTIFY, &ppe_stats); +} + +/* + * nss_ppe_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_ppe_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_ppe_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_ppe_stats_unregister_notifier); + +/* + * nss_ppe_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_ppe_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_ppe_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_ppe_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h index af9c33b3b..bd2cecb8d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -22,6 +22,8 @@ #ifndef __NSS_PPE_STATS_H #define __NSS_PPE_STATS_H +#include + /* * NSS PPE connection statistics */ @@ -69,6 +71,16 @@ enum nss_ppe_stats_conn { NSS_PPE_STATS_CONN_MAX }; +/* + * NSS PPE SC statistics + */ +enum nss_ppe_stats_service_code { + NSS_PPE_STATS_SERVICE_CODE_CB_UNREGISTER, + NSS_PPE_STATS_SERVICE_CODE_PROCESS_OK, + NSS_PPE_STATS_SERVICE_CODE_PROCESS_FAIL, + NSS_PPE_STATS_SERVICE_CODE_MAX +}; + /* * NSS PPE L3 statistics */ @@ -400,7 +412,7 @@ struct nss_ppe_sc_stats_debug { * NSS PPE statistics */ struct nss_ppe_stats_debug { - uint32_t conn_stats[NSS_PPE_STATS_CONN_MAX]; + uint64_t conn_stats[NSS_PPE_STATS_CONN_MAX]; uint32_t l3_stats[NSS_PPE_STATS_L3_MAX]; uint32_t code_stats[NSS_PPE_STATS_CODE_MAX]; struct nss_ppe_sc_stats_debug sc_stats[NSS_PPE_SC_MAX]; @@ -414,9 +426,21 @@ struct nss_ppe_stats_debug { */ extern struct nss_ppe_stats_debug nss_ppe_debug_stats; +/** + * nss_ppe_stats_notification + * PPE transmission statistics structure. + */ +struct nss_ppe_stats_notification { + struct nss_ppe_sc_stats_debug ppe_stats_sc[NSS_PPE_SC_MAX]; /* PPE service code stats. */ + uint64_t ppe_stats_conn[NSS_PPE_STATS_CONN_MAX]; /* PPE connection statistics. */ + uint32_t core_id; /* Core ID. */ + uint32_t if_num; /* Interface number. */ +}; + /* * NSS PPE statistics APIs */ +extern void nss_ppe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); extern void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_stats_msg *stats_msg, uint16_t if_num); extern void nss_ppe_stats_dentry_create(void); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c new file mode 100644 index 000000000..294996449 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c @@ -0,0 +1,532 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_ppe.h" +#include "nss_strings.h" +#include "nss_ppe_strings.h" + +/* + * nss_ppe_stats_str_conn + * PPE statistics strings for nss flow stats + */ +struct nss_stats_info nss_ppe_stats_str_conn[NSS_PPE_STATS_CONN_MAX] = { + {"v4 routed flows", NSS_STATS_TYPE_SPECIAL}, + {"v4 bridge flows", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn create req", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn create fail", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn destroy req", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn destroy fail", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC create req", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC create fail", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC update req", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC update fail", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC delete req", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn MC delete fail", NSS_STATS_TYPE_SPECIAL}, + {"v4 conn unknown if", NSS_STATS_TYPE_SPECIAL}, + {"v6 routed flows", NSS_STATS_TYPE_SPECIAL}, + {"v6 bridge flows", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn create req", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn create fail", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn destroy req", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn destroy fail", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC create req", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC create fail", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC update req", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC update fail", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC delete req", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn MC delete fail", NSS_STATS_TYPE_SPECIAL}, + {"v6 conn unknown if", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - vp full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - nexthop full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - flow full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - host full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - pub-ip full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - port not setup", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - rw fifo full", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - flow cmd failure", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - unknown proto", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - ppe not responding", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - CE opaque invalid", NSS_STATS_TYPE_SPECIAL}, + {"conn fail - fqg full", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_ppe_stats_str_conn_strings_read() + * Read ppe NSS flow statistics names + */ +static ssize_t nss_ppe_stats_str_conn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_conn, NSS_PPE_STATS_CONN_MAX); +} + +/* + * nss_ppe_stats_str_conn_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_conn); + +/* + * nss_ppe_stats_str_l3 + * PPE statistics strings for nss debug stats + */ +struct nss_stats_info nss_ppe_stats_str_l3[NSS_PPE_STATS_L3_MAX] = { + {"L3 dbg reg 0", NSS_STATS_TYPE_SPECIAL}, + {"L3 dbg reg 1", NSS_STATS_TYPE_SPECIAL}, + {"L3 dbg reg 2", NSS_STATS_TYPE_SPECIAL}, + {"L3 dbg reg 3", NSS_STATS_TYPE_SPECIAL}, + {"L3 dbg reg 4", NSS_STATS_TYPE_SPECIAL}, + {"L3 dbg reg port", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_ppe_stats_str_l3_strings_read() + * Read ppe NSS debug statistics names + */ +static ssize_t nss_ppe_stats_str_l3_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_l3, NSS_PPE_STATS_L3_MAX); +} + +/* + * nss_ppe_stats_str_l3_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_l3); + +/* + * nss_ppe_stats_str_code + * PPE statistics strings for nss debug stats + */ +struct nss_stats_info nss_ppe_stats_str_code[NSS_PPE_STATS_CODE_MAX] = { + {"CPU_CODE", NSS_STATS_TYPE_SPECIAL}, + {"DROP_CODE", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_ppe_stats_str_code_strings_read() + * Read ppe NSS debug statistics names + */ +static ssize_t nss_ppe_stats_str_code_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_code, NSS_PPE_STATS_CODE_MAX); +} + +/* + * nss_ppe_stats_str_code_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_code); + +/* + * nss_ppe_stats_str_dc + * PPE statistics strings for drop code + */ +struct nss_stats_info nss_ppe_stats_str_dc[NSS_PPE_STATS_DROP_CODE_MAX] = { + {"DROP_CODE_NONE", NSS_STATS_TYPE_SPECIAL}, + {"DROP_CODE_EXP_UNKNOWN_L2_PORT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_PPPOE_WRONG_VER_TYPE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_PPPOE_WRONG_CODE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_WRONG_VER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_SMALL_IHL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_WITH_OPTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_BAD_TOTAL_LEN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_FRAG", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_PING_OF_DEATH", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_SNALL_TTL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_UNK_IP_PROT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_INV_SIP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_INV_DIP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_LAND_ATTACK", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_AH_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_WRONG_VER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_SMALL_HOP_LIMIT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_INV_SIP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_INV_DIP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_LAND_ATTACK", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_FRAG", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_PING_OF_DEATH", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_WITH_MORE_EXT_HDR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_UNK_LAST_NEXT_HDR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_MOBILITY_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_AH_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_ESP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_SMALL_DATA_OFFSET", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_0", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_1", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_2", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_3", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_4", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_5", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_6", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_FLAGS_7", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_TCP_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_BAD_LEN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_CSM_COV_1_TO_7", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_CSM_COV_TOO_LONG", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_CSM_COV_CROSS_BORDER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EXP_UDP_LITE_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_MC_BRIDGE_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_ROUTE_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_NO_ROUTE_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_NO_ROUTE_NH_INVALID_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_NO_ROUTE_PREHEAD_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_BRIDGE_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_FLOW_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_FLOW_MISS_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_EXP_MRU_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_EXP_MTU_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_IP_PREFIX_BC", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_MTU_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_MRU_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_ICMP_RDT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_FAKE_MAC_HEADER_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_IP_RT_TTL_ZERO", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_FLOW_SERVICE_CODE_LOOP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_FLOW_DE_ACCELEARTE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_MTU_DF_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L3_EXP_PPPOE_MULTICAST", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IPV4_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IPV6_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ARP_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ND_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IPV4_SG_VIO", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IPV6_SG_VIO", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ARP_SG_VIO", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ND_SG_VIO", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_NEW_MAC_ADDRESS", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_HASH_COLLISION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_STATION_MOVE", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_LEARN_LIMIT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_SA_LOOKUP_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_L2_DA_LOOKUP_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_APP_CTRL_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IN_VLAN_FILTER_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_IN_VLAN_XLT_MISS", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_EG_VLAN_FILTER_DROP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ACL_PRE_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ACL_POST_ACTION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_MC_BC_SA", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_NO_DESTINATION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_STG_IN_FILTER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_STG_EG_FILTER", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_SOURCE_FILTER_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_TRUNK_SEL_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_TX_EN_FAIL", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_VLAN_TAG_FMT", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_CRC_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_PAUSE_FRAME", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_PROMISC", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_ISOLATION", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_MGMT_APP", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_FAKE_L2_PROT_ERR", NSS_STATS_TYPE_DROP}, + {"DROP_CODE_POLICER", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_ppe_stats_str_dc_strings_read() + * Read ppe drop code statistics names + */ +static ssize_t nss_ppe_stats_str_dc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_dc, NSS_PPE_STATS_DROP_CODE_MAX); +} + +/* + * nss_ppe_stats_str_dc_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_dc); + +/* + * nss_ppe_stats_str_sc + * PPE statistics strings for service-code stats + */ +struct nss_stats_info nss_ppe_stats_str_sc[NSS_PPE_STATS_SERVICE_CODE_MAX] = { + {"cb_unregister", NSS_STATS_TYPE_SPECIAL}, + {"process_ok", NSS_STATS_TYPE_SPECIAL}, + {"process_fail", NSS_STATS_TYPE_ERROR} +}; + +/* + * nss_ppe_stats_str_sc_strings_read() + * Read ppe service code statistics names + */ +static ssize_t nss_ppe_stats_str_sc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_sc, NSS_PPE_STATS_SERVICE_CODE_MAX); +} + +/* + * nss_ppe_stats_str_sc_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_sc); + +/* + * nss_ppe_stats_str_cc + * PPE statistics strings for cpu code + */ +struct nss_stats_info nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_MAX] = { + {"CPU_CODE_FORWARDING", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UNKNOWN_L2_PROT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_PPPOE_WRONG_VER_TYPE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_WRONG_CODE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_WRONG_VER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_SMALL_IHL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_WITH_OPTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_BAD_TOTAL_LEN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_IPV4_FRAG", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_PING_OF_DEATH", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_SNALL_TTL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_UNK_IP_PROT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_INV_SIP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_INV_DIP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_LAND_ATTACK", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_AH_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_WRONG_VER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_SMALL_HOP_LIMIT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_INV_SIP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_INV_DIP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_LAND_ATTACK", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_IPV6_FRAG", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_PING_OF_DEATH", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_UNK_NEXT_HDR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_MOBILITY_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_AH_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_ESP_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_OTHER_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_IPV6_OTHER_EXT_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_TCP_HDR_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_TCP_SMAE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_TCP_SMALL_DATA_OFFSET", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_0", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_1", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_2", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_3", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_4", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_5", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_6", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FLAGS_7", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_HDR_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_SMAE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_BAD_LEN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_CSM_COV_TO_7", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_CSM_TOO_LONG", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_CSM_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_UDP_LITE_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FAKE_L2_PROT_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EXP_FAKE_MAC_HEADER_ERR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_BITMAP_MAX", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L2_MRU_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L2_MTU_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_EXP_IP_PREFIX_BC", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_MTU_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_MRU_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ICMP_RDT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_EXP_IP_RT_TO_ME", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_EXP_IP_TTL_ZERO", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_FLOW_SERVICE_CODE_LOOP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_DE_ACCELERATE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_EXP_FLOW_SRC_CHK_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_EXP_MTU_DF_FAIL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_PPPOE_MULTICAST", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_OFFSET", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_EAPOL", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PPPOE_DIS", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_IGMP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_ARP_REQ", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_ARP_REP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_DHCPv4", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_MLD", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_NS", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_NA", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_MGMT_DHCPv6", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_OFFSET", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_SYNC", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_FOLLOW_UP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_DELAY_REQ", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_DELAY_RESP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PDELAY_REQ", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PDELAY_RESP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_PDELAY_RESP_FOLLOW_UP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_ANNOUNCE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_MANAGEMENT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_SIGNALING", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PTP_RSV_MSG", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTING_IP_TO_ME", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_SNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_DNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_RT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_BR_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_BRIDGE_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_PREHEAD_RT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_PREHEAD_SNAPT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_PREHEAD_DNAPT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_PREHEAD_SNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_PREHEAD_DNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_NO_ROUTE_NAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_NO_ROUTE_NAT_ERROR", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_ROUTE_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_ROUTE_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_NO_ROUTE_INVALID_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_NO_ROUTE_PREHEAD_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_BRIDGE_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_FLOW_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L3_MISS_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L2_MAC_ADDRESS", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_HASH_COLLISION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_STATION_MOVE", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_LEARN_LIMIT", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L2_LOOKUP_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_L2_LOOKUP_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_CTRL_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_IN_FILTER_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_IN_XLT_MISS", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_EG_FILTER_DROP", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_PRE_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_POST_ACTION", NSS_STATS_TYPE_EXCEPTION}, + {"CPU_CODE_CODE_ACTION", NSS_STATS_TYPE_EXCEPTION} +}; + +/* + * nss_ppe_stats_str_cc_strings_read() + * Read ppe cpu code statistics names + */ +static ssize_t nss_ppe_stats_str_cc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_cc, NSS_PPE_STATS_CPU_CODE_MAX); +} + +/* + * nss_ppe_stats_str_cc_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_cc); + +/* + * nss_ppe_strings_dentry_create() + * Create ppe statistics strings debug entry. + */ +void nss_ppe_strings_dentry_create(void) +{ + struct dentry *ppe_d = NULL; + + if (!nss_top_main.strings_dentry) { + nss_warning("qca-nss-drv/strings is not present"); + return; + } + + ppe_d = debugfs_create_dir("ppe", nss_top_main.strings_dentry); + if (!ppe_d) { + nss_warning("Failed to create qca-nss-drv/strings/ppe directory"); + return; + } + + if (!debugfs_create_file("stats_str_conn", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_conn_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_conn file"); + debugfs_remove_recursive(ppe_d); + return; + } + + if (!debugfs_create_file("stats_str_sc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_sc_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_sc file"); + debugfs_remove_recursive(ppe_d); + return; + } + + if (!debugfs_create_file("stats_str_l3", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_l3_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_l3 file"); + debugfs_remove_recursive(ppe_d); + return; + } + + if (!debugfs_create_file("stats_str_code", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_code_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_code file"); + debugfs_remove_recursive(ppe_d); + return; + } + + if (!debugfs_create_file("stats_str_dc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_dc_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_dc file"); + debugfs_remove_recursive(ppe_d); + return; + } + + if (!debugfs_create_file("stats_str_cc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_cc_strings_ops)) { + nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_cc file"); + debugfs_remove_recursive(ppe_d); + return; + } +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h new file mode 100644 index 000000000..e8fe77ec2 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h @@ -0,0 +1,32 @@ +/* + *************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *************************************************************************** + */ + +#ifndef __NSS_PPE_STRINGS_H +#define __NSS_PPE_STRINGS_H + +#include "nss_ppe_stats.h" + +extern struct nss_stats_info nss_ppe_stats_str_conn[NSS_PPE_STATS_CONN_MAX]; +extern struct nss_stats_info nss_ppe_stats_str_sc[NSS_PPE_STATS_SERVICE_CODE_MAX]; +extern struct nss_stats_info nss_ppe_stats_str_l3[NSS_PPE_STATS_L3_MAX]; +extern struct nss_stats_info nss_ppe_stats_str_code[NSS_PPE_STATS_CODE_MAX]; +extern struct nss_stats_info nss_ppe_stats_str_dc[NSS_PPE_STATS_DROP_CODE_MAX]; +extern struct nss_stats_info nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_MAX]; +extern void nss_ppe_strings_dentry_create(void); + +#endif /* __NSS_PPE_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c index d3e8ce9e5..a5411cec9 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,11 +16,19 @@ ************************************************************************** */ +/* + * Header file for qca-ssdk APIs + */ +#include + #include "nss_ppe_vp.h" #include "nss_ppe_vp_stats.h" #define NSS_PPE_VP_TX_TIMEOUT 1000 /* 1 Second */ +static struct nss_vp_mapping *vp_map[NSS_MAX_DYNAMIC_INTERFACES] = {NULL}; +unsigned char nss_ppe_vp_cmd[NSS_PPE_VP_MAX_CMD_STR] __read_mostly; + /* * Private data structure */ @@ -30,16 +38,24 @@ static struct nss_ppe_vp_pvt { int response; void *cb; void *app_data; + nss_ppe_port_t ppe_port_num; } ppe_vp_pvt; -int nss_ppe_vp_enable __read_mostly = 0; -int nss_ppe_vp_disable __read_mostly = 0; - DEFINE_SPINLOCK(nss_ppe_vp_stats_lock); +DEFINE_SPINLOCK(nss_ppe_vp_map_lock); struct nss_ppe_vp_stats_debug nss_ppe_vp_debug_stats; static struct dentry *nss_ppe_vp_dentry; +/* + * nss_ppe_vp_get_map_index() + * Get the index of the NSS-VP number mapping array. + */ +static inline int32_t nss_ppe_vp_get_map_index(nss_if_num_t if_num) +{ + return (if_num - NSS_DYNAMIC_IF_START); +} + /* * nss_ppe_vp_verify_ifnum() * Verify PPE VP interface number. @@ -50,12 +66,122 @@ static inline bool nss_ppe_vp_verify_ifnum(int if_num) } /* - * nss_ppe_vp_get_context() - * Get NSS context instance for ppe_vp + * nss_ppe_vp_map_dealloc() + * Deallocate memory for the NSS interface number and PPE VP number mapping. */ -struct nss_ctx_instance *nss_ppe_vp_get_context(void) +static inline void nss_ppe_vp_map_dealloc(struct nss_vp_mapping *map) { - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.ppe_handler_id]; + vfree(map); +} + +/* + * nss_ppe_vp_map_alloc() + * Allocate memory for the NSS interface number and PPE VP number mapping. + */ +static inline struct nss_vp_mapping *nss_ppe_vp_map_alloc(void) +{ + struct nss_vp_mapping *nss_vp_info = vzalloc(sizeof(struct nss_vp_mapping)); + if (!nss_vp_info) { + nss_warning("No memory for allocating NSS-VP mapping instance"); + } + + return nss_vp_info; +} + +/* + * nss_ppe_vp_proc_help() + * Print usage information for ppe_vp configure sysctl. + */ +static void nss_ppe_vp_proc_help(void) +{ + nss_info_always("== for dynamic interface types read following file =="); + nss_info_always("/sys/kernel/debug/qca-nss-drv/stats/dynamic_if/type_names"); + nss_info_always("NSS PPE VP create: echo > /proc/sys/nss/ppe_vp/create"); + nss_info_always("NSS PPE VP destroy: echo > /proc/sys/nss/ppe_vp/destroy"); +} + +/* + * nss_ppe_vp_del_map() + * Delete mapping between NSS interface number and VP number. + */ +static bool nss_ppe_vp_del_map(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) +{ + int32_t idx; + nss_ppe_port_t ppe_port_num; + struct nss_vp_mapping *nss_vp_info; + uint16_t vp_index; + + nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); + + idx = nss_ppe_vp_get_map_index(if_num); + if ((idx < 0) || (idx >= NSS_MAX_DYNAMIC_INTERFACES)) { + nss_warning("%px: Invalid index. Cannot delete the PPE VP mapping. idx:%u", nss_ctx, idx); + return false; + } + + spin_lock_bh(&nss_ppe_vp_map_lock); + nss_vp_info = vp_map[idx]; + if (!nss_vp_info) { + spin_unlock_bh(&nss_ppe_vp_map_lock); + nss_warning("%px: Could not find the vp num in the mapping. NSS if num:%u", nss_ctx, if_num); + return false; + } + + ppe_port_num = nss_vp_info->ppe_port_num; + + nss_ppe_vp_map_dealloc(nss_vp_info); + vp_map[idx] = NULL; + spin_unlock_bh(&nss_ppe_vp_map_lock); + + /* + * Clear the PPE VP stats once PPE VP is deleted + */ + vp_index = ppe_port_num - NSS_PPE_VP_START; + spin_lock_bh(&nss_ppe_vp_stats_lock); + memset(&nss_ppe_vp_debug_stats.vp_stats[vp_index], 0, sizeof(struct nss_ppe_vp_statistics_debug)); + spin_unlock_bh(&nss_ppe_vp_stats_lock); + + nss_info("%px: Deleted NSS interface number and PPE VP number mapping successfully: NSS if num:%u at index:%u", nss_ctx, if_num, idx); + + return true; +} + +/* + * nss_ppe_vp_add_map() + * Add mapping between NSS interface number and VP number. + */ +static bool nss_ppe_vp_add_map(struct nss_ctx_instance *nss_ctx ,nss_if_num_t if_num, struct nss_vp_mapping *nss_vp_info) +{ + uint32_t idx; + nss_ppe_port_t ppe_port_num; + + nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); + + if (!nss_vp_info) { + nss_warning("%px: Received invalid argument.", nss_ctx); + return false; + } + + idx = nss_ppe_vp_get_map_index(if_num); + if ((idx < 0) || (idx >= NSS_MAX_DYNAMIC_INTERFACES)) { + nss_warning("%px: Invalid index. Cannot add the PPE VP mapping. idx:%u", nss_ctx, idx); + return false; + } + + spin_lock_bh(&nss_ppe_vp_map_lock); + if (vp_map[idx]) { + spin_unlock_bh(&nss_ppe_vp_map_lock); + nss_warning("%px: Mapping exists already. NSS if num:%d index:%u, VP num:%u", nss_ctx, if_num, idx, vp_map[idx]->ppe_port_num); + return false; + } + + vp_map[idx] = nss_vp_info; + ppe_port_num = vp_map[idx]->ppe_port_num; + spin_unlock_bh(&nss_ppe_vp_map_lock); + + nss_info("%px: Mapping added successfully. NSS if num:%d index:%u, VP num:%u", nss_ctx, if_num, idx, ppe_port_num); + + return true; } /* @@ -65,14 +191,99 @@ struct nss_ctx_instance *nss_ppe_vp_get_context(void) static void nss_ppe_vp_callback(void *app_data, struct nss_ppe_vp_msg *npvm) { if (npvm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("ppe_vp error response %d\n", npvm->cm.response); - ppe_vp_pvt.response = npvm->cm.response; + nss_warning("ppe_vp error response %d", npvm->cm.response); + ppe_vp_pvt.response = NSS_TX_FAILURE; + complete(&ppe_vp_pvt.complete); + return; } + if (npvm->cm.type == NSS_IF_PPE_PORT_CREATE) { + ppe_vp_pvt.ppe_port_num = npvm->msg.if_msg.ppe_port_create.ppe_port_num; + nss_trace("PPE VP callback success VP num: %u", npvm->msg.if_msg.ppe_port_create.ppe_port_num); + } ppe_vp_pvt.response = NSS_TX_SUCCESS; + complete(&ppe_vp_pvt.complete); } +/* + * nss_ppe_vp_parse_vp_cmd() + * Parse PPE VP create and destroy message and return the NSS interface number. + * Command usage: + * echo /proc/sys/nss/ppe_vp/create> + * echo ath0 6 > /proc/sys/nss/ppe_vp/create + * Since ath0 has only one type i.e. ath0 is NSS_DYNAMIC_INTERFACE_TYPE_VAP, the above command can be rewritten as + * echo ath0 > /proc/sys/nss/ppe_vp/create => Here 6 can be ignored. + */ +static nss_if_num_t nss_ppe_vp_parse_vp_cmd(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) +{ + int32_t if_num; + struct net_device *dev; + uint32_t dynamic_if_type = (uint32_t)NSS_DYNAMIC_INTERFACE_TYPE_NONE; + struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); + char *pos; + char cmd_buf[NSS_PPE_VP_MAX_CMD_STR] = {0}, dev_name[NSS_PPE_VP_MAX_CMD_STR] = {0}; + size_t count = *lenp; + int ret = proc_dostring(ctl, write, buffer, lenp, ppos); + + if (!write) { + nss_ppe_vp_proc_help(); + return ret; + } + + if (!nss_ctx) { + nss_warning("%px: NSS Context not found.", nss_ctx); + return -ENODEV; + } + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + if (count >= NSS_PPE_VP_MAX_CMD_STR) { + nss_ppe_vp_proc_help(); + nss_warning("%px: Input string too big", nss_ctx); + return -E2BIG; + } + + if (copy_from_user(cmd_buf, buffer, count)) { + nss_warning("%px: Cannot copy user's entry to kernel memory", nss_ctx); + return -EFAULT; + } + + if ((pos = strrchr(cmd_buf, '\n')) != NULL) { + *pos = '\0'; + } + + if (sscanf(cmd_buf, "%s %u", dev_name, &dynamic_if_type) < 0) { + nss_warning("%px: PPE VP command parse failed", nss_ctx); + return -EFAULT; + } + + dev = dev_get_by_name(&init_net, dev_name); + if (!dev) { + nss_warning("%px: Cannot find the net device", nss_ctx); + return -ENODEV; + } + + nss_info("%px: Dynamic interface type: %u", nss_ctx, dynamic_if_type); + if ((dynamic_if_type < NSS_DYNAMIC_INTERFACE_TYPE_NONE) || (dynamic_if_type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX)) { + nss_warning("%px: Invalid dynamic interface type: %d", nss_ctx, dynamic_if_type); + dev_put(dev); + return -EFAULT; + } + + if_num = nss_cmn_get_interface_number_by_dev_and_type(dev, dynamic_if_type); + if (if_num < 0) { + nss_warning("%px: Invalid interface number:%s", nss_ctx, dev_name); + dev_put(dev); + return -EFAULT; + } + + nss_info("%px: PPE VP create/destroy for, nss_if_num:%d dev_name:%s dynamic_if_type:%u", nss_ctx, if_num, dev_name, dynamic_if_type); + dev_put(dev); + + return if_num; +} + /* * nss_ppe_vp_tx_msg() * Transmit a ppe_vp message to NSS FW @@ -80,6 +291,7 @@ static void nss_ppe_vp_callback(void *app_data, struct nss_ppe_vp_msg *npvm) nss_tx_status_t nss_ppe_vp_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_msg *msg) { struct nss_cmn_msg *ncm = &msg->cm; + nss_if_num_t if_num = ncm->interface; /* * Trace messages. @@ -89,13 +301,13 @@ nss_tx_status_t nss_ppe_vp_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_p /* * Sanity check the message */ - if (ncm->type >= NSS_PPE_VP_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); + if (!((ncm->type == NSS_IF_PPE_PORT_CREATE) || (ncm->type == NSS_IF_PPE_PORT_DESTROY))) { + nss_warning("%px: Invalid message type: %d", nss_ctx, ncm->type); return NSS_TX_FAILURE; } - if (!nss_ppe_vp_verify_ifnum(ncm->interface)) { - nss_warning("%px: invalid interface %d\n", nss_ctx, ncm->interface); + if (!(if_num >= NSS_DYNAMIC_IF_START && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))) { + nss_warning("%px: invalid interface %d", nss_ctx, ncm->interface); return NSS_TX_FAILURE; } @@ -112,64 +324,295 @@ nss_tx_status_t nss_ppe_vp_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct int ret = 0; down(&ppe_vp_pvt.sem); - npvm->cm.cb = (nss_ptr_t)nss_ppe_vp_callback; - npvm->cm.app_data = (nss_ptr_t)NULL; status = nss_ppe_vp_tx_msg(nss_ctx, npvm); if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ppe_tx_msg failed\n", nss_ctx); + nss_warning("%px: ppe_tx_msg failed", nss_ctx); up(&ppe_vp_pvt.sem); return status; } ret = wait_for_completion_timeout(&ppe_vp_pvt.complete, msecs_to_jiffies(NSS_PPE_VP_TX_TIMEOUT)); if (!ret) { - nss_warning("%px: ppe_vp msg tx failed due to timeout\n", nss_ctx); + nss_warning("%px: ppe_vp msg tx failed due to timeout", nss_ctx); ppe_vp_pvt.response = NSS_TX_FAILURE; } status = ppe_vp_pvt.response; up(&ppe_vp_pvt.sem); + return status; } /* - * nss_ppe_vp_tx_config_msg - * API to send ppe_vp support configure message to NSS FW + * nss_ppe_vp_get_context() + * Get NSS context instance for ppe_vp */ -nss_tx_status_t nss_ppe_vp_tx_config_msg(enum nss_dynamic_interface_type type, bool enable) +struct nss_ctx_instance *nss_ppe_vp_get_context(void) { - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - struct nss_ppe_vp_config_msg *npvcm; - struct nss_ppe_vp_msg *npvm; - nss_tx_status_t status; + return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.ppe_handler_id]; +} +EXPORT_SYMBOL(nss_ppe_vp_get_context); - if (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX) { - nss_warning("%px: Dynamic if msg drooped as type is wrong:%d\n", nss_ctx, type); +/* + * nss_ppe_vp_get_ppe_port_by_nssif() + * Get vp number for a given NSS interface number. + */ +nss_ppe_port_t nss_ppe_vp_get_ppe_port_by_nssif(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) +{ + uint32_t idx; + nss_ppe_port_t ppe_port_num; + + if (!((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))) { + nss_warning("%px: NSS invalid nss if num: %u", nss_ctx, if_num); return -1; } + idx = nss_ppe_vp_get_map_index(if_num); + if (idx < 0 || idx >= NSS_MAX_DYNAMIC_INTERFACES) { + nss_warning("%px: NSS invalid index: %d nss if num: %u",nss_ctx, idx, if_num); + return -1; + } + + spin_lock_bh(&nss_ppe_vp_map_lock); + if (!vp_map[idx]) { + spin_unlock_bh(&nss_ppe_vp_map_lock); + nss_warning("%px: NSS interface and VP mapping is not present for nss if num: %u",nss_ctx, if_num); + return -1; + } + ppe_port_num = vp_map[idx]->ppe_port_num; + spin_unlock_bh(&nss_ppe_vp_map_lock); + + nss_info("%px: VP num %d nss_if: %d",nss_ctx, ppe_port_num, if_num); + + return ppe_port_num; +} +EXPORT_SYMBOL(nss_ppe_vp_get_ppe_port_by_nssif); + +/* + * nss_ppe_vp_destroy() + * Destroy PPE virtual port for the given nss interface number. + */ +nss_tx_status_t nss_ppe_vp_destroy(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) +{ + nss_tx_status_t status; + struct nss_ppe_vp_msg *npvm; + uint32_t idx; + int32_t vsi_id_valid = false; + int32_t vsi_id; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + idx = nss_ppe_vp_get_map_index(if_num); + if (idx < 0 || idx >= NSS_MAX_DYNAMIC_INTERFACES) { + nss_warning("%px: Cannot destroy PPE VP. Invalid index: %d. nss_if_num: %u", nss_ctx, idx, if_num); + return -1; + } + + spin_lock_bh(&nss_ppe_vp_map_lock); + if (vp_map[idx]) { + vsi_id = vp_map[idx]->vsi_id; + vsi_id_valid = vp_map[idx]->vsi_id_valid; + } + spin_unlock_bh(&nss_ppe_vp_map_lock); + + if (vsi_id_valid) { + /* + * Send the dettach VSI message to the Firmware. + */ + if (nss_if_vsi_unassign(nss_ctx, if_num, vsi_id)) { + nss_warning("%px: PPE VP destroy failed. Failed to detach VSI to PPE VP interface %d vsi:%d", nss_ctx, if_num, vsi_id); + return NSS_TX_FAILURE; + } + + if (ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { + nss_warning("%px: PPE VP destroy failed. Failed to free PPE VSI. nss_if:%d vsi:%d", nss_ctx, if_num, vsi_id); + return NSS_TX_FAILURE; + } + + nss_info("%px: PPE VP VSI detached successfully. VSI ID freed successfully. NSS if num:%u, VSI ID:%u", nss_ctx, if_num, vsi_id); + } + npvm = kzalloc(sizeof(struct nss_ppe_vp_msg), GFP_KERNEL); if (!npvm) { - nss_warning("%px: Unable to allocate message\n", nss_ctx); - return -1; + nss_warning("%px: Unable to allocate memeory of PPE VP message", nss_ctx); + return NSS_TX_FAILURE; } - nss_cmn_msg_init(&npvm->cm, NSS_PPE_VP_INTERFACE, NSS_PPE_VP_MSG_CONFIG, - sizeof(struct nss_ppe_vp_config_msg), NULL, NULL); + nss_trace("%px: PPE_VP will be destroyed for an interface: %d", nss_ctx, if_num); - npvcm = &npvm->msg.vp_config; - npvcm->type = type; - npvcm->vp_enable = enable; + /* + * Destroy PPE VP for a dynamic interface. + */ + nss_cmn_msg_init(&npvm->cm, if_num, NSS_IF_PPE_PORT_DESTROY, 0, nss_ppe_vp_callback, NULL); status = nss_ppe_vp_tx_msg_sync(nss_ctx, npvm); if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send ppe_vp config message for type:%d\n", nss_ctx, type); + nss_warning("%px: Unable to send PPE VP destroy message", nss_ctx); + kfree(npvm); + return NSS_TX_FAILURE; } kfree(npvm); + + /* + * Delete mapping between the NSS interface number and the VP number. + */ + if (!nss_ppe_vp_del_map(nss_ctx, if_num)) { + nss_warning("%px: Failed to delete the mapping for nss_if:%d", nss_ctx, if_num); + return NSS_TX_FAILURE; + } + return status; } +EXPORT_SYMBOL(nss_ppe_vp_destroy); + +/* + * nss_ppe_vp_create() + * Create PPE virtual port for the given nss interface number. + */ +nss_tx_status_t nss_ppe_vp_create(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) +{ + uint32_t vsi_id; + nss_tx_status_t status; + struct nss_ppe_vp_msg *npvm; + struct nss_vp_mapping *nss_vp_info; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + /* + * TODO: No need to create VSI for tunnel interfaces. Only for VAP interfaces VSI is needed. + * Allocate the VSI for the dynamic interface on which VP will be created. + */ + if (ppe_vsi_alloc(NSS_PPE_VP_SWITCH_ID, &vsi_id)) { + nss_warning("%px, Failed to alloc VSI ID, PPE VP create failed. nss_if:%u", nss_ctx, if_num); + return NSS_TX_FAILURE; + } + + npvm = kzalloc(sizeof(struct nss_ppe_vp_msg), GFP_KERNEL); + if (!npvm) { + nss_warning("%px: Unable to allocate memeory of PPE VP message", nss_ctx); + goto free_vsi; + } + + nss_trace("%px: PPE_VP will be created for an interface: %d", nss_ctx, if_num); + + /* + * Create PPE VP for a dynamic interface. + */ + nss_cmn_msg_init(&npvm->cm, if_num, NSS_IF_PPE_PORT_CREATE, + sizeof(struct nss_if_ppe_port_create), nss_ppe_vp_callback, NULL); + + status = nss_ppe_vp_tx_msg_sync(nss_ctx, npvm); + if (status != NSS_TX_SUCCESS) { + nss_warning("%px: Unable to send ppe_vp create message", nss_ctx); + goto free_alloc; + } + + /* + * Send the attach VSI message to the Firmware. + */ + if (nss_if_vsi_assign(nss_ctx, if_num, vsi_id) != NSS_TX_SUCCESS) { + nss_warning("%px: Failed to attach VSI to PPE VP interface. nss_if:%u vsi:%u", nss_ctx, if_num, vsi_id); + goto destroy_vp; + } + + nss_vp_info = nss_ppe_vp_map_alloc(); + if (!nss_vp_info) { + nss_warning("%px: No memory for allocating NSS-VP mapping instance", nss_ctx); + goto detach_vsi; + } + + nss_vp_info->vsi_id = vsi_id; + nss_vp_info->vsi_id_valid = true; + nss_vp_info->if_num = if_num; + nss_vp_info->ppe_port_num = ppe_vp_pvt.ppe_port_num; + + nss_info("%px: PPE VP allocated VSI ID:%u NSS interface number:%u VP no from Firmware:%u", nss_ctx, vsi_id, if_num, nss_vp_info->ppe_port_num); + + /* + * Add mapping between the NSS interface number and the VP number. + */ + if (!nss_ppe_vp_add_map(nss_ctx, if_num, nss_vp_info)) { + nss_warning("%px: Failed to add mapping for NSS interface number: %d", nss_ctx, if_num); + goto free_nss_vp_info; + } + + kfree(npvm); + + return status; + +free_nss_vp_info: + nss_ppe_vp_map_dealloc(nss_vp_info); + +detach_vsi: + nss_trace("%px: Detaching VSI ID :%u NSS Interface no:%u", nss_ctx, vsi_id, if_num); + if (nss_if_vsi_unassign(nss_ctx, if_num, vsi_id)) { + nss_warning("%px: Failed to free PPE VP VSI. nss_if:%u vsi:%u", nss_ctx, if_num, vsi_id); + } + +destroy_vp: + nss_trace("%px: Destroy Vp for NSS Interface num:%u VP num:%u", nss_ctx, if_num, npvm->msg.if_msg.ppe_port_create.ppe_port_num); + if (nss_ppe_vp_destroy(nss_ctx, if_num)) { + nss_warning("%px: PPE VP destroy failed, nss_if:%u", nss_ctx, if_num); + } + +free_alloc: + kfree(npvm); + +free_vsi: + nss_trace("%px: Free VSI ID :%u NSS Interface no:%u", nss_ctx, vsi_id, if_num); + if (ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { + nss_warning("%px: Failed to free PPE VP VSI. NSS if num:%u vsi:%u", nss_ctx, if_num, vsi_id); + } + + return NSS_TX_FAILURE; +} +EXPORT_SYMBOL(nss_ppe_vp_create); + +/* + * nss_ppe_vp_destroy_notify() + * Get PPE VP destroy notification from NSS + */ +static void nss_ppe_vp_destroy_notify(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_destroy_notify_msg *destroy_notify) +{ + nss_if_num_t nss_if_num; + uint32_t i; + int32_t vsi_id; + bool vsi_id_valid = false; + nss_ppe_port_t ppe_port_num = destroy_notify->ppe_port_num; + + /* + * Find NSS interface number corresponding to the VP num. + */ + spin_lock_bh(&nss_ppe_vp_map_lock); + for (i = 0; i < NSS_MAX_DYNAMIC_INTERFACES; i++) { + if (vp_map[i] && (ppe_port_num == vp_map[i]->ppe_port_num)) { + nss_if_num = vp_map[i]->if_num; + vsi_id = vp_map[i]->vsi_id; + vsi_id_valid = vp_map[i]->vsi_id_valid; + break; + } + } + spin_unlock_bh(&nss_ppe_vp_map_lock); + + if (i == NSS_MAX_DYNAMIC_INTERFACES) { + nss_warning("%px: Could not find the NSS interface number mapping for VP number: %u\n", nss_ctx, ppe_port_num); + return; + } + + /* + * Delete the nss_if_num to VP num mapping and reset the stats entry for this VP. + */ + if (!nss_ppe_vp_del_map(nss_ctx, nss_if_num)) { + nss_warning("%px: Failed to delete the mapping for nss_if: %d\n", nss_ctx, nss_if_num); + return; + } + + if (vsi_id_valid && ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { + nss_warning("%px: Failed to free PPE VSI. nss_if: %d vsi: %d\n", nss_ctx, nss_if_num, vsi_id); + } +} /* * nss_ppe_vp_handler() @@ -181,34 +624,48 @@ static void nss_ppe_vp_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_ nss_ppe_vp_msg_callback_t cb; void *ctx; - nss_trace("nss_ctx: %px ppe_vp msg: %px\n", nss_ctx, msg); - BUG_ON(!nss_ppe_vp_verify_ifnum(ncm->interface)); + NSS_VERIFY_CTX_MAGIC(nss_ctx); - /* - * Trace messages. - */ - nss_ppe_vp_log_rx_msg(msg); + nss_trace("%px ppe_vp msg: %px\n", nss_ctx, msg); + BUG_ON(!nss_ppe_vp_verify_ifnum(ncm->interface)); /* * Is this a valid request/response packet? */ if (ncm->type >= NSS_PPE_VP_MSG_MAX) { - nss_warning("%px: received invalid message %d for PPE_VP interface\n", nss_ctx, ncm->type); + nss_warning("%px: received invalid message %d for PPE_VP interface", nss_ctx, ncm->type); return; } if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ppe_vp_msg)) { - nss_warning("%px: Length of message is greater than required: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); + nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); return; } + /* + * Trace messages. + */ + nss_ppe_vp_log_rx_msg(msg); + switch (msg->cm.type) { case NSS_PPE_VP_MSG_SYNC_STATS: /* * Per VP stats msg */ nss_ppe_vp_stats_sync(nss_ctx, &msg->msg.stats, ncm->interface); - return; + break; + + case NSS_PPE_VP_MSG_DESTROY_NOTIFY: + /* + * VP destroy notification + */ + nss_ppe_vp_destroy_notify(nss_ctx, &msg->msg.destroy_notify); + break; + } + + if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { + ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); + ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; } /* @@ -233,83 +690,76 @@ static void nss_ppe_vp_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_ } /* - * nss_ppe_vp_proc_help - * Print usage information for ppe_vp configure sysctl. + * nss_ppe_vp_destroy_handler() + * PPE VP destroy handler. */ -void nss_ppe_vp_proc_help(void) +static int nss_ppe_vp_destroy_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - printk("== for dynamic interface types read following file ==\n"); - printk("/sys/kernel/debug/qca-nss-drv/stats/dynamic_if/type_names\n"); -} + struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); + int32_t if_num; + nss_tx_status_t nss_tx_status; -/* - * nss_ppe_vp_enable_handler - * Enable VP support for specfic dynamic interface type. - */ -static int nss_ppe_vp_enable_handler(struct ctl_table *table, int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - nss_tx_status_t status; - enum nss_dynamic_interface_type type; - - int ret = proc_dointvec(table, write, buffer, lenp, ppos); - if (ret) - return ret; - - nss_info("%s:%d start\n", __func__, __LINE__); - - if (!write) { - nss_info("print dynamic interface type table\n"); - nss_ppe_vp_proc_help(); - return ret; + if (!nss_ctx) { + nss_warning("%px: NSS Context not found.", nss_ctx); + return -ENODEV; } - type = nss_ppe_vp_enable; - if ((type <= NSS_DYNAMIC_INTERFACE_TYPE_NONE) || (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX)) { - nss_warning("incorrect type: %u", nss_ppe_vp_enable); - nss_ppe_vp_proc_help(); - return -EINVAL; + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + if_num = nss_ppe_vp_parse_vp_cmd(ctl, write, buffer, lenp, ppos); + if (if_num < 0) { + nss_warning("%px: Invalid interface number: %d", nss_ctx, if_num); + return -EFAULT; } - status = nss_ppe_vp_tx_config_msg(type, true); - if (status != NSS_TX_SUCCESS) { - nss_warning("failed to enable VP support for type: %u", type); - return -EINVAL; + if (nss_ppe_vp_get_ppe_port_by_nssif(nss_ctx, if_num) < 0) { + nss_warning("%px: VP is not present for interface: %d", nss_ctx, if_num); + return -EEXIST; + } + + nss_tx_status = nss_ppe_vp_destroy(nss_ctx, if_num); + if (nss_tx_status != NSS_TX_SUCCESS) { + nss_warning("%px: Sending message failed, cannot destroy PPE_VP node nss_if: %u", nss_ctx, if_num); + return -EBUSY; } return 0; } /* - * nss_ppe_vp_disable_handler - * Disable VP support for a given dynamic interface type. + * nss_ppe_vp_create_handler() + * PPE VP create handler. */ -static int nss_ppe_vp_disable_handler(struct ctl_table *table, int write, void __user *buffer, - size_t *lenp, loff_t *ppos) +static int nss_ppe_vp_create_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - nss_tx_status_t status; - enum nss_dynamic_interface_type type; + int32_t if_num; + struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); + nss_tx_status_t nss_tx_status; - int ret = proc_dointvec(table, write, buffer, lenp, ppos); - if (ret) - return ret; - - if (!write) { - nss_ppe_vp_proc_help(); - return ret; + if (!nss_ctx) { + nss_warning("%px: NSS Context not found.", nss_ctx); + return -ENODEV; } - type = nss_ppe_vp_disable; - if ((type <= NSS_DYNAMIC_INTERFACE_TYPE_NONE) || (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX)) { - nss_warning("incorrect type: %u", nss_ppe_vp_enable); - nss_ppe_vp_proc_help(); - return -EINVAL; + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + if_num = nss_ppe_vp_parse_vp_cmd(ctl, write, buffer, lenp, ppos); + if (if_num < 0) { + nss_warning("%px: Invalid interface number: %d", nss_ctx, if_num); + return -EFAULT; } - status = nss_ppe_vp_tx_config_msg(type, false); - if (status != NSS_TX_SUCCESS) { - nss_warning("failed to disable VP support for type: %u", type); - return -EINVAL; + nss_info("%px: NSS interface number: %d", nss_ctx, if_num); + + if (nss_ppe_vp_get_ppe_port_by_nssif(nss_ctx, if_num) > 0) { + nss_warning("%px: VP is already present for nss_if_num: %d", nss_ctx, if_num); + return -EEXIST; + } + + nss_tx_status = nss_ppe_vp_create(nss_ctx, if_num); + if (nss_tx_status != NSS_TX_SUCCESS) { + nss_warning("%px: Sending message failed, cannot create PPE VP node for nss_if_num: %u", nss_ctx, if_num); + return -EBUSY; } return 0; @@ -317,18 +767,18 @@ static int nss_ppe_vp_disable_handler(struct ctl_table *table, int write, void _ static struct ctl_table nss_ppe_vp_table[] = { { - .procname = "enable", - .data = &nss_ppe_vp_enable, - .maxlen = sizeof(int), + .procname = "create", + .data = &nss_ppe_vp_cmd, + .maxlen = sizeof(nss_ppe_vp_cmd), .mode = 0644, - .proc_handler = &nss_ppe_vp_enable_handler, + .proc_handler = &nss_ppe_vp_create_handler, }, { - .procname = "disable", - .data = &nss_ppe_vp_disable, - .maxlen = sizeof(int), + .procname = "destroy", + .data = &nss_ppe_vp_cmd, + .maxlen = sizeof(nss_ppe_vp_cmd), .mode = 0644, - .proc_handler = &nss_ppe_vp_disable_handler, + .proc_handler = &nss_ppe_vp_destroy_handler, }, { } }; @@ -389,7 +839,7 @@ void nss_ppe_vp_register_handler(void) nss_ppe_vp_dentry = nss_ppe_vp_stats_dentry_create(); if (nss_ppe_vp_dentry == NULL) { - nss_warning("%px: Not able to create debugfs entry\n", nss_ctx); + nss_warning("%px: Not able to create debugfs entry", nss_ctx); return; } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h index 3508ea530..ee656497f 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -30,7 +30,8 @@ #define NSS_PPE_VP_MAX_NUM 192 #define NSS_PPE_VP_START 64 #define NSS_PPE_VP_NODE_STATS_MAX 32 - +#define NSS_PPE_VP_SWITCH_ID 0 +#define NSS_PPE_VP_MAX_CMD_STR 200 /* * ppe_vp nss debug stats lock @@ -43,7 +44,7 @@ extern spinlock_t nss_ppe_vp_stats_lock; */ enum nss_ppe_vp_msg_error_type { NSS_PPE_VP_MSG_ERROR_TYPE_UNKNOWN, /* Unknown message error */ - NSS_PPE_VP_MSG_ERROR_TYPE_INVALID_DI, /* Invalid dynamic interface type error */ + PPE_VP_MSG_ERROR_TYPE_INVALID_DI, /* Invalid dynamic interface type */ NSS_PPE_VP_MSG_ERROR_TYPE_MAX /* Maximum error type */ }; @@ -52,27 +53,18 @@ enum nss_ppe_vp_msg_error_type { * Message types for Packet Processing Engine (PPE) requests and responses. */ enum nss_ppe_vp_message_types { - NSS_PPE_VP_MSG_CONFIG, NSS_PPE_VP_MSG_SYNC_STATS, + NSS_PPE_VP_MSG_DESTROY_NOTIFY, NSS_PPE_VP_MSG_MAX, }; -/* - * nss_ppe_vp_config_msg - * Message to enable/disable VP support for a specific dynamic interface type. - */ -struct nss_ppe_vp_config_msg { - enum nss_dynamic_interface_type type; /* Interface type */ - bool vp_enable; /* VP support enable */ -}; - /* * nss_ppe_vp_statistics * Message structure for ppe_vp statistics */ struct nss_ppe_vp_statistics { uint32_t nss_if; /* NSS interface number corresponding to VP */ - uint32_t vp_num; /* VP number */ + nss_ppe_port_t ppe_port_num; /* VP number */ uint32_t rx_drop; /* Rx drops due to VP node inactive */ uint32_t tx_drop; /* Tx drops due to VP node inactive */ uint32_t packet_big_err; /* Number of packets not sent to PPE because packet was too large */ @@ -90,22 +82,43 @@ struct nss_ppe_vp_sync_stats_msg { /* Per service-code stats */ }; +/* + * nss_ppe_vp_destroy_notify_msg + * Message received as part of destroy notification from Firmware to Host. + */ +struct nss_ppe_vp_destroy_notify_msg { + nss_ppe_port_t ppe_port_num; /* VP number */ +}; + /* * nss_ppe_vp_msg * Message for receiving ppe_vp NSS to host messages. */ struct nss_ppe_vp_msg { - struct nss_cmn_msg cm; /**< Common message header. */ + struct nss_cmn_msg cm; /* Common message header. */ /* * Payload. */ union { - struct nss_ppe_vp_config_msg vp_config; - /**< Enable/disable VP support for specific type */ + union nss_if_msgs if_msg; + /* NSS interface base messages. */ struct nss_ppe_vp_sync_stats_msg stats; - /**< Synchronization statistics. */ - } msg; /**< Message payload. */ + /* Synchronization statistics. */ + struct nss_ppe_vp_destroy_notify_msg destroy_notify; + /* Information for the VP destroyed in Firmware. */ + } msg; /* Message payload. */ +}; + +/* + * nss_vp_mapping + * Structure to maintain the one-to-one mapping between the NSS interface number and VP number. + */ +struct nss_vp_mapping { + nss_if_num_t if_num; /* NSS interface number. */ + nss_ppe_port_t ppe_port_num; /* PPE port number corresponding to the NSS interface number. */ + uint32_t vsi_id; /* VSI ID allocated for NSS interface */ + bool vsi_id_valid; /* Set to true if vsi_id field has a valid VSI else set to false. */ }; typedef void (*nss_ppe_vp_msg_callback_t)(void *app_data, struct nss_ppe_vp_msg *msg); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c index 02e352d1e..8c853dfcb 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -24,15 +24,6 @@ #include "nss_core.h" #include "nss_ppe_vp.h" -/* - * nss_ppe_vp_log_message_types_str - * PPE message strings - */ -static int8_t *nss_ppe_vp_log_message_types_str[NSS_PPE_VP_MSG_MAX] __maybe_unused = { - "PPE VP Config", - "PPE VP Stats", -}; - /* * nss_ppe_vp_log_error_response_types_str * Strings for error types for PPE-VP messages @@ -43,15 +34,16 @@ static int8_t *nss_ppe_vp_log_error_response_types_str[NSS_PPE_VP_MSG_ERROR_TYPE }; /* - * nss_ppe_vp_log_config_msg() - * Log NSS PPE VP configuration message. + * nss_ppe_vp_log_destroy_notify_msg() + * Log NSS PPE VP destroy notification message. */ -static void nss_ppe_vp_log_config_msg(struct nss_ppe_vp_msg *npvm) +static void nss_ppe_vp_log_destroy_notify_msg(struct nss_ppe_vp_msg *npvm) { - struct nss_ppe_vp_config_msg *npcm __maybe_unused = &npvm->msg.vp_config; - nss_trace("%px: NSS PPE VP configuration message:\n" - "Dynamic interface type: %d is_vp_support_enable: %d\n", - npcm, npcm->type, npcm->vp_enable); + struct nss_ppe_vp_destroy_notify_msg *npdnm __maybe_unused = &npvm->msg.destroy_notify; + + nss_trace("%px: NSS PPE VP destroy notification message:\n" + "VP number: %u\n", + npdnm, npdnm->ppe_port_num); } /* @@ -61,8 +53,25 @@ static void nss_ppe_vp_log_config_msg(struct nss_ppe_vp_msg *npvm) static void nss_ppe_vp_log_verbose(struct nss_ppe_vp_msg *npvm) { switch (npvm->cm.type) { - case NSS_PPE_VP_MSG_CONFIG: - nss_ppe_vp_log_config_msg(npvm); + + case NSS_IF_PPE_PORT_CREATE: + nss_info("%px: PPE interface create message type:%d\n", npvm, npvm->cm.type); + break; + + case NSS_IF_PPE_PORT_DESTROY: + nss_info("%px: PPE interface destroy message type:%d\n", npvm, npvm->cm.type); + break; + + case NSS_IF_VSI_ASSIGN: + nss_info("%px: PPE interface VSI assign message type:%d\n", npvm, npvm->cm.type); + break; + + case NSS_IF_VSI_UNASSIGN: + nss_info("%px: PPE interface VSI unassign message type:%d\n", npvm, npvm->cm.type); + break; + + case NSS_PPE_VP_MSG_DESTROY_NOTIFY: + nss_ppe_vp_log_destroy_notify_msg(npvm); break; case NSS_PPE_VP_MSG_SYNC_STATS: @@ -83,12 +92,13 @@ static void nss_ppe_vp_log_verbose(struct nss_ppe_vp_msg *npvm) */ void nss_ppe_vp_log_tx_msg(struct nss_ppe_vp_msg *npvm) { - if (npvm->cm.type >= NSS_PPE_VP_MSG_MAX) { + + if (!((npvm->cm.type == NSS_IF_PPE_PORT_CREATE) || (npvm->cm.type == NSS_IF_PPE_PORT_DESTROY))) { nss_warning("%px: Invalid message type\n", npvm); return; } - nss_info("%px: type[%d]:%s\n", npvm, npvm->cm.type, nss_ppe_vp_log_message_types_str[npvm->cm.type]); + nss_info("%px: type:%d\n", npvm, npvm->cm.type); nss_ppe_vp_log_verbose(npvm); } @@ -104,23 +114,20 @@ void nss_ppe_vp_log_rx_msg(struct nss_ppe_vp_msg *npvm) } if (npvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npvm, npvm->cm.type, - nss_ppe_vp_log_message_types_str[npvm->cm.type], + nss_info("%px: type: %d, response[%d]: %s\n", npvm, npvm->cm.type, npvm->cm.response, nss_cmn_response_str[npvm->cm.response]); goto verbose; } if (npvm->cm.error >= NSS_PPE_VP_MSG_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - npvm, npvm->cm.type, nss_ppe_vp_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], + nss_warning("%px: msg failure - type: %d, response[%d]: %s, error[%d]:Invalid error\n", + npvm, npvm->cm.type, npvm->cm.response, nss_cmn_response_str[npvm->cm.response], npvm->cm.error); goto verbose; } - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - npvm, npvm->cm.type, nss_ppe_vp_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], + nss_info("%px: msg nack - type: %d, response[%d]: %s, error[%d]: %s\n", + npvm, npvm->cm.type, npvm->cm.response, nss_cmn_response_str[npvm->cm.response], npvm->cm.error, nss_ppe_vp_log_error_response_types_str[npvm->cm.error]); verbose: diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c index a51973690..57c79953f 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -69,7 +69,7 @@ struct nss_stats_info nss_ppe_vp_stats_rx_str[NSS_PPE_VP_STATS_RX_MAX] = { * PPE VP statistics strings */ struct nss_stats_info nss_ppe_vp_stats_str[NSS_PPE_VP_STATS_MAX] = { - {"vp_num" , NSS_STATS_TYPE_SPECIAL}, + {"ppe_port_num" , NSS_STATS_TYPE_SPECIAL}, {"nss_if" , NSS_STATS_TYPE_SPECIAL}, {"rx_packets" , NSS_STATS_TYPE_COMMON}, {"rx_bytes" , NSS_STATS_TYPE_COMMON}, @@ -108,18 +108,11 @@ void nss_ppe_vp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_s while (count) { count--; - /* - * If nss interface is changed from previous entry, reset the stats. - */ - vp_index = stats_msg->vp_stats[count].vp_num - NSS_PPE_VP_START; - if (nss_ppe_vp_debug_stats.vp_stats[vp_index].nss_if != stats_msg->vp_stats[count].nss_if) { - memset(&nss_ppe_vp_debug_stats.vp_stats[vp_index], 0, sizeof(struct nss_ppe_vp_statistics_debug)); - } - /* * Update stats in global array */ - nss_ppe_vp_debug_stats.vp_stats[vp_index].vp_num = stats_msg->vp_stats[count].vp_num; + vp_index = stats_msg->vp_stats[count].ppe_port_num - NSS_PPE_VP_START; + nss_ppe_vp_debug_stats.vp_stats[vp_index].ppe_port_num = stats_msg->vp_stats[count].ppe_port_num; nss_ppe_vp_debug_stats.vp_stats[vp_index].nss_if = stats_msg->vp_stats[count].nss_if; nss_ppe_vp_debug_stats.vp_stats[vp_index].rx_packets += stats_msg->vp_stats[count].stats.rx_packets; nss_ppe_vp_debug_stats.vp_stats[vp_index].rx_bytes += stats_msg->vp_stats[count].stats.rx_bytes; @@ -132,8 +125,8 @@ void nss_ppe_vp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_s nss_ppe_vp_debug_stats.vp_stats[vp_index].tx_dropped[i] += stats_msg->vp_stats[count].stats.rx_dropped[i]; } - nss_trace("sync count:%d vp_num %d rx_packets %d tx_packets %d\n", - count, stats_msg->vp_stats[count].vp_num, + nss_trace("sync count:%d ppe_port_num %d rx_packets %d tx_packets %d\n", + count, stats_msg->vp_stats[count].ppe_port_num, stats_msg->vp_stats[count].stats.rx_packets, stats_msg->vp_stats[count].stats.tx_packets); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h index 56a828905..b435da5ba 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h @@ -28,7 +28,7 @@ * NSS PPE-VP statistics */ struct nss_ppe_vp_statistics_debug { - uint64_t vp_num; /* VP number */ + uint64_t ppe_port_num; /* VP number */ uint64_t nss_if; /* NSS interface number corresponding to VP */ uint64_t rx_packets; /* Number of packets received. */ uint64_t rx_bytes; /* Number of bytes received. */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c b/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c index 1066d0042..73cf43460 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -365,7 +365,7 @@ struct nss_ctx_instance *nss_register_pptp_if(uint32_t if_num, int i = 0; nss_assert(nss_ctx); - nss_assert(nss_pptp_verify_if_num()); + nss_assert(nss_pptp_verify_if_num(if_num)); nss_ctx->subsys_dp_register[if_num].type = type; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c index b06136323..abe78eeb7 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -80,22 +80,22 @@ static bool nss_pvxlan_hdl_instance_free(struct nss_ctx_instance *nss_ctx, uint3 { struct nss_pvxlan_handle *h; - spin_lock(&nss_pvxlan_spinlock); + spin_lock_bh(&nss_pvxlan_spinlock); h = nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START]; if (!h) { - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); nss_warning("%px: Instance does not exist: %d", nss_ctx, if_num); return false; } if (h->if_num != if_num) { - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); nss_warning("%px: Not correct if_num: %d", nss_ctx, if_num); return false; } nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] = NULL; - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); kfree(h); return true; } @@ -119,9 +119,9 @@ static bool nss_pvxlan_hdl_instance_alloc(struct nss_ctx_instance *nss_ctx, uint } h->if_num = if_num; - spin_lock(&nss_pvxlan_spinlock); + spin_lock_bh(&nss_pvxlan_spinlock); if (nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); kfree(h); nss_warning("%px: The handle has been taken by another thread :%d", nss_ctx, if_num); return false; @@ -130,7 +130,7 @@ static bool nss_pvxlan_hdl_instance_alloc(struct nss_ctx_instance *nss_ctx, uint h->msg_callback = notify_cb; h->app_data = app_data; nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] = h; - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); return true; } @@ -201,13 +201,13 @@ static void nss_pvxlan_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_ */ if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { uint32_t if_num = ncm->interface - NSS_DYNAMIC_IF_START; - spin_lock(&nss_pvxlan_spinlock); + spin_lock_bh(&nss_pvxlan_spinlock); h = nss_pvxlan_hdl[if_num]; if (h) { ncm->cb = (nss_ptr_t)h->msg_callback; ncm->app_data = (nss_ptr_t)h->app_data; } - spin_unlock(&nss_pvxlan_spinlock); + spin_unlock_bh(&nss_pvxlan_spinlock); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c index 756bd5677..b6068d947 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -16,9 +16,11 @@ #include "nss_tx_rx_common.h" #include "nss_qvpn_stats.h" +#include "nss_qvpn_strings.h" #include "nss_qvpn_log.h" #define NSS_QVPN_TX_TIMEOUT 1000 /* 1 Second */ +#define NSS_QVPN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) /**< QVPN interface mapping bits. */ /* * Private data structure @@ -48,36 +50,6 @@ static bool nss_qvpn_verify_if_num(uint32_t if_num) return true; } -/* - * nss_qvpn_tunnel_stats_sync - * Update qvpn interface statistics. - */ -static void nss_qvpn_tunnel_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_qvpn_msg *ndcm = (struct nss_qvpn_msg *)ncm; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_qvpn_stats_sync_msg *msg_stats = &ndcm->msg.stats; - uint64_t *if_stats; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats - */ - if_stats = nss_top->stats_node[ncm->interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->node_stats.rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->node_stats.rx_bytes; - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED] += msg_stats->node_stats.rx_dropped[0]; - if_stats[NSS_STATS_NODE_RX_QUEUE_1_DROPPED] += msg_stats->node_stats.rx_dropped[1]; - if_stats[NSS_STATS_NODE_RX_QUEUE_2_DROPPED] += msg_stats->node_stats.rx_dropped[2]; - if_stats[NSS_STATS_NODE_RX_QUEUE_3_DROPPED] += msg_stats->node_stats.rx_dropped[3]; - - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->node_stats.tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->node_stats.tx_bytes; - - spin_unlock_bh(&nss_top->stats_lock); -} - /* * nss_qvpn_handler() * Handle NSS to HLOS messages for QVPN @@ -114,7 +86,8 @@ static void nss_qvpn_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_ms nss_qvpn_log_rx_msg((struct nss_qvpn_msg *)ncm); if (ncm->type == NSS_QVPN_MSG_TYPE_SYNC_STATS) { - nss_qvpn_tunnel_stats_sync(nss_ctx, ncm); + nss_qvpn_stats_tunnel_sync(nss_ctx, ncm); + nss_qvpn_stats_notify(nss_ctx, ncm->interface); } /* @@ -367,4 +340,5 @@ void nss_qvpn_register_handler(void) sema_init(&qvpn_pvt.sem, 1); init_completion(&qvpn_pvt.complete); nss_qvpn_stats_dentry_create(); + nss_qvpn_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c index ff139bc99..4a9bdc116 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -16,6 +16,38 @@ #include "nss_core.h" #include +#include "nss_qvpn_stats.h" +#include "nss_qvpn_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_qvpn_stats_notifier); + +/* + * Spinlock to protect qvpn statistics update/read + */ +DEFINE_SPINLOCK(nss_qvpn_stats_lock); + +uint64_t nss_qvpn_stats[NSS_MAX_NET_INTERFACES][NSS_STATS_NODE_MAX]; /* to store the qvpn statistics */ + +/* + * nss_qvpn_stats_iface_type() + * Return a string for each interface type. + */ +static const char *nss_qvpn_stats_iface_type(enum nss_dynamic_interface_type type) +{ + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER: + return "qvpn_inner"; + + case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER: + return "qvpn_outer"; + + default: + return "invalid_interface"; + } +} /* * nss_qvpn_stats_read() @@ -23,51 +55,70 @@ */ static ssize_t nss_qvpn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) { + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; struct nss_ctx_instance *nss_ctx = nss_qvpn_get_context(); enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; unsigned long *ifmap; - char *buf; + uint64_t *stats_shadow; + ssize_t bytes_read = 0; + size_t size_wr = 0; + uint32_t if_num; + int32_t i; + int count; + char *lbuf; ifmap = nss_qvpn_ifmap_get(); - size = NSS_QVPN_STATS_SIZE_PER_IF * bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); + count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); + if (count) { + size_al = size_al * count; + } - buf = kzalloc(size, GFP_KERNEL); - if (!buf) { - nss_warning("Could not allocate memory for local statistics buffer\n"); - return 0; + lbuf = vzalloc(size_al); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return -ENOMEM; + } + + stats_shadow = vzalloc(NSS_STATS_NODE_MAX * 8); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + vfree(lbuf); + return -ENOMEM; } /* * Common node stats for each QVPN dynamic interface. */ - len += nss_stats_banner(buf, len, size, "qvpn", NSS_STATS_SINGLE_CORE); + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "qvpn stats", NSS_STATS_SINGLE_CORE); for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { + type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - default: - len += scnprintf(buf + len, size - len, "\nUnknown(%d) if_num:%03u", type, if_num); - break; + if ((type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER) && + (type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER)) { + continue; } - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "qvpn"); + spin_lock_bh(&nss_qvpn_stats_lock); + for (i = 0; i < NSS_STATS_NODE_MAX; i++) { + stats_shadow[i] = nss_qvpn_stats[if_num][i]; + } + spin_unlock_bh(&nss_qvpn_stats_lock); + + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", + nss_qvpn_stats_iface_type(type), if_num); + size_wr += nss_stats_print("qvpn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_qvpn_strings_stats, + stats_shadow, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al); } - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - kfree(buf); - + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + vfree(lbuf); + vfree(stats_shadow); return bytes_read; } @@ -76,6 +127,72 @@ static ssize_t nss_qvpn_stats_read(struct file *fp, char __user *ubuf, size_t sz */ NSS_STATS_DECLARE_FILE_OPERATIONS(qvpn) +/* + * nss_qvpn_stats_tunnel_sync + * Update qvpn interface statistics. + */ +void nss_qvpn_stats_tunnel_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) +{ + struct nss_qvpn_msg *ndcm = (struct nss_qvpn_msg *)ncm; + struct nss_qvpn_stats_sync_msg *msg_stats = &ndcm->msg.stats; + + spin_lock_bh(&nss_qvpn_stats_lock); + + /* + * Update common node stats + */ + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_PKTS] += msg_stats->node_stats.rx_packets; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_BYTES] += msg_stats->node_stats.rx_bytes; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_0_DROPPED] += msg_stats->node_stats.rx_dropped[0]; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_1_DROPPED] += msg_stats->node_stats.rx_dropped[1]; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_2_DROPPED] += msg_stats->node_stats.rx_dropped[2]; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_3_DROPPED] += msg_stats->node_stats.rx_dropped[3]; + + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_TX_PKTS] += msg_stats->node_stats.tx_packets; + nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_TX_BYTES] += msg_stats->node_stats.tx_bytes; + + spin_unlock_bh(&nss_qvpn_stats_lock); +} + +/* + * nss_qvpn_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_qvpn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_qvpn_stats_notification qvpn_stats; + + spin_lock_bh(&nss_qvpn_stats_lock); + qvpn_stats.core_id = nss_ctx->id; + qvpn_stats.if_num = if_num; + memcpy(qvpn_stats.stats_ctx, nss_qvpn_stats[if_num], sizeof(qvpn_stats.stats_ctx)); + spin_unlock_bh(&nss_qvpn_stats_lock); + + atomic_notifier_call_chain(&nss_qvpn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &qvpn_stats); +} + +/* + * nss_qvpn_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_qvpn_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_qvpn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_qvpn_stats_unregister_notifier); + +/* + * nss_qvpn_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_qvpn_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_qvpn_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_qvpn_stats_register_notifier); + /* * nss_qvpn_stats_dentry_create() * Create QVPN statistics debug entry. diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h index d9d3dc2fc..74bbe11de 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -17,10 +17,8 @@ #ifndef _NSS_QVPN_STATS_H_ #define _NSS_QVPN_STATS_H_ -/* - * nss_qvpn_stats_dentry_create - * Creates QVPN interface statistics debug entry. - */ -void nss_qvpn_stats_dentry_create(void); +extern void nss_qvpn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_qvpn_stats_tunnel_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); +extern void nss_qvpn_stats_dentry_create(void); #endif /* _NSS_QVPN_STATS_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c new file mode 100644 index 000000000..2af34aad4 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c @@ -0,0 +1,60 @@ +/* + ***************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_qvpn_strings.h" + +/* + * nss_qvpn_strings_stats + * qvpn statistics strings. + */ +struct nss_stats_info nss_qvpn_strings_stats[NSS_STATS_NODE_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_qvpn_strings_read() + * Read qvpn statistics names + */ +static ssize_t nss_qvpn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_qvpn_strings_stats, NSS_STATS_NODE_MAX); +} + +/* + * nss_qvpn_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(qvpn); + +/* + * nss_qvpn_strings_dentry_create() + * Create qvpn statistics strings debug entry. + */ +void nss_qvpn_strings_dentry_create(void) +{ + nss_strings_create_dentry("qvpn", &nss_qvpn_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h new file mode 100644 index 000000000..4b874d803 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h @@ -0,0 +1,27 @@ +/* + **************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + **************************************************************************** + */ + +#ifndef __NSS_QVPN_STRINGS_H +#define __NSS_QVPN_STRINGS_H + +#include "nss_qvpn_stats.h" + +extern struct nss_stats_info nss_qvpn_strings_stats[NSS_STATS_NODE_MAX]; +extern void nss_qvpn_strings_dentry_create(void); + +#endif /* __NSS_QVPN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c b/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c index adba8062a..c77ef3f3e 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c @@ -29,7 +29,7 @@ #define NSS_RMNET_RX_GET_INDEX(if_num) (if_num - NSS_DYNAMIC_IF_START) /* - * Spinlock to protect the global data structure virt_handle. + * Spinlock to protect the global data structure rmnet handle. */ DEFINE_SPINLOCK(nss_rmnet_rx_lock); @@ -524,6 +524,27 @@ error1: } EXPORT_SYMBOL(nss_rmnet_rx_create_sync_nexthop); +/* + * nss_rmnet_rx_create() + * Create rmnet_n2h and rmnet_h2n interfaces with generic next hops and associate it with same netdev. + * + * When rmnet and eth_rx is running at the same core, we directly send packets to eth_rx node. + * When they are running at different cores, the packets needs to arrive eth_rx through C2C. + */ +struct nss_rmnet_rx_handle *nss_rmnet_rx_create(struct net_device *netdev) +{ + uint32_t nexthop_n2h = NSS_N2H_INTERFACE; + uint32_t nexthop_h2n = NSS_C2C_TX_INTERFACE; + + if (nss_top_main.rmnet_rx_handler_id == 0) { + nexthop_h2n = NSS_ETH_RX_INTERFACE; + } + + + return nss_rmnet_rx_create_sync_nexthop(netdev, nexthop_n2h, nexthop_h2n); +} +EXPORT_SYMBOL(nss_rmnet_rx_create); + /* * nss_rmnet_rx_tx_buf() * HLOS interface has received a packet which we redirect to the NSS, if appropriate to do so. diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rps.c b/feeds/ipq807x/qca-nss-drv/src/nss_rps.c index 59a4e72d6..c2a603f2d 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rps.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_rps.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2013-2017, 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017, 2019-2021 The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -307,6 +307,7 @@ static nss_tx_status_t nss_rps_ipv4_hash_bitmap_cfg(struct nss_ctx_instance *nss return NSS_SUCCESS; } +#ifdef NSS_DRV_IPV6_ENABLE /* * nss_rps_ipv6_hash_bitmap_cfg() * Send Message to NSS to configure hash_bitmap. @@ -335,6 +336,7 @@ static nss_tx_status_t nss_rps_ipv6_hash_bitmap_cfg(struct nss_ctx_instance *nss up(&nss_rps_cfg_pvt.sem); return NSS_SUCCESS; } +#endif /* * nss_rps_pri_map_cfg() @@ -455,7 +457,7 @@ static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write, { struct nss_top_instance *nss_top = &nss_top_main; struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - int ret, ret_ipv4, ret_ipv6, current_state; + int ret, ret_ipv4, current_state; current_state = nss_rps_hash_bitmap; ret = proc_dointvec(ctl, write, buffer, lenp, ppos); @@ -479,17 +481,21 @@ static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write, return ret_ipv4; } - ret_ipv6 = nss_rps_ipv6_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap); +#ifdef NSS_DRV_IPV6_ENABLE + { + int ret_ipv6; + ret_ipv6 = nss_rps_ipv6_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap); - if (ret_ipv6 != NSS_SUCCESS) { - nss_warning("%px: ipv6 hash_bitmap config message failed\n", nss_ctx); - nss_rps_hash_bitmap = current_state; - if (nss_rps_ipv4_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap != NSS_SUCCESS)) { - nss_warning("%px: ipv4 and ipv6 have different hash_bitmaps.\n", nss_ctx); + if (ret_ipv6 != NSS_SUCCESS) { + nss_warning("%px: ipv6 hash_bitmap config message failed\n", nss_ctx); + nss_rps_hash_bitmap = current_state; + if (nss_rps_ipv4_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap != NSS_SUCCESS)) { + nss_warning("%px: ipv4 and ipv6 have different hash_bitmaps.\n", nss_ctx); + } + return ret_ipv6; } - return ret_ipv6; } - +#endif return 0; } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls.c index 6fda9c7f1..ff5336333 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tls.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,10 +18,10 @@ #include "nss_tx_rx_common.h" #include "nss_tls_log.h" +#include "nss_tls_stats.h" +#include "nss_tls_strings.h" #define NSS_TLS_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) -#define NSS_TLS_STATS_MAX_LINES (NSS_STATS_NODE_MAX + 32) -#define NSS_TLS_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_TLS_STATS_MAX_LINES) #define NSS_TLS_TX_TIMEOUT 3000 /* 3 Seconds */ /* @@ -34,93 +34,6 @@ static struct nss_tls_pvt { unsigned long if_map[NSS_TLS_INTERFACE_MAX_LONG]; } tls_pvt; -/* - * nss_tls_stats_sync() - * Update tls node statistics. - */ -static void nss_tls_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_tls_msg *ndcm = (struct nss_tls_msg *)ncm; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_tls_ctx_stats *msg_stats = &ndcm->msg.stats; - uint64_t *if_stats; - int i; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats, - * Note: TLS only supports a single queue for RX - */ - if_stats = nss_top->stats_node[ncm->interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->pkt.rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->pkt.rx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += msg_stats->pkt.rx_dropped[i]; - - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->pkt.tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->pkt.tx_bytes; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_tls_stats_read() - * Read tls node statiistics. - */ -static ssize_t nss_tls_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; - char *buf; - - size = NSS_TLS_STATS_SIZE_PER_IF * bitmap_weight(tls_pvt.if_map, NSS_MAX_NET_INTERFACES); - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Common node stats for each TLS dynamic interface. - */ - for_each_set_bit(if_num, tls_pvt.if_map, NSS_MAX_NET_INTERFACES) { - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - default: - len += scnprintf(buf + len, size - len, "\nUnknown(%d) if_num:%03u", type, if_num); - break; - } - - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len = nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "tls"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - kfree(buf); - - return bytes_read; -} - -/* - * nss_tls_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(tls) - /* * nss_tls_verify_ifnum() * Verify if the interface number is a TLS interface. @@ -167,8 +80,10 @@ static void nss_tls_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg return; } - if (ncm->type == NSS_TLS_MSG_TYPE_CTX_SYNC) + if (ncm->type == NSS_TLS_MSG_TYPE_CTX_SYNC) { nss_tls_stats_sync(nss_ctx, ncm); + nss_tls_stats_notify(nss_ctx, ncm->interface); + } /* * Update the callback and app_data for NOTIFY messages @@ -228,6 +143,15 @@ static void nss_tls_sync_resp(void *app_data, struct nss_cmn_msg *ncm) complete(&tls_pvt.complete); } +/* + * nss_tls_ifmap_get() + * Return TLS active interfaces map. + */ +unsigned long *nss_tls_ifmap_get(void) +{ + return tls_pvt.if_map; +} + /* * nss_tls_tx_buf() * Transmit buffer over TLS interface @@ -546,5 +470,6 @@ void nss_tls_register_handler(void) { sema_init(&tls_pvt.sem, 1); init_completion(&tls_pvt.complete); - nss_stats_create_dentry("tls", &nss_tls_stats_ops); + nss_tls_stats_dentry_create(); + nss_tls_strings_dentry_create(); } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c new file mode 100644 index 000000000..58082708e --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c @@ -0,0 +1,206 @@ +/* + ****************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ****************************************************************************** + */ + +#include "nss_core.h" +#include "nss_tls.h" +#include "nss_tls_stats.h" +#include "nss_tls_strings.h" + +/* + * Declare atomic notifier data structure for statistics. + */ +ATOMIC_NOTIFIER_HEAD(nss_tls_stats_notifier); + +/* + * Spinlock to protect tls statistics update/read + */ +DEFINE_SPINLOCK(nss_tls_stats_lock); + +uint64_t nss_tls_stats[NSS_MAX_NET_INTERFACES][NSS_TLS_STATS_MAX]; + +/* + * nss_tls_stats_iface_type() + * Return a string for each interface type. + */ +static const char *nss_tls_stats_iface_type(enum nss_dynamic_interface_type type) +{ + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER: + return "tls_inner"; + + case NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER: + return "tls_outer"; + + default: + return "invalid_interface"; + } +} + +/* + * nss_tls_stats_read() + * Read tls node statiistics. + */ +static ssize_t nss_tls_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + /* + * Max output lines = #stats + + * few blank lines for banner printing + Number of Extra outputlines + * for future reference to add new stats + */ + uint32_t max_output_lines = NSS_TLS_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; + struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); + enum nss_dynamic_interface_type type; + unsigned long *ifmap; + uint64_t *stats_shadow; + ssize_t bytes_read = 0; + size_t size_wr = 0; + uint32_t if_num; + int32_t i; + int count; + char *lbuf; + + ifmap = nss_tls_ifmap_get(); + count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); + if (count) { + size_al = size_al * count; + } + + lbuf = vzalloc(size_al); + if (unlikely(!lbuf)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return -ENOMEM; + } + + stats_shadow = vzalloc(NSS_TLS_STATS_MAX * 8); + if (unlikely(!stats_shadow)) { + nss_warning("Could not allocate memory for local shadow buffer"); + vfree(lbuf); + return -ENOMEM; + } + + /* + * Common node stats for each TLS dynamic interface. + */ + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "tls stats", NSS_STATS_SINGLE_CORE); + for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { + + type = nss_dynamic_interface_get_type(nss_ctx, if_num); + if ((type != NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER) && + (type != NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER)) { + continue; + } + + spin_lock_bh(&nss_tls_stats_lock); + for (i = 0; i < NSS_TLS_STATS_MAX; i++) { + stats_shadow[i] = nss_tls_stats[if_num][i]; + } + spin_unlock_bh(&nss_tls_stats_lock); + + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", + nss_tls_stats_iface_type(type), if_num); + size_wr += nss_stats_print("tls", NULL, NSS_STATS_SINGLE_INSTANCE, nss_tls_strings_stats, + stats_shadow, NSS_TLS_STATS_MAX, lbuf, size_wr, size_al); + } + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + vfree(lbuf); + vfree(stats_shadow); + return bytes_read; +} + +/* + * nss_tls_stats_ops + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(tls); + +/* + * nss_tls_stats_dentry_create() + * Create tls statistics debug entry. + */ +void nss_tls_stats_dentry_create(void) +{ + nss_stats_create_dentry("tls", &nss_tls_stats_ops); +} + +/* + * nss_tls_stats_sync() + * Update tls node statistics. + */ +void nss_tls_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) +{ + struct nss_tls_msg *ndcm = (struct nss_tls_msg *)ncm; + struct nss_tls_ctx_stats *ndccs = &ndcm->msg.stats; + uint64_t *ctx_stats; + uint32_t *msg_stats; + int i; + + spin_lock_bh(&nss_tls_stats_lock); + + /* + * Update common node stats, + * Note: TLS only supports a single queue for RX + */ + msg_stats = (uint32_t *)ndccs; + ctx_stats = nss_tls_stats[ncm->interface]; + + for (i = 0; i < NSS_TLS_STATS_MAX; i++, ctx_stats++, msg_stats++) { + *ctx_stats += *msg_stats; + } + + spin_unlock_bh(&nss_tls_stats_lock); +} + +/* + * nss_tls_stats_notify() + * Sends notifications to all the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_tls_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) +{ + struct nss_tls_stats_notification tls_stats; + + spin_lock_bh(&nss_tls_stats_lock); + tls_stats.core_id = nss_ctx->id; + tls_stats.if_num = if_num; + memcpy(tls_stats.stats_ctx, nss_tls_stats[if_num], sizeof(tls_stats.stats_ctx)); + spin_unlock_bh(&nss_tls_stats_lock); + + atomic_notifier_call_chain(&nss_tls_stats_notifier, NSS_STATS_EVENT_NOTIFY, &tls_stats); +} + +/* + * nss_tls_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_tls_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_tls_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_tls_stats_unregister_notifier); + +/* + * nss_tls_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_tls_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_tls_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_tls_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h new file mode 100644 index 000000000..3883f6297 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h @@ -0,0 +1,28 @@ +/* + ****************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ****************************************************************************** + */ + +#ifndef __NSS_TLS_STATS_H +#define __NSS_TLS_STATS_H + +#include + +extern void nss_tls_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); +extern void nss_tls_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); +extern void nss_tls_stats_dentry_create(void); + +#endif /* __NSS_TLS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c new file mode 100644 index 000000000..8c4854865 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c @@ -0,0 +1,88 @@ +/* + ****************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ****************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include "nss_strings.h" +#include "nss_tls_strings.h" + +/* + * nss_tls_strings_stats + * tls statistics strings. + */ +struct nss_stats_info nss_tls_strings_stats[NSS_TLS_STATS_MAX] = { + {"rx_pkts", NSS_STATS_TYPE_COMMON}, + {"rx_byts", NSS_STATS_TYPE_COMMON}, + {"tx_pkts", NSS_STATS_TYPE_COMMON}, + {"tx_byts", NSS_STATS_TYPE_COMMON}, + {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, + {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, + {"single_rec", NSS_STATS_TYPE_SPECIAL}, + {"multi_rec", NSS_STATS_TYPE_SPECIAL}, + {"tx_inval_reqs", NSS_STATS_TYPE_SPECIAL}, + {"rx_ccs_rec", NSS_STATS_TYPE_SPECIAL}, + {"fail_ccs", NSS_STATS_TYPE_ERROR}, + {"eth_node_deactive", NSS_STATS_TYPE_SPECIAL}, + {"crypto_alloc_success", NSS_STATS_TYPE_SPECIAL}, + {"crypto_free_req", NSS_STATS_TYPE_SPECIAL}, + {"crypto_free_success", NSS_STATS_TYPE_SPECIAL}, + {"fail_crypto_alloc", NSS_STATS_TYPE_EXCEPTION}, + {"fail_crypto_lookup", NSS_STATS_TYPE_EXCEPTION}, + {"fail_req_alloc", NSS_STATS_TYPE_ERROR}, + {"fail_pbuf_stats", NSS_STATS_TYPE_ERROR}, + {"fail_ctx_active", NSS_STATS_TYPE_ERROR}, + {"hw_len_error", NSS_STATS_TYPE_ERROR}, + {"hw_token_error", NSS_STATS_TYPE_ERROR}, + {"hw_bypass_error", NSS_STATS_TYPE_ERROR}, + {"hw_crypto_error", NSS_STATS_TYPE_ERROR}, + {"hw_hash_error", NSS_STATS_TYPE_ERROR}, + {"hw_config_error", NSS_STATS_TYPE_ERROR}, + {"hw_algo_error", NSS_STATS_TYPE_ERROR}, + {"hw_hash_ovf_error", NSS_STATS_TYPE_ERROR}, + {"hw_auth_error", NSS_STATS_TYPE_ERROR}, + {"hw_pad_verify_error", NSS_STATS_TYPE_ERROR}, + {"hw_timeout_error", NSS_STATS_TYPE_ERROR}, + {"no_desc_in", NSS_STATS_TYPE_EXCEPTION}, + {"no_desc_out", NSS_STATS_TYPE_EXCEPTION}, + {"no_reqs", NSS_STATS_TYPE_EXCEPTION} +}; + +/* + * nss_tls_strings_read() + * Read tls statistics names + */ +static ssize_t nss_tls_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_tls_strings_stats, NSS_TLS_STATS_MAX); +} + +/* + * nss_tls_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(tls); + +/* + * nss_tls_strings_dentry_create() + * Create tls statistics strings debug entry. + */ +void nss_tls_strings_dentry_create(void) +{ + nss_strings_create_dentry("tls", &nss_tls_strings_ops); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h similarity index 66% rename from feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.h rename to feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h index ffc1f83ea..1509722b0 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h @@ -1,9 +1,11 @@ /* ****************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. + * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR @@ -11,16 +13,15 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** + ****************************************************************************** */ -#ifndef __NSS_WIFI_IF_STATS_H -#define __NSS_WIFI_IF_STATS_H +#ifndef __NSS_TLS_STRINGS_H +#define __NSS_TLS_STRINGS_H -/* - * wifi interface statistics APIs - */ -extern void nss_wifi_if_stats_sync(struct nss_wifi_if_handle *handle, struct nss_wifi_if_stats *nwis); -extern void nss_wifi_if_stats_dentry_create(void); +#include "nss_tls_stats.h" -#endif /* __NSS_WIFI_IF_STATS_H */ +extern struct nss_stats_info nss_tls_strings_stats[NSS_TLS_STATS_MAX]; +extern void nss_tls_strings_dentry_create(void); + +#endif /* __NSS_TLS_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h b/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h index 7ace9ec5b..6e148c450 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h +++ b/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h @@ -99,6 +99,7 @@ extern void nss_ppe_vp_register_handler(void); extern void nss_wifi_mac_db_register_handler(void); extern void nss_wifi_ext_vdev_register_handler(void); extern void nss_wifili_thread_scheme_db_init(uint8_t core_id); +extern void nss_wifi_mesh_init(void); /* * nss_if_msg_handler() diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c new file mode 100755 index 000000000..eeab9ad03 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c @@ -0,0 +1,233 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +/* + * nss_udp_st.c + * NSS UDP_ST APIs + */ + +#include "nss_core.h" +#include "nss_udp_st_stats.h" +#include "nss_udp_st_strings.h" +#include "nss_udp_st_log.h" + +#define NSS_UDP_ST_TX_MSG_TIMEOUT 1000 /* 1 sec timeout for udp_st messages */ + +/* + * Private data structure for udp_st configuration + */ +struct nss_udp_st_pvt { + struct semaphore sem; /* Semaphore structure */ + struct completion complete; /* completion structure */ + int response; /* Response from FW */ + void *cb; /* Original cb for sync msgs */ + void *app_data; /* Original app_data for sync msgs */ +} nss_udp_st_pvt; + +/* + * nss_udp_st_msg_handler() + * Handle NSS -> HLOS messages for UDP_ST node + */ +static void nss_udp_st_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) +{ + struct nss_udp_st_msg *num = (struct nss_udp_st_msg *)ncm; + nss_udp_st_msg_callback_t cb; + + /* + * Is this a valid message type? + */ + if (num->cm.type >= NSS_UDP_ST_MAX_MSG_TYPES) { + nss_warning("%px: received invalid message %d for udp_st interface", nss_ctx, num->cm.type); + return; + } + + /* + * Log messages. + */ + nss_udp_st_log_rx_msg(num); + + switch (num->cm.type) { + case NSS_UDP_ST_STATS_SYNC_MSG: + /* + * Update driver statistics and send stats notifications to the registered modules. + */ + nss_udp_st_stats_sync(nss_ctx, &num->msg.stats); + break; + + case NSS_UDP_ST_RESET_STATS_MSG: + /* + * This is a response to the statistics reset message. + */ + nss_udp_st_stats_reset(NSS_UDP_ST_INTERFACE); + break; + default: + if (ncm->response != NSS_CMN_RESPONSE_ACK) { + /* + * Check response. + */ + nss_info("%px: Received response %d for type %d, interface %d", + nss_ctx, ncm->response, ncm->type, ncm->interface); + } + } + + /* + * Return for NOTIFY messages because there is no notifier functions. + */ + if (num->cm.response == NSS_CMN_RESPONSE_NOTIFY) { + return; + } + + /* + * Do we have a callback? + */ + if (!ncm->cb) { + return; + } + + /* + * Callback + */ + cb = (nss_udp_st_msg_callback_t)ncm->cb; + cb((void *)ncm->app_data, num); +} + +/* + * nss_udp_st_tx_sync_callback() + * Callback to handle the completion of synchronous tx messages. + */ +static void nss_udp_st_tx_sync_callback(void *app_data, struct nss_udp_st_msg *num) +{ + nss_udp_st_msg_callback_t callback = (nss_udp_st_msg_callback_t)nss_udp_st_pvt.cb; + void *data = nss_udp_st_pvt.app_data; + + nss_udp_st_pvt.cb = NULL; + nss_udp_st_pvt.app_data = NULL; + + if (num->cm.response != NSS_CMN_RESPONSE_ACK) { + nss_warning("udp_st error response %d\n", num->cm.response); + nss_udp_st_pvt.response = NSS_TX_FAILURE; + } else { + nss_udp_st_pvt.response = NSS_TX_SUCCESS; + } + + if (callback) { + callback(data, num); + } + + complete(&nss_udp_st_pvt.complete); +} + +/* + * nss_udp_st_tx() + * Transmit a udp_st message to the FW. + */ +nss_tx_status_t nss_udp_st_tx(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num) +{ + struct nss_cmn_msg *ncm = &num->cm; + + /* + * Sanity check the message + */ + if (ncm->interface != NSS_UDP_ST_INTERFACE) { + nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); + return NSS_TX_FAILURE; + } + + if (ncm->type >= NSS_UDP_ST_MAX_MSG_TYPES) { + nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); + return NSS_TX_FAILURE; + } + + /* + * Trace messages. + */ + nss_udp_st_log_tx_msg(num); + + return nss_core_send_cmd(nss_ctx, num, sizeof(*num), NSS_NBUF_PAYLOAD_SIZE); +} +EXPORT_SYMBOL(nss_udp_st_tx); + +/* + * nss_udp_st_tx_sync() + * Transmit a synchronous udp_st message to the FW. + */ +nss_tx_status_t nss_udp_st_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num) +{ + nss_tx_status_t status; + int ret = 0; + + down(&nss_udp_st_pvt.sem); + nss_udp_st_pvt.cb = (void *)num->cm.cb; + nss_udp_st_pvt.app_data = (void *)num->cm.app_data; + + num->cm.cb = (nss_ptr_t)nss_udp_st_tx_sync_callback; + num->cm.app_data = (nss_ptr_t)NULL; + + status = nss_udp_st_tx(nss_ctx, num); + if (status != NSS_TX_SUCCESS) { + nss_warning("%px: nss udp_st msg tx failed\n", nss_ctx); + up(&nss_udp_st_pvt.sem); + return status; + } + + ret = wait_for_completion_timeout(&nss_udp_st_pvt.complete, msecs_to_jiffies(NSS_UDP_ST_TX_MSG_TIMEOUT)); + if (!ret) { + nss_warning("%px: udp_st tx sync failed due to timeout\n", nss_ctx); + nss_udp_st_pvt.response = NSS_TX_FAILURE; + } + + status = nss_udp_st_pvt.response; + up(&nss_udp_st_pvt.sem); + return status; +} +EXPORT_SYMBOL(nss_udp_st_tx_sync); + +/* + * nss_udp_st_msg_init() + * Initialize udp_st message. + */ +void nss_udp_st_msg_init(struct nss_udp_st_msg *num, uint16_t if_num, uint32_t type, uint32_t len, + nss_udp_st_msg_callback_t cb, void *app_data) +{ + nss_cmn_msg_init(&num->cm, if_num, type, len, (void *)cb, app_data); +} +EXPORT_SYMBOL(nss_udp_st_msg_init); + +/* + * nss_udp_st_register_handler() + */ +void nss_udp_st_register_handler(struct nss_ctx_instance *nss_ctx) +{ + nss_core_register_handler(nss_ctx, NSS_UDP_ST_INTERFACE, nss_udp_st_msg_handler, NULL); + + nss_udp_st_stats_dentry_create(); + nss_udp_st_strings_dentry_create(); + + sema_init(&nss_udp_st_pvt.sem, 1); + init_completion(&nss_udp_st_pvt.complete); +} + +/* + * nss_udp_st_get_mgr() + * + */ +struct nss_ctx_instance *nss_udp_st_get_mgr(void) +{ + return (void *)&nss_top_main.nss[nss_top_main.udp_st_handler_id]; +} +EXPORT_SYMBOL(nss_udp_st_get_mgr); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c new file mode 100644 index 000000000..bd4e07b20 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c @@ -0,0 +1,254 @@ +/* + ************************************************************************** + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +/* + * nss_udp_st_log.c + * NSS UDP Speedtest logger file. + */ + +#include "nss_core.h" + +/* + * nss_udp_st_log_message_types_str + * udp_st message strings + */ +static int8_t *nss_udp_st_log_message_types_str[NSS_UDP_ST_MAX_MSG_TYPES] __maybe_unused = { + "UDP_ST Start Msg", + "UDP_ST Stop Msg", + "UDP_ST Configure Rule Msg", + "UDP_ST Unconfigure Rule Msg", + "UDP_ST Stats Sync Msg", + "UDP_ST TX Create Msg", + "UDP_ST TX Destroy Msg", + "UDP_ST Reset Stats Msg", +}; + +/* + * nss_udp_st_log_error_response_types_str + * Strings for error types for udp_st messages + */ +static int8_t *nss_udp_st_log_error_response_types_str[NSS_UDP_ST_ERROR_MAX] __maybe_unused = { + "UDP_ST No Error", + "UDP_ST Incorrect Rate", + "UDP_ST Incorrect Buffer Size", + "UDP_ST Memory Failure", + "UDP_ST Incorrect State", + "UDP_ST Incorrect Flags", + "UDP_ST Entry Exist", + "UDP_ST Entry Add Failed", + "UDP_ST Entry Not Exist", + "UDP_ST Wrong Start Msg Type", + "UDP_ST Wrong Stop Msg Type", + "UDP_ST Too Many Users", + "UDP_ST Unknown Msg Type", + "UDP_ST Pbuf Alloc Failure", + "UDP_ST Pbuf Size Failure", + "UDP_ST Drop Queue", + "UDP_ST Timer call missed", +}; + +/* + * nss_udp_st_log_tx_create_destroy_msg() + * Log NSS udp_st Tx create/destroy message. + */ +static void nss_udp_st_log_tx_create_destroy_msg(struct nss_udp_st_msg *num, uint8_t *msg_type) +{ + struct nss_udp_st_tx_create *create __maybe_unused = &num->msg.create; + nss_trace("%px: NSS udp_st message: %s\n" + "Rate: %u\n" + "Buffer Size: %u\n" + "DSCP: %u\n", + create, + msg_type, + create->rate, + create->buffer_size, + create->dscp); +} + +/* + * nss_udp_st_log_uncfg_rule_msg() + * Log NSS udp_st unconfig rule message. + */ +static void nss_udp_st_log_uncfg_rule_msg(struct nss_udp_st_msg *num) +{ + struct nss_udp_st_cfg *uncfg __maybe_unused = &num->msg.uncfg; + nss_trace("%px: NSS udp_st message: Unconfig\n" + "IP version: %u\n", + uncfg, + uncfg->ip_version); + + if (uncfg->ip_version == NSS_UDP_ST_FLAG_IPV4) { + nss_trace("Src IP: %pI4\n" + "Dest IP: %pI4\n", + &(uncfg->src_ip.ip.ipv4), + &(uncfg->dest_ip.ip.ipv4)); + } else { + nss_trace("Src IP: %pI6\n" + "Dest IP: %pI6\n", + &(uncfg->src_ip.ip.ipv6), + &(uncfg->dest_ip.ip.ipv6)); + } + + nss_trace("Src Port: %u\n Dest Port: %u\n Type: %u\n", + uncfg->src_port, uncfg->dest_port, uncfg->type); +} + +/* + * nss_udp_st_log_cfg_rule_msg() + * Log NSS udp_st config rule message. + */ +static void nss_udp_st_log_cfg_rule_msg(struct nss_udp_st_msg *num) +{ + struct nss_udp_st_cfg *cfg __maybe_unused = &num->msg.cfg; + nss_trace("%px: NSS udp_st message: Config\n" + "IP version: %u\n", + cfg, + cfg->ip_version); + + if (cfg->ip_version == NSS_UDP_ST_FLAG_IPV4) { + nss_trace("Src IP: %pI4\n" + "Dest IP: %pI4\n", + &(cfg->src_ip.ip.ipv4), + &(cfg->dest_ip.ip.ipv4)); + } else { + nss_trace("Src IP: %pI6\n" + "Dest IP: %pI6\n", + &(cfg->src_ip.ip.ipv6), + &(cfg->dest_ip.ip.ipv6)); + } + + nss_trace("Src Port: %u\n Dest Port: %u\n Type: %u\n", + cfg->src_port, cfg->dest_port, cfg->type); +} + +/* + * nss_udp_st_log_stop_msg() + * Log NSS udp_st stop message. + */ +static void nss_udp_st_log_stop_msg(struct nss_udp_st_msg *num) +{ + struct nss_udp_st_stop *stop __maybe_unused = &num->msg.stop; + nss_trace("%px: NSS udp_st message: Stop\n" + "Type: %u\n", + stop, + stop->type); +} + +/* + * nss_udp_st_log_start_msg() + * Log NSS udp_st start message. + */ +static void nss_udp_st_log_start_msg(struct nss_udp_st_msg *num) +{ + struct nss_udp_st_start *start __maybe_unused = &num->msg.start; + nss_trace("%px: NSS udp_st message: Start\n" + "Type: %u\n", + start, + start->type); +} + +/* + * nss_udp_st_log_verbose() + * Log message contents. + */ +static void nss_udp_st_log_verbose(struct nss_udp_st_msg *num) +{ + switch (num->cm.type) { + case NSS_UDP_ST_START_MSG: + nss_udp_st_log_start_msg(num); + break; + + case NSS_UDP_ST_STOP_MSG: + nss_udp_st_log_stop_msg(num); + break; + + case NSS_UDP_ST_CFG_RULE_MSG: + nss_udp_st_log_cfg_rule_msg(num); + break; + + case NSS_UDP_ST_UNCFG_RULE_MSG: + nss_udp_st_log_uncfg_rule_msg(num); + break; + + case NSS_UDP_ST_TX_CREATE_MSG: + nss_udp_st_log_tx_create_destroy_msg(num, "Create"); + break; + + case NSS_UDP_ST_TX_DESTROY_MSG: + nss_udp_st_log_tx_create_destroy_msg(num, "Destroy"); + break; + + case NSS_UDP_ST_RESET_STATS_MSG: + case NSS_UDP_ST_STATS_SYNC_MSG: + break; + + default: + nss_trace("%px: Invalid message type\n", num); + break; + } +} + +/* + * nss_udp_st_log_tx_msg() + * Log messages transmitted to FW. + */ +void nss_udp_st_log_tx_msg(struct nss_udp_st_msg *num) +{ + if (num->cm.type >= NSS_UDP_ST_MAX_MSG_TYPES) { + nss_warning("%px: Invalid message type\n", num); + return; + } + + nss_info("%px: type[%d]:%s\n", num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type]); + nss_udp_st_log_verbose(num); +} + +/* + * nss_udp_st_log_rx_msg() + * Log messages received from FW. + */ +void nss_udp_st_log_rx_msg(struct nss_udp_st_msg *num) +{ + if (num->cm.response >= NSS_CMN_RESPONSE_LAST) { + nss_warning("%px: Invalid response\n", num); + return; + } + + if (num->cm.response == NSS_CMN_RESPONSE_NOTIFY || (num->cm.response == NSS_CMN_RESPONSE_ACK)) { + nss_info("%px: type[%d]:%s, response[%d]:%s\n", num, num->cm.type, + nss_udp_st_log_message_types_str[num->cm.type], + num->cm.response, nss_cmn_response_str[num->cm.response]); + goto verbose; + } + + if (num->cm.error >= NSS_UDP_ST_ERROR_MAX) { + nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", + num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type], + num->cm.response, nss_cmn_response_str[num->cm.response], + num->cm.error); + goto verbose; + } + + nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", + num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type], + num->cm.response, nss_cmn_response_str[num->cm.response], + num->cm.error, nss_udp_st_log_error_response_types_str[num->cm.error]); + +verbose: + nss_udp_st_log_verbose(num); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h new file mode 100644 index 000000000..fa2a551fb --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h @@ -0,0 +1,39 @@ +/* + ****************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * **************************************************************************** + */ + +#ifndef __NSS_UDP_ST_LOG_H__ +#define __NSS_UDP_ST_LOG_H__ + +/* + * nss_udp_st_log.h + * NSS UDP Speedtest Log Header File. + */ + +/* + * nss_udp_st_log_tx_msg + * Logs a udp_st message that is sent to the NSS firmware. + */ +void nss_udp_st_log_tx_msg(struct nss_udp_st_msg *num); + +/* + * nss_udp_st_log_rx_msg + * Logs a udp_st message that is received from the NSS firmware. + */ +void nss_udp_st_log_rx_msg(struct nss_udp_st_msg *num); + +#endif /* __NSS_UDP_ST_LOG_H__*/ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c new file mode 100755 index 000000000..0fee47b2e --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c @@ -0,0 +1,178 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_core.h" +#include "nss_udp_st_stats.h" +#include "nss_udp_st_strings.h" + +uint32_t nss_udp_st_errors[NSS_UDP_ST_ERROR_MAX]; +uint32_t nss_udp_st_stats_time[NSS_UDP_ST_TEST_MAX][NSS_UDP_ST_STATS_TIME_MAX]; + +/* + * nss_udp_st_stats_read() + * Read UDP_ST stats. + */ +static ssize_t nss_udp_st_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + /* + * Max output lines = #stats * NSS_MAX_CORES + + * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats + */ + uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_UDP_ST_ERROR_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; + size_t size_wr = 0; + ssize_t bytes_read = 0; + uint64_t *stats_shadow; + uint32_t i; + + char *lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(lbuf == NULL)) { + nss_warning("Could not allocate memory for local statistics buffer"); + return 0; + } + + /* + * Note: The assumption here is that we do not have more than 64 stats. + */ + stats_shadow = kzalloc(64 * 8, GFP_KERNEL); + if (unlikely(stats_shadow == NULL)) { + nss_warning("Could not allocate memory for local shadow buffer"); + kfree(lbuf); + return 0; + } + + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "udp_st", NSS_STATS_SINGLE_CORE); + + size_wr += nss_stats_fill_common_stats(NSS_UDP_ST_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "udp_st"); + + /* + * Error stats + */ + spin_lock_bh(&nss_top_main.stats_lock); + for (i = 0; (i < NSS_UDP_ST_ERROR_MAX); i++) { + stats_shadow[i] = nss_udp_st_errors[i]; + } + spin_unlock_bh(&nss_top_main.stats_lock); + size_wr += nss_stats_print("udp_st", "udp_st error stats" + , NSS_STATS_SINGLE_INSTANCE + , nss_udp_st_strings_error_stats + , stats_shadow + , NSS_UDP_ST_ERROR_MAX + , lbuf, size_wr, size_al); + + /* + * Rx time stats + */ + spin_lock_bh(&nss_top_main.stats_lock); + for (i = 0; (i < NSS_UDP_ST_STATS_TIME_MAX); i++) { + stats_shadow[i] = nss_udp_st_stats_time[NSS_UDP_ST_TEST_RX][i]; + } + spin_unlock_bh(&nss_top_main.stats_lock); + size_wr += nss_stats_print("udp_st", "udp_st Rx time stats (ms)" + , NSS_STATS_SINGLE_INSTANCE + , nss_udp_st_strings_rx_time_stats + , stats_shadow + , NSS_UDP_ST_STATS_TIME_MAX + , lbuf, size_wr, size_al); + + /* + * Tx time stats + */ + spin_lock_bh(&nss_top_main.stats_lock); + for (i = 0; (i < NSS_UDP_ST_STATS_TIME_MAX); i++) { + stats_shadow[i] = nss_udp_st_stats_time[NSS_UDP_ST_TEST_TX][i]; + } + spin_unlock_bh(&nss_top_main.stats_lock); + size_wr += nss_stats_print("udp_st", "udp_st Tx time stats (ms)" + , NSS_STATS_SINGLE_INSTANCE + , nss_udp_st_strings_tx_time_stats + , stats_shadow + , NSS_UDP_ST_STATS_TIME_MAX + , lbuf, size_wr, size_al); + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); + kfree(lbuf); + kfree(stats_shadow); + + return bytes_read; +} + +/* + * nss_udp_st_stats_ops. + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(udp_st); + +/* + * nss_udp_st_stats_dentry_create() + * Create udp_st statistics debug entry. + */ +void nss_udp_st_stats_dentry_create(void) +{ + nss_stats_create_dentry("udp_st", &nss_udp_st_stats_ops); +} + +/* + * nss_udp_st_stats_reset() + * Reset the udp_st statistics. + */ +void nss_udp_st_stats_reset(uint32_t if_num) +{ + uint32_t i; + + /* + * Reset common node stats. + */ + nss_stats_reset_common_stats(if_num); + + /* + * Reset error stats. + */ + spin_lock_bh(&nss_top_main.stats_lock); + for (i = 0; i < NSS_UDP_ST_ERROR_MAX; i++) { + nss_udp_st_errors[i] = 0; + } + spin_unlock_bh(&nss_top_main.stats_lock); +} + +/* + * nss_udp_st_stats_sync() + * Handle the syncing of UDP_ST node statistics. + */ +void nss_udp_st_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_stats *nus) +{ + struct nss_top_instance *nss_top = nss_ctx->nss_top; + uint32_t i, j; + + spin_lock_bh(&nss_top->stats_lock); + + nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nus->nstats.node_stats.rx_packets; + nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nus->nstats.node_stats.rx_bytes; + nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nus->nstats.node_stats.tx_packets; + nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nus->nstats.node_stats.tx_bytes; + + for (i = 0; i < NSS_UDP_ST_ERROR_MAX; i++) { + nss_udp_st_errors[i] += nus->nstats.errors[i]; + } + + for (i = 0; i < NSS_UDP_ST_TEST_MAX; i++) { + for (j = 0; j < NSS_UDP_ST_STATS_TIME_MAX; j++) { + nss_udp_st_stats_time[i][j] = nus->time_stats[i][j]; + } + } + spin_unlock_bh(&nss_top->stats_lock); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h new file mode 100755 index 000000000..86b387da8 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h @@ -0,0 +1,36 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_UDP_ST_STATS_H +#define __NSS_UDP_ST_STATS_H + +#include + +/* + * nss_udp_st_stats.h + * NSS driver UDP_ST statistics header file. + */ + +/* + * udp_st statistics APIs + */ +extern void nss_udp_st_stats_reset(uint32_t if_num); +extern void nss_udp_st_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_stats *nus); +extern void nss_udp_st_stats_dentry_create(void); + +#endif /* __NSS_UDP_ST_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c new file mode 100644 index 000000000..3b67b13b9 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c @@ -0,0 +1,151 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include +#include "nss_strings.h" + +/* + * nss_udp_st_strings_error_stats + * Statistics strings for udp_st errors. + */ +struct nss_stats_info nss_udp_st_strings_error_stats[NSS_UDP_ST_ERROR_MAX] = { + {"error_none" , NSS_STATS_TYPE_SPECIAL}, + {"incorrect_rate" , NSS_STATS_TYPE_DROP}, + {"incorrect_buffer_size" , NSS_STATS_TYPE_DROP}, + {"memory_failure" , NSS_STATS_TYPE_DROP}, + {"incorrect_state" , NSS_STATS_TYPE_DROP}, + {"incorrect_flags" , NSS_STATS_TYPE_DROP}, + {"entry_exist" , NSS_STATS_TYPE_DROP}, + {"entry_add_failed" , NSS_STATS_TYPE_DROP}, + {"entry_not_exist" , NSS_STATS_TYPE_DROP}, + {"wrong_start_msg_type" , NSS_STATS_TYPE_DROP}, + {"wrong_stop_msg_type" , NSS_STATS_TYPE_DROP}, + {"too_many_users" , NSS_STATS_TYPE_DROP}, + {"unknown_msg_type" , NSS_STATS_TYPE_DROP}, + {"pb_alloc_failure" , NSS_STATS_TYPE_DROP}, + {"pb_size_failure" , NSS_STATS_TYPE_DROP}, + {"drop_queue_failure" , NSS_STATS_TYPE_DROP}, + {"timer call is missed" , NSS_STATS_TYPE_SPECIAL}, +}; + +/* + * nss_udp_st_strings_rx_time_stats + * Statistics strings for Rx udp_st time. + */ +struct nss_stats_info nss_udp_st_strings_rx_time_stats[NSS_UDP_ST_STATS_TIME_MAX] = { + {"rx_start_time" , NSS_STATS_TYPE_SPECIAL}, + {"rx_current_time" , NSS_STATS_TYPE_SPECIAL}, + {"rx_elapsed_time" , NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_udp_st_strings_tx_time_stats + * Statistics strings for Tx udp_st time. + */ +struct nss_stats_info nss_udp_st_strings_tx_time_stats[NSS_UDP_ST_STATS_TIME_MAX] = { + {"tx_start_time" , NSS_STATS_TYPE_SPECIAL}, + {"tx_current_time" , NSS_STATS_TYPE_SPECIAL}, + {"tx_elapsed_time" , NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_udp_st_error_stats_strings_read() + * Read udp_st error statistics names. + */ +static ssize_t nss_udp_st_error_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_error_stats, NSS_UDP_ST_ERROR_MAX); +} + +/* + * nss_udp_st_rx_time_stats_strings_read() + * Read Rx udp_st time statistics names. + */ +static ssize_t nss_udp_st_rx_time_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_rx_time_stats, NSS_UDP_ST_STATS_TIME_MAX); +} + +/* + * nss_udp_st_tx_time_stats_strings_read() + * Read Tx udp_st time statistics names. + */ +static ssize_t nss_udp_st_tx_time_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_tx_time_stats, NSS_UDP_ST_STATS_TIME_MAX); +} + +/* + * nss_udp_st_error_stats_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_error_stats); + +/* + * nss_udp_st_rx_time_stats_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_rx_time_stats); + +/* + * nss_udp_st_tx_time_stats_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_tx_time_stats); + +/* + * nss_udp_st_strings_dentry_create() + * Create udp_st statistics strings debug entry. + */ +void nss_udp_st_strings_dentry_create(void) +{ + struct dentry *dir_d; + struct dentry *file_d; + + if (!nss_top_main.strings_dentry) { + nss_warning("qca-nss-drv/strings is not present"); + return; + } + + dir_d = debugfs_create_dir("udp_st", nss_top_main.strings_dentry); + if (!dir_d) { + nss_warning("Failed to create qca-nss-drv/strings/udp_st directory"); + return; + } + + file_d = debugfs_create_file("error_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_error_stats_strings_ops); + if (!file_d) { + nss_warning("Failed to create qca-nss-drv/stats/udp_st/error_stats_str file"); + goto fail; + } + + file_d = debugfs_create_file("rx_time_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_rx_time_stats_strings_ops); + if (!file_d) { + nss_warning("Failed to create qca-nss-drv/stats/udp_st/rx_time_stats_str file"); + goto fail; + } + + file_d = debugfs_create_file("tx_time_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_tx_time_stats_strings_ops); + if (!file_d) { + nss_warning("Failed to create qca-nss-drv/stats/udp_st/tx_time_stats_str file"); + goto fail; + } + + return; +fail: + debugfs_remove_recursive(dir_d); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h new file mode 100644 index 000000000..6f5b513cf --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h @@ -0,0 +1,28 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_UDP_ST_STRINGS_H +#define __NSS_UDP_ST_STRINGS_H + +extern struct nss_stats_info nss_udp_st_strings_error_stats[NSS_UDP_ST_ERROR_MAX]; +extern struct nss_stats_info nss_udp_st_strings_rx_time_stats[NSS_UDP_ST_STATS_TIME_MAX]; +extern struct nss_stats_info nss_udp_st_strings_tx_time_stats[NSS_UDP_ST_STATS_TIME_MAX]; + +extern void nss_udp_st_strings_dentry_create(void); + +#endif /* __NSS_UDP_ST_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c index fce92d9fb..bb2723906 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c @@ -43,6 +43,7 @@ static bool nss_wifi_ext_vdev_verify_if_num(uint32_t if_num) switch (type) { case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS: + case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN: return true; default: return false; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c index b04c41027..7fd188860 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c @@ -23,15 +23,19 @@ #include "nss_core.h" +#define NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(type) ((type) - NSS_IF_MAX_MSG_TYPES) + /* * nss_wifi_ext_vdev_log_message_types_str * NSS WiFi extended VAP message strings */ static int8_t *nss_wifi_ext_vdev_log_message_types_str[NSS_WIFI_EXT_VDEV_MSG_MAX] __maybe_unused = { + "WiFi Common I/F Message", "WiFi Extendev VAP configure", "WiFi Extendev VAP configure wds", "WiFi Extendev VAP configure next hop", - "WiFi Extendev VAP stats" + "WiFi Extendev VAP stats", + "WiFi Extended VAP configure VLAN" }; /* @@ -43,7 +47,7 @@ static void nss_wifi_ext_vdev_log_configure_if_msg(struct nss_wifi_ext_vdev_msg struct nss_wifi_ext_vdev_configure_if_msg *cmsg __maybe_unused = &nwevm->msg.cmsg; nss_trace("%px: WiFi extended VAP configure message \n" "Mac address: %pM\n" - "Radion interface num: %d\n" + "Radio interface num: %d\n" "Parent VAP interface num: %d\n", cmsg, cmsg->mac_addr, cmsg->radio_ifnum, cmsg->pvap_ifnum); @@ -76,6 +80,52 @@ static void nss_wifi_ext_vdev_set_nxt_hop_msg(struct nss_wifi_ext_vdev_msg *nwev wnhm, wnhm->if_num); } + +/* + * nss_wifi_ext_vdev_linkup_msg() + * Log NSS linkup message. + */ +static void nss_wifi_ext_vdev_linkup_msg(struct nss_wifi_ext_vdev_msg *nwevm) +{ + union nss_if_msgs *if_msg __maybe_unused = &nwevm->msg.if_msg; + nss_trace("%px: NSS WiFi ext linkup message\n", if_msg); +} + +/* + * nss_wifi_ext_vdev_linkdown_msg() + * Log NSS linkdown message. + */ +static void nss_wifi_ext_vdev_linkdown_msg(struct nss_wifi_ext_vdev_msg *nwevm) +{ + union nss_if_msgs *if_msg __maybe_unused = &nwevm->msg.if_msg; + nss_trace("%px: NSS WiFi ext linkdown message\n", if_msg); +} + +/* + * nss_wifi_ext_vdev_macaddr_set_msg() + * Set/Change the mac address + */ +static void nss_wifi_ext_vdev_macaddr_set_msg(struct nss_wifi_ext_vdev_msg *nwevm) +{ + union nss_if_msgs *if_msg = &nwevm->msg.if_msg; + struct nss_if_mac_address_set *nimas __maybe_unused = &if_msg->mac_address_set; + nss_trace("%px: NSS WiFi ext change mac addr: \n" + "mac addr %pM\n", + nimas, nimas->mac_addr); +} + +/* + * nss_wifi_ext_vdev_log_vlan_msg() + * Configure vlan message. + */ +static void nss_wifi_ext_vdev_log_vlan_msg(struct nss_wifi_ext_vdev_msg *nwevm) +{ + struct nss_wifi_ext_vdev_vlan_msg *vmsg __maybe_unused = &nwevm->msg.vmsg; + nss_trace("%px: NSS WiFi extended VAP vlan message: \n" + "vlan ID %hu\n", + vmsg, vmsg->vlan_id); +} + /* * nss_wifi_ext_vdev_log_verbose() * Log message contents. @@ -98,6 +148,22 @@ static void nss_wifi_ext_vdev_log_verbose(struct nss_wifi_ext_vdev_msg *nwevm) case NSS_WIFI_EXT_VDEV_MSG_STATS_SYNC: break; + case NSS_IF_OPEN: + nss_wifi_ext_vdev_linkup_msg(nwevm); + break; + + case NSS_IF_CLOSE: + nss_wifi_ext_vdev_linkdown_msg(nwevm); + break; + + case NSS_IF_MAC_ADDR_SET: + nss_wifi_ext_vdev_macaddr_set_msg(nwevm); + break; + + case NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_VLAN: + nss_wifi_ext_vdev_log_vlan_msg(nwevm); + break; + default: nss_trace("%px: Invalid message type\n", nwevm); break; @@ -110,12 +176,16 @@ static void nss_wifi_ext_vdev_log_verbose(struct nss_wifi_ext_vdev_msg *nwevm) */ void nss_wifi_ext_vdev_log_tx_msg(struct nss_wifi_ext_vdev_msg *nwevm) { + uint32_t type_idx = 0; if (nwevm->cm.type >= NSS_WIFI_EXT_VDEV_MSG_MAX) { nss_warning("%px: Invalid message type\n", nwevm); return; } - nss_info("%px: type[%d]:%s\n", nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[nwevm->cm.type]); + type_idx = (nwevm->cm.type > NSS_IF_MAX_MSG_TYPES) ? + (NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(nwevm->cm.type)) : 0; + + nss_info("%px: type[%d]:%s\n", nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[type_idx]); nss_wifi_ext_vdev_log_verbose(nwevm); } @@ -125,20 +195,24 @@ void nss_wifi_ext_vdev_log_tx_msg(struct nss_wifi_ext_vdev_msg *nwevm) */ void nss_wifi_ext_vdev_log_rx_msg(struct nss_wifi_ext_vdev_msg *nwevm) { + uint32_t type_idx = 0; if (nwevm->cm.response >= NSS_CMN_RESPONSE_LAST) { nss_warning("%px: Invalid response\n", nwevm); return; } + type_idx = (nwevm->cm.type > NSS_IF_MAX_MSG_TYPES) ? + (NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(nwevm->cm.type)) : 0; + if (nwevm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nwevm->cm.response == NSS_CMN_RESPONSE_ACK)) { nss_info("%px: type[%d]:%s, response[%d]:%s\n", nwevm, nwevm->cm.type, - nss_wifi_ext_vdev_log_message_types_str[nwevm->cm.type], + nss_wifi_ext_vdev_log_message_types_str[type_idx], nwevm->cm.response, nss_cmn_response_str[nwevm->cm.response]); goto verbose; } nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[nwevm->cm.type], + nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[type_idx], nwevm->cm.response, nss_cmn_response_str[nwevm->cm.response]); verbose: diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if.c deleted file mode 100644 index ba492802f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if.c +++ /dev/null @@ -1,516 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifi_if.c - * NSS wifi/redirect handler APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_wifi_if_stats.h" -#include - -#define NSS_WIFI_IF_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_WIFI_IF_GET_INDEX(if_num) (if_num-NSS_DYNAMIC_IF_START) - -extern int nss_ctl_redirect; - -/* - * Data structure that holds the wifi interface context. - */ -struct nss_wifi_if_handle *wifi_handle[NSS_MAX_DYNAMIC_INTERFACES]; - -/* - * Spinlock to protect the global data structure wifi_handle. - */ -DEFINE_SPINLOCK(wifi_if_lock); - -/* - * nss_wifi_if_msg_handler() - * Handle NSS -> HLOS messages for wifi interface - */ -static void nss_wifi_if_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - struct nss_wifi_if_msg *nwim = (struct nss_wifi_if_msg *)ncm; - int32_t if_num; - - nss_wifi_if_msg_callback_t cb; - struct nss_wifi_if_handle *handle = NULL; - - /* - * Sanity check the message type - */ - if (ncm->type >= NSS_WIFI_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", - nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_if_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - if (!NSS_IS_IF_TYPE(DYNAMIC, ncm->interface)) { - nss_warning("%px: response for another interface: %d", nss_ctx, ncm->interface); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - if_num = NSS_WIFI_IF_GET_INDEX(ncm->interface); - - spin_lock_bh(&wifi_if_lock); - if (!wifi_handle[if_num]) { - spin_unlock_bh(&wifi_if_lock); - nss_warning("%px: wifi_if handle is NULL\n", nss_ctx); - return; - } - - handle = wifi_handle[if_num]; - spin_unlock_bh(&wifi_if_lock); - - switch (nwim->cm.type) { - case NSS_WIFI_IF_STATS_SYNC_MSG: - nss_wifi_if_stats_sync(handle, &nwim->msg.stats); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (nwim->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)handle->cb; - ncm->app_data = (nss_ptr_t)handle->app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - nss_warning("cb is NULL\n"); - return; - } - - /* - * Callback - */ - cb = (nss_wifi_if_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_wifi_if_register_handler() - * Register the message handler & initialize semaphore & completion for the * interface if_num - */ -static uint32_t nss_wifi_if_register_handler(struct nss_wifi_if_handle *handle) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.wlan_handler_id]; - uint32_t ret; - struct nss_wifi_if_pvt *nwip = NULL; - int32_t if_num = handle->if_num; - - ret = nss_core_register_handler(nss_ctx, if_num, nss_wifi_if_msg_handler, NULL); - - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%d: Message handler failed to be registered for interface ret %d\n", if_num, ret); - return NSS_WIFI_IF_CORE_FAILURE; - } - - nwip = handle->pvt; - if (!nwip->sem_init_done) { - sema_init(&nwip->sem, 1); - init_completion(&nwip->complete); - nwip->sem_init_done = 1; - } - - nss_wifi_if_stats_dentry_create(); - return NSS_WIFI_IF_SUCCESS; -} - -/* - * nss_wifi_if_callback - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_wifi_if_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_wifi_if_handle *handle = (struct nss_wifi_if_handle *)app_data; - struct nss_wifi_if_pvt *nwip = handle->pvt; - - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: wifi_if Error response %d\n", - handle->nss_ctx, ncm->response); - nwip->response = NSS_TX_FAILURE; - complete(&nwip->complete); - return; - } - - nwip->response = NSS_TX_SUCCESS; - complete(&nwip->complete); -} - -/* - * nss_wifi_if_tx_msg() - * Send a message from HLOS to NSS asynchronously. - */ -nss_tx_status_t nss_wifi_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_if_msg *nwim) -{ - struct nss_cmn_msg *ncm = &nwim->cm; - - if (ncm->type > NSS_WIFI_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, nwim, sizeof(*nwim), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_wifi_if_tx_msg_sync - * Send a message from HLOS to NSS synchronously. - */ -static nss_tx_status_t nss_wifi_if_tx_msg_sync(struct nss_wifi_if_handle *handle, - struct nss_wifi_if_msg *nwim) -{ - nss_tx_status_t status; - int ret = 0; - struct nss_wifi_if_pvt *nwip = handle->pvt; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - - down(&nwip->sem); - - status = nss_wifi_if_tx_msg(nss_ctx, nwim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_wifi_if_msg failed\n", nss_ctx); - up(&nwip->sem); - return status; - } - - ret = wait_for_completion_timeout(&nwip->complete, - msecs_to_jiffies(NSS_WIFI_IF_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: wifi_if tx failed due to timeout\n", nss_ctx); - nwip->response = NSS_TX_FAILURE; - } - - status = nwip->response; - up(&nwip->sem); - - return status; -} - -/* - * nss_wifi_if_handle_destroy() - * Destroy the wifi handle either due to request from WLAN or due to error. - */ -static int nss_wifi_if_handle_destroy(struct nss_wifi_if_handle *handle) -{ - int32_t if_num; - int32_t index; - struct nss_ctx_instance *nss_ctx; - nss_tx_status_t status; - - if (!handle) { - nss_warning("Destroy failed as wifi_if handle is NULL\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if_num = handle->if_num; - index = NSS_WIFI_IF_GET_INDEX(if_num); - nss_ctx = handle->nss_ctx; - - spin_lock_bh(&wifi_if_lock); - wifi_handle[index] = NULL; - spin_unlock_bh(&wifi_if_lock); - - status = nss_dynamic_interface_dealloc_node(if_num, NSS_DYNAMIC_INTERFACE_TYPE_WIFI); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Dynamic interface destroy failed status %d\n", nss_ctx, status); - return status; - } - - kfree(handle->pvt); - kfree(handle); - - return status; -} - -/* - * nss_wifi_if_handle_init() - * Initialize wifi handle which holds the if_num and stats per interface. - */ -static struct nss_wifi_if_handle *nss_wifi_if_handle_create(struct nss_ctx_instance *nss_ctx, - int32_t *cmd_rsp) -{ - int32_t index; - int32_t if_num = 0; - struct nss_wifi_if_handle *handle; - - if_num = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_WIFI); - if (if_num < 0) { - nss_warning("%px:failure allocating wifi if\n", nss_ctx); - *cmd_rsp = NSS_WIFI_IF_DYNAMIC_IF_FAILURE; - return NULL; - } - - index = NSS_WIFI_IF_GET_INDEX(if_num); - - handle = (struct nss_wifi_if_handle *)kzalloc(sizeof(struct nss_wifi_if_handle), - GFP_KERNEL); - if (!handle) { - nss_warning("%px: handle memory alloc failed\n", nss_ctx); - *cmd_rsp = NSS_WIFI_IF_ALLOC_FAILURE; - goto error1; - } - - handle->nss_ctx = nss_ctx; - handle->if_num = if_num; - handle->pvt = (struct nss_wifi_if_pvt *)kzalloc(sizeof(struct nss_wifi_if_pvt), - GFP_KERNEL); - if (!handle->pvt) { - nss_warning("%px: failure allocating memory for nss_wifi_if_pvt\n", nss_ctx); - *cmd_rsp = NSS_WIFI_IF_ALLOC_FAILURE; - goto error2; - } - - handle->cb = NULL; - handle->app_data = NULL; - - spin_lock_bh(&wifi_if_lock); - wifi_handle[index] = handle; - spin_unlock_bh(&wifi_if_lock); - - *cmd_rsp = NSS_WIFI_IF_SUCCESS; - - return handle; - -error2: - kfree(handle); -error1: - nss_dynamic_interface_dealloc_node(if_num, NSS_DYNAMIC_INTERFACE_TYPE_WIFI); - return NULL; -} - -/* nss_wifi_if_msg_init() - * Initialize wifi specific message structure. - */ -static void nss_wifi_if_msg_init(struct nss_wifi_if_msg *nwim, - uint16_t if_num, - uint32_t type, - uint32_t len, - nss_wifi_if_msg_callback_t cb, - struct nss_wifi_if_handle *app_data) -{ - nss_cmn_msg_init(&nwim->cm, if_num, type, len, (void *)cb, (void *)app_data); -} - -/* - * nss_wifi_if_create_sync() - * Create a wifi interface and associate it with the netdev - */ -struct nss_wifi_if_handle *nss_wifi_if_create_sync(struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.wlan_handler_id]; - struct nss_wifi_if_msg nwim; - struct nss_wifi_if_create_msg *nwcm; - uint32_t ret; - struct nss_wifi_if_handle *handle = NULL; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be created as core not ready\n", nss_ctx); - return NULL; - } - - handle = nss_wifi_if_handle_create(nss_ctx, &ret); - if (!handle) { - nss_warning("%px:wifi_if handle creation failed ret %d\n", nss_ctx, ret); - return NULL; - } - - /* Initializes the semaphore and also sets the msg handler for if_num */ - ret = nss_wifi_if_register_handler(handle); - if (ret != NSS_WIFI_IF_SUCCESS) { - nss_warning("%px: Registration handler failed reason: %d\n", nss_ctx, ret); - goto error; - } - - nss_wifi_if_msg_init(&nwim, handle->if_num, NSS_WIFI_IF_TX_CREATE_MSG, - sizeof(struct nss_wifi_if_create_msg), nss_wifi_if_callback, handle); - - nwcm = &nwim.msg.create; - nwcm->flags = 0; - memcpy(nwcm->mac_addr, netdev->dev_addr, ETH_ALEN); - - ret = nss_wifi_if_tx_msg_sync(handle, &nwim); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: nss_wifi_if_tx_msg_sync failed %u\n", nss_ctx, ret); - goto error; - } - - nss_core_register_subsys_dp(nss_ctx, handle->if_num, NULL, NULL, NULL, netdev, 0); - - /* - * Hold a reference to the net_device - */ - dev_hold(netdev); - - /* - * The context returned is the interface # which is, essentially, the index into the if_ctx - * array that is holding the net_device pointer - */ - - return handle; - -error: - nss_wifi_if_handle_destroy(handle); - return NULL; -} -EXPORT_SYMBOL(nss_wifi_if_create_sync); - -/* - * nss_wifi_if_destroy_sync() - * Destroy the wifi interface associated with the interface number. - */ -nss_tx_status_t nss_wifi_if_destroy_sync(struct nss_wifi_if_handle *handle) -{ - nss_tx_status_t status; - struct net_device *dev; - int32_t if_num = handle->if_num; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be destroyed as core not ready\n", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - spin_lock_bh(&nss_top_main.lock); - if (!nss_ctx->subsys_dp_register[if_num].ndev) { - spin_unlock_bh(&nss_top_main.lock); - nss_warning("%px: Unregister wifi interface %d: no context\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - dev = nss_ctx->subsys_dp_register[if_num].ndev; - nss_core_unregister_subsys_dp(nss_ctx, if_num); - spin_unlock_bh(&nss_top_main.lock); - dev_put(dev); - - status = nss_wifi_if_handle_destroy(handle); - return status; -} -EXPORT_SYMBOL(nss_wifi_if_destroy_sync); - -/* - * nss_wifi_if_register() - * Register cb, netdev associated with the if_num to the nss data plane - * to receive data packets. - */ -void nss_wifi_if_register(struct nss_wifi_if_handle *handle, - nss_wifi_if_data_callback_t rx_callback, - struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - - if (!handle) { - nss_warning("nss_wifi_if_register handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - if_num = handle->if_num; - nss_assert(NSS_IS_IF_TYPE(DYNAMIC, if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, rx_callback, NULL, NULL, netdev, netdev->features); -} -EXPORT_SYMBOL(nss_wifi_if_register); - -/* - * nss_wifi_if_unregister() - * Unregister the cb, netdev associated with the if_num. - */ -void nss_wifi_if_unregister(struct nss_wifi_if_handle *handle) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - - if (!handle) { - nss_warning("nss_wifi_if_unregister handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - if_num = handle->if_num; - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_wifi_if_unregister); - -/* - * nss_wifi_if_tx_buf() - * HLOS interface has received a packet which we redirect to the NSS. - */ -nss_tx_status_t nss_wifi_if_tx_buf(struct nss_wifi_if_handle *handle, - struct sk_buff *skb) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - int cpu = 0; - - if (!handle) { - nss_warning("nss_wifi_if_tx_buf handle is NULL\n"); - return NSS_TX_FAILURE; - } - - nss_ctx = handle->nss_ctx; - if_num = handle->if_num; - - /* - * redirect should be turned on in /proc/ - */ - if (unlikely(nss_ctl_redirect == 0)) { - return NSS_TX_FAILURE_NOT_ENABLED; - } - - if (unlikely(skb->vlan_tci)) { - return NSS_TX_FAILURE_NOT_SUPPORTED; - } - - nss_assert(NSS_IS_IF_TYPE(DYNAMIC, if_num)); - - /* - * Sanity check the SKB to ensure that it's suitable for us - */ - if (unlikely(skb->len <= ETH_HLEN)) { - nss_warning("%px: Rx packet: %px too short", nss_ctx, skb); - return NSS_TX_FAILURE_TOO_SHORT; - } - - /* - * set skb queue mapping - */ - cpu = get_cpu(); - put_cpu(); - skb_set_queue_mapping(skb, cpu); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER); -} -EXPORT_SYMBOL(nss_wifi_if_tx_buf); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.c deleted file mode 100644 index 19c1c3653..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_if_stats.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_wifi_if.h" - -/* - * Data structure that holds the wifi interface context. - */ -extern struct nss_wifi_if_handle *wifi_handle[]; - -/* - * Spinlock to protect the global data structure wifi_handle. - */ -extern spinlock_t wifi_if_lock; - -/* - * nss_wifi_if_stats_get() - * Get the stats from wifi handle to buffer(line) for if_num. - */ -static int32_t nss_wifi_if_stats_get(int32_t if_num, int i, char *line) -{ - int32_t bytes = 0; - struct nss_wifi_if_stats *stats; - int32_t ifnum; - uint32_t len = 80; - struct nss_wifi_if_handle *handle = NULL; - - ifnum = if_num - NSS_DYNAMIC_IF_START; - - spin_lock_bh(&wifi_if_lock); - if (!wifi_handle[ifnum]) { - spin_unlock_bh(&wifi_if_lock); - goto end; - } - - handle = wifi_handle[ifnum]; - spin_unlock_bh(&wifi_if_lock); - stats = &handle->stats; - - switch (i) { - case 0: - bytes = scnprintf(line, len, "rx_packets=%d\n", - stats->node_stats.rx_packets); - break; - - case 1: - bytes = scnprintf(line, len, "rx_bytes=%d\n", - stats->node_stats.rx_bytes); - break; - - case 2: - bytes = scnprintf(line, len, "rx_dropped=%d\n", - nss_cmn_rx_dropped_sum(&stats->node_stats)); - break; - - case 3: - bytes = scnprintf(line, len, "tx_packets=%d\n", - stats->node_stats.tx_packets); - break; - - case 4: - bytes = scnprintf(line, len, "tx_bytes=%d\n", - stats->node_stats.tx_bytes); - break; - - case 5: - bytes = scnprintf(line, len, "tx_enqueue_failed=%d\n", - stats->tx_enqueue_failed); - break; - - case 6: - bytes = scnprintf(line, len, "shaper_enqueue_failed=%d\n", - stats->shaper_enqueue_failed); - break; - } - -end: - return bytes; -} - -/* - * nss_wifi_if_stats_read() - * Read wifi_if statistics - */ -static ssize_t nss_wifi_if_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_stats_data *data = fp->private_data; - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - int32_t if_num = NSS_DYNAMIC_IF_START; - int32_t max_if_num = if_num + NSS_MAX_DYNAMIC_INTERFACES; - size_t bytes = 0; - ssize_t bytes_read = 0; - char line[80]; - int start, end; - - if (data) { - if_num = data->if_num; - } - - if (if_num > max_if_num) { - return 0; - } - - for (; if_num < max_if_num; if_num++) { - if (nss_dynamic_interface_get_type(nss_ctx, if_num) != NSS_DYNAMIC_INTERFACE_TYPE_WIFI) - continue; - - bytes = scnprintf(line, sizeof(line), "if_num %d stats start:\n\n", if_num); - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto end; - } - - bytes_read += bytes; - - start = 0; - end = 7; - while (bytes_read < sz && start < end) { - bytes = nss_wifi_if_stats_get(if_num, start, line); - if (!bytes) - break; - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto end; - } - - bytes_read += bytes; - start++; - } - - bytes = scnprintf(line, sizeof(line), "if_num %d stats end:\n\n", if_num); - if (bytes_read > (sz - bytes)) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto end; - } - - bytes_read += bytes; - } - - if (bytes_read > 0) { - *ppos = bytes_read; - } - - if (data) { - data->if_num = if_num; - } - -end: - return bytes_read; -} - -/* - * nss_wifi_if_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_if) - -/* - * nss_wifi_if_stats_dentry_create() - * Create wifi_if statistics debug entry. - */ -void nss_wifi_if_stats_dentry_create(void) -{ - nss_stats_create_dentry("wifi_if", &nss_wifi_if_stats_ops); -} - -/* - * nss_wifi_if_stats_sync() - * Sync stats from the NSS FW - */ -void nss_wifi_if_stats_sync(struct nss_wifi_if_handle *handle, - struct nss_wifi_if_stats *nwis) -{ - struct nss_wifi_if_stats *stats = &handle->stats; - int i; - - stats->node_stats.rx_packets += nwis->node_stats.rx_packets; - stats->node_stats.rx_bytes += nwis->node_stats.rx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - stats->node_stats.rx_dropped[i] += nwis->node_stats.rx_dropped[i]; - } - stats->node_stats.tx_packets += nwis->node_stats.tx_packets; - stats->node_stats.tx_bytes += nwis->node_stats.tx_bytes; - stats->tx_enqueue_failed += nwis->tx_enqueue_failed; - stats->shaper_enqueue_failed += nwis->shaper_enqueue_failed; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c new file mode 100644 index 000000000..d4a6c0a1d --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c @@ -0,0 +1,242 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_tx_rx_common.h" +#include "nss_core.h" +#include "nss_cmn.h" +#include "nss_wifi_mesh.h" +#include "nss_wifi_mesh_log.h" +#include "nss_wifi_mesh_strings.h" + +/* + * nss_wifi_mesh_verify_if_num() + * Verify interface number. + */ +bool nss_wifi_mesh_verify_if_num(nss_if_num_t if_num) +{ + enum nss_dynamic_interface_type if_type = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); + + return ((if_type == NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER) || + (if_type == NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)); +} +EXPORT_SYMBOL(nss_wifi_mesh_verify_if_num); + +/* nss_wifi_mesh_handler() + * Handles Wi-Fi mesh messages from NSS to HLOS. + */ +static void nss_wifi_mesh_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) +{ + nss_wifi_mesh_msg_callback_t cb; + struct nss_wifi_mesh_msg *nwmm = (struct nss_wifi_mesh_msg *)ncm; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + nss_assert(nss_is_dynamic_interface(ncm->interface)); + nss_assert(nss_wifi_mesh_verify_if_num(ncm->interface)); + + /* + * Is this a valid request/response packet? + */ + if (ncm->type >= NSS_WIFI_MESH_MSG_MAX) { + nss_warning("%px: Received invalid message %d for wifi_mesh interface\n", nss_ctx, ncm->type); + return; + } + + + /* + * For variable array the size of the common length will be greater the nss_wifi_mesh_msg + * length. Add conditional checking for messages where length check will fail. + */ + if ((nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_mesh_msg)) && + (ncm->type != NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP) && + (ncm->type != NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP)) { + nss_warning("%px: Length of message is greater than expected, type: %d, len: %d", + nss_ctx, ncm->type, ncm->len); + return; + } + + /* + * Log failures + */ + nss_core_log_msg_failures(nss_ctx, ncm); + + /* + * Trace Messages + */ + nss_wifi_mesh_log_rx_msg(nwmm); + + /* + * Update the stats and send statistics notifications to the registered modules. + */ + if (nwmm->cm.type == NSS_WIFI_MESH_MSG_STATS_SYNC) { + nss_wifi_mesh_update_stats(ncm->interface, &nwmm->msg.stats_sync_msg); + nss_wifi_mesh_stats_notify(ncm->interface, nss_ctx->id); + } + + if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { + ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); + ncm->app_data = (nss_ptr_t)app_data; + } + + if (!ncm->cb) { + return; + } + + cb = (nss_wifi_mesh_msg_callback_t)ncm->cb; + cb((void *)ncm->app_data, ncm); +} + +/* + * nss_wifi_mesh_msg_init() + * Initiliaze a Wi-Fi mesh message. + */ +void nss_wifi_mesh_msg_init(struct nss_wifi_mesh_msg *nwm, nss_if_num_t if_num, uint32_t type, uint32_t len, + nss_wifi_mesh_msg_callback_t cb, void *app_data) +{ + nss_assert(nss_wifi_mesh_verify_if_num(if_num)); + nss_cmn_msg_init(&nwm->cm, if_num, type, len, cb, app_data); +} +EXPORT_SYMBOL(nss_wifi_mesh_msg_init); + +/* + * nss_wifi_mesh_tx_buf + * Send data packet for vap processing asynchronously. + */ +nss_tx_status_t nss_wifi_mesh_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, nss_if_num_t if_num) +{ + nss_assert(nss_is_dynamic_interface(if_num)); + return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); +} +EXPORT_SYMBOL(nss_wifi_mesh_tx_buf); + +/* + * nss_wifi_mesh_tx_msg + * Transmit a Wi-Fi mesh message to the NSS firmware asynchronously. + * + * NOTE: The caller is expected to handle synchronous waiting for message + * response if needed. + */ +nss_tx_status_t nss_wifi_mesh_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_mesh_msg *msg) +{ + struct nss_cmn_msg *ncm = &msg->cm; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + if (ncm->type >= NSS_WIFI_MESH_MSG_MAX) { + nss_warning("%px: wifi_mesh message type out of range: %d\n", nss_ctx, ncm->type); + return NSS_TX_FAILURE; + } + + /* + * Log messages. + */ + nss_wifi_mesh_log_tx_msg(msg); + + /* + * The interface number shall be one of the Wi-Fi mesh socket interfaces. + */ + nss_assert(nss_is_dynamic_interface(ncm->interface)); + + return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); +} +EXPORT_SYMBOL(nss_wifi_mesh_tx_msg); + +/* + **************************************** + * Register/Unregister/Miscellaneous APIs + **************************************** + */ + +/* + * nss_wifi_mesh_get_context() + * Return the core ctx which the feature is on. + */ +struct nss_ctx_instance *nss_wifi_mesh_get_context(void) +{ + return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; +} +EXPORT_SYMBOL(nss_wifi_mesh_get_context); + +/* + * nss_unregister_wifi_mesh_if() + * Unregister Wi-Fi mesh from the NSS driver. + */ +void nss_unregister_wifi_mesh_if(nss_if_num_t if_num) +{ + struct nss_ctx_instance *nss_ctx = nss_wifi_mesh_get_context(); + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + + nss_core_unregister_subsys_dp(nss_ctx, if_num); + nss_core_unregister_msg_handler(nss_ctx, if_num); + nss_core_unregister_handler(nss_ctx, if_num); + nss_wifi_mesh_stats_handle_free(if_num); +} +EXPORT_SYMBOL(nss_unregister_wifi_mesh_if); + +/* + * nss_register_wifi_mesh_if() + * Register wifi_mesh with nss driver. + */ +uint32_t nss_register_wifi_mesh_if(nss_if_num_t if_num, + nss_wifi_mesh_data_callback_t mesh_data_callback, + nss_wifi_mesh_ext_data_callback_t mesh_ext_data_callback, + nss_wifi_mesh_msg_callback_t mesh_event_callback, + uint32_t dp_type, struct net_device *netdev, uint32_t features) +{ + struct nss_ctx_instance *nss_ctx = nss_wifi_mesh_get_context(); + uint32_t status; + + NSS_VERIFY_CTX_MAGIC(nss_ctx); + nss_assert(netdev); + nss_assert(nss_wifi_mesh_verify_if_num(if_num)); + + if (!nss_wifi_mesh_stats_handle_alloc(if_num, netdev->ifindex)) { + nss_warning("%px: couldn't allocate stats handle for device name: %s, if_num: 0x%x\n", nss_ctx, netdev->name, if_num); + return NSS_CORE_STATUS_FAILURE; + } + + nss_core_register_handler(nss_ctx, if_num, nss_wifi_mesh_handler, netdev); + + status = nss_core_register_msg_handler(nss_ctx, if_num, mesh_event_callback); + if (status != NSS_CORE_STATUS_SUCCESS) { + nss_warning("%px: unable to register event handler for interface(%u)\n", nss_ctx, if_num); + nss_core_unregister_handler(nss_ctx, if_num); + nss_wifi_mesh_stats_handle_free(if_num); + return status; + } + + nss_core_register_subsys_dp(nss_ctx, if_num, mesh_data_callback, mesh_ext_data_callback, NULL, netdev, features); + nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, dp_type); + return NSS_CORE_STATUS_SUCCESS; +} +EXPORT_SYMBOL(nss_register_wifi_mesh_if); + +/* + * nss_wifi_mesh_init() + * Initialize the mesh stats dentries. + */ +void nss_wifi_mesh_init(void) +{ + if (!nss_wifi_mesh_strings_dentry_create()) { + nss_warning("Unable to create dentry for Wi-Fi mesh strings\n"); + } + + if (!nss_wifi_mesh_stats_dentry_create()) { + nss_warning("Unable to create dentry for Wi-Fi mesh stats\n"); + } +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c new file mode 100644 index 000000000..bf9ddc658 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c @@ -0,0 +1,368 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +/* + * nss_wifi_mesh_log.c + * NSS WiFi Mesh logger file. + */ + +#include "nss_core.h" +#include "nss_wifi_mesh.h" + +#define NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(type) ((type) - NSS_IF_MAX_MSG_TYPES) + +/* + * nss_wifi_mesh_log_message_types_str + * NSS Wi-Fi mesh message strings. + */ +static uint8_t *nss_wifi_mesh_log_message_types_str[NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(NSS_WIFI_MESH_MSG_MAX)] __maybe_unused = { + "WiFi Mesh configure", + "WiFi Mesh configure Mpath Add", + "WiFi Mesh configure Mpath Delete", + "WiFi Mesh configure Mpath Update", + "WiFi Mesh configure Proxy Learn", + "WiFi Mesh configure Proxy Add", + "WiFi Mesh configure Proxy Update", + "WiFi Mesh configure Proxy Delete", + "WiFi Mesh configure Mpath Not Found", + "WiFi Mesh configure Refresh" + "WiFi Mesh configure Mpath Table Dump", + "WiFi Mesh configure Proxy Path Table Dump", + "WiFi Mesh configure Assoc Link Vap", + "WiFi Mesh configure Exception Message", + "WiFi Mesh configure Stats Sync" +}; + +/* + * nss_wifi_mesh_log_configure_msg() + * Log a NSS Wi-Fi mesh interface configure message. + */ +static void nss_wifi_mesh_log_configure_if_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_config_msg *cmsg __maybe_unused = &nwmm->msg.mesh_config; + nss_trace("%px: WiFi Mesh configure message\n" + "Local Mac address: %pM\n" + "TTL: %d\n" + "Mesh Path Refresh Time: %d\n" + "Mpp Learning Mode: %d\n" + "Block Mesh Forwarding: %d\n" + "Configs Flags: 0x%x\n", + cmsg, cmsg->local_mac_addr, cmsg->ttl, + cmsg->mesh_path_refresh_time, + cmsg->mpp_learning_mode, + cmsg->block_mesh_forwarding, + cmsg->config_flags); +} + +/* + * nss_wifi_mesh_log_mpath_add_msg() + * Log a NSS Wi-Fi mesh mpath add message. + */ +static void nss_wifi_mesh_log_mpath_add_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_mpath_add_msg *mamsg __maybe_unused = &nwmm->msg.mpath_add; + nss_trace("%px: NSS WiFi Mesh Mpath add message:\n" + "Dest Mac address: %pM\n" + "Next Hop Mac address: %pM\n" + "Metric: %d\n" + "Expiry Time: %d\n" + "Hop Count: %d\n" + "Flags: 0x%x\n" + "Link Vap id: %d\n" + "Is Mesh Gate: %d\n", + mamsg, mamsg->dest_mac_addr, mamsg->next_hop_mac_addr, + mamsg->metric, mamsg->expiry_time, mamsg->hop_count, + mamsg->path_flags, mamsg->link_vap_id, mamsg->is_mesh_gate); +} + +/* + * nss_wifi_mesh_log_mpath_delete_msg() + * Log a NSS Wi-Fi mesh mpath delete message. + */ +static void nss_wifi_mesh_log_mpath_delete_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_mpath_del_msg *mdmsg __maybe_unused = &nwmm->msg.mpath_del; + nss_trace("%px: NSS WiFi Mesh Mpath delete message:\n" + "Dest Mac Address: %pM\n" + "Link Vap id: %d\n" + "Next Hop Mac address: %pM\n", + mdmsg, mdmsg->mesh_dest_mac_addr, mdmsg->link_vap_id, mdmsg->next_hop_mac_addr); +} + +/* + * nss_wifi_mesh_log_mpath_update_msg() + * Log a NSS Wi-Fi mesh mpath update message. + */ +static void nss_wifi_mesh_log_mpath_update_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_mpath_update_msg *mumsg __maybe_unused = &nwmm->msg.mpath_update; + nss_trace("%px: NSS WiFi Mesh Mpath update message:\n" + "Dest Mac address: %pM\n" + "Next Hop Mac address: %pM\n" + "Metric: %d\n" + "Expiry Time: %d\n" + "Hop Count: %d\n" + "Flags: 0x%x\n" + "Link Vap id: %d\n" + "Is Mesh Gate: %d\n" + "Update Flags: %d\n", + mumsg, mumsg->dest_mac_addr, mumsg->next_hop_mac_addr, + mumsg->metric, mumsg->expiry_time, mumsg->hop_count, + mumsg->path_flags, mumsg->link_vap_id, mumsg->is_mesh_gate, + mumsg->update_flags); +} + +/* + * nss_wifi_mesh_log_proxy_path_learn_msg() + * Log a NSS Wi-Fi mesh proxy path learn message. + */ +static void nss_wifi_mesh_log_proxy_path_learn_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_proxy_path_learn_msg *pplm __maybe_unused = &nwmm->msg.proxy_learn_msg; + nss_trace("%px: NSS WiFi Mesh Proxy Path Learn message:\n" + "Mesh Dest Mac address: %pM\n" + "Destination Mac address: %pM\n" + "flags: 0x%x\n", + pplm, pplm->mesh_dest_mac, pplm->dest_mac_addr, + pplm->path_flags); +} + +/* + * nss_wifi_mesh_log_proxy_path_add_msg() + * Log a NSS Wi-Fi Mesh proxy path add message. + */ +static void nss_wifi_mesh_log_proxy_path_add_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_proxy_path_add_msg *ppam __maybe_unused = &nwmm->msg.proxy_add_msg; + nss_trace("%px: NSS WiFi Mesh Proxy Path Add message:\n" + "Mesh Dest Mac address: %pM\n" + "Destination Mac address: %pM\n" + "flags: 0x%x\n", + ppam, ppam->mesh_dest_mac, ppam->dest_mac_addr, + ppam->path_flags); +} + +/* + * nss_wifi_mesh_log_proxy_path_delete_msg() + * Log a NSS Wi-Fi proxy path delete message. + */ +static void nss_wifi_mesh_log_proxy_path_delete_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_proxy_path_del_msg *ppdm __maybe_unused = &nwmm->msg.proxy_del_msg; + nss_trace("%px: NSS WiFi Mesh Proxy Path Delete message:\n" + "Mesh Dest Mac address: %pM\n" + "Destination Mac address: %pM\n", + ppdm, ppdm->mesh_dest_mac_addr, ppdm->dest_mac_addr); +} + +/* + * nss_wifi_mesh_log_proxy_path_update_msg() + * Log a NSS Wi-Fi mesh proxy path update message. + */ +static void nss_wifi_mesh_log_proxy_path_update_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_proxy_path_update_msg *ppum __maybe_unused = &nwmm->msg.proxy_update_msg; + nss_trace("%px: NSS WiFi Mesh Proxy Path Add message:\n" + "Mesh Dest Mac address: %pM\n" + "Destination Mac address: %pM\n" + "flags: 0x%x\n" + "Bitmap: %d\n", + ppum, ppum->mesh_dest_mac, ppum->dest_mac_addr, + ppum->path_flags, ppum->bitmap); +} + +/* + * nss_wifi_mesh_log_mpath_not_found_msg() + * Log a NSS Wi-Fi mesh mpath not found message. + */ +static void nss_wifi_mesh_log_mpath_not_found_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_mpath_not_found_msg *mnfm __maybe_unused = &nwmm->msg.mpath_not_found_msg; + nss_trace("%px: NSS WiFi Mesh Mpath not found message:\n" + "Destination Mac address: %pM\n" + "Transmitter Mac address: %pM\n" + "Link Vap Id: %d\n" + "Is Mesh Forwarding Path: %d\n", + mnfm, mnfm->dest_mac_addr, mnfm->transmitter_mac_addr, + mnfm->link_vap_id, mnfm->is_mesh_forward_path); +} + +/* + * nss_wifi_mesh_log_mpath_refresh_msg() + * Log a NSS Wi-Fi mesh mpath refresh message. + */ +static void nss_wifi_mesh_log_mpath_refresh_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_path_refresh_msg *mprm __maybe_unused = &nwmm->msg.path_refresh_msg; + nss_trace("%px: NSS WiFi Mesh Mpath refresh message:\n" + "Destination Mac address: %pM\n" + "Next Hop Mac address: %pM\n" + "Flags: 0x%x\n" + "Link Vap Id: %d\n", + mprm, mprm->dest_mac_addr, mprm->next_hop_mac_addr, + mprm->path_flags, mprm->link_vap_id); +} + +/* + * nss_wifi_mesh_log_mpath_expiry_msg() + * Log a NSS Wi-Fi mesh mpath expiry message. + */ +static void nss_wifi_mesh_log_mpath_expiry_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_path_expiry_msg *mpem __maybe_unused = &nwmm->msg.path_expiry_msg; + nss_trace("%px: NSS WiFi Mesh Mpath expiry message:\n" + "Destination Mac address: %pM\n" + "Next Hop Mac address: %pM\n" + "Flags: 0x%x\n" + "Link Vap Id: %d\n", + mpem, mpem->mesh_dest_mac_addr, mpem->next_hop_mac_addr, + mpem->path_flags, mpem->link_vap_id); +} + +/* + * nss_wifi_mesh_log_exception_flag_msg() + * Log a NSS Wi-Fi mesh exception flag message. + */ +static void nss_wifi_mesh_log_exception_flag_msg(struct nss_wifi_mesh_msg *nwmm) +{ + struct nss_wifi_mesh_exception_flag_msg *efm __maybe_unused = &nwmm->msg.exception_msg; + nss_trace("%px: NSS WiFi Mesh Exception Flag message:\n" + "Destination Mac address: %pM\n", + efm, efm->dest_mac_addr); +} + +/* + * nss_wifi_mesh_log_verbose() + * Log message contents. + */ +static void nss_wifi_mesh_log_verbose(struct nss_wifi_mesh_msg *nwmm) +{ + switch (nwmm->cm.type) { + case NSS_WIFI_MESH_MSG_INTERFACE_CONFIGURE: + nss_wifi_mesh_log_configure_if_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_MPATH_ADD: + nss_wifi_mesh_log_mpath_add_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_MPATH_DELETE: + nss_wifi_mesh_log_mpath_delete_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_MPATH_UPDATE: + nss_wifi_mesh_log_mpath_update_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PROXY_PATH_LEARN: + nss_wifi_mesh_log_proxy_path_learn_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PROXY_PATH_ADD: + nss_wifi_mesh_log_proxy_path_add_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PROXY_PATH_DELETE: + nss_wifi_mesh_log_proxy_path_delete_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PROXY_PATH_UPDATE: + nss_wifi_mesh_log_proxy_path_update_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PATH_NOT_FOUND: + nss_wifi_mesh_log_mpath_not_found_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PATH_REFRESH: + nss_wifi_mesh_log_mpath_refresh_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PATH_EXPIRY: + nss_wifi_mesh_log_mpath_expiry_msg(nwmm); + break; + + case NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP: + break; + + case NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP: + break; + + case NSS_WIFI_MESH_MSG_STATS_SYNC: + break; + + case NSS_WIFI_MESH_MSG_EXCEPTION_FLAG: + nss_wifi_mesh_log_exception_flag_msg(nwmm); + break; + + default: + nss_trace("%px: Invalid message, type: %d\n", nwmm, nwmm->cm.type); + break; + } +} + +/* + * nss_wifi_mesh_log_tx_msg() + * Log messages transmitted to firmware. + */ +void nss_wifi_mesh_log_tx_msg(struct nss_wifi_mesh_msg *nwmm) +{ + uint32_t index; + if ((nwmm->cm.type >= NSS_WIFI_MESH_MSG_MAX) || (nwmm->cm.type <= NSS_IF_MAX_MSG_TYPES)) { + nss_warning("%px: Invalid message, type: %d\n", nwmm, nwmm->cm.type); + return; + } + + index = NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(nwmm->cm.type); + + nss_info("%px: type[%d]:%s\n", nwmm, nwmm->cm.type, nss_wifi_mesh_log_message_types_str[index - 1]); + nss_wifi_mesh_log_verbose(nwmm); +} + +/* + * nss_wifi_mesh_log_rx_msg() + * Log messages received from firmware. + */ +void nss_wifi_mesh_log_rx_msg(struct nss_wifi_mesh_msg *nwmm) +{ + uint32_t index; + if (nwmm->cm.response >= NSS_CMN_RESPONSE_LAST) { + nss_warning("%px: Invalid response, message type: %d\n", nwmm, nwmm->cm.type); + return; + } + + if (nwmm->cm.type <= NSS_IF_MAX_MSG_TYPES) { + return; + } + + index = NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(nwmm->cm.type); + + if (nwmm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nwmm->cm.response == NSS_CMN_RESPONSE_ACK)) { + nss_info("%px: type[%d]:%s, response[%d]:%s\n", nwmm, nwmm->cm.type, + nss_wifi_mesh_log_message_types_str[index - 1], + nwmm->cm.response, nss_cmn_response_str[nwmm->cm.response]); + goto verbose; + } + + nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", + nwmm, nwmm->cm.type, nss_wifi_mesh_log_message_types_str[index - 1], + nwmm->cm.response, nss_cmn_response_str[nwmm->cm.response]); + +verbose: + nss_wifi_mesh_log_verbose(nwmm); +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h new file mode 100644 index 000000000..a6c54368f --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h @@ -0,0 +1,34 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_WIFI_MESH_LOG_H +#define __NSS_WIFI_MESH_LOG_H + +/* + * nss_wifi_mesh_log_tx_msg + * Logs a Wi-Fi mesh message that was sent to the NSS firmware. + */ +void nss_wifi_mesh_log_tx_msg(struct nss_wifi_mesh_msg *nwmm); + +/* + * nss_wifi_mesh_log_rx_msg + * Logs a Wi-Fi mesh message that was received from the NSS firmware. + */ +void nss_wifi_mesh_log_rx_msg(struct nss_wifi_mesh_msg *nwmm); + +#endif /* __NSS_WIFI_MESH_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c new file mode 100644 index 000000000..4cfa96a67 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c @@ -0,0 +1,662 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_core.h" +#include "nss_tx_rx_common.h" +#include "nss_wifi_mesh.h" +#include "nss_wifi_mesh_stats.h" +#include "nss_wifi_mesh_strings.h" + +#define NSS_WIFI_MESH_OUTER_STATS 0 +#define NSS_WIFI_MESH_INNER_STATS 1 +#define NSS_WIFI_MESH_PATH_STATS 2 +#define NSS_WIFI_MESH_PROXY_PATH_STATS 3 +#define NSS_WIFI_MESH_EXCEPTION_STATS 4 + +/* + * Wi-Fi mesh stats dentry file size. + */ +#define NSS_WIFI_MESH_DENTRY_FILE_SIZE 19 + +/* + * Spinlock for protecting tunnel operations colliding with a tunnel destroy + */ +static DEFINE_SPINLOCK(nss_wifi_mesh_stats_lock); + +/* + * Declare atomic notifier data structure for statistics. + */ +static ATOMIC_NOTIFIER_HEAD(nss_wifi_mesh_stats_notifier); + +/* + * Declare an array of Wi-Fi mesh stats handle. + */ +struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_stats_hdl[NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE]; + +/* + * nss_wifi_mesh_max_statistics() + * Wi-Fi mesh maximum statistics. + */ +static uint32_t nss_wifi_mesh_max_statistics(void) +{ + uint32_t max1; + uint32_t exception_stats_max = NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX; + uint32_t encap_stats_max = NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX; + uint32_t decap_stats_max = NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX; + uint32_t path_stats_max = NSS_WIFI_MESH_PATH_STATS_TYPE_MAX; + uint32_t proxy_path_stats_max = NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX; + + max1 = max(max(encap_stats_max, decap_stats_max), max(path_stats_max, proxy_path_stats_max)); + + return (max(max1, exception_stats_max)); +} + +/* + * nss_wifi_mesh_stats_handle_alloc() + * Allocate Wi-Fi mesh tunnel instance + */ +bool nss_wifi_mesh_stats_handle_alloc(nss_if_num_t if_num, int32_t ifindex) +{ + struct nss_wifi_mesh_stats_handle *h; + uint32_t idx; + + /* + * Allocate a handle + */ + h = kzalloc(sizeof(struct nss_wifi_mesh_stats_handle), GFP_ATOMIC); + if (!h) { + nss_warning("Failed to allocate memory for Wi-Fi mesh instance for interface : 0x%x\n", if_num); + return false; + } + + spin_lock(&nss_wifi_mesh_stats_lock); + for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { + if (nss_wifi_mesh_stats_hdl[idx] && nss_wifi_mesh_stats_hdl[idx]->if_num == if_num) { + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("Already a handle present for this interface number: 0x%x\n", if_num); + kfree(h); + return false; + } + } + + for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { + if (nss_wifi_mesh_stats_hdl[idx]) { + continue; + } + + h->if_num = if_num; + h->mesh_idx = idx; + h->ifindex = ifindex; + nss_wifi_mesh_stats_hdl[idx] = h; + spin_unlock(&nss_wifi_mesh_stats_lock); + return true; + } + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("No free index available for handle with ifnum: 0x%x\n", if_num); + kfree(h); + return false; +} + +/* + * nss_wifi_mesh_stats_handle_free() + * Free Wi-Fi mesh tunnel handle instance. + */ +bool nss_wifi_mesh_stats_handle_free(nss_if_num_t if_num) +{ + struct nss_wifi_mesh_stats_handle *h; + + spin_lock(&nss_wifi_mesh_stats_lock); + h = nss_wifi_mesh_get_stats_handle(if_num); + if (!h) { + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("Unable to free Wi-Fi mesh stats handle instance for interface number: 0x%x\n", if_num); + return false; + } + + nss_wifi_mesh_stats_hdl[h->mesh_idx] = NULL; + spin_unlock(&nss_wifi_mesh_stats_lock); + kfree(h); + return true; +} + +/** + * nss_wifi_mesh_get_stats_handle() + * Get Wi-Fi mesh stats handle from interface number. + */ +struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_get_stats_handle(nss_if_num_t if_num) +{ + uint32_t idx; + + assert_spin_locked(&nss_wifi_mesh_stats_lock); + + for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { + if (nss_wifi_mesh_stats_hdl[idx]) { + if (nss_wifi_mesh_stats_hdl[idx]->if_num == if_num) { + struct nss_wifi_mesh_stats_handle *h = nss_wifi_mesh_stats_hdl[idx]; + return h; + } + } + } + return NULL; +} + +/* + * nss_wifi_mesh_get_stats() + * API for getting stats from a Wi-Fi mesh interface stats + */ +static bool nss_wifi_mesh_get_stats(nss_if_num_t if_num, struct nss_wifi_mesh_hdl_stats_sync_msg *stats) +{ + struct nss_wifi_mesh_stats_handle *h; + + if (!nss_wifi_mesh_verify_if_num(if_num)) { + return false; + } + + spin_lock(&nss_wifi_mesh_stats_lock); + h = nss_wifi_mesh_get_stats_handle(if_num); + if (!h) { + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("Invalid Wi-Fi mesh stats handle for interface number: %d\n", if_num); + return false; + } + + memcpy(stats, &h->stats, sizeof(*stats)); + spin_unlock(&nss_wifi_mesh_stats_lock); + return true; +} + +/* + * nss_wifi_mesh_get_valid_interface_count() + * Get count of valid Wi-Fi mesh interfaces up. + */ +static uint32_t nss_wifi_mesh_get_valid_interface_count(uint16_t type, uint32_t if_num, uint32_t max_if_num) +{ + uint32_t interface_count = 0; + enum nss_dynamic_interface_type dtype; + + for (; if_num <= max_if_num; if_num++) { + if (!nss_is_dynamic_interface(if_num)) { + continue; + } + + dtype = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); + + if ((type == NSS_WIFI_MESH_OUTER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_INNER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_PROXY_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + interface_count++; + } + return interface_count; +} + +/** + * nss_wifi_mesh_stats_read() + * Read Wi-Fi Mesh stats. + */ +static ssize_t nss_wifi_mesh_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos, uint16_t type) +{ + uint32_t max_output_lines, max_stats; + size_t size_al, size_wr; + ssize_t bytes_read = 0; + struct nss_stats_data *data = fp->private_data; + int ifindex; + uint32_t if_num = NSS_DYNAMIC_IF_START; + uint32_t interface_count = 0; + uint32_t max_if_num = NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES; + struct nss_wifi_mesh_hdl_stats_sync_msg *stats; + struct net_device *ndev; + struct nss_wifi_mesh_stats_handle *handle; + char *lbuf; + enum nss_dynamic_interface_type dtype; + + if (data) { + if_num = data->if_num; + } + + /* + * If we are done accomodating all the Wi-Fi mesh interfaces. + */ + if (if_num > max_if_num) { + return 0; + } + + /* + * Get number of Wi-Fi mesh interfaces up. + */ + interface_count = nss_wifi_mesh_get_valid_interface_count(type, if_num, max_if_num); + if (!interface_count) { + nss_warning("%px: Invalid number of valid interface for if_num: 0x%x\n", data, if_num); + return 0; + } + + /* + * max output lines = #stats + Number of Extra outputlines for future reference to add new stats + + * Maximum node stats + Maximum of all the stats + three blank lines. + */ + max_stats = nss_wifi_mesh_max_statistics(); + max_output_lines = max_stats + NSS_STATS_NODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; + size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * interface_count; + + lbuf = kzalloc(size_al, GFP_KERNEL); + if (unlikely(lbuf == NULL)) { + nss_warning("Could not allocate memory for local statistics buffer\n"); + return 0; + } + + size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifi_mesh", NSS_STATS_SINGLE_CORE); + + stats = kzalloc(sizeof(struct nss_wifi_mesh_hdl_stats_sync_msg), GFP_KERNEL); + if (!stats) { + nss_warning("%px: Failed to allocate stats memory for if_num: 0x%x\n", data, if_num); + kfree(lbuf); + return 0; + } + + for (; if_num <= max_if_num; if_num++) { + bool ret; + + if (!nss_is_dynamic_interface(if_num)) { + continue; + } + + dtype = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); + + if ((type == NSS_WIFI_MESH_OUTER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_INNER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + + if ((type == NSS_WIFI_MESH_PROXY_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { + continue; + } + + /* + * If Wi-Fi mesh stats handle does not exists, then ret will be false. + */ + ret = nss_wifi_mesh_get_stats(if_num, stats); + if (!ret) { + continue; + } + + spin_lock(&nss_wifi_mesh_stats_lock); + handle = nss_wifi_mesh_get_stats_handle(if_num); + if (!handle) { + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("Invalid Wi-Fi mesh stats handle, if_num: %d\n", if_num); + continue; + } + ifindex = handle->ifindex; + spin_unlock(&nss_wifi_mesh_stats_lock); + + ndev = dev_get_by_index(&init_net, ifindex); + if (!ndev) { + continue; + } + + size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", + ndev->name, if_num); + dev_put(ndev); + + /* + * Read encap stats, path stats, proxy path stats from inner node and decap stats from outer node. + */ + switch (type) { + case NSS_WIFI_MESH_INNER_STATS: + size_wr += nss_stats_print("wifi_mesh", "encap stats", NSS_STATS_SINGLE_INSTANCE + , nss_wifi_mesh_strings_encap_stats + , stats->encap_stats + , NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX + , lbuf, size_wr, size_al); + break; + + case NSS_WIFI_MESH_PATH_STATS: + size_wr += nss_stats_print("wifi_mesh", "path stats", NSS_STATS_SINGLE_INSTANCE + , nss_wifi_mesh_strings_path_stats + , stats->path_stats + , NSS_WIFI_MESH_PATH_STATS_TYPE_MAX + , lbuf, size_wr, size_al); + break; + + case NSS_WIFI_MESH_PROXY_PATH_STATS: + size_wr += nss_stats_print("wifi_mesh", "proxy path stats", NSS_STATS_SINGLE_INSTANCE + , nss_wifi_mesh_strings_proxy_path_stats + , stats->proxy_path_stats + , NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX + , lbuf, size_wr, size_al); + break; + + case NSS_WIFI_MESH_OUTER_STATS: + size_wr += nss_stats_print("wifi_mesh", "decap stats", NSS_STATS_SINGLE_INSTANCE + , nss_wifi_mesh_strings_decap_stats + , stats->decap_stats + , NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX + , lbuf, size_wr, size_al); + break; + + case NSS_WIFI_MESH_EXCEPTION_STATS: + size_wr += nss_stats_print("wifi_mesh", "exception stats", NSS_STATS_SINGLE_INSTANCE + , nss_wifi_mesh_strings_exception_stats + , stats->except_stats + , NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX + , lbuf, size_wr, size_al); + break; + + default: + nss_warning("%px: Invalid stats type: %d\n", stats, type); + nss_assert(0); + kfree(stats); + kfree(lbuf); + return 0; + } + } + + bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); + kfree(stats); + kfree(lbuf); + return bytes_read; +} + +/** + * nss_wifi_mesh_decap_stats_read() + * Read Wi-Fi Mesh decap stats. + */ +static ssize_t nss_wifi_mesh_decap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_OUTER_STATS); +} + +/** + * nss_wifi_mesh_encap_stats_read() + * Read Wi-Fi Mesh encap stats + */ +static ssize_t nss_wifi_mesh_encap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_INNER_STATS); +} + +/** + * nss_wifi_mesh_path_stats_read() + * Read Wi-Fi Mesh path stats + */ +static ssize_t nss_wifi_mesh_path_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_PATH_STATS); +} + +/** + * nss_wifi_mesh_proxy_path_stats_read() + * Read Wi-Fi Mesh proxy path stats + */ +static ssize_t nss_wifi_mesh_proxy_path_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_PROXY_PATH_STATS); +} + +/** + * nss_wifi_mesh_exception_stats_read() + * Read Wi-Fi Mesh exception stats + */ +static ssize_t nss_wifi_mesh_exception_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_EXCEPTION_STATS); +} + +/* + * nss_wifi_mesh_stats_ops + */ +NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_encap); +NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_decap); +NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_path); +NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_proxy_path); +NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_exception); + +/* + * nss_wifi_mesh_get_interface_type() + * Function to get the type of dynamic interface. + */ +static enum nss_dynamic_interface_type nss_wifi_mesh_get_interface_type(nss_if_num_t if_num) +{ + struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.wifi_handler_id]; + NSS_VERIFY_CTX_MAGIC(nss_ctx); + return nss_dynamic_interface_get_type(nss_ctx, if_num); +} + +/* + * nss_wifi_mesh_update_stats() + * Update stats for Wi-Fi mesh interface. + */ +void nss_wifi_mesh_update_stats(nss_if_num_t if_num, struct nss_wifi_mesh_stats_sync_msg *mstats) +{ + struct nss_wifi_mesh_stats_handle *handle; + struct nss_wifi_mesh_hdl_stats_sync_msg *stats; + enum nss_dynamic_interface_type type; + uint64_t *dst; + uint32_t *src; + int i; + + spin_lock(&nss_wifi_mesh_stats_lock); + handle = nss_wifi_mesh_get_stats_handle(if_num); + if (!handle) { + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("Invalid Wi-Fi mesh stats handle, if_num: %d\n", if_num); + return; + } + + type = nss_wifi_mesh_get_interface_type(handle->if_num);; + stats = &handle->stats; + + switch (type) { + case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER: + /* + * Update pnode Rx stats. + */ + stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_PACKETS] += mstats->pnode_stats.rx_packets; + stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_BYTES] += mstats->pnode_stats.rx_bytes; + stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_DROPPED] += nss_cmn_rx_dropped_sum(&mstats->pnode_stats); + + /* + * Update pnode Tx stats. + */ + stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_PACKETS] += mstats->pnode_stats.tx_packets; + stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_BYTES] += mstats->pnode_stats.tx_bytes; + + /* + * Update encap stats. + */ + dst = &stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_SENT]; + src = &mstats->mesh_encap_stats.expiry_notify_sent; + for (i = NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_SENT; i < NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX; i++) { + *dst++ += *src++; + } + + /* + * Update mesh path stats. + */ + dst = &stats->path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_ALLOC_FAILURES]; + src = &mstats->mesh_path_stats.alloc_failures; + for (i = NSS_WIFI_MESH_PATH_STATS_TYPE_ALLOC_FAILURES; i < NSS_WIFI_MESH_PATH_STATS_TYPE_MAX; i++) { + *dst++ += *src++; + } + + /* + * Update mesh proxy path stats. + */ + dst = &stats->proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ALLOC_FAILURES]; + src = &mstats->mesh_proxy_path_stats.alloc_failures; + for (i = NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ALLOC_FAILURES; i < NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX; i++) { + *dst++ += *src++; + } + + /* + * Update exception stats. + */ + dst = &stats->except_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_SUCCESS]; + src = &mstats->mesh_except_stats.packets_success; + for (i = NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_SUCCESS; i < NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX; i++) { + *dst++ += *src++; + } + spin_unlock(&nss_wifi_mesh_stats_lock); + break; + + case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER: + /* + * Update pnode Rx stats. + */ + stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_PACKETS] += mstats->pnode_stats.rx_packets; + stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_BYTES] += mstats->pnode_stats.rx_bytes; + stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_DROPPED] += nss_cmn_rx_dropped_sum(&mstats->pnode_stats); + + /* + * Update pnode Tx stats. + */ + stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_PACKETS] += mstats->pnode_stats.tx_packets; + stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_BYTES] += mstats->pnode_stats.tx_bytes; + + /* + * Update decap stats. + */ + dst = &stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PATH_REFRESH_SENT]; + src = &mstats->mesh_decap_stats.path_refresh_sent; + for (i = NSS_WIFI_MESH_DECAP_STATS_TYPE_PATH_REFRESH_SENT; i < NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX; i++) { + *dst++ += *src++; + } + spin_unlock(&nss_wifi_mesh_stats_lock); + break; + + default: + spin_unlock(&nss_wifi_mesh_stats_lock); + nss_warning("%px: Received invalid dynamic interface type: %d\n", handle, type); + nss_assert(0); + } +} + +/* + * nss_wifi_mesh_stats_notify() + * Sends notifications to the registered modules. + * + * Leverage NSS-FW statistics timing to update Netlink. + */ +void nss_wifi_mesh_stats_notify(nss_if_num_t if_num, uint32_t core_id) +{ + struct nss_wifi_mesh_stats_notification wifi_mesh_stats; + + if (!nss_wifi_mesh_get_stats(if_num, &wifi_mesh_stats.stats)) { + nss_warning("No handle is present with ifnum: 0x%x\n", if_num); + return; + } + + wifi_mesh_stats.core_id = core_id; + wifi_mesh_stats.if_num = if_num; + atomic_notifier_call_chain(&nss_wifi_mesh_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&wifi_mesh_stats); +} + +/* + * nss_wifi_mesh_stats_dentry_create() + * Create Wi-Fi Mesh statistics debug entry + */ +struct dentry *nss_wifi_mesh_stats_dentry_create(void) +{ + struct dentry *stats_dentry_dir; + struct dentry *stats_file; + char dir_name[NSS_WIFI_MESH_DENTRY_FILE_SIZE] = {0}; + + if (!nss_top_main.stats_dentry) { + nss_warning("qca-nss-drv/stats is not present\n"); + return NULL; + } + + snprintf(dir_name, sizeof(dir_name), "wifi_mesh"); + + stats_dentry_dir = debugfs_create_dir(dir_name, nss_top_main.stats_dentry); + if (!stats_dentry_dir) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh directory\n"); + return NULL; + } + + stats_file = debugfs_create_file("encap_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_encap_stats_ops); + if (!stats_file) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/encap_stats file\n"); + goto fail; + } + + stats_file = debugfs_create_file("decap_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_decap_stats_ops); + if (!stats_file) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/decap_stats file\n"); + goto fail; + } + + stats_file = debugfs_create_file("path_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_path_stats_ops); + if (!stats_file) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/path_stats file\n"); + goto fail; + } + + stats_file = debugfs_create_file("proxy_path_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_proxy_path_stats_ops); + if (!stats_file) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/proxy_path_stats file\n"); + goto fail; + } + stats_file = debugfs_create_file("exception_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_exception_stats_ops); + if (!stats_file) { + nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/exception_stats file\n"); + goto fail; + } + return stats_dentry_dir; +fail: + debugfs_remove_recursive(stats_dentry_dir); + return NULL; +} + +/** + * nss_wifi_mesh_stats_register_notifier() + * Registers statistics notifier. + */ +int nss_wifi_mesh_stats_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&nss_wifi_mesh_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_wifi_mesh_stats_register_notifier); + +/** + * nss_wifi_mesh_stats_unregister_notifier() + * Deregisters statistics notifier. + */ +int nss_wifi_mesh_stats_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nss_wifi_mesh_stats_notifier, nb); +} +EXPORT_SYMBOL(nss_wifi_mesh_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h new file mode 100644 index 000000000..0e3a11850 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h @@ -0,0 +1,42 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_WIFI_MESH_STATS_H__ +#define __NSS_WIFI_MESH_STATS_H__ + +/** + * Array of pointer for NSS Wi-Fi mesh handles. + * Each handle has per-tunnel statistics based on the interface number which is an index. + */ +struct nss_wifi_mesh_stats_handle { + nss_if_num_t if_num; /**< Interface number. */ + uint32_t ifindex; /**< Netdev index. */ + uint32_t mesh_idx; /**< Mesh index. */ + struct nss_wifi_mesh_hdl_stats_sync_msg stats; /**< Stats per-interface number. */ +}; + +/* + * Wi-Fi Mesh statistics APIs + */ +extern void nss_wifi_mesh_update_stats(nss_if_num_t if_num, struct nss_wifi_mesh_stats_sync_msg *mstats); +extern void nss_wifi_mesh_stats_notify(nss_if_num_t if_num, uint32_t core_id); +extern struct dentry *nss_wifi_mesh_stats_dentry_create(void); +extern struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_get_stats_handle(nss_if_num_t if_num); +extern bool nss_wifi_mesh_stats_handle_alloc(nss_if_num_t if_num, int32_t ifindex); +extern bool nss_wifi_mesh_stats_handle_free(nss_if_num_t if_num); +#endif /* __NSS_WIFI_MESH_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c new file mode 100644 index 000000000..25f647323 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c @@ -0,0 +1,276 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#include "nss_stats.h" +#include "nss_core.h" +#include +#include "nss_wifi_mesh_stats.h" +#include "nss_strings.h" +#include "nss_wifi_mesh_strings.h" + +/* + * nss_wifi_mesh_strings_encap_stats + * Wi-Fi mesh encap statistics string. + */ +struct nss_stats_info nss_wifi_mesh_strings_encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX] = { + {"rx_packets", NSS_STATS_TYPE_COMMON}, + {"rx_bytes", NSS_STATS_TYPE_COMMON}, + {"tx_packets", NSS_STATS_TYPE_COMMON}, + {"tx_bytes", NSS_STATS_TYPE_COMMON}, + {"rx_dropped", NSS_STATS_TYPE_COMMON}, + {"expiry_notify_sent", NSS_STATS_TYPE_SPECIAL}, + {"mc_count", NSS_STATS_TYPE_SPECIAL}, + {"mp_not_found", NSS_STATS_TYPE_SPECIAL}, + {"mp_active", NSS_STATS_TYPE_SPECIAL}, + {"mpp_not_found", NSS_STATS_TYPE_SPECIAL}, + {"mpp_found", NSS_STATS_TYPE_SPECIAL}, + {"encap_hdr_fail", NSS_STATS_TYPE_SPECIAL}, + {"mp_del_notify_fail", NSS_STATS_TYPE_SPECIAL}, + {"link_enqueue", NSS_STATS_TYPE_SPECIAL}, + {"link_enq_fail", NSS_STATS_TYPE_SPECIAL}, + {"ra_lup_fail", NSS_STATS_TYPE_SPECIAL}, + {"dummy_add_count", NSS_STATS_TYPE_SPECIAL}, + {"encap_mp_add_notify_fail", NSS_STATS_TYPE_SPECIAL}, + {"dummy_add_fail", NSS_STATS_TYPE_SPECIAL}, + {"dummy_lup_fail", NSS_STATS_TYPE_SPECIAL}, + {"send_to_host_failed", NSS_STATS_TYPE_SPECIAL}, + {"sent_to_host", NSS_STATS_TYPE_SPECIAL}, + {"expiry_notify_fail", NSS_STATS_TYPE_SPECIAL}, + {"no_headroom", NSS_STATS_TYPE_SPECIAL}, + {"path_refresh_sent", NSS_STATS_TYPE_SPECIAL}, + {"linearise_failed", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_wifi_mesh_encap_strings_read() + * Read Wi-Fi mesh encap statistics names. + */ +static ssize_t nss_wifi_mesh_encap_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_encap_stats, NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX); +} + +/* + * nss_wifi_mesh_strings_path_stats + * Wi-Fi mesh path statistics string. + */ +struct nss_stats_info nss_wifi_mesh_strings_path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_MAX] = { + {"alloc_failures", NSS_STATS_TYPE_SPECIAL}, + {"error_max_radio_count", NSS_STATS_TYPE_SPECIAL}, + {"invalid_interface_failures", NSS_STATS_TYPE_SPECIAL}, + {"add_success", NSS_STATS_TYPE_SPECIAL}, + {"table_full_errors", NSS_STATS_TYPE_SPECIAL}, + {"insert_failures", NSS_STATS_TYPE_SPECIAL}, + {"not_found", NSS_STATS_TYPE_SPECIAL}, + {"delete_success", NSS_STATS_TYPE_SPECIAL}, + {"update_success", NSS_STATS_TYPE_SPECIAL}, + {"mesh_path_expired", NSS_STATS_TYPE_SPECIAL}, + {"mesh_path_refresh_needed", NSS_STATS_TYPE_SPECIAL}, + {"add_requests", NSS_STATS_TYPE_SPECIAL}, + {"del_requests", NSS_STATS_TYPE_SPECIAL}, + {"update_requests", NSS_STATS_TYPE_SPECIAL}, + {"next_hop_updations", NSS_STATS_TYPE_SPECIAL}, + {"hop_count_updations", NSS_STATS_TYPE_SPECIAL}, + {"flag_updations", NSS_STATS_TYPE_SPECIAL}, + {"metric_updations", NSS_STATS_TYPE_SPECIAL}, + {"block_mesh_fwd_updations", NSS_STATS_TYPE_SPECIAL}, + {"delete_failures", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_wifi_mesh_path_strings_read() + * Read Wi-Fi mesh path statistics names. + */ +static ssize_t nss_wifi_mesh_path_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_path_stats, NSS_WIFI_MESH_PATH_STATS_TYPE_MAX); +} + +/* + * nss_wifi_mesh_strings_proxy_path_stats + * Wi-Fi mesh proxy path statistics string. + */ +struct nss_stats_info nss_wifi_mesh_strings_proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX] = { + {"alloc_failures", NSS_STATS_TYPE_SPECIAL}, + {"entry_exist_failures", NSS_STATS_TYPE_SPECIAL}, + {"add_success", NSS_STATS_TYPE_SPECIAL}, + {"table_full_errors", NSS_STATS_TYPE_SPECIAL}, + {"insert_failures", NSS_STATS_TYPE_SPECIAL}, + {"not_found", NSS_STATS_TYPE_SPECIAL}, + {"unhashed_errors", NSS_STATS_TYPE_SPECIAL}, + {"delete_failures", NSS_STATS_TYPE_SPECIAL}, + {"delete_success", NSS_STATS_TYPE_SPECIAL}, + {"update_success", NSS_STATS_TYPE_SPECIAL}, + {"lookup_success", NSS_STATS_TYPE_SPECIAL}, + {"add_requests", NSS_STATS_TYPE_SPECIAL}, + {"del_requests", NSS_STATS_TYPE_SPECIAL}, + {"update_requests", NSS_STATS_TYPE_SPECIAL}, + {"mda_updations", NSS_STATS_TYPE_SPECIAL}, + {"flag_updations", NSS_STATS_TYPE_SPECIAL} +}; + +/* + * nss_wifi_mesh_proxy_path_strings_read() + * Read Wi-Fi mesh proxy path statistics names. + */ +static ssize_t nss_wifi_mesh_proxy_path_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_proxy_path_stats, NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX); +} + +/* + * nss_wifi_mesh_strings_decap_stats + * Wi-Fi mesh decap statistics string. + */ +struct nss_stats_info nss_wifi_mesh_strings_decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX] = { + {"rx_packets", NSS_STATS_TYPE_COMMON}, + {"rx_bytes", NSS_STATS_TYPE_COMMON}, + {"tx_packets", NSS_STATS_TYPE_COMMON}, + {"tx_bytes", NSS_STATS_TYPE_COMMON}, + {"rx_dropped", NSS_STATS_TYPE_COMMON}, + {"path_refresh_sent", NSS_STATS_TYPE_SPECIAL}, + {"reserved", NSS_STATS_TYPE_SPECIAL}, + {"mc_drop", NSS_STATS_TYPE_DROP}, + {"ttl_0", NSS_STATS_TYPE_SPECIAL}, + {"mpp_lup_fail", NSS_STATS_TYPE_SPECIAL}, + {"decap_hdr_fail", NSS_STATS_TYPE_SPECIAL}, + {"rx_fwd_fail", NSS_STATS_TYPE_SPECIAL}, + {"rx_fwd_success", NSS_STATS_TYPE_SPECIAL}, + {"mp_fwd_lookup_fail", NSS_STATS_TYPE_SPECIAL}, + {"mp_fwd_inactive", NSS_STATS_TYPE_SPECIAL}, + {"nxt_mnode_fwd_success", NSS_STATS_TYPE_SPECIAL}, + {"nxt_mnode_fwd_fail", NSS_STATS_TYPE_SPECIAL}, + {"mpp_add_fail", NSS_STATS_TYPE_SPECIAL}, + {"mpp_add_event2host_fail", NSS_STATS_TYPE_SPECIAL}, + {"mpp_upate_fail", NSS_STATS_TYPE_SPECIAL}, + {"mpp_update_even2host_fail", NSS_STATS_TYPE_SPECIAL}, + {"mpp_learn2host_fail", NSS_STATS_TYPE_SPECIAL}, + {"block_mesh_fwd_packets", NSS_STATS_TYPE_SPECIAL}, + {"no_headroom", NSS_STATS_TYPE_SPECIAL}, + {"linearise_failed", NSS_STATS_TYPE_SPECIAL}, + {"mpp_learn_event_rl_dropped", NSS_STATS_TYPE_DROP}, + {"mp_missging_event_rl_dropped", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_wifi_mesh_decap_strings_read() + * Read Wi-Fi mesh decap statistics names. + */ +static ssize_t nss_wifi_mesh_decap_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_decap_stats, NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX); +} + +/* + * nss_wifi_mesh_strings_exception_stats + * Wi-Fi mesh exception statistics string. + */ +struct nss_stats_info nss_wifi_mesh_strings_exception_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX] = { + {"packets_success", NSS_STATS_TYPE_SPECIAL}, + {"packets_failure", NSS_STATS_TYPE_DROP} +}; + +/* + * nss_wifi_mesh_exception_strings_read() + * Read Wi-Fi mesh exception statistics names. + */ +static ssize_t nss_wifi_mesh_exception_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) +{ + return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_exception_stats, NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX); +} + +/* + * nss_wifi_mesh_decap_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_decap_stats); + +/* + * nss_wifi_mesh_encap_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_encap_stats); + +/* + * nss_wifi_mesh_path_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_path_stats); + +/* + * nss_wifi_mesh_proxy_path_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_proxy_path_stats); + +/* + * nss_wifi_mesh_exception_strings_ops + */ +NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_exception_stats); + +/* + * nss_wifi_mesh_strings_dentry_create() + * Create Wi-Fi mesh statistics strings debug entry. + */ +struct dentry *nss_wifi_mesh_strings_dentry_create(void) +{ + struct dentry *str_dentry_dir; + struct dentry *str_file; + + if (!nss_top_main.strings_dentry) { + nss_warning("qca-nss-drv/strings is not present\n"); + return NULL; + } + + str_dentry_dir = debugfs_create_dir("wifi_mesh", nss_top_main.strings_dentry); + if (!str_dentry_dir) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh directory\n"); + return NULL; + } + + str_file = debugfs_create_file("encap_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_encap_stats_strings_ops); + if (!str_file) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/encap_stats file\n"); + goto fail; + } + + str_file = debugfs_create_file("decap_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_decap_stats_strings_ops); + if (!str_file) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/decap_stats file\n"); + goto fail; + } + + str_file = debugfs_create_file("path_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_path_stats_strings_ops); + if (!str_file) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/path_stats file\n"); + goto fail; + } + + str_file = debugfs_create_file("proxy_path_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_proxy_path_stats_strings_ops); + if (!str_file) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/proxy_path_stats file\n"); + goto fail; + } + + str_file = debugfs_create_file("exception_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_exception_stats_strings_ops); + if (!str_file) { + nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/exception_stats file\n"); + goto fail; + } + + return str_dentry_dir; +fail: + debugfs_remove_recursive(str_dentry_dir); + return NULL; +} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h new file mode 100644 index 000000000..e858cbd05 --- /dev/null +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h @@ -0,0 +1,32 @@ +/* + ************************************************************************** + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + +#ifndef __NSS_WIFI_MESH_STRINGS_H +#define __NSS_WIFI_MESH_STRINGS_H + +#include "nss_wifi_mesh_stats.h" +#include "nss_strings.h" + +extern struct nss_stats_info nss_wifi_mesh_strings_encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX]; +extern struct nss_stats_info nss_wifi_mesh_strings_decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX]; +extern struct nss_stats_info nss_wifi_mesh_strings_path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_MAX]; +extern struct nss_stats_info nss_wifi_mesh_strings_proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX]; +extern struct nss_stats_info nss_wifi_mesh_strings_exception_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX]; +extern struct dentry *nss_wifi_mesh_strings_dentry_create(void); + +#endif /* __NSS_WIFI_MESH_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c index 43e8d0b13..c1904e465 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c @@ -1,6 +1,6 @@ /* ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -20,9 +20,15 @@ #include "nss_wifili_strings.h" #define NSS_WIFILI_TX_TIMEOUT 1000 /* Millisecond to jiffies*/ -#define NSS_WIFILI_INVALID_SCHEME_ID -1 -#define NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX 4 - /* Maximum number of thread scheme entries. */ +#define NSS_WIFILI_INVALID_SCHEME_ID -1 +#define NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX 4 /* Maximum number of thread scheme entries. */ +#define NSS_WIFILI_EXTERNAL_INTERFACE_MAX 2 /* Maximum external I/F supported */ + +/* + * NSS external interface number table + */ +nss_if_num_t nss_wifili_external_tbl[NSS_WIFILI_EXTERNAL_INTERFACE_MAX] = + {NSS_WIFILI_EXTERNAL_INTERFACE0, NSS_WIFILI_EXTERNAL_INTERFACE1}; /* * nss_wifili_thread_scheme_entry @@ -47,6 +53,24 @@ struct nss_wifili_thread_scheme_db { /* Metadata for each of scheme. */ }; +/* + * nss_wifili_external_if_state_tbl + * External interface state table + */ +struct nss_wifili_external_if_state_tbl { + nss_if_num_t ifnum; + bool in_use; +}; + +/* + * nss_wifili_external_if_info + * Wifili external interface info + */ +struct nss_wifili_external_if_info { + spinlock_t lock; + struct nss_wifili_external_if_state_tbl state_tbl[NSS_WIFILI_EXTERNAL_INTERFACE_MAX]; +} nss_wifi_eif_info; + /* * nss_wifili_pvt * Private data structure @@ -257,28 +281,66 @@ struct nss_ctx_instance *nss_wifili_get_context(void) } EXPORT_SYMBOL(nss_wifili_get_context); +/* + * nss_wifili_release_external_if() + * Release the external interface. + */ +void nss_wifili_release_external_if(nss_if_num_t ifnum) +{ + uint32_t idx; + + spin_lock_bh(&nss_wifi_eif_info.lock); + for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { + if (nss_wifi_eif_info.state_tbl[idx].ifnum != ifnum) { + continue; + } + + if (!nss_wifi_eif_info.state_tbl[idx].in_use) { + spin_unlock_bh(&nss_wifi_eif_info.lock); + nss_warning("%px: I/F num:%d is not in use\n", &nss_wifi_eif_info, ifnum); + return; + } + + nss_wifi_eif_info.state_tbl[idx].in_use = false; + break; + } + + spin_unlock_bh(&nss_wifi_eif_info.lock); + + if (idx == NSS_WIFILI_EXTERNAL_INTERFACE_MAX) { + nss_warning("%px: Trying to release invalid ifnum:%d\n", &nss_wifi_eif_info, ifnum); + } +} +EXPORT_SYMBOL(nss_wifili_release_external_if); + /* * nss_get_available_wifili_external_if() * Check and return the available external interface */ -uint32_t nss_get_available_wifili_external_if(void) +nss_if_num_t nss_get_available_wifili_external_if(void) { - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; + nss_if_num_t ifnum = -1; + uint32_t idx; + /* * Check if the external interface is registered. * Return the interface number if not registered. */ - if (!(nss_ctx->subsys_dp_register[NSS_WIFILI_EXTERNAL_INTERFACE0].ndev)) { - return NSS_WIFILI_EXTERNAL_INTERFACE0; + spin_lock_bh(&nss_wifi_eif_info.lock); + for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { + if (nss_wifi_eif_info.state_tbl[idx].in_use) { + continue; + } + + nss_wifi_eif_info.state_tbl[idx].in_use = true; + ifnum = nss_wifi_eif_info.state_tbl[idx].ifnum; + break; } - if (!(nss_ctx->subsys_dp_register[NSS_WIFILI_EXTERNAL_INTERFACE1].ndev)) { - return NSS_WIFILI_EXTERNAL_INTERFACE1; - } + spin_unlock_bh(&nss_wifi_eif_info.lock); - nss_warning("%px: No available external intefaces\n", nss_ctx); - - return NSS_MAX_NET_INTERFACES; + BUG_ON(idx == NSS_WIFILI_EXTERNAL_INTERFACE_MAX); + return ifnum; } EXPORT_SYMBOL(nss_get_available_wifili_external_if); @@ -534,6 +596,7 @@ void nss_unregister_wifili_if(uint32_t if_num) || (if_num == NSS_WIFILI_EXTERNAL_INTERFACE1)); nss_core_unregister_subsys_dp(nss_ctx, if_num); + nss_wifili_release_external_if(if_num); } EXPORT_SYMBOL(nss_unregister_wifili_if); @@ -583,6 +646,7 @@ EXPORT_SYMBOL(nss_unregister_wifili_radio_if); void nss_wifili_register_handler(void) { struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; + uint32_t idx; nss_info("nss_wifili_register_handler"); nss_core_register_handler(nss_ctx, NSS_WIFILI_INTERNAL_INTERFACE, nss_wifili_handler, NULL); @@ -594,4 +658,13 @@ void nss_wifili_register_handler(void) sema_init(&wifili_pvt.sem, 1); init_completion(&wifili_pvt.complete); + + /* + * Intialize the external interfaces info. + */ + spin_lock_init(&nss_wifi_eif_info.lock); + for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { + nss_wifi_eif_info.state_tbl[idx].ifnum = nss_wifili_external_tbl[idx]; + nss_wifi_eif_info.state_tbl[idx].in_use = false; + } } diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c index add36990d..6f983bcf5 100644 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c +++ b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c @@ -458,7 +458,7 @@ void nss_wifili_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) struct nss_wifili_stats_notification *wifili_stats; uint32_t index = 0; - wifili_stats = kzalloc(sizeof(struct nss_wifili_stats_notification), GFP_KERNEL); + wifili_stats = kzalloc(sizeof(struct nss_wifili_stats_notification), GFP_ATOMIC); if (!wifili_stats) { nss_warning("%px: Failed to allocate memory for wifili stats\n", nss_ctx); return; diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin index da083e859..56b20c27d 100755 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin and b/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin differ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin index e94173757..75e2d925b 100755 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin and b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin differ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin index 6899db883..b191ba8f6 100755 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin and b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin differ diff --git a/feeds/ipq807x/qca-ssdk/patches/100-aq.patch b/feeds/ipq807x/qca-ssdk/patches/100-aq.patch index 45a3c0cb6..17d28f6bb 100644 --- a/feeds/ipq807x/qca-ssdk/patches/100-aq.patch +++ b/feeds/ipq807x/qca-ssdk/patches/100-aq.patch @@ -2,13 +2,6 @@ Index: qca-ssdk/include/hsl/phy/hsl_phy.h =================================================================== --- qca-ssdk.orig/include/hsl/phy/hsl_phy.h +++ qca-ssdk/include/hsl/phy/hsl_phy.h -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015, 2017-2020, The Linux Foundation. All rights reserved. -+ * Copyright (c) 2015, 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. @@ -541,6 +541,7 @@ typedef struct { #define QCA8033_PHY 0x004DD074 #define QCA8035_PHY 0x004DD072 diff --git a/feeds/ipq807x/qca-ssdk/src/include/adpt/adpt.h b/feeds/ipq807x/qca-ssdk/src/include/adpt/adpt.h old mode 100644 new mode 100755 index 28978270a..b497350af --- a/feeds/ipq807x/qca-ssdk/src/include/adpt/adpt.h +++ b/feeds/ipq807x/qca-ssdk/src/include/adpt/adpt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -887,6 +887,10 @@ typedef sw_error_t (*adpt_policer_time_slot_set_func)(a_uint32_t dev_id, a_uint3 typedef sw_error_t (*adpt_policer_global_counter_get_func)(a_uint32_t dev_id, fal_policer_global_counter_t *counter); +typedef sw_error_t (*adpt_policer_bypass_en_set_func)(a_uint32_t dev_id, + fal_policer_frame_type_t frame_type, a_bool_t enable); +typedef sw_error_t (*adpt_policer_bypass_en_get_func)(a_uint32_t dev_id, + fal_policer_frame_type_t frame_type, a_bool_t *enable); /* misc */ typedef sw_error_t (*adpt_debug_port_counter_enable_func)(a_uint32_t dev_id, @@ -1497,6 +1501,8 @@ typedef struct adpt_port_compensation_byte_set_func adpt_port_compensation_byte_set; adpt_policer_time_slot_set_func adpt_policer_time_slot_set; adpt_policer_global_counter_get_func adpt_policer_global_counter_get; + adpt_policer_bypass_en_set_func adpt_policer_bypass_en_set; + adpt_policer_bypass_en_get_func adpt_policer_bypass_en_get; /* misc */ adpt_debug_port_counter_enable_func adpt_debug_port_counter_enable; diff --git a/feeds/ipq807x/qca-ssdk/src/include/adpt/mp/adpt_mp_portctrl.h b/feeds/ipq807x/qca-ssdk/src/include/adpt/mp/adpt_mp_portctrl.h index 8eb35ad8d..364a28544 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/adpt/mp/adpt_mp_portctrl.h +++ b/feeds/ipq807x/qca-ssdk/src/include/adpt/mp/adpt_mp_portctrl.h @@ -18,25 +18,43 @@ #define _ADPT_PORTCTRL_H_ -#define GMAC_SPEED_10M 0x0 -#define GMAC_SPEED_100M 0x1 -#define GMAC_SPEED_1000M 0x0 -#define GMAC_FULL_DUPLEX 0x1 -#define GMAC_HALF_DUPLEX 0x0 -#define GMAC_PAUSE_TIME 0xffff -#define GMAC_PAUSE_ZERO_QUANTA_ENABLE 0x0 -#define GMAC_JD_ENABLE 0x1 -#define GMAC_WD_DISABLE 0x0 -#define GMAC_FRAME_BURST_ENABLE 0x1 -#define GMAC_JUMBO_FRAME_ENABLE 0x1 -#define GMAC_MAX_FRAME_CTRL_ENABLE 0x1 -#define GMAC_LPI_LINK_UP 0x1 -#define GMAC_LPI_AUTO_MODE 0x1 -#define GMAC_TX_STORE_FORWAD_ENABLE 0x1 -#define GMAC_RX_STORE_FORWAD_ENABLE 0x1 -#define GMAC_FORWARD_ERROR_FRAME_DISABLE 0x0 -#define GMAC_DROP_GAINT_FRAME_DISABLE 0x0 -#define GMAC_HW_FLOWCTRL_ENABLE 0x1 +#define GMAC_SPEED_10M 0x0 +#define GMAC_SPEED_100M 0x1 +#define GMAC_SPEED_1000M 0x0 +#define GMAC_FULL_DUPLEX 0x1 +#define GMAC_HALF_DUPLEX 0x0 +#define GMAC_PAUSE_TIME 0xffff +#define GMAC_PAUSE_ZERO_QUANTA_ENABLE 0x0 +#define GMAC_JD_ENABLE 0x1 +#define GMAC_WD_DISABLE 0x0 +#define GMAC_FRAME_BURST_ENABLE 0x1 +#define GMAC_JUMBO_FRAME_ENABLE 0x1 +#define GMAC_MAX_FRAME_CTRL_ENABLE 0x1 +#define GMAC_LPI_LINK_UP 0x1 +#define GMAC_LPI_AUTO_MODE 0x1 +#define GMAC_TX_STORE_FORWAD_ENABLE 0x1 +#define GMAC_RX_STORE_FORWAD_ENABLE 0x1 +#define GMAC_FORWARD_ERROR_FRAME_DISABLE 0x0 +#define GMAC_DROP_GAINT_FRAME_DISABLE 0x0 +#define GMAC_FLUSH_RECEIVED_FRAMES_DISABLE 0x1 +#define GMAC_HW_FLOWCTRL_ENABLE 0x1 +#define GMAC_ACTIVATE_FLOWCTRL_MASK 0x800600 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_1KB 0x0 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_2KB 0x200 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_3KB 0x400 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_4KB 0x600 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_5KB 0x800000 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_6KB 0x800200 +#define GMAC_ACTIVATE_FLOWCTRL_WITH_7KB 0x800400 +#define GMAC_DACTIVATE_FLOWCTRL_MASK 0x401800 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_1KB 0x0 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_2KB 0x800 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_3KB 0x1000 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_4KB 0x1800 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_5KB 0x400000 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_6KB 0x400800 +#define GMAC_DACTIVATE_FLOWCTRL_WITH_7KB 0x401000 + #define GMAC_HW_FLOWCTRL_DISABLE 0x0 #define PORT_LPI_ENABLE_STATUS 0x3 #define PORT_LPI_TASK_RUNNING 0x10000 diff --git a/feeds/ipq807x/qca-ssdk/src/include/api/api_desc.h b/feeds/ipq807x/qca-ssdk/src/include/api/api_desc.h index 078728f06..388f45476 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/api/api_desc.h +++ b/feeds/ipq807x/qca-ssdk/src/include/api/api_desc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2015-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -4370,6 +4370,15 @@ extern "C" { sizeof(fal_policer_global_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, \ "Global Statistics"), +#define SW_API_POLICER_BYPASS_EN_SET_DESC \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "frame_type"), \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), + +#define SW_API_POLICER_BYPASS_EN_GET_DESC \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "frame_type"), \ + SW_PARAM_DEF(SW_API_POLICER_BYPASS_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), #define SW_API_PTP_CONFIG_SET_DESC \ SW_PARAM_DEF(SW_API_PTP_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ diff --git a/feeds/ipq807x/qca-ssdk/src/include/api/sw_ioctl.h b/feeds/ipq807x/qca-ssdk/src/include/api/sw_ioctl.h index fd26b5dea..5c404e346 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/api/sw_ioctl.h +++ b/feeds/ipq807x/qca-ssdk/src/include/api/sw_ioctl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2015-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -847,6 +847,8 @@ extern "C" { #define SW_API_POLICER_ACL_ENTRY_SET (8 + SW_API_POLICER_OFFSET) #define SW_API_POLICER_ACL_ENTRY_GET (9 + SW_API_POLICER_OFFSET) #define SW_API_POLICER_GLOBAL_COUNTER_GET (10 + SW_API_POLICER_OFFSET) +#define SW_API_POLICER_BYPASS_EN_SET (11 + SW_API_POLICER_OFFSET) +#define SW_API_POLICER_BYPASS_EN_GET (12 + SW_API_POLICER_OFFSET) /* SHAPER */ diff --git a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_api.h b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_api.h index dcd6f0af3..51aff5701 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_api.h +++ b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2015-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -479,6 +479,9 @@ extern "C" { SW_API_DEF(SW_API_GLOBAL_QINQ_MODE_GET, fal_global_qinq_mode_get), \ SW_API_DEF(SW_API_PORT_QINQ_MODE_SET, fal_port_qinq_mode_set), \ SW_API_DEF(SW_API_PORT_QINQ_MODE_GET, fal_port_qinq_mode_get), \ + SW_API_DEF(SW_API_QINQ_MODE_SET, fal_qinq_mode_set), \ + SW_API_DEF(SW_API_PT_QINQ_ROLE_SET, fal_port_qinq_role_set), \ + SW_API_DEF(SW_API_PT_VLAN_TRANS_ADD, fal_port_vlan_trans_add), \ SW_API_DEF(SW_API_TPID_SET, fal_ingress_tpid_set), \ SW_API_DEF(SW_API_TPID_GET, fal_ingress_tpid_get), \ SW_API_DEF(SW_API_EGRESS_TPID_SET, fal_egress_tpid_set), \ @@ -522,6 +525,9 @@ extern "C" { SW_API_DESC(SW_API_GLOBAL_QINQ_MODE_GET) \ SW_API_DESC(SW_API_PORT_QINQ_MODE_SET) \ SW_API_DESC(SW_API_PORT_QINQ_MODE_GET) \ + SW_API_DESC(SW_API_QINQ_MODE_SET) \ + SW_API_DESC(SW_API_PT_QINQ_ROLE_SET) \ + SW_API_DESC(SW_API_PT_VLAN_TRANS_ADD) \ SW_API_DESC(SW_API_TPID_SET) \ SW_API_DESC(SW_API_TPID_GET) \ SW_API_DESC(SW_API_EGRESS_TPID_SET) \ @@ -2138,8 +2144,9 @@ extern "C" { SW_API_DEF(SW_API_POLICER_PORT_ENTRY_GET, fal_port_policer_entry_get), \ SW_API_DEF(SW_API_POLICER_ACL_ENTRY_SET, fal_acl_policer_entry_set), \ SW_API_DEF(SW_API_POLICER_ACL_ENTRY_GET,fal_acl_policer_entry_get), \ - SW_API_DEF(SW_API_POLICER_GLOBAL_COUNTER_GET, fal_policer_global_counter_get), - + SW_API_DEF(SW_API_POLICER_GLOBAL_COUNTER_GET, fal_policer_global_counter_get), \ + SW_API_DEF(SW_API_POLICER_BYPASS_EN_SET, fal_policer_bypass_en_set), \ + SW_API_DEF(SW_API_POLICER_BYPASS_EN_GET, fal_policer_bypass_en_get), #define POLICER_API_PARAM \ SW_API_DESC(SW_API_POLICER_TIMESLOT_SET) \ @@ -2152,7 +2159,9 @@ extern "C" { SW_API_DESC(SW_API_POLICER_PORT_ENTRY_GET) \ SW_API_DESC(SW_API_POLICER_ACL_ENTRY_SET) \ SW_API_DESC(SW_API_POLICER_ACL_ENTRY_GET) \ - SW_API_DESC(SW_API_POLICER_GLOBAL_COUNTER_GET) + SW_API_DESC(SW_API_POLICER_GLOBAL_COUNTER_GET) \ + SW_API_DESC(SW_API_POLICER_BYPASS_EN_SET) \ + SW_API_DESC(SW_API_POLICER_BYPASS_EN_GET) #else #define POLICER_API \ SW_API_DEF(SW_API_POLICER_TIMESLOT_SET, fal_policer_timeslot_set), \ diff --git a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_policer.h b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_policer.h index 6a2c42bf0..b54092c01 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_policer.h +++ b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_policer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -95,9 +95,15 @@ enum FUNC_ADPT_PORT_COMPENSATION_BYTE_SET, FUNC_ADPT_POLICER_TIME_SLOT_SET, FUNC_ADPT_POLICER_GLOBAL_COUNTER_GET, + FUNC_ADPT_POLICER_BYPASS_EN_SET, + FUNC_ADPT_POLICER_BYPASS_EN_GET, }; +typedef enum { + FAL_FRAME_DROPPED = 0, +} fal_policer_frame_type_t; + #ifndef IN_POLICER_MINI sw_error_t fal_port_policer_entry_set(a_uint32_t dev_id, fal_port_t port_id, @@ -134,6 +140,9 @@ sw_error_t fal_policer_global_counter_get(a_uint32_t dev_id, fal_policer_global_counter_t *counter); +sw_error_t +fal_policer_bypass_en_get(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t *enable); #endif sw_error_t @@ -143,6 +152,9 @@ fal_port_policer_compensation_byte_set(a_uint32_t dev_id, fal_port_t port_id, sw_error_t fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot); +sw_error_t +fal_policer_bypass_en_set(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t enable); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_portvlan.h b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_portvlan.h index b759ef8c2..2eb8c6483 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_portvlan.h +++ b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_portvlan.h @@ -415,8 +415,18 @@ enum { fal_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_propagation_mode_t mode); + sw_error_t + fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t role); + + + sw_error_t + fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode); + + sw_error_t + fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry); + + #ifndef IN_PORTVLAN_MINI - sw_error_t @@ -424,10 +434,6 @@ enum { fal_vlan_propagation_mode_t * mode); - sw_error_t - fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry); - - sw_error_t fal_port_vlan_trans_del(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry); @@ -436,18 +442,10 @@ enum { fal_port_vlan_trans_get(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry); - sw_error_t - fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode); - - sw_error_t fal_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode); - sw_error_t - fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t role); - - sw_error_t fal_port_qinq_role_get(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t * role); @@ -493,10 +491,12 @@ enum { #define FAL_GLOBAL_QINQ_MODE_INGRESS_EN (0x1UL << 0) #define FAL_GLOBAL_QINQ_MODE_EGRESS_EN (0x1UL << 1) +#define FAL_GLOBAL_QINQ_MODE_EGRESS_UNTOUCHED_FOR_CPU_CODE (0x1UL << 2) typedef struct { a_uint32_t mask;/*bit 0 for ingress and bit 1 for egress*/ fal_qinq_mode_t ingress_mode; /* ingress direction mode */ fal_qinq_mode_t egress_mode; /* egress direction mode */ + a_bool_t untouched_for_cpucode; /*egress untouched with cpu_code!=0 to cpu port 0 */ } fal_global_qinq_mode_t; #define FAL_PORT_QINQ_ROLE_INGRESS_EN (0x1UL << 0) diff --git a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_trunk.h b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_trunk.h old mode 100755 new mode 100644 index 0b5bb5429..d25296159 --- a/feeds/ipq807x/qca-ssdk/src/include/fal/fal_trunk.h +++ b/feeds/ipq807x/qca-ssdk/src/include/fal/fal_trunk.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2016-2018, 2020, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -32,14 +32,14 @@ extern "C" { #define FAL_TRUNK_HASH_KEY_SA 0x2 #define FAL_TRUNK_HASH_KEY_DIP 0x4 #define FAL_TRUNK_HASH_KEY_SIP 0x8 -#define FAL_TRUNK_HASH_KEY_SRC_PORT 0x10 -#define FAL_TRUNK_HASH_KEY_L4_SRC_PORT 0x20 -#define FAL_TRUNK_HASH_KEY_L4_DST_PORT 0x40 -#define FAL_TRUNK_HASH_KEY_UDF0 0x80 -#define FAL_TRUNK_HASH_KEY_UDF1 0x100 -#define FAL_TRUNK_HASH_KEY_UDF2 0x200 -#define FAL_TRUNK_HASH_KEY_UDF3 0x400 -#define FAL_TRUNK_GROUP_MAX_MEMEBER 4 +#define FAL_TRUNK_HASH_KEY_SRC_PORT 0x10 +#define FAL_TRUNK_HASH_KEY_L4_SRC_PORT 0x20 +#define FAL_TRUNK_HASH_KEY_L4_DST_PORT 0x40 +#define FAL_TRUNK_HASH_KEY_UDF0 0x80 +#define FAL_TRUNK_HASH_KEY_UDF1 0x100 +#define FAL_TRUNK_HASH_KEY_UDF2 0x200 +#define FAL_TRUNK_HASH_KEY_UDF3 0x400 +#define FAL_TRUNK_GROUP_MAX_MEMEBER 8 enum { FUNC_TRUNK_GROUP_SET = 0, diff --git a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan.h b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan.h index 232ca4480..2a4a77959 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan.h +++ b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan.h @@ -43,6 +43,16 @@ hppe_port_parsing_reg_set( a_uint32_t index, union port_parsing_reg_u *value); +sw_error_t +hppe_edma_vlan_tpid_reg_get( + a_uint32_t dev_id, + union edma_vlan_tpid_reg_u *value); + +sw_error_t +hppe_edma_vlan_tpid_reg_set( + a_uint32_t dev_id, + union edma_vlan_tpid_reg_u *value); + sw_error_t hppe_vlan_tpid_reg_get( a_uint32_t dev_id, @@ -1356,6 +1366,14 @@ hppe_eg_bridge_config_bridge_type_set( unsigned int value); sw_error_t +hppe_eg_bridge_config_pkt_l2_edit_en_get( + a_uint32_t dev_id, + a_uint32_t *value); +sw_error_t +hppe_eg_bridge_config_pkt_l2_edit_en_set( + a_uint32_t dev_id, + a_uint32_t value); +sw_error_t hppe_eg_bridge_config_queue_cnt_en_get( a_uint32_t dev_id, unsigned int *value); diff --git a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan_reg.h b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan_reg.h index 5a918d9f5..1a79643bb 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan_reg.h +++ b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_portvlan_reg.h @@ -43,6 +43,34 @@ union port_parsing_reg_u { struct port_parsing_reg bf; }; +/*[register] EDMA_VLAN_TPID_REG*/ +#define EDMA_VLAN_TPID_REG +#define EDMA_VLAN_TPID_REG_ADDRESS 0x8 +#define EDMA_VLAN_TPID_REG_NUM 1 +#define EDMA_VLAN_TPID_REG_INC 0x4 +#define EDMA_VLAN_TPID_REG_TYPE REG_TYPE_RW +#define EDMA_VLAN_TPID_REG_DEFAULT 0x810088a8 + /*[field] STAG_TPID*/ + #define EDMA_VLAN_TPID_REG_STAG_TPID + #define EDMA_VLAN_TPID_REG_STAG_TPID_OFFSET 0 + #define EDMA_VLAN_TPID_REG_STAG_TPID_LEN 16 + #define EDMA_VLAN_TPID_REG_STAG_TPID_DEFAULT 0x88a8 + /*[field] CTAG_TPID*/ + #define EDMA_VLAN_TPID_REG_CTAG_TPID + #define EDMA_VLAN_TPID_REG_CTAG_TPID_OFFSET 16 + #define EDMA_VLAN_TPID_REG_CTAG_TPID_LEN 16 + #define EDMA_VLAN_TPID_REG_CTAG_TPID_DEFAULT 0x8100 + +struct edma_vlan_tpid_reg { + a_uint32_t stag_tpid:16; + a_uint32_t ctag_tpid:16; +}; + +union edma_vlan_tpid_reg_u { + a_uint32_t val; + struct edma_vlan_tpid_reg bf; +}; + /*[register] VLAN_TPID_REG*/ #define VLAN_TPID_REG #define VLAN_TPID_REG_ADDRESS 0x20 @@ -869,11 +897,11 @@ union eg_vlan_tpid_u { #define EG_BRIDGE_CONFIG_BRIDGE_TYPE_OFFSET 0 #define EG_BRIDGE_CONFIG_BRIDGE_TYPE_LEN 1 #define EG_BRIDGE_CONFIG_BRIDGE_TYPE_DEFAULT 0x0 - /*[field] PKT_LE_EDIT_BYPASS*/ - #define EG_BRIDGE_CONFIG_PKT_LE_EDIT_BYPASS - #define EG_BRIDGE_CONFIG_PKT_LE_EDIT_BYPASS_OFFSET 1 - #define EG_BRIDGE_CONFIG_PKT_LE_EDIT_BYPASS_LEN 1 - #define EG_BRIDGE_CONFIG_PKT_LE_EDIT_BYPASS_DEFAULT 0x0 + /*[field] PKT_L2_EDIT_EN*/ + #define EG_BRIDGE_CONFIG_PKT_L2_EDIT_EN + #define EG_BRIDGE_CONFIG_PKT_L2_EDIT_EN_OFFSET 1 + #define EG_BRIDGE_CONFIG_PKT_L2_EDIT_EN_LEN 1 + #define EG_BRIDGE_CONFIG_PKT_L2_EDIT_EN_DEFAULT 0x0 /*[field] QUEUE_CNT_EN*/ #define EG_BRIDGE_CONFIG_QUEUE_CNT_EN #define EG_BRIDGE_CONFIG_QUEUE_CNT_EN_OFFSET 2 @@ -882,7 +910,7 @@ union eg_vlan_tpid_u { struct eg_bridge_config { a_uint32_t bridge_type:1; - a_uint32_t pkt_le_edit_bypass:1; + a_uint32_t pkt_l2_edit_en:1; a_uint32_t queue_cnt_en:1; a_uint32_t _reserved0:29; }; diff --git a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_reg_access.h b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_reg_access.h index 7b0f56a6f..9ecc4c8ad 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_reg_access.h +++ b/feeds/ipq807x/qca-ssdk/src/include/hsl/hppe/hppe_reg_access.h @@ -23,6 +23,7 @@ extern "C" { #include "sw.h" +#define EDMA_CSR_BASE_ADDR 0xb00000 #define IPE_L3_BASE_ADDR 0x200000 #define QUEUE_MANAGER_BASE_ADDR 0x800000 #define TRAFFIC_MANAGER_BASE_ADDR 0x400000 diff --git a/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/hsl_phy.h b/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/hsl_phy.h index 7597aeba7..4621e725d 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/hsl_phy.h +++ b/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/hsl_phy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015, 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -563,7 +563,7 @@ typedef struct { #define QCA8035_PHY 0x004DD072 /*qca808x_start*/ #define QCA8081_PHY_V1_1 0x004DD101 -#define INVALID_PHY_ID 0 +#define INVALID_PHY_ID 0xFFFFFFFF /*qca808x_end*/ #define F1V1_PHY 0x004DD033 diff --git a/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/mpge_phy.h b/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/mpge_phy.h index 7c750721d..7854389d7 100644 --- a/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/mpge_phy.h +++ b/feeds/ipq807x/qca-ssdk/src/include/hsl/phy/mpge_phy.h @@ -72,7 +72,7 @@ extern "C" #define MPGE_PHY_MMD3_CDT_THRESH_CTRL13 0x807e #define MPGE_PHY_MMD3_CDT_THRESH_CTRL14 0x807f - /*MMD3 register field*/ +/*MMD3 register field*/ #define MPGE_PHY_MMD3_AZ_CTRL1_VAL 0x7880 #define MPGE_PHY_MMD3_AZ_CTRL2_VAL 0xc8 #define MPGE_PHY_MMD3_CDT_THRESH_CTRL3_VAL 0xc040 @@ -87,6 +87,12 @@ extern "C" /*debug register*/ #define MPGE_PHY_DEBUG_EDAC 0x4380 +/*debug port analog*/ +#define MPGE_PHY_DEBUG_ANA_LDO_EFUSE 0x180 +#define MPGE_PHY_DEBUG_ANA_DAC_FILTER 0xa080 + +#define MPGE_PHY_DEBUG_ANA_LDO_EFUSE_DEFAULT 0x50 + int mpge_phy_init(a_uint32_t dev_id, a_uint32_t port_bmp); #ifdef __cplusplus diff --git a/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_clk.h b/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_clk.h index ccc8ca605..e03c76a04 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_clk.h +++ b/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_clk.h @@ -291,6 +291,9 @@ void ssdk_uniphy_raw_clock_set( a_uint8_t uniphy_index, a_uint8_t direction, a_uint32_t clock); +void ssdk_gcc_uniphy_sys_set(a_uint32_t dev_id, a_uint32_t uniphy_index, + a_bool_t enable); +void ssdk_uniphy_port5_clock_source_set(void); #endif #if defined(MP) @@ -298,6 +301,9 @@ void ssdk_mp_raw_clock_set( a_uint8_t uniphy_index, a_uint8_t direction, a_uint32_t clock); +void ssdk_mp_gephy_icc_efuse_load_enable( + a_bool_t enable); + #endif #ifdef __cplusplus diff --git a/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_plat.h b/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_plat.h old mode 100644 new mode 100755 index a0735e78b..1463102ed --- a/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_plat.h +++ b/feeds/ipq807x/qca-ssdk/src/include/init/ssdk_plat.h @@ -189,7 +189,8 @@ enum { /*qca808x_end*/ /*poll mib per 120secs*/ #define QCA_PHY_MIB_WORK_DELAY 120000 -#define QCA_MIB_ITEM_NUMBER 41 +#define QCA_MIB_ITEM_NUMBER \ + (sizeof(fal_mib_counter_t)/sizeof(a_uint64_t)) #define SSDK_MAX_UNIPHY_INSTANCE 3 #define SSDK_UNIPHY_INSTANCE0 0 @@ -246,9 +247,9 @@ extern a_uint32_t ssdk_log_level; if (SSDK_LOG_LEVEL_##lev <= ssdk_log_level) {\ a_uint32_t i_buf = 0;\ for(i_buf=0; i_buf<(len); i_buf++) {\ - printk("%08lx ", *((buf)+i_buf));\ + printk(KERN_CONT "%08lx ", *((buf)+i_buf));\ }\ - printk("\n");\ + printk(KERN_CONT "\n");\ }\ } while(0) diff --git a/feeds/ipq807x/qca-ssdk/src/include/ref/ref_port_ctrl.h b/feeds/ipq807x/qca-ssdk/src/include/ref/ref_port_ctrl.h index 5ddc38ad0..b614c95d6 100755 --- a/feeds/ipq807x/qca-ssdk/src/include/ref/ref_port_ctrl.h +++ b/feeds/ipq807x/qca-ssdk/src/include/ref/ref_port_ctrl.h @@ -44,13 +44,17 @@ typedef struct{ #if defined(IN_SWCONFIG) int qca_ar8327_sw_get_port_link(struct switch_dev *dev, int port, - struct switch_port_link *link); + struct switch_port_link *link); +int qca_ar8327_sw_set_eee(struct switch_dev *dev, + const struct switch_attr *attr, struct switch_val *val); +int qca_ar8327_sw_get_eee(struct switch_dev *dev, + const struct switch_attr *attr, struct switch_val *val); #endif int ssdk_port_link_notify_register(struct notifier_block *nb); int ssdk_port_link_notify_unregister(struct notifier_block *nb); int ssdk_port_link_notify(unsigned char port_id, - unsigned char link, unsigned char speed, unsigned char duplex); + unsigned char link, unsigned char speed, unsigned char duplex); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_acl.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_acl.c index a79138b13..b0e682cde 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_acl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_acl.c @@ -319,9 +319,9 @@ static void _adpt_acl_reg_dump(a_uint8_t *reg, a_uint32_t len) for(i = 0; i < len; i++) { - if(i%32 == 0) - printk("\n"); - printk("%02x ", reg[i]); + printk(KERN_CONT "%02x ", reg[i]); + if((i+1)%32 == 0 || (i == len-1)) + printk(KERN_CONT "\n"); } return; @@ -1971,7 +1971,9 @@ _adpt_hppe_acl_l2_fields_check(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t } if((FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_MAC_ETHTYPE)) || - (FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_PPPOE_SESSIONID))) + (FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_PPPOE_SESSIONID)) || + ((FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_MAC_STAG_VID)) && + (rule->stag_vid_op != FAL_ACL_FIELD_MASK))) { SSDK_DEBUG("select L2 MISC rule\n"); l2_rule_type_map |= (1<field_flg, FAL_ACL_FIELD_MAC_STAG_VID)) { - if(rule->stag_vid_op == FAL_ACL_FIELD_MASK) - { SSDK_DEBUG("select VLAN rule\n"); l2_rule_type_map |= (1<ctag_fmt_mask = rule->ctagged_mask; } /*stag*/ - if(FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_MAC_STAG_VID)) + if(FAL_FIELD_FLG_TST(rule->field_flg, FAL_ACL_FIELD_MAC_STAG_VID) && + (rule->stag_vid_op == FAL_ACL_FIELD_MASK)) { vlanrule->svid = rule->stag_vid_val; vlanrule_mask->svid_mask = rule->stag_vid_mask; @@ -3687,14 +3682,11 @@ _adpt_hppe_acl_rule_dump(a_uint32_t dev_id, a_uint32_t list_id, ADPT_HPPE_ACL_SW hw_list_id*ADPT_ACL_ENTRY_NUM_PER_LIST+i, &hw_act); printk("hw_entry %d\n", hw_list_id*ADPT_ACL_ENTRY_NUM_PER_LIST+i); _adpt_acl_reg_dump((u_int8_t *)&hw_reg, sizeof(hw_reg)); - printk("\n"); printk("hw_entry_mask %d\n", hw_list_id*ADPT_ACL_ENTRY_NUM_PER_LIST+i); _adpt_acl_reg_dump((u_int8_t *)&hw_mask, sizeof(hw_mask)); - printk("\n"); printk("hw_action %d\n", hw_list_id*ADPT_ACL_ENTRY_NUM_PER_LIST+i); _adpt_acl_reg_dump((u_int8_t *)&hw_act, sizeof(hw_act)); - printk("\n"); } } } diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_misc.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_misc.c index 104c3652c..e3dbd31e1 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_misc.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_misc.c @@ -516,16 +516,16 @@ adpt_hppe_debug_prx_drop_cnt_get(void) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15u(port=%04d)", value, i); + printk(KERN_CONT "%15u(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -549,16 +549,16 @@ adpt_hppe_debug_prx_drop_pkt_stat_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -585,16 +585,16 @@ adpt_hppe_debug_ipx_pkt_num_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -616,16 +616,16 @@ adpt_hppe_debug_vlan_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(vsi=%04d)", value, i); + printk(KERN_CONT "%15llu(vsi=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -647,16 +647,16 @@ adpt_hppe_debug_pre_l2_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(vsi=%04d)", value, i); + printk(KERN_CONT "%15llu(vsi=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); sign = tags = 0; printk("%-35s", "PRE_L2_CNT_TBL RX_DROP:"); @@ -670,16 +670,16 @@ adpt_hppe_debug_pre_l2_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(vsi=%04d)", value, i); + printk(KERN_CONT "%15llu(vsi=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void adpt_hppe_debug_port_tx_drop_counter_get(a_bool_t show_type) @@ -700,16 +700,16 @@ void adpt_hppe_debug_port_tx_drop_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -731,16 +731,16 @@ adpt_hppe_debug_eg_vsi_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(vsi=%04d)", value, i); + printk(KERN_CONT "%15llu(vsi=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -762,16 +762,16 @@ adpt_hppe_debug_port_tx_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -793,16 +793,16 @@ adpt_hppe_debug_vp_tx_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -824,16 +824,16 @@ adpt_hppe_debug_queue_tx_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(queue=%04d)", value, i); + printk(KERN_CONT "%15llu(queue=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -855,16 +855,16 @@ adpt_hppe_debug_vp_tx_drop_counter_get(a_bool_t show_type) if (value > 0) { if (sign) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); } sign = 0; - printk("%15llu(port=%04d)", value, i); + printk(KERN_CONT "%15llu(port=%04d)", value, i); if (++tags % 3 == 0) sign = 1; } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -885,31 +885,31 @@ adpt_hppe_debug_cpu_code_counter_get(a_bool_t show_type) value = drop_cpu_cnt_tbl.bf.byte_cnt_0 | ((a_uint64_t)drop_cpu_cnt_tbl.bf.byte_cnt_1 << 32); if (value > 0) { - printk("\n"); - printk("%-35s", ""); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); if (i >=0 && i <= 70) - printk("%15llu(%s)", value, cpucode[i]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i]); else if (i >= 79 && i <= 92) - printk("%15llu(%s)", value, cpucode[i - 8]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 8]); else if (i >= 97 && i <= 102) - printk("%15llu(%s)", value, cpucode[i - 12]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 12]); else if (i >= 107 && i <= 110) - printk("%15llu(%s)", value, cpucode[i - 16]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 16]); else if (i >= 113 && i <= 127) - printk("%15llu(%s)", value, cpucode[i - 18]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 18]); else if (i >= 136 && i <= 143) - printk("%15llu(%s)", value, cpucode[i - 26]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 26]); else if (i >= 148 && i <= 174) - printk("%15llu(%s)", value, cpucode[i - 30]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 30]); else if (i >= 178 && i <= 180) - printk("%15llu(%s)", value, cpucode[i - 33]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 33]); else if (i >= 254 && i <= 255) - printk("%15llu(%s)", value, cpucode[i - 106]); + printk(KERN_CONT "%15llu(%s)", value, cpucode[i - 106]); else - printk("%15llu(Reserved)", value); + printk(KERN_CONT "%15llu(Reserved)", value); } } - printk("\n"); + printk(KERN_CONT "\n"); } void @@ -930,12 +930,12 @@ adpt_hppe_debug_drop_cpu_counter_get(a_bool_t show_type) value = drop_cpu_cnt_tbl.bf.byte_cnt_0 | ((a_uint64_t)drop_cpu_cnt_tbl.bf.byte_cnt_1 << 32); if (value > 0) { - printk("\n"); - printk("%-35s", ""); - printk("%15llu(port=%d:%s)", value, (i - 256) % 8, dropcode[(i - 256) / 8]); + printk(KERN_CONT "\n"); + printk(KERN_CONT "%-35s", ""); + printk(KERN_CONT "%15llu(port=%d:%s)", value, (i - 256) % 8, dropcode[(i - 256) / 8]); } } - printk("\n"); + printk(KERN_CONT "\n"); } /* if show_type = A_FALSE, show packets. diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_policer.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_policer.c index 7ffcf1318..cf6191a1b 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_policer.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_policer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -964,8 +964,54 @@ adpt_hppe_policer_global_counter_get(a_uint32_t dev_id, return SW_OK; } + +sw_error_t +adpt_hppe_policer_bypass_en_get(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t *enable) +{ + sw_error_t rv = SW_OK; + union pc_drop_bypass_reg_u drop_bypass_reg; + + memset(&drop_bypass_reg, 0, sizeof(drop_bypass_reg)); + ADPT_DEV_ID_CHECK(dev_id); + ADPT_NULL_POINT_CHECK(enable); + + rv = hppe_pc_drop_bypass_reg_get(dev_id, &drop_bypass_reg); + SW_RTN_ON_ERROR (rv); + + if (frame_type == FAL_FRAME_DROPPED) { + *enable = drop_bypass_reg.bf.drop_bypass_en; + } else { + return SW_BAD_PARAM; + } + + return SW_OK; +} + #endif +sw_error_t +adpt_hppe_policer_bypass_en_set(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t enable) +{ + sw_error_t rv = SW_OK; + union pc_drop_bypass_reg_u drop_bypass_reg; + + memset(&drop_bypass_reg, 0, sizeof(drop_bypass_reg)); + ADPT_DEV_ID_CHECK(dev_id); + + if (frame_type == FAL_FRAME_DROPPED) { + drop_bypass_reg.bf.drop_bypass_en = enable; + } else { + return SW_BAD_PARAM; + } + + rv = hppe_pc_drop_bypass_reg_set(dev_id, &drop_bypass_reg); + SW_RTN_ON_ERROR (rv); + + return SW_OK; +} + void adpt_hppe_policer_func_bitmap_init(a_uint32_t dev_id) { adpt_api_t *p_adpt_api = NULL; @@ -985,7 +1031,9 @@ void adpt_hppe_policer_func_bitmap_init(a_uint32_t dev_id) (1 << FUNC_ADPT_POLICER_TIME_SLOT_GET)| (1 << FUNC_ADPT_PORT_COMPENSATION_BYTE_SET)| (1 << FUNC_ADPT_POLICER_TIME_SLOT_SET) | - (1 << FUNC_ADPT_POLICER_GLOBAL_COUNTER_GET)); + (1 << FUNC_ADPT_POLICER_GLOBAL_COUNTER_GET)| + (1 << FUNC_ADPT_POLICER_BYPASS_EN_SET)| + (1 << FUNC_ADPT_POLICER_BYPASS_EN_GET)); return; @@ -1007,6 +1055,8 @@ static void adpt_hppe_policer_func_unregister(a_uint32_t dev_id, adpt_api_t *p_a p_adpt_api->adpt_port_compensation_byte_set = NULL; p_adpt_api->adpt_policer_time_slot_set = NULL; p_adpt_api->adpt_policer_global_counter_get = NULL; + p_adpt_api->adpt_policer_bypass_en_set = NULL; + p_adpt_api->adpt_policer_bypass_en_get = NULL; return; @@ -1061,6 +1111,10 @@ sw_error_t adpt_hppe_policer_init(a_uint32_t dev_id) { p_adpt_api->adpt_policer_global_counter_get = adpt_hppe_policer_global_counter_get; } + if(p_adpt_api->adpt_policer_func_bitmap & (1 << FUNC_ADPT_POLICER_BYPASS_EN_GET)) + { + p_adpt_api->adpt_policer_bypass_en_get = adpt_hppe_policer_bypass_en_get; + } #endif if(p_adpt_api->adpt_policer_func_bitmap & (1 << FUNC_ADPT_PORT_COMPENSATION_BYTE_SET)) { @@ -1070,6 +1124,10 @@ sw_error_t adpt_hppe_policer_init(a_uint32_t dev_id) { p_adpt_api->adpt_policer_time_slot_set = adpt_hppe_policer_time_slot_set; } + if(p_adpt_api->adpt_policer_func_bitmap & (1 << FUNC_ADPT_POLICER_BYPASS_EN_SET)) + { + p_adpt_api->adpt_policer_bypass_en_set = adpt_hppe_policer_bypass_en_set; + } return SW_OK; } diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portctrl.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portctrl.c index f1b29ef41..4102fbea1 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portctrl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portctrl.c @@ -160,6 +160,12 @@ _adpt_phy_status_get_from_ppe(a_uint32_t dev_id, a_uint32_t port_id, phy_status->link_status = PORT_LINK_UP; switch (reg_field & 0x7) { + case MAC_SPEED_10M: + phy_status->speed = FAL_SPEED_10; + break; + case MAC_SPEED_100M: + phy_status->speed = FAL_SPEED_100; + break; case MAC_SPEED_1000M: phy_status->speed = FAL_SPEED_1000; break; @@ -1900,6 +1906,39 @@ adpt_hppe_port_txfc_status_set(a_uint32_t dev_id, fal_port_t port_id, return rv; } + +sw_error_t +adpt_hppe_port_rxfc_status_set(a_uint32_t dev_id, fal_port_t port_id, + a_bool_t enable) +{ + sw_error_t rv = SW_OK; + a_uint32_t port_mac_type; + struct qca_phy_priv *priv = ssdk_phy_priv_data_get(dev_id); + + ADPT_DEV_ID_CHECK(dev_id); + + if (!priv) + return SW_FAIL; + + if ((port_id < SSDK_PHYSICAL_PORT1) || (port_id > SSDK_PHYSICAL_PORT6)) + return SW_BAD_VALUE; + + port_mac_type =qca_hppe_port_mac_type_get(dev_id, port_id); + if(port_mac_type == PORT_XGMAC_TYPE) + rv = _adpt_xgmac_port_rxfc_status_set( dev_id, port_id, enable); + else if (port_mac_type == PORT_GMAC_TYPE) + rv = _adpt_gmac_port_rxfc_status_set( dev_id, port_id, enable); + else + return SW_BAD_VALUE; + + if (rv != SW_OK) + return rv; + + priv->port_old_rx_flowctrl[port_id - 1] = enable; + + return SW_OK; +} + #ifndef IN_PORTCONTROL_MINI sw_error_t adpt_hppe_port_counter_set(a_uint32_t dev_id, fal_port_t port_id, @@ -2817,7 +2856,11 @@ _adpt_hppe_instance0_mode_get(a_uint32_t dev_id, a_uint32_t *mode0) break; #endif case SSDK_PHYSICAL_PORT5: - *mode0 = PORT_WRAPPER_SGMII_CHANNEL4; + if(ssdk_dt_global_get_mac_mode(dev_id, + SSDK_UNIPHY_INSTANCE1) == PORT_WRAPPER_MAX) + { + *mode0 = PORT_WRAPPER_SGMII_CHANNEL4; + } break; default: SSDK_ERROR("port %d doesn't support " @@ -3175,7 +3218,9 @@ adpt_hppe_port_mac_uniphy_phy_config(a_uint32_t dev_id, a_uint32_t mode_index, port_id_end = SSDK_PHYSICAL_PORT5; break; default: - break; + SSDK_INFO ("uniphy %d interface mode is 0x%x\n", + mode_index, mode[SSDK_UNIPHY_INSTANCE0]); + return SW_OK; } } else if(mode_index == SSDK_UNIPHY_INSTANCE1) @@ -3231,6 +3276,8 @@ adpt_hppe_port_mac_uniphy_phy_config(a_uint32_t dev_id, a_uint32_t mode_index, /*init port status for special ports to triger polling*/ for(port_id = port_id_from; port_id <= port_id_end; port_id++) { + adpt_hppe_port_txfc_status_set(dev_id, port_id, A_FALSE); + adpt_hppe_port_rxfc_status_set(dev_id, port_id, A_FALSE); qca_mac_port_status_init(dev_id, port_id); } @@ -3268,6 +3315,13 @@ _adpt_hppe_port_interface_mode_apply(a_uint32_t dev_id, a_bool_t force_switch) { ssdk_dt_global_set_mac_mode(dev_id, mode_index, mode_new[mode_index]); } + + for (mode_index = SSDK_UNIPHY_INSTANCE0; mode_index <= SSDK_UNIPHY_INSTANCE2; mode_index++) + { + ssdk_gcc_uniphy_sys_set(dev_id, mode_index, A_TRUE); + } + ssdk_uniphy_port5_clock_source_set(); + /*configure the mode according to mode_new*/ for(mode_index = SSDK_UNIPHY_INSTANCE0; mode_index <= SSDK_UNIPHY_INSTANCE2; mode_index++) { @@ -3282,6 +3336,9 @@ _adpt_hppe_port_interface_mode_apply(a_uint32_t dev_id, a_bool_t force_switch) return rv; } } + if (mode_new[mode_index] == PORT_WRAPPER_MAX) { + ssdk_gcc_uniphy_sys_set(dev_id, mode_index, A_FALSE); + } } return rv; @@ -3599,37 +3656,7 @@ adpt_hppe_port_reset(a_uint32_t dev_id, fal_port_t port_id) } #endif -sw_error_t -adpt_hppe_port_rxfc_status_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv = SW_OK; - a_uint32_t port_mac_type; - struct qca_phy_priv *priv = ssdk_phy_priv_data_get(dev_id); - ADPT_DEV_ID_CHECK(dev_id); - - if (!priv) - return SW_FAIL; - - if ((port_id < SSDK_PHYSICAL_PORT1) || (port_id > SSDK_PHYSICAL_PORT6)) - return SW_BAD_VALUE; - - port_mac_type =qca_hppe_port_mac_type_get(dev_id, port_id); - if(port_mac_type == PORT_XGMAC_TYPE) - rv = _adpt_xgmac_port_rxfc_status_set( dev_id, port_id, enable); - else if (port_mac_type == PORT_GMAC_TYPE) - rv = _adpt_gmac_port_rxfc_status_set( dev_id, port_id, enable); - else - return SW_BAD_VALUE; - - if (rv != SW_OK) - return rv; - - priv->port_old_rx_flowctrl[port_id - 1] = enable; - - return SW_OK; -} sw_error_t adpt_hppe_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) @@ -4695,7 +4722,9 @@ adpt_hppe_gcc_port_speed_clock_set(a_uint32_t dev_id, a_uint32_t port_id, if ((((mode == PORT_WRAPPER_PSGMII) || (mode == PORT_WRAPPER_PSGMII_FIBER)) && (mode1 == PORT_WRAPPER_MAX)) || - ((mode == PORT_WRAPPER_SGMII4_RGMII4) && (mode1 == PORT_WRAPPER_MAX))) + ((mode == PORT_WRAPPER_SGMII4_RGMII4 || + mode == PORT_WRAPPER_SGMII_CHANNEL4) + && (mode1 == PORT_WRAPPER_MAX))) { adpt_hppe_pqsgmii_speed_clock_set(dev_id, port_id, phy_speed); return; @@ -4748,7 +4777,9 @@ adpt_hppe_gcc_uniphy_clock_status_set(a_uint32_t dev_id, a_uint32_t port_id, if ((((mode == PORT_WRAPPER_PSGMII) || (mode == PORT_WRAPPER_PSGMII_FIBER)) && (mode1 == PORT_WRAPPER_MAX)) || - ((mode == PORT_WRAPPER_SGMII4_RGMII4) && (mode1 == PORT_WRAPPER_MAX))) + ((mode == PORT_WRAPPER_SGMII4_RGMII4 || + mode == PORT_WRAPPER_SGMII_CHANNEL4) + && (mode1 == PORT_WRAPPER_MAX))) { qca_gcc_uniphy_port_clock_set(dev_id, uniphy_index, port_id, enable); diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portvlan.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portvlan.c index 85186d1ff..aebb8857c 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portvlan.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_portvlan.c @@ -505,14 +505,18 @@ adpt_hppe_global_qinq_mode_set(a_uint32_t dev_id, fal_global_qinq_mode_t *mode) if (FAL_FLG_TST(mode->mask, FAL_GLOBAL_QINQ_MODE_INGRESS_EN)) { SW_RTN_ON_ERROR(hppe_bridge_config_bridge_type_set(dev_id, - (a_uint32_t)mode->ingress_mode)); + (a_uint32_t)mode->ingress_mode)); } if (FAL_FLG_TST(mode->mask, FAL_GLOBAL_QINQ_MODE_EGRESS_EN)) { SW_RTN_ON_ERROR(hppe_eg_bridge_config_bridge_type_set(dev_id, - (a_uint32_t)mode->egress_mode)); + (a_uint32_t)mode->egress_mode)); } + if (FAL_FLG_TST(mode->mask, FAL_GLOBAL_QINQ_MODE_EGRESS_UNTOUCHED_FOR_CPU_CODE)) { + SW_RTN_ON_ERROR(hppe_eg_bridge_config_pkt_l2_edit_en_set(dev_id, + (a_uint32_t)!mode->untouched_for_cpucode)); + } return rtn; } @@ -520,6 +524,7 @@ sw_error_t adpt_hppe_global_qinq_mode_get(a_uint32_t dev_id, fal_global_qinq_mode_t *mode) { sw_error_t rtn = SW_OK; + a_uint32_t l2_edit_en = 0; ADPT_DEV_ID_CHECK(dev_id); ADPT_NULL_POINT_CHECK(mode); @@ -530,6 +535,10 @@ adpt_hppe_global_qinq_mode_get(a_uint32_t dev_id, fal_global_qinq_mode_t *mode) SW_RTN_ON_ERROR(hppe_eg_bridge_config_bridge_type_get(dev_id, (a_uint32_t *)&mode->egress_mode)); + SW_RTN_ON_ERROR(hppe_eg_bridge_config_pkt_l2_edit_en_get(dev_id, &l2_edit_en)); + + mode->untouched_for_cpucode = !l2_edit_en; + return rtn; } @@ -574,19 +583,32 @@ sw_error_t adpt_hppe_tpid_set(a_uint32_t dev_id, fal_tpid_t *tpid) { sw_error_t rtn = SW_OK; + union edma_vlan_tpid_reg_u edma_tpid; + union vlan_tpid_reg_u ppe_tpid; ADPT_DEV_ID_CHECK(dev_id); + rtn = hppe_edma_vlan_tpid_reg_get(dev_id, &edma_tpid); + SW_RTN_ON_ERROR(rtn); + + rtn = hppe_vlan_tpid_reg_get(dev_id, &ppe_tpid); + SW_RTN_ON_ERROR(rtn); + if (FAL_FLG_TST(tpid->mask, FAL_TPID_CTAG_EN)) { - SW_RTN_ON_ERROR(hppe_vlan_tpid_reg_ctag_tpid_set(dev_id, - (a_uint32_t)tpid->ctpid)); + edma_tpid.bf.ctag_tpid = tpid->ctpid; + ppe_tpid.bf.ctag_tpid = tpid->ctpid; } if (FAL_FLG_TST(tpid->mask, FAL_TPID_STAG_EN)) { - SW_RTN_ON_ERROR(hppe_vlan_tpid_reg_stag_tpid_set(dev_id, - (a_uint32_t)tpid->stpid)); + edma_tpid.bf.stag_tpid = tpid->stpid; + ppe_tpid.bf.stag_tpid = tpid->stpid; } + rtn = hppe_edma_vlan_tpid_reg_set(dev_id, &edma_tpid); + SW_RTN_ON_ERROR(rtn); + + rtn = hppe_vlan_tpid_reg_set(dev_id, &ppe_tpid); + return rtn; } @@ -594,15 +616,16 @@ sw_error_t adpt_hppe_tpid_get(a_uint32_t dev_id, fal_tpid_t *tpid) { sw_error_t rtn = SW_OK; + union vlan_tpid_reg_u ppe_tpid; ADPT_DEV_ID_CHECK(dev_id); ADPT_NULL_POINT_CHECK(tpid); - SW_RTN_ON_ERROR(hppe_vlan_tpid_reg_ctag_tpid_get(dev_id, - (a_uint32_t *)&tpid->ctpid)); + rtn = hppe_vlan_tpid_reg_get(dev_id, &ppe_tpid); + SW_RTN_ON_ERROR(rtn); - SW_RTN_ON_ERROR(hppe_vlan_tpid_reg_stag_tpid_get(dev_id, - (a_uint32_t *)&tpid->stpid)); + tpid->ctpid = ppe_tpid.bf.ctag_tpid; + tpid->stpid = ppe_tpid.bf.stag_tpid; return rtn; } diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_trunk.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_trunk.c old mode 100755 new mode 100644 index 0a7834f11..976625542 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_trunk.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_trunk.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2020, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -130,7 +130,7 @@ adpt_hppe_trunk_group_set(a_uint32_t dev_id, a_uint32_t trunk_id, union trunk_filter_u trunk_filter; union port_trunk_id_u port_trunk_id; union trunk_member_u trunk_member; - a_uint32_t i, j, cnt = 0, data[4] = {0,0,0,0}; + a_uint32_t i, j, cnt = 0, data[FAL_MAX_PORT_NUMBER] = {0}; memset(&trunk_filter, 0, sizeof(trunk_filter)); memset(&port_trunk_id, 0, sizeof(port_trunk_id)); @@ -193,49 +193,25 @@ adpt_hppe_trunk_group_set(a_uint32_t dev_id, a_uint32_t trunk_id, if (A_TRUE == enable) { - switch (cnt) { - case 1: - trunk_member.bf.member_0_port_id = data[0]; - trunk_member.bf.member_1_port_id = data[0]; - trunk_member.bf.member_2_port_id = data[0]; - trunk_member.bf.member_3_port_id = data[0]; - trunk_member.bf.member_4_port_id = data[0]; - trunk_member.bf.member_5_port_id = data[0]; - trunk_member.bf.member_6_port_id = data[0]; - trunk_member.bf.member_7_port_id = data[0]; - break; - case 2: - trunk_member.bf.member_0_port_id = data[0]; - trunk_member.bf.member_1_port_id = data[1]; - trunk_member.bf.member_2_port_id = data[0]; - trunk_member.bf.member_3_port_id = data[1]; - trunk_member.bf.member_4_port_id = data[0]; - trunk_member.bf.member_5_port_id = data[1]; - trunk_member.bf.member_6_port_id = data[0]; - trunk_member.bf.member_7_port_id = data[1]; - break; - case 3: - trunk_member.bf.member_0_port_id = data[0]; - trunk_member.bf.member_1_port_id = data[1]; - trunk_member.bf.member_2_port_id = data[2]; - trunk_member.bf.member_3_port_id = data[0]; - trunk_member.bf.member_4_port_id = data[1]; - trunk_member.bf.member_5_port_id = data[2]; - trunk_member.bf.member_6_port_id = data[0]; - trunk_member.bf.member_7_port_id = data[1]; - break; - case 4: - trunk_member.bf.member_0_port_id = data[0]; - trunk_member.bf.member_1_port_id = data[1]; - trunk_member.bf.member_2_port_id = data[2]; - trunk_member.bf.member_3_port_id = data[3]; - trunk_member.bf.member_4_port_id = data[0]; - trunk_member.bf.member_5_port_id = data[1]; - trunk_member.bf.member_6_port_id = data[2]; - trunk_member.bf.member_7_port_id = data[3]; - break; + for(i = SSDK_PHYSICAL_PORT0; i <= SSDK_PHYSICAL_PORT7; i+=cnt) + { + for(j = 0; j < cnt; j++) + { + if((i+j) < FAL_MAX_PORT_NUMBER) + { + data[i+j] = data[j]; + } + } } } + trunk_member.bf.member_0_port_id = data[0]; + trunk_member.bf.member_1_port_id = data[1]; + trunk_member.bf.member_2_port_id = data[2]; + trunk_member.bf.member_3_port_id = data[3]; + trunk_member.bf.member_4_port_id = data[4]; + trunk_member.bf.member_5_port_id = data[5]; + trunk_member.bf.member_6_port_id = data[6]; + trunk_member.bf.member_7_port_id = data[7]; SW_RTN_ON_ERROR(hppe_trunk_member_set(dev_id, trunk_id, &trunk_member)); diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_uniphy.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_uniphy.c index 959e4a4d0..531d3fbef 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_uniphy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/hppe/adpt_hppe_uniphy.c @@ -37,29 +37,6 @@ extern void adpt_hppe_gcc_port_speed_clock_set(a_uint32_t dev_id, a_uint32_t port_id, fal_port_speed_t phy_speed); -void -__adpt_hppe_gcc_uniphy_sys_set(a_uint32_t dev_id, a_uint32_t uniphy_index, - a_bool_t enable) -{ - enum unphy_rst_type rst_type; - - if (uniphy_index == SSDK_UNIPHY_INSTANCE0) { - rst_type = UNIPHY0_SOFT_RESET_E; - } else if (uniphy_index == SSDK_UNIPHY_INSTANCE1) { - rst_type = UNIPHY1_SOFT_RESET_E; - } else { - rst_type = UNIPHY2_SOFT_RESET_E; - } - - if (enable == A_TRUE) { - ssdk_uniphy_reset(dev_id, rst_type, SSDK_RESET_DEASSERT); - } else { - ssdk_uniphy_reset(dev_id, rst_type, SSDK_RESET_ASSERT); - } - - return; -} - static sw_error_t __adpt_hppe_uniphy_10g_r_linkup(a_uint32_t dev_id, a_uint32_t uniphy_index) { @@ -713,10 +690,7 @@ adpt_hppe_uniphy_mode_set(a_uint32_t dev_id, a_uint32_t index, a_uint32_t mode) if (mode == PORT_WRAPPER_MAX) { ssdk_uniphy_raw_clock_reset(index); - __adpt_hppe_gcc_uniphy_sys_set(dev_id, index, A_FALSE); return SW_OK; - } else { - __adpt_hppe_gcc_uniphy_sys_set(dev_id, index, A_TRUE); } switch(mode) { diff --git a/feeds/ipq807x/qca-ssdk/src/src/adpt/mp/adpt_mp_portctrl.c b/feeds/ipq807x/qca-ssdk/src/src/adpt/mp/adpt_mp_portctrl.c index dd464c586..955e8e03e 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/adpt/mp/adpt_mp_portctrl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/adpt/mp/adpt_mp_portctrl.c @@ -244,6 +244,14 @@ adpt_mp_port_txfc_status_set(a_uint32_t dev_id, fal_port_t port_id, GMAC_PAUSE_ZERO_QUANTA_ENABLE; mac_operation_mode_ctrl.bf.enable_hw_flowctrl = GMAC_HW_FLOWCTRL_ENABLE; + mac_operation_mode_ctrl.bf.disable_flushing_receiving_frame = + GMAC_FLUSH_RECEIVED_FRAMES_DISABLE; + /*activate flowctrl when 6KB FIFO is available*/ + mac_operation_mode_ctrl.val &= ~(GMAC_ACTIVATE_FLOWCTRL_MASK); + mac_operation_mode_ctrl.val |= GMAC_ACTIVATE_FLOWCTRL_WITH_6KB; + /*dactivate flowctrl when 7KB FIFO is available*/ + mac_operation_mode_ctrl.val &= ~(GMAC_DACTIVATE_FLOWCTRL_MASK); + mac_operation_mode_ctrl.val |= GMAC_DACTIVATE_FLOWCTRL_WITH_7KB; } else { mac_flow_ctrl.bf.flowctrl_tx_enable = 0; mac_operation_mode_ctrl.bf.enable_hw_flowctrl = @@ -632,7 +640,8 @@ adpt_mp_port_max_frame_size_set(a_uint32_t dev_id, fal_port_t port_id, SW_RTN_ON_ERROR(rv); mac_max_frame_ctrl.bf.max_frame_ctrl_enable = GMAC_MAX_FRAME_CTRL_ENABLE; - mac_max_frame_ctrl.bf.max_frame_ctrl = max_frame; + /* default max_frame 1518 byte doesn't include vlan tag */ + mac_max_frame_ctrl.bf.max_frame_ctrl = max_frame + 8; rv = mp_mac_max_frame_ctrl_set(dev_id, gmac_id, &mac_max_frame_ctrl); rv = mp_mac_operation_mode_ctrl_get(dev_id, gmac_id, @@ -1091,10 +1100,8 @@ adpt_mp_port_link_up_update(struct qca_phy_priv *priv, msleep(50); - if (change == A_TRUE) { - rv = adpt_mp_port_reset_set(priv->device_id, port_id); - SW_RTN_ON_ERROR (rv); - } + rv = adpt_mp_port_reset_set(priv->device_id, port_id); + SW_RTN_ON_ERROR (rv); rv = adpt_mp_port_txmac_status_set(priv->device_id, port_id, A_TRUE); SW_RTN_ON_ERROR (rv); diff --git a/feeds/ipq807x/qca-ssdk/src/src/fal/fal_policer.c b/feeds/ipq807x/qca-ssdk/src/src/fal/fal_policer.c index 0e100bc84..6e9e68fb6 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/fal/fal_policer.c +++ b/feeds/ipq807x/qca-ssdk/src/src/fal/fal_policer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -131,6 +131,23 @@ _fal_policer_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) rv = p_api->adpt_policer_time_slot_get(dev_id, timeslot); return rv; } + +sw_error_t +_fal_policer_bypass_en_get(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t *enable) +{ + adpt_api_t *p_api; + sw_error_t rv = SW_OK; + + SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id)); + + if (NULL == p_api->adpt_policer_bypass_en_get) + return SW_NOT_SUPPORTED; + + rv = p_api->adpt_policer_bypass_en_get(dev_id, frame_type, enable); + return rv; +} + #endif sw_error_t _fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) @@ -147,6 +164,22 @@ _fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) return rv; } +sw_error_t +_fal_policer_bypass_en_set(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t enable) +{ + adpt_api_t *p_api; + sw_error_t rv = SW_OK; + + SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id)); + + if (NULL == p_api->adpt_policer_bypass_en_set) + return SW_NOT_SUPPORTED; + + rv = p_api->adpt_policer_bypass_en_set(dev_id, frame_type, enable); + return rv; +} + #ifndef IN_POLICER_MINI sw_error_t _fal_port_policer_compensation_byte_get(a_uint32_t dev_id, a_uint32_t port_id, @@ -276,6 +309,18 @@ fal_policer_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) FAL_API_UNLOCK; return rv; } + +sw_error_t +fal_policer_bypass_en_get(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t *enable) +{ + sw_error_t rv = SW_OK; + + FAL_API_LOCK; + rv = _fal_policer_bypass_en_get(dev_id, frame_type, enable); + FAL_API_UNLOCK; + return rv; +} #endif sw_error_t fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) @@ -288,6 +333,18 @@ fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) return rv; } +sw_error_t +fal_policer_bypass_en_set(a_uint32_t dev_id, fal_policer_frame_type_t frame_type, + a_bool_t enable) +{ + sw_error_t rv = SW_OK; + + FAL_API_LOCK; + rv = _fal_policer_bypass_en_set(dev_id, frame_type, enable); + FAL_API_UNLOCK; + return rv; +} + #ifndef IN_POLICER_MINI sw_error_t fal_port_policer_compensation_byte_get(a_uint32_t dev_id, fal_port_t port_id, @@ -336,8 +393,10 @@ EXPORT_SYMBOL(fal_acl_policer_entry_set); EXPORT_SYMBOL(fal_policer_timeslot_get); EXPORT_SYMBOL(fal_port_policer_compensation_byte_get); EXPORT_SYMBOL(fal_policer_global_counter_get); +EXPORT_SYMBOL(fal_policer_bypass_en_get); #endif EXPORT_SYMBOL(fal_policer_timeslot_set); EXPORT_SYMBOL(fal_port_policer_compensation_byte_set); +EXPORT_SYMBOL(fal_policer_bypass_en_set); /*insert flag for outter fal, don't remove it*/ diff --git a/feeds/ipq807x/qca-ssdk/src/src/fal/fal_portvlan.c b/feeds/ipq807x/qca-ssdk/src/src/fal/fal_portvlan.c index c12493bb2..0b82accd5 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/fal/fal_portvlan.c +++ b/feeds/ipq807x/qca-ssdk/src/src/fal/fal_portvlan.c @@ -579,6 +579,7 @@ _fal_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id, rv = p_api->port_vlan_propagation_get(dev_id, port_id, mode); return rv; } +#endif static sw_error_t _fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry) @@ -604,6 +605,7 @@ _fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_e return rv; } +#ifndef IN_PORTVLAN_MINI static sw_error_t _fal_port_vlan_trans_del(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry) { @@ -651,6 +653,7 @@ _fal_port_vlan_trans_get(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_e rv = p_api->port_vlan_trans_get(dev_id, port_id, entry); return rv; } +#endif static sw_error_t _fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) @@ -676,6 +679,7 @@ _fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) return rv; } +#ifndef IN_PORTVLAN_MINI static sw_error_t _fal_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) { @@ -699,6 +703,7 @@ _fal_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) rv = p_api->qinq_mode_get(dev_id, mode); return rv; } +#endif static sw_error_t _fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t role) @@ -724,6 +729,7 @@ _fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_rol return rv; } +#ifndef IN_PORTVLAN_MINI static sw_error_t _fal_port_qinq_role_get(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t * role) { @@ -1463,6 +1469,7 @@ fal_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id, FAL_API_UNLOCK; return rv; } +#endif /** * @brief Add a vlan translation entry to a particular port. @@ -1482,6 +1489,7 @@ fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_en return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Delete a vlan translation entry from a particular port. * @param[in] dev_id device id @@ -1517,6 +1525,7 @@ fal_port_vlan_trans_get(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_en FAL_API_UNLOCK; return rv; } +#endif /** * @brief Set switch qinq work mode on a particular device. @@ -1535,6 +1544,7 @@ fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Get switch qinq work mode on a particular device. * @param[in] dev_id device id @@ -1551,6 +1561,7 @@ fal_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) FAL_API_UNLOCK; return rv; } +#endif /** * @brief Set qinq role on a particular port. @@ -1570,6 +1581,7 @@ fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Get qinq role on a particular port. * @param[in] dev_id device id @@ -2524,13 +2536,13 @@ EXPORT_SYMBOL(fal_port_vlan_counter_cleanup); EXPORT_SYMBOL(fal_portvlan_member_add); EXPORT_SYMBOL(fal_portvlan_member_del); EXPORT_SYMBOL(fal_portvlan_member_update); -#ifndef IN_PORTVLAN_MINI EXPORT_SYMBOL(fal_qinq_mode_set); -EXPORT_SYMBOL(fal_qinq_mode_get); EXPORT_SYMBOL(fal_port_qinq_role_set); +EXPORT_SYMBOL(fal_port_vlan_trans_add); +#ifndef IN_PORTVLAN_MINI +EXPORT_SYMBOL(fal_qinq_mode_get); EXPORT_SYMBOL(fal_port_qinq_role_get); EXPORT_SYMBOL(fal_port_vlan_trans_iterate); -EXPORT_SYMBOL(fal_port_vlan_trans_add); EXPORT_SYMBOL(fal_port_vlan_trans_del); EXPORT_SYMBOL(fal_port_vlan_trans_get); EXPORT_SYMBOL(fal_portvlan_member_get); diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/dess/dess_multicast_acl.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/dess/dess_multicast_acl.c index 087395c67..7995737fd 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/dess/dess_multicast_acl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/dess/dess_multicast_acl.c @@ -832,7 +832,7 @@ sw_error_t dess_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent { MULTI_DEBUG("KKK entry clear, new(G,S), with null portmap. \n"); dess_multicast_acl_del(FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -850,7 +850,7 @@ sw_error_t dess_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent else if(pm_type == 1) { dess_multicast_acl_del(FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -867,7 +867,7 @@ sw_error_t dess_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent if (portmap_null(new_index-1, entry->port_map)) { dess_multicast_acl_del(FAL_ACL_LIST_MULTICAST+1, new_index-1); - rv = SW_NO_MORE; + rv = SW_OK; } else { diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_policer.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_policer.c index 1c17bde47..45e8f3489 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_policer.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_policer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -51,6 +51,17 @@ hppe_meter_cmpst_length_reg_set( value->val); } +sw_error_t +hppe_pc_drop_bypass_reg_set( + a_uint32_t dev_id, + union pc_drop_bypass_reg_u *value) +{ + return hppe_reg_set( + dev_id, + INGRESS_POLICER_BASE_ADDR + PC_DROP_BYPASS_REG_ADDRESS, + value->val); +} + #ifndef IN_POLICER_MINI sw_error_t hppe_pc_drop_bypass_reg_get( @@ -63,17 +74,6 @@ hppe_pc_drop_bypass_reg_get( &value->val); } -sw_error_t -hppe_pc_drop_bypass_reg_set( - a_uint32_t dev_id, - union pc_drop_bypass_reg_u *value) -{ - return hppe_reg_set( - dev_id, - INGRESS_POLICER_BASE_ADDR + PC_DROP_BYPASS_REG_ADDRESS, - value->val); -} - sw_error_t hppe_pc_spare_reg_get( a_uint32_t dev_id, diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_portvlan.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_portvlan.c index 4b6ff8281..d38b7820b 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_portvlan.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/hppe/hppe_portvlan.c @@ -51,6 +51,28 @@ hppe_port_parsing_reg_set( value->val); } +sw_error_t +hppe_edma_vlan_tpid_reg_get( + a_uint32_t dev_id, + union edma_vlan_tpid_reg_u *value) +{ + return hppe_reg_get( + dev_id, + EDMA_CSR_BASE_ADDR + EDMA_VLAN_TPID_REG_ADDRESS, + &value->val); +} + +sw_error_t +hppe_edma_vlan_tpid_reg_set( + a_uint32_t dev_id, + union edma_vlan_tpid_reg_u *value) +{ + return hppe_reg_set( + dev_id, + EDMA_CSR_BASE_ADDR + EDMA_VLAN_TPID_REG_ADDRESS, + value->val); +} + sw_error_t hppe_vlan_tpid_reg_get( a_uint32_t dev_id, @@ -3405,6 +3427,35 @@ hppe_eg_bridge_config_bridge_type_set( return ret; } +sw_error_t +hppe_eg_bridge_config_pkt_l2_edit_en_get( + a_uint32_t dev_id, + a_uint32_t *value) +{ + union eg_bridge_config_u reg_val; + sw_error_t ret = SW_OK; + + ret = hppe_eg_bridge_config_get(dev_id, ®_val); + *value = reg_val.bf.pkt_l2_edit_en; + return ret; +} + +sw_error_t +hppe_eg_bridge_config_pkt_l2_edit_en_set( + a_uint32_t dev_id, + a_uint32_t value) +{ + union eg_bridge_config_u reg_val; + sw_error_t ret = SW_OK; + + ret = hppe_eg_bridge_config_get(dev_id, ®_val); + if (SW_OK != ret) + return ret; + reg_val.bf.pkt_l2_edit_en = value; + ret = hppe_eg_bridge_config_set(dev_id, ®_val); + return ret; +} + sw_error_t hppe_eg_bridge_config_queue_cnt_en_get( a_uint32_t dev_id, diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/isis/isis_multicast_acl.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/isis/isis_multicast_acl.c index 9db89f4d2..19ad9c21e 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/isis/isis_multicast_acl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/isis/isis_multicast_acl.c @@ -815,7 +815,7 @@ sw_error_t isis_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent { MULTI_DEBUG("KKK entry clear, new(G,S), with null portmap. \n"); isis_multicast_acl_del(FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -833,7 +833,7 @@ sw_error_t isis_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent else if(pm_type == 1) { isis_multicast_acl_del(FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -850,7 +850,7 @@ sw_error_t isis_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * ent if (portmap_null(new_index-1, entry->port_map)) { isis_multicast_acl_del(FAL_ACL_LIST_MULTICAST+1, new_index-1); - rv = SW_NO_MORE; + rv = SW_OK; } else { diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_multicast_acl.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_multicast_acl.c index befd61cd5..bd2c91c9e 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_multicast_acl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_multicast_acl.c @@ -826,7 +826,7 @@ sw_error_t isisc_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * en { MULTI_DEBUG("KKK entry clear, new(G,S), with null portmap. \n"); isisc_multicast_acl_del(dev_id, FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -844,7 +844,7 @@ sw_error_t isisc_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * en else if(pm_type == 1) { isisc_multicast_acl_del(dev_id, FAL_ACL_LIST_MULTICAST, new_index-1); - return SW_NO_MORE; + return SW_OK; } else { @@ -861,7 +861,7 @@ sw_error_t isisc_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * en if (portmap_null(new_index-1, entry->port_map)) { isisc_multicast_acl_del(dev_id, FAL_ACL_LIST_MULTICAST+1, new_index-1); - rv = SW_NO_MORE; + rv = SW_OK; } else { diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_portvlan.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_portvlan.c index bac24ac1c..bf47d0060 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_portvlan.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/isisc/isisc_portvlan.c @@ -891,6 +891,7 @@ _isisc_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id, return SW_OK; } +#endif static sw_error_t _isisc_vlan_trans_read(a_uint32_t dev_id, a_uint32_t entry_idx, @@ -1048,6 +1049,7 @@ _isisc_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, return _isisc_vlan_trans_write(dev_id, entry_idx, t_pbmp, local); } +#ifndef IN_PORTVLAN_MINI static sw_error_t _isisc_port_vlan_trans_del(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t * entry) @@ -1198,6 +1200,7 @@ _isisc_port_vlan_trans_iterate(a_uint32_t dev_id, fal_port_t port_id, *iterator = index + 1; return SW_OK; } +#endif static sw_error_t _isisc_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) @@ -1223,6 +1226,7 @@ _isisc_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) return rv; } +#ifndef IN_PORTVLAN_MINI static sw_error_t _isisc_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) { @@ -1247,6 +1251,7 @@ _isisc_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) return SW_OK; } +#endif static sw_error_t _isisc_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, @@ -1281,6 +1286,7 @@ _isisc_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, return rv; } +#ifndef IN_PORTVLAN_MINI static sw_error_t _isisc_port_qinq_role_get(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t * role) @@ -1928,6 +1934,7 @@ isisc_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id, HSL_API_UNLOCK; return rv; } +#endif /** * @brief Add a vlan translation entry to a particular port. @@ -1948,6 +1955,7 @@ isisc_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Delete a vlan translation entry from a particular port. * @param[in] dev_id device id @@ -2007,6 +2015,7 @@ isisc_port_vlan_trans_iterate(a_uint32_t dev_id, fal_port_t port_id, HSL_API_UNLOCK; return rv; } +#endif /** * @brief Set switch qinq work mode on a particular device. @@ -2025,6 +2034,7 @@ isisc_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Get switch qinq work mode on a particular device. * @param[in] dev_id device id @@ -2042,6 +2052,7 @@ isisc_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) return rv; } +#endif /** * @brief Set qinq role on a particular port. * @param[in] dev_id device id @@ -2061,6 +2072,7 @@ isisc_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, return rv; } +#ifndef IN_PORTVLAN_MINI /** * @brief Get qinq role on a particular port. * @param[in] dev_id device id @@ -2252,13 +2264,15 @@ isisc_portvlan_init(a_uint32_t dev_id) p_api->port_default_cvid_get = isisc_port_default_cvid_get; p_api->port_default_svid_get = isisc_port_default_svid_get; p_api->port_vlan_propagation_get = isisc_port_vlan_propagation_get; - p_api->port_vlan_trans_add = isisc_port_vlan_trans_add; p_api->port_vlan_trans_del = isisc_port_vlan_trans_del; p_api->port_vlan_trans_get = isisc_port_vlan_trans_get; +#endif + p_api->port_vlan_trans_add = isisc_port_vlan_trans_add; p_api->qinq_mode_set = isisc_qinq_mode_set; - p_api->qinq_mode_get = isisc_qinq_mode_get; p_api->port_qinq_role_set = isisc_port_qinq_role_set; +#ifndef IN_PORTVLAN_MINI p_api->port_qinq_role_get = isisc_port_qinq_role_get; + p_api->qinq_mode_get = isisc_qinq_mode_get; p_api->port_vlan_trans_iterate = isisc_port_vlan_trans_iterate; p_api->port_mac_vlan_xlt_set = isisc_port_mac_vlan_xlt_set; p_api->port_mac_vlan_xlt_get = isisc_port_mac_vlan_xlt_get; diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/hsl_phy.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/hsl_phy.c index 5ad88c6c9..5866a522e 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/hsl_phy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/hsl_phy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015, 2017-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -756,7 +756,16 @@ hsl_port_phydev_get(a_uint32_t dev_id, a_uint32_t port_id, priv = ssdk_phy_priv_data_get(dev_id); SW_RTN_ON_NULL(priv); - phy_addr = qca_ssdk_port_to_phy_addr(dev_id, port_id); +#if defined(IN_PHY_I2C_MODE) + if (hsl_port_phy_access_type_get(dev_id, port_id) == PHY_I2C_ACCESS) + { + phy_addr = qca_ssdk_port_to_phy_mdio_fake_addr(dev_id, port_id); + } + else +#endif + { + phy_addr = qca_ssdk_port_to_phy_addr(dev_id, port_id); + } SW_RTN_ON_NULL(phydev); *phydev = mdiobus_get_phy(priv->miibus, phy_addr); if(*phydev == NULL) diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/malibu_phy.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/malibu_phy.c old mode 100755 new mode 100644 index bbebc59e5..1f4dba156 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/malibu_phy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/malibu_phy.c @@ -1503,11 +1503,6 @@ malibu_phy_set_autoneg_adv(a_uint32_t dev_id, a_uint32_t phy_id, if (autoneg & FAL_PHY_ADV_ASY_PAUSE) { phy_data |= MALIBU_ADVERTISE_ASYM_PAUSE; } - if (autoneg & FAL_PHY_ADV_1000T_FD) { - phy_data |= MALIBU_EXTENDED_NEXT_PAGE_EN; - } else { - phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN; - } malibu_phy_reg_write(dev_id, phy_id, MALIBU_AUTONEG_ADVERT, phy_data); @@ -2731,6 +2726,10 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_uint32_t port_bmp) led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); + /*disable Extended next page*/ + phy_data = malibu_phy_reg_read(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT); + phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN; + malibu_phy_reg_write(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT, phy_data); } } /* qca 8072 two ports phy chip's firstly address to init phy chip */ diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/mpge_phy.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/mpge_phy.c index 970c3331b..dc4d31ef1 100644 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/mpge_phy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/mpge_phy.c @@ -951,6 +951,30 @@ mpge_phy_dac_init(a_uint32_t dev_id, a_uint32_t phy_id, return; } +static sw_error_t +mpge_phy_ldo_efuse_set(a_uint32_t dev_id, a_uint32_t phy_id, a_uint32_t efuse_value) +{ + a_uint16_t phy_data = 0, phy_data1 = 0; + sw_error_t rv = SW_OK; + + /*when set the register of MPGE_PHY_DEBUG_ANA_LDO_EFUSE, the register of + MPGE_PHY_DEBUG_ANA_DAC_FILTER will be changed automatically, so need to + save it and restore it*/ + phy_data1 = mpge_phy_debug_read(dev_id, phy_id, MPGE_PHY_DEBUG_ANA_DAC_FILTER); + PHY_RTN_ON_READ_ERROR(phy_data1); + + phy_data = mpge_phy_debug_read(dev_id, phy_id, MPGE_PHY_DEBUG_ANA_LDO_EFUSE); + PHY_RTN_ON_READ_ERROR(phy_data); + phy_data &= ~(BITS(4,4)); + rv = mpge_phy_debug_write(dev_id, phy_id, MPGE_PHY_DEBUG_ANA_LDO_EFUSE, + phy_data | efuse_value); + SW_RTN_ON_ERROR(rv); + rv = mpge_phy_debug_write(dev_id, phy_id, MPGE_PHY_DEBUG_ANA_DAC_FILTER, + phy_data1); + + return rv; +} + static sw_error_t mpge_phy_hw_init(a_uint32_t dev_id, a_uint32_t port_bmp) { @@ -966,6 +990,9 @@ mpge_phy_hw_init(a_uint32_t dev_id, a_uint32_t port_bmp) /*configure the CDT threshold*/ rv = mpge_phy_cdt_thresh_init (dev_id, phy_addr); SW_RTN_ON_ERROR(rv); + /*set LDO efuse as default and make ICC efuse take effect only*/ + rv = mpge_phy_ldo_efuse_set(dev_id, phy_addr, + MPGE_PHY_DEBUG_ANA_LDO_EFUSE_DEFAULT); /*special configuration for AZ*/ rv = mpge_phy_mmd_write(dev_id, phy_addr, MPGE_PHY_MMD3_NUM, MPGE_PHY_MMD3_AZ_CTRL1, MPGE_PHY_MMD3_AZ_CTRL1_VAL); diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x.c index bdb37f2d0..c1c7c15ba 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -39,6 +39,25 @@ struct qca808x_phy_info* qca808x_phy_info_get(a_uint32_t phy_addr) return NULL; } +static a_bool_t qca808x_sfp_present(struct phy_device *phydev) +{ + qca808x_priv *priv = phydev->priv; + struct qca808x_phy_info *pdata = priv->phy_info; + a_uint32_t phy_id = 0; + sw_error_t rv = SW_OK; + + if (!pdata) { + SSDK_ERROR("pdata is null\n"); + return A_FALSE; + } + rv = qca808x_phy_get_phy_id(pdata->dev_id, pdata->phy_addr, &phy_id); + if(rv == SW_READ_ERROR) { + return A_FALSE; + } + + return A_TRUE; +} + static sw_error_t qca808x_phy_config_init(struct phy_device *phydev) { a_uint16_t phy_data; @@ -158,7 +177,8 @@ static sw_error_t qca808x_phy_config_init(struct phy_device *phydev) return SW_OK; } -static int qca808x_config_init(struct phy_device *phydev) +static a_bool_t qca808x_config_init_done = A_FALSE; +static int _qca808x_config_init(struct phy_device *phydev) { int ret = 0; #if defined(IN_LINUX_STD_PTP) @@ -171,6 +191,23 @@ static int qca808x_config_init(struct phy_device *phydev) return ret; } +static int qca808x_config_init(struct phy_device *phydev) +{ + int ret = 0; + + if(!qca808x_sfp_present(phydev)) + { + return 0; + } + ret = _qca808x_config_init(phydev); + if(!ret) + { + qca808x_config_init_done = A_TRUE; + } + + return ret; +} + static int qca808x_config_intr(struct phy_device *phydev) { int err; @@ -301,6 +338,11 @@ static int qca808x_config_aneg(struct phy_device *phydev) qca808x_priv *priv = phydev->priv; const struct qca808x_phy_info *pdata = priv->phy_info; + if(!qca808x_sfp_present(phydev)) + { + return 0; + } + if (!pdata) { return SW_FAIL; } @@ -355,11 +397,19 @@ static int qca808x_aneg_done(struct phy_device *phydev) static int qca808x_read_status(struct phy_device *phydev) { - struct port_phy_status phy_status; + struct port_phy_status phy_status = {0}; a_uint32_t dev_id = 0, phy_id = 0; qca808x_priv *priv = phydev->priv; const struct qca808x_phy_info *pdata = priv->phy_info; + if(!qca808x_config_init_done) + { + if(!_qca808x_config_init(phydev)) + { + qca808x_config_init_done = A_TRUE; + } + } + if (!pdata) { return SW_FAIL; } @@ -438,6 +488,10 @@ static int qca808x_soft_reset(struct phy_device *phydev) qca808x_priv *priv = phydev->priv; const struct qca808x_phy_info *pdata = priv->phy_info; + if(!qca808x_sfp_present(phydev)) { + return 0; + } + if (!pdata) { return SW_FAIL; } @@ -561,16 +615,12 @@ void qca808x_phydev_init(a_uint32_t dev_id, a_uint32_t port_id) /* in i2c mode, need to register a fake phy device * before the phy driver register */ if (hsl_port_phy_access_type_get(dev_id, port_id) == PHY_I2C_ACCESS) { - a_uint32_t phy_id = 0; - sw_error_t ret = SW_OK; - ret = qca808x_phy_get_phy_id(dev_id, pdata->phy_addr, &phy_id); - if (ret != SW_OK) { - SSDK_ERROR("%s fail to get phy id\n", __func__); + a_uint32_t phy_id = QCA8081_PHY_V1_1; + qca808x_phy_get_phy_id(dev_id, pdata->phy_addr, &phy_id); + if(phy_id != QCA8081_PHY_V1_1 && phy_id != INVALID_PHY_ID) { + SSDK_ERROR("phy id 0x%x is not supported\n", phy_id); return; } - if(phy_id == INVALID_PHY_ID) { - phy_id = QCA8081_PHY_V1_1; - } pdata->phydev_addr = qca_ssdk_port_to_phy_mdio_fake_addr(dev_id, port_id); sfp_phy_device_setup(dev_id, port_id, phy_id); } diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x_phy.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x_phy.c old mode 100644 new mode 100755 index cecbf2061..4ca834a75 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x_phy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/qca808x_phy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -146,13 +146,13 @@ qca808x_phy_debug_read(a_uint32_t dev_id, a_uint32_t phy_id, a_uint16_t reg_id) rv = qca808x_phy_reg_write(dev_id, phy_id, QCA808X_DEBUG_PORT_ADDRESS, reg_id); if (rv != SW_OK) { QCA808X_REG_UNLOCK; - SSDK_ERROR("qca808x_phy_reg_write failed\n"); + SSDK_DEBUG("qca808x_phy_reg_write failed\n"); return PHY_INVALID_DATA; } phy_data = qca808x_phy_reg_read(dev_id, phy_id, QCA808X_DEBUG_PORT_DATA); if (phy_data == PHY_INVALID_DATA) { QCA808X_REG_UNLOCK; - SSDK_ERROR("qca808x_phy_reg_read failed\n"); + SSDK_DEBUG("qca808x_phy_reg_read failed\n"); return PHY_INVALID_DATA; } QCA808X_REG_UNLOCK; diff --git a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/sfp_phy.c b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/sfp_phy.c index 91aca3889..66bb1acd6 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/sfp_phy.c +++ b/feeds/ipq807x/qca-ssdk/src/src/hsl/phy/sfp_phy.c @@ -45,7 +45,6 @@ __ETHTOOL_DECLARE_LINK_MODE_MASK(SFP_PHY_FEATURES) __ro_after_init; static int sfp_phy_probe(struct phy_device *pdev) { - pdev->autoneg = AUTONEG_DISABLE; SSDK_INFO("sfp phy is probed!\n"); return 0; } diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_clk.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_clk.c index 7d099f328..a3b39c403 100755 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_clk.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_clk.c @@ -465,13 +465,17 @@ static void ssdk_ppe_fixed_clock_init(a_uint32_t revision) #endif #if defined(MP) -#define TCSR_ETH_ADDR 0x19475C4 -#define TCSR_ETH_SIZE 4 -#define ETH_LDO_RDY 0x1 -#define CMN_PLL_LOCKED_ADDR 0x9B064 -#define CMN_PLL_LOCKED_SIZE 4 -#define CMN_PLL_LOCKED 4 -#define MP_RAW_CLOCK_INSTANCE 2 +#define TCSR_ETH_ADDR 0x19475C0 +#define TCSR_ETH_SIZE 0x4 +#define TCSR_GEPHY_LDO_BIAS_EN 0 +#define TCSR_ETH_LDO_RDY 0x4 + +#define GEPHY_LDO_BIAS_EN 0x1 +#define ETH_LDO_RDY 0x1 +#define CMN_PLL_LOCKED_ADDR 0x9B064 +#define CMN_PLL_LOCKED_SIZE 0x4 +#define CMN_PLL_LOCKED 0x4 +#define MP_RAW_CLOCK_INSTANCE 0x2 static char *mp_rst_ids[MP_BCR_RST_MAX] = { GEHPY_BCR_RESET_ID, @@ -615,22 +619,66 @@ static void ssdk_mp_uniphy_clock_enable(void) } static void -ssdk_mp_cmnblk_enable(void) +ssdk_mp_tcsr_get(a_uint32_t tcsr_offset, a_uint32_t *tcsr_val) { - void __iomem *tcsr_eth = NULL; - a_uint32_t reg_val; + void __iomem *tcsr_base = NULL; - tcsr_eth = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE); - if (!tcsr_eth) { + tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE); + if (!tcsr_base) + { SSDK_ERROR("Failed to map tcsr eth address!\n"); return; } + *tcsr_val = readl(tcsr_base + tcsr_offset); + iounmap(tcsr_base); - reg_val = readl(tcsr_eth); + return; +} + +static void +ssdk_mp_tcsr_set(a_uint32_t tcsr_offset, a_uint32_t tcsr_val) +{ + void __iomem *tcsr_base = NULL; + + tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE); + if (!tcsr_base) + { + SSDK_ERROR("Failed to map tcsr eth address!\n"); + return; + } + writel(tcsr_val, tcsr_base + tcsr_offset); + iounmap(tcsr_base); + + return; +} + +static void +ssdk_mp_cmnblk_enable(void) +{ + a_uint32_t reg_val; + + ssdk_mp_tcsr_get(TCSR_ETH_LDO_RDY, ®_val); reg_val |= ETH_LDO_RDY; - writel(reg_val, tcsr_eth); + ssdk_mp_tcsr_set(TCSR_ETH_LDO_RDY, reg_val); - iounmap(tcsr_eth); + return; +} + +void +ssdk_mp_gephy_icc_efuse_load_enable(a_bool_t enable) +{ + a_uint32_t reg_val; + + ssdk_mp_tcsr_get(TCSR_GEPHY_LDO_BIAS_EN, ®_val); + if(!enable) + { + reg_val |= GEPHY_LDO_BIAS_EN; + } + else + { + reg_val &= ~GEPHY_LDO_BIAS_EN; + } + ssdk_mp_tcsr_set(TCSR_GEPHY_LDO_BIAS_EN, reg_val); } static a_bool_t @@ -688,7 +736,7 @@ ssdk_mp_reset_init(void) i = UNIPHY1_SOFT_RESET_E; uniphy_rsts[i] = of_reset_control_get(rst_node, UNIPHY1_SOFT_RESET_ID); - SSDK_INFO("MP reset successfully!1\n"); + SSDK_INFO("MP reset successfully!\n"); #endif } @@ -855,6 +903,27 @@ void ssdk_uniphy_raw_clock_set( #endif } +void ssdk_uniphy_port5_clock_source_set(void) +{ +#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) + a_uint32_t id, mode, i; + + mode = ssdk_dt_global_get_mac_mode(0, SSDK_UNIPHY_INSTANCE1); + + for (i = UNIPHY_RX; i <= UNIPHY_TX; i++) { + if (mode == PORT_INTERFACE_MODE_MAX) { + id = SSDK_UNIPHY_INSTANCE0*2 + i; + } else { + id = SSDK_UNIPHY_INSTANCE1*2 + i; + } + if (clk_set_parent(uniphy_port_clks[PORT5_RX_SRC_E + i], + uniphy_raw_clks[id]->clk)) { + SSDK_ERROR("set parent fail!\n"); + } + } +#endif +} + static void ssdk_gcc_ppe_clock_init(a_uint32_t revision, enum cmnblk_clk_type mode) { @@ -863,6 +932,7 @@ void ssdk_gcc_ppe_clock_init(a_uint32_t revision, enum cmnblk_clk_type mode) /*fixme for cmn clock init*/ ssdk_cmnblk_init(mode); ssdk_ppe_uniphy_clock_init(revision); + ssdk_uniphy_port5_clock_source_set(); #endif } #endif @@ -1203,5 +1273,33 @@ void ssdk_ppe_reset_init(void) port_rst_ids[i-1]); #endif } + +void ssdk_gcc_uniphy_sys_set(a_uint32_t dev_id, a_uint32_t uniphy_index, + a_bool_t enable) +{ + enum unphy_rst_type rst_type; + + if (of_device_is_compatible(clock_node, "qcom,ess-switch-ipq60xx")){ + if (uniphy_index > SSDK_UNIPHY_INSTANCE1) { + return; + } + } + + if (uniphy_index == SSDK_UNIPHY_INSTANCE0) { + rst_type = UNIPHY0_SOFT_RESET_E; + } else if (uniphy_index == SSDK_UNIPHY_INSTANCE1) { + rst_type = UNIPHY1_SOFT_RESET_E; + } else { + rst_type = UNIPHY2_SOFT_RESET_E; + } + + if (enable == A_TRUE) { + ssdk_uniphy_reset(dev_id, rst_type, SSDK_RESET_DEASSERT); + } else { + ssdk_uniphy_reset(dev_id, rst_type, SSDK_RESET_ASSERT); + } + + return; +} #endif diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_dts.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_dts.c index 21804970b..ddc0e8af8 100644 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_dts.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_dts.c @@ -192,7 +192,8 @@ ssdk_dts_miibus_get(a_uint32_t dev_id, a_uint32_t phy_addr) ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]; for (i = 0; i < cfg->phyinfo_num; i++) { - if (phy_addr == cfg->port_phyinfo[i].phy_addr) + if (phy_addr == cfg->port_phyinfo[i].phy_addr || + phy_addr == cfg->port_phyinfo[i].phy_addr+1) return cfg->port_phyinfo[i].miibus; } diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_hppe.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_hppe.c old mode 100644 new mode 100755 index e62747e40..3c0849684 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_hppe.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_hppe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2014-2019, 2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -38,8 +38,13 @@ static sw_error_t qca_hppe_fdb_hw_init(a_uint32_t dev_id) SW_RTN_ON_NULL(p_api->adpt_port_bridge_txmac_set); for(port = SSDK_PHYSICAL_PORT0; port <= SSDK_PHYSICAL_PORT7; port++) { - fal_fdb_port_learning_ctrl_set(dev_id, port, A_TRUE, FAL_MAC_FRWRD); - fal_fdb_port_stamove_ctrl_set(dev_id, port, A_TRUE, FAL_MAC_FRWRD); + if(port == SSDK_PHYSICAL_PORT0) { + fal_fdb_port_learning_ctrl_set(dev_id, port, A_FALSE, FAL_MAC_FRWRD); + fal_fdb_port_stamove_ctrl_set(dev_id, port, A_FALSE, FAL_MAC_FRWRD); + } else { + fal_fdb_port_learning_ctrl_set(dev_id, port, A_TRUE, FAL_MAC_FRWRD); + fal_fdb_port_stamove_ctrl_set(dev_id, port, A_TRUE, FAL_MAC_FRWRD); + } fal_portvlan_member_update(dev_id, port, 0x7f); if (port == SSDK_PHYSICAL_PORT0 || port == SSDK_PHYSICAL_PORT7) { p_api->adpt_port_bridge_txmac_set(dev_id, port, A_TRUE); @@ -143,6 +148,7 @@ static sw_error_t qca_hppe_policer_hw_init(a_uint32_t dev_id) { a_uint32_t i = 0; + fal_policer_frame_type_t frame_type; fal_policer_timeslot_set(dev_id, HPPE_POLICER_TIMESLOT_DFT); @@ -150,6 +156,10 @@ qca_hppe_policer_hw_init(a_uint32_t dev_id) fal_port_policer_compensation_byte_set(dev_id, i, 4); } + /* bypass policer for dropped frame */ + frame_type = FAL_FRAME_DROPPED; + fal_policer_bypass_en_set(dev_id, frame_type, A_TRUE); + return SW_OK; } #endif @@ -755,10 +765,10 @@ qca_hppe_qm_hw_init(a_uint32_t dev_id) fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 8, 0); queue_dst.service_code = 3; - fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 0); + fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 8); queue_dst.service_code = 4; - fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 0); + fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 8); queue_dst.service_code = 5; fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 0, 0); @@ -793,7 +803,7 @@ qca_hppe_qm_hw_init(a_uint32_t dev_id) if (i == 2 || i == 6) { fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 8, 0); } else if (i == 3 || i == 4) { - fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 0); + fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 128, 8); } else { fal_ucast_queue_base_profile_set(dev_id, &queue_dst, 4, 0); } @@ -1025,8 +1035,8 @@ sw_error_t qca_hppe_acl_remark_ptp_servcode(a_uint32_t dev_id) { LIST_PRI_TAG_SERVICE_CODE_PTP); SW_RTN_ON_ERROR(ret); - /* Set up UDF0 profile */ - ret = fal_acl_udf_profile_set(dev_id, FAL_ACL_UDF_NON_IP, 0, FAL_ACL_UDF_TYPE_L3, 0); + /* Set up UDF2 profile */ + ret = fal_acl_udf_profile_set(dev_id, FAL_ACL_UDF_NON_IP, 2, FAL_ACL_UDF_TYPE_L3, 0); SW_RTN_ON_ERROR(ret); /* Tag service code for PTP packet */ @@ -1044,11 +1054,10 @@ sw_error_t qca_hppe_acl_remark_ptp_servcode(a_uint32_t dev_id) { FAL_FIELD_FLG_SET(entry.field_flg, FAL_ACL_FIELD_MAC_ETHTYPE); for (msg_type = PTP_MSG_SYNC; msg_type <= PTP_MSG_PRESP; msg_type++) { - /* L2 UDF0 for msg type */ - entry.udf0_op = FAL_ACL_FIELD_MASK; - entry.udf0_val = (msg_type << 0x8); - entry.udf0_mask = 0x0f00; - FAL_FIELD_FLG_SET(entry.field_flg, FAL_ACL_FIELD_UDF0); + /* L2 UDF2 for msg type */ + entry.udf2_val = (msg_type << 0x8); + entry.udf2_mask = 0x0f00; + FAL_FIELD_FLG_SET(entry.field_flg, FAL_ACL_FIELD_UDF2); /* Add PTP L2 rule to ACL list */ ret = fal_acl_rule_add(dev_id, LIST_ID_L2_TAG_SERVICE_CODE_PTP, @@ -1058,7 +1067,7 @@ sw_error_t qca_hppe_acl_remark_ptp_servcode(a_uint32_t dev_id) { /* Unset L2 PTP ethernet type 0x88f7 */ index = 0; - FAL_FIELD_FLG_CLR(entry.field_flg, FAL_ACL_FIELD_UDF0); + FAL_FIELD_FLG_CLR(entry.field_flg, FAL_ACL_FIELD_UDF2); FAL_FIELD_FLG_CLR(entry.field_flg, FAL_ACL_FIELD_MAC_ETHTYPE); /* Create PTP ACL L4 list */ @@ -1138,6 +1147,7 @@ qca_hppe_interface_mode_init(a_uint32_t dev_id, a_uint32_t mode0, a_uint32_t mod sw_error_t rv = SW_OK; fal_port_t port_id; a_uint32_t port_max = SSDK_PHYSICAL_PORT7; + a_uint32_t index = 0, mode[3] = {mode0, mode1, mode2}; SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id)); SW_RTN_ON_NULL(p_api->adpt_port_mux_mac_type_set); @@ -1155,6 +1165,11 @@ qca_hppe_interface_mode_init(a_uint32_t dev_id, a_uint32_t mode0, a_uint32_t mod SSDK_UNIPHY_INSTANCE2, mode2); SW_RTN_ON_ERROR(rv); } + for (index = SSDK_UNIPHY_INSTANCE0; index <= SSDK_UNIPHY_INSTANCE2; index ++) { + if (mode[index] == PORT_WRAPPER_MAX) { + ssdk_gcc_uniphy_sys_set(dev_id, index, A_FALSE); + } + } if(adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION) { port_max = SSDK_PHYSICAL_PORT6; diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_init.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_init.c old mode 100644 new mode 100755 index 43c4ddd7c..84b858c43 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_init.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2014-2021, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. @@ -1106,8 +1106,8 @@ static struct switch_attr qca_ar8327_globals[] = { }, }; -#if defined(IN_MIB) static struct switch_attr qca_ar8327_port[] = { +#if defined(IN_MIB) { .name = "reset_mib", .description = "Reset Mib Counters", @@ -1121,8 +1121,18 @@ static struct switch_attr qca_ar8327_port[] = { .set = NULL, .get = qca_ar8327_sw_get_port_mib, }, -}; #endif +#if defined(IN_PORTCONTROL) + { + .type = SWITCH_TYPE_INT, + .name = "enable_eee", + .description = "Enable EEE", + .set = qca_ar8327_sw_set_eee, + .get = qca_ar8327_sw_get_eee, + .max = 1, + }, +#endif +}; #if defined(IN_VLAN) static struct switch_attr qca_ar8327_vlan[] = { @@ -1142,12 +1152,10 @@ const struct switch_dev_ops qca_ar8327_sw_ops = { .attr = qca_ar8327_globals, .n_attr = ARRAY_SIZE(qca_ar8327_globals), }, -#if defined(IN_MIB) .attr_port = { .attr = qca_ar8327_port, .n_attr = ARRAY_SIZE(qca_ar8327_port), }, -#endif #if defined(IN_VLAN) .attr_vlan = { .attr = qca_ar8327_vlan, @@ -1398,6 +1406,11 @@ dess_rgmii_mac_work_stop(struct qca_phy_priv *priv) void qca_mac_port_status_init(a_uint32_t dev_id, a_uint32_t port_id) { + if(port_id < SSDK_PHYSICAL_PORT1 || port_id >= SW_MAX_NR_PORT) + { + SSDK_ERROR("port %d does not support status init\n", port_id); + return; + } qca_phy_priv_global[dev_id]->port_old_link[port_id - 1] = 0; qca_phy_priv_global[dev_id]->port_old_speed[port_id - 1] = FAL_SPEED_BUTT; qca_phy_priv_global[dev_id]->port_old_duplex[port_id - 1] = FAL_DUPLEX_BUTT; @@ -1547,7 +1560,7 @@ static int qca_switchdev_register(struct qca_phy_priv *priv) sw_dev->ops = &qca_ar8327_sw_ops; sw_dev->vlans = AR8327_MAX_VLANS; - sw_dev->ports = SSDK_MAX_PORT_NUM; + sw_dev->ports = priv->ports; ret = register_switch(sw_dev, NULL); if (ret != SW_OK) { @@ -1675,7 +1688,22 @@ static int ssdk_switch_register(a_uint32_t dev_id, ssdk_chip_type chip_type) priv->phy_dbg_write = qca_ar8327_phy_dbg_write; priv->phy_dbg_read = qca_ar8327_phy_dbg_read; priv->phy_mmd_write = qca_ar8327_mmd_write; - priv->ports = SSDK_MAX_PORT_NUM; + + if (chip_type == CHIP_DESS) { + priv->ports = 6; + } else if ((chip_type == CHIP_ISIS) || (chip_type == CHIP_ISISC)) { + priv->ports = 7; + } else if (chip_type == CHIP_SCOMPHY) { +#ifdef MP + if(adapt_scomphy_revision_get(priv->device_id) == MP_GEPHY) { + /*for ipq50xx, port id is 1 and 2, port 0 is not available*/ + priv->ports = 3; + } +#endif + } else { + priv->ports = SSDK_MAX_PORT_NUM; + } + #ifdef MP if(chip_type == CHIP_SCOMPHY) { @@ -3249,15 +3277,27 @@ static int ssdk_dev_event(struct notifier_block *this, unsigned long event, void #endif case NETDEV_CHANGEMTU: if(dev->type == ARPHRD_ETHER) { - if (strstr(dev->name, "eth")) { - if (cfg.chip_type == CHIP_DESS || - cfg.chip_type == CHIP_ISIS || - cfg.chip_type == CHIP_ISISC) { -#ifdef IN_MISC - fal_frame_max_size_set(0, - dev->mtu + 18); -#endif + if (cfg.chip_type == CHIP_DESS || + cfg.chip_type == CHIP_ISIS || + cfg.chip_type == CHIP_ISISC) { + struct net_device *eth_dev = NULL; + unsigned int mtu= 0; + + if(!strcmp(dev->name, "eth0")) { + eth_dev = dev_get_by_name(&init_net, "eth1"); + } else if (!strcmp(dev->name, "eth1")) { + eth_dev = dev_get_by_name(&init_net, "eth0"); + } else { + return NOTIFY_DONE; } + if (!eth_dev) { + return NOTIFY_DONE; + } + mtu = dev->mtu > eth_dev->mtu ? dev->mtu : eth_dev->mtu; +#ifdef IN_MISC + fal_frame_max_size_set(0, mtu + 18); +#endif + dev_put(eth_dev); } } break; @@ -3422,19 +3462,21 @@ static void qca_ar8327_gpio_reset(struct qca_phy_priv *priv) #endif if(!np) return; - - reset_gpio = of_get_property(np, "reset_gpio", &len); - if (!reset_gpio ) + gpio_num = of_get_named_gpio(np, "reset_gpio", 0); + if(gpio_num < 0) { - SSDK_INFO("reset_gpio node does not exist\n"); - return; - } - - gpio_num = be32_to_cpup(reset_gpio); - if(gpio_num <= 0) - { - SSDK_INFO("reset gpio doesn't exist\n "); - return; + reset_gpio = of_get_property(np, "reset_gpio", &len); + if (!reset_gpio ) + { + SSDK_INFO("reset_gpio node does not exist\n"); + return; + } + gpio_num = be32_to_cpup(reset_gpio); + if(gpio_num <= 0) + { + SSDK_INFO("reset gpio doesn't exist\n "); + return; + } } ret = gpio_request(gpio_num, "reset_gpio"); if(ret) diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_mp.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_mp.c index 9e96b4e42..d28670a4e 100644 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_mp.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_mp.c @@ -20,6 +20,7 @@ #include "ssdk_mp.h" #include "adpt.h" #include "ssdk_led.h" +#include "ssdk_clk.h" #ifdef IN_PORTCONTROL sw_error_t @@ -52,6 +53,8 @@ qca_mp_portctrl_hw_init(a_uint32_t dev_id) fal_port_promisc_mode_set(dev_id, i, A_TRUE); /* init software level port status */ qca_mac_port_status_init(dev_id, i); + /*enable ICC efuse loading*/ + ssdk_mp_gephy_icc_efuse_load_enable(A_TRUE); } return rv; } diff --git a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_plat.c b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_plat.c old mode 100644 new mode 100755 index 7a6a3b635..1bb848260 --- a/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_plat.c +++ b/feeds/ipq807x/qca-ssdk/src/src/init/ssdk_plat.c @@ -948,16 +948,16 @@ void ssdk_dts_phyinfo_dump(a_uint32_t dev_id) port_phyinfo->phy_addr, 5, ""); for (j = 0; j < QCA_PHY_FEATURE_MAX; j++) { if (port_phyinfo->phy_features & BIT(j) && BIT(j) != PHY_F_INIT) { - printk("%s ", qca_phy_feature_str[j]); + printk(KERN_CONT "%s ", qca_phy_feature_str[j]); if (BIT(j) == PHY_F_FORCE) { - printk("(speed: %d, duplex: %s) ", + printk(KERN_CONT "(speed: %d, duplex: %s) ", port_phyinfo->port_speed, port_phyinfo->port_duplex > 0 ? "full" : "half"); } } } - printk("\n"); + printk(KERN_CONT "\n"); } } } diff --git a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_fdb.c b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_fdb.c old mode 100755 new mode 100644 index 87d01936c..7c1a5fcc9 --- a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_fdb.c +++ b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_fdb.c @@ -140,15 +140,28 @@ ref_fdb_get_port_by_mac(unsigned int vid, const char * addr) fal_fdb_entry_t entry; unsigned char i; sw_error_t rv; + a_uint32_t dev_id = 0; memset(&entry, 0, sizeof(entry)); + SSDK_DEBUG("the fdb entry with MAC:%x-%x-%x-%x-%x-%x, fid:%d will be searched\n", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], vid); entry.fid = vid; for (i = 0; i < 6; i++) entry.addr.uc[i] = addr[i]; - - rv = fal_fdb_find(0, &entry); - if (rv != SW_OK) + for(dev_id = 0; dev_id < SW_MAX_NR_DEV; dev_id++) + { + rv = fal_fdb_find(dev_id, &entry); + if (rv == SW_OK) + { + SSDK_DEBUG("device %d have the entry\n", dev_id); + break; + } + } + if(rv != SW_OK) + { + SSDK_DEBUG("the entry cannot be found\n"); return 0xffffffff; + } for (i = 0; i < MAX_PORT; i++) { diff --git a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_port_ctrl.c b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_port_ctrl.c old mode 100755 new mode 100644 index e749897cd..b0a0b679e --- a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_port_ctrl.c +++ b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_port_ctrl.c @@ -65,6 +65,7 @@ qca_ar8327_sw_get_port_link(struct switch_dev *dev, int port, fal_port_speed_t speed = FAL_SPEED_10; fal_port_duplex_t duplex = FAL_FULL_DUPLEX; + fal_port_eee_cfg_t port_eee_cfg = {0}; a_bool_t status = 0; a_bool_t tx_fc = 0; a_bool_t rx_fc = 0; @@ -118,6 +119,18 @@ qca_ar8327_sw_get_port_link(struct switch_dev *dev, int port, if (ret == SW_OK) { link->tx_flow = tx_fc; } + ret = fal_port_interface_eee_cfg_get(priv->device_id, port, + &port_eee_cfg); + if(ret == SW_OK) + { + link->eee &= ~(ADVERTISED_100baseT_Full || ADVERTISED_1000baseT_Full); + if(port_eee_cfg.advertisement & FAL_PHY_EEE_100BASE_T) { + link->eee |= ADVERTISED_100baseT_Full; + } + if(port_eee_cfg.advertisement & FAL_PHY_EEE_1000BASE_T) { + link->eee |= ADVERTISED_1000baseT_Full; + } + } mutex_unlock(&priv->reg_mutex); return 0; @@ -710,3 +723,53 @@ dess_rgmii_sw_mac_polling_task(struct qca_phy_priv *priv) return; } +#ifdef IN_SWCONFIG +int qca_ar8327_sw_set_eee(struct switch_dev *dev, + const struct switch_attr *attr, struct switch_val *val) +{ + sw_error_t rv = SW_OK; + struct qca_phy_priv *priv = qca_phy_priv_get(dev); + fal_port_eee_cfg_t port_eee_cfg; + + SSDK_DEBUG("configure EEE for dev_id: %d, port %d as %d\n", + priv->device_id, val->port_vlan, val->value.i); + rv = fal_port_interface_eee_cfg_get(priv->device_id, val->port_vlan, &port_eee_cfg); + if(rv != SW_OK) + { + return -1; + } + port_eee_cfg.enable = val->value.i; + port_eee_cfg.lpi_tx_enable = val->value.i; + + if(port_eee_cfg.enable) + { + port_eee_cfg.advertisement = FAL_PHY_EEE_100BASE_T | FAL_PHY_EEE_1000BASE_T; + } + rv = fal_port_interface_eee_cfg_set(priv->device_id, val->port_vlan, &port_eee_cfg); + if(rv != SW_OK) + { + return -1; + } + + return 0; +} + +int qca_ar8327_sw_get_eee(struct switch_dev *dev, + const struct switch_attr *attr, struct switch_val *val) +{ + sw_error_t rv = SW_OK; + struct qca_phy_priv *priv = qca_phy_priv_get(dev); + fal_port_eee_cfg_t port_eee_cfg; + + SSDK_DEBUG("get EEE for dev_id: %d, port %d\n", + priv->device_id, val->port_vlan); + rv = fal_port_interface_eee_cfg_get(priv->device_id, val->port_vlan, &port_eee_cfg); + if(rv != SW_OK) + { + return -1; + } + val->value.i = port_eee_cfg.enable; + + return 0; +} +#endif diff --git a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_uci.c b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_uci.c old mode 100644 new mode 100755 index 4276d1e4d..a4291051d --- a/feeds/ipq807x/qca-ssdk/src/src/ref/ref_uci.c +++ b/feeds/ipq807x/qca-ssdk/src/src/ref/ref_uci.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013, 2015, 2017-2019, 2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -10161,6 +10161,34 @@ parse_policer_aclentry(struct switch_val *val) return rv; } +static int +parse_policer_bypass(struct switch_val *val) +{ + struct switch_ext *switch_ext_p, *ext_value_p; + int rv = 0; + switch_ext_p = val->value.ext_val; + while(switch_ext_p) { + ext_value_p = switch_ext_p; + + if(!strcmp(ext_value_p->option_name, "name")) { + switch_ext_p = switch_ext_p->next; + continue; + } else if(!strcmp(ext_value_p->option_name, "frame_type")) { + val_ptr[0] = (char*)ext_value_p->option_value; + } else if(!strcmp(ext_value_p->option_name, "bypass_status")) { + val_ptr[1] = (char*)ext_value_p->option_value; + } else { + rv = -1; + break; + } + + parameter_length++; + switch_ext_p = switch_ext_p->next; + } + + return rv; +} + #endif #ifdef IN_SHAPER @@ -11359,6 +11387,8 @@ parse_policer(const char *command_name, struct switch_val *val) rv = parse_policer_portentry(val); } else if(!strcmp(command_name, "Aclentry")) { rv = parse_policer_aclentry(val); + } else if(!strcmp(command_name, "Bypass")) { + rv = parse_policer_bypass(val); } return rv; diff --git a/feeds/ipq807x/qca-ssdk/src/src/shell_lib/shell_config.c b/feeds/ipq807x/qca-ssdk/src/src/shell_lib/shell_config.c old mode 100644 new mode 100755 index 3f4ad2ab4..1b00daf3e --- a/feeds/ipq807x/qca-ssdk/src/src/shell_lib/shell_config.c +++ b/feeds/ipq807x/qca-ssdk/src/src/shell_lib/shell_config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013, 2015-2019, 2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1200,6 +1200,7 @@ struct sub_cmd_des_t g_policer_des[] = {"fcscompensation", "set", SW_API_POLICER_COMPENSATION_SET, NULL}, {"portentry", "set", SW_API_POLICER_PORT_ENTRY_SET, NULL}, {"aclentry", "set", SW_API_POLICER_ACL_ENTRY_SET, NULL}, + {"bypass", "set", SW_API_POLICER_BYPASS_EN_SET, NULL}, {NULL, NULL, 0, NULL},/*end of desc*/ }; #endif diff --git a/feeds/wifi-ax/ath11k-firmware/Makefile b/feeds/wifi-ax/ath11k-firmware/Makefile index 44d5809d0..efe4ffeb7 100644 --- a/feeds/wifi-ax/ath11k-firmware/Makefile +++ b/feeds/wifi-ax/ath11k-firmware/Makefile @@ -61,9 +61,9 @@ define Package/ath11k-firmware-ipq807x/install endef define Package/ath11k-firmware-qcn9000/install - $(INSTALL_DIR) $(1)/lib/firmware/ath11k/qcn9000/hw1.0/ + $(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ $(INSTALL_DATA) ./files/QCN9000/* \ - $(1)/lib/firmware/ath11k/qcn9000/hw1.0/ + $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ endef $(eval $(call BuildPackage,ath11k-firmware-ipq60xx)) diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/fw_version.txt b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/fw_version.txt new file mode 100755 index 000000000..660aa75df --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/fw_version.txt @@ -0,0 +1 @@ +WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 v1 diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b01 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b01 index 96e922f01..3a25605c8 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b01 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b01 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b02 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b02 index 0f307492d..e45c10de1 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b02 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.b02 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.mdt b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.mdt index 9d51226a7..6f6bddb56 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.mdt and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/m3_fw.mdt differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b00 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b00 index 0ba22960c..2a0616a0f 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b00 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b00 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b01 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b01 index eba557707..7d48d6a14 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b01 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b01 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b02 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b02 index c93589adb..a2d3db543 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b02 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b02 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b03 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b03 index ab8fdfddb..efefa5870 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b03 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b03 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b04 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b04 index 3113c3c77..fb571c229 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b04 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b04 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b05 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b05 index bd35391b2..e9f13e495 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b05 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b05 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b07 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b07 index c5a21cbf3..454c939b2 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b07 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b07 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b08 b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b08 index 6a7a4509b..dfb80a8a5 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b08 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.b08 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.mdt b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.mdt index 98805947f..89b63099a 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.mdt and b/feeds/wifi-ax/ath11k-firmware/files/IPQ6018/q6_fw.mdt differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/Notice.txt b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/Notice.txt deleted file mode 100644 index 665d813b7..000000000 --- a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/Notice.txt +++ /dev/null @@ -1,795 +0,0 @@ -This Notice.txt file contains certain notices of software components included with the software that Qualcomm Atheros, Inc. -(“Qualcomm Atheros”) is required to provide you. Except where prohibited by the open source license, the content of this -notices file is only provided to satisfy Qualcomm Atheros's attribution and notice requirement; your use of these software -components together with the Qualcomm Atheros software (Qualcomm Atheros software hereinafter referred to as “Software”) is -subject to the terms of your agreement from Qualcomm Atheros. Compliance with all copyright laws and software license agreements -included in the notice section of this file are the responsibility of the user. Except as may be granted by separate express -written agreement, this file provides no license to any patents, trademarks, copyrights, or other intellectual property of -Qualcomm Incorporated or any of its subsidiaries. - -Qualcomm is a trademark of Qualcomm Incorporated, registered in the United States and other countries. All Qualcomm Incorporated -trademarks are used with permission. Other products and brand names may be trademarks or registered trademarks of their respective -owners. - --------------------- - - /* - * WPA definitions shared between hostapd and wpa_supplicant - * Copyright (c) 2002-2018, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - --------------------- - - /* WPA/RSN - Shared functions for supplicant and authenticator - * EAP common peer/server definitions - * EAP peer state machines (RFC 4137) - * Copyright (c) 2002-2018, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - --------------------- - -/* - * Copyright (c) 2011 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - * Notifications and licenses are retained for attribution purposes only. - */ -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * AES-based functions - * - * - * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) - * - One-Key CBC MAC (OMAC1) hash with AES-128 - * - AES-128 CTR mode encryption - * - AES-128 EAX mode encryption/decryption - * - AES-128 CBC - * - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * Copyright (c) 2011 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - * Notifications and licenses are retained for attribution purposes only. - */ -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * SHA1 hash implementation and interface functions - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * Copyright (c) 2011 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - * Notifications and licenses are retained for attribution purposes only. - */ -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * WPA Supplicant / wrapper functions for crypto libraries - * Copyright (c) 2004-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - * - * This file defines the cryptographic functions that need to be implemented - * for wpa_supplicant and hostapd. When TLS is not used, internal - * implementation of MD5, SHA1, and AES is used and no external libraries are - * required. When TLS is enabled (e.g., by enabling EAP-TLS or EAP-PEAP), the - * crypto library used by the TLS implementation is expected to be used for - * non-TLS needs, too, in order to save space by not implementing these - * functions twice. - * - * Wrapper code for using each crypto library is in its own file (crypto*.c) - * and one of these files is build and linked in to provide the functions - * defined here. - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * WPA Supplicant - Common definitions - * Copyright (c) 2004-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * WPA Supplicant - WPA state machine and EAPOL-Key processing - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * WPA Supplicant / Configuration file structures - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - - /* - * Copyright (c) 2008, Atheros Communications Inc. - * - * Copyright (c) 2011 Qualcomm Atheros, Inc. - * Qualcomm Atheros, Inc. has chosen to take madwifi subject to the BSD license and terms. - * - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * wpa_supplicant - Internal WPA state machine definitions - * Copyright (c) 2004-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * wpa_supplicant - WPA definitions - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -/* - * wpa_supplicant/hostapd / common helper functions, etc. - * Copyright (c) 2002-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - --------------------- - - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004, National ICT Australia - * Copyright (c) 2007, Open Kernel Labs, Inc. - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - --------------------- - - * Copyright (c) 2002-2004, Karlsruhe University - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - --------------------- - - /* - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. - * - * First, the polynomial itself and its table of feedback terms. The - * polynomial is - * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 - * - * Note that we take it "backwards" and put the highest-order term in - * the lowest-order bit. The X^32 term is "implied"; the LSB is the - * X^31 term, etc. The X^0 term (usually shown as "+1") results in - * the MSB being 1 - * - * Note that the usual hardware shift register implementation, which - * is what we're using (we're merely optimizing it by doing eight-bit - * chunks at a time) shifts bits into the lowest-order term. In our - * implementation, that means shifting towards the right. Why do we - * do it this way? Because the calculated CRC must be transmitted in - * order from highest-order term to lowest-order term. UARTs transmit - * characters in order from LSB to MSB. By storing the CRC this way - * we hand it to the UART in the order low-byte to high-byte; the UART - * sends each low-bit to hight-bit; and the result is transmission bit - * by bit from highest- to lowest-order term without requiring any bit - * shuffling on our part. Reception works similarly - * - * The feedback terms table consists of 256, 32-bit entries. Notes - * - * The table can be generated at runtime if desired; code to do so - * is shown later. It might not be obvious, but the feedback - * terms simply represent the results of eight shift/xor opera - * tions for all combinations of data and CRC register values - * - * The values must be right-shifted by eight bits by the "updcrc - * logic; the shift must be unsigned (bring in zeroes). On some - * hardware you could probably optimize the shift in assembler by - * using byte-swap instructions - * polynomial $edb88320 - * - * - * CRC32 code derived from work by Gary S. Brown. - */ - --------------------- - - * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ - * - * Copyright (c) 2000-2001, Aaron D. Gifford - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - --------------------- - - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - --------------------- - - * Copyright (c) 1982, 1986, 1990, 1991, 1993 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - --------------------- - -# Copyright (c) 2012-2015 Qualcomm Atheros, Inc. -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - --------------------- - - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - --------------------- - -/* $OpenBSD: string.h,v 1.17 2006/01/06 18:53:04 millert Exp $ */ -/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)string.h 5.10 (Berkeley) 3/9/91 - */ - --------------------- - - // Copyright (c) 1991, 1993 - // The Regents of the University of California. All rights reserved. - // $ATH_LICENSE_NULL$ - // - // Redistribution and use in source and binary forms, with or without - // modification, are permitted provided that the following conditions - // are met: - // 1. Redistributions of source code must retain the above copyright - // notice, this list of conditions and the following disclaimer. - // 2. Redistributions in binary form must reproduce the above copyright - // notice, this list of conditions and the following disclaimer in the - // documentation and/or other materials provided with the distribution. - // 3. All advertising materials mentioning features or use of this software - // must display the following acknowledgement: - // This product includes software developed by the University of - // California, Berkeley and its contributors. - // 4. Neither the name of the University nor the names of its contributors - // may be used to endorse or promote products derived from this software - // without specific prior written permission. - // - // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - // SUCH DAMAGE. - --------------------- - - * Copyright (c) 1998, 2010 Todd C. Miller - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - --------------------- - -/* - * Copyright (c) 1998 Todd C. Miller - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --------------------- - -** Copyright (c) 2004-2010, Atheros Communications Inc. -** -** Permission to use, copy, modify, and/or distribute this software for any -** purpose with or without fee is hereby granted, provided that the above -** copyright notice and this permission notice appear in all copies. -** -** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -** ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -** WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -** ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -** -** This module is the Atheros specific ioctl/iwconfig/iwpriv interface -** to the ATH object, normally instantiated as wifiX, where X is the -** instance number (e.g. wifi0, wifi1). -** -** This provides a mechanism to configure the ATH object within the -** Linux OS enviornment. This file is OS specific. - --------------------- - -/* - * Copyright (c) 2012 Qualcomm Atheros, Inc. - * All Rights Reserved. - * Qualcomm Atheros Confidential and Proprietary. - */ - -/* - * For this file, which was received with alternative licensing options for - * distribution, Qualcomm Atheros, Inc. has selected the BSD license. - */ - -//- -// Copyright (c) 2002-2004 Sam Leffler, Errno Consulting -// All rights reserved. -// $ATH_LICENSE_NULL$ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer, -// without modification. -// 2. Redistributions in binary form must reproduce at minimum a disclaimer -// similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any -// redistribution must be conditioned upon including a substantially -// similar Disclaimer requirement for further binary redistribution. -// 3. Neither the names of the above-listed copyright holders nor the names -// of any contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// Alternatively, this software may be distributed under the terms of the -// GNU General Public License ("GPL") version 2 as published by the Free -// Software Foundation. -// -// NO WARRANTY -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY -// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, -// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGES. - --------------------- - - /* - * AES SIV (RFC 5297) - * Copyright (c) 2013 Cozybit, Inc. - * - * This software may be distributed under the terms of the BSD license. - */ - --------------------- - - * Copyright 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - --------------------- - -/* ===== start - public domain SHA256 implementation ===== */ - -/* This is based on SHA256 implementation in LibTomCrypt that was released into - * public domain by Tom St Denis. */ - --------------------- - -// This code implements the MD5 message-digest algorithm. -// The algorithm is due to Ron Rivest. This code was -// written by Colin Plumb in 1993, no copyright is claimed. -// This code is in the public domain; do with it what you wish. -// -// Equivalent code is available from RSA Data Security, Inc. -// This code has been tested against that, and is equivalent, -// except that you don't need to include two pages of legalese -// with every copy. -// - --------------------- diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/fw_version.txt b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/fw_version.txt new file mode 100755 index 000000000..fef70f43d --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/fw_version.txt @@ -0,0 +1 @@ +WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 v2 diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b00 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b00 old mode 100644 new mode 100755 diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b01 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b01 old mode 100644 new mode 100755 index d5aec573b..e126f02a0 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b01 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b01 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b02 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b02 old mode 100644 new mode 100755 index 9f36236a3..45f97d653 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b02 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.b02 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.flist b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.flist old mode 100644 new mode 100755 diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.mdt b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.mdt old mode 100644 new mode 100755 index dc77aaba5..117e12fe2 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.mdt and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/m3_fw.mdt differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b00 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b00 old mode 100644 new mode 100755 index 13f932d8c..3d1f93d15 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b00 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b00 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b01 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b01 old mode 100644 new mode 100755 index 3d96f675b..5206977e3 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b01 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b01 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b02 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b02 old mode 100644 new mode 100755 index ef6f5ea1b..d3a193c8a Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b02 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b02 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b03 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b03 old mode 100644 new mode 100755 index 8b286af06..72eefc64e Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b03 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b03 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b04 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b04 old mode 100644 new mode 100755 index 854c94577..c1b13f84f Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b04 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b04 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b05 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b05 old mode 100644 new mode 100755 index 737d0f002..1f82cb123 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b05 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b05 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b07 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b07 old mode 100644 new mode 100755 index 07e250789..3b9bc9be7 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b07 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b07 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b08 b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b08 old mode 100644 new mode 100755 index a8a6e6974..a69ae8c5e Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b08 and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.b08 differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.flist b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.flist old mode 100644 new mode 100755 diff --git a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.mdt b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.mdt old mode 100644 new mode 100755 index 9da891f9f..7b69acc28 Binary files a/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.mdt and b/feeds/wifi-ax/ath11k-firmware/files/IPQ8074/q6_fw.mdt differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/Data.msc b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/Data.msc new file mode 100644 index 000000000..805536381 --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/Data.msc @@ -0,0 +1,6187 @@ +VERSION:621184076 + +8,i,[ wlan_swbmiss_offload.c : 492 ] wlan_bmiss_update_hwbmiss = %d +7,iiiiiiii,[ wlan_swbmiss_offload.c : 639 ] SWBMISS_NULL_SEND_CMPLT: vdev_id=%d, isQosNullSuccess=%d, isFinalBmiss=%d, first_bmiss_detected=%d, final_bmiss_detected=%d, fbmiss_evnt_posted=%d, vbmiss->connected = %d, cons_bmiss_count = %d +6,ii,[ wlan_swbmiss_offload.c : 510 ] SWBMISS_BCON_RECVED: vdev_id=%d, IS_HWBMISS=%d +5,iiiiiii,[ wlan_swbmiss_offload.c : 947 ] SWBMISS_TIMER_FN: vdev_id=%d, curr_bmiss_bcnt=%d, pre_bmiss_detected=%d, first_bmiss_detected=%d, final_bmiss_detected=%d, b_timeout=%d, cons_bmiss_count = %d +4,iIii,[ wlan_swbmiss_offload.c : 1132 ] SWBMISS_DELIVER_EVT: vdev_id=%d, evt_type=0x%x, bcn_rssi_avg=%d, bcn_rssi_last=%d +3,iiIIiI,[ wlan_swbmiss_offload.c : 460 ] SWBMISS_DISABLED: vdev_id=%d, module_id=%d, bmiss_disable_bitmap_63_32=0x%x, bmiss_disable_bitmap_31_0=0x%x, curr_bmiss_bcnt=%d, cur_disable_bitmask=0x%x +2,iiIIii,[ wlan_swbmiss_offload.c : 417 ] SWBMISS_ENABLED: vdev_id=%d, module_id=%d, bmiss_disable_bitmap_63_32=0x%x, bmiss_disable_bitmap_31_0=0x%x, curr_bmiss_bcnt=%d, final_bmiss_detected=%d +1,ii,[ wlan_swbmiss_offload.c : 569 ] SWBMISS_TIMER_SET: vdev_id=%d, timeout_val=%d +0,iiii,[ wlan_swbmiss_offload.c : 1198 ] SWBMISS_VDEV_EVT: vdev_id=%d, mac id %d notif=%d , HBMISS %d +74,,[ wlan_dev.c : 7637 ] WMI_PDEV_SET_WMM_PARAMS_CMDID DEPRECATED - use VDEV level command instead +73,,[ wlan_dev.c : 7840 ] wlan_pdev_resume_cmd: NOT expected to receive during wifi on +72,i,[ wlan_dev.c : 7853 ] wlan_pdev_resume_cmd: NOT expected to receive during wifi on, mac id=%d +71,,[ wlan_dev.c : 8073 ] WMI_REQUEST_LINK_STATS_CMDID, ftm mode +70,iII,[ wlan_dev.c : 8203 ] WMI_LRO_CONFIG_CMDID 1 mac=%d en=%x flags=%x +69,i,[ wlan_dev.c : 8409 ] WMI_PDEV_SMART_ANT_ENABLE_CMDID gpio_handler_num : %d +68,i,[ wlan_dev.c : 8439 ] WMI_PDEV_SMART_ANT_ENABLE_CMDID loop number : %d +67,i,[ wlan_dev.c : 8650 ] BSS_CHAN_INFO_CMD_RCVD mac_id:%d +66,IIII,[ wlan_dev.c : 8831 ] WMI_GPIO_CONFIG_CMDID: %x %x %x %x +65,II,[ wlan_dev.c : 8901 ] WMI_GPIO_OUTPUT_CMDID: %x %x +64,II,[ wlan_dev.c : 7247 ] smart_ant_gpio_handler smart_gpio_cfg.gpio_num :%x, smart_gpio_cfg.func: %x +63,iiii,[ wlan_dev.c : 2745 ] To serve %d peers %d TIDs is enough (TQM TIDs = %d, TQM BYPASS TIDs = %d) +62,iiii,[ wlan_dev.c : 2752 ] To serve %d peers %d TIDs required (TQM TIDs = %d, TQM BYPASS TIDs = %d) +61,ii,[ wlan_dev.c : 6443 ] wlan_dev_set_pcl not match pcl_cnt=%d,supp_chan_cnt=%d +60,iii,[ wlan_dev.c : 6469 ] wlan_dev_set_pcl: cur_category %d: num_chans_in_category %d -> cur_idx %d +59,i,[ wlan_dev.c : 6477 ] wlan_dev_set_pcl: num_chans=%d +58,i,[ wlan_dev.c : 9279 ] unit_test: sleep for %d ms +57,I,[ wlan_dev.c : 9301 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_TX_CHAIN_MASK, value=0x%x +56,I,[ wlan_dev.c : 9310 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_RX_CHAIN_MASK, value=0x%x +55,I,[ wlan_dev.c : 9320 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_TX_CHAIN_MASK_2G, value=0x%x +54,I,[ wlan_dev.c : 9330 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_RX_CHAIN_MASK_2G, value=0x%x +53,I,[ wlan_dev.c : 9340 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_TX_CHAIN_MASK_5G, value=0x%x +52,I,[ wlan_dev.c : 9350 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_RX_CHAIN_MASK_5G, value=0x%x +51,ii,[ wlan_dev.c : 9360 ] wlan_dev_unit_test: cca_busy_detector_config time_diff_threshold = %d us, cca_busy_percent_threshold = %d +50,I,[ wlan_dev.c : 9288 ] wlan_dev_unit_test: cmd = WMI_PDEV_PARAM_ABG_MODE_TX_CHAIN_NUM, value = 0x%x +49,iiii,[ wlan_dev.c : 411 ] GreenAP Curr Chainmask: %d/%d, Phy_mode: %d, bw[20/40/80/160]: %d +48,iiiii,[ wlan_dev.c : 413 ] GreenAP saved tx/rx chainmask: %d/%d, phymode: %d, freq1: %d, valid flag: %d +47,iii,[ wlan_dev.c : 415 ] GreenAP cur_channel mhz: %d, freq1: %d, freq2: %d +46,,[ wlan_dev.c : 3272 ] phymode_param Received multi-vdev command +45,iii,[ wlan_dev.c : 3352 ] Update Stream: vdev_id=%d preferred_tx_stream = %d preferred_rx_stream = %d +44,ii,[ wlan_dev.c : 3360 ] phymode_param: applying phymode=%d for vdev at index %d +43,IIi,[ wlan_dev.c : 9797 ] wlan_pdev_get_hw_mode_transition_event: old_hw_idx=0x%x, new_hw_idx=0x%x, vdev_num=%d +42,ii,[ wlan_dev.c : 10362 ] wlan_pdev_handle_get_channel_ani_cmd max_channel_limit %d, received_count %d +41,i,[ wlan_dev.c : 10374 ] wlan_pdev_handle_get_channel_ani_cmd memory allocation failed, %d +40,iii,[ wlan_dev.c : 10406 ] wlan_pdev_handle_get_channel_ani_cmd freq:%d, mac_id:%d, ani:%d +39,i,[ wlan_dev.c : 10410 ] wlan_pdev_handle_get_channel_ani_cmd unsupported freq:%d +38,iiiI,[ wlan_dev.c : 6857 ] pdev_id = %d: DMA %d push config status %d event %p +37,i,[ wlan_dev.c : 2362 ] BSS_CHAN_INFO_EVENT_SENT mac_id:%d +36,ii,[ wlan_dev.c : 431 ] GreenAP wlan_pdev_set_greenap_cmd enable: %d, zero_client:%d +35,I,[ wlan_dev.c : 6525 ] wlan_pdev_set_hw_mode: HW_Mode_Idx = 0x%x +34,I,[ wlan_dev.c : 6550 ] wlan_pdev_set_hw_mode: DBSMGR_Ret_Status = 0x%x +33,,[ wlan_dev.c : 6695 ] wlan_pdev_set_hw_mode_resp_event: WMI Event Alloc Failed!!! +32,II,[ wlan_dev.c : 6735 ] wlan_pdev_set_hw_mode_resp_event: status=0x%x, cfg_hw_mode_idx=0x%x +31,,[ wlan_dev.c : 6604 ] WMI_PDEV_SET_MAC_CONFIG_RESP_EVENT: WMI Event Alloc Failed!!! +30,I,[ wlan_dev.c : 6621 ] WMI_PDEV_SET_MAC_CONFIG_RESP_EVENT: status=0x%x +29,I,[ wlan_dev.c : 3698 ] wlan_pdev_set_param: WMI_PDEV_PARAM_TX_CHAIN_MASK 0x%x +28,I,[ wlan_dev.c : 3727 ] wlan_pdev_set_param: WMI_PDEV_PARAM_TX_CHAIN_MASK 0x%x not valid +27,I,[ wlan_dev.c : 3760 ] wlan_pdev_set_param: WMI_PDEV_PARAM_RX_CHAIN_MASK 0x%x +26,I,[ wlan_dev.c : 3783 ] wlan_pdev_set_param: WMI_PDEV_PARAM_RX_CHAIN_MASK 0x%x not valid +25,,[ wlan_dev.c : 4670 ] PDEV_PARAM_RX_FILTER not supported +24,I,[ wlan_dev.c : 4847 ] PDEV_PARAM_IOT_PATTERN=%08x +23,,[ wlan_dev.c : 4962 ] PDEV_PARAM_GCMP_SUPPORT_ENABLE not handled in FW +22,,[ wlan_dev.c : 7068 ] WMI_PDEV_UPDATE_PKT_ROUTING_CMDID SOC level command not valid + +21,ii,[ wlan_dev.c : 3174 ] wlan_resync_imps: IMPS_ENABLED=%d, VDEV_UP_COUNT=%d +20,,[ wlan_dev.c : 10180 ] DISPLAY_TPC_STATS: Alloc tpc_configs_reg_event_buf failed + +19,,[ wlan_dev.c : 10204 ] DISPLAY_TPC_STATS: Alloc tgt_pwrs_event_buf failed + +18,,[ wlan_dev.c : 10232 ] DISPLAY_TPC_STATS: Alloc tgt_pwrs_set2_event_buf failed + +17,,[ wlan_dev.c : 10261 ] DISPLAY_TPC_STATS: Alloc ctl_event_buf failed + +16,,[ wlan_dev.c : 10270 ] DISPLAY_TPC_STATS: Allocation complete! +15,,[ wlan_dev.c : 10720 ] ANI - Memory Allocation fail +14,,[ wlan_dev.c : 10742 ] ANI - Invalid PDEV_ID +13,i,[ wlan_dev.c : 10744 ] ANI - CCK_level=%d +12,,[ wlan_dev.c : 10679 ] ANI - Memory Allocation fail +11,,[ wlan_dev.c : 10701 ] ANI - Invalid PDEV_ID +10,i,[ wlan_dev.c : 10703 ] ANI - OFDM_level=%d +9,II,[ wlan_dev.c : 6194 ] WMI: WMI_PDEV_GET_DPD_STATUS_EVENTID pdev_id %ld ev->dpd_status %ld +148,,[ wlan_peer.c : 5765 ] Invalid sta_fixed_rate: Found CCK rate in 5G + +147,,[ wlan_peer.c : 5782 ] Invalid sta_fixed_rate: Found CCK rate in 5G + +146,IIIIIIII,[ wlan_peer.c : 5877 ] WMI_PEER_PARAM_DISABLE_AGGRESSIVE_TX:peer %x value %x mac_address %x:%x:%x:%x:%x:%x +145,,[ wlan_peer.c : 6324 ] PEER_CHAN_WIDTH null vdev +144,IIi,[ wlan_peer.c : 6349 ] Invalid CHAN_WIDTH_SWITCH: mac_addr31to0 = 0x%x, mac_addr47to32 = 0x%x, phy_mode %d +143,iIiiI,[ wlan_peer.c : 6361 ] Invalid CHAN_WIDTH_SWITCH:peer_id = %d chan_width =0x%X, new_phy_mode= %d old_phy_mode = %d he_mcs_nss_160=0x%x +142,iIiiI,[ wlan_peer.c : 6367 ] Invalid CHAN_WIDTH_SWITCH:peer_id = %d chan_width =0x%X, new_phy_mode= %d old_phy_mode = %d he_mcs_nss_80_80=0x%x +141,iiIIiiII,[ wlan_peer.c : 5062 ] WLAN_PEER_ASSOC_REQ peer %d peer_assoc_evt %d, ni_flags 0x%x, valid_tx_chainmask 0x%x, peer_nss %d, phymode %d, ni_vht_mcs_set 0x%x, ni_legacy_rate_set 0x%x, +140,ii,[ wlan_peer.c : 5082 ] WLAN_PEER_CHANGE_BW peerid %d bw %d +139,iii,[ wlan_peer.c : 5116 ] WLAN_PEER_CHANGE_NSS peer %d peer_nss %d ul_nss %d +138,ii,[ wlan_peer.c : 5149 ] WLAN_PEER_CHANGE_PHY_MODE peer %d bw %d +137,iIIiiII,[ wlan_peer.c : 5177 ] WLAN_PEER_CHANGE_CHAN_WIDTH peer %d ni_flags 0x%x, valid_tx_chainmask 0x%x, peer_nss %d, phymode %d, ni_vht_mcs_set 0x%x, ni_legacy_rate_set 0x%x, +136,iIIiiI,[ wlan_peer.c : 555 ] RESOURCE_PEER_ALLOC duplicate PEER_TYPE_BSS vdev_id = %d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x mac_id = %d/%d peer=0x%x +135,iIIIi,[ wlan_peer.c : 645 ] wal peer allocaton status = %d vdev_id_8/mac_id_8 = 0x%x mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x peer_type = %d +134,iIIIi,[ wlan_peer.c : 668 ] wal peer allocaton status = %d vdev_id_8/mac_id_8 = 0x%x mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x peer_type = %d +133,,[ wlan_peer.c : 261 ] wlan_find_peer: NULL vdev +132,iIIi,[ wlan_peer.c : 871 ] VDEV EVT:RESOURCE_PEER_FREE vdev_id = %d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x usage_count = %d +131,iI,[ wlan_peer.c : 956 ] VDEV EVT PEER: wlan_free_peer del_resp=%d, wal_peer:0x%x +130,iI,[ wlan_peer.c : 2580 ] HE160NSS : 160_mcs_nss_set %d, 160_mcs_nss_map %x +129,II,[ wlan_peer.c : 6834 ] Deauth frame is not sent because of different RT thread addr1 0x%x addr2 = 0x%x +128,I,[ wlan_peer.c : 5010 ] wlan_peer_mask_cck_rates_internal:wlan_peer 0x%x +127,,[ wlan_peer.c : 2855 ] rc_node_update: ABORT +126,III,[ wlan_peer.c : 2497 ] Assoc OMI: NSS=0x%x BW=0x%x er_su_disable=0x%x +125,iiIIii,[ wlan_peer.c : 1703 ] peer_update status=%d,vdevid=%d,macaddr=0x%8x0x%4x peer_type=%d,req_peer_type=%d + +124,IIII,[ wlan_peer.c : 4684 ] wal_vdev non_data_rc:0x%x bcast_data_rc:0x%x mcast_data_rc:0x%x beacon_rc:0x%x + +123,II,[ wlan_peer.c : 4758 ] update rts_rix, peer:0x%x, rts_rix:0x%x +122,I,[ wlan_peer.c : 4706 ] wal_peer: %x, wlan_peer_vdev_restart_done: tearing down tx_ba and rx_ba +121,II,[ wlan_peer.c : 4721 ] update non data1, peer:0x%x, rc:0x%x +120,i,[ wlan_peer.c : 5243 ] WMI_PEER_UNMAP_RESPONSE_CMDID: %d +119,ii,[ wlan_peer.c : 5250 ] peer_id[%d]: %d +118,I,[ wlan_peer.c : 2257 ] wlan_set_peer_he_txbf_cap:ax_txbf_caps.suax_max_nc=%x +117,I,[ wlan_peer.c : 1424 ] wlan_set_peer_vht_txbf_cap vht_caps: %x +116,III,[ wlan_peer.c : 1455 ] Nr=%x Nrx=%x, Nc=%x + +115,IIII,[ wlan_peer.c : 1529 ] Nr=%x Nc=%x peer_nss=%x Ntx=%x +114,iIIiii,[ wlan_peer.c : 470 ] RESOURCE_PEER_ALLOC error vdev_id = %d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x usage_count = %d, peer_type = %d, delete_in_process:%d +113,Iii,[ wlan_peer.c : 6620 ] wlan_vdev_delete_all_peer_conf_msg_hdlr: wal_vdev=%p, delete_all_peer_in_progress=%d, WLAN_FW_THREAD_IS_RT=%d + +112,i,[ wlan_peer.c : 6625 ] wlan_vdev_delete_all_peer_conf_msg_hdlr: vdev_id=%d + +111,ii,[ wlan_peer.c : 6686 ] veriware wlan_vdev_delete_all_peer_conf_msg_hdlr: vdev_id=%d dbg_conf_del_all_peer_num = %d + +110,i,[ wlan_peer.c : 2076 ] delete_all_peer: WMI_VDEV_DELETE_ALL_PEER_CMDID command for vdev_id %d + +109,,[ wlan_peer.c : 2079 ] DELETE_ALL_PEER max vdev +108,,[ wlan_peer.c : 2086 ] DELETE_ALL_PEER null vdev +107,,[ wlan_peer.c : 2100 ] DELETE_ALL_PEER alredy in progress +106,,[ wlan_peer.c : 2143 ] DELETE_ALL_PEER No active peer +105,,[ wlan_peer.c : 3002 ] PEER_ASSOC null vdev +104,,[ wlan_peer.c : 3014 ] PEER_ASSOC null peer +103,,[ wlan_peer.c : 3016 ] PEER_ASSOC null wal_peer +102,iiIIi,[ wlan_peer.c : 3132 ] PEER_ASSOC Overridding phymode. Orig phy %d, new phy %d. Orig flag 0x%x, new flag 0x%x. Error:%d +101,IIiIIIii,[ wlan_peer.c : 3278 ] PEER_ASSOC cmd for mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x, num_peer_ht_rates=%d, ni_flags=0x%x phymode=0x%x nss=0x%x mpdudensity=%d max_mpdu=%d +100,IIIII,[ wlan_peer.c : 3304 ] PEER_ASSOC ni_legacy_rate_set= 0x%x ht_caps=0x%x vht_caps=0x%x vht_mcs_set=0x%x ht_mcs_set= 0x%x +99,I,[ wlan_peer.c : 3483 ] Peer_assoc:peer_he_cap_phy = 0x%x +98,II,[ wlan_peer.c : 3489 ] Peer_assoc: he_ops=0x%x he_cap_info_internal=0x%x +97,,[ wlan_peer.c : 3688 ] PEER_ASSOC Sending KO for STA as invalid phymode config +96,IIIII,[ wlan_peer.c : 4248 ] wlan_vdev_dispatch_peer_change_bw:prev_ni_flags=%x new_ni_flags=%x new_bw = %x ht_caps = %x vht_caps = %x +95,iII,[ wlan_peer.c : 1743 ] peer create cmd ingored vdev_id =%d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x + +94,II,[ wlan_peer.c : 1840 ] DFS nol protection peer create cmd ingored mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x + +93,II,[ wlan_peer.c : 1851 ] peer create command for mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x + +92,iII,[ wlan_peer.c : 1994 ] peer delete command for vdev_id %d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x +91,,[ wlan_peer.c : 2007 ] PEER_DELETE null vdev +90,,[ wlan_peer.c : 2014 ] PEER_DELETE parent vdev delete_all_peer_in_progress +89,,[ wlan_peer.c : 2039 ] PEER_DELETE peer not exist, still generating PEER_DELETE_RESP_EVENTID +88,IIII,[ wlan_peer.c : 4652 ] wlan_vdev_dispatch_peer_mask_cck_rates is-2g:0x%x rc_node:0x%x legacy_rate:0x%x is_cck_rate_mask 0x%x +87,i,[ wlan_peer.c : 3954 ] RATE_DBG wlan_vdev_migrate_rate_reset peer_params NULL: peer_id %d +86,i,[ wlan_peer.c : 3959 ] RATE_DBG wlan_vdev_migrate_rate_reset: peer_id %d +85,I,[ wlan_peer.c : 3919 ] wlan_vdev_peer_autorate_reset: user_start_rate 0x=%x +84,I,[ wlan_peer.c : 4114 ] wlan_vdev_peer_change_bw_internal: new_bw = %x +83,iI,[ wlan_peer.c : 4054 ] wlan_vdev_peer_change_phymode_internal: peerid %d phymode = %x +82,I,[ wlan_peer.c : 4990 ] wlan_vdev_peer_mimo_ps_internal: valid_tx_chainmask 0x=%x +81,II,[ wlan_peer.c : 4319 ] TXBF_UPDATE_PEER_PARAMS peer_nss = %u, nc_idx = %u. +80,II,[ wlan_peer.c : 4328 ] TXBF_UPDATE_PEER_PARAMS peer_nss_160 = %u, nc_idx_160 = %u. +79,iii,[ wlan_peer.c : 831 ] delete_all_peer: VDEV EVT:WMI_VDEV_DELETE_ALL_PEER_RESP_EVENTID vdevId=%d status=%d time=%d +78,,[ wlan_peer.c : 783 ] WMI_EVENT_ALLOC_FAILURE: WMI_PEER_DELETE_RESP_EVENTID buffer failure +77,iiII,[ wlan_peer.c : 799 ] VDEV EVT:WMI_PEER_DELETE_RESP_EVENTID send vdevId=%d time=%d peer_macaddr31to0 =0x%x peer_macaddr47to32 =0x%x +76,,[ wlan_peer.c : 5275 ] WMI_PEER_TX_PN_REQUEST : Invalid Peer +75,ii,[ wlan_peer.c : 5284 ] WMI_PEER_TX_PN_REQUEST : vdev_id = %d, key_type = %d +171,IIIII,[ wlan_mgmt_local_txrx.c : 2206 ] _wlan_local_send_peer_change_omi()invalid rx=0x%x bw=0x%x ulmu=0x%x tx=0x%x ulmu_data=0x%x + +170,I,[ wlan_mgmt_local_txrx.c : 2221 ] _wlan_local_send_peer_change_omi()newOMI=0x%x +169,III,[ wlan_mgmt_local_txrx.c : 1590 ] mac id mismatch:rx:%x vdev:%x, frame: %x + +168,III,[ wlan_mgmt_local_txrx.c : 1734 ] mac id mismatch:rx:%x vdev:%x, frame: %x + +167,,[ wlan_mgmt_local_txrx.c : 1797 ] IEEE80211_FC0_SUBTYPE_NDPA +166,,[ wlan_mgmt_local_txrx.c : 408 ] SCAN_RADIO_SUPPORT_DBUG _wlan_mgmt_local_send cur_channel NULL +165,ii,[ wlan_mgmt_local_txrx.c : 627 ] MGMT_TXRX_SENT_FROM_LOCAL: send failure:%d, flags:%d +164,i,[ wlan_mgmt_local_txrx.c : 417 ] SCAN_RADIO_SUPPORT_DBUG: _wlan_mgmt_local_send DFS channel = %d Detected Skipping... + +163,IIIIIiII,[ wlan_mgmt_local_txrx.c : 520 ] MGMT_TXRX_SENT_FROM_LOCAL: macidh8/tid8/ptype16:0x%08x, cbflags=0x%08x, peerflag=0x%x,addr=0x%08x 0x%04x cur_chan=%d ppdu_H32=0x%x ppdu_L32=0x%x +162,I,[ wlan_mgmt_local_txrx.c : 2062 ] LOCAL MGMT DEAUTH-DISASSOC tx compl. status 0x%x +161,IiI,[ wlan_mgmt_local_txrx.c : 898 ] _wlan_mgmt_local_send_nullfunc() get nullfunc failed: peer = %p peer_type = %d cb_flags: 0x%x +160,IIIII,[ wlan_mgmt_local_txrx.c : 661 ] OMI: wlan_mgmt_txrx_send_omi rx_nss: 0x%lx, bw: 0x%lx, ulmu_disable: 0x%lx, ulmu_data_disable: 0x%lx, tx_nss: 0x%lx + +159,IIIIIIiii,[ wlan_mgmt_local_txrx.c : 1391 ] MGMT_TXRX_FORWARD_TO_HOST: mgmt pkt, Ch_VdevActCnt_ToHost=0x%08x MacId_Type_Subtype=0x%06x Seq=%04d(0x%03x) Addr2=0x%04x 0x%08x RssiComb=%d Chain0=%d Chain1=%d +158,i,[ wlan_mgmt_local_txrx.c : 1394 ] MGMT_TXRX_FORWARD_TO_HOST: mgmt pkt,sta_mon_mode=%d +157,IIiIiii,[ wlan_mgmt_local_txrx.c : 1422 ] MGMT_TXRX_FORWARD_TO_HOST: not mgmt pkt, Ch_VdevActCnt_ToHost=0x%08x MacId_Type_Subtype=0x%06x Seq=%d(0x%x) RssiComb=%d Chain0=%d Chain1=%d +156,i,[ wlan_mgmt_local_txrx.c : 1425 ] MGMT_TXRX_FORWARD_TO_HOST: mgmt pkt,sta_mon_mode=%d +155,i,[ wlan_mgmt_local_txrx.c : 649 ] wlan_mgmt_txrx_omi_req_completion: set mu as %d + +154,II,[ wlan_mgmt_local_txrx.c : 707 ] setUnitTestCmd 13 9 1 %x %x - couldn't find peer! +153,IIIIiI,[ wlan_mgmt_local_txrx.c : 718 ] OMI: Unit test with rx_nss = 0x%lx, bw = 0x%lx, ulmu disable = 0x%lx, tx_nss = 0x%lx, er_su disable %d, ulmu_data_disable = 0x%lx + +152,,[ wlan_mgmt_local_txrx.c : 722 ] Invalid input for OMI unit test. + +151,,[ wlan_mgmt_local_txrx.c : 776 ] Invalid input for muedca unit test to set mu wmm params. + +150,,[ wlan_mgmt_local_txrx.c : 808 ] Invalid input for muedca unit test to emulate trigger frm. + +149,I,[ wlan_mgmt_local_txrx.c : 818 ] Unit test: mu edca enable = %lu + +201,I,[ wlan_mgmt_txrx.c : 1435 ] QOS_NULL_TX_WMI_FROM_HOST: Host is not expected to use this command other than QoS null, frame subtype = 0x%X +200,IIIi,[ wlan_mgmt_txrx.c : 1484 ] QOS_NULL_TX_WMI_FROM_HOST subtype=0x%02x addr=0x%04x%08x chanfreq=%d +199,iiIiI,[ wlan_mgmt_txrx.c : 1489 ] QOS_NULL_TX_WMI_FROM_HOST tx_param_valid=%d frame_len=%d desc_id=0x%x tid_num=%d ppdu_info=0x%x +198,iIiI,[ wlan_mgmt_txrx.c : 1539 ] QOS_NULL_TX_WMI_FROM_HOST FAIL invalid input param vdev_id=%d, vdev_opmode=%x, desc_id=%d peer =0x%X +197,I,[ wlan_mgmt_txrx.c : 1443 ] QOS_NULL_TX_WMI_FROM_HOST: Command is expected only for AP VDEV wlan_vdev->ic_opmode= 0x%X +196,I,[ wlan_mgmt_txrx.c : 1452 ] QOS_NULL_TX_WMI_FROM_HOST: Expected wlan peer value = 0x%X +195,IIi,[ wlan_mgmt_txrx.c : 400 ] _wlan_mgmt_rx_frame_handler Droping frame from non associated Peer type=0x%x subtype=0x%x bNull=%d +194,,[ wlan_mgmt_txrx.c : 2351 ] SCAN_RADIO_SUPPORT_DBUG WMI_SCAN_EVENT_FOREIGN_CHANNEL_ENTRY pmac NULL +193,,[ wlan_mgmt_txrx.c : 2357 ] SCAN_RADIO_SUPPORT_DBUG WMI_SCAN_EVENT_FOREIGN_CHANNEL_ENTRY cur_channel NULL +192,ii,[ wlan_mgmt_txrx.c : 2384 ] SCAN_RADIO_SUPPORT_DBUG WMI_SCAN_EVENT_FOREIGN_CHANNEL_ENTRY DFS_Flag = %d channel = %d +191,IIii,[ wlan_mgmt_txrx.c : 1661 ] MGMT_TX_WMI_FROM_HOST is_home_8/is_curr_8=0x%x mode_8/submode_8=0x%x pmac->mac_id=%d e_mac_id=%d +190,IIIi,[ wlan_mgmt_txrx.c : 1742 ] MGMT_TX_WMI_FROM_HOST subtype=0x%02x addr=0x%04x%08x chanfreq=%d +189,iiIiIIiI,[ wlan_mgmt_txrx.c : 1747 ] MGMT_TX_WMI_FROM_HOST check_tag=%d tx_param_valid=%d cmd_ch=0x%x frame_len=%d tx_flags=0x%x desc_id=0x%x tid_num=%d ppdu_info=0x%x +188,,[ wlan_mgmt_txrx.c : 1819 ] Dropping CFR capture +187,ii,[ wlan_mgmt_txrx.c : 2501 ] MGMT_TX_WMI_FROM_HOST register %d %d +186,ii,[ wlan_mgmt_txrx.c : 2506 ] MGMT_TX_WMI_FROM_HOST register %d %d +185,ii,[ wlan_mgmt_txrx.c : 2512 ] MGMT_TX_WMI_FROM_HOST register %d %d +184,iii,[ wlan_mgmt_txrx.c : 2228 ] WMI TX comp hold,idx:%d, desc id=%d,comp=%d +183,I,[ wlan_mgmt_txrx.c : 1886 ] WMI TX comp send bundle: bundle_evt_size:0x%x +182,iii,[ wlan_mgmt_txrx.c : 1951 ] WMI TX comp send bundle, num:%d, desc id=%d comp=%d +181,,[ wlan_mgmt_txrx.c : 2057 ] MGMT_TX_WMI_TXCOMP_SEND_EVT PKT NULL +180,,[ wlan_mgmt_txrx.c : 2063 ] MGMT_TX_WMI_TXCOMP_SEND_EVT PKT NULL +179,IIii,[ wlan_mgmt_txrx.c : 2107 ] MGMT_TX_WMI_FROM_HOST_COMP desc_id=0x%x tx_status=0x%x ppdu_id:%d ack_rssi=%d +178,I,[ wlan_mgmt_txrx.c : 996 ] WMI_SEND_EVENT_WRONG_TLV CmdId/EventId = 0x%x +177,I,[ wlan_mgmt_txrx.c : 909 ] WMI_SEND_EVENT_WRONG_TLV CmdId/EventId = 0x%x +176,,[ wlan_mgmt_txrx.c : 1966 ] OFFCHAN_DATA_TX_WMI_TXCOMP_SEND_EVT PKT NULL +175,II,[ wlan_mgmt_txrx.c : 1982 ] MGMT_TX_WMI_FROM_HOST_COMP desc_id=0x%x tx_status=0x%x +174,,[ wlan_mgmt_txrx.c : 2001 ] QOS_NULL_TX_WMI_FROM_HOST PKT NULL +173,IIIII,[ wlan_mgmt_txrx.c : 2020 ] QOS_NULL_TX_WMI_FROM_HOST Send Evt: desc_id = 0x%x comp_type=0x%x,pdev_id =0x%X, ppdu_id=0x%X ack_rssi =0x%X +172,IIIII,[ wlan_mgmt_txrx.c : 1349 ] MGMT_TX_WMI_FROM_HOST: dword0=0x%x dword1=0x%x, subtype:%x, ppdu_info:0x%x multiplier:0x%x +243,iii,[ offload_mgr.c : 1954 ] OFLD drop wmi evt, id=%d, len:%d status:%d +242,ii,[ offload_mgr.c : 342 ] OFLD dereg data name=%d vdev id=%d, vdev mask +241,ii,[ offload_mgr.c : 384 ] OFLD dereg htt name=%d ref_cnt=%d +240,ii,[ offload_mgr.c : 322 ] OFLD dereg nondata name=%d ref_cnt=%d +239,ii,[ offload_mgr.c : 363 ] OFLD dereg wmi name=%d ref_cnt=%d +238,,[ offload_mgr.c : 1245 ] drop data in wow awake +237,I,[ offload_mgr.c : 1264 ] OFLD remote data hdlr dropping frame as L2_valid :%x +236,II,[ offload_mgr.c : 1280 ] OFLD remote data hdlr ds2ds, id:%x, mode:%x +235,II,[ offload_mgr.c : 1287 ] OFLD remote data hdlr nonds, id:%x, mode:%x +234,iiii,[ offload_mgr.c : 1296 ] OFLD remote data hdlr pktlen=%d, dataT=%d addrT=%d vdevId=%d +233,iii,[ offload_mgr.c : 1359 ] OFLD enhanced data hdlr ofld id=%d status=%d, wow data state:%d +232,I,[ offload_mgr.c : 2006 ] evt store:%x +231,III,[ offload_mgr.c : 1667 ] offldmgr_non_data_handler: Received rx buf as null for peer = 0x%x mac_id =0x%X rxbuf =0x%X +230,III,[ offload_mgr.c : 1741 ] _offldmgr_non_data_handler: peer = 0x%x addr1 0x%x addr2 = 0x%x +229,IIII,[ offload_mgr.c : 1837 ] _offldmgr_non_data_handler: status= 0x%x, sub_status = 0x%x offld_id 0x%x frametype = 0x%x +228,II,[ offload_mgr.c : 1924 ] offldmgr_non_data_handler: status = 0x%x frametype = 0x%x +227,ii,[ offload_mgr.c : 1409 ] OFLD proto data hdlr ret_Status=%d curr_wow=%d +226,III,[ offload_mgr.c : 211 ] OFLD reg data name=0x%x, vdevid:0x%x, vdev_bitmap:0x%x +225,ii,[ offload_mgr.c : 230 ] OFLD reg data vdev id=%d, max_len =%d +224,II,[ offload_mgr.c : 286 ] OFLD reg HTT name=0x%x, refcnt:0x%x +223,II,[ offload_mgr.c : 170 ] OFLD reg nondata name=0x%x, refcnt:0x%x +222,II,[ offload_mgr.c : 248 ] OFLD reg wmi name=0x%x, refcnt:0x%x +221,II,[ offload_mgr.c : 972 ] OFLD status hdlr ds2ds, id:%x, mode:%x +220,II,[ offload_mgr.c : 980 ] OFLD status hdlr nonds, id:%x, mode:%x +219,I,[ offload_mgr.c : 988 ] OFLD status hdlr invalid eth type,l2 present:%x +218,,[ offload_mgr.c : 1079 ] OFLD status hdlr: unable to handle this in status buf! HIF CPY +217,iiii,[ offload_mgr.c : 1084 ] OFLD status hdlr pktlen=%d, dataT=%d addrT=%d vdevId=%d +216,iiiI,[ offload_mgr.c : 1197 ] OFLD status hdlr ofld id=%d status=%d, route_type=%d, status_buf_flags:0x%x +215,ii,[ offload_mgr.c : 2127 ] OFLD wmi evt flush evt_id=%d, evt_len=%d +214,ii,[ offload_mgr.c : 2096 ] OFLD wmi evt store evt_id=%d, evt_len=%d +213,,[ offload_mgr.c : 2101 ] ofld wmi evt store failure - no memory +212,Iiiii,[ offload_mgr.c : 646 ] OFLD data parse 11c_snap_hdr_t exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d,dsDir:%d +211,Iiii,[ offload_mgr.c : 693 ] OFLD data parse llc_snap_hdr_t exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +210,i,[ offload_mgr.c : 709 ] Unknown RX Decap mode %d +209,IIIIII,[ offload_mgr.c : 735 ] OFLD data parse DA %x %x %x %x %x %x +208,iiI,[ offload_mgr.c : 738 ] OFLD data parse rx_mode:%d, L3 offset=%d, L2 ethType=%x +207,Iiii,[ offload_mgr.c : 763 ] OFLD data parse IP_HDR exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +206,Iiii,[ offload_mgr.c : 779 ] OFLD data parse IP6_HDR exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +205,Iiii,[ offload_mgr.c : 811 ] OFLD data parse TCP_HDR exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +204,Iiii,[ offload_mgr.c : 824 ] OFLD data parse UDP_HDR exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +203,Iiii,[ offload_mgr.c : 836 ] OFLD data parse ICMPV6_HDR exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +202,Iiii,[ offload_mgr.c : 676 ] OFLD data parse ether_header exceeds frame length pktbuf:%x,rx_mode:%d,buf_len:%d,offset:%d +252,iII,[ channel_mgr.c : 58 ] CHAN_MGR_PAUSE_COMPLETE: curr_chan = %d link = 0x%x link_flgs = 0x%x +251,,[ channel_mgr.c : 100 ] chan mgr pause complete timeout +250,ii,[ channel_mgr.c : 115 ] CHAN_MANAGER_SM_EVENT: %d < %d + +249,II,[ channel_mgr.c : 294 ] CHAN_MGR_CTS2S_TX_COMP: status = 0x%x ch_handle = 0x%x +248,II,[ channel_mgr.c : 261 ] CHAN_MGR_PAUSE_CMPL_CB: status = 0x%x curr_time = 0x%x +247,iIIiI,[ channel_mgr.c : 198 ] CHAN_MGR_VDEV_PAUSE: chan = %d link = 0x%x flg = 0x%x max_sw_time = %d curr_time = 0x%x +246,III,[ channel_mgr.c : 165 ] CHAN_MANAGER_SM_EVENT_DATA: chan = 0x%x sec_chan = 0x%x sw_time = 0x%x +245,iiIIIIi,[ channel_mgr.c : 468 ] CHAN_MGR_TRIGGER_CHANNEL_CHANGE: pri_ch = %d, chan_change_dur = %d,is_chm_valid = 0x%x tx_chm = 0x%x, rx_chm = 0x%x, selfgen_chm = 0x%x, pf_cnt = %d +244,iII,[ channel_mgr.c : 232 ] CHAN_MGR_VDEV_UNPAUSE:chan =%d link =0x%x curr_time = 0x%x +256,ii,[ channel_mgr_sm.c : 134 ] CHAN_MANAGER_SM: %d => %d +255,III,[ channel_mgr_sm.c : 132 ] RESMGR_CHMGR_SEND_CTS2SELF: cur_vc = 0x%x link = 0x%x status = 0x%x +254,ii,[ channel_mgr_sm.c : 115 ] CHAN_MANAGER_SM_EVENT: %d < %d + +253,ii,[ channel_mgr_sm.c : 261 ] CHAN_MGR_UNPAUSE: PF %d, time %d +266,II,[ resmgr.c : 100 ] RESMGR_OCS_INVALID_QUOTA Different MAC: chan0 = 0x%x chan1 = 0x%x +265,II,[ resmgr.c : 153 ] RESMGR_OCS_INVALID_LATENCY Different MAC: chan0 = 0x%x chan1 = 0x%x +264,II,[ resmgr.c : 559 ] RESMGR_DEREG_EVT_HDLR: handler = 0x%x arg = 0x%x not found!!! +263,II,[ resmgr.c : 565 ] RESMGR_DEREG_EVT_HDLR: handler = 0x%x arg = 0x%x deregistered +262,II,[ resmgr.c : 523 ] RESMGR_REG_EVT_HDLR: handler = 0x%x arg = 0x%x exists!!! +261,II,[ resmgr.c : 531 ] RESMGR_REG_EVT_HDLR: handler = 0x%x arg = 0x%x no memory!!! +260,II,[ resmgr.c : 541 ] RESMGR_REG_EVT_HDLR: handler = 0x%x arg = 0x%x registered +259,III,[ resmgr.c : 361 ] RESMGR_OCS_REQ_QUOTA_STATS arg = 0x%x chan_mhz = 0x%x req_chan_time/latency = 0x%x +258,III,[ resmgr.c : 383 ] RESMGR_OCS_REQ_QUOTA_STATS arg = 0x%x chan_mhz = 0x%x req_chan_time/latency = 0x%x +257,III,[ resmgr.c : 369 ] RESMGR_OCS_REQ_QUOTA_STATS arg = 0x%x chan_mhz = 0x%x req_chan_time/latency = 0x%x +271,i,[ resmgr_ocm.c : 351 ] RESMGR_OCS_ALLOCRAM_SIZE size_in_bytes = %d +270,I,[ resmgr_ocm.c : 511 ] OCM_Migrate: migrate_mode = 0x%x +269,II,[ resmgr_ocm.c : 568 ] OCM_Resume: ocs_cfg = 0x%x, Pause_OCS = 0x%x +268,II,[ resmgr_ocm.c : 440 ] OCM_Suspend: Pause_Pending = 0x%x, Pause_OCS = 0x%x +267,,[ resmgr_ocm.c : 283 ] RESMGR_OCS_CHAN_CHANGE_PROGRESS FAILURE +280,iIII,[ resmgr_dyn_sch.c : 163 ] RESMGR_DYN_SCH_CH_SX_STATS chan_mhz = %d accu_tx_rx_dur_us = 0x%x accu_free_dur_us = 0x%x accu_sampling_dur_us = 0x%x +279,iiii,[ resmgr_dyn_sch.c : 250 ] RESMGR_DYN_SCH_HOME_CH_QUOTA chan0_mhz = %d ch0_new_quota = %d chan1_mhz = %d ch1_new_quota = %d +278,iIII,[ resmgr_dyn_sch.c : 170 ] RESMGR_DYN_SCH_CH_SX_STATS chan_mhz = %d accu_tx_rx_dur_us = 0x%x accu_free_dur_us = 0x%x accu_sampling_dur_us = 0x%x +277,iiii,[ resmgr_dyn_sch.c : 184 ] RESMGR_DYN_SCH_TOT_UTIL_PER chan0_mhz = %d chan0_util_percentage = %d chan1_mhz = %d chan1_util_percentage = %d +276,iiiii,[ resmgr_dyn_sch.c : 477 ] RESMGR_DYN_SCH_CH_STATS_END chan_mhz = %d rx_clear_cnt = %d tx_frame_cnt = %d rx_frame_cnt_us = %d sampling_dur_us = %d +275,iiiii,[ resmgr_dyn_sch.c : 547 ] RESMGR_DYN_SCH_CH_STATS_START chan_mhz = %d start_rx_clear_cnt = %d start_tx_frame_cnt = %d start_rx_frame_cnt_us = %d start_time_us = %d +274,i,[ resmgr_dyn_sch.c : 296 ] RESMGR_DYN_SCH_ALLOCRAM_SIZE size = %d +273,II,[ resmgr_dyn_sch.c : 357 ] RESMGR_DYN_SCH_ENABLE enable = 0x%x fw_disable_bmap = 0x%x +272,i,[ resmgr_dyn_sch.c : 88 ] RESMGR_DYN_SCH_ACTIVE is_active = %d +345,IIiii,[ resmgr_ocs.c : 4652 ] RESMGR_OCS_CHREQ_CREATE: req_id = 0x%x chan_req_addr = 0x%x chan_mhz = %d, sec_chan_mhz = %d prioirty = %d +344,IiiIiI,[ resmgr_ocs.c : 4658 ] RESMGR_OCS_CHREQ_CREATE: start_tsf = 0x%x duration_usec = %d interval = %d dtim_start_tsf = 0x%x dtim_period = %d end_tsf = 0x%x +343,IIiii,[ resmgr_ocs.c : 4684 ] RESMGR_OCS_CHREQ_DELETE: req_id = 0x%x chan_req_addr = 0x%x chan_mhz = %d sec_chan_mhz = %d state = %d +342,IIiiii,[ resmgr_ocs.c : 5053 ] RESMGR_OCS_CHREQ_START: req_id = 0x%x chan_req_addr = 0x%x chan_mhz = %d sec_chan_mhz = %d band_center_freq2 = %d prioirty = %d +341,IiiIiI,[ resmgr_ocs.c : 5058 ] RESMGR_OCS_CHREQ_START: start_tsf = 0x%x duration_usec = %d interval = %d dtim_start_tsf = 0x%x dtim_period=%d end_tsf = 0x%x +340,IIiii,[ resmgr_ocs.c : 5121 ] RESMGR_OCS_CHREQ_STOP: req_id = 0x%x chan_req_addr = 0x%x chan_mhz = %d sec_chan_mhz = %d state = %d +339,I,[ resmgr_ocs.c : 4736 ] RESMGR_OCS_CHREQ_UPDATE: start_tsf/req_id = 0x%x +338,IIiii,[ resmgr_ocs.c : 4861 ] RESMGR_OCS_CHREQ_UPDATE: req_id = 0x%x chan_req_addr = 0x%x chan_mhz = %d sec_chan_mhz = %d prioirty = %d +337,IIiIiI,[ resmgr_ocs.c : 4866 ] RESMGR_OCS_CHREQ_UPDATE: start_tsf = 0x%x duration_usec = 0x%x interval = %d dtim_start_tsf = 0x%x dtim_period=%d end_tsf = 0x%x +336,i,[ resmgr_ocs.c : 4495 ] RESMGR_OCS_ALLOCRAM_SIZE size_in_bytes = %d +335,i,[ resmgr_ocs.c : 2928 ] RESMGR_OCS_WIN_CAT_DUR duration = %d +334,IIiII,[ resmgr_ocs.c : 574 ] RESMGR_OCS_CHREQ_UPDATE start_tsf = 0x%x duration_usec = 0x%x interval=%d prioirty = 0x%x chan_req_addr = 0x%x +333,IIIi,[ resmgr_ocs.c : 666 ] RESMGR_OCS_CHREQ_RESTART start_tsf = 0x%x stop_tsf = 0x%x dtim_start_tsf = 0x%x dtim_period = %d +332,IIiII,[ resmgr_ocs.c : 583 ] RESMGR_OCS_CHREQ_UPDATE req_id = 0x%x dtim_start_tsf = 0x%x dtim_period=%d purge_flag = 0x%x end_tsf = 0x%x +331,ii,[ resmgr_ocs.c : 586 ] RESMGR_OCS_CHREQ_UPDATE chan_mhz = %d sec_chan_mhz = %d +330,,[ resmgr_ocs.c : 4427 ] RESMGR_OCS_CH_SWITCH_REQ +329,II,[ resmgr_ocs.c : 1957 ] RESMGR_OCS_LATENCY_STRICT_TIME_SLOT slot1_start_tsf = 0x%x slot2_start_tsf = 0x%x +328,I,[ resmgr_ocs.c : 1976 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +327,I,[ resmgr_ocs.c : 2147 ] RESMGR_OCS_CURR_TSF current_tsf = 0x%x +326,II,[ resmgr_ocs.c : 2149 ] RESMGR_OCS_QUOTA_REM cat1_quota_remain = 0x%x cat2_quota_remain = 0x%x +325,I,[ resmgr_ocs.c : 2194 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +324,I,[ resmgr_ocs.c : 2198 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +323,I,[ resmgr_ocs.c : 2222 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +322,I,[ resmgr_ocs.c : 2272 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +321,I,[ resmgr_ocs.c : 2276 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +320,I,[ resmgr_ocs.c : 2291 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +319,I,[ resmgr_ocs.c : 2320 ] RESMGR_OCS_LATENCY_CASE_NO arg = 0x%x +318,I,[ resmgr_ocs.c : 3534 ] RESMGR_OCS_CLEANUP_CH_ALLOCATORS cur_ch_alloc_addr = 0x%x +317,I,[ resmgr_ocs.c : 3553 ] RESMGR_OCS_CH_ALLOCATOR_FREE cur_ch_alloc_addr = 0x%x +316,I,[ resmgr_ocs.c : 3604 ] RESMGR_OCS_CLEANUP_STALE_REQS cur_ch_alloc_addr = 0x%x +315,IIi,[ resmgr_ocs.c : 3684 ] RESMGR_OCS_CHREQ_TERMINATE: req_id = 0x%x cur_ch_req = 0x%x state = %d +314,II,[ resmgr_ocs.c : 3625 ] RESMGR_OCS_CHREQ_COMPLETE curr_time = 0x%x ch_req_addr = 0x%x +313,II,[ resmgr_ocs.c : 3649 ] RESMGR_OCS_CHREQ_COMPLETE curr_time = 0x%x ch_req_addr = 0x%x +312,Iii,[ resmgr_ocs.c : 1520 ] RESMGR_OCS_CONSTRUCT_CAT_WIN chan_alloc_addr=0x%x chan_mhz=%d sec_ch_mhz=%d +311,Ii,[ resmgr_ocs.c : 1559 ] RESMGR_OCS_NEW_CAT_WINDOW_REQ ch_req_addr = 0x%x state = %d +310,II,[ resmgr_ocs.c : 1562 ] RESMGR_OCS_NEW_CAT_WINDOW_TIMESLOT start_tsf = 0x%x stop_tsf = 0x%x +309,IIIII,[ resmgr_ocs.c : 4339 ] RESMGR_OCS_RESOURCES req_id = 0x%x ch_req_addr = 0x%x ch_alloc_addr = 0x%x state = 0x%x priority = 0x%x +308,iii,[ resmgr_ocs.c : 4342 ] RESMGR_OCS_RESOURCES chan_mhz = %d sec_chan_mhz = %d, band_center_freq2 = %d +307,II,[ resmgr_ocs.c : 135 ] RESMGR_OCS_CHREQ_GRANT curr_time = 0x%x ch_req_addr = 0x%x +306,II,[ resmgr_ocs.c : 733 ] RESMGR_OCS_CHREQ_COMPLETE curr_time = 0x%x ch_req_addr = 0x%x +305,i,[ resmgr_ocs.c : 5157 ] RESMGR_OCS_CHANNEL_SWITCHED status = %d +304,II,[ resmgr_ocs.c : 1872 ] RESMGR_OCS_MISS_TOLERANCE miss_tolerance_cnt_timeslot1 = 0x%x miss_tolerance_cnt_timeslot2 = 0x%x +303,i,[ resmgr_ocs.c : 5292 ] RESMGR_OCS_NEXT_SCH_INTERVAL = %d +302,Ii,[ resmgr_ocs.c : 3421 ] RESMGR_OCS_PURGE_CHREQ cur_ch_alloc_addr = 0x%x chan_mhz = %d +301,I,[ resmgr_ocs.c : 3472 ] RESMGR_OCS_PURGE_CHREQ cur_ch_req_addr = 0x%x +300,ii,[ resmgr_ocs.c : 4959 ] RESMGR_OCS_RECAL_QUOTAS num_home_chans = %d tracking_interval = %d +299,ii,[ resmgr_ocs.c : 5006 ] RESMGR_OCS_RECAL_QUOTAS chan_mhz = %d latency = %d +298,iii,[ resmgr_ocs.c : 5013 ] RESMGR_OCS_ALLOCATED_QUOTA_STATS chan_mhz = %d req_chan_time_percentage = %d chan_time_quota = %d +297,i,[ resmgr_ocs.c : 3046 ] RESMGR_OCS_RECOMPUTE_SCHEDULE: ocs_ins = %d +296,i,[ resmgr_ocs.c : 3052 ] RESMGR_OCS %d has been paused +295,,[ resmgr_ocs.c : 349 ] RESMGR_OCS_CURR_CAT_WINDOW +294,IIi,[ resmgr_ocs.c : 367 ] RESMGR_OCS_CURR_CAT_WINDOW_REQ req_id = 0x%x ch_req_addr = 0x%x state = %d +293,II,[ resmgr_ocs.c : 370 ] RESMGR_OCS_CURR_CAT_WINDOW_TIMESLOT start_tsf = 0x%x stop_tsf = 0x%x +292,I,[ resmgr_ocs.c : 385 ] RESMGR_OCS_CURR_CAT_WINDOW: Channel change pending, flags = 0x%x +291,Iii,[ resmgr_ocs.c : 2998 ] RESMGR_OCS_CUR_CH_ALLOC curr_chan_alloc_addr = 0x%x chan_mhz = %d sec_ch_mhz = %d +290,Iii,[ resmgr_ocs.c : 3008 ] RESMGR_OCS_WINNING_CH_ALLOC curr_chan_alloc_addr = 0x%x chan_mhz = %d sec_ch_mhz = %d +289,iII,[ resmgr_ocs.c : 3824 ] RESMGR_OCS_INVOKED: ocs_ins = %d last_ocs_entry_time = 0x%x current_time = 0x%x +288,III,[ resmgr_ocs.c : 3828 ] RESMGR_OCS_INVOKED: Cur_Ch_Alloc = 0x%x Flags = 0x%x Resched_Req = 0x%x +287,I,[ resmgr_ocs.c : 3961 ] RESMGR_OCS_TSF_TIMEOUT_US defer_sch_time = %x +286,i,[ resmgr_ocs.c : 3977 ] RESMGR_OCS_SCHED_CH_CHANGE: ocs_ins = %d +285,I,[ resmgr_ocs.c : 4029 ] RESMGR_OCS_TSF_TIMEOUT_US next_tsftime = %x +284,I,[ resmgr_ocs.c : 4041 ] RESMGR_OCS_NEXT_TSFTIME next_tsf_time = 0x%x +283,iii,[ resmgr_ocs.c : 4066 ] RESMGR_OCS_TSF_TIMEOUT_US wake up latency = %d, wlan_chan_num = %d, wlan_cb_num = %d +282,i,[ resmgr_ocs.c : 4073 ] RESMGR_OCS_TSF_TIMEOUT_US timeout_us = %d +281,iII,[ resmgr_ocs.c : 4146 ] RESMGR_OCS_INVOKED: ocs_ins = %d ocs_entry_time = 0x%x ocs_exit_time = 0x%x +350,,[ resmgr_vcm.c : 48 ] RESMGR_CREATE_LINK failed due to invalid channel param +349,IIiiii,[ resmgr_vcm.c : 137 ] RESMGR_LINK_CREATE link_pointer = 0x%x link_flags = 0x%x ch_mhz = %d phy_mode = %d band_center_freq1 = %d band_center_freq2 = %d +348,I,[ resmgr_vcm.c : 150 ] RESMGR_LINK_DELETE Link Pointer = 0x%x +347,,[ resmgr_vcm.c : 265 ] RESMGR_UPDATE_LINK failed due to invalid channel param +346,I,[ resmgr_vcm.c : 816 ] VCM_Init: VC Pool Size = 0x%x +362,iII,[ virtual_channel.c : 397 ] RESMGR_VC_UPDATE_HOME_CHAN_INFO: mac_id = %d virtual_chan_count = 0x%x home_chan_count = 0x%x +361,iiIIiiII,[ virtual_channel.c : 474 ] RESMGR_ADD_LINK ch_mhz = %d phy_mode = %d link_flags = 0x%x link_valid_attr = 0x%x no_160_link_cnt = %d 160_link_cnt = %d vc = 0x%x link = 0x%x +360,iIIIIi,[ virtual_channel.c : 276 ] RESMGR_VC_INIT_VIR_CHAN: chan_mhz = %d, mac_id = 0x%x, band = 0x%x, tx_chm = 0x%x, rx_chm = 0x%x, rx_nss = %d +359,IIIIIII,[ virtual_channel.c : 286 ] RESMGR_VC_INIT_VIR_CHAN: nss1_tx_chm = 0x%x, nss2_tx_chm = 0x%x, selfgen_chm = 0x%x, nss_tx_11b_chainmask = 0x%x, selfgen_11b_chainmask = 0x%x, nss_tx_ofdm_chainmask = 0x%x, selfgen_ofdm_chainmask = 0x%x +358,i,[ virtual_channel.c : 314 ] RESMGR_VC_INIT_HOME_CHAN: chan_mhz = %d +357,iI,[ virtual_channel.c : 610 ] RESMGR_OCS_REQ_QUOTA_STATS chan_mhz = %d req_chan_time/latency = 0x%x +356,II,[ virtual_channel.c : 616 ] RESMGR_OCS_REQ_QUOTA_STATS arg = 0x%x req_chan_time/latency = 0x%x +355,iiiiII,[ virtual_channel.c : 793 ] RESMGR_VC_REGISTER_LINK: chan_mhz = %d link_count = %d ephemeral_link_count = %d is_home_chan = %d link_flags = 0x%x link_valid_attr = 0x%x +354,iiIIii,[ virtual_channel.c : 511 ] RESMGR_RMV_LINK ch_mhz = %d phy_mode = %d link_flags = 0x%x link_valid_attr = 0x%x no_160_link_cnt = %d 160_link_cnt = %d +353,III,[ virtual_channel.c : 990 ] !cts2s_sent: 0x%x 0x%x 0x%x +352,iiii,[ virtual_channel.c : 815 ] RESMGR_VC_UNREGISTER_LINK: chan_mhz = %d link_count = %d ephemeral_link_count = %d is_home_chan = %d +351,i,[ virtual_channel.c : 671 ] RESMGR_VC_UPDATE_CUR_VC chan_mhz = %d +370,iii,[ virtual_channel_arbiter.c : 908 ] wlan_virtual_chan_apply_chan_num rx = %d tx = %d org = %d +369,Ii,[ virtual_channel_arbiter.c : 953 ] RESMGR_VC_ARBITRATE_ATTRIBUTES link_var = 0x%x link_count = %d +368,iiiII,[ virtual_channel_arbiter.c : 1093 ] RESMGR_VC_ARBITRATE_ATTRIBUTES chan_mhz = %d phy_mode/vc_prog_latency = %d band_center_freq = %d virtual_chan_ctxt = 0x%x virtual_chan = 0x%x +367,ii,[ virtual_channel_arbiter.c : 1120 ] RESMGR_VC_ARBITRATE_ATTRIBUTES chan_mhz = %d phy_mode/vc_prog_latency = %d +366,iiii,[ virtual_channel_arbiter.c : 1141 ] RESMGR_VC_ARBITRATE_ATTRIBUTES chan_mhz = %d current_chan_mhz = %d per link tx_chainmask = %d, rx_chainmask = %d +365,iii,[ virtual_channel_arbiter.c : 1035 ] RESMGR_VC_ARBITRATE_ATTRIBUTES link_count = %d chain_number = %d per_link_chain_num = %d +364,iII,[ virtual_channel_arbiter.c : 1049 ] RESMGR_VC_ARBITRATE_ATTRIBUTES num = %d, tx_mask = %x rx_mask = %x +363,iii,[ virtual_channel_arbiter.c : 1192 ] VC_ARB_SMPS: mhz = %d, smps_supp = %d, dyn_smps = %d +371,iiIi,[ resmgr_chainmask_mgr.c : 3209 ] RESMGR_CHMMGR_RESOLVE_BANDWIDTH: band = %d, mac = %d, max_bw_supported = 0x%x, hw_mode = %d +377,II,[ resmgr_concurrency_mgr.c : 161 ] RESMGR_CONCURRENCY_DEREG_EVT_HDLR: handler = 0x%x arg = 0x%x deregistered +376,IIIi,[ resmgr_concurrency_mgr.c : 259 ] _resmgr_concurrency_mgr_is_low_freq_vdev_chreq_apply: active_sta_vdev_num = 0x%x, active_vdev_num = 0x%x, resmgr_nan_discovery_enable = 0x%x, result = %d +375,I,[ resmgr_concurrency_mgr.c : 338 ] resmgr_concurrency_mgr_notify: module = 0x%x +374,II,[ resmgr_concurrency_mgr.c : 105 ] RESMGR_CONCURRENCY_REG_EVT_HDLR: handler = 0x%x arg = 0x%x exists!!! +373,II,[ resmgr_concurrency_mgr.c : 113 ] RESMGR_CONCURRENCY_REG_EVT_HDLR: handler = 0x%x arg = 0x%x no memory!!! +372,II,[ resmgr_concurrency_mgr.c : 123 ] RESMGR_CONCURRENCY_REG_EVT_HDLR: handler = 0x%x arg = 0x%x registered +394,iiiiii,[ wlan_scan.c : 1412 ] SCAN_ENG_CALC_CHAN num_2g = %d num_5g_active = %d num_5g_passive = %d double_passive_chan_scan = %d num_6g_ch = %d num_extra_6g_ch = %d +393,IIII,[ wlan_scan.c : 1440 ] SCAN_ENG_SPOOFED_MAC_ADDR full_mac_addr = %08x%04x partial_mac_addr = %08x%04x +392,IIIIIiii,[ wlan_scan.c : 766 ] SCAN_ENG_START scan_id = 0x%x eng_id(3)|req_type(3) = %06d num_chans_[req(3)|granted_2g(3)|granted_5g(3)] = %09d num_[ssid(3)|bssid(3)] = %06d flags = 0x%x vdev_freq = %d cur_ch_idx_2g|5g = %d %d +391,iiiiii,[ wlan_scan.c : 778 ] SCAN_ENG_PARAM_1 dwell_time_active = %d dwell_time_active_2g = %d msec dwell_time_passive = %d msec min_rest_time = %d msec max_rest_time = %d msec max_scan_time = %d msec +390,iiiiiii,[ wlan_scan.c : 789 ] SCAN_ENG_PARAM_2 idle_time = %d msec repeat_probe_time = %d msec probe_spacing_time = %d msec probe_delay = %d msec burst_duration = %d msec max_num_probes(2g|5g) = %d cancel_probe_req_defer = %d +389,iiii,[ wlan_scan.c : 1569 ] SCAN_ADJUST_PARAM active=%d active_2g=%d passive=%d rest=%d +388,IIIIIii,[ wlan_scan.c : 200 ] CHANNEL_CONGESTION_PRINTS cycle_cnt = %10d, busy = %10d, tx = %10d, rx = %10d, mr_rx = %10d, chan_freq= %d send_stats:%d +387,iiiiiiii,[ wlan_scan.c : 985 ] SCAN_ENG_CALC_CHAN num_6g_active = %d num_6g_passive = %d num_items_in_cache = %d scan_all_psc_chan = %d scan_all_non_psc_chan = %d match_hint = %d skip_non_rnr_chan = %d client_priority = %d +386,iIIiii,[ wlan_scan.c : 1780 ] SCAN_ENG_CANCEL scanhandler_id = %d scan_id = 0x%x requestor= 0x%x stop_mode = %d scan_in_progress = %d cancel_in_progress = %d +385,iiiII,[ wlan_scan.c : 80 ] AUTO_CHAN_EVT_HDNLR CURR_CHAN_STATS_ERROR error_code = %d (1:scan_handle NULL, 2:chan_freq 0) scan_id = %d evt_mac_id = %d type = 0x%x freq = 0x%x +384,iIii,[ wlan_scan.c : 2086 ] SCAN_BCN_RECVD mhz=%d at %08x is_scan_in_progress=%d (0 ignored) send_probe_req_on_DFS_ch=%d (1 ignored) +383,ii,[ wlan_scan.c : 1838 ] SCAN_SET_CHANLIST_FAILED support_chan %d num_scan_chans %d +382,iiiIIii,[ wlan_scan.c : 1946 ] SCAN_SET_CHAN_LIST idx = %d, mhz = %d, is_passive = %d ch_info = 0x%x reg_info_1 = 0x%x max_bd = %d is_nan_disabled = %d +381,,[ wlan_scan.c : 2212 ] ath11k passive scan + +380,IIIi,[ wlan_scan.c : 1608 ] SCAN_ENG_START_IN_PROGRESS = 1 scan_id = 0x%x requestor = 0x%x req_sub_id = 0x%x priority = %d -> return EBUSY +379,I,[ wlan_scan.c : 1731 ] SCAN_SM_START_COMMAND_FAILED cur_sch_scan_req = NULL handle = 0x%x +378,iI,[ wlan_scan.c : 642 ] SCAN_ENG_MAX_SCAN_TIMEOUT scanhandle_id = %d scan_id = 0x%x +406,I,[ wlan_dcs.c : 526 ] WLAN_DCS_DBGID_TIMER 0x%x +405,I,[ wlan_dcs.c : 724 ] Init = 0x%x +404,I,[ wlan_dcs.c : 55 ] WMI_EVENT_ALLOC_FAILURE EventId = 0x%x +403,iiiII,[ wlan_dcs.c : 87 ] AWGN_INT_DBG ATH_CAP_DCS_AGWNIM sent chan_freq = %d center_freq0 = %d center_freq1 = %d channel_width = 0x%x bitmap = 0x%x + +402,I,[ wlan_dcs.c : 161 ] WMI_EVENT_ALLOC_FAILURE EventId = 0x%x +401,I,[ wlan_dcs.c : 191 ] WLAN_DCS_DBGID_WMI_CWINT 0x%x +400,I,[ wlan_dcs.c : 250 ] WMI_EVENT_ALLOC_FAILURE EventId = 0x%x +399,I,[ wlan_dcs.c : 278 ] WLAN_DCS_DBGID_WMI_WLAN_INT 0x%x +398,I,[ wlan_dcs.c : 507 ] WLAN_DCS_DBGID_TIMER 0x%x +397,iiiii,[ wlan_dcs.c : 124 ] AWGN_INT_DBG unit_test command invoked num_args = %d vdev_id = %d e_mac_id = %d pmac_id = %d g_chan_bw_interference_bitmap = %d + +396,ii,[ wlan_dcs.c : 130 ] AWGN_INT_DBG unit_test wrong param num_args = %d args[0] = %d + +395,iIii,[ wlan_dcs.c : 100 ] AWGN_INT_DBG pdev_id = %d seg = 0x%x bw_drop = %d pkt_drop = %d + +438,I,[ wlan_scan_sch.c : 2653 ] SCAN_SCH_CSA_FAILED status = 0x%x +437,III,[ wlan_scan_sch.c : 2920 ] SCAN_SCH_RESUME requestor_id = 0x%x suspend_bitmap_63_32 = 0x%x, suspend_bitmap_31_0 = 0x%x +436,iIIi,[ wlan_scan_sch.c : 181 ] SCAN_SCH_SUPPRESS_REQ req_mod_id=%d sch_class = 0x%x id = 0x%x is_disable_scan = %d +435,III,[ wlan_scan_sch.c : 2894 ] SCAN_SCH_SUSPEND requestor_id = 0x%x suspend_bitmap_63_32 = 0x%x, suspend_bitmap_31_0 = 0x%x +434,IIiiIIii,[ wlan_scan_sch.c : 1215 ] SCAN_INTERN_EVT evt_type=%x(1:start 2:compl 4:bss 8:frn_ch 10:deq 20:preempt 40:start_fail 80:restart 100:frn_ch_exit 200:susp 400:resume) scan_id=0x%x vdev_id=%d freq=%d req_sub_id=0x%x to_host(8b)|reason(8b)=0x%x abs_pri=%d dwell=%d +433,Iiiii,[ wlan_scan_sch.c : 1265 ] SCAN_INTERN_EVT (FOREIGN_CHANNEL) scan_id = 0x%x ch_freq = %d bss_ch_freq = %d passive/active = %d dwell_time = %d +432,IIi,[ wlan_scan_sch.c : 1278 ] SCAN_INTERN_EVT (PREEMPTED) scan_id = 0x%x preempted_by (scan_id) = 0x%x reason = %d +431,I,[ wlan_scan_sch.c : 1840 ] SCAN_SCH_WMI_START_SCAN vdev_id = 0x%x is FREE +430,Iiiii,[ wlan_scan_sch.c : 1942 ] SCAN_SCH_WMI_START s_ssid_bssid_cache = 0x%x num_hint_freq_short_ssid_list = %d num_hint_freq_bssid_list = %d dtime_act = %d dtime_pas = %d +429,iiiii,[ wlan_scan_sch.c : 1994 ] CheckNOL status = %d, p_cmd->num_chan = %d, numOfChans = %d, scan_id = %d, req_id = %d +428,iI,[ wlan_scan_sch.c : 2025 ] SCAN_START_COMMAND_FAILED err_ret_code = %d(1:normal 2:NOL) status = 0x%x +427,iiiiii,[ wlan_scan_sch.c : 1892 ] SCAN_SCH_WMI_START_SCAN num_ssid from %d to %d, num_bssid from %d to %d, num_chan = %d ie_len = %d +426,I,[ wlan_scan_sch.c : 2050 ] SCAN_SCH_STOP_COMMAND_FAILED status = 0x%x +425,II,[ wlan_scan_sch.c : 630 ] SCAN_SCH_SUSPENDED suspend_bitmap_63_32 = 0x%x, suspend_bitmap_31_0 = 0x%x +424,i,[ wlan_scan_sch.c : 657 ] SCAN_SCH_START_NEW_REQ_FAILED error_code=%d +423,,[ wlan_scan_sch.c : 660 ] SCAN_DETERM_HIGH_PRI cur scan not completed +422,I,[ wlan_scan_sch.c : 1672 ] %s: Invalid params +421,I,[ wlan_scan_sch.c : 1649 ] %s: Invalid params +420,iI,[ wlan_scan_sch.c : 849 ] SCAN_SCH_START_PARAM_INVALID scan_id=0x%d param=0x%x +419,IIIiiiii,[ wlan_scan_sch.c : 1015 ] SCAN_SCH_START scan_id = 0x%x requestor_id = 0x%x req_sub_id = 0x%x requested_priority = %d absolute_priority = %d actv_time_5g = %d actv_time_2g = %d pass_time = %d +418,iiIii,[ wlan_scan_sch.c : 1045 ] SCAN_SCH_START_INFO monitoring_interval = %d ie_len = %d ie_chunk_bitmap = 0x%x opmode = %d subopmode = %d +417,iiIIii,[ wlan_scan_sch.c : 1062 ] SCAN_SCH_START_FAIL err_code = %d(1:misc 2:vdev_invalid 3:no_mem_new_req 4:chunk_copy_fail) scan_id = 0x%d requestor_id = 0x%x req_sub_id = 0x%x requested_priority = %d ie_len = %d +416,I,[ wlan_scan_sch.c : 1620 ] SCAN_EVENT_SEND_FAILED 0x%x +415,IiiIi,[ wlan_scan_sch.c : 1360 ] SCAN_EVENT_SEND_FAILED scan_id = 0x%x vdev_id = %d ch_freq = %d req_sub_id = 0x%x reason = %d +414,IIii,[ wlan_scan_sch.c : 303 ] SCAN_SCH_CANCEL scan_id = 0x%x requestor_id = 0x%x vdev_id = %d req_type = %d +413,,[ wlan_scan_sch.c : 355 ] SCAN_SCH_CANCEL already in progress +412,,[ wlan_scan_sch.c : 361 ] SCAN_SCH_CANCEL no match found +411,II,[ wlan_scan_sch.c : 556 ] SCAN_SCH_SUSPEND_NEXT_SCAN suspend_bitmap_63_32 = 0x%x, suspend_bitmap_31_0 = 0x%x +410,IIIIIII,[ wlan_scan_sch.c : 589 ] SCAN_SCH_SUPPRESS_MATCH scan_id = 0x%x, requestor = 0x%x, vdev_id = 0x%x, suppress_vdev_id_bitmap = 0x%x suppress_mod_bitmap[0:2] 0x%x 0x%x 0x%x +409,II,[ wlan_scan_sch.c : 1108 ] SCAN_SCH_ENGINE_STOP_DUE_TO_TIMEOUT evt_scan_id = 0x%x evt_reason = 0x%x +408,i,[ wlan_scan_sch.c : 1469 ] SCAN_SCH_NEXT_SCAN_FAILED error_code=%d +407,i,[ wlan_scan_sch.c : 1172 ] SCAN_EVENT_COMPLETED really cancelled scan_id %d +458,iii,[ wlan_scan_sm.c : 109 ] SCAN_SM_TRANSITIONS_MAC_%d %d => %d +457,iii,[ wlan_scan_sm.c : 94 ] SCAN_SM_DISPATCH_MAC_%d %d < %d +456,Iiii,[ wlan_scan_sm.c : 6687 ] SCAN_SM_OCS_TIMEOUT scan_id 0x%x, requestor = %d, curr_index = %d, curr_policy = %d +455,iiIIiiii,[ wlan_scan_sm.c : 826 ] SCAN_SM_REQ_NEXT_CHAN cur_policy=%d hdl_id=%d 2g_idx(16)|tot(16)=0x%x 5g_idx(8)|tot(E8_H8_L8)=0x%x dwell=%dms dur=%dus freq_pri=%d freq_sec=%d +454,IiiiiiiIi,[ wlan_scan_sm.c : 4735 ] SCAN_SEND_PROBE_REQ scan_id = 0x%x mac_id = %d freq = %d cur_index = %d max_num_probe = %d probe_timer_count = %d chainmask = %d ppdu_info = 0x%x max_tx_power = %d +453,Ii,[ wlan_scan_sm.c : 6787 ] SCAN_SM_CANCEL scan_stop = 0x%x scan_timeout = %d +452,i,[ wlan_scan_sm.c : 3249 ] SCAN_SM_REQ_NEXT_CHAN !error! not implemented scan policy: %d +451,ii,[ wlan_scan_sm.c : 4821 ] SCAN_SM_PROBE_REQ_FRAME_GEN_FAILED scanhandler_id = %d 6g_freq = %d +450,iIiIIII,[ wlan_scan_sm.c : 4860 ] SEND_PROBE_ON_6GHZ_CH freq = %d short_ssid = 0x%x (cur_20TU_idx = %d add_flags_save = 0x%x add_flags = 0x%x chainmask = 0x%x ppdu_info = 0x%x) +449,iIIiIIII,[ wlan_scan_sm.c : 4870 ] SEND_PROBE_ON_6GHZ_CH freq = %d bssid = %08x%04x (cur_20TU_idx = %d add_flags_save = 0x%x add_flags = 0x%x chainmask = 0x%x ppdu_info = 0x%x) +448,i,[ wlan_scan_sm.c : 4962 ] SCAN_SEND_PROBE_REQ_6G_MGR err_ret = %d +447,IiiI,[ wlan_scan_sm.c : 5839 ] SCAN_SEND_PROBE_REQ_2G_RET scan_id = 0x%x freq = %d cur_index = %d flags = 0x%02x +446,IiiI,[ wlan_scan_sm.c : 5852 ] SCAN_SEND_PROBE_REQ_5G_RET scan_id = 0x%x freq = %d cur_index = %d flags = 0x%02x +445,IIIiiiii,[ wlan_scan_sm.c : 5998 ] SCAN_SEND_PROBE_REQ_INFO scan_id = 0x%x band_2G_info = 0x%x band_5G_info = 0x%x probe_time = %d last_ssid_idx = %d last_bssid_idx = %d last_sent_probes = %d increase_probe_cnt:%d +444,iI,[ wlan_scan_sm.c : 6004 ] SCAN_SEND_PROBE_REQ_RET err_ret = %d scan_id = 0x%x +443,i,[ wlan_scan_sm.c : 5511 ] SCAN_SM_PROBE_REQ_FRAME_GEN_FAILED scanhandler_id = %d +442,iii,[ wlan_scan_sm.c : 5177 ] SCAN_SM_PROBE_REQ_FRAME_GEN_FAILED scanhandler_id = %d 5g_freq = %d 2g_freq = %d +441,iii,[ wlan_scan_sm.c : 4249 ] SCAN_SM_FOREIGN_CH actual_probe_delay = %d, scan_sch_handle->cancel_probe_req_defer = %d, params.cancel_probe_req_defer = %d +440,iiii,[ wlan_scan_sm.c : 4272 ] SCAN_SM_LEGACY_MAC_CHANGE scanhandler_id = %d, last_legacy_macid = %d req_mac_id = %d, index = %d +439,i,[ wlan_scan_sm.c : 6387 ] SCAN_SM_FOREIGN_CHAN_EVENT !error! not implemented scan policy: %d +480,iiii,[ wlan_scan_mgr.c : 439 ] SCAN_MGR_PDEV_SUSPEND_RESUME_CHANGE_EVT pdev_id = %d requestor = %d reason %d state = %d +479,IIII,[ wlan_scan_mgr.c : 410 ] SCAN_POLICY_EVENT current_allowed_policy = 0x%x new_allowed_policy = 0x%x current_scan_req = 0x%x suppress_mode_bitmap = 0x%x +478,Iiiii,[ wlan_scan_mgr.c : 90 ] SCAN_MGR_STATE_CHANGE scan_id = 0x%x num_ssid = %d num_bssid = %d num_chan = %d new_scan_state = %d (0:completed 1:legacy 2:sync_DBS 3:async_DBS 4:agile 5:agile_DFS_2g 6:agile_DFS_5g) +477,iii,[ wlan_scan_mgr.c : 1207 ] SCAN_MGR_BCN_RECV_WRONG_CH mac_id = %d freq (%d != %d) +476,ii,[ wlan_scan_mgr.c : 1264 ] SCAN_MGR_BCN_RECV_FAIL err_code = %d(1:macid_invalid 2:cur_sch_scan_req_null) mac_id = %d +475,iii,[ wlan_scan_mgr.c : 1214 ] SCAN_MGR_BCN_RECV_WRONG_CH mac_id = %d cur_freq (%d != %d) +474,,[ wlan_scan_mgr.c : 1417 ] SCAN_MGR_CH_MODE_CHANGE scan cancelled +473,iiiii,[ wlan_scan_mgr.c : 1484 ] SCAN_MGR_CHECK_PARAMS_CHANNELS params->num_chan=%d params->chan_list[0]=%d has_2g_chan=%d has_5g_chan_active=%d has_5g_chan_passive=%d +472,iii,[ wlan_scan_mgr.c : 1283 ] SCAN_MGR_DS_PARAM mac_id = %d, chan = %d len = %d +471,iI,[ wlan_scan_mgr.c : 154 ] SCAN_MGR_EVENT_FAIL: Invalid input - scan_handler_id = %d, current_scan_sch_req = 0x%x +470,IIiiiiiIi,[ wlan_scan_mgr.c : 296 ] SCAN_MGR_EVENT_PREEMPTED scan_id = 0x%x cur_chan_index = 0x%x mac_id = %d 2g_next_idx = %d 2g_curr = %d 5g_next_idx = %d 5g_curr = %dreason = 0x%x cur_scan_policy = %d +469,IIIi,[ wlan_scan_mgr.c : 302 ] SCAN_MGR_EVENT_SUSPENDED scan_id = 0x%x cur_chan_index = 0x%x reason = 0x%x cur_scan_policy = %d +468,i,[ wlan_scan_mgr.c : 308 ] SCAN_MGR_EVENT_PREEMPTED or SCAN_MGR_EVENT_SUSPENDED drop_event = %d +467,Iiiii,[ wlan_scan_mgr.c : 366 ] SCAN_MGR_EVENT_COMPLETED scan_id = 0x%x num_ssid = %d num_bssid = %d num_chan = %d is_drop = %d +466,I,[ wlan_scan_mgr.c : 1574 ] SCAN_MGR_SCAN_POLICY_RECOMPUTE_START suppress mode bitmap = 0x%x +465,iiii,[ wlan_scan_mgr.c : 1628 ] SCAN_MGR_SCAN_POLICY_RECOMPUTE invalid chan index vdev_index=%d has_2g_chan=%d passive_5g=%d has_5g_chan_active=%d +464,iiiiiI,[ wlan_scan_mgr.c : 1678 ] SCAN_MGR_SCAN_POLICY_RECOMPUTE_END vdev_index = %d, chan_index = %d, new_scan_policy = %d, scan_mgr_handle->cur_scan_policy = %d, scan_policy_max = %d, suppress mode bitmap = 0x%x +463,IIii,[ wlan_scan_mgr.c : 960 ] SCAN_MGR_CANCEL scan_id = 0x%x requstor = 0x%x stop_mode = %d scan_eng_start_pending = %d +462,II,[ wlan_scan_mgr.c : 1056 ] SCAN_MGR_CANCEL comp_pending=0x%x cancel_pending=0x%x +461,Ii,[ wlan_scan_mgr.c : 925 ] SCAN_MGR_SCAN_START_NON_DBS scan_id = 0x%x cur_scan_policy = %d +460,i,[ wlan_scan_mgr.c : 1119 ] SCAN_SCH_NEXT_SCAN_FAILED after setting new channel lists, error_code=%d +459,iiiiiiii,[ wlan_scan_mgr.c : 620 ] SCAN_MGR_RESUME_EVENT 2g cur_chan = %d, 2g next_chan = %d, 5g cur_chan = %d, 5g next_chan = %d, band_5g_low(high)_num_chan_indices = %d(%d), band_5g_low(high)_num_chan_indices = %d(%d) +481,i,[ wlan_scan_unit_test.c : 53 ] SCAN_NUM_SUPP_CHAN_LIST %d +483,i,[ wlan_scan_6g_discv.c : 669 ] SCAN_FILSD_HANDLER_ERROR err_code = %d +482,iiI,[ wlan_scan_6g_discv.c : 707 ] SCAN_FILSD_PARSER_ERROR rx_freq = %d len = %d ret = 0x%x +491,iii,[ wlan_thermal_unit_test.c : 86 ] WLAN_THERMAL_TSENS_TEMP_1 temp_req = %d, sensor_id = %d, temp = %d +490,iiiiiiii,[ wlan_thermal_unit_test.c : 96 ] WLAN_THERMAL_TSENS_TEMP_2 sensor[1-8] %d %d %d %d %d %d %d %d +489,ii,[ wlan_thermal_unit_test.c : 369 ] wlan_thermal_unit_test %d %d +488,ii,[ wlan_thermal_unit_test.c : 48 ] WLAN_THERMAL_TSENS_INVALID_CONFIG vdev_id = %d, num_args = %d +487,iiiiii,[ wlan_thermal_unit_test.c : 52 ] WLAN_THERMAL_TSENS_RECONFIG num_args = %d, Temp1|2 degC = %d %d, kp|ki|kd = %d %d %d +486,iiiii,[ wlan_thermal_unit_test.c : 299 ] tt enabled. pdev_id(%d) dc:%d, dc_per_event:%d, hwm:%d, throt_levels:%d +485,i,[ wlan_thermal_unit_test.c : 314 ] tt disabled for pdev_id: (%d) +484,iiii,[ wlan_thermal_unit_test.c : 358 ] level configured. level:%d, lwm:%d, hwm:%d, dcoff:%d +583,,[ wlan_vdev.c : 469 ] vdev connecting client is registered in non wow mode +582,I,[ wlan_vdev.c : 493 ] allow during connecting, subtype:%x +581,iiI,[ wlan_vdev.c : 567 ] set_restore_mac_addr status = %d, freq = %d, evh = 0x%x +580,ii,[ wlan_vdev.c : 6633 ] VDEV_MGR_STA_PS_EVENT: vdev_id=%d, event_type=%d +579,ii,[ wlan_vdev.c : 1515 ] VDEV EVT:RT thread handle vdev_stop_down_del cmd:%d, vdev_id:%d +578,iii,[ wlan_vdev.c : 1445 ] VDEV EVT:DATA offload thread handle vdev_stop_down_del msg cmd = %d, vdev_id = %d, vdev_mode = %d +577,iii,[ wlan_vdev.c : 1351 ] VDEV EVT:RT thread handle vdev_stop_down_del msg cmd = %d, vdev_id = %d, vdev_mode = %d +576,i,[ wlan_vdev.c : 11123 ] wmi vdev send event %d +575,II,[ wlan_vdev.c : 7205 ] VDEV_STOP_ABORT_TX try_to_abort, hwq=0x%x, swq=0x%x +574,II,[ wlan_vdev.c : 7212 ] VDEV_STOP_ABORT_TX abort_fails, hwq=0x%x, swq=0x%x +573,II,[ wlan_vdev.c : 7216 ] VDEV_STOP_ABORT_TX abort_succeeds, hwq=0x%x, swq=0x%x +572,II,[ wlan_vdev.c : 7223 ] VDEV_STOP_ABORT_TX after_abort, hwq=0x%x, swq=0x%x +571,iii,[ wlan_vdev.c : 7243 ] VDEV_STOP_EVT VDEV ID = %d HW Q depth= %d, SW Q depth = %d +570,ii,[ wlan_vdev.c : 7335 ] WMI_CMD_PARAMS VdevId/AC/Arg1 = %d Cmd/Med-Time/Action/Arg2 = %d +569,iii,[ wlan_vdev.c : 1006 ] VDEV EVT: vdev create id=%d, mode=%d submode=%d +568,ii,[ wlan_vdev.c : 1969 ] VDEV EVT: vdev delete id=%d, mode=%d +567,i,[ wlan_vdev.c : 1557 ] wlan_beacon_tx: vdev id = %d vdev delete return becasue bcn ctxt is not free yet +566,iii,[ wlan_vdev.c : 1628 ] VDEV EVT: WMI_VDEV_DELETE_RESP_EVENTID vdevId=%d vdev_type: %d vdev_subtype: %d +565,iiIIi,[ wlan_vdev.c : 1588 ] VDEV EVT peer not cleared idx=%d vdev_id = %d mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x usage_count = %d +564,,[ wlan_vdev.c : 9462 ] Failed to allocate memory for DISA event!!! +563,i,[ wlan_vdev.c : 9492 ] DISA event sent to HOST: frame_len=%d +562,iiiii,[ wlan_vdev.c : 9996 ] Error: vdev id %d, aggregation type %d, ac %d, max num frames %d, enable_bitmap %d + +561,iiiiii,[ wlan_vdev.c : 10003 ] vdev id %d, aggregation type %d, ac %d, max num frames %d, enable_bitmap %d rx_size %d + +560,iiiiii,[ wlan_vdev.c : 10080 ] vdev id %d, ac %d, software retry type %d, software retry threshold %d, pdev->agg_retry_th %d, pdev->non_agg_retry_th %d +559,i,[ wlan_vdev.c : 9514 ] WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID invalid vdev_id %d +558,i,[ wlan_vdev.c : 9523 ] WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID invalid data_len %d +557,i,[ wlan_vdev.c : 9543 ] VDEV_DISPATCH_DISA_FRAME_TX failed status=%d +556,i,[ wlan_vdev.c : 8814 ] WMI_VDEV_GET_ARP_STAT_CMDID: vdev_id = %d event alloc failed +555,,[ wlan_vdev.c : 8529 ] wlan_vdev_dispatch_get_big_data Err vdev || vdev not free +554,i,[ wlan_vdev.c : 8676 ] WMI_VDEV_GET_KEEPALIVE_CMDID: vdev_id = %d event alloc failed +553,iiiii,[ wlan_vdev.c : 7909 ] 11w PMF vdevId=%d key_ix=%d cipher=%d is_group_key_valid %d group_key_ix %d +552,,[ wlan_vdev.c : 7992 ] key cache POOL ALLOC FAILURE +551,iIIi,[ wlan_vdev.c : 8030 ] VDEV_INSTALL_KEY_FAIL vdev_id %d mac_addr %04x:%08x status %d +550,iIIi,[ wlan_vdev.c : 8078 ] VDEV_INSTALL_KEY_FAIL_MESH vdev_id %d mac_addr %04x:%08x status %d +549,iI,[ wlan_vdev.c : 8116 ] WAL_DBGID_SET_M4_SENT_MANUALLY VDEV ID = %d, peer = 0x%x +548,i,[ wlan_vdev.c : 9725 ] LIMIT_OFFCHAN_ERROR client_id=%d +547,i,[ wlan_vdev.c : 9735 ] LIMIT_OFFCHAN_ERROR vdev_id=%d +546,Iiii,[ wlan_vdev.c : 9388 ] dispatch_set_ie_cmd: ie_id = 0x%x, id_len = %d, source=%d, band=%d +545,Iii,[ wlan_vdev.c : 9406 ] vdev_set_scan_default_ie status = 0x%x vdev_id=%d prunned_ie_len=%d +544,iII,[ wlan_vdev.c : 8634 ] KA: cmd handler() -> start timer vdev_id = %d keepalive_interval = 0x%x keepalive_method = 0x%x +543,i,[ wlan_vdev.c : 7737 ] Invalid VDEV in WMI_VDEV_SET_WMM_PARAMS_CMDID, VDEV ID = %d +542,i,[ wlan_vdev.c : 7760 ] WMI_VDEV_SET_WMM_PARAMS_CMDID type=%d +541,IIII,[ wlan_vdev.c : 7773 ] WMI_VDEV_SET_WMM_PARAMS_CMDID ac[31-16]/acm[15-0] = 0x%x cw_min = 0x%x cw_max = 0x%x txop_limit[31-16]/aifs[15-0] = 0x%x +540,i,[ wlan_vdev.c : 7744 ] Invalid WAL VDEV in WMI_VDEV_SET_WMM_PARAMS_CMDID, VDEV ID = %d +539,Iiii,[ wlan_vdev.c : 7534 ] Rejecting vdev_start Invalid Regdomain vdev_id= 0x%x, host_regdomain = %d regdomain = %d isDFSSTA=%d +538,I,[ wlan_vdev.c : 7546 ] Rejecting vdev_start Roaming in progress vdev_id= 0x%x +537,I,[ wlan_vdev.c : 7555 ] Rejecting vdev_start BSS Peer not created vdev_id= 0x%x +536,I,[ wlan_vdev.c : 7563 ] Rejecting vdev_start Home channel not in supported band vdev_id= 0x%x +535,III,[ wlan_vdev.c : 7584 ] Rejecting vdev_start request from requestor_id = 0x%x. start_delay_us = 0x%x, max_start_delay_us=0x%x +534,iI,[ wlan_vdev.c : 7597 ] Rejecting vdev_start request for vdev_id = %d from requestor_id = 0x%x. STA + STA not supported +533,i,[ wlan_vdev.c : 7652 ] STA-DFS flag SET in wmi_channel for vdev %d +532,IIIIIii,[ wlan_vdev.c : 8410 ] WLAN_DISPATCH_VDEV_UP vdev_flags:0x%x vdev_bssid:%x_%x trans_bssid:%x_%x profile_idx:%d profile_num:%d +531,,[ wlan_vdev.c : 8446 ] WLAN_DISPATCH_VDEV_UP !!!host sends wrong MBSSID param!!! +530,iii,[ wlan_vdev.c : 8187 ] WMI_CMD_PARAMS AC = %d Med-Time usec = %d DwnGrd_Type = %d +529,ii,[ wlan_vdev.c : 8879 ] dispatch_wmm_delts_cmd: ac = %d vdev id = %d +528,,[ wlan_vdev.c : 8899 ] dispatch_wmm_delts_cmd: end +527,ii,[ wlan_vdev.c : 4614 ] VDEV EVT: vdev down id=%d, mode=%d +526,ii,[ wlan_vdev.c : 9348 ] vdev_extract_mandatory_ies: id=%d, len=%d +525,Ii,[ wlan_vdev.c : 9262 ] vdev_extract_optional_vendor_ies: oui=0x%x, len=%d +524,I,[ wlan_vdev.c : 6906 ] VDEV free error, peer addr:0x%x, mac:0x8x 0x8x +523,ii,[ wlan_vdev.c : 10584 ] SET TPC POWER CMD num_pwr_levels limit exceeded vdev_id %d num_pwr_levels %d +522,iii,[ wlan_vdev.c : 10601 ] VDEV_SET_PARAM_TPC_POWER psd_power=%d, eirp_power=%d, num_pwr_levels=%d +521,iiiii,[ wlan_vdev.c : 10569 ] wlan_vdev_handle_wfa_config_cmd override_rsnxe=%d, ignore_csa=%d, deauth_on_saquery_timeout=%d override_oci_chan frame_types=%d, override_oci_chan=%d +520,iIii,[ wlan_vdev.c : 9686 ] LIMIT_OFFCHAN_ARBITER client=%d flag=0x%x max_offchan_time=%d rest_time=%d +519,Iii,[ wlan_vdev.c : 9708 ] LIMIT_OFFCHAN_ARBITER_RESULT flag=0x%x max_offchan_time=%d rest_time=%d +518,II,[ wlan_vdev.c : 2417 ] wlan_vdev_migrate vdev_id[31-16]/from_mac[15-8]/to_mac[7-0] 0x%x, is_up[24]/is_active[16]/mode[15-8]/submode[7-0] 0x%x +517,,[ wlan_vdev.c : 7430 ] WMI_EVENT_ALLOC_FAILURE: VDEV_REJECT_VDEV_START_REQ_RESP_EVENTID buffer failure +516,ii,[ wlan_vdev.c : 9102 ] vdev_set_mandatory_ie: ie_id=%d, id_len=%d +515,i,[ wlan_vdev.c : 9213 ] vdev_set_mandatory_ie: not handled ie_id=%d +514,iii,[ wlan_vdev.c : 8998 ] vdev_set_mandatory_ie_by_band: ie_id=%d, band=%d, id_len=%d +513,ii,[ wlan_vdev.c : 5482 ] WMI_CMD_PARAMS VdevId/AC/Arg1 = %d Cmd/Med-Time/Action/Arg2 = %d +512,iII,[ wlan_vdev.c : 5487 ] vdev_id: %d vdev_set_param: id: 0x%x param_value: 0x%x +511,iII,[ wlan_vdev.c : 6008 ] WLAN_VDEV_SET_PARAM_FAIL3 paramid:%d vdevp:0x%x vdevp->bss:0x%x +510,iii,[ wlan_vdev.c : 6231 ] WMI_VDEV_PARAM_DISABLE_NOA_P2P_GO ic_mode:%d ic_subopmode:%d param:%d +509,ii,[ wlan_vdev.c : 6250 ] WMI_VDEV_PARAM_SMPS_INTOLERANT: vdev_id:%d, param:%d +508,I,[ wlan_vdev.c : 6449 ] Setting CABQ to %x +507,,[ wlan_vdev.c : 6497 ] Err: WMI_VDEV_PARAM_NTH_BEACON_TO_HOST command came for non STA vdev +506,IiiiiiI,[ wlan_vdev.c : 3314 ] VDEV_START: vdev_id[31-24]/mode[23-16]/mode[15-8]/mac_id[7-0] = 0x%x chan_mhz = %d phy_mode=%d band_center_freq1=%d band_center_freq2=%d ldpc_rx_enabled=%d vdev_flags:0x%x +505,IiI,[ wlan_vdev.c : 3507 ] VDEV_MGR_HP_START_TIME vdev_id = 0x%x chan_mhz = %d start_tsf = 0x%x +504,Ii,[ wlan_vdev.c : 599 ] resmgr link already exist: 0x%X vdev_id = %d +503,iIIII,[ wlan_vdev.c : 8228 ] wlan_vdev_tsf_report: vdev_id = %d, tsf_low = 0x%x, tsf_high = 0x%x, qtimer_low=0x%x, qtimer_high=0x%x +502,iI,[ wlan_vdev.c : 8249 ] wlan_vdev_tsf_tstamp_action:vdev_id = %d, action = 0x%x +501,ii,[ wlan_vdev.c : 8257 ] wlan_vdev_tsf_tstamp_action: vdev_id = %d, vdev_ifUp = %d +500,iI,[ wlan_vdev.c : 11146 ] wlan_vdev_unit_test: vdev_id = %d, cmd = WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM, value = 0x%x +499,ii,[ wlan_vdev.c : 4159 ] VDEV_MGR_VDEV_UP id=%d, mode=%d +498,i,[ wlan_vdev.c : 4377 ] VDEV RESMGR_LINK_ATTR_SMPS_VALID Peer_flags:%d +497,i,[ wlan_vdev.c : 4419 ] VDEV RESMGR_LINK_ATTR_SMPS_VALID VHT mode:%d +496,iII,[ wlan_vdev.c : 4486 ] KA: wlan_vdev_up() -> start timer vdev_id = %d keepalive_interval = 0x%x keepalive_method = 0x%x +495,i,[ wlan_vdev.c : 2723 ] wlan_vdevs_migrate, vdevs_migrate_duration = %d us +494,iiii,[ wlan_vdev.c : 780 ] WMI NRP Config : addr1=%d, idx=%d, type=%d, action=%d +493,iii,[ wlan_vdev.c : 6940 ] WAL Peer event vdevp %d is_free %d, is_vdev_stopping %d +492,iii,[ wlan_vdev.c : 6948 ] WAL Peer event Vdev ID = %d HW Q depth= %d, SW Q depth = %d +602,iii,[ wlan_vdev_misc.c : 1138 ] VDEV_MGR_MY_BEACON_PARSED malformed id = %d len=%d remain_len=%d +601,iiI,[ wlan_vdev_misc.c : 1170 ] VDEV_MGR_MY_BEACON_BAD_IE id=%d,len=%d,status=0x%x +600,IIIII,[ wlan_vdev_misc.c : 1061 ] wlan_vdev_256BA_support_check :: VENDOR SPECIFIC IE :%u, %u, %02x, %02x, %02x +599,IIIIII,[ wlan_vdev_misc.c : 970 ] VENDOR SPECIFIC IE :%u, %u, %02x, %02x, %02x, %02x +598,ii,[ wlan_vdev_misc.c : 3267 ] User configured fils discovery period (%d) is more than max supported value (%d). Capping fd period to max supported +597,ii,[ wlan_vdev_misc.c : 2835 ] wlan_vdev_fill_vdev_mac_entry: vdev_id=%d, pdev_id=%d +596,,[ wlan_vdev_misc.c : 3208 ] FD_TMPL_CMD: buf_len is greater than max len +595,,[ wlan_vdev_misc.c : 3216 ] FD_TMPL_CMD: invalid vdev_id +594,,[ wlan_vdev_misc.c : 3225 ] failed to allocate buffer for FD TMPL CMD +593,I,[ wlan_vdev_misc.c : 2985 ] wlan_vdev_get_migrate_active_vdev_list vdev_id_list=0x%x +592,I,[ wlan_vdev_misc.c : 1701 ] Received IBSS Beacon peer = 0x%x send_to_host = +591,iIIIiii,[ wlan_vdev_misc.c : 1435 ] VDEV_MGR_MY_BEACON_RECEIVED: vdev_id = %d curr_time = 0x%x curr_vdev_tsf = 0x%x seq = 0x%x rssi = %d bss_ch = %d recv_ch = %d +590,iii,[ wlan_vdev_misc.c : 1529 ] VDEV_MGR_HANDLE_OWN_BEACON fail freq:%d len:%d err_code:%d(1:NULL_wal_peer 2:ch_0 3:NULL_wlan_peer 4:short_len) +589,i,[ wlan_vdev_misc.c : 3770 ] wlan_vdev_is_mcc_vdev_connect_in_progress result %d +588,IIIIi,[ wlan_vdev_misc.c : 2075 ] OMI: Error peernss = 0x%lx OMI nss = 0x%lx bssBw= %1x OMI Bw= %1x peerMaxBw = %d + +587,IIIII,[ wlan_vdev_misc.c : 1086 ] set_ignore_check_for_OUI :: VENDOR SPECIFIC IE :%u, %u, %02x, %02x, %02x +586,IIII,[ wlan_vdev_misc.c : 1325 ] MU EDCA BEACON UPDATE FROM AP ac = 0x%x cw_min = 0x%x cw_max = 0x%x mu_edca_timer[31-16]/aifs[15-0] = 0x%x +585,iiii,[ wlan_vdev_misc.c : 1345 ] MU EDCA BEACON: ignoring edca update qos_present=%d mu_edca_present=%d bcn_update_cnt=%d vdev_update_cnt=%d +584,i,[ wlan_vdev_misc.c : 325 ] STA_KICKOUT: Reason=%d +612,iIIII,[ wlan_vdev_keepalive.c : 770 ] KA: VDEV_MGR_AP_KEEPALIVE_INACTIVE vdev_id = %d cur_txrx_ref_time = 0x%x last_txrx_time = 0x%xlast_tx_time = 0x%x last_rx_time = 0x%x +611,IIi,[ wlan_vdev_keepalive.c : 781 ] KA: wlan_vdev_keepalive_ready_to_send cur_txrx_ref_time = 0x%x last_txrx_time = 0x%x inactive_time_ms = %d +610,iIII,[ wlan_vdev_keepalive.c : 374 ] VDEV_MGR_AP_KEEPALIVE_IDLE vdev_id = %d assoc_id = 0x%x inact_gen = 0x%x n_buffered_mpdu = 0x%x +609,iiIIIIIi,[ wlan_vdev_keepalive.c : 449 ] VDEV_MGR_AP_KEEPALIVE KICKOUT: vdevid:%d, aid:%d, max_inactivity:0x%x last_txrx_activity:0x%x curr_time:0x%x, data_act:0x%x, mgmt_ctrl_act:0x%x, IdleOption:%d +608,III,[ wlan_vdev_keepalive.c : 492 ] IBSS Keep Alive rx_last_activity = 0x%x ibss_max_bcn_lost_uses = 0x%x current time = 0x%x +607,IIII,[ wlan_vdev_keepalive.c : 380 ] VDEV_MGR_AP_KEEPALIVE_INACTIVE vdev_id = 0x%x assoc_id = 0x%x inact_gen = 0x%x n_buffered_mpdu = 0x%x +606,iIII,[ wlan_vdev_keepalive.c : 386 ] VDEV_MGR_AP_KEEPALIVE_UNRESPONSIVE vdev_id = %d assoc_id = 0x%x inact_gen = 0x%x n_buffered_mpdu = 0x%x +605,i,[ wlan_vdev_keepalive.c : 838 ] VDEV_MGR_FIRST_BMISS_DETECTED: vdev_id = %d +604,i,[ wlan_vdev_keepalive.c : 848 ] VDEV_MGR_FINAL_BMISS_DETECTED: vdev_id = %d +603,i,[ wlan_vdev_keepalive.c : 880 ] VDEV_MGR_BCN_IN_SYNC: vdev_id = %d +640,iIIII,[ wlan_vdev_schedule.c : 618 ] VDEV_MGR_AP_TBTT_CONFIG: vdev_id =%d, chan_mhz = 0x%x, tbtt_link_type = 0x%x, ni_intval = 0x%x, tbtt_offset = 0x%x +639,iII,[ wlan_vdev_schedule.c : 690 ] Corr_sta_tbtt_drift: vdev_id = %d, chan_mhz = 0x%x, start_tsf = 0x%x +638,iIIi,[ wlan_vdev_schedule.c : 3139 ] VDEV_MGR AP Connection protection critical channel request: vdev_id = %d, chan_mhz = 0x%x, start_tsf = 0x%x, duration = %d +637,iIIi,[ wlan_vdev_schedule.c : 3074 ] VDEV_MGR SWBA protection critical channel request: vdev_id = %d, chan_mhz = 0x%x, start_tsf = 0x%x, duration = %d +636,,[ wlan_vdev_schedule.c : 1800 ] vdev_bmiss_crit_ch_req_cb: ch_req granted +635,,[ wlan_vdev_schedule.c : 1840 ] vdev_bmiss_crit_ch_req_cb: ch_req completed without receiving beacon +634,i,[ wlan_vdev_schedule.c : 2483 ] VDEV_MGR_VDEV_START_OCS_HP_REQ_STOP: vdev_id = %d +633,i,[ wlan_vdev_schedule.c : 2518 ] VDEV_MGR_FIRST_BCN_RECEIVED: vdev_id = %d +632,i,[ wlan_vdev_schedule.c : 2523 ] VDEV_MGR_PEER_AUTHORIZED: vdev_id = %d +631,i,[ wlan_vdev_schedule.c : 2545 ] VDEV_MGR_VDEV_START_OCS_HP_REQ_STOP: vdev_id = %d +630,i,[ wlan_vdev_schedule.c : 2557 ] WLAN_VDEV_DPD_CAL_START vdev_id:%d +629,iI,[ wlan_vdev_schedule.c : 2385 ] VDEV_MGR_VDEV_START_OCS_HP_REQ_COMPLETE without VDEV UP: vdev_id = %d, ch_req_flag = 0x%x +628,i,[ wlan_vdev_schedule.c : 2424 ] VDEV_MGR_VDEV_START_OCS_HP_REQ_COMPLETE: vdev_id = %d +627,ii,[ wlan_vdev_schedule.c : 2116 ] WLAN_VDEV_DPD_CAL_DONE vdev_id:%d ch:%d +626,iiI,[ wlan_vdev_schedule.c : 2244 ] multi_vdev response: vdev_id=%d, num_multi_vdev_restart_compl=%d, multi_vdev_restart_bitmap=0x%x +625,ii,[ wlan_vdev_schedule.c : 2065 ] WMI_EVENT_ALLOC_FAILURE: vdev_id = %d, opmode = %d, evt_id = WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID +624,i,[ wlan_vdev_schedule.c : 2090 ] multi_vdev WMI_EVENT_SEND: pdev_id = %d, event = WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID +623,ii,[ wlan_vdev_schedule.c : 1985 ] WMI_EVENT_ALLOC_FAILURE: vdev_id = %d, opmode = %d, evt_id = WMI_VDEV_START_RESP_EVENTID +622,ii,[ wlan_vdev_schedule.c : 2039 ] WMI_EVENT_SEND: vdev_id = %d, opmode = %d, event = WMI_VDEV_START_RESP_EVENTID +621,iII,[ wlan_vdev_schedule.c : 3370 ] wlan_vdev_sta_concurrency_event_handler: vdev_id = %d, next_state = 0x%x, cur_state = 0x%x +620,Ii,[ wlan_vdev_schedule.c : 1965 ] SCAN_RADIO_SUPPORT_DBUG scan_radio_lpri_req setup lp_ch_req created = %p channel = %d + +619,,[ wlan_vdev_schedule.c : 3006 ] VDEV_MGR_FIRST_BMISS_DETECTED: Post Critical ch_req +618,iIII,[ wlan_vdev_schedule.c : 1425 ] VDEV_MGR_AP_TBTT_CONFIG: vdev_id = %d, chan_mhz = 0x%x, tbtt_link_type = 0x%x, ap_tbtt_offset = 0x%x +617,iI,[ wlan_vdev_schedule.c : 2789 ] VDEV_MGR_LOWPOWER_HP_CHREQ_ENABLED: vdev_id = %d, chan_mhz = 0x%x +616,iII,[ wlan_vdev_schedule.c : 2872 ] VDEV_MGR_HP_START_TIME: vdev_id = %d, chan_mhz = 0x%x, start_tsf = 0x%x +615,iI,[ wlan_vdev_schedule.c : 2907 ] VDEV_MGR_LOWPOWER_LP_CHREQ_ENABLED: vdev_id = %d, factor = 0x%x +614,iI,[ wlan_vdev_schedule.c : 2913 ] VDEV_MGR_LOWPOWER_LP_CHREQ_ENABLED: vdev_id = %d, factor = 0x%x +613,iII,[ wlan_vdev_schedule.c : 2931 ] VDEV_MGR_OCS_HP_LP_REQ_POSTED: vdev_id = %d, hp_ch_req = 0x%x, lp_ch_req = 0x%x +654,iI,[ wlan_vdev_pause.c : 475 ] VDEV Unpause Failure: VDEV ID = %d pause_bitmap = 0x%x in Unpause complete +653,ii,[ wlan_vdev_pause.c : 1251 ] Disable leaky AP CTS2S: vdev_id = %d pause_delay_us = %d +652,I,[ wlan_vdev_pause.c : 1254 ] enable_null_leaky_ap_pause=0x%x +651,I,[ wlan_vdev_pause.c : 585 ] vdev->bcn_tx_paused_wlan_vdev_pause_1=0x%x +650,,[ wlan_vdev_pause.c : 603 ] VDEV_PAUSE_FAIL ifPaused set with pause_bitmap = 0 in _wlan_vdev_pause +649,IiiiI,[ wlan_vdev_pause.c : 669 ] VDEV_MGR_VDEV_PAUSE: enable_null_leaky_ap_pause=0x%x no_null_to_ap_for_roaming=%d leakyAp_cts2s_enable=%d pause_delay_us=%d req from mod_id = %x +648,iiiii,[ wlan_vdev_pause.c : 249 ] VDEV_MGR_VDEV_PAUSE_COMP: vdev_id = %d pause_status = LEAKY AP DETECTED data_null_tx_delay = %d actual_leak_window = %d pause_delay_us = %d consec_detect_leaky_ap_cnt = %d +647,iiiii,[ wlan_vdev_pause.c : 383 ] VDEV_MGR_VDEV_PAUSE_DELAY_UPDATE: vdev_id = %d avg_data_null_tx_delay = %d avg_rx_leak_window = %d pause_delay_us = %d is_bt_connected = %d +646,iiiii,[ wlan_vdev_pause.c : 304 ] VDEV_MGR_VDEV_PAUSE_COMP: vdev_id = %d pause_status = FAILURE data_null_tx_delay = %d avg_data_null_tx_delay = %d actual_leak_window = %d avg_rx_leak_window = %d +645,iiiii,[ wlan_vdev_pause.c : 327 ] VDEV_MGR_VDEV_PAUSE_COMP: vdev_id = %d pause_status = SUCCESS data_null_tx_delay = %d avg_data_null_tx_delay = %d actual_leak_window = %d avg_rx_leak_window = %d +644,i,[ wlan_vdev_pause.c : 1262 ] no_null_to_ap_for_roaming=%d +643,I,[ wlan_vdev_pause.c : 853 ] VDEV_UNPAUSE_FAIL: ifPaused not set with pause_bitmap = 0x%x in _wlan_vdev_unpause +642,,[ wlan_vdev_pause.c : 894 ] VDEV_MGR_VDEV_PAUSE unpause non_protocol_unpaused +641,,[ wlan_vdev_pause.c : 960 ] VDEV_MGR_VDEV_PAUSE csa_roaming_ongoing and no host unpause +659,,[ wlan_vdev_unit_test.c : 86 ] wlan_vdev_config_test: vdev is NULL +658,iiii,[ wlan_vdev_unit_test.c : 157 ] wlan_vdev_unit_test: vdev_id = %d, custom_sw_retry_th_cmd, ac %d sw_retry_type = %d sw_retry_th = %d +657,I,[ wlan_vdev_unit_test.c : 232 ] wlan_vdev_unit_test: g_wmi_cmd_enable_pf_log = 0x%x +656,iiiii,[ wlan_vdev_unit_test.c : 100 ] wlan_vdev_config_test: vdev_id = %d, test_cmd = %d, args[1] = %d, args[2] = %d, num_args = %d +655,iii,[ wlan_vdev_unit_test.c : 135 ] wlan_vdev_unit_test: vdev_id = %d, custom_aggr_size_cmd, subfram %d ac = %d +686,,[ wlan_pmf_offload.c : 1141 ] 11w PMF: PN Replay attack detected +685,ii,[ wlan_pmf_offload.c : 1035 ] 11w PMF KEY ID MISMATCH MMIE key_id = %d, igtk_key_id = %d +684,i,[ wlan_pmf_offload.c : 723 ] 11w PMF: can not handle frame size: %d +683,,[ wlan_pmf_offload.c : 742 ] 11w PMF: IE is not Mgmt MIC IE or Invalid length +682,,[ wlan_pmf_offload.c : 764 ] 11w PMF: BC/MC/Beacon MGMT IPN check Failed +681,,[ wlan_pmf_offload.c : 836 ] 11w PMF: BC/MC/Beacon CMAC MGMT frame MMIE MIC check Failed +680,,[ wlan_pmf_offload.c : 913 ] 11w PMF: BC/MC/Beacon GMAC MGMT frame MMIE MIC check Failed +679,,[ wlan_pmf_offload.c : 970 ] 11W PMF: MMIE valid +678,iiIII,[ wlan_pmf_offload.c : 1207 ] 11W PMF mgmt hdlr subtype=%d len=%d wal_peer: %p vdev: %p wlan_peer:%p +677,,[ wlan_pmf_offload.c : 1217 ] 11W PMF mgmt hdlr pmf not enabled +676,,[ wlan_pmf_offload.c : 1242 ] 11W PMF mgmt hdlr pmf not enabled +675,,[ wlan_pmf_offload.c : 1251 ] 11W PMF mgmt hdlr frame not from Associated AP +674,,[ wlan_pmf_offload.c : 1284 ] 11w PMF BIP check failed +673,I,[ wlan_pmf_offload.c : 1299 ] 11w PMF decrypt error, rx status 0x%x +672,,[ wlan_pmf_offload.c : 1322 ] 11w PMF drop unenryp robust action category +671,IIII,[ wlan_pmf_offload.c : 1331 ] 11w PMF action frm %x %x %x %x +670,ii,[ wlan_pmf_offload.c : 1374 ] 11w PMF current transId=%d startTransId=%d +669,,[ wlan_pmf_offload.c : 1379 ] 11w PMF SA query rsp with valid transId rcvd +668,Ii,[ wlan_pmf_offload.c : 1396 ] 11w PMF deauth/disassoc reason_code %x frmType=%d +667,i,[ wlan_pmf_offload.c : 1399 ] 11w PMF send SA query state=%d +666,ii,[ wlan_pmf_offload.c : 565 ] 11W PMF: SA query timeout hdlr vdevId=%d, query_state=%d +665,ii,[ wlan_pmf_offload.c : 570 ] 11W PMF: SA query timeout hdlr cur retry cnt=%d, max retry cnt=%d +664,iiii,[ wlan_pmf_offload.c : 1078 ] 11W PMF: Send SA query vdevId=%d, transId=%d query_type=%d tx_status=%d +663,iii,[ wlan_pmf_offload.c : 658 ] 11W PMF: Update iGTK vdevId=%d, keyIdx=%d, KeyLen=%d +662,,[ wlan_pmf_offload.c : 675 ] igtk: Same key reinstalled +661,iii,[ wlan_pmf_offload.c : 618 ] 11W PMF Offload CMD hdlr: WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID vdevId=%d, interval=%d, retry_count=%d +660,,[ wlan_pmf_offload.c : 1458 ] 11w PMF is not enabled +694,iii,[ wlan_roam_host.c : 126 ] ROAM_LOW_RSSI_INTERRUPT bcn_rssi_avg = -%d dBm bcn_rssi_last = -%d dBm hi_thresh = -%d dBm +693,iii,[ wlan_roam_host.c : 139 ] ROAM_LOW_RSSI_INTERRUPT bcn_rssi_avg = -%d dBm bcn_rssi_last = -%d dBm hi_thresh = -%d dBm +692,i,[ wlan_roam_host.c : 324 ] ROAM_VDEV_EVT_NOT_INUSE type=%d +691,,[ wlan_roam_host.c : 202 ] ROAM_FREE_NOT_IN_USE +690,i,[ wlan_roam_host.c : 232 ] ROAM_CONFIG_RSSI_CHANGE chagne_val = %d +689,i,[ wlan_roam_host.c : 242 ] ROAM_CONFIG_RSSI_CHANGE chagne_val = %d dBm +688,,[ wlan_roam_host.c : 260 ] ROAM_START_FAIL_NOT_INUSE +687,,[ wlan_roam_host.c : 288 ] ROAM_STOP_FAIL_NOT_INUSE +695,iiiii,[ wlan_roam_wmi.c : 399 ] ROAM_EVENT_TO_HOST reason=%d, notif=%d, notif_params=%d, ret=%d ev_size=%d +699,iII,[ wlan_dsm_filter.c : 213 ] DSM_LIST_UPDATE bssid_type = %d bssid removed is %08x%04x +698,iIIiiiii,[ wlan_dsm_filter.c : 104 ] i | bssid_type = %d, bssid_disallow_ap = %08x%04x retry_delay = %d msec, rssi = %d dbm source|reason = %d original_timestamp = %d original_timeout = %d +697,iIIiiiii,[ wlan_dsm_filter.c : 196 ] FW added: i | bssid_type = %d, bssid_disallow_ap = %08x%04x retry_delay = %d msec, rssi = %d dbm source|reason = %d original_timestamp = %d original_timeout = %d +696,iIIii,[ wlan_dsm_filter.c : 346 ] AP Blacklisted: bssid_type = %d, bssid %08x%04x exp_delay = %d msec, exp_rssi = %ddBm +709,I,[ wlan_framegen.c : 2180 ] WLAN_FRMGEN_GET_ACTION_SMPS incorrect sm_power_control:0x%x +708,iIiIiIiI,[ wlan_framegen.c : 1858 ] WLAN_FRMGEN_GET_ACTION_TM lci_ie_len:%d lci_ie:0x%x civ_ie_len:%d civ_ie:0x%x ftm_ie_len:%d ftm_ie:0x%x vendor_ie_len:%d vendor_ie:0x%x +707,iIiIiIiI,[ wlan_framegen.c : 1685 ] WLAN_FRMGEN_GET_ACTION_TMR lci_ie_len:%d lci_ie:0x%x civ_ie_len:%d civ_ie:0x%x ftm_ie_len:%d ftm_ie:0x%x vendor_ie_len:%d vendor_ie:0x%x +706,iiii,[ wlan_framegen.c : 5472 ] bss color gen evt rpt ie_len=%d evt_token=%d evt_type=%d evt_status=%d +705,iIi,[ wlan_framegen.c : 5873 ] frmgen_get_default_ie vdev_id=%d fc_type=0x%x length=%d +704,III,[ wlan_framegen.c : 263 ] WLAN_FRMGEN_GET_NULLFUNC_WITH_HTCTRL FAIL! peer:0x%x addr1:0x%x addr3:0x%x +703,i,[ wlan_framegen.c : 1514 ] SKIPPED inserting some IE's error_code:%d +702,iIIi,[ wlan_framegen.c : 5839 ] frmgen_insert_default_ie vdev_id=%d frm_type=0x%x sub_type=0x%x ies_len=%d +701,IIIi,[ wlan_framegen.c : 5970 ] frmgen_set_default_ie: vdev=0x%x,frm_type=0x%x,buf=0x%x,len=%d +700,iIiii,[ wlan_framegen.c : 6017 ] frmgen_set_default_ie vdev_id=%d frm_type=0x%x ies_len=%d status=%d i=%d +775,ii,[ wlan_frameparse.c : 5323 ] FRAME_PARSER frm_len=%d fils_d_size=%d +774,iiii,[ wlan_frameparse.c : 4991 ] bss color parse evt rpt ie_len=%d evt_token=%d evt_type=%d evt_status=%d +773,iii,[ wlan_frameparse.c : 581 ] FRMPARSE_WARN ie->ie_len %d (exp %d) remaining_len %d. ignore this IE +772,ii,[ wlan_frameparse.c : 3885 ] MLME_FRMPARSE_WARN_EXT_CAP ie->ie_len %d (remaining %d) ignore this IE +771,i,[ wlan_frameparse.c : 3891 ] MLME_FRMPARSE_WARN_EXT_CAP ie->ie_len %d ignore this IE +770,ii,[ wlan_frameparse.c : 1366 ] MLME_FRMPARSE_WARN_EXT_SUPP_RATE ie->ie_len %d remaining_len %d. ignore this IE +769,iii,[ wlan_frameparse.c : 1375 ] MLME_FRMPARSE_WARN_EXT_SUPP_RATE rate_index %d (> %d)-> trimmed to %d +768,I,[ wlan_frameparse.c : 1386 ] MLME_FRMPARSE_WARN_EXT_SUPP_RATE skipped unknown rate 0x%x +767,,[ wlan_frameparse.c : 1393 ] MLME_FRMPARSE_WARN_EXT_SUPP_RATE no known rate value +766,iiiI,[ wlan_frameparse.c : 5097 ] wlan_frmparse_get_mgmt_payload frm_len=%d iv_len=%d ivmic_len=%d htctrl_len=%u +765,ii,[ wlan_frameparse.c : 733 ] MLME_FRMPARSE_WARN_HE_6GHZ_BAND_CAP ie->ie_len %d (exp %d) ignore this IE +764,ii,[ wlan_frameparse.c : 740 ] MLME_FRMPARSE_WARN_HE_6GHZ_BAND_CAP remaining_len %d (exp %d) ignore this IE +763,ii,[ wlan_frameparse.c : 638 ] MLME_FRMPARSE_HE_CAP remaining_len %d (exp %d) ignore this IE +762,ii,[ wlan_frameparse.c : 645 ] MLME_FRMPARSE_HE_CAP remaining_len %d (exp %d) ignore this IE +761,ii,[ wlan_frameparse.c : 678 ] MLME_FRMPARSE_HE_CAP_MSC remaining_len %d (exp %d) ignore this IE +760,ii,[ wlan_frameparse.c : 708 ] MLME_FRMPARSE_HE_PPET remaining_len %d (exp %d) ignore this IE +759,iiii,[ wlan_frameparse.c : 557 ] FRMPARSE he op ie heop_present=%d vht_op_present=%d 6ghz_op=%d max_co_loc_bssid_present=%d. +758,ii,[ wlan_frameparse.c : 266 ] MLME_FRMPARSE_WARN_HT_CAP ie->ie_len %d (exp %d) ignore this IE +757,ii,[ wlan_frameparse.c : 272 ] MLME_FRMPARSE_WARN_HT_CAP remaining_len %d (exp %d) ignore this IE +756,ii,[ wlan_frameparse.c : 325 ] MLME_FRMPARSE_WARN_HT_OPER ie->ie_len %d (exp %d) ignore this IE +755,ii,[ wlan_frameparse.c : 331 ] MLME_FRMPARSE_WARN_HT_OPER remaining_len %d (exp %d) ignore this IE +754,,[ wlan_frameparse.c : 4925 ] FRM_PARSE_IE_ITERATOR ie_buffer_start is NULL +753,ii,[ wlan_frameparse.c : 4932 ] FRM_PARSE_IE_ITERATOR ERROR remaining_length(%d) < ie_hdr_size(%d) +752,ii,[ wlan_frameparse.c : 4939 ] FRM_PARSE_IE_ITERATOR ERROR remaining_length(%d) < ie_len(%d) +751,ii,[ wlan_frameparse.c : 1645 ] FRMPARSE_WARN_MU_EDCA_PARAM ie->ie_len %d (exp %d). ignore this IE +750,ii,[ wlan_frameparse.c : 1652 ] FRMPARSE_WARN_MU_EDCA_PARAM ie->ie_len %d remaining_len %d. ignore this IE +749,ii,[ wlan_frameparse.c : 84 ] MLME_FRMPARSE_WARN_QBSS ie->ie_len %d remaining_len %d. ignore this IE +748,ii,[ wlan_frameparse.c : 89 ] MLME_FRMPARSE_WARN_QBSS ie->ie_len %d (!= %d) +747,ii,[ wlan_frameparse.c : 1263 ] MLME_FRMPARSE_WARN_SSID ie->ie_len %d (> %d) +746,ii,[ wlan_frameparse.c : 1270 ] MLME_FRMPARSE_WARN_SSID ie->ie_len %d remaining_len %d. ignore this IE +745,ii,[ wlan_frameparse.c : 1304 ] MLME_FRMPARSE_WARN_SUPP_RATE ie->len %d (> %d)-> ignore this IE +744,ii,[ wlan_frameparse.c : 1312 ] MLME_FRMPARSE_WARN_SUPP_RATE ie->ie_len %d remaining_len %d. ignore this IE +743,I,[ wlan_frameparse.c : 1327 ] MLME_FRMPARSE_WARN_SUPP_RATE skipped unknown rate 0x%x +742,,[ wlan_frameparse.c : 1336 ] MLME_FRMPARSE_WARN_SUPP_RATE no known rate value +741,i,[ wlan_frameparse.c : 4634 ] MLME_FRMPARSE_VENDOR_VHT unknown type %d +740,ii,[ wlan_frameparse.c : 4651 ] MLME_FRMPARSE_WARN_VENDOR_VHT remaining_len %d (exp %d) ignore this IE +739,I,[ wlan_frameparse.c : 4664 ] MLME_FRMPARSE_WARN_VENDOR_VHT ERROR vht_caps. status %x + +738,I,[ wlan_frameparse.c : 4678 ] MLME_FRMPARSE_WARN_VENDOR_VHT ERROR vht_oper. status %x + +737,ii,[ wlan_frameparse.c : 423 ] MLME_FRMPARSE_WARN_VHT_CAP ie->ie_len %d (exp %d) ignore this IE +736,ii,[ wlan_frameparse.c : 430 ] MLME_FRMPARSE_WARN_VHT_CAP remaining_len %d (exp %d) ignore this IE +735,ii,[ wlan_frameparse.c : 370 ] MLME_FRMPARSE_WARN_VHT_OPER ie->ie_len %d (exp %d) ignore this IE +734,ii,[ wlan_frameparse.c : 377 ] MLME_FRMPARSE_WARN_VHT_OPER remaining_len %d (exp %d) ignore this IE +733,i,[ wlan_frameparse.c : 2074 ] MLME_FRMPARSE_WPA_IE skip parsing as rsn_ie_len (%d) is present +732,iIII,[ wlan_frameparse.c : 1791 ] MLME_FRMPARSE_WPA_RSN_CIPHER index %d unknown vendor oui 0x%08x 0x%08x 0x%08x +731,I,[ wlan_frameparse.c : 1818 ] MLME_FRMPARSE_WPA_RSN_CIPHER_ERR can't use_group for suite type 0x%x +730,iIi,[ wlan_frameparse.c : 1834 ] MLME_FRMPARSE_WPA_RSN_CIPHER index %d unknown suite type 0x%08x cipher_suite_type = %d +729,iiiII,[ wlan_frameparse.c : 1847 ] MLME_FRMPARSE_WPA_RSN_CIPHER cipher_suite_count %d is_rsn %d suite_type %d (0=group,1=pair,2=group_mgmt) cipher_type 0x%08x ie_status 0x%x +728,i,[ wlan_frameparse.c : 1885 ] MLME_FRMPARSE_ERROR_WPA_RSN missing version field. remaining_len %d +727,ii,[ wlan_frameparse.c : 1892 ] MLME_FRMPARSE_ERROR_WPA_RSN version (%d) is not 1. remaining ie_len %d +726,i,[ wlan_frameparse.c : 1902 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete group cipher suite. remaining_len = %d (< 4) +725,i,[ wlan_frameparse.c : 1916 ] MLME_FRMPARSE_WARN_WPA_RSN pairwise suite count remaining_len %d (< 2) +724,ii,[ wlan_frameparse.c : 1924 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete pairwise cipher suite. remaining_len = %d (< %d) +723,i,[ wlan_frameparse.c : 1938 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete akm suite count remaining_len %d (< 2) +722,ii,[ wlan_frameparse.c : 1948 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete akm suite. remaining_len = %d (< %d) +721,i,[ wlan_frameparse.c : 1959 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete rsn caps. remaining_len = %d (< 2) +720,,[ wlan_frameparse.c : 1970 ] MLME_FRMPARSE_WARN_WPA_RSN rsn_caps.pre_auth set in WPA. +719,i,[ wlan_frameparse.c : 1987 ] MLME_FRMPARSE_WARN_WPA_RSN pmkid. remaining_len = %d (< 2) +718,ii,[ wlan_frameparse.c : 1997 ] MLME_FRMPARSE_WARN_WPA_RSN pmkid. remaining_len = %d (< %d) +717,i,[ wlan_frameparse.c : 2013 ] MLME_FRMPARSE_WARN_WPA_RSN incomplete group mgmt cipher suite. remaining_len = %d (< 4) +716,iIII,[ wlan_frameparse.c : 1706 ] MLME_FRMPARSE_WPA_RSN_AKM index %d unknown vendor oui 0x%08x 0x%08x 0x%08x +715,iI,[ wlan_frameparse.c : 1752 ] MLME_FRMPARSE_WPA_RSN_AKM index %d unknown suite type 0x%08x + +714,iiIII,[ wlan_frameparse.c : 1758 ] MLME_FRMPARSE_WPA_RSN_AKM akm_suite_count %d is_rsn %d proto 0x%08x key_mgmt 0x%08x ie_status 0x%x +713,i,[ wlan_frameparse.c : 1079 ] MLME_PHYMODE invaild center freq0 phymode=%d +712,i,[ wlan_frameparse.c : 1180 ] MLME_PHYMODE invaild center freq0 phymode=%d +711,iiii,[ wlan_frameparse.c : 860 ] wlan_get_rx_nss nss=%d,%d,%d,%d +710,iiii,[ wlan_frameparse.c : 906 ] wlan_get_tx_nss nss=%d,%d,%d,%d +794,iii,[ wlan_key_mgmt.c : 40 ] KEYMGMT_ADD_PEER_ENTRY key_ciper:%d key_len:%d is_mcast:%d +793,iIi,[ wlan_key_mgmt.c : 77 ] KEYMGMT_ADD_KEY_ENTRY_REINSTALLATION ERROR id=%d flags=0x%x len=%d +792,i,[ wlan_key_mgmt.c : 104 ] KEYMGMT_ADD_PEER_ENTRY WEP ERROR key_len:%d +791,i,[ wlan_key_mgmt.c : 120 ] KEYMGMT_ADD_PEER_ENTRY AES CCM ERROR key_len:%d +790,i,[ wlan_key_mgmt.c : 137 ] KEYMGMT_ADD_PEER_ENTRY AES GCM ERROR key_len:%d +789,i,[ wlan_key_mgmt.c : 172 ] KEYMGMT_ADD_PEER_ENTRY ERROR key_ciper:%d +788,iii,[ wlan_key_mgmt.c : 195 ] wal_peer_set_key type=%d, keyid=%d,pairwise=%d failed + +787,i,[ wlan_key_mgmt.c : 43 ] KEYMGMT_ADD_PEER_ENTRY open key_ciper:%d +786,,[ wlan_key_mgmt.c : 57 ] KEYMGMT_ADD_PEER_ENTRY ERROR! wal_peer is NULL +785,i,[ wlan_key_mgmt.c : 416 ] KEYMGMT_CLR_KEY_ENTRY id=%d +784,i,[ wlan_key_mgmt.c : 433 ] KEYMGMT_CLR_KEY_ENTRY id=%d +783,,[ wlan_key_mgmt.c : 244 ] KEYMGMT_ADD_GROUP_KEY ERROR! wal_peer is NULL +782,i,[ wlan_key_mgmt.c : 270 ] KEYMGMT_ADD_GROUP_KEY WEP ERROR key_len:%d +781,i,[ wlan_key_mgmt.c : 327 ] KEYMGMT_ADD_GROUP_KEY ERROR key_ciper:%d +780,iII,[ wlan_key_mgmt.c : 527 ] KEYMGMT_RESET_KEY id=%d peer_addr=%08x%04x +779,iiIi,[ wlan_key_mgmt.c : 367 ] KEYMGMT_ADD_KEY_ENTRY id=%d key_idx=%d flags=0x%x len=%d +778,iIi,[ wlan_key_mgmt.c : 382 ] KEYMGMT_ADD_KEY_ENTRY_EXISTING key_idx=%d flags=0x%x len=%d +777,ii,[ wlan_key_mgmt.c : 394 ] KEYMGMT_ADD_KEY_ENTRY_NO_MEM id=%d key_idx=%d +776,iiIiII,[ wlan_key_mgmt.c : 479 ] KEYMGMT_INSTALL_KEY_ENTRY id=%d idx=%d key_flags_bitmap=0x%x len=%d peer_addr=0x04%x08%x +817,ii,[ wlan_beacon.c : 1152 ] WLAN_BEACON_CANCEL_RESYNC: vdev_id=%d, resyncBeacon=%d +816,II,[ wlan_beacon.c : 1855 ] nextdtim: 0x%08x%08x +815,II,[ wlan_beacon.c : 651 ] tsf_beacon: 0x%08x%08x +814,ii,[ wlan_beacon.c : 1124 ] WLAN_BEACON_RESYNC: vdev_id=%d, resyncBeacon=%d +813,ii,[ wlan_beacon.c : 2331 ] BEACON_RESYNC_ARBITER_ADD_CLIENT: vdev_id=%d, client_id=%d +812,i,[ wlan_beacon.c : 2314 ] BEACON_RESYNC_ARBITER_CANCEL_ALL_REQUESTS: vdev_id=%d +811,ii,[ wlan_beacon.c : 2289 ] BEACON_RESYNC_ARBITER_CANCEL_REQUEST: vdev_id=%d, client_id=%d +810,ii,[ wlan_beacon.c : 2345 ] BEACON_RESYNC_ARBITER_REMOVE_CLIENT: vdev_id=%d, client_id=%d +809,ii,[ wlan_beacon.c : 2258 ] BEACON_RESYNC_ARBITER_REQUEST: vdev_id=%d, client_id=%d +808,iii,[ wlan_beacon.c : 2361 ] BEACON_RESYNC_ARBITER_RESOLVE: vdev_id=%d, is_vdev_holding=%d, SLIST_EMPTY(hold_list)=%d +807,i,[ wlan_beacon.c : 2387 ] BEACON_RESYNC_ARBITER_VDEV_INIT: vdev_id=%d +806,,[ wlan_beacon.c : 2405 ] arbiter_clinet POOL ALLOC FAILURE +805,,[ wlan_beacon.c : 2392 ] arbiter_clinet POOL ALLOC FAILURE +804,i,[ wlan_beacon.c : 2427 ] BEACON_RESYNC_ARBITER_VDEV_DEINIT: vdev_id=%d +803,,[ wlan_beacon.c : 1049 ] WLAN_BEACON_TBTTOFFSET_UPDATE_HANDLER ERROR! pmac is NULL +802,iIII,[ wlan_beacon.c : 1086 ] WLAN_BEACON_TBTTOFFSET_UPDATE_HANDLER vdev_map mismatch i:%d vdev_map:0x%x vdev_id_map:0x%x max_diff:0x%x +801,,[ wlan_beacon.c : 204 ] beacon_init POOL ALLOC FAILURE +800,iI,[ wlan_beacon.c : 1459 ] _wlan_tsfoor_handler: vdev_id = %d, tesf = 0x%x +799,iiii,[ wlan_beacon.c : 753 ] QUIET IE STA: period=%d dur=%d, offset=%d, tbtt cnt=%d +798,ii,[ wlan_beacon.c : 163 ] wlan_beacon_unit_test_module %d %d +797,,[ wlan_beacon.c : 969 ] WLAN_BEACON_WAL_TBTTOFFSET_UPDATE_HANDLER ERROR! pmac is NULL +796,ii,[ wlan_beacon.c : 128 ] wlan_beacon_unit_test_beacon_start_stop %d %d +795,i,[ wlan_beacon.c : 154 ] wlan_beacon_unit_test_slot_time %d +831,iI,[ wlan_mbssid.c : 686 ] MBSS: NONTRAN_BSSID_CAP IE length: %d, NontxBssidCap: 0x%x +830,iI,[ wlan_mbssid.c : 691 ] MBSS: SSID IE length:%d ssid:%s +829,iIIIIIIii,[ wlan_mbssid.c : 707 ] MBSS: Couldn't find (mbssid_ind %d) %x:%x:%x:%x:%x:%x, DP: %d, DC:%d +828,iiii,[ wlan_mbssid.c : 716 ] MBSS: UPDATE: mbssid_idx:%d, period:%d, *dtim_cnt:%d, vdev_dtim_intval:%d +827,iiiiii,[ wlan_mbssid.c : 725 ] MBSS: SET: mbssid_idx: %d, dtimperiod:%d, frm_dtimcnt:%d, vdev_dtim_cnt %d, recvd_dtim:%d, settingdtm:%d +826,i,[ wlan_mbssid.c : 743 ] MBSS: Unhandled wlan_mbss_index_update_type: %d +825,ii,[ wlan_mbssid.c : 750 ] MBSS: ELEMENT ID: %d, IE length: %d +824,i,[ wlan_mbssid.c : 461 ] WLAN_MBSSID_GET_NONTRANS_BSSID Big max_bssid_ind:%d +823,iiIIIIII,[ wlan_mbssid.c : 478 ] MBSSID_GET_NONTRANS_BSSID profile_id = %d bssid_index = %d mac addr = %02x:%02x:%02x:%02x:%02x:%02x +822,ii,[ wlan_mbssid.c : 445 ] MBSSID_GET_NONTRANS_BSSID_PROF_NUM profile_num = %d max_mbssid_indicator = %d +821,ii,[ wlan_mbssid.c : 317 ] MBSSID_IS_BSSID_MATCHED fail, len:%d err_code:%d(4:invalid_idx,5:invalid_profile_id) +820,,[ wlan_mbssid.c : 342 ] MBSSID_IS_SSID_MATCHED legacy case +819,ii,[ wlan_mbssid.c : 376 ] MBSSID_IS_SSID_MATCHED profile_id = %d ssid_len = %d +818,i,[ wlan_mbssid.c : 807 ] MBSS: MBSSID_GET_NONTRANS_BSSID_PROF_NUM profile_num = %d +834,ii,[ wlan_phyerr_internal.c : 121 ] phyerr event err: buf_len:%d>%d +833,,[ wlan_phyerr_internal.c : 209 ] phyerr event: alloc event failure +832,iiiii,[ wlan_phyerr_internal.c : 224 ] phyerr event, lo:%d, now_mac:%d, now_os:%d, phy0:%d, phy1:%d +848,i,[ wlan_dfs_phyerr_offload.c : 384 ] PHYERR offload enable pdev_id=%d +847,,[ wlan_dfs_phyerr_offload.c : 420 ] PHYERR unexpected offload disable command for HKv2! +846,iiiiiii,[ wlan_dfs_phyerr_offload.c : 472 ] ADFS_DUMPS WMI_VDEV_ADFS_CH_CFG_CMD center_freq1=%d, center_freq2=%d, chan_width=%d, cac_duration_ms=%d, ocac_mode=%d, flags=%d, vdev_id=%d +845,ii,[ wlan_dfs_phyerr_offload.c : 510 ] ADFS_DUMPS PROTOCOL-Starting timer for cac_duration_ms:%d, current_time:%d + +844,i,[ wlan_dfs_phyerr_offload.c : 73 ] ADFS_DUMPS PROTOCOL-Inside wlan_adfs_cac_timer_handler, current_time = %d +843,iiiii,[ wlan_dfs_phyerr_offload.c : 56 ] ADFS_DUMPS PROTOCOL-Sending WMI_VDEV_ADFS_OCAC_COMPLETE_EVENTID center_freq1=%d, center_freq2=%d, bandwidth=%d, status=%d, vdev_id=%d +842,,[ wlan_dfs_phyerr_offload.c : 258 ] PHYERR offload cac check not DFS chan +841,ii,[ wlan_dfs_phyerr_offload.c : 263 ] PHYERR offload not enabled, mac_id=%d vdev_id=%d +840,i,[ wlan_dfs_phyerr_offload.c : 95 ] PHYERR offload cac timeout vdevId=%d +839,ii,[ wlan_dfs_phyerr_offload.c : 238 ] PHYERR offload mac_id=%d enabled=%d +838,,[ wlan_dfs_phyerr_offload.c : 579 ] register - WMI_SERVICE_DFS_PHYERR_OFFLOAD +837,i,[ wlan_dfs_phyerr_offload.c : 314 ] PHYERR offload radar det evt disable cac timer vdevId=%d +836,iiii,[ wlan_dfs_phyerr_offload.c : 348 ] PHYERR offload det mode=%d, chan_freq=%d det_id=%d seg_id=%d +835,i,[ wlan_dfs_phyerr_offload.c : 346 ] PHYERR offload send radar detection evt WMI pdevId=%d +851,iii,[ wlan_dfs_phyerr_unit_test.c : 44 ] wlan_dfs_phyerr_offload_unit_test input: vdevId=%d testId=%d num_args=%d +850,ii,[ wlan_dfs_phyerr_unit_test.c : 60 ] wlan_dfs_phyerr_offload_unit_test input: set radar mac_id=%d cmd=%d +849,ii,[ wlan_dfs_phyerr_unit_test.c : 107 ] wlan_dfs_phyerr_offload_unit_test input: mac_id=%d enable radar det offload=%d +860,II,[ wlan_txbf.c : 1436 ] TXBFEE_DBGID_HOST_CONFIG_CMDID ID=0x%x Value=0x%x +859,IIIIi,[ wlan_txbf.c : 1175 ] TXBF: SUBFee=0x%x MUBFee=0x%x SUBFer=0x%x MUBFer=0x%x chan->phy_mode=%d +858,,[ wlan_txbf.c : 1191 ] VDEV Registration Failed +857,iI,[ wlan_txbf.c : 1330 ] TXBFEE_DBGID_BRPOLL_RECEIVED vdev_id = %d fbSegBmap=0x%x +856,,[ wlan_txbf.c : 1352 ] Non-directed GID frame + +855,i,[ wlan_txbf.c : 1395 ] Gid=%d + +854,iII,[ wlan_txbf.c : 1404 ] TXBFEE_DBGID_GID_RECEIVED vdev_id = %d gid=0x%x userpos=0x%x +853,iI,[ wlan_txbf.c : 1378 ] i=%d, membership=0x%x + +852,iiIi,[ wlan_txbf.c : 1309 ] TXBFEE_DBGID_NDPA_RECEIVED vdev_id=%d vht_he=%d staInfo=0x%x token_num=%d +861,I,[ wlan_txbf_unit_test.c : 78 ] WLAN_TXBF_CONFIG param = 0x%x +864,II,[ unit_test.c : 419 ] UNIT_TEST_GEN 0x%x 0x%x +863,IIIII,[ unit_test.c : 427 ] UNIT_TEST_GEN 0x%x 0x%x 0x%x 0x%x, 0x%x +862,,[ unit_test.c : 180 ] DTF Disabled +890,iiI,[ wlan_regdb_offload.c : 192 ] REGDB set init country command pdev_id=%d, cc_type=%d, cc_value=%x +889,,[ wlan_regdb_offload.c : 276 ] register - WMI_SERVICE_REGULATORY_DB +888,i,[ wlan_regdb_offload.c : 588 ] REGDB EXT send reg rules failed - status=%d +887,i,[ wlan_regdb_offload.c : 524 ] REGDB send reg rules failed - status=%d +886,ii,[ wlan_regdb_offload.c : 530 ] REGDB rdCtl: %d %d +885,II,[ wlan_regdb_offload.c : 537 ] REGDB send default reg rules for alpha2: %c %c +884,iiiiii,[ wlan_regdb_offload.c : 539 ] REGDB send def reg rules phy_id=%d status_code=%d, ctry_id=%d dom_code=%d, num_2g_rules=%d, num_5g_rules=%d +883,IIiiii,[ wlan_regdb_offload.c : 542 ] REGDB dfs_reg=%x, phybitmap=%x minbw2g=%d maxbw2g=%d minbw5g=%d maxbw5g=%d +882,,[ wlan_regdb_offload.c : 430 ] REGDB EXT fail - invalid country code input +881,,[ wlan_regdb_offload.c : 434 ] REGDB EXT fail - invalid get type +880,iiiI,[ wlan_regdb_offload.c : 315 ] REGDB send reg rules for mac_id=%d get_type=%d cc_type=%d cc_value=%x +879,i,[ wlan_regdb_offload.c : 384 ] REGDB send reg rules failed - status=%d +878,II,[ wlan_regdb_offload.c : 388 ] REGDB send reg rules for alpha2: %c %c +877,iiiiii,[ wlan_regdb_offload.c : 390 ] REGDB phy_id=%d status_code=%d, ctry_id=%d dom_code=%d, num_2g_rules=%d, num_5g_rules=%d +876,IIiiii,[ wlan_regdb_offload.c : 393 ] REGDB dfs_reg=%x, phybitmap=%x minbw2g=%d maxbw2g=%d minbw5g=%d maxbw5g=%d +875,,[ wlan_regdb_offload.c : 330 ] REGDB fail - invalid country code input +874,,[ wlan_regdb_offload.c : 334 ] REGDB fail - invalid get type +873,i,[ wlan_regdb_offload.c : 765 ] RegDB EXT Rules Assert - %d + +872,,[ wlan_regdb_offload.c : 776 ] RegDB EXT wmi buf alloc fail +871,,[ wlan_regdb_offload.c : 868 ] RegDB - Sent WMI_REG_CHAN_LIST_CC_EXT_EVENT + +870,II,[ wlan_regdb_offload.c : 636 ] REGDB read reg rules alpha2 %c %c +869,iiii,[ wlan_regdb_offload.c : 648 ] REGDB max_rules=%d 2g_rules=%d 5g_rules=%d, evt_len=%d +868,,[ wlan_regdb_offload.c : 652 ] REGDB wmi buf alloc fail +867,iIII,[ wlan_regdb_offload.c : 715 ] REGDB ruleIdx=%d freq info=%x bw_pwr=%x flag=%x +866,,[ wlan_regdb_offload.c : 723 ] REGDB send WMI_REG_CHAN_LIST_CC_EVENTID +865,iiI,[ wlan_regdb_offload.c : 66 ] REGDB test command num_args=%d testId=%d value1=%x +924,iiIII,[ wlan_beacon_tx_offload.c : 1368 ] WOW_BEACON_OFFLOAD_TX pdev_id = %d vdev_id = %d completion_status = 0x%x bcn_pending_count = 0x%x bcn_buf_initialized = 0x%x +923,i,[ wlan_beacon_tx_offload.c : 2577 ] WOW_PROBE_RESP_TX: tx done cb, compl status=%d +922,iiiiiiI,[ wlan_beacon_tx_offload.c : 955 ] BCN_TMPL_CMDID: vdevid:%d, tmplt_idx:%d, first:%d, last:%d, pp:%d, maxpp:%d, vdev_flags:0x%x +921,ii,[ wlan_beacon_tx_offload.c : 988 ] tmplt_idx %d >= profile_period %d +920,IIIII,[ wlan_beacon_tx_offload.c : 1109 ] QUIET IE AP: vdev_id= %x period = %x duration = %x off = %x flag = %x +919,iI,[ wlan_beacon_tx_offload.c : 1163 ] WOW_PROBE_RESP_TX: PRB TMPL CMDID, probe_resp_len=%d flags=%x +918,,[ wlan_beacon_tx_offload.c : 1193 ] offload_ctxt POOL ALLOC FAILURE +917,,[ wlan_beacon_tx_offload.c : 1200 ] buf POOL ALLOC FAILURE +916,I,[ wlan_beacon_tx_offload.c : 1238 ] QUIET IE AP_swba: TIM Disable value = %x +915,I,[ wlan_beacon_tx_offload.c : 1248 ] QUIET IE AP_swba: TIM Enable value = %x +914,,[ wlan_beacon_tx_offload.c : 115 ] bcn_ctxt POOL ALLOC FAILURE +913,I,[ wlan_beacon_tx_offload.c : 2164 ] HE_RTS_THRESHOLD_DBG: enter: he_op_ie rts_thresh: %lu +912,iiii,[ wlan_beacon_tx_offload.c : 2188 ] HE_RTS_THRESHOLD_DBG: middle: he_rts_load_enable_threshold: %d, load_metric: %d, active_user_count: %d, rx_load_pct: %d +911,I,[ wlan_beacon_tx_offload.c : 2202 ] HE_RTS_THRESHOLD_DBG: exit: he_op_ie rts_thresh: %lu +910,IIIIiiI,[ wlan_beacon_tx_offload.c : 1585 ] BEACON TX ignored, vdev id:%x, mac_id:%x, bcn_tx_paused:%x, pdev_id:%x, swba_delay:%d consec_beacon_skip:%d, on_chan = %x +909,I,[ wlan_beacon_tx_offload.c : 1708 ] WOW_RECV_MGMT frame_type = 0x%x +908,ii,[ wlan_beacon_tx_offload.c : 2219 ] MU_EDCA_DEBUG: id: %d, update_cnt: %d +907,iiiii,[ wlan_beacon_tx_offload.c : 2224 ] MU_EDCA_DEBUG: id: %d, BK: cwmin: %d, cwmax: %d, aifsn: %d, edca_timer: %d +906,iiiii,[ wlan_beacon_tx_offload.c : 2229 ] MU_EDCA_DEBUG: id: %d, BE: cwmin: %d, cwmax: %d, aifsn: %d, edca_timer: %d +905,iiiii,[ wlan_beacon_tx_offload.c : 2234 ] MU_EDCA_DEBUG: id: %d, VI: cwmin: %d, cwmax: %d, aifsn: %d, edca_timer: %d +904,iiiii,[ wlan_beacon_tx_offload.c : 2239 ] MU_EDCA_DEBUG: id: %d, VO: cwmin: %d, cwmax: %d, aifsn: %d, edca_timer: %d +903,I,[ wlan_beacon_tx_offload.c : 3156 ] QUIET IE AP: num_args= %x failed +902,IIIII,[ wlan_beacon_tx_offload.c : 3168 ] QUIET IE AP: vdev_id= %x period = %x duration = %x off = %x flag = %x +901,iiiiii,[ wlan_beacon_tx_offload.c : 375 ] OPTDBG: vdevid:%d, vdev chan_idx:%d, vdev opclass:%d, regdomain:%d, rnr opclass: %d, rnr_chidx:%d +900,iIIi,[ wlan_beacon_tx_offload.c : 699 ] BCN_TMPL_CMDID: dtim_count_tmpl0:%d, nonTxVdevMap: 0x%x 0x%x Cur_idx:%d +899,iiii,[ wlan_beacon_tx_offload.c : 732 ] MBSS : BCN_TMPL_CMDID: TMPL0: %d DTIM: %d Cur_pp_index: %d PP:%d + +898,iii,[ wlan_beacon_tx_offload.c : 758 ] BCN_TMPL_CMDID: dtim_count:%d, pp:%d new_pp_eff_in_bcn:%d +897,,[ wlan_beacon_tx_offload.c : 3020 ] WOW_PROBE_RESP_TX: wps ie recv, wakeup host +896,Ii,[ wlan_beacon_tx_offload.c : 3040 ] WOW_PROBE_RESP_TX offload flags = 0x%x enabled = %d +895,,[ wlan_beacon_tx_offload.c : 299 ] QUIET IE AP_swba: BCN_CTXT Null +894,I,[ wlan_beacon_tx_offload.c : 304 ] QUIET IE AP_swba: SWBA Enable value = %x +893,I,[ wlan_beacon_tx_offload.c : 309 ] QUIET IE AP_swba: SWBA disable value = %x +892,ii,[ wlan_beacon_tx_offload.c : 2647 ] WOW_PROBE_RESP_TX: Err sending probe response not on home channel vdev home channel = %d, mac cahnnel = %d +891,,[ wlan_beacon_tx_offload.c : 2787 ] WOW_PROBE_RESP_TX: send probe resp +931,iii,[ wlan_nth_beacon_offload.c : 59 ] wlan_nth_bcn_ctx_deint nth_value = %d, timer_status = %d, is_nth_beacon_enable = %d +930,iii,[ wlan_nth_beacon_offload.c : 120 ] wlan_nth_bcn_ofld_run_timer error can't start timer nvalue = %d, ifup = %d, active = %d +929,iiiiiIII,[ wlan_nth_beacon_offload.c : 173 ] wlan_nth_bcn_ofld_run_timer timeout_val_ms = %d, nvalue = %d, status = %d, is_nth_beacon_enable = %d, drift_ms = %d, next_tbtt = 0x%x, cur_tsf =0x%x bi_us = 0x%x +928,iiiii,[ wlan_nth_beacon_offload.c : 339 ] wlan_nth_beacon_ofld_handler bcn received n_value = %d, nth_ctx->tmr_status = %d, is_nth_beacon_enable = %d, WOW_STATE = %d , host_wake_alwd = %d +927,,[ wlan_nth_beacon_offload.c : 211 ] nth beacon vdev notification registration failed +926,iii,[ wlan_nth_beacon_offload.c : 222 ] wlan_nth_beacon_to_host_ofld_init nth_value = %d, timer_status = %d, is_ofld_active = %d +925,iii,[ wlan_nth_beacon_offload.c : 260 ] wlan_update_value_nth_bcn_ofld nth_value = %d, timer_ststus = %d, is_ofld_active = %d +932,iiiii,[ wlan_nth_beacon_offload_unit_test.c : 26 ] wlan_nth_bcn_offload_unit_test num_args = %d, args[0] = %d, args[1] = %d, vdev_id = %d, ifUp = %d +949,Ii,[ csa_offload_main.c : 531 ] _csa_action_frame_handler: wbw_ie 0x%x len: %d +948,II,[ csa_offload_main.c : 56 ] CSA_OFFLOAD_WMI_CHANSWITCH_RECV cur_ch_freq=0x%x new_ch_freq=0x%x +947,,[ csa_offload_main.c : 674 ] pause disable +946,II,[ csa_offload_main.c : 136 ] CSA_OFFLOAD_CSA_TIMER_ERROR vdev_id=0x%x state=0x%x +945,iII,[ csa_offload_main.c : 148 ] CSA_OFFLOAD_CSA_TIMER_ERROR vdev_id = %d csa_proc/bcn_tsf=0x%x curr_tsf=0x%x +944,iII,[ csa_offload_main.c : 158 ] CSA_OFFLOAD_CSA_TIMER_EXP vdev_id = %d csa_proc=0x%x curr_tsf=0x%x +943,IIII,[ csa_offload_main.c : 709 ] _csa_vdev_notif_handler: enable:%x pause_until_beacon:%x, csa state:%x, notify:%x + +942,II,[ csa_offload_main.c : 722 ] csa vdev_start notif,csa ch freq:0x%x, prev csa ch freq:0x%x +941,III,[ csa_offload_main.c : 289 ] csa handle ie: enable:%x pause_until_beacon:%x, csa state:%x + +940,iIIiII,[ csa_offload_main.c : 322 ] CSA_OFFLOAD_BEACON_CSA_RECV, XCSA_IE vdev_id = %d tbtt_cnt=0x%x, curr_chan_freq :0x%x, csa_chan %d csa_freq:0x%x, prev csa ch freq:0x%x +939,iIIiII,[ csa_offload_main.c : 338 ] CSA_OFFLOAD_BEACON_CSA_RECV, CSA_IE vdev_id = %d tbtt_cnt=0x%x, curr_chan_freq :0x%x, csa_chan %d csa_freq:0x%x, prev csa ch freq:0x%x +938,iI,[ csa_offload_main.c : 347 ] CSA_OFFLOAD_CSA_RECV_ERROR_IE vdev_id = %d tbtt_cnt=0x%x +937,iIi,[ csa_offload_main.c : 400 ] CSA_OFFLOAD_CSA_RECV_ERROR_IE vdev_id = %d tbtt_cnt=0x%x csa_ies_valid = %d +936,i,[ csa_offload_main.c : 431 ] CSA_OFFLOAD_CSA_RECV_ERROR_IE: CSWRAP IE len: %d +935,I,[ csa_offload_main.c : 453 ] pause vdev, csa:%x +934,iii,[ csa_offload_main.c : 267 ] csa_check_ies_valid chan_valid = %d, tbtt_valid = %d pcl = %d +933,iI,[ csa_offload_main.c : 118 ] CSA_OFFLOAD_WMI_EVENT_ERROR vdev_id = %d csa_proc=0x%x +950,i,[ obss_offload_api.c : 104 ] bss color: SCAN_SCH_START_ALLOC_FAIL, %d +972,i,[ bss_color_offload_int.c : 697 ] bss color offload: not support: vdev id:%d +971,ii,[ bss_color_offload_int.c : 705 ] bss color offload: vdev id:%d, enable=%d +970,iii,[ bss_color_offload_int.c : 86 ] bss color chg ie: new_bss_color=%d countdown=%d remain_time_us=%d +969,ii,[ bss_color_offload_int.c : 119 ] bss color he op ie: new_rts_thres=%d curr_rts_thres=%d +968,i,[ bss_color_offload_int.c : 651 ] bss color: bss clr chg timeout hdlr vdev_id=%d +967,iii,[ bss_color_offload_int.c : 265 ] bss color he op ie: bcn_bss_color=%d bss_color_disabled=%d curr_bss_color=%d +966,i,[ bss_color_offload_int.c : 504 ] bss color: scan_evt_handler evt->type = %d +965,,[ bss_color_offload_int.c : 558 ] BSS COLOR: SCAN_START_COMMAND_FAILED, vdev bss NULL +964,i,[ bss_color_offload_int.c : 605 ] BSS COLOR: SCAN_START_COMMAND_FAILED, %d +963,i,[ bss_color_offload_int.c : 626 ] 11d: STOP_COMMAND_FAILED, %d +962,iii,[ bss_color_offload_int.c : 455 ] bss color: check color collision detection vdev_id=%d vdev_mode=%d col_detect=%d +961,iii,[ bss_color_offload_int.c : 484 ] bss color: check color collision detection evt_type=%d free_slot_timer=%d det_period=%d +960,iii,[ bss_color_offload_int.c : 159 ] bss color action: iv_len=%d, category=%d, code=%d +959,i,[ bss_color_offload_int.c : 723 ] bss color offload: not support: vdev id:%d +958,ii,[ bss_color_offload_int.c : 743 ] bss color offload: collision det cmd: vdev id:%d, evt_type=%d +957,iii,[ bss_color_offload_int.c : 749 ] bss color vdev cfg: det_per=%d scan_per=%d expiry_per=%d +956,i,[ bss_color_offload_int.c : 670 ] bss color: obss clr colli det timeout hdlr vdev_id=%d +955,ii,[ bss_color_offload_int.c : 357 ] bss color: Send evt report vdevId=%d, tx_status=%d +954,ii,[ bss_color_offload_int.c : 378 ] bss color: event report fails in wow, vdev id:%d, evt_type:%d +953,iiII,[ bss_color_offload_int.c : 403 ] bss color: event report,vdev id:%d, evt_type:%d, color bitmap:32to63 0x%x 0to31 0x%x +952,i,[ bss_color_offload_int.c : 436 ] bss color: restart color collision detection vdev_id=%d +951,i,[ bss_color_offload_int.c : 414 ] bss color: stop color collision detection vdev_id=%d +974,i,[ bss_color_offload_unit_test.c : 94 ] bss_color ofld unit test fails: bss_color vdev not exist id:%d +973,iiii,[ bss_color_offload_unit_test.c : 105 ] bss color ofld unit test: args %d %d %d %d +976,i,[ obss_offload_priv.c : 64 ] bss color: len wrong:%d +975,ii,[ obss_offload_priv.c : 73 ] bss color: wrong type:%d, sub:%d +991,iii,[ wlan_quiet_ie_ap.c : 107 ] QUIET IE AP: timer cb-next evt:%d, cac:%d, paused:%d +990,I,[ wlan_quiet_ie_ap.c : 131 ] QUIET IE AP: quiet duration time-usec:0x%x +989,i,[ wlan_quiet_ie_ap.c : 59 ] QUIET IE AP: vdev init vdevId=%d +988,II,[ wlan_quiet_ie_ap.c : 232 ] QUIET IE AP: not appending quiet IE. time_to_quite_period_start = 0x%x, time_to_bcn_tx = 0x%x +987,iIIi,[ wlan_quiet_ie_ap.c : 276 ] QUIET IE AP: append quiet IE, tbtt cnt=%d dur=0x%x offset=0x%x len=%d +986,iiI,[ wlan_quiet_ie_ap.c : 188 ] QUIET IE AP: bi_us=%d diff=%d curr_wal_time=0x%x +985,iiii,[ wlan_quiet_ie_ap.c : 313 ] QUIET IE AP: start quiet IE: module id=%d, vdev id=%d, dur=%d, beaconing_cnt=%d +984,i,[ wlan_quiet_ie_ap.c : 324 ] QUIET IE AP: start quiet IE: input duration out of range, duration_us = %d +983,,[ wlan_quiet_ie_ap.c : 335 ] QUIET IE AP: cancel current quiet IE config +982,III,[ wlan_quiet_ie_ap.c : 380 ] QUIET IE AP: quiet IE Start time=0x%x Curr_time=0x%x timeout=0x%x +981,iiii,[ wlan_quiet_ie_ap.c : 454 ] QUIET IE AP: test input num_args=%d vdevId=%d dur=%d cnt=%d +980,,[ wlan_quiet_ie_ap.c : 463 ] QUIET IE AP: test cfg fail +979,I,[ wlan_quiet_ie_ap.c : 466 ] QUIET IE AP: test cfg success start_time=0x%x +978,i,[ wlan_quiet_ie_ap.c : 444 ] QUIET IE AP: test cb status=%d +977,iii,[ wlan_quiet_ie_ap.c : 423 ] QUIET IE AP: post migration,vdevId:%d, cac:%d, vdevPaused:%d +1004,IiiiiI,[ wlan_quiet_ie_sta.c : 141 ] QUIET IE STA, time-usec:0x%x, vdevId=%d, evt:%d, all_tids_tx_blocked:%d, supend_alwd:%d, period:0x%x +1003,iiiii,[ wlan_quiet_ie_sta.c : 232 ] QUIET IE STA: vdevId=%d, next_start=%d, period=%d, duration=%d, quiet_enabled=%d +1002,,[ wlan_quiet_ie_sta.c : 237 ] QUIET IE STA: cancel current quiet IE config +1001,Ii,[ wlan_quiet_ie_sta.c : 273 ] QUIET IE STA: Quiet period starts in=0x%x, vdevId=%d +1000,iiii,[ wlan_quiet_ie_sta.c : 327 ] QUIET IE STA: test input num_args=%d vdevId=%d dur=%d per=%d +999,,[ wlan_quiet_ie_sta.c : 332 ] QUIET IE STA: test cfg, vdev is NULL +998,,[ wlan_quiet_ie_sta.c : 337 ] QUIET IE STA: test cfg, vdev not up or incorrect mode +997,,[ wlan_quiet_ie_sta.c : 354 ] QUIET IE STA: test cfg fail +996,,[ wlan_quiet_ie_sta.c : 357 ] QUIET IE STA: test cfg success +995,IiiiiIi,[ wlan_quiet_ie_sta.c : 396 ] QUIET IE STA: PS SM callback , time-usec:0x%x, vdevId=%d, next_evt:%d, all_tids_tx_blocked:%d, supend_alwd:%d, period:0x%x, sleep = %d +994,IIIII,[ wlan_quiet_ie_sta.c : 437 ] QUIET IE STA: time_diff_us = 0x%x , current_quite_ie = 0x%x, sum =0x%x, ref_time = 0x%x, curr_ts=0x%x +993,Ii,[ wlan_quiet_ie_sta.c : 460 ] QUIET IE STA: wake recved in ON period timer:0x%x, nxt_evnt:%d +992,Ii,[ wlan_quiet_ie_sta.c : 474 ] QUIET IE STA: wake recved in OFF period timer:0x%x, nxt_evnt:%d +1009,,[ wlan_hw_data_filtering.c : 264 ] Add NON ARP BC CCE filter +1008,,[ wlan_hw_data_filtering.c : 268 ] Delete NON ARP BC CCE filter +1007,,[ wlan_hw_data_filtering.c : 320 ] Add NON ICMPv6 MC CCE filter +1006,,[ wlan_hw_data_filtering.c : 324 ] Delete NON ICMPv6 MC CCE filter +1005,iiiiii,[ wlan_hw_data_filtering.c : 65 ] OFFLOAD HDLR CCE UNIT TEST CMD: num_args=%d vdevId=%d args =%d %d %d %d +1011,i,[ offload_unit_test.c : 128 ] OFFLOAD HDLR UNIT TEST: status = %d +1010,iii,[ offload_unit_test.c : 173 ] Offload unit test input: vdevid:%d, group=%d, type=%d +1012,II,[ wlan_pps.c : 124 ] PPS wmi_set_vdev_pkt_pwr_save: old:0x%x, new:0x%x +1152,,[ wlan_rtt.c : 11076 ] wlan_internal_disable_responder +1151,,[ wlan_rtt.c : 665 ] Event buffer allocation for cancel measurement response failed +1150,iii,[ wlan_rtt.c : 4585 ] wlan_oem_rtt_measreq_hdl: client %d running. cannot new req from client: %d. So Dropping req_id: %d +1149,i,[ wlan_rtt.c : 4608 ] wlan_oem_rtt_measreq_hdl: Request with id %d won't be served because of an error +1148,i,[ wlan_rtt.c : 4640 ] wlan_oem_rtt_measreq_hdl: asm_req status %d would be served from call back due to NACK +1147,IIII,[ wlan_rtt.c : 10853 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1146,IIII,[ wlan_rtt.c : 10913 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1145,IIII,[ wlan_rtt.c : 10924 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1144,iIi,[ wlan_rtt.c : 1020 ] wlan_rtt_band_change_req_init_cb: event: %d init_ctxt: %p rtt_2g: %d +1143,IIII,[ wlan_rtt.c : 1056 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1142,,[ wlan_rtt.c : 3192 ] RTT_CALL_FLOW: WLAN_RTT_BEACON_RX +1141,iiiiiiii,[ wlan_rtt.c : 4854 ] wlan_rtt_burst_instance_done: num_burst_done:%d total_bursts:%d curr_state:%d burst_duration:%d, index:%d ftm1_done:%d num_meas:%d ftm_per_burst:%d +1140,,[ wlan_rtt.c : 4961 ] Wait for NAN module to finish sending NAN ranging termination frame +1139,iI,[ wlan_rtt.c : 11195 ] wlan_rtt_cancel_all_rtt_operation attached to vdev_id: %d p_pdev_rtt_ctxt: %p +1138,iiiiii,[ wlan_rtt.c : 3782 ] wlan_rtt_cap_msg_req_hdl: client_id: %d Req:%d Reqid:%d Major:%d Minor:%d Revision:%d +1137,,[ wlan_rtt.c : 3797 ] Event buffer allocation for wlan_rtt_cap_msg_req response failed +1136,iIII,[ wlan_rtt.c : 7412 ] RTT_CHANNEL_SWITCH_GRANT ev_id = %d p_chnl_switch_ctxt = 0x%x p_owner = 0x%x p_rtt_ctxt = 0x%x +1135,,[ wlan_rtt.c : 3149 ] RTT_CALL_FLOW: WLAN_RTT_DFS_EXIT +1134,IIII,[ wlan_rtt.c : 10545 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1133,ii,[ wlan_rtt.c : 3310 ] wlan_rtt_dfs_chan_init_handler rtt_ctxt->chnl_switch_ctxt.cb_fn %d rtt_ctxt->chnl_switch_ctxt.owner%d +1132,iII,[ wlan_rtt.c : 3337 ] RTT_CHANNEL_DFS_SWITCH_HDL ev = %d sw_ctxt->arg = %p sw_ctxt->cb_fn %p +1131,,[ wlan_rtt.c : 3132 ] RTT_CALL_FLOW: WLAN_RTT_DFS_TIMEOUT_HANDLER +1130,iiii,[ wlan_rtt.c : 7636 ] RTT_CHANNEL_SWITCH_REQ module_id %d duration = %d channel = %d priority = %d +1129,I,[ wlan_rtt.c : 1921 ] wlan_rtt_free_init_ctxt() usage flags = 0x%x +1128,II,[ wlan_rtt.c : 1958 ] Unregistered wlan_rtt_vdev_notify_handler() for init context vdev = %p status = 0x%x +1127,IIiiiii,[ wlan_rtt.c : 6411 ] wlan_rtt_ftm_init_burst_periodic_timeout: dest_mac:%x%x is_multiburst(%d) is_repetitive_ss(%d) current_burst:%d total_bursts:%d curr_state: %d +1126,iII,[ wlan_rtt.c : 6467 ] wlan_rtt_ftm_init_burst_periodic_timeout: ERR: Some other request is in progress; skip current burst %d for dest_mac:%x%x +1125,II,[ wlan_rtt.c : 6499 ] Init PTSF fired resp_tsf_h = 0x%x resp_tsf_l = 0x%x +1124,iii,[ wlan_rtt.c : 6383 ] wlan_rtt_ftm_resp_burst_timeout: ftm_state: %d num_burst_exp: %d no_burst_count: %d +1123,II,[ wlan_rtt.c : 11158 ] wlan_rtt_get_clear_stats ranging_dur: %x resp_dur: %x +1122,iii,[ wlan_rtt.c : 5206 ] wlan_rtt_get_ftm_chnl_code bw:%d preamble:%d phy_mode:%d +1121,,[ wlan_rtt.c : 5659 ] RTT_ERROR_REPORT :RTT_RESP_CTXT_EXIST +1120,,[ wlan_rtt.c : 5690 ] RTT_ERROR_REPORT :RTT_RESP_REQ_ACCEPT +1119,,[ wlan_rtt.c : 5700 ] RTT_ERROR_REPORT :RTT_RESP_BUSY +1118,IIiIIiII,[ wlan_rtt.c : 3595 ] wlan_rtt_init_handler: Starting initiator with mac_addr = %08x%02x init_idx = %d init_ctxt_usage_flags = 0x%x pmac: %p mac_id: %d vdev: %p rate_info: 0x%x +1117,,[ wlan_rtt.c : 3600 ] RTT request on a different vdev than the one set during channel change +1116,IiI,[ wlan_rtt.c : 3622 ] Registered wlan_rtt_vdev_notify_handler() for init context : vdev = %p vdevid = %d status = 0x%x +1115,iii,[ wlan_rtt.c : 7317 ] vdev mac id(%d) not same as pmac mac id(%d): change PM lock & set mac address: %d +1114,iiiiI,[ wlan_rtt.c : 7336 ] Channel Granted(Initiator): RTT requested freq: %d phymode: %d Grant came on freq: %d phymode: %d chan_flags: 0x%04x +1113,iII,[ wlan_rtt.c : 7369 ] Downgraded the BW: New bw: %d chnl_format: %u rate_info: %u +1112,II,[ wlan_rtt.c : 2059 ] wlan_rtt_init_scheduler => curr_init:0x%x init_ctxt_usage_flags:0x%x +1111,ii,[ wlan_rtt.c : 2094 ] wlan_rtt_init_scheduler => diff1:%d diff2:%d +1110,i,[ wlan_rtt.c : 2124 ] wlan_rtt_init_scheduler => next_mb_slot_index:%d +1109,i,[ wlan_rtt.c : 2169 ] wlan_rtt_init_scheduler: Skipping initiator with index %d as it may creep into next multiburst start time +1108,iiii,[ wlan_rtt.c : 2186 ] wlan_rtt_init_scheduler => index:%d curr_index:%d schedule_timeout:%d next_mb_slot_index: %d +1107,iiiiiiiI,[ wlan_rtt.c : 2747 ] RTT_MEAS_REQ_HEAD ch_mhz = %d, center_freq1 = %d ch_mode = %d sta_num:%d, max_reg_power: %d antenna_max: %d, max_tx_power: %d, ch_flags: 0x%04x +1106,IIIII,[ wlan_rtt.c : 10231 ] Received FTMR resp_tsf_h = 0x%x resp_tsf_l = 0x%x curslot_slot_idx: 0x%x cur_diff: 0x%x resp_ref_tsf: 0x%x +1105,III,[ wlan_rtt.c : 10248 ] wlan_rtt_is_burst_in_slot: diff_tesf: %u next_burst_tsf: %u cur_tsf: %u +1104,IIII,[ wlan_rtt.c : 7696 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1103,iiiIIii,[ wlan_rtt.c : 7751 ] wlan_rtt_local_send()status: %d pmac_mac_id: %d vdev_mac_id: %d selfgen_chm: 0x%x abf: %p peer_type: %d vdev_id: %d +1102,IIIII,[ wlan_rtt.c : 5182 ] RTT_FTM_PARAM_INFO arg1 = 0x%x arg2 = 0x%x arg3 = 0x%x arg4 = 0x%x arg5 = 0x%x +1101,iiii,[ wlan_rtt.c : 2892 ] RTT_MEAS_REQ_HEAD req_id = %d num_chan = %d sps = %d client: %d +1100,iIii,[ wlan_rtt.c : 7061 ] wlan_rtt_measurement_report: client_id: %d curr_init_ctxt:%p size: %d freq: %d +1099,iII,[ wlan_rtt.c : 10395 ] nan_ranging_terminate_completion_handler: req_id: %d init_ctxt: %p wait_status: %x +1098,i,[ wlan_rtt.c : 10418 ] nan_ranging_terminate_completion_handler for req_id: %d is not processed !!! +1097,iiii,[ wlan_rtt.c : 8811 ] RTT Null frame Tx status: %d tx_fail_count: %d num_meas: %d terminate: %d +1096,I,[ wlan_rtt.c : 8556 ] RTT add_random_mac_addr failed. status: 0x%x +1095,i,[ wlan_rtt.c : 4072 ] _wlan_wmi_oem_req: Non TLV format msg received; tlv_head: %d +1094,iii,[ wlan_rtt.c : 4089 ] wlan_wmi_oem_req: INFO: OEM Req received with sub_type:%d, req_id:%d client: %d +1093,ii,[ wlan_rtt.c : 3091 ] wlan_rtt_pm_arb_req(): mac_id: %d state: %d +1092,IIIIII,[ wlan_rtt.c : 5553 ] wlan_rtt_populate_resp_ftm_param: next_sched_tsf: %u resp_ref_tsf: %u partial_tsf: %u diff_tsf: %u current_resp_tsf64: 0x%08x%08x +1091,IIIIII,[ wlan_rtt.c : 5582 ] wlan_rtt_populate_resp_ftm_param: next_sched_tsf: %u diff_tsf: %u nearest_tsf: %u resp_partial_tsf: %u next_burst_tsf: 0x%08x%08x +1090,II,[ wlan_rtt.c : 5637 ] wlan_rtt_populate_resp_ftm_param: ftm_param.burst_period: %u resp_param_info.burst_period: %u +1089,Ii,[ wlan_rtt.c : 498 ] wlan_rtt_proceed: init_ctxt: %p wait_status: %d +1088,iIIIIIIII,[ wlan_rtt.c : 2693 ] RTT_MEAS_REQ_BODY idx = %d dest_mac_0to31 = 0x%x dest_mac_32to47 = 0x%x sppof_bssid_0to31 = 0x%x spoof_bssid_32to47 = 0x%x control_inf = 0x%x meas_inf = 0x%x meas_params1 = 0x%x meas_params2 = 0x%x +1087,IIIII,[ wlan_rtt.c : 10493 ] wlan_rtt_ranging_negotiation_status_notif_handler: timeout_us:%u burst_start_time_h:%u burst_start_time_l:%u StartTsf:%u curr_time%u +1086,iIi,[ wlan_rtt.c : 10519 ] wlan_rtt_ranging_negotiation_status_notif_handler: ranging_ind_data->RangingParams.ReqId %d init_ctxt %p event_handled %d +1085,IIII,[ wlan_rtt.c : 10669 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1084,iii,[ wlan_rtt.c : 7238 ] wlan_rtt_resp_chan_switch_hdl() ev_id = %d ftm_state:%d is_ftmr_pending:%d +1083,II,[ wlan_rtt.c : 3058 ] Unregistered wlan_rtt_vdev_notify_handler() for resp context vdev = %p status = 0x%x +1082,IIIII,[ wlan_rtt.c : 10188 ] wlan_rtt_resp_free_existing_slot 0x%x 0x%x 0x%x dest_mac:%08x%02x +1081,iiI,[ wlan_rtt.c : 6310 ] wlan_rtt_resp_ftm1_timeout: ftm_state: %d asap: %d resp_ctxt: %p +1080,IIIIIIII,[ wlan_rtt.c : 10174 ] wlan_rtt_resp_get_free_slot 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x dest_mac:%08x%02x +1079,ii,[ wlan_rtt.c : 6144 ] wlan_rtt_resp_init:current session is active: session_index: %d slot: %d +1078,ii,[ wlan_rtt.c : 6155 ] wlan_rtt_resp_init: Received a frame which we are not in slot send FTM stop frame. session_index: %d slot: %d +1077,iii,[ wlan_rtt.c : 6020 ] wlan_rtt_resp_init_body: session_active: %d init_new_session: %d ftm_state: %d +1076,iii,[ wlan_rtt.c : 6024 ] wlan_rtt_resp_init_body: asap: %d ftm_state: %d session_active: %d +1075,iiI,[ wlan_rtt.c : 6058 ] wlan_rtt_resp_init_body:ftm_state: %d asap: %d resp_ctxt: %p +1074,III,[ wlan_rtt.c : 6083 ] wlan_rtt_resp_init_body: ftm_state: %u asap: %u resp_ctxt: %p +1073,IiII,[ wlan_rtt.c : 5830 ] Registered wlan_rtt_vdev_notify_handler() for resp context vdev: %p vdev_type: %d pmac: %p status: 0x%x +1072,IIII,[ wlan_rtt.c : 5954 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1071,ii,[ wlan_rtt.c : 5969 ] wlan_rtt_resp_init_new_session: slot: %d param_info.status: %d +1070,iiI,[ wlan_rtt.c : 5978 ] END_FTM_INVALID_REQUEST: ftm_state: %d asap: %d resp_ctxt: %p +1069,iiiiiiii,[ wlan_rtt.c : 5441 ] wlan_rtt_resp_init_rate: vdev_id: %d phy_mode: %d mhz: %d ftm_chnl_format: %d param_ie_valid: %d tx_bw: %d tx_preamble: %d mcs: %d +1068,IIIi,[ wlan_rtt.c : 7221 ] Channel Granted(Responder): Responder operating freq = 0x%x pmac = %p Granted on freq: 0x%x phymode: %d +1067,ii,[ wlan_rtt.c : 10334 ] wlan_rtt_resp_house_keeping: channel_mhz: %d nearest_sched_resp_tsf_ctxt_index: %d +1066,,[ wlan_rtt.c : 2269 ] All requests done nothing to schedule +1065,IIII,[ wlan_rtt.c : 1691 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1064,iiiI,[ wlan_rtt.c : 6910 ] RTT_ERROR_WMI_EVENT: ERROR: client_id: %d req_id:%d reason:%d init_ctxt: %p +1063,,[ wlan_rtt.c : 6954 ] Event buffer allocation for send_rtt_error_report failed +1062,iIiiiIi,[ wlan_rtt.c : 7111 ] wlan_rtt_send_measurement_report_hdl: client_id: %d curr_init_ctxt: %p token_id:%d frag_idx:%d more_frag: %d buf:%p buf_len:%d +1061,IIIi,[ wlan_rtt.c : 7816 ] wlan_rtt_send_null_frame: abf: %p channel: %x pmac = %p spoofed_seqno = %d +1060,Ii,[ wlan_rtt.c : 7834 ] RTT NULL frame Tx failed: abf: %p ret: %d +1059,,[ wlan_rtt.c : 8339 ] wlan_rtt_send_tm_frame: vdev is seen as NULL in resp_ctxt +1058,,[ wlan_rtt.c : 8493 ] RTT_ERROR_REPORT :ALLOCATE_FRAME_BUFFER_ERROR +1057,IiIIiiiiI,[ wlan_rtt.c : 8502 ] wlan_rtt_send_tm_frame: abf: %p freq: %d pmac = %p resp_ctxt: %p tkn = %d follow_tkn = %d tx_bw = %d resp_ctxt ftm state = %d chan_flags = 0x%04x +1056,II,[ wlan_rtt.c : 8177 ] Sending RTT Trigger frame resp_tsf_h = 0x%x resp_tsf_l = 0x%x +1055,,[ wlan_rtt.c : 8208 ] RTT_ERROR_REPORT :ALLOCATE_FRAME_BUFFER_ERROR +1054,IIi,[ wlan_rtt.c : 8232 ] wlan_rtt_send_tmr_frame: channel: %x pmac = %p spoofed_seqno = %d +1053,,[ wlan_rtt.c : 8273 ] RTT_TIMER_STOP +1052,I,[ wlan_rtt.c : 8022 ] RTT_CALL_FLOW: WLAN_RTT_SET_VENDOR_IE_HT_VHT_ACK ts = %u +1051,iii,[ wlan_rtt.c : 11038 ] wlan_rtt_sta_resp_chan_switch: channel.mhz: %d band_center_freq1: %d phy_mode: %d +1050,IIII,[ wlan_rtt.c : 10965 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1049,i,[ wlan_rtt.c : 1507 ] wlan_rtt_start_burst_periodic_timer: timeout_ms:%dms +1048,iIIi,[ wlan_rtt.c : 1261 ] wlan_rtt_terminate_all_ftm_resp_context() idx: %d resp_ctxt = %p vdev = %p ftm_state = %d +1047,iiii,[ wlan_rtt.c : 1339 ] cancel_measurement_req: vdev_type: %d, req_id: %d, free_curr_init: %d, is_cancelled: %d +1046,iIII,[ wlan_rtt.c : 2027 ] wlan_rtt_terminate_repetitive_ss_request: red_id:%d init_ctxt_usage_flags:0x%x dest_mac :%x %x +1045,iii,[ wlan_rtt.c : 1210 ] wlan_rtt_terminate_resp_context() state: %d busrt_exp: %d burst_count: %d +1044,iii,[ wlan_rtt.c : 9125 ] wlan_rtt_tm_ack_handle_completion: ftm_state: %d num_burst_exp: %d no_burst_count: %d +1043,IiIII,[ wlan_rtt.c : 9157 ] wlan_rtt_tm_ack_handle_completion: init_ftmr_rx_ts: %10u completion_status: %d ftm_tx_ts: %10u init_ftmr_offset: %6u delta_ftm_act: %6u +1042,i,[ wlan_rtt.c : 9239 ] RTT TM frame Tx status: %d +1041,i,[ wlan_rtt.c : 9186 ] RTT_TWOSIDED_RESP_CNT number = %d +1040,iii,[ wlan_rtt.c : 9206 ] wlan_rtt_tm_ack_success: ftm_state: %d num_burst_exp: %d no_burst_count: %d +1039,iii,[ wlan_rtt.c : 9211 ] wlan_rtt_tm_ack_success:Don't continue burst: ftm_state: %d num_burst_exp: %d no_burst_count: %d +1038,iIIiIII,[ wlan_rtt.c : 9590 ] state = %d tsf_sync_info = 0x%x resp_tsf = 0x%x Diff: %d ftm_req_start_time = 0x%x ftm_req_complete_time = 0x%x current_tsf = 0x%x +1037,II,[ wlan_rtt.c : 9601 ] RTT TM FTM curr_tsf_delta = 0x%x new_tsf_delta = 0x%x +1036,IIII,[ wlan_rtt.c : 9680 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1035,,[ wlan_rtt.c : 9777 ] RTT_ERROR_REPORT :TM_TOKEN_MISMATCH +1034,,[ wlan_rtt.c : 9780 ] RTT_ERROR_REPORT :TM_CFR_CAPTURE_ERROR +1033,,[ wlan_rtt.c : 9782 ] RTT_ERROR_REPORT :TM_SEQUENCE_RESTART +1032,,[ wlan_rtt.c : 9836 ] RTT_ERROR_REPORT :RTT_GET_TM_NOTWAIT_TM +1031,,[ wlan_rtt.c : 9854 ] RTT_ERROR_REPORT :RTT_GET_TM_NOTWAIT_TM +1030,IIiIIII,[ wlan_rtt.c : 9937 ] wlan_rtt_tm_rx_hdl: status: 0x%x RTT_TWOSIDED_RESP_CNT number = %2d recv_state: %d init_ftmr_tx_ts: %10u ftm_rx_ts: %10u init_ftmr_offset: %6u delta_ftm_act: %6u +1029,IIII,[ wlan_rtt.c : 7921 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1028,IIII,[ wlan_rtt.c : 7928 ] RTT_REPORT arg1 = 0x%x arg2 = 0x%x arg3 = x%x arg4 = 0x%x +1027,I,[ wlan_rtt.c : 8654 ] RTT add_random_mac_addr failed. status: 0x%x +1026,,[ wlan_rtt.c : 9465 ] rtt_tmr_rx_hdl() vdev not found +1025,,[ wlan_rtt.c : 9471 ] rtt_tmr_rx_hdl() wal_vdev not found +1024,II,[ wlan_rtt.c : 9507 ] rtt_tmr_rx_hdl() ftmr_rx_ts: %10u begin_tsf_sap_resp: %10u +1023,,[ wlan_rtt.c : 9526 ] RTT_ERROR_REPORT :RTT_GET_INVALID_TMR_STOP +1022,,[ wlan_rtt.c : 9546 ] RTT_ERROR_REPORT :RTT_GET_INVALID_TMR_STOP +1021,iiI,[ wlan_rtt.c : 8872 ] RTT TMR frame Tx status: %d curr_state: %d ftmr_tx_ts: %u +1020,iiii,[ wlan_rtt.c : 4238 ] RTT_UNIT_TEST_CMD 1 num_args = %d arg0 = %d vdev_id = %d mac_id = %d +1019,iiiiii,[ wlan_rtt.c : 4301 ] RTT_UNIT_TEST_CMD numFrms= %d ChnlFrmt= %d frmType= %d reportType= %d burstDr= %d asap_mode= %d +1018,i,[ wlan_rtt.c : 4530 ] RTT_UNIT_TEST_CMD 2 status = %d +1017,,[ wlan_rtt.c : 4278 ] MAC address not configured +1016,,[ wlan_rtt.c : 4289 ] Channel not configured +1015,Iii,[ wlan_rtt.c : 1433 ] wlan_rtt_vdev_notify_handler() vdev = %p vdev_id = %d notification type = %d +1014,,[ wlan_rtt.c : 10724 ] Event buffer allocation for send_responder_cfg_info response failed +1013,iiIii,[ wlan_rtt.c : 7015 ] wmi_send_rtt_error_report_event: req_id: %d reason: %d init_ctxt: %p vdev_type: %d nan_req_active: %d +1178,iIii,[ wlan_rtt_tlv_helper.c : 190 ] RTTTLV_CHECK_AND_PAD_TLVS is_req = %d buf_ptr = 0x%x buf_len = %d sub_type = %d +1177,i,[ wlan_rtt_tlv_helper.c : 194 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Couldn't get expected number of TLVs for sub_type=%d + +1176,iiiiii,[ wlan_rtt_tlv_helper.c : 214 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Invalid TLV length for sub_type=%d Tag_order=%d buf_idx=%d Tag:%d Len:%d TotalLen:%d + +1175,ii,[ wlan_rtt_tlv_helper.c : 223 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: No TLV attributes found for sub_type=%d Tag_order=%d + +1174,iii,[ wlan_rtt_tlv_helper.c : 228 ] RTTTLV_CHECK_AND_PAD_TLVS: VERBOSE: [tlv %d]: tag=%d, len=%d + +1173,iii,[ wlan_rtt_tlv_helper.c : 241 ] RTTTLV_CHECK_AND_PAD_TLVS: VERBOSE: Tag ID expecting is Loop end for loop started at index %d but received tag %d.num_active_loops: %d +1172,iii,[ wlan_rtt_tlv_helper.c : 247 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Can't get the first TLV Tag ID (tlv_index:%d) for last entered loop start (cnt=%d) for sub_type=%d + +1171,iiii,[ wlan_rtt_tlv_helper.c : 255 ] RTTTLV_CHECK_AND_PAD_TLVS: WARN: First TLV Tag ID (%d) for last entered loop start (index=%d) doesn't match; skipping this tlv with tag:%d for sub_type=%d +1170,iiiii,[ wlan_rtt_tlv_helper.c : 262 ] RTTTLV_CHECK_AND_PAD_TLVS: VERBOSE: First TLV Tag ID (tlv_index:%d) for last entered loop start (total_active_loops=%d) matched (looping loop_cnt:%d) with tag:%d for sub_type=%d +1169,iii,[ wlan_rtt_tlv_helper.c : 278 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: TLV has wrong tag in order for sub_type=%d. Given=%d, Expected=%d. + +1168,iii,[ wlan_rtt_tlv_helper.c : 284 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: TLV has wrong tag in order for sub_type=%d. Given=%d, Expected=%d. + +1167,ii,[ wlan_rtt_tlv_helper.c : 292 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Wrong TLV length %d for loop end for sub_type:%d +1166,i,[ wlan_rtt_tlv_helper.c : 297 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Loop start and End mismatch for sub_type:%d +1165,iiii,[ wlan_rtt_tlv_helper.c : 305 ] RTTTLV_CHECK_AND_PAD_TLVS: VERBOSE: Processing of loop %d done for sub_type:%d; left out loop instances:%d TLVs per loop:%d +1164,iii,[ wlan_rtt_tlv_helper.c : 320 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Exceeded given max loop count %d, for sub_type:%d tlv_index:%d +1163,ii,[ wlan_rtt_tlv_helper.c : 329 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Wrong TLV length %d for loop start for sub_type:%d +1162,i,[ wlan_rtt_tlv_helper.c : 334 ] RTTTLV_CHECK_AND_PAD_TLVS: ERROR: Maximum inner loops reached for sub_type:%d +1161,i,[ wlan_rtt_tlv_helper.c : 367 ] RTTTLV_CHECK_AND_PAD_TLVS: WARN: ERROR Need to handle this tag ID %d for variable length + +1160,ii,[ wlan_rtt_tlv_helper.c : 378 ] RTTTLV_CHECK_AND_PAD_TLVS: WARN: TLV truncated. tlv_size_diff=%d, curr_tlv_len=%d + +1159,i,[ wlan_rtt_tlv_helper.c : 393 ] RTTTLV_CHECK_AND_PAD_TLVS: WARN: TLV needs padding. tlv_size_diff=-%d + +1158,ii,[ wlan_rtt_tlv_helper.c : 458 ] RTTTLV_CHECK_AND_PAD_TLVS: Some loop(cnt = %d) didn't ended properly for sub_type:%d +1157,i,[ wlan_rtt_tlv_helper.c : 464 ] RTTTLV_CHECK_AND_PAD_TLVS: Successfully processed TLVs for sub_type:%d + +1156,iii,[ wlan_rtt_tlv_helper.c : 90 ] WMI TLV attribute definitions for is_req:%d found; rtt_cmd_event_id: %d num_of_tlvs:%d +1155,ii,[ wlan_rtt_tlv_helper.c : 119 ] ERROR: Didn't found WMI TLV attribute definitions for is_req:%d rtt_cmd_event_id: %d +1154,iiii,[ wlan_rtt_tlv_helper.c : 99 ] ERROR: TLV order %d greater than num_of_tlvs:%d for is_req:%d rtt_cmd_event_id: %d +1153,iiii,[ wlan_rtt_tlv_helper.c : 106 ] WMI TLV attributes for is_req:%d rtt_cmd_event_id: %d TLV order %d [tlv %d] +1204,,[ wlan_cfr.c : 1455 ] No free unassociated CFR pool +1203,ii,[ wlan_cfr.c : 1804 ] wlan_cfr_pm_arb_req(): mac_id: %d state: %d +1202,iiii,[ wlan_cfr.c : 1606 ] <<< CFR_UNIT_TEST_CMD, num_args = %d arg0 = %d vdev_id = %d mac_id = %d +1201,,[ wlan_cfr.c : 1639 ] CFR_UNIT_TEST_CMD_SET_TA_AND_MASK, there's some missing argument, cannot set here +1200,,[ wlan_cfr.c : 1659 ] CFR_UNIT_TEST_CMD_SET_RA_AND_MASK, there's some missing argument, cannot set here +1199,,[ wlan_cfr.c : 1681 ] CFR_UNIT_TEST_CMD_SET_EXTRA_PARAMS_CAPTURE_GROUP, there's some missing argument, cannot set here +1198,,[ wlan_cfr.c : 1704 ] CFR_UNIT_TEST_CMD_SET_EXTRA_FIXED_PARAM, there's some missing argument, cannot set here +1197,,[ wlan_cfr.c : 1724 ] CFR_UNIT_TEST_CMD_WMI_CFR_CAPTURE_FILTER_CMDID, there's some missing argument, cannot set here +1196,IIIII,[ wlan_cfr.c : 1749 ] wmi_pdev_id = 0x%x filter_type = 0x%x capture_interval = 0x%x capture_duration = 0x%x filter_group_bitmap = 0x%x +1195,IIIIII,[ wlan_cfr.c : 1758 ] filter_group_id = 0x%x filter_set_valid_mask = 0x%x bw_nss_filter = 0x%x mgmt_subtype_filter = 0x%x ctrl_subtype_filter = 0x%x data_subtype_filter = 0x%x +1194,IIII,[ wlan_cfr.c : 1765 ] ta_addr.mac_addr31to0 = 0x%x ta_addr.mac_addr47to32 = 0x%x ta_addr_mask.mac_addr31to0 = 0x%x ta_addr_mask.mac_addr47to32 = 0x%x +1193,IIII,[ wlan_cfr.c : 1772 ] ra_addr.mac_addr31to0 = 0x%x ra_addr.mac_addr47to32 = 0x%x ra_addr_mask.mac_addr31to0 = 0x%x ra_addr_mask.mac_addr47to32 = 0x%x +1192,i,[ wlan_cfr.c : 1792 ] >>> CFR_UNIT_TEST_CMD, status = %d +1191,I,[ wlan_cfr.c : 1531 ] wlan_next_cfr_capture_handler: no capture requests in %p +1190,III,[ wlan_cfr.c : 921 ] Space not available read_index = %x,write_index = %x, max_write_index = %x +1189,i,[ wlan_cfr.c : 1137 ] gain table index is non zero for chain: %d +1188,,[ wlan_cfr.c : 1158 ] Invalid gain info. No AoA phase data got captured. +1187,IIIii,[ wlan_cfr.c : 1184 ] wlan_null_frame_cfr_wmi_ack_hdl: status 0x%08x correlation_info 0x%08x%08x cap_bw %d tx_bw %d +1186,i,[ wlan_cfr.c : 1144 ] Capping gain to 62, Current gain = %d +1185,IIIIIIII,[ wlan_cfr.c : 1153 ] gainDB values: %u %u %u %u %u %u %u %u +1184,I,[ wlan_cfr.c : 1322 ] Invalid operating BW for CFR %x +1183,I,[ wlan_cfr.c : 1371 ] Invalid CFR capture method %x +1182,iiIIIi,[ wlan_cfr.c : 743 ] wlan_peer_cfr_capture_cmd_handler: request %d periodicity %d peer MAC 0x%08x%02x context %p status %d +1181,iIIiI,[ wlan_cfr.c : 43 ] wlan_peer_cfr_capture: vdev %d peer MAC 0x%08x%02x status %d at %p +1180,,[ wlan_cfr.c : 88 ] WMI_PEER_CFR_CAPTURE_EVENTID evt alloc failed +1179,I,[ wlan_cfr.c : 1569 ] wlan_periodic_cfr_capture_handler: no capture requests in %p +1219,II,[ wlan_obss_scan_offload.c : 221 ] obss send: num_of_scans:%x,send cnt:%x +1218,II,[ wlan_obss_scan_offload.c : 246 ] obss merge: num_of_scans:%x, idx:%x +1217,ii,[ wlan_obss_scan_offload.c : 392 ] Beacon parser invoked, mac_id:%d, ch:%d +1216,ii,[ wlan_obss_scan_offload.c : 423 ] obss scan TE-A type=%d, index:%d +1215,,[ wlan_obss_scan_offload.c : 428 ] obss scan TE-A rec null +1214,Iiii,[ wlan_obss_scan_offload.c : 464 ] obss scan TE-A found_dup=%x, index:%d, op:%d,ch_id:%d +1213,iI,[ wlan_obss_scan_offload.c : 420 ] obss scan HT cap present=%d, teb:0x%x +1212,Ii,[ wlan_obss_scan_offload.c : 148 ] obss scan send action, add ch id:%x, op class:%d +1211,IiIi,[ wlan_obss_scan_offload.c : 154 ] OBSS_SCAN_SEND_ACTION idx:%x, op class:%d, intolerent len:%x, frame len:%d +1210,i,[ wlan_obss_scan_offload.c : 700 ] obss scan stop, refer cnt:%d, status +1209,I,[ wlan_obss_scan_offload.c : 184 ] obss coex action frame buf null, vdev id:%x +1208,i,[ wlan_obss_scan_offload.c : 571 ] obss scan start vdev id =%d +1207,i,[ wlan_obss_scan_offload.c : 576 ] obss scan vdev pool alloc failed=%d +1206,,[ wlan_obss_scan_offload.c : 623 ] Channel not in 2.4 GHz sent +1205,,[ wlan_obss_scan_offload.c : 635 ] Channel not in 2.4 GHz sent +1227,II,[ umac_wmi_events.c : 577 ] WMI_CHAN_INFO_EVENT_ALLOC_FAILURE EventId = 0x%x chan_freq = 0x%x +1226,iiiiiii,[ umac_wmi_events.c : 585 ] WMI_CHAN_INFO_EVT err_code = %d, freq = %d, cmd_flags = %d, nf = %d, rx_clr_cnt = %d, cycle_cnt = %d, chan_tx_pwr_range = %d +1225,iiiiii,[ umac_wmi_events.c : 587 ] WMI_CHAN_INFO_EVT chan_tx_pwr_tp = %d, rx_frm_cnt = %d, my_bss_rx_cycle_cnt = %d, rx_11b_mode_data_dur = %d, tx_frm_cnt = %d, mac_clk_mhz = %d +1224,iII,[ umac_wmi_events.c : 626 ] WMI_EVENT_ALLOC_FAILURE vdev_id = %d EventId = 0x%x AssocId/VdevMap = 0x%x +1223,iII,[ umac_wmi_events.c : 721 ] WMI_EVENT_ALLOC_FAILURE vdev_id = %d EventId = 0x%x AssocId/VdevMap = 0x%x +1222,ii,[ umac_wmi_events.c : 99 ] drop mgmt as size:%d,limit:%d +1221,,[ umac_wmi_events.c : 256 ] BEACON_EVENT_SWBA_SEND_FAILED +1220,II,[ umac_wmi_events.c : 684 ] WMI_EVENT_ALLOC_FAILURE EventId = 0x%x AssocId/VdevMap = 0x%x +1233,,[ wlan_wmi.c : 285 ] wlan_wmi_read_tlv: p_in_tlv is NULL +1232,,[ wlan_wmi.c : 291 ] wlan_wmi_read_tlv: p_out_tlv is NULL +1231,III,[ wlan_wmi.c : 314 ] wlan_wmi_read_tlv: type=%u, length=%u, read_len=%u +1230,,[ wlan_wmi.c : 245 ] wlan_wmi_write_tlv: p_in_tlv is NULL +1229,,[ wlan_wmi.c : 251 ] wlan_wmi_write_tlv: p_out_tlv is NULL +1228,III,[ wlan_wmi.c : 271 ] wlan_wmi_write_tlv: type=%u, length=%u, write_len=%u +1258,iiii,[ wlan_wmi_events.c : 576 ] wlan_debug_mesg_flush_compete stall_type:%d vdev_bmap:%d reason_code1:%d reason_code2:%d +1257,II,[ wlan_wmi_events.c : 626 ] WMI handle send WMI evt msg fail, evt_id:0x%x, evt_len:0x%x + +1256,II,[ wlan_wmi_events.c : 630 ] WMI handle send WMI evt msg, evt_id:0x%x, evt_len:0x%x + +1255,IIIII,[ wlan_wmi_events.c : 262 ] bdf_version = %x ref_design_id=%x, customer_id=%x, project_id=%x, board_data_rev=%x +1254,iiiii,[ wlan_wmi_events.c : 1700 ] wmi_service_ready_ext_event: pdev_id %d mod_id %d ring_elems_min %d min_buf_align %d min_buf_size %d +1253,ii,[ wlan_wmi_events.c : 1769 ] SCAN_RADIO_SUPPORT_DBUG WMI_SERVICE_READY_EXT2 san_radio_flag = %d phy_id = %d + +1252,iiiii,[ wlan_wmi_events.c : 1524 ] wmi_service_ready_ext_event: pdev_id %d mod_id %d ring_elems_min %d min_buf_align %d min_buf_size %d +1251,IIIIIIII,[ wlan_wmi_events.c : 1547 ] WMI Service Ready Ext: wmi_svc_bitmap(ext) = 0x%08x %08x %08x %08x (%08x %08x %08x %08x) +1250,III,[ wlan_wmi_events.c : 675 ] DISPLAY_TPC_STATS: 1st event tpcEvSize is %lu wal_pdev_get_reg_array_len is %lu reg_mask is %u +1249,,[ wlan_wmi_events.c : 679 ] DISPLAY_TPC_STATS: Event size exceeds WMI_SVC_MSG_SIZE!! +1248,,[ wlan_wmi_events.c : 687 ] DISPLAY_TPC_STATS: WMI tpc stats evt, allocation failed! +1247,I,[ wlan_wmi_events.c : 914 ] DISPLAY_TPC_STATS: 4th event tpcEvSize is %lu +1246,I,[ wlan_wmi_events.c : 916 ] DISPLAY_TPC_STATS: wal_pdev_get_ctl_array_len is %lu +1245,,[ wlan_wmi_events.c : 923 ] DISPLAY_TPC_STATS: Event size exceeds WMI_SVC_MSG_SIZE!! +1244,,[ wlan_wmi_events.c : 930 ] DISPLAY_TPC_STATS: WMI tpc stats evt, allocation failed! +1243,I,[ wlan_wmi_events.c : 936 ] DISPLAY_TPC_STATS: event starting ptr is %lu +1242,,[ wlan_wmi_events.c : 651 ] DISPLAY_TPC_STATS: wmi_tpc_stats_event_complete +1241,II,[ wlan_wmi_events.c : 750 ] DISPLAY_TPC_STATS: 2nd event tpcEvSize is %lu wal_pdev_get_rates_array_len is %lu +1240,,[ wlan_wmi_events.c : 754 ] DISPLAY_TPC_STATS: Event size exceeds WMI_SVC_MSG_SIZE!! +1239,,[ wlan_wmi_events.c : 761 ] DISPLAY_TPC_STATS: WMI tpc stats evt, allocation failed! +1238,I,[ wlan_wmi_events.c : 767 ] DISPLAY_TPC_STATS: event starting ptr is %lu +1237,I,[ wlan_wmi_events.c : 826 ] DISPLAY_TPC_STATS: 3rd event tpcEvSize is %lu +1236,,[ wlan_wmi_events.c : 833 ] DISPLAY_TPC_STATS: Event size exceeds WMI_SVC_MSG_SIZE!! +1235,,[ wlan_wmi_events.c : 840 ] DISPLAY_TPC_STATS: WMI tpc stats evt, allocation failed! +1234,,[ wlan_wmi_events.c : 595 ] WOW send initial wakeup wmi cmd +1312,Ii,[ cmdProcessTlv2.c : 4855 ] %s: #### Getting cal version:bdfvertype: %d ! + +1311,ii,[ cmdProcessTlv2.c : 2005 ] PHYDBGdump2Handler(Phy:%d, Option:%d) + +1310,IiI,[ cmdProcessTlv2.c : 2013 ] ### data_ptr %p size %d status 0x%x + +1309,Ii,[ cmdProcessTlv2.c : 2022 ] ### data_ptr %p stream_cnt %d + +1308,,[ cmdProcessTlv2.c : 2025 ] ### Data buffer stream ended + +1307,ii,[ cmdProcessTlv2.c : 2417 ] PHYDBGdumpHandler(Phy:%d, Option:%d) + +1306,IiI,[ cmdProcessTlv2.c : 2425 ] ### data_ptr %p size %d status 0x%x + +1305,Ii,[ cmdProcessTlv2.c : 2434 ] ### data_ptr %p stream_cnt %d + +1304,,[ cmdProcessTlv2.c : 2437 ] ### Data buffer stream ended + +1303,Ii,[ cmdProcessTlv2.c : 4832 ] %s :set cal version , bdfvertype: %d ! + +1302,i,[ cmdProcessTlv2.c : 4092 ] Channel index out of bounds %d +1301,i,[ cmdProcessTlv2.c : 4100 ] Power offset Index out of bounds %d +1300,ii,[ cmdProcessTlv2.c : 4108 ] 2G index %d flag %d +1299,ii,[ cmdProcessTlv2.c : 4121 ] values written 2G %d 5G %d +1298,i,[ cmdProcessTlv2.c : 4182 ] Channel index out of bounds %d +1297,i,[ cmdProcessTlv2.c : 4263 ] Channel index out of bounds %d +1296,i,[ cmdProcessTlv2.c : 4278 ] Target Power index out of bounds %d +1295,i,[ cmdProcessTlv2.c : 4293 ] Gain index out of bounds %d +1294,,[ cmdProcessTlv2.c : 4609 ] OPC_OTP_WRITE:Ready to send response! + +1293,I,[ cmdProcessTlv2.c : 4610 ] OTP Write status, 0x%x +1292,,[ cmdProcessTlv2.c : 4622 ] OPC_OTP_WRITE:send response done! + +1291,,[ cmdProcessTlv2.c : 3041 ] bdGetSizeHandler + +1290,iIii,[ cmdProcessTlv2.c : 3068 ] bdReadHandler: bdSize %d, offset 0x%x, size %d, source %d + +1289,i,[ cmdProcessTlv2.c : 3109 ] error in bdReadHandler: status %d + +1288,Ii,[ cmdProcessTlv2.c : 4509 ] bdWriteHandler: offset 0x%x, size %d + +1287,ii,[ cmdProcessTlv2.c : 2309 ] combCalGroupHandler(): phyId = %d; cmdid = %d +1286,IIII,[ cmdProcessTlv2.c : 4734 ] %s: offset %ld, size %ld, totalsize %ld +1285,III,[ cmdProcessTlv2.c : 4803 ] %s: offset %ld, size %ld +1284,,[ cmdProcessTlv2.c : 198 ] ftm_termperature_timer_handler::MAC sleeping +1283,,[ cmdProcessTlv2.c : 1745 ] Failed Rx Stop +1282,,[ cmdProcessTlv2.c : 1756 ] ### genericUtfCmdHandler: InValid CmdID#### +1281,i,[ cmdProcessTlv2.c : 493 ] FATAL ERROR!! Trying to access phy %d which is not present +1280,i,[ cmdProcessTlv2.c : 504 ] FATAL ERROR!! Trying to access phy %d which is inactive +1279,I,[ cmdProcessTlv2.c : 4363 ] modifyBDFOTPFlagsHandler: modifyBdfOtpFlags 0x%x +1278,,[ cmdProcessTlv2.c : 4381 ] modifyBDFOTPFlagsHandler: pCmdStream is NULL +1277,,[ cmdProcessTlv2.c : 3741 ] OFDMA TonePlan + +1276,ii,[ cmdProcessTlv2.c : 626 ] FTM :: pktgen_complete_timer_handler: pktgen_complete_timer_handler: Pktgen Tx STOP completion callback failure for phyId %d g_pktgen_done_assert_count %d +1275,iiiiiii,[ cmdProcessTlv2.c : 1122 ] rxHandler: phyId %d rxMode %d wlanMode %d freq %d freq2 %d chainMask %d wifiStandard %d +1274,i,[ cmdProcessTlv2.c : 1136 ] RX operation not allowed on phyID %d one operation ongoing +1273,,[ cmdProcessTlv2.c : 4400 ] #### per chain forced pwr TLV called! + +1272,iI,[ cmdProcessTlv2.c : 2732 ] setPhyRfModeHandler: DBS/SBS is not supported, phyRfMode %d status 0x%x +1271,I,[ cmdProcessTlv2.c : 1259 ] pdev %u +1270,iiiiiII,[ cmdProcessTlv2.c : 1295 ] curChan->band_center_freq1 %d, curChan->band_center_freq2 %d, PHYRF_BW_IDX(curChan) %d curChan->phy_mode %d num_20_bw %d rx_CM %x, tx_CM %x +1269,ii,[ cmdProcessTlv2.c : 1363 ] pilot_evm pilot_evm_dB_mean[%d] = %d +1268,I,[ cmdProcessTlv2.c : 588 ] FTM :: tlv2SendTxStatus: timestamp = %ld +1267,iiii,[ cmdProcessTlv2.c : 3516 ] Tx Gain Control:Chain %d, Gain %d, dacGain %d, forceCal %d + +1266,iiiiiiiI,[ cmdProcessTlv2.c : 675 ] FTM :: txHandler: phyId %d txMode %d freq %d freq2 %d wlanMode %d chainMask %d wifiStandard %d timestamp =%ld +1265,IIII,[ cmdProcessTlv2.c : 850 ] FTM :: txHandler: ret:0x%x, ret1:0x%x, ret2:0x%x, ret3:0x%x +1264,ii,[ cmdProcessTlv2.c : 868 ] FTM :: txHandler dev running state=%d iterations_taken_to_flush=%d +1263,iI,[ cmdProcessTlv2.c : 879 ] FTM :: txHandler: Sent response to host with status =%d, timestamp =%ld +1262,i,[ cmdProcessTlv2.c : 709 ] FTM :: txHandler: TX operation not allowed on phyID %d one operation ongoing +1261,iiI,[ cmdProcessTlv2.c : 919 ] FTM :: txStatusHandler: INSIDE txStatusHandler phyId =%d pParms->needReport=%d timestamp : %u +1260,ii,[ cmdProcessTlv2.c : 933 ] FTM :: txStatusHandler: pParms->needReport=%d pParms->stopTx=%d +1259,IIII,[ cmdProcessTlv2.c : 964 ] FTM :: txStatusHandler: ret:0x%x, ret1:0x%x, ret2:0x%x, ret3:0x%x +1315,,[ LMGoProcessing.c : 61 ] LM_DBG: NULL pdev return +1314,Ii,[ LMGoProcessing.c : 78 ] LM_DBG: ABI on-period tx_duration_data %ld(US) current_time(MS) %d +1313,Ii,[ LMGoProcessing.c : 295 ] LM_DBG: ABI off-period tx_duration_data(US) %ld curTime(MS) %d +1317,II,[ cmdProcessing.c : 279 ] FTM_DEBUG :: txCmdProcessor, TxMiscFlags : 0x%x txParms->aifsn=0x%x +1316,iiiii,[ cmdProcessing.c : 391 ] FTM :: txCmdProcessor channel=%d txPwr=%d dataRrate=%d numPkt=%d txChain=%d + +1344,I,[ tcmd.c : 4941 ] Invalid pdev %lu +1343,,[ tcmd.c : 1222 ] A: NEW COMMAND ISSUED +1342,iiiiI,[ tcmd.c : 2388 ] [UL-OFDMA]ruIdx=%d, dataRate=%d, NSS=%d, pktSz=%d, miscFlags=0x%x +1341,,[ tcmd.c : 4303 ] Could not find valid ruIdx in tone plan +1340,i,[ tcmd.c : 3607 ] tcmd_cont_rx_begin: phyId=%d, chain mask 0 + +1339,i,[ tcmd.c : 3648 ] tcmd_cont_rx_begin: phyId=%d, tcmd_setup_channel failure + +1338,Ii,[ tcmd.c : 3203 ] tcmd_cont_rx_cmd - flags 0x%x; act %d +1337,ii,[ tcmd.c : 3211 ] aId[%d] = %d +1336,,[ tcmd.c : 3217 ] Could not find valid aID in tone plan +1335,ii,[ tcmd.c : 3473 ] pilot_evm g_ftmrxstats[phyId].pilotEvmDbMean[%d] = %d +1334,iii,[ tcmd.c : 2696 ] TPC force glutindex: chain%d: gainindex%d: dacgain=%d + +1333,iii,[ tcmd.c : 2718 ] PAPRD TCMD: Chain %d Glut Idx %d Gain Idx %d + +1332,iiii,[ tcmd.c : 2833 ] Setup chan failed: freq %d, freq2 %d, wlanMd %d, bw %d + +1331,,[ tcmd.c : 4172 ] Enabled SIFS bursting for Tx99 +1330,i,[ tcmd.c : 1808 ] Invalid frequency %d. + +1329,,[ tcmd.c : 1946 ] 11AC VHT20 + +1328,i,[ tcmd.c : 2188 ] 165 MHz frequency %d +1327,i,[ tcmd.c : 2192 ] Invalid frequency %d +1326,i,[ tcmd.c : 2028 ] pktType Invalid %d + +1325,Iiiii,[ tcmd.c : 2141 ] get_ch wlanMode: %lu ch: %d freq1 %d freq2 %d, fcMode %d + +1324,iiII,[ tcmd.c : 3883 ] tcmd_setup_channel_real: phyId=%d,Failure: chan.phy_mode=%d, rx_tcmdParms.u.para.pktType=0x%x, rx_tcmdParms.miscFlags=0x%x + +1323,II,[ tcmd.c : 3993 ] tcmd() Before GI 0x%x LTF 0x%x +1322,II,[ tcmd.c : 4028 ] tcmd() After GI 0x%x LTF 0x%x +1321,iI,[ tcmd.c : 1496 ] A: TCMD TX COMP CB - MADE STOP TX = 2 phyId [%d] | Time : %u +1320,I,[ tcmd.c : 4453 ] tcmd() Before RC flag 0x%x +1319,Iii,[ tcmd.c : 4478 ] tcmd() After RC flag 0x%x GI %d LTF %d +1318,ii,[ tcmd.c : 4630 ] [UL-OFDMA]gi=%d, ltf=%d +1351,,[ tcmd_rx.c : 335 ] A: RETURN if((g_ftm_frame_enacap_config[phyId].da_addr == NULL) || (g_ftm_frame_enacap_config[phyId].bss_addr == NULL)) +1350,,[ tcmd_rx.c : 364 ] RX WAL PEER A_PANIC +1349,ii,[ tcmd_rx.c : 383 ] A: wal_vdev_attach vdevId[%d]=%d +1348,,[ tcmd_rx.c : 389 ] A: wal_peer_alloc rx peer 1 +1347,,[ tcmd_rx.c : 399 ] A: wal_peer_alloc rx peer 2 +1346,,[ tcmd_rx.c : 352 ] A: page fault condition, all vdev is null +1345,,[ tcmd_rx.c : 361 ] A: Inside if(g_tcmd_wal_rx_ctxt[phyId].vdev == NULL) +1369,ii,[ tcmd_tx.c : 1417 ] [MU] sched_algo_mu_tx_peer_assoc() peer[%d] AID %d +1368,,[ tcmd_tx.c : 1533 ] A: INSIDE tcmd_wal_peer_free +1367,ii,[ tcmd_tx.c : 1023 ] tcmd_wal_setup_data_rate: rc %d invalid for freq %d +1366,ii,[ tcmd_tx.c : 418 ] ftm_tid_create_handler: phyId %d, tid %d +1365,,[ tcmd_tx.c : 1558 ] A: RETURN if((g_ftm_frame_enacap_config[phyId].bss_addr == NULL) || (g_ftm_frame_enacap_config[phyId].da_addr == NULL)) +1364,,[ tcmd_tx.c : 1564 ] A: if((g_tcmd_wal_config[phyId].vdev) == NULL) +1363,,[ tcmd_tx.c : 1567 ] A: if(((g_bss_peer[phyId]) == NULL) || (g_ftm_ctxt[phyId].peer == NULL)) +1362,,[ tcmd_tx.c : 1572 ] A: RETURN if((g_bss_track_peer != NULL) || (g_ctxt_track_peer != NULL)) +1361,,[ tcmd_tx.c : 1176 ] A: peer_use_4cal +1360,iiI,[ tcmd_tx.c : 1196 ] A: g_bss_peer[%d]=%d g_ftm_bss_peer[phyId]= %08x +1359,I,[ tcmd_tx.c : 1197 ] cwc wal_peer_alloc for bss_peer %08x <= +1358,I,[ tcmd_tx.c : 1200 ] A: ctxt->peer=0x%x +1357,iI,[ tcmd_tx.c : 1201 ] A: g_ftm_frame_enacap_config[%d].da_addr=0x%x +1356,iI,[ tcmd_tx.c : 1202 ] A: g_ftm_frame_enacap_config[%d].bss_addr=0x%x +1355,Ii,[ tcmd_tx.c : 1212 ] A: wal_peer_alloc ctxt->peer[%08x] %d times +1354,,[ tcmd_tx.c : 1215 ] A: wal_peer_alloc peer_use_4cal ctxt->peer +1353,iiI,[ tcmd_tx.c : 1179 ] A: g_bss_peer[%d]=%d g_ftm_bss_peer[phyId]= %08x +1352,,[ tcmd_tx.c : 1186 ] A: peer_use_4cal wal_peer_alloc bss_peer +1457,iii,[ tpcCal.c : 586 ] chk1 Max_TX_CAL_Gain_ID_5G:%d Max_TX_CAL_Gain_ID_2G %d Max_TX_CAL_Gain_ID_6G %d +1456,IIII,[ tpcCal.c : 680 ] tpccal::5G opcChan[%u] %u, tpcChan[%u] %u +1455,IIII,[ tpcCal.c : 700 ] tpccal::6G opcChan[%u] %u, tpcChan[%u] %u +1454,Ii,[ tpcCal.c : 760 ] greenTxGainIndGrpFlag2G:%x, greenTxGainIndGrpFlag5G:%d + +1453,iiii,[ tpcCal.c : 845 ] 5G IdxGainEndGrp1:%d IdxGainEndGrp2:%d IdxGainEndGrp3:%d IdxGainEndGrp4:%d + +1452,i,[ tpcCal.c : 633 ] tpccal chan::6g %d +1451,IIII,[ tpcCal.c : 660 ] tpccal::2G opcChan[%u] %u, tpcChan[%u] %u +1450,iiiii,[ tpcCal.c : 1210 ] freq %d gIdx %d dacGain %d paCfg %d chMask %d + +1449,III,[ tpcCal.c : 1248 ] tpccal::Stopping tx before starting for Chan %u, Chain %u, Gain %u +1448,,[ tpcCal.c : 2338 ] tpccal::Generating Caldata +1447,ii,[ tpcCal.c : 2382 ] tpcCal::Generating Caldata for Channel %d dacGainforCal %d +1446,i,[ tpcCal.c : 2386 ] tpcCal::Generating Caldata for Chain %d +1445,iii,[ tpcCal.c : 2392 ] tpcCal::Generating Caldata for GLUT Gain Idx %d txgainIdx %d meas_pwr %d +1444,iii,[ tpcCal.c : 2402 ] tpcCal::Generating Caldata for GLUT EXT Gain Idx %d txgainIdx %d meas_pwr %d +1443,iii,[ tpcCal.c : 2412 ] tpcCal::Generating Caldata for PLUT Gain Idx %d pdadc_read %d meas_pwr %d +1442,iii,[ tpcCal.c : 2454 ] tpcCal::Generating Caldata for Chain %d sbsOffset %d NUM_CAL_GAINS_SELECTED_4_GLUT:%d +1441,iii,[ tpcCal.c : 2461 ] tpcCal::Generating Caldata for GLUT Gain Idx %d txgainIdx %d meas_pwr %d +1440,iiii,[ tpcCal.c : 2471 ] tpcCal::Generating Caldata for GLUT EXT Gain Idx %d txgainIdx %d meas_pwr %d numGlutEntries_5G:%d +1439,iii,[ tpcCal.c : 2481 ] tpcCal::Generating Caldata for PLUT Gain Idx %d pdadc_read %d meas_pwr %d +1438,iii,[ tpcCal.c : 2499 ] phyId:%d cmask:%d pwrAtPdadc:%d +1437,III,[ tpcCal.c : 1670 ] getNextLoop fail curLoop->idxCalPt %u, Chain %u, Gain %u +1436,iiiii,[ tpcCal.c : 1697 ] bef, band %d ch %d numCh %d chain %d gain %d + +1435,,[ tpcCal.c : 1702 ] end loop0 + +1434,iiii,[ tpcCal.c : 1715 ] inc calPt %d ch %d chn %d, numGain %d + +1433,ii,[ tpcCal.c : 1723 ] inc chain AI %d %d + +1432,ii,[ tpcCal.c : 1731 ] inc ch AI %d %d + +1431,ii,[ tpcCal.c : 1739 ] inc band AI %d %d + +1430,,[ tpcCal.c : 1743 ] end loop + +1429,iiii,[ tpcCal.c : 1804 ] pwr est %d band %d numEst %d, idx %d +1428,iiiii,[ tpcCal.c : 1808 ] sG %d %d %d %d %d +1427,i,[ tpcCal.c : 1809 ] %d + +1426,i,[ tpcCal.c : 3077 ] available_gainIdxs:%d +1425,iiii,[ tpcCal.c : 3083 ] Iteration m:%d glutsfilled[%d]:%d Max_Glut_Map[band][grpId]:%d +1424,i,[ tpcCal.c : 3084 ] tpcCalResult[band][chan].measPwr[chain][m]:%d +1423,,[ tpcCal.c : 3087 ] ERR: BAD CAL TARGETs CONFIGURED for: +1422,i,[ tpcCal.c : 3094 ] Picked limiting gainidx:%d +1421,i,[ tpcCal.c : 3103 ] Picked gainidx:%d +1420,,[ tpcCal.c : 3107 ] Moving up gainidxs to guarantee GLUT count! +1419,ii,[ tpcCal.c : 3110 ] currIndx:%d Updated endPwrIdxGrp:%d +1418,,[ tpcCal.c : 3115 ] BAD CAL TARGETs CONFIGURED for +1417,ii,[ tpcCal.c : 3120 ] Picked max gainidx:%d from group :%d +1416,,[ tpcCal.c : 3123 ] Invalid pick_glut_entry condition! +1415,,[ tpcCal.c : 1986 ] tpccal::Post processing CLPC Caldata +1414,,[ tpcCal.c : 2112 ] tpccal::Post processing CLPC Caldata +1413,,[ tpcCal.c : 1880 ] tpccal::Post processing OLPC Caldata +1412,,[ tpcCal.c : 1888 ] pp OLPC + +1411,iiiii,[ tpcCal.c : 1911 ] meaPwr %d tgtPwr %d, bn %d ch %d chn %d, + +1410,i,[ tpcCal.c : 1912 ] numValidMeas = %d + +1409,iiii,[ tpcCal.c : 1919 ] bkof %d bn %d ch %d chn %d + +1408,iiii,[ tpcCal.c : 1930 ] stPwrIdx %d bn %d ch %d chn %d + +1407,iiiiiiii,[ tpcCal.c : 1956 ] iMeas %d iGainIdx %d tgt %d ch %d chn %d sel pwr %d gIdx %d dac %d + +1406,,[ tpcCal.c : 3141 ] postProcessingOLPCCALData_gtx +1405,iiii,[ tpcCal.c : 3172 ] BegiN: Band:%d chan:%d startPwrIdxGrp:%d endPwrIdxGrp:%d +1404,ii,[ tpcCal.c : 3173 ] gtx tgtpwridx:%d , GlutPwrMapGrpNum:%d +1403,iii,[ tpcCal.c : 3180 ] gtx startPwrIdxGrp:%d , endPwrIdxGrp:%d modifiedTarget:%d +1402,i,[ tpcCal.c : 3182 ] endPwrIdxGrp:%d +1401,iii,[ tpcCal.c : 3188 ] gtx startPwrIdxGrp:%d , endPwrIdxGrp:%d modifiedTarget:%d +1400,i,[ tpcCal.c : 3190 ] endPwrIdxGrp:%d +1399,iiii,[ tpcCal.c : 3197 ] gtx startPwrIdxGrp:%d , endPwrIdxGrp:%d tpcCfg[band].IdxGainEndGrp3:%d modifiedTarget:%d +1398,i,[ tpcCal.c : 3199 ] endPwrIdxGrp:%d +1397,iiii,[ tpcCal.c : 3205 ] gtx startPwrIdxGrp:%d , endPwrIdxGrp:%d tpcCfg[band].IdxGainEndGrp4:%d modifiedTarget:%d +1396,i,[ tpcCal.c : 3207 ] endPwrIdxGrp:%d +1395,iii,[ tpcCal.c : 3211 ] gtx Invalid TPC_GLUT_PWR_MAP_GRP Id ! from Band:%d Chain:%d tgtpwridx:%d +1394,ii,[ tpcCal.c : 1032 ] Sending to host freq2G %d, freq5G %d + +1393,iii,[ tpcCal.c : 1573 ] Sending to host freq2G %d, freq5G %d, chain %d +1392,iiii,[ tpcCal.c : 1574 ] gain %d pwr %d numChain %d numCalpt %d + +1391,IIII,[ tpcCal.c : 1578 ] tpccal::Sending to host to look for measurements inChan2G %u, Chan5G %u, ChainMask(User) %u, Gain %u +1390,iii,[ tpcCal.c : 1580 ] Sending to host freq2G %d, freq5G %d, chain %d + +1389,iiii,[ tpcCal.c : 1581 ] gain %d pwr %d numChain %d numCalpt %d + +1388,,[ tpcCal.c : 2291 ] tpccal::Sending Caldata to host +1387,,[ tpcCal.c : 1317 ] tpccal::Starting ... +1386,,[ tpcCal.c : 1414 ] TPC Cal message check + +1385,ii,[ tpcCal.c : 1456 ] tpcCALScheme: %d, phyID %d + +1384,,[ tpcCal.c : 1850 ] tpccal::Completed +1383,,[ tpcCal.c : 1866 ] FTM_REGEN_CALDB: Initiating cold boot calibration in FTM... + +1382,,[ tpcCal.c : 2709 ] tpccal::Out of sync power measurement report! + +1381,iIIII,[ tpcCal.c : 2742 ] tpccal::Got measurement %d from host for Chan %u Chain %u Chain(user) %u Gain %u +1380,iIIIII,[ tpcCal.c : 2762 ] tpccal::Thermoffset %d for Band %u tpcChan %u opcChan[%u] %u Chain %u +1379,iiii,[ tpcCal.c : 2778 ] Got Power from host Chan %d , GainIdx %d , MeasPwr %d , Read pdadc %d +1378,ii,[ tpcCal.c : 2831 ] Received identical power meas:%d prevMeas:%d .Failing calloop +1377,iii,[ tpcCal.c : 2860 ] Get 10Log(pdadc) prev:%d curr:%d slope:%d +1376,ii,[ tpcCal.c : 2863 ] Get Power meas:%d prevMeas:%d +1375,iiii,[ tpcCal.c : 2864 ] calFail:%d, gainIdx:%d, idxCalPt:%d skipSlope_gtx_bndry:%d +1374,i,[ tpcCal.c : 2868 ] skipping slope for gainIdx = %d +1373,III,[ tpcCal.c : 1835 ] tpccal::Starting tx for Chan %u, Chain %u, Gain %u +1372,iiiii,[ tpcCal.c : 3046 ] Write to tpcCalPostProcResult[%d][%d].olpc.measPwrExt[%d][%d]:%d +1371,iiiii,[ tpcCal.c : 3053 ] Write to tpcCalPostProcResult[%d][%d].olpc.measPwr[%d][%d]:%d +1370,ii,[ tpcCal.c : 3063 ] glutsfilled[%d]:%d +1459,ii,[ xtalCal.c : 252 ] [TLV2_CTRL_W_OTP]capIn=%d, capOut=%d +1458,ii,[ xtalCal.c : 256 ] [ERROR][TLV2_CTRL_W_OTP]OTP has data %d, %d +1478,Iiii,[ tpcOnepointCal.c : 296 ] tpcOnepointCal::Starting Tx for phy %u, freq %d, chainMask %d, txPwr_db2 %d +1477,Iiii,[ tpcOnepointCal.c : 299 ] tpcOnepointCal::Stopping Tx for phy %u, freq %d, chainMask %d, txPwr_db2 %d +1476,iii,[ tpcOnepointCal.c : 529 ] tpcOnepointCal::Failure at BandIdx:%d chanIdx:%d chainIdx:%d +1475,,[ tpcOnepointCal.c : 539 ] tpcOnepointCal:: end loop 1 +1474,,[ tpcOnepointCal.c : 549 ] tpcOnepointCal:: break +1473,,[ tpcOnepointCal.c : 595 ] tpcOnepointCal:: end loop +1472,i,[ tpcOnepointCal.c : 136 ] tpccal chan::2g %d +1471,ii,[ tpcOnepointCal.c : 170 ] tpcOnepointCal::TPC_DBG 5G numChain %d 2G numChain %d +1470,i,[ tpcOnepointCal.c : 142 ] tpccal chan::5g %d +1469,i,[ tpcOnepointCal.c : 148 ] tpccal chan::6g %d +1468,ii,[ tpcOnepointCal.c : 613 ] tpcOnepointCal::TPC_DBG band %d idxChan %d +1467,IIII,[ tpcOnepointCal.c : 431 ] tpcOnepointCal::Requesting pwr measurement for phy %u, freq %u, chainMask %u,tgtPwr_db8 %u +1466,IIII,[ tpcOnepointCal.c : 445 ] tpcOnepointCal::Requesting pwr measurement for phy %u, freq %u, chainMask %u,tgtPwr_db8 %u +1465,IIII,[ tpcOnepointCal.c : 461 ] tpcOnepointCal::Requesting pwr measurement for phy %u, freq %u, chainMask %u,tgtPwr_db8 %u +1464,,[ tpcOnepointCal.c : 668 ] tpcOnepointcal::Completed +1463,,[ tpcOnepointCal.c : 322 ] tpcOnepointCAL::Starting... +1462,,[ tpcOnepointCal.c : 711 ] tpcOnepointcal::Failure, -999 power detected +1461,IIIiiI,[ tpcOnepointCal.c : 739 ] tpcOnepointCal::Pwr measurement for phy %u, freq %u, chainMask %u, glutOffset %d, thermOffset %d, measPwr_db8 is %u +1460,,[ tpcOnepointCal.c : 102 ] tpcOnepointCal::tpcPowerMeasurementDelayTimeout +1487,iiiiii,[ rxGainCal.c : 132 ] rxGainCal:: Starting Rx on phyId %d, is2Ghz %d, Chain %d Chan %d, rxMode %d refISS Level %d +1486,i,[ rxGainCal.c : 213 ] rxGainCal:: Error on chainIdx %d + +1485,i,[ rxGainCal.c : 223 ] rxGainCal:: Error on chainIdx %d + +1484,i,[ rxGainCal.c : 237 ] rxGainCal:: Error on chainIdx status %d + +1483,ii,[ rxGainCal.c : 281 ] rxGainCal:: Host error: phyId %d, veryFirstRxGainCal %d +1482,iiiiii,[ rxGainCal.c : 295 ] rxGainCal:: Host error: phyId %d, chainIdx %d, ChanIdx %d, Expected Pkt Cnt %d, Actual Pkt Cnt %d, rxGainCalState.status %d +1481,iiiiiii,[ rxGainCal.c : 337 ] rxGainCal:: Saving Results for phyId %d, chainIdx %d, ChanIdx %d, PNFdBr %d, PNFdBm %d, Expected Pkt Cnt %d, Actual Pkt Cnt %d +1480,iiiiii,[ rxGainCal.c : 343 ] rxGainCal:: Saving Results for phyId %d, chainIdx %d, ChanIdx %d, Expected Pkt Cnt %d, Actual Pkt Cnt %d totalPkt=%d +1479,,[ rxGainCal.c : 353 ] nextLoopRxCal is NULL +1488,ii,[ wmi_ftm_attach.c : 227 ] ERROR: ftm_parse_unifiedcmd: dataLen %d is LESS than sizeof(segHdrInfo) %d +1501,III,[ whal_debug.c : 5561 ] assert:r0=0x%x, r1=0x%x, line:0x%x + +1500,ii,[ whal_debug.c : 5724 ] config_reg_dump: Entries exceeded MAX REG DUMP ENTRY :%d! :%d + +1499,I,[ whal_debug.c : 5729 ] config_reg_dump: Invalid register physical address! :0x%x + +1498,iIIII,[ whal_debug.c : 3583 ] CRYPTO_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1497,iII,[ whal_debug.c : 3453 ] HWSCH_TRACER_LOG: mac(%d), tbus_index(0x%x), debug_trace(0x%x) +1496,iIIII,[ whal_debug.c : 3551 ] PDG_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1495,iIIII,[ whal_debug.c : 4378 ] RXDMA1_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1494,iIIII,[ whal_debug.c : 4324 ] RXDMA_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1493,iIIII,[ whal_debug.c : 3647 ] RXOLE_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1492,iIIII,[ whal_debug.c : 3518 ] RXPCU_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1491,iIIII,[ whal_debug.c : 4434 ] TXDMA_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1490,iIIII,[ whal_debug.c : 3615 ] TXOLE_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1489,iIIII,[ whal_debug.c : 3486 ] TXPCU_TRACER_LOG: mac(%d), tbus_index(0x%x), dbg_select(0x%x), debug_trace(0x%x,0x%x) +1508,II,[ whal_hwsch.c : 3661 ] hwsch2_wdog_timeout: reg_wdog=%x, reg_cmd_ring_wdog=%x +1507,II,[ whal_hwsch.c : 3853 ] cca_watchdog=%x, reg_axi_err=%x +1506,II,[ whal_hwsch.c : 3898 ] ul-q(%i), reg:%x +1505,III,[ whal_hwsch.c : 3904 ] val_0=%x, val_1=%x, val_2=%x +1504,I,[ whal_hwsch.c : 4056 ] WHAL_FATAL_ERR_UNKNOWN:%x +1503,i,[ whal_hwsch.c : 4070 ] WHAL_FATAL_ERR_UNKNOWN: pdev_id:%d - Ignore, since wdog statuses got cleared +1502,iiIii,[ whal_hwsch.c : 4665 ] config_txop_sel (pdev=%d,q=%d): reg=0x%x, lifetime_exp=%d, txop_sel=%d +1510,II,[ whal_interrupt.c : 997 ] Clear false RXPCU WDOG, status %x, limit %x +1509,I,[ whal_interrupt.c : 1713 ] GetPendingInterrupts-whalPending:0x%x +1512,ii,[ whal_wmac_recipes.c : 144 ] whal_wmac_clr_rogue_ap_type_by_mask: rogue_ap_bit_mask[%d]: %d +1511,ii,[ whal_wmac_recipes.c : 164 ] whal_wmac_set_rogue_ap_type: rogue_ap_bit_mask[%d]: %d +1513,,[ whal_cce.c : 463 ] poll MCMN_R0_MCMN_MAC_IDLE/HWIO_MCMN_R0_MCMN_MAC_IDLE_RXOLE_BMSK timeout + +1519,III,[ whal_recv.c : 6743 ] fse_watchdog %x, sm_state_reg %x, cache_response %x +1518,II,[ whal_recv.c : 5652 ] rssi_legacy rssi_comb,rssi_comb_ppdu :0x%x chain0, 1:0x%x +1517,iii,[ whal_recv.c : 1558 ] startPcuReceive on mac:%d, phy_is_off:%d leave_phy_off:%d +1516,I,[ whal_recv.c : 9263 ] TxRx overlap TLV_READY reg_val: 0x%x + +1515,Ii,[ whal_recv.c : 9097 ] %s: invalid lmac id %d + +1514,,[ whal_recv.c : 9128 ] Link desc leakage due to SFM issue Jira 1206 + +1544,,[ whal_recv_recovery.c : 79 ] SW2RXDMA_BUF ring empty +1543,,[ whal_recv_recovery.c : 122 ] FW2RXDMA_BUF ring empty +1542,,[ whal_recv_recovery.c : 143 ] RX_RING_FW_BUF ring empty caused by RX_RING_WMI_EVT +1541,,[ whal_recv_recovery.c : 167 ] FW2RXDMA_STATBUF ring empty +1540,,[ whal_recv_recovery.c : 174 ] FW2RXDMA_STATBUF ring empty +1539,,[ whal_recv_recovery.c : 199 ] WBM2RXDMA_LINK ring empty +1538,,[ whal_recv_recovery.c : 206 ] WBM2RXDMA_LINK ring empty +1537,,[ whal_recv_recovery.c : 231 ] FW2RXDMA_LINK ring empty +1536,,[ whal_recv_recovery.c : 86 ] SW2RXDMA_BUF ring empty +1535,,[ whal_recv_recovery.c : 238 ] FW2RXDMA_LINK ring empty +1534,,[ whal_recv_recovery.c : 265 ] MO SW2RXDMA_BUF ring empty +1533,,[ whal_recv_recovery.c : 272 ] MO SW2RXDMA_BUF ring empty +1532,,[ whal_recv_recovery.c : 297 ] MO FW2RXDMA_STATBUF ring empty +1531,,[ whal_recv_recovery.c : 304 ] MO FW2RXDMA_STATBUF ring empty +1530,,[ whal_recv_recovery.c : 329 ] MO FW2RXDMA_LINK ring empty +1529,,[ whal_recv_recovery.c : 336 ] MO FW2RXDMA_LINK ring empty +1528,IIIIII,[ whal_recv_recovery.c : 382 ] ring type [0x%x] empty error ts-0x%x, pre hp:0x%x, ts 0x%x, hp 0x%x, tp 0x%x +1527,IiI,[ whal_recv_recovery.c : 393 ] ring type [0x%x] wmi pending:%d, empty %x +1526,,[ whal_recv_recovery.c : 115 ] FW2RXDMA_BUF ring empty +1525,IIIIIIII,[ whal_recv_recovery.c : 516 ] ring [0x%x] full ts-0x%x, hp 0x%x, tp 0x%x, reo2sw1: 0x%x, reo2sw4:0x%x, reo2tcl:0x%x, rxdma2sw:0x%x +1524,IiIIII,[ whal_recv_recovery.c : 1738 ] RXDMA hang type [0x%x], cnt %d, error ts-0x%x, rin type: %x, mask 0x%x:0x%x +1523,IiIII,[ whal_recv_recovery.c : 974 ] RXOLE hang type [0x%x], cnt %d, error ts-0x%x, rin type: %x, mask 0x%x +1522,IIII,[ whal_recv_recovery.c : 1151 ] RXPCU hang type [0x%x] empty error ts-0x%x, mask 0x%x, 0x%x +1521,IIII,[ whal_recv_recovery.c : 1871 ] RXCRYPTO hang type [0x%x] empty error ts-0x%x, mask 0x%x, 0x%x +1520,i,[ whal_recv_recovery.c : 762 ] TXRX OVLAP hit on MAC-%d +1559,iiiii,[ whal_reset.c : 3644 ] channelSwitch: INI = %d TPC = %d Cal = %d Tot = %d PF = %d +1558,i,[ whal_reset.c : 2763 ] whalConfigProxyStaParams Unhandled BSS_ID :%d +1557,,[ whal_reset.c : 1175 ] DEBUG_RESTORE::Invalid access type + +1556,II,[ whal_reset.c : 1192 ] DEBUG_RESTORE::Read::addr=0x%x, value=0x%x + +1555,IiiI,[ whal_reset.c : 1209 ] DEBUG_RESTORE::Bitmask Read::addr=0x%x, bitmask=%d, bitshift=%d, value=0x%x + +1554,II,[ whal_reset.c : 1222 ] DEBUG_RESTORE::Write::addr=0x%x, value=0x%x + +1553,IiiI,[ whal_reset.c : 1240 ] DEBUG_RESTORE::Bitmask Write::addr=0x%x, bitmask=%d, bitshift=%d, value=0x%x + +1552,i,[ whal_reset.c : 1245 ] DEBUG_RESTORE::Invalid num_args_type at idx = %d + +1551,,[ whal_reset.c : 1137 ] DEBUG_CACHE::Invalid Access type + +1550,I,[ whal_reset.c : 1600 ] whalSetMACNAVOverrideCfg: value = 0x%x +1549,,[ whal_reset.c : 1069 ] DEBUG_CACHE::Clearing the cache + +1548,,[ whal_reset.c : 1114 ] DEBUG_CACHE::Invalid num args type + +1547,,[ whal_reset.c : 1075 ] DEBUG_CACHE::Invalid address + +1546,,[ whal_reset.c : 1081 ] DEBUG_CACHE::Reseting the cache idx + +1545,iIiiI,[ whal_reset.c : 1047 ] DEBUG_CACHE::args_type=%d, addr=0x%x, bitmask=%d, bitshift=%d, value=0x%x + +1579,iiIIII,[ whal_rtt.c : 1132 ] DEBUG-TKNS: %d,%d,%lu,%lu,%lu,%lu +1578,IIIIIIIIi,[ whal_rtt.c : 1144 ] DEBUG-PERF: %lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%d +1577,II,[ whal_rtt.c : 1150 ] DEBUG-PERF: %lu,%lu +1576,iiIIIIII,[ whal_rtt.c : 1101 ] DEBUG-PERF: %d,%d,%lu,%lu,%lu,%lu,%lu,%lu +1575,II,[ whal_rtt.c : 1107 ] DEBUG-PERF: %lu,%lu +1574,IIIIIIIII,[ whal_rtt.c : 575 ] RXLocInf1 0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x +1573,I,[ whal_rtt.c : 576 ] RXLocInf2 %u +1572,,[ whal_rtt.c : 232 ] whal_rtt_frame_prepare() HW is already prepared for RTT return !!! +1571,,[ whal_rtt.c : 354 ] whal_rtt_frame_recover() HW was not configured for RTT!!! return +1570,I,[ whal_rtt.c : 700 ] ar_wal_get_rssi_chain: invalid rssi_info for %p +1569,II,[ whal_rtt.c : 708 ] ar_wal_rtt_get_rssi_chain: rssi_info 0x%08x%08x +1568,IiIiii,[ whal_rtt.c : 1080 ] rtt_get_toda: txrx_msg_buf=%p toda_type=%d toda_phy_clk=%u ppdu_id=%d txrx_delay=%d status=%d +1567,ii,[ whal_rtt.c : 556 ] rtt_get_tx_rate: rate: %d bit_rate_kbps: %d +1566,Ii,[ whal_rtt.c : 939 ] recv sta rssi 0x%08x chain:%d +1565,ii,[ whal_rtt.c : 1183 ] rtt_recv_sta_get_rxbw: rx_bw=%d rx_preamble=%d +1564,iiIIiIi,[ whal_rtt.c : 184 ] whal_rtt_recv_sta_txrx_chain_handle_event: mode %d event %d tx_mask 0x%02x rx_mask 0x%02x tx_dirty %d rtt_selfgen_tx_chain_idx %u rtt_rx_chain_idx %d +1563,Ii,[ whal_rtt.c : 966 ] send sta rssi 0x%08x chain:%d +1562,I,[ whal_rtt.c : 1225 ] rtt_send_sta_get_rxbw: rtt_pkt_bw=0x%x +1561,I,[ whal_rtt.c : 1205 ] rtt_send_sta_get_txbw: packet_bw=0x%x +1560,,[ whal_rtt.c : 1344 ] ar_wal_rtt_tx_ppdu_completion_handler: excess zero values in receive_rssi_info +1581,iii,[ whal_cfir.c : 253 ] whal_cfir_configure: rtt %d capture_cfr %d capture_cir %d +1580,iiI,[ whal_cfir.c : 193 ] whal_cfir_enable: enaRttPerBurst %d enaFixedStrChain %d fixedStrChainIdx 0x%02x +1583,I,[ whal_tqm.c : 402 ] link_Desc_tshd register value:%02x +1582,I,[ whal_tqm.c : 412 ] link_Desc_tshd register value:%02x +1603,IIIIII,[ whal_xmit.c : 20680 ] fsm_client0 = %lu, fsm_client1 = %lu, fsm_client2 = %lu, fsm_client3 = %lu, fsm_client4 = %lu, fsm_client5 = %lu +1602,IIIIiII,[ whal_xmit.c : 20682 ] fsm_client6 = %lu, fsm_client7 = %lu, fsm_client8 = %lu, fsm_client9 = %lu, num of times sfm issue got hit = %d, sfm_status = %u, sfm_limit = %u +1601,i,[ whal_xmit.c : 20532 ] NAN virtual CCA: war_enable=%d +1600,iiIII,[ whal_xmit.c : 15190 ] TPCDBG: HWAdjust: tpc=%d,%d cm=%x c=%08x:%08x +1599,ii,[ whal_xmit.c : 11024 ] InfoTPC: Max TPC = %d Min TPC = %d + +1598,iiiiii,[ whal_xmit.c : 5468 ] UL_RESP_TPC_DBG : rix %d, rc_flags %d, num_chain %d, tx_mask %d, ctl_pwr %d, chan %d +1597,II,[ whal_xmit.c : 20284 ] FIPS hp %x tp %x +1596,I,[ whal_xmit.c : 20302 ] FIPS nxt_p %x +1595,,[ whal_xmit.c : 20326 ] FIPS hp null +1594,I,[ whal_xmit.c : 20355 ] FIPS %x +1593,,[ whal_xmit.c : 20366 ] FIPS nxt_p null +1592,I,[ whal_xmit.c : 20394 ] FIPS %x +1591,I,[ whal_xmit.c : 20443 ] FIPS %x +1590,,[ whal_xmit.c : 20553 ] NAN disable CCA profiling +1589,iiIII,[ whal_xmit.c : 4833 ] TPCDBG: selfGen: tpc=%d,%d cm=%x c=%08x:%08x +1588,II,[ whal_xmit.c : 9912 ] whalSetupCbfRateParams: rate code %x, flags %x +1587,I,[ whal_xmit.c : 20112 ] TXDMA WDG TXDMA_R1_DEBUG_STATES_0 reg_val: 0x%x + +1586,III,[ whal_xmit.c : 5238 ] Old mcs %x New mcs %x New rate_mask %x +1585,iIII,[ whal_xmit.c : 15769 ] TPCDBG: override: tpc=%d reason=%x c=%08x:%08x +1584,II,[ whal_xmit.c : 16430 ] Info: TPC = %u, %u + +1605,iIIII,[ data_rx.c : 658 ] DATA_TXRX_DBGID_DUP_CHECK vdev_id = %d tcp_info=0x%x SN=0x%x last_pn_valid=0x%x offset_winsize=0x%x +1604,iIIII,[ data_rx.c : 749 ] DATA_TXRX_DBGID_DUP_CHECK vdev_id = %d SN=0x%x Len=0x%x WalRxCnt=0x%x DataRxCnt=0x%x +1607,III,[ data_rx_pn.c : 151 ] DATA_TXRX_DBGID_REPLAY_CHECK_WAR KeyId=0x%x oldPN=0x%llx newPN=0x%llx +1606,IIII,[ data_rx_pn.c : 194 ] DATA_TXRX_DBGID_REPLAY_CHECK 0x%x KeyId=0x%x oldPN=0x%x newPN=0x%x +1614,ii,[ blockack.c : 413 ] ADDBA Req dropped WEP:%d MFP_SUPPORT:%d +1613,ii,[ blockack.c : 204 ] wal_ba_event_peer_rx: amsdusupported=%d, buffersize=%d +1612,ii,[ blockack.c : 1661 ] wal_ba_rx_sm: their_buf_size:%d, our_buf_size:%d +1611,ii,[ blockack.c : 2046 ] wal_ba_send_addba_rsp: amsdusupported=%d, buffersize=%d +1610,,[ blockack.c : 2524 ] BA-Link-Monitor implementation Start +1609,I,[ blockack.c : 505 ] wal_ba_start_tear_down,tid:%x + +1608,i,[ blockack.c : 1138 ] Error: ba_handle is NULL for wal_peer_id = %d +1619,iii,[ wal_lp_bar.c : 191 ] LP_BAR_DBG: lp_complete_cnt=%d,tid_num = %d, session_id = %d +1618,,[ wal_lp_bar.c : 45 ] LP_BAR_DBG: Local frame completion +1617,,[ wal_lp_bar.c : 78 ] LP_BAR_DBG: Alloc failed +1616,,[ wal_lp_bar.c : 90 ] LP_BAR_DBG: BA session not established +1615,Iiiii,[ wal_lp_bar.c : 112 ] LP_BAR_DBG: Resp_ctxt info = %x, peer_id = %d,tid_num = %d, session_id = %d, repeat_cnt = %d +1626,iiiIIi,[ htt_tgt_rx.c : 333 ] htt_tgt_fse_setup:[%d] [%d] [%d] [0x%lx] [0x%lx] RT: [%d] + +1625,iiiii,[ htt_tgt_rx.c : 396 ] htt_tgt_fse_operation pdev,ipsec,src/dest ports,proto:[%d][%d] [%d][%d] [%d] + +1624,IIIIIIII,[ htt_tgt_rx.c : 406 ] IP src [%x][%x][%x][%x] dest [%x][%x][%x][%x] + +1623,II,[ htt_tgt_rx.c : 483 ] 3-tuple Configuration value rcvd : + flow_id_toeplitz_enable : [%x] + toeplitz_2_or_4_field_enable : [%x] + +1622,IIIIIII,[ htt_tgt_rx.c : 751 ] ring_selection_cfg [%x] [%x] [%x] [%x] [%x] [%x] [%x] + +1621,iiiiii,[ htt_tgt_rx.c : 60 ] htt_tgt_sring_setup [%d] [%d] [%d] [%d] [%d] [%d] + +1620,i,[ htt_tgt_rx.c : 640 ] htt_tgt_sring_setup_done -[%d] + +1628,III,[ htt_tgt_rx_event.c : 334 ] RX event msg buf_len type[%x] peer_id [%x] vdev_id [%x] + +1627,IIIIII,[ htt_tgt_rx_event.c : 706 ] htt_tgt_rx_event_backpressure -[%x], [%x], [%x], [%x], [%x], [%x] + +1630,III,[ mac_core_main.c : 225 ] assert:r0=0x%x, r1=0x%x, line:0x%x + +1629,I,[ mac_core_main.c : 147 ] mac_core_work_loop_init: invalid wlan_driver_mode 0x%x +1642,iii,[ pktgen.c : 196 ] pktgen_calc_aggr_size: adjust pkt len: orig=%d adjust=%d mpdu=%d +1641,iii,[ pktgen.c : 1651 ] pktgen_tx_msg_handler msg hdlr: pkt len = %d pdev_id = %d mode = %d + +1640,I,[ pktgen.c : 1611 ] pktgen_data_tx_start_msg_send dev->running=0x%x +1639,,[ pktgen.c : 1810 ] pktgen_data_tx_stop_msg_send + +1638,I,[ pktgen.c : 852 ] %s: Unable to get tcl entry + +1637,I,[ pktgen.c : 870 ] %s: Unable to get tcl entry + +1636,II,[ pktgen.c : 1146 ] %s: we're dead - %u is in use now +Bitmap +1635,I,[ pktgen.c : 1155 ] 0x%X +1634,I,[ pktgen.c : 750 ] Tx done MAC id %lu + +1633,II,[ pktgen.c : 1284 ] %s: we're dead - try to free cookie %lu notused +Bitmap: +1632,I,[ pktgen.c : 1293 ] 0x%x +1631,,[ pktgen.c : 1296 ] + +1648,IIii,[ pktlog.c : 201 ] _pktlog_getbuf: pool_list_alloc failed with size %u type=%u qheap=%d missed=%d +1647,i,[ pktlog.c : 357 ] Dropped buffer for pktlog_type:%d +1646,I,[ pktlog.c : 774 ] FLUSHSTATS INFRA_4 HIF RINGSEND buffer:0x%x +1645,I,[ pktlog.c : 710 ] _pktlog_disable: already disabled, bmap=0x%x +1644,I,[ pktlog.c : 584 ] _pktlog_enable: already enabled, bmap=0x%x +1643,II,[ pktlog.c : 589 ] _pktlog_enable: enable %u evlist %08x +1654,iii,[ wal_channel_change_hw.c : 653 ] ADFS_DUMPS MAC-Received agile channel command for center_freq1:%d center_freq2:%d flags=%d + +1653,i,[ wal_channel_change_hw.c : 659 ] ADFS_DUMPS rc=%d + +1652,IiIIII,[ wal_channel_change_hw.c : 410 ] WAL_DBGID_CHANNEL_CHANGE_FORCE_RESET: mhz = %04d mac_id = %d phy_mode = %02d flags = 0x%04x rx_stop|tx_stop = 0x%x pf_cnt = %02d +1651,IiIII,[ wal_channel_change_hw.c : 419 ] WAL_DBGID_CHANNEL_CHANGE: mhz = %04d mac_id = %d phy_mode = %02d flags = 0x%04x pf_cnt = %02d +1650,ii,[ wal_channel_change_hw.c : 507 ] phyId %d Caling DPD SM for home channel %d + +1649,iiii,[ wal_channel_change_hw.c : 573 ] GreenAP wal_set_greenap_channel error tx/rx chainmask: %d/%d, phy_mode: %d, flag: %d +1677,ii,[ ar_wal_tx_de.c : 2847 ] security: sw_peer_id=%d WAL_DBGID_TX_EAPOL_PKT type=%d +1676,iiiiI,[ ar_wal_tx_de.c : 2944 ] security: sw_peer_id=%d WAL_DBGID_TX_EAPOL_PKT M%d or G%d key_type:%d key_val:0x%02x +1675,,[ ar_wal_tx_de.c : 1901 ] DE classify: invalid bcast mcast +1674,ii,[ ar_wal_tx_de.c : 2032 ] DE enq: ARP req|actual_tid_num = %d %d +1673,ii,[ ar_wal_tx_de.c : 2068 ] DE enq: DHCP|actual_tid_num = %d %d +1672,i,[ ar_wal_tx_de.c : 2512 ] Drop frame: qos_to_nonqos_switch in progress, peer_id:%d +1671,,[ ar_wal_tx_de.c : 2577 ] WAL_DBGID_TX_EAPOL_PKT peer is disassoced +1670,,[ ar_wal_tx_de.c : 2584 ] WAL_DBGID_TX_EAPOL_PKT qpeer is not valid +1669,iiIiIiI,[ ar_wal_tx_de.c : 1726 ] DE enq: sw_peer_id=%d tid=%d fc=0x%x type=%d msdu_flags=0x%x len=%d id=0x%x +1668,ii,[ ar_wal_tx_de.c : 414 ] wal_tx_de_wbm_complete_handler vdev_id = %d, buffer_id = %d +1667,ii,[ ar_wal_tx_de.c : 420 ] wal_tx_de_wbm_complete_handler WAL_BUFFERID_TX_DELETE_ALL_PEER_TCL_DUMMY_FRAME vdev_id = %d, peer_id = %d +1666,i,[ ar_wal_tx_de.c : 431 ] wal_tx_de_wbm_complete_handler WAL_VDEV_DEL_ALL_PEER_TCL_DUMMY_FRAME_DONE vdev_id = %d +1665,ii,[ ar_wal_tx_de.c : 436 ] wal_tx_de_wbm_complete_handler WAL_BUFFERID_TX_DELETE_ALL_PEER_TQM_DUMMY_FRAME vdev_id = %d, peer_id = %d +1664,i,[ ar_wal_tx_de.c : 447 ] wal_tx_de_wbm_complete_handler WAL_VDEV_DEL_ALL_PEER_TQM_DUMMY_FRAME_DONE vdev_id = %d +1663,i,[ ar_wal_tx_de.c : 462 ] wal_tx_de_wbm_complete_handler WAL_VDEV_DEL_ALL_PEER_TCL_DUMMY_FRAME_DONE & WAL_VDEV_DEL_ALL_PEER_TQM_DUMMY_FRAME_DONE vdev_id = %d +1662,iii,[ ar_wal_tx_de.c : 465 ] wal_tx_de_wbm_complete_handler vdev_id = %d, thread_id = %d, msg_id = %d +1661,iii,[ ar_wal_tx_de.c : 484 ] qos_to_nonqos_switch: Received tcl dummy frame compl peer_id:%d status:%d buffer_id:%d +1660,,[ ar_wal_tx_de.c : 498 ] qos_to_nonqos_switch: Received tqm dummy frame compl in wbm2fw release ring +1659,IiIiii,[ ar_wal_tx_de.c : 3116 ] DE wbm2fw: cookie=0x%x sw_peer_id=%d flags=0x%x msdu_len=%d rel_md=%d,rel_reason=%d +1658,i,[ ar_wal_tx_de.c : 3788 ] wal_tx_de_delete_all_peer_handler vdev_id = %d +1657,,[ ar_wal_tx_de.c : 3231 ] invalid_msdu - about to free to FW +1656,,[ ar_wal_tx_de.c : 3236 ] invalid_msdu - about to free to host +1655,IIII,[ ar_wal_tx_de.c : 3768 ] restore SN: tid=%x, mpdu_last_seq_num=%X, frameq=%p %x +1752,,[ wal_phy_dev_hw.c : 10564 ] AWGN_INT_DBG : cca_int reduce BW 20Mhz + +1751,,[ wal_phy_dev_hw.c : 10567 ] AWGN_INT_DBG : cca_int reduce BW 40Mhz + +1750,,[ wal_phy_dev_hw.c : 10571 ] AWGN_INT_DBG : cca_in Primary + +1749,,[ wal_phy_dev_hw.c : 10575 ] AWGN_INT_DBG : cca_int reduce BW 80Mhz + +1748,,[ wal_phy_dev_hw.c : 10585 ] AWGN_INT_DBG : cca_int ack restore + +1747,i,[ wal_phy_dev_hw.c : 10591 ] AWGN_INT_DBG : cca_int bw restore cur_bw = %d + +1746,I,[ wal_phy_dev_hw.c : 10606 ] AWGN_INT_DBG : bw_drop cca_seg =0x%x + +1745,i,[ wal_phy_dev_hw.c : 10614 ] AWGN_INT_DBG : bw_drop restore cur_bw = %d + +1744,,[ wal_phy_dev_hw.c : 10622 ] AWGN_INT_DBG : pkt_drop ack blk + +1743,,[ wal_phy_dev_hw.c : 10629 ] AWGN_INT_DBG : pkt_drop ack restore + +1742,Iiii,[ wal_phy_dev_hw.c : 10635 ] AWGN_INT_DBG : Sending WMI Event cca_seg =0x%x cca_int = %d pkt_drop = %d bw_drop = %d + +1741,iII,[ wal_phy_dev_hw.c : 6952 ] RXPCU WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1740,iIII,[ wal_phy_dev_hw.c : 6979 ] TXPCU WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x, PhyErr 0x%x +1739,iII,[ wal_phy_dev_hw.c : 7004 ] TXDMA WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1738,iII,[ wal_phy_dev_hw.c : 7044 ] RXOLE WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1737,iII,[ wal_phy_dev_hw.c : 7061 ] TXOLE WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1736,iII,[ wal_phy_dev_hw.c : 7074 ] CRYPTO WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1735,iII,[ wal_phy_dev_hw.c : 7095 ] RXDMA WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1734,iII,[ wal_phy_dev_hw.c : 7112 ] PDG WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1733,iII,[ wal_phy_dev_hw.c : 7137 ] HWSCH WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1732,iII,[ wal_phy_dev_hw.c : 7217 ] MXI WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1731,iII,[ wal_phy_dev_hw.c : 7227 ] AMPI WDOG error interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1730,I,[ wal_phy_dev_hw.c : 8938 ] WAL_DBGID_DEV_TX_TIMEOUT 0x%x +1729,iIIIII,[ wal_phy_dev_hw.c : 8246 ] %d [CCA:myRxFrame]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1728,iIIIII,[ wal_phy_dev_hw.c : 8251 ] %d [CCA:rxFrame]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1727,iIIIII,[ wal_phy_dev_hw.c : 8256 ] %d [CCA:rx_busy_cnt]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1726,iIIIII,[ wal_phy_dev_hw.c : 8261 ] %d [CCA:tx_frame_cnt]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1725,iII,[ wal_phy_dev_hw.c : 7328 ] CRYPTO panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1724,iII,[ wal_phy_dev_hw.c : 7659 ] PDG panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1723,iII,[ wal_phy_dev_hw.c : 7782 ] HWSCH panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1722,iII,[ wal_phy_dev_hw.c : 7799 ] MXI panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1721,iII,[ wal_phy_dev_hw.c : 7869 ] AMPI panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1720,iII,[ wal_phy_dev_hw.c : 7882 ] TXOLE panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1719,iII,[ wal_phy_dev_hw.c : 7961 ] RXOLE panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1718,iII,[ wal_phy_dev_hw.c : 7974 ] SFM panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1717,iII,[ wal_phy_dev_hw.c : 8007 ] RXDMA1 panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1716,iII,[ wal_phy_dev_hw.c : 8021 ] RXDMA_SRC_RNG panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1715,iII,[ wal_phy_dev_hw.c : 8034 ] RXDMA_DST_RNG panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1714,iII,[ wal_phy_dev_hw.c : 8049 ] RXDMA1_SRC_RNG panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1713,iII,[ wal_phy_dev_hw.c : 8061 ] RXDMA1_DST_RNG panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1712,iII,[ wal_phy_dev_hw.c : 8073 ] MCMN panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1711,iII,[ wal_phy_dev_hw.c : 7381 ] TXPCU0 panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1710,iII,[ wal_phy_dev_hw.c : 7522 ] TXDMA panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1709,iII,[ wal_phy_dev_hw.c : 7623 ] RXDMA panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1708,iII,[ wal_phy_dev_hw.c : 7635 ] RXPCU0 panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1707,iII,[ wal_phy_dev_hw.c : 7647 ] RXPCU1 panic interrupt on PDEV ID-%d, mask 0x%x, total count 0x%x + +1706,,[ wal_phy_dev_hw.c : 2053 ] Don't reset as CHIP IS IN POWER DOWN STATE +1705,II,[ wal_phy_dev_hw.c : 2541 ] ctrl_path_stats_dbg: mac_addr31to0 = 0x%x mac_addr47to32 = 0x%x + +1704,I,[ wal_phy_dev_hw.c : 6797 ] PHY M3 requested WARM reset for PHY: %x + +1703,III,[ wal_phy_dev_hw.c : 6810 ] M3SSR asserted on pdev:%x MAC_ID:%x ts:%x + +1702,I,[ wal_phy_dev_hw.c : 6817 ] PHY M3 Assert for PHY: %x + +1701,Iii,[ wal_phy_dev_hw.c : 10497 ] AWGN_INT_DBG get = 0x%x period = %d inited = %d +1700,IIIII,[ wal_phy_dev_hw.c : 10237 ] AWGN_INT_DBG register read ed = 0x%x gi = 0x%x sec_mask = 0x%x seg =0x%x intr = 0x%x + +1699,IiiiiIii,[ wal_phy_dev_hw.c : 10257 ] AWGN_INT_DBG compute_cca current_time = %ld cca1 = %d cca2 = %d ed_mu = %d gi_mu = %d cc_cnt = %ld tx_frm = %d rx_frm = %d + +1698,iiiiii,[ wal_phy_dev_hw.c : 10269 ] AWGN_INT_DBG tx_frame_1 = %d tx_frame = %d rx_frame_1 = %d rx_frame = %d cc_1 = %d cc = %d + +1697,iii,[ wal_phy_dev_hw.c : 10274 ] AWGN_INT_DBG tx_prop = %d rx_prop = %d cc_diff = %d + +1696,iii,[ wal_phy_dev_hw.c : 10308 ] AWGN_INT_DBG p_cca1 = %d p_cca2 = %d time_diff = %d + +1695,IIiiiiii,[ wal_phy_dev_hw.c : 10331 ] AWGN_INT_DBG cur_time = 0x%x current_time = %ld cca1 = %d cca2 = %d ed_mu = %d gi_mu = %d awgn_cca_edmu_ind = %d interference_count = %d + +1694,iiiiii,[ wal_phy_dev_hw.c : 10372 ] AWGN_INT_DBG tx_frame_1 = %d tx_frame = %d rx_frame_1 = %d rx_frame = %d cc_1 = %d cc = %d + +1693,iii,[ wal_phy_dev_hw.c : 10377 ] AWGN_INT_DBG tx_prop = %d fudge_fact = %d cc_diff = %d + +1692,III,[ wal_phy_dev_hw.c : 10393 ] AWGN_INT_DBG compute_seg ed_mu = 0x%x gi_mu = 0x%x int_detected = 0x%x + +1691,II,[ wal_phy_dev_hw.c : 10414 ] AWGN_INT_DBG Interrrupt Not detected gi_mask = 0x%x sec_mask = 0x%x + +1690,I,[ wal_phy_dev_hw.c : 10432 ] AWGN_INT_DBG Interrupt detected at Segment = 0x%x + +1689,I,[ wal_phy_dev_hw.c : 10446 ] AWGN_INT_DBG Interrupt detected at Segment = 0x%x + +1688,II,[ wal_phy_dev_hw.c : 10470 ] AWGN_INT_DBG Pri gi_mask = 0x%x mask = 0x%x + +1687,II,[ wal_phy_dev_hw.c : 10485 ] AWGN_INT_DBG Sec gi_mask = 0x%x mask = 0x%x + +1686,ii,[ wal_phy_dev_hw.c : 1930 ] WAL_PDEV_RESUME_REQ req = %d, is_pdev_pause = %d +1685,iiiii,[ wal_phy_dev_hw.c : 1843 ] WAL_PDEV_SUSPEND_REQ req = %d, reason %d, is_pdev_pause = %d, force_sync = %d, resume_inline = %d +1684,iIIIII,[ wal_phy_dev_hw.c : 8443 ] %d [TX_RX_STATS:hw_queued]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1683,iIIIII,[ wal_phy_dev_hw.c : 8452 ] %d [TX_RX_STATS:hw_reaped]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1682,iIIIII,[ wal_phy_dev_hw.c : 8462 ] %d [TX_RX_STATS:hw_flush]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1681,iIIIII,[ wal_phy_dev_hw.c : 8472 ] %d [TX_RX_STATS:hw_filt]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1680,iIIIII,[ wal_phy_dev_hw.c : 8482 ] %d [TX_RX_STATS:ppdu_recvd]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1679,iIIIII,[ wal_phy_dev_hw.c : 8492 ] %d [TX_RX_STATS:mpdu_cnt_fcs_ok]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1678,iIIIII,[ wal_phy_dev_hw.c : 8502 ] %d [TX_RX_STATS:ppdu_recvd]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +1773,II,[ wal_soc_dev_hw.c : 525 ] TCL0 panic interrupt mask : 0x%x, total count 0x%x + +1772,II,[ wal_soc_dev_hw.c : 536 ] TCL1 panic interrupt mask : 0x%x, total count 0x%x + +1771,II,[ wal_soc_dev_hw.c : 627 ] TQM0 panic interrupt mask : 0x%x, total count 0x%x + +1770,II,[ wal_soc_dev_hw.c : 660 ] TQM1 panic interrupt mask : 0x%x, total count 0x%x + +1769,II,[ wal_soc_dev_hw.c : 723 ] TQM2 panic interrupt mask : 0x%x, total count 0x%x + +1768,II,[ wal_soc_dev_hw.c : 850 ] APB panic interrupt mask : 0x%x, total count 0x%x + +1767,II,[ wal_soc_dev_hw.c : 1016 ] GXI panic interrupt mask : 0x%x, total count 0x%x + +1766,II,[ wal_soc_dev_hw.c : 859 ] MEM panic interrupt mask : 0x%x, total count 0x%x + +1765,II,[ wal_soc_dev_hw.c : 868 ] WBM0 panic interrupt mask : 0x%x, total count 0x%x + +1764,II,[ wal_soc_dev_hw.c : 928 ] WBM1 panic interrupt mask : 0x%x, total count 0x%x + +1763,II,[ wal_soc_dev_hw.c : 944 ] WBM2 panic interrupt mask : 0x%x, total count 0x%x + +1762,II,[ wal_soc_dev_hw.c : 957 ] RE0 panic interrupt mask : 0x%x, total count 0x%x + +1761,II,[ wal_soc_dev_hw.c : 966 ] REO1 panic interrupt mask : 0x%x, total count 0x%x + +1760,II,[ wal_soc_dev_hw.c : 975 ] REO2 panic interrupt mask : 0x%x, total count 0x%x + +1759,II,[ wal_soc_dev_hw.c : 984 ] REO3 panic interrupt mask : 0x%x, total count 0x%x + +1758,I,[ wal_soc_dev_hw.c : 991 ] SM_IX_2 value:%x +1757,II,[ wal_soc_dev_hw.c : 1007 ] REO4 panic interrupt mask : 0x%x, total count 0x%x + +1756,I,[ wal_soc_dev_hw.c : 1748 ] PN dummy MSDU(%x) returned +1755,i,[ wal_soc_dev_hw.c : 1305 ] Enter/Exit WoW mode :%d +1754,,[ wal_soc_dev_hw.c : 1348 ] Entering into WoW mode is done +1753,,[ wal_soc_dev_hw.c : 1367 ] Exiting from WoW mode is done +1774,iIiiii,[ ar_wal_vdev_hw.c : 404 ] VDEV migration sync: ba_migrate, thread_id=%d, peer=%p, vdev_id=%d, vdev_type=%d, pdev_id=%d:%d +1783,iiii,[ wal_soc_debug.c : 233 ] wal_unit_test: num_args = %d test_cmd = %d arg[1] = %d arg[2] = %d +1782,,[ wal_soc_debug.c : 713 ] Recorded page fault count reset to 0 +1781,i,[ wal_soc_debug.c : 715 ] Total page fault count: %d +1780,i,[ wal_soc_debug.c : 719 ] Recorded page fault count: %d +1779,i,[ wal_soc_debug.c : 721 ] Total page fault count: %d +1778,IIIII,[ wal_soc_debug.c : 859 ] pcss_ring_feeder num_interrupts:%u, num_pcss_elem_zero:%u, num_in_elem_zero:%u, num_out_elem_zero:%u, num_elem_moved:%u + +1777,iiii,[ wal_soc_debug.c : 991 ] wal_unit_test: num_args = %d test_cmd = %d arg[1] = %d arg[2] = %d +1776,I,[ wal_soc_debug.c : 582 ] page fault in wow: 0x%x +1775,i,[ wal_soc_debug.c : 712 ] Recorded page fault count: %d +1784,Ii,[ direct_dma_config.c : 212 ] dma_prepare %p status %d +1790,IIIIIIII,[ host_ring_reader.c : 348 ] host ring reader %p has base address 0x%08x%08x, %u elements, tail address 0x%08x%08x, head address 0x%08x%08x +1789,IIIIII,[ host_ring_reader.c : 162 ] host_ring_reader_read_elems: reader %p head_idx %u tail_idx %u shadow_tail_idx %u num_avail %u num_free %u +1788,III,[ host_ring_reader.c : 183 ] tail dirty host ring reader %p head index is %u, shadow tail index is %u +1787,II,[ host_ring_reader.c : 81 ] host_ring_reader_read_elems_compl: host ring reader %p read %u elements +1786,I,[ host_ring_reader.c : 298 ] host ring reader %p stop request +1785,IIIi,[ host_ring_reader.c : 39 ] host ring reader %p failed to copy from address 0x%08x%08x with status %d +1795,iiI,[ pcss_ring_feeder.c : 241 ] PHY %d ring %d has %u elements remaining +1794,III,[ pcss_ring_feeder.c : 267 ] pcss_ring_feeder_handle_ipc : head = %u shadow_head = %u and num_elems = %u for out_ring +1793,I,[ pcss_ring_feeder.c : 278 ] pcss_ring_feeder_handle_ipc : num elems_dmaed = %u for out_ring +1792,iiII,[ pcss_ring_feeder.c : 382 ] PHY %d ring %d needs %u elements; have %u +1791,iiIIIIII,[ pcss_ring_feeder.c : 499 ] pcss_ring_status_print: PHY %d ring %d event %c%u head_idx %u tail_idx %u num_avail %u num_free %u +1824,IIiIi,[ ar_wal_local_frames.c : 2389 ] LOCAL abf completion internal,peer=%x,abf=%x,flags=%d,abf_thread=%x,cur_thread=%d +1823,IIiIi,[ ar_wal_local_frames.c : 2396 ] LOCAL abf completion internal,peer=%x,abf=%x,flags=%d,abf_thread=%x,cur_thread=%d +1822,IIiIiI,[ ar_wal_local_frames.c : 2301 ] LOCAL abf completion msg:peer_id=%x,abf=%x,flag=%d,abf_thread=%x,cur_thread=%d,target_thread=%x +1821,IIIiII,[ ar_wal_local_frames.c : 2258 ] Deliver LOCAL buffer sending msg failure: tid=%x,peer=%x,abf=%x,flag=%d,target_thread=%x, is_data:%x +1820,ii,[ ar_wal_local_frames.c : 1237 ] Local data send: use default tid, requested TID:%d, tid_alloc_status=%d +1819,II,[ ar_wal_local_frames.c : 1439 ] Local EAPOL M4 duplicated, peer:%x, qpeer-flag=%x +1818,iiI,[ ar_wal_local_frames.c : 1494 ] Local data send: use tqm-tid %d, num:%d, flags:0x%x +1817,iiIII,[ ar_wal_local_frames.c : 1558 ] local_data_frame_send vdev_id=%d mac_id=%d seq_num=0x%x type=0x%x status =0x%x +1816,I,[ ar_wal_local_frames.c : 188 ] MGMT_TX_WMI_FROM_HOST TX COMP: flags = 0x%x +1815,IIIiii,[ ar_wal_local_frames.c : 384 ] local_frame_handle_completion: SN=0x%x/0x%x, type=0x%x, thread=%d/%d, status=%d +1814,iii,[ ar_wal_local_frames.c : 388 ] local_frame_handle_completion: thread=%d/%d, status=%d +1813,iiIIIIi,[ ar_wal_local_frames.c : 328 ] WAL_DBGID_TX_MGMT_COMP_DESCID_STATUS vdev_id=%d mac_id=%d dec_id=0x%x tx_status=0x%x tid=0x%x buffer_id=0x%x reset_cnt=%d +1812,iI,[ ar_wal_local_frames.c : 332 ] WAL_DBGID_TX_MGMT_COMP_DESCID_STATUS vdev_id=%d tx_status=0x%x +1811,IIIIiiIiI,[ ar_wal_local_frames.c : 477 ] local_frame_handle_completion_tqm, DA:%X-%X,type=0x%X,DATA:0x%X,thread=%d/%d,cookie=%X,status=%d,flags=0x%x +1810,ii,[ ar_wal_local_frames.c : 925 ] WAL_DBGID_TX_MGMT_ENQUEUE_FAILED vdev_id = %d tid:%d +1809,iiIIIII,[ ar_wal_local_frames.c : 1100 ] WAL_DBGID_TX_MGMT_DESCID_SEQ_TYPE_LEN vdev_id=%d mac_id=%d cookie=0x%x seq_num=0x%x type=0x%x len=0x%x tid_flg=0x%x +1808,iiIIIII,[ ar_wal_local_frames.c : 1111 ] DBG WAL_DBGID_TX_MGMT_DESCID_SEQ_TYPE_LEN vdev_id=%d mac_id=%d cookie=0x%x seq_num=0x%x type=0x%x len=0x%x tid_flg=0x%x +1807,IIi,[ ar_wal_local_frames.c : 1128 ] ctrl_path_stats_dbg: mac_address equal mac_0 = 0x%x mac_2 =0x%x subtype = %d + +1806,i,[ ar_wal_local_frames.c : 2186 ] send local buffer fail: sw_peer_id=%d migration in progress +1805,II,[ ar_wal_local_frames.c : 2216 ] send local buffer fail: status=%x, flags=%x +1804,IIII,[ ar_wal_local_frames.c : 2150 ] local_data, peer(%p, sw_peer_id:%x) pdev mismatch(%p:%p) +1803,IIII,[ ar_wal_local_frames.c : 2095 ] local_mgmt, peer(%p, sw_peer_id:%x) pdev mismatch(%p:%p) +1802,ii,[ ar_wal_local_frames.c : 1726 ] WAL_DBGID_TX_MGMT_ENQUEUE_FAILED vdev_id = %d tid:%d +1801,IIII,[ ar_wal_local_frames.c : 1763 ] host_mgmt, peer(%p, sw_peer_id:%x) pdev mismatch(%p:%p) +1800,Ii,[ ar_wal_local_frames.c : 1780 ] MGMT_TX_WMI_FROM_HOST flags = %x, is_wmi = %d +1799,iiIIII,[ ar_wal_local_frames.c : 1894 ] WAL_DBGID_TX_MGMT_DESCID_SEQ_TYPE_LEN vdev_id=%d mac_id=%d cookie=0x%x seq_num=0x%x type=0x%x len=0x%x +1798,iiIIII,[ ar_wal_local_frames.c : 1903 ] DBG WAL_DBGID_TX_MGMT_DESCID_SEQ_TYPE_LEN vdev_id=%d mac_id=%d cookie=0x%x seq_num=0x%x type=0x%x len=0x%x +1797,IIi,[ ar_wal_local_frames.c : 1919 ] ctrl_path_stats_dbg: mac_address equal mac_0 = 0x%x mac_2 =0x%x subtype = %d + +1796,iIiiI,[ ar_wal_local_frames.c : 1954 ] WAL_DBGID_MGMT_TX_FAIL vdev_id=%d, err_code=%x, cookie=%d, status=%d, fc[0]=%x +1839,i,[ ar_wal_monitor.c : 1320 ] dev-%d:POLICY_ENFORCE_STATE --> MONITOR_TIMER_RUNNING_STATE +1838,i,[ ar_wal_monitor.c : 381 ] dev-%d:TIMER_RUNNING_STATE --> MONITOR_STATS_COLLECTION_STATE +1837,i,[ ar_wal_monitor.c : 408 ] dev-%d:WAIT_POLICY_ENFORCE_STATE --> MONITOR_POLICY_ENFORCE_STATE +1836,i,[ ar_wal_monitor.c : 840 ] dev-%d:STATS_COLLECTION_STATE --> MONITOR_WAIT_POLICY_ENFORCE_STATE +1835,ii,[ ar_wal_monitor.c : 852 ] dev-%d:STATS_COLLECTION_STATE --> MONITOR_STATS_COLLECTION_STATE last_peer_idx:%d +1834,i,[ ar_wal_monitor.c : 356 ] dev-%d:INIT_STATE --> MONITOR_TIMER_RUNNING_STATE +1833,IIiI,[ ar_wal_monitor.c : 360 ] %s %s send signal=%d to thread=%s to start timer + +1832,IIiI,[ ar_wal_monitor.c : 94 ] %s %s send signal=%d to thread=%s to yield + +1831,iiii,[ ar_wal_monitor.c : 1047 ] CONGCTRL HOST_CONTROL UPDATE aid:%d tid_num:%d threshold_1:%d threshold_2:%d + +1830,iii,[ ar_wal_monitor.c : 1073 ] CONGCTRL HOST_CONTROL UPDATE aid:%d tid_num:%d new drop_threshold:%d +1829,iii,[ ar_wal_monitor.c : 1114 ] CONGCTRL FW_CONTROL UPDATE aid:%d tid_num:%d new drop_threshold:%d +1828,iiI,[ ar_wal_monitor.c : 1175 ] CONGCTRL peer_id:%d tid_num:%d msduq_mask:0x%08x +1827,iiiiiii,[ ar_wal_monitor.c : 967 ] CONGCTRL HOST_CONTROL peer_id:%d tid_num:%d traffic_enq:%d drop:%d deq:%d old_threshold:%d new_threshold:%d +1826,iii,[ ar_wal_monitor.c : 714 ] qstats_update peer_id:%d tid_num:%d qtype:%d +1825,IIIIIi,[ ar_wal_monitor.c : 275 ] _wal_txrx_monitor_pdev_record: type %x rx msdu %x ppdu %x, tx msdu %x ppdu %x phy_mode %d + +1860,,[ ar_wal_ast.c : 419 ] WAL_DBGID_AST_ENTRY_FULL WAL_ENOSPC +1859,,[ ar_wal_ast.c : 1517 ] WAL_DBGID_AST_ENTRY_EXIST WAL_EEXIST +1858,IIII,[ ar_wal_ast.c : 1526 ] WAL_AST_ALLOC_PEER peer_mac:0x%x ast_index:0x%x sw_peer_id:0x%x ast_flags:0x%x +1857,i,[ ar_wal_ast.c : 1476 ] ar_wal_ast_dummy_alloc_peer ast_index = %d +1856,III,[ ar_wal_ast.c : 491 ] WAL_DBGID_AST_DEL_WDS_ENTRY 0x%x 0x%x 0x%x +1855,IIII,[ ar_wal_ast.c : 1659 ] WAL_DBGID_AST_ADD_MONITOR_DIRECT_ENTRY 0x%x 0x%x 0x%x 0x%x +1854,IIII,[ ar_wal_ast.c : 1678 ] WAL_DBGID_AST_ADD_MONITOR_DIRECT_ENTRY 0x%x 0x%x 0x%x 0x%x +1853,IIIIi,[ ar_wal_ast.c : 1683 ] WAL_DBGID_AST_ADD_MONITOR_DIRECT_ENTRY 0x%x 0x%x 0x%x 0x%x pdev_id:%d +1852,IIIII,[ ar_wal_ast.c : 1118 ] WAL_DBGID_AST_ADD_WDS_ENTRY 0x%x 0x%x 0x%x 0x%x 0x%x +1851,IIIII,[ ar_wal_ast.c : 1152 ] WAL_DBGID_AST_ADD_WDS_ENTRY 0x%x 0x%x 0x%x 0x%x 0x%x +1850,IIIIIi,[ ar_wal_ast.c : 1161 ] WAL_DBGID_AST_ADD_WDS_ENTRY 0x%x 0x%x 0x%x 0x%x 0x%x pdev_id:%d +1849,II,[ ar_wal_ast.c : 1827 ] WAL_DBGID_AST_DEL_ALL_MONITOR_DIRECT_ENTRY 0x%x 0x%x +1848,II,[ ar_wal_ast.c : 1295 ] WAL_DBGID_AST_FREE_WDS_ENTRY des_mac is not next_hop or monitor direct 0x%x 0x%x +1847,IIII,[ ar_wal_ast.c : 1730 ] WAL_DBGID_AST_DEL_MONITOR_DIRECT_ENTRY 0x%x 0x%x 0x%x 0x%x +1846,IIII,[ ar_wal_ast.c : 1771 ] WAL_DBGID_AST_DEL_MONITOR_DIRECT_ENTRY 0x%x 0x%x 0x%x 0x%x +1845,I,[ ar_wal_ast.c : 2196 ] SW peer key not found, peer_mac-0x%x +1844,IiIIIII,[ ar_wal_ast.c : 2209 ] Update reorder queue peer_mac-0x%x, sw_peer_id-%d, queue_addr-0x%x:0x%x, queue-%x, ba_win-0x%x:0x%x +1843,IIi,[ ar_wal_ast.c : 1210 ] WAL_DBGID_AST_UPDATE_WDS_ENTRY FAILED due to peer mac search failed 0x%x 0x%x pdev_id:%d +1842,IIi,[ ar_wal_ast.c : 1218 ] WAL_DBGID_AST_UPDATE_WDS_ENTRY FAILED due to dest mac search failed 0x%x 0x%x pdev_id:%d +1841,IIII,[ ar_wal_ast.c : 1239 ] WAL_DBGID_AST_UPDATE_WDS_ENTRY 0x%x 0x%x 0x%x 0x%x +1840,IIII,[ ar_wal_ast.c : 1246 ] WAL_DBGID_AST_UPDATE_WDS_ENTRY des_mac is not next_hop 0x%x 0x%x 0x%x 0x%x +1947,ii,[ ar_wal_peer.c : 9666 ] _wal_peer_alloc_tid: got tid flush handle for tidno %d sw_peer_id:%d + +1946,IiiiI,[ ar_wal_peer.c : 9748 ] ul_dbg_tid_alloc: peer=0x%x, tidno=%d, ac=%d, timeout_ms=%d, tid_ptr=0x%x +1945,i,[ ar_wal_peer.c : 9798 ] _wal_peer_alloc_tid: adding tid %d to temp tid list + +1944,iIIIIII,[ ar_wal_peer.c : 1001 ] PEER_DELETE_DBG: pdev_id: %d ar_wal_peer_clean_up_flow:%x,%x,%x,%x,%x, invalidate:%x + +1943,iIIIII,[ ar_wal_peer.c : 1022 ] pdev_id: %d ar_wal_peer_clean_up_flow:%x,%x,%x,%x,%x, +1942,III,[ ar_wal_peer.c : 1035 ] ar_wal_peer_clean_up_flow:%x,%x,%x +1941,IIIiII,[ ar_wal_peer.c : 3166 ] FREE_AST_ENTRY: peer=%p mac_addr=0x%x %x invalidate=%d ast_index=0x%x valid_bmap[ast_index]=0x%x +1940,ii,[ ar_wal_peer.c : 9907 ] _ar_wal_peer_free_tid: sw_peer_id=%d, tidno=%d +1939,ii,[ ar_wal_peer.c : 9921 ] _ar_wal_peer_free_tid: sending tid flush cmd to tac thread_id=%d, tidno=%d + +1938,iiIiII,[ ar_wal_peer.c : 13213 ] mpdu_reconstruct_block_cb:pdev(%d)peer %d,flags=0x%x,del=%d,block=0x%x,recon=0x%x +1937,IIIIII,[ ar_wal_peer.c : 4839 ] pdev(%x)peer %x blocked for tidLen update,refcnt=%x,htc=%x,remap=%x,security=%x +1936,iIiI,[ ar_wal_peer.c : 5010 ] security: ar_wal_peer_set_key_block_cb: peer_id:%d peer_flags:%02x authrized:%d qpeer_flags:%x +1935,iIi,[ ar_wal_peer.c : 5053 ] security: ar_wal_peer_set_mcast_key_block_cb: peer_id:%d peer_flags:%02x authrized:%d +1934,,[ ar_wal_peer.c : 8913 ] qdepth_thresh_update_cmd_handler: Invalid sw_peer_key +1933,,[ ar_wal_peer.c : 8920 ] qdepth_thresh_update_cmd_handler: Invalid peer +1932,,[ ar_wal_peer.c : 8930 ] qdepth_thresh_update_cmd_handler: is_self_peer or bss_peer +1931,,[ ar_wal_peer.c : 8941 ] qdepth_thresh_update_cmd_handler: peer delete in progress +1930,i,[ ar_wal_peer.c : 8962 ] qdepth_thresh_update_cmd_handler: not valid TID give tidno:%d +1929,i,[ ar_wal_peer.c : 8974 ] qdepth_thresh_update_cmd_handler: not valid tqm tid tidno:%d +1928,ii,[ ar_wal_peer.c : 8991 ] qdepth_thresh_update_cmd_handler: qtype:%d host_drop_th:%d +1927,ii,[ ar_wal_peer.c : 9950 ] _ar_wal_peer_tidq_empty: thread_id =%d,tidq->tid_num=%d + +1926,IIIIIII,[ ar_wal_peer.c : 4749 ] update MPDUq hdrlen, peer=%x,tid_num=%x,tid_flg=%x %x,orig=%x,new=%x,wow=%x +1925,,[ ar_wal_peer.c : 11775 ] wal_htt_peer_stats_reset: Peer pointer is NULL +1924,IIi,[ ar_wal_peer.c : 2364 ] WAL_ALLOC_PEER_AST_FAIL peer_addr 0x04%x08%x type %d +1923,i,[ ar_wal_peer.c : 2659 ] PEER_ALLOC: peer_id=%d: Fail to allocate wmm_param +1922,II,[ ar_wal_peer.c : 2867 ] ADDR_TYPE_A: mac_adr_31_0=0x%x, mac_addr_32_47=0x%x +1921,II,[ ar_wal_peer.c : 2870 ] ADDR_TYPE_B peer: mac_adr_31_0=0x%x, mac_addr_32_47=0x%x +1920,II,[ ar_wal_peer.c : 2873 ] ADDR_TYPE_C self: mac_adr_31_0=0x%x, mac_addr_32_47=0x%x +1919,III,[ ar_wal_peer.c : 12201 ] OMI: Change a_ctrl from 0x%lx to 0x%lx, ULMU Disable is 0x%lx + +1918,ii,[ ar_wal_peer.c : 3709 ] wal_peer_delete_conf_msg_hdlr: peer=%d,num_del_in_pro=%d +1917,ii,[ ar_wal_peer.c : 3732 ] wal_peer_delete_conf_msg_hdlr: peer = %d, pdev_peer_deletes_in_progress = %d + +1916,iiI,[ ar_wal_peer.c : 3632 ] _wal_peer_del_msg_hdlr: thread_id =%d, sw_peer_id=%d, peer->peer_flgs=0x%x + +1915,iii,[ ar_wal_peer.c : 3919 ] wal_peer_delete_resume: peer = %d, delete_in_progress %d pdev_peer_deletes_in_progress = %d + +1914,iII,[ ar_wal_peer.c : 13060 ] security: WAL_DBGID_SECURITY_PM4_SENT peer_id:%d, peer_flag:0x%x, qpeer_flag:0x%x +1913,i,[ ar_wal_peer.c : 10643 ] wal_peer_mcast_cfg AST entry not found for key_id:%d +1912,Iii,[ ar_wal_peer.c : 10647 ] wal_peer_fill_mcast_key_info: peer :%0x key_id:%d key_id_type:%d +1911,ii,[ ar_wal_peer.c : 3841 ] _wal_peer_free: peer = %d delete_in_progress %d +1910,iii,[ ar_wal_peer.c : 10722 ] wal_pm_mcast_cfg: enable :%d encr_en:%d decap_type:%d +1909,Ii,[ ar_wal_peer.c : 10608 ] _wal_peer_mcast_key_id_update: peer :%0x key_id:%d +1908,IIII,[ ar_wal_peer.c : 12807 ] peer_migrate failed: rx:%x, tx:%x MAC:%x, reset_cause %x +1907,iiIiI,[ ar_wal_peer.c : 13256 ] mpdu_reconstruct:pdev(%d)peer %d,flags=0x%x,del=%d,recon=0x%x +1906,,[ ar_wal_peer.c : 13300 ] reconstruct_tqm_mpdus: no TIDs to block +1905,iIII,[ ar_wal_peer.c : 13139 ] Index= %d, time_stamp_32_61 = 0x%x, time_stamp_0_31= 0x%x, flags = 0x%x +1904,II,[ ar_wal_peer.c : 13144 ] A_TIMER_CURRENT_TIME_IN_TICKS time_stamp_32_61 = 0x%x time_stamp_0_31 = 0x%x +1903,iIiiiI,[ ar_wal_peer.c : 4083 ] security: wal_peer_set_key: peer:%d, key_info:%p, key_id:%d is_mcast:%d key_type:%d key_flags:%02x +1902,i,[ ar_wal_peer.c : 4106 ] _wal_peer_set_key: key_id:%d ignored, PMF +1901,i,[ ar_wal_peer.c : 4306 ] _wal_peer_set_key: is_already_set_key_pending:%d +1900,II,[ ar_wal_peer.c : 4421 ] WAL_DBGID_SECURITY_UCAST_KEY_SET 0x%x MAC:%x +1899,I,[ ar_wal_peer.c : 4430 ] WAL_DBGID_SECURITY_MCAST_KEY_SET 0x%x +1898,iI,[ ar_wal_peer.c : 4597 ] security: postponing set key for peer_id:%d peer_flags:%02x +1897,iI,[ ar_wal_peer.c : 4627 ] security: wal_peer_set_key: peer:%d peer_flags:%02x +1896,i,[ ar_wal_peer.c : 5516 ] WAL_DBGID_SECURITY_SAFE_MODE on: %d +1895,iIIII,[ ar_wal_peer.c : 5947 ] security: WAL_DBGID_SECURITY_ENCR_EN, peer %d, refcnt=%x,htc=%x,remap=%x,security=%x +1894,I,[ ar_wal_peer.c : 6331 ] OMI: Set new nss = 0x%lx + +1893,I,[ ar_wal_peer.c : 6338 ] OMI: Set new bw = 0x%lx + +1892,I,[ ar_wal_peer.c : 6344 ] OMI: Set new a_ctrl = 0x%lx + +1891,I,[ ar_wal_peer.c : 6356 ] HTC-block tids, peer:%x +1890,I,[ ar_wal_peer.c : 6438 ] WAL_DBGID_SET_M4_SENT_MANUALLY PEER = 0X%X +1889,I,[ ar_wal_peer.c : 6443 ] WAL_DBGID_UNSET_M4_SENT_MANUALLY peer = 0x%x +1888,I,[ ar_wal_peer.c : 6522 ] WAL_PEER_PARAM_FW_CONGESTION_DISABLE:%x +1887,iii,[ ar_wal_peer.c : 5572 ] qos: flag: %d and peer_id is %d and qos_flag_rcvd:%d +1886,,[ ar_wal_peer.c : 5596 ] qos_to_nonqos_switch: Sent dummy frame request to TX_DE +1885,Ii,[ ar_wal_peer.c : 5603 ] nonqos to qos switch received during peer assoc for peer = %p, peer->qos_enabled = %d +1884,iI,[ ar_wal_peer.c : 5668 ] security: set_param_authorized: peer:%d peer_flags:%02x +1883,iii,[ ar_wal_peer.c : 5720 ] DYN_MIMO_PS : sw_peer_id %d, dyn_mimo_ps %d, force_dyn_mimo_ps %d + +1882,Iii,[ ar_wal_peer.c : 5801 ] security: WAL_PEER_PARAM_TX_KEYID peer_key:%p and peer:%d val:%d + +1881,iiIii,[ ar_wal_peer.c : 12926 ] PDEV:%d, peer id=%d, QCU:%x/%d, ena=%d +1880,,[ ar_wal_peer.c : 11213 ] _wal_peer_state_publish: Entry +1879,ii,[ ar_wal_peer.c : 11218 ] _wal_peer_state_publish: bytes is %d, less than output size = %d +1878,iiii,[ ar_wal_peer.c : 11247 ] _wal_peer_state_publish: peer_keyid0_ast_index is %d, vdev_id = %d, qos_enabled = %d, ba_tx_state_bmap = %d +1877,iiiiii,[ ar_wal_peer.c : 11256 ] _wal_peer_state_publish: mac_address is %d:%d:%d:%d:%d:%d +1876,,[ ar_wal_peer.c : 11262 ] _wal_peer_state_publish: Exit +1875,,[ ar_wal_peer.c : 11992 ] Memory ERROR: Cannot retrieve peer stats + +1874,,[ ar_wal_peer.c : 11996 ] Invalid stats. Please try again + +1873,iIi,[ ar_wal_peer.c : 5072 ] security: wal_peer_tid_flush_handler: peer_id:%d peer_flags:%02x authrized:%d +1872,ii,[ ar_wal_peer.c : 9392 ] wal_peer_tid_free_mem: sw_peer_id=%d, tidno = %d +1871,i,[ ar_wal_peer.c : 9423 ] qos_to_nonqos_switch: it is last data TID got deleted peer_id:%d +1870,i,[ ar_wal_peer.c : 9451 ] delete_all_peer wal_peer_tid_free_mem: WLAN_THREAD_COMM_FUNC_VDEV_DEL_ALL_PEER peer_id:%d +1869,II,[ ar_wal_peer.c : 12688 ] TRIGGER PDEV MISMATCH, thread:%x, tid:%x +1868,i,[ ar_wal_peer.c : 3536 ] qos_to_nonqos_switch: wal_qos_to_nonqos_conf_msg_hdlr switching is done peer_id:%d +1867,ii,[ ar_wal_peer.c : 3494 ] qos_to_nonqos_switch: wal_qos_to_nonqos_switch_msg_hdlr peer_id:%d thread_id:%d +1866,IIIIIII,[ ar_wal_peer.c : 4693 ] security:pdev(%x)peer %x,flag %x, unblocked for tidLen update,refcnt=%x,htc=%x,remap=%x,security=%x +1865,iII,[ ar_wal_peer.c : 5175 ] security: wal_tqm_setkey_update_sync_cb_func: sw_peer_id:%d peer_flags:0x%x, qpeer_flags=0x%x +1864,II,[ ar_wal_peer.c : 5201 ] security: wal_tqm_setkey_update_unblock_cb_func: peer:%p peer_flags:%02x +1863,ii,[ ar_wal_peer.c : 546 ] HW overwritten tx_flow_number:%d and corressponding sw_peer_id:%d +1862,iii,[ ar_wal_peer.c : 11083 ] wal_vdev_delete_all_peer_queue_dummy_frame_into_tcl: vdev = %d, sw_cookie = %d, buffer_id = %d + +1861,iii,[ ar_wal_peer.c : 10970 ] wal_vdev_delete_all_peer_queue_dummy_frame_into_tqm: vdev = %d, sw_cookie = %d, buffer_id = %d + +1954,I,[ wal_rc.c : 212 ] Phy rate=0, rix=%x +1953,Iiii,[ wal_rc.c : 372 ] CHAINMASk_DBG overwrite tx chainmask, peer%p, sw_peer_id:%d rate_Sched_chainmask %d tx_mask %d +1952,i,[ wal_rc.c : 1444 ] [HT Sig]MCS value is not correct (%d) +1951,i,[ wal_rc.c : 1655 ] [he_sig_b2_ofdma]MCS value is not correct (%d) +1950,i,[ wal_rc.c : 1780 ] [he_sig_a]MCS value is not correct (%d) +1949,i,[ wal_rc.c : 1525 ] MCS value is not correct (%d) +1948,IIII,[ wal_rc.c : 2685 ] MU_EDCA_DEBUG: total_msdu: %lu, tcp_msdu: %lu, udp_msdu: %lu, other_msdu: %lu +1958,iiiiiii,[ wal_rc_ul.c : 344 ] UL_PSD_BOOST_DBG: AID: %d, bw: %d, ref_mcs: %d, ref_nss: %d, ru_try: %d, boosted mcs: %d, boosted nss: %d +1957,iiiIIi,[ wal_rc_ul.c : 546 ] UL_PSD_BOOST_DBG: idx: %d, AID: %d, MRU RU Size: %d, Out of Date Bmap: 0x%08x, Invalid RU Size Bmap: 0x%08x, Lgest uptodate ru: %d +1956,iiIiiiiiI,[ wal_rc_ul.c : 569 ] UL_PSD_BOOST_DBG: idx: %d, AID: %d, cur_time: %u, ru_size: %d, dst_mcs: %d, dst_nss: %d, src_mcs: %d, src_nss: %d, src_tstamp: %u +1955,iiiiiiiii,[ wal_rc_ul.c : 700 ] UL_TPC_DBG: AID: %d, bw: %d, ru_size: %d, mcs: %d, delta_p_mcs_100x: %d, delta_p_ru_100x: %d, rssi_ref_100x: %d, target_rssi_error_100x: %d => target_rssi_100x: %d +1960,IiI,[ ar_wal_rtt.c : 93 ] Deliver RX Ind msg:%p s_thr:%d to RT at ticks:0x%x +1959,i,[ ar_wal_rtt.c : 34 ] _wal_fac_handler: report type %d +1981,IIIIII,[ ar_wal_rx.c : 2386 ] rxdma_error_code: %x, sw_peer_id =%x ,sw group_id %x, %x,%x, ts= %u +1980,IIIII,[ ar_wal_rx.c : 2556 ] rx msg 0x%p, head:0x%p, 0x%p, %x buffers, ts: %u +1979,IIi,[ ar_wal_rx.c : 2642 ] ctrl_path_stats_dbg rx: mac_address equal mac_0 = 0x%x mac_2 =0x%x subtype = %d + +1978,IIII,[ ar_wal_rx.c : 2016 ] rx pop ppdu %x, sw_frame_group_id %x, err code %x, peer %p +1977,iII,[ ar_wal_rx.c : 4494 ] RX PhyErr:dev=%d,err=%x,rx_err_cnt=%x +1976,iiiiii,[ ar_wal_rx.c : 4585 ] RX PPDU dev: %d peer_id: %d ts: %d mcs: %d nss: %d,dur: %d + +1975,iiiiiII,[ ar_wal_rx.c : 4595 ] RX PPDU dev: %d peer_id: %d seq_no: %d mpdu_ok: %d mpdu_fail: %d fcs_err_bmap_L32 0x: %x fcs_err_bmap_U32 0x: %x + +1974,iiII,[ ar_wal_rx.c : 6951 ] rx resume on pdev :%d, module:%d, flag:%x, caller:0x%x +1973,IiI,[ ar_wal_rx.c : 632 ] pdev %x, rx reap error sq %d, buffer 0x%x +1972,I,[ ar_wal_rx.c : 680 ] drop encrypted frame without key %x +1971,IiI,[ ar_wal_rx.c : 791 ] pdev %x, rx reap normal sq %d, buffer[%x] +1970,iiiII,[ ar_wal_rx.c : 6864 ] rx_suspend on pdev:%d, module:%d, status:%d, flags %x, caller: %x +1969,i,[ ar_wal_rx.c : 1657 ] wal_rx_delete_all_peer_hdlr vdev_id = %d +1968,IIIIIII,[ ar_wal_rx.c : 7205 ] wal_rx_restore_ring_from_offload: [%x] [%x] [%x] [%x] [%x] [%x] [%x] + +1967,II,[ ar_wal_rx.c : 7224 ] wal_rx_setup_ring_for_offload: [%x] [%x] + +1966,III,[ ar_wal_rx.c : 1493 ] rx local notify: 0x%p, flags: 0x%x, ts: %u +1965,IIII,[ ar_wal_rx.c : 1567 ] %s: empty len: 0x%x, addr:0x%x:0x%x +1964,IIII,[ ar_wal_rx.c : 1606 ] %s: offload len: 0x%x, addr:0x%x:0x%x +1963,III,[ ar_wal_rx.c : 7810 ] %s: filter0 (0x%x) filter1 (0x%x) + +1962,IIIIII,[ ar_wal_rx.c : 7076 ] WAL_DBGID_RX_BA_SETUP 0x%x 0x%x 0x%x 0x%x 0x%x MAC:%x +1961,iiIIII,[ ar_wal_rx.c : 6295 ] rx_suspend_resume_msg on pdev:%d, data_value:%d, status ring flag %x, head %x, tail %x, ms:%x +1997,IiI,[ ar_wal_rx_recovery.c : 291 ] pdev %x, rx empty recovery sq %d, buffer[%x] +1996,IiI,[ ar_wal_rx_recovery.c : 321 ] pdev %x, rx reap recovery sq %d, buffer[%x] +1995,iii,[ ar_wal_rx_recovery.c : 814 ] RX phy error count: CNT_1:%d CNT_2:%d CNT_3:%d +1994,iII,[ ar_wal_rx_recovery.c : 1014 ] UL OFDMA usr index: %d, Qos Control value: 0x%x, Qos Control count: 0x%x + +1993,ii,[ ar_wal_rx_recovery.c : 1219 ] pkt_route: %d type_bmap: %d +1992,iIIII,[ ar_wal_rx_recovery.c : 1261 ] RX ppdu sfm no resource drop count is valid? %d :%x,%x mpdu drop count:%x,%x +1991,IIi,[ ar_wal_rx_recovery.c : 1360 ] SFM_PENDING_RXPCU DETECTION_TYPE: 0x%x RECOVERY_TYPE = 0x%x NUM_RESETS : %d +1990,I,[ ar_wal_rx_recovery.c : 1428 ] RX set crash mask 0x%x +1989,,[ ar_wal_rx_recovery.c : 1432 ] clear crash mask +1988,I,[ ar_wal_rx_recovery.c : 1444 ] g_dbg_local_buf_debug_enable %x +1987,iiI,[ ar_wal_rx_recovery.c : 1507 ] mu edca timer stop thru frame handler: pdev_id=%d, peer_id=%d, ac_bitmap = %08x +1986,iII,[ ar_wal_rx_recovery.c : 987 ] UL OFDMA usr index: %d, HE Control value: 0x%x, HE Control count: 0x%x + +1985,IIII,[ ar_wal_rx_recovery.c : 541 ] SFM_PENDING_RXPCU (SFM_REG) detected dev_id:0x%x,rxpcu_sfm_num_dwords=0x%x,MCMN_R0_MCMN_MAC_IDLE=0x%x,detection_type= 0x%x +1984,i,[ ar_wal_rx_recovery.c : 486 ] restart remote timers for pdev:%d +1983,ii,[ ar_wal_rx_recovery.c : 456 ] wal_rx_rings_reset pdev:%d, cnt:%d +1982,,[ ar_wal_rx_recovery.c : 515 ] SFM_PENDING_RXPCU ignored.. +2005,i,[ ar_wal_rx_refill.c : 77 ] Skip host ring TP updating for inactive pdev %d +2004,i,[ ar_wal_rx_refill.c : 164 ] Skip monitor ring HP updating for inactive pdev %d +2003,i,[ ar_wal_rx_refill.c : 266 ] Skip refill ring HP updating on pdev %d +2002,ii,[ ar_wal_rx_refill.c : 1958 ] pdev %d CE pending in refill ring %d +2001,ii,[ ar_wal_rx_refill.c : 1967 ] pdev %d CE pending in dest ring %d +2000,ii,[ ar_wal_rx_refill.c : 1975 ] pdev %d CE pending in dest ring %d +1999,ii,[ ar_wal_rx_refill.c : 1984 ] pdev %d CE pending in src ring %d +1998,,[ ar_wal_rx_refill.c : 1441 ] Buffer leaked! +2026,I,[ ar_wal_rx_uplink.c : 1436 ] ul_dbg_fake_qdepth_timer_handler: pdev=0x%x +2025,Ii,[ ar_wal_rx_uplink.c : 1474 ] ul_dbg_fake_qdepth_updated: peer=0x%x, ac=%d +2024,iii,[ ar_wal_rx_uplink.c : 1793 ] FDRSSI: rx done %d, ipc done %d, flush out %d. + +2023,iiiiiiii,[ ar_wal_rx_uplink.c : 1632 ] UL_ACTIVITY_DBG: TRIG_TYPE=%d, NUM_USER=%d, RX_DONE=%d, TX_DONE=%d, RX_FLUSH_TIMEOUT=%d CMD_RESULT=%d TSF=%d TSTAMP_MS=%d +2022,iiiiiiiii,[ ar_wal_rx_uplink.c : 1692 ] UL_ACTIVITY_DBG_USR: PEER_ID=%d, USER_INDEX=%d, BASIC_FAIL=%d, BASIC_SUCCESS=%d, QDEPTH_RESET=%d, BASIC_TRIG=%d, BSR_TRIG=%d, RX_DONE=%d, UL_MPDU_OK=%d +2021,iIii,[ ar_wal_rx_uplink.c : 885 ] smart_basic_trig : qos_ctrl_info sample_count=%d, average_ul_qdepth_bytes=%u, qdepth_curr=%d, is_11ax_pkt=%d +2020,Iiiiiiii,[ ar_wal_rx_uplink.c : 893 ] smart_basic_trig : qos_ctrl_info buffer_depletion_time=%lu, buffer_filling_interval=%d, buffer_filling_interval_bytes=%d, received_bytes=%d, bsr_trig=%d, ignore_received_bytes=%d, ac=%d, aid=%d + +2019,iiIIIIII,[ ar_wal_rx_uplink.c : 918 ] ul_dbg_update_peer_ul_data QOS_BITMAP: peer_aid=%d, tid_num=%d, ul_tid_state=0x%x, tid_bitmap=0x%x, eosp_bitmap=0x%x, qsize=%u, qos_ctrl_15_8=%u, ul_trig_info=0x%x +2018,IIIIII,[ ar_wal_rx_uplink.c : 930 ] ul_dbg_update_peer_ul_data_for_bsr: time_delta=%u,qdepth_prev=%u, qdepth_curr=%u, time_now_ms=%u, bsr_timeout_ms=%u, last_non_zero_update_ts=%u +2017,iiIIIII,[ ar_wal_rx_uplink.c : 942 ] ULMU_QUEUE_TRACK: peer_aid=%d ,peer_aid=%d, rx_mpdu_ok: %lu, rx_mpdu_fail: %lu, rx_mpdu_bytes_count: %lu, tcp_ack_msdu_cnt=%lu, ppdu_dur_us=%u +2016,iIIIIII,[ ar_wal_rx_uplink.c : 951 ] ul_dbg_efficiency: peer_aid=%d,rx_mpdu_ok: %lu, rx_mpdu_fail: %lu, rx_mpdu_bytes_count: %lu, extra_delim_bytes: %lu, tcp_ack_msdu_cnt=%lu, ppdu_dur_us=%u +2015,iIIIII,[ ar_wal_rx_uplink.c : 979 ] UL_MAX_PPDU_SIZE_DBG_1: aid: %d,average_mpdu_len: %lu, rx_mpdu_count: %lu, rx_mpdu_bytes_count: %lu, rx_null_delim_bytes: %lu, sum_qdepth_bytes: %lu +2014,iII,[ ar_wal_rx_uplink.c : 1018 ] UL_MAX_PPDU_SIZE_DBG_2: aid: %d, rx_mpdu_bytes_count: %lu, ul_ofdma_estimated_max_ppdu_bytes: %lu +2013,iiiiiiiii,[ ar_wal_rx_uplink.c : 2185 ] FDRSSI: AID: %d, ul_mu_type %d, trigger_type %d, user %d, nss %d, ru_start %d, min_total_gain %d, Raw %d, Final %d. + +2012,iiiiiiiii,[ ar_wal_rx_uplink.c : 2058 ] UL_MUMIMO_DBG, EVM, mu_type %d, user %d, stream %d, pilot %d, raw_evm %d, sig_pwr_db4 %d, evm_pwr_db4 %d, pilot_evm_dB %d, mean_pilot_evm %d +2011,IIII,[ ar_wal_rx_uplink.c : 366 ] ul_dbg_update_peer_queue_stats_from_HT_CTRL: aci_bitmap=0x%x, aci_high=0x%x, qsize_all=%u, qsize_high=%u +2010,iIIIIII,[ ar_wal_rx_uplink.c : 518 ] ul_dbg_update_peer_queue_stats_from_HT_CTRL ac=%d, time_delta=%u, qdepth_prev=%u, qdepth_curr=%u, time_now_ms=%u, bsr timeout=%u, last_non_zero_qdepth_ts=%u +2009,iIi,[ ar_wal_rx_uplink.c : 438 ] UL_MUMIMO_DBG: update from_htctrl. aid %d, queue size %u, ptid_tidno=%d reset UL implicit +2008,Iiiiiiii,[ ar_wal_rx_uplink.c : 478 ] smart_basic_trig : stats_from_htctrl_field buffer_depletion_time=%lu, buffer_filling_interval=%d, buffer_filling_interval_bytes=%d, sample_count=%d, smart_basic_trigger=%d, qdepth_curr=%d, ac=%d, aid=%d + +2007,IIiI,[ ar_wal_rx_uplink.c : 1185 ] ul_dbg_update_peer_ul_data: peer=0x%x, ul_rate_info=0x%x, bsr_recvd=%d, bsr_trig=%u +2006,IIIIIIII,[ ar_wal_rx_uplink.c : 1194 ] ul_dbg_update_peer_ul_data: fc_valid:%x, fc_field:0x%x, ht_ctrl_valid=%x, ht_control_field=0x%x,ht_ctrl_null_valid=%x, ht_control_null_field=0x%x,qos_data_tid_bitmap=0x%x, qos_data_tid_eosp_bitmap=0x%x +2045,,[ wal_htt_ppdu_stats.c : 519 ] Dropped ppdu stats due to ring full +2044,,[ wal_htt_ppdu_stats.c : 1054 ] Dropped ppdu stats due to full QHEAP +2043,,[ wal_htt_ppdu_stats.c : 1681 ] Dropped ppdu stats due to full QHEAP +2042,,[ wal_htt_ppdu_stats.c : 1735 ] Dropped ppdu stats due to full QHEAP +2041,,[ wal_htt_ppdu_stats.c : 1796 ] Dropped mgmt ppdu tlv due to ring full +2040,,[ wal_htt_ppdu_stats.c : 1853 ] Dropped ppdu stats due to full QHEAP +2039,,[ wal_htt_ppdu_stats.c : 627 ] Dropped ppdu stats due to full QHEAP +2038,,[ wal_htt_ppdu_stats.c : 1209 ] Dropped ppdu stats due to full QHEAP +2037,,[ wal_htt_ppdu_stats.c : 773 ] Dropped ppdu stats due to full QHEAP +2036,,[ wal_htt_ppdu_stats.c : 992 ] Dropped ppdu stats due to full QHEAP +2035,,[ wal_htt_ppdu_stats.c : 934 ] Dropped ppdu stats due to full QHEAP +2034,,[ wal_htt_ppdu_stats.c : 1418 ] Dropped ppdu stats due to full QHEAP +2033,,[ wal_htt_ppdu_stats.c : 1317 ] Dropped tqm ppdu stats due to ring full +2032,,[ wal_htt_ppdu_stats.c : 1331 ] Dropped tqm ppdu stats due to full QHEAP +2031,,[ wal_htt_ppdu_stats.c : 1517 ] Dropped tac ppdu stats due to full QHEAP +2030,,[ wal_htt_ppdu_stats.c : 1996 ] Dropped ppdu stats due to full QHEAP +2029,I,[ wal_htt_ppdu_stats.c : 1943 ] Dropped FLUSHSTATS INFRA_3_X HTT RINGFULL!!! CANCEL buffer:0x%x +2028,I,[ wal_htt_ppdu_stats.c : 1962 ] FLUSHSTATS INFRA_3_0 HTT RINGSEND buffer:0x%x +2027,i,[ wal_htt_ppdu_stats.c : 1898 ] Dropped self gen ppdu tlv due to ring full ring_id:%d +2046,iiii,[ ar_wal_thermal.c : 433 ] pdev_id(%d),tx_chainmask(%d), rx_chainmask(%d), num_chains(%d) +2071,IIII,[ ar_wal_tqm.c : 608 ] peer_id=0x%x, _set_flow_to_be_cleanup:%x, tx_flow_number:%x,caller:%x +2070,ii,[ ar_wal_tqm.c : 733 ] qos: %d and peer_id is %d tickle tid +2069,I,[ ar_wal_tqm.c : 771 ] wal_tqm_process_flow_not_empty_status new flow:%x +2068,ii,[ ar_wal_tqm.c : 7312 ] soft_msduq_delete: Requesting soft msduq delete :%d qtype:%d +2067,IIIIII,[ ar_wal_tqm.c : 6345 ] PEER_DELETE_DBG: wal_tqm_delete_tid:%x,%x,%x,%x,%x, invalidate:%x + +2066,i,[ ar_wal_tqm.c : 405 ] wal_tqm_flow_empty_helper not_init, counter:%d +2065,II,[ ar_wal_tqm.c : 353 ] wal_tqm_flow_update_helper not_init, fw_initialized:%x, counter:%x +2064,I,[ ar_wal_tqm.c : 1225 ] FLUSHSTATS INFRA_5 TQM FREE buffer:0x%x +2063,,[ ar_wal_tqm.c : 4250 ] TCL rings unpaused +2062,i,[ ar_wal_tqm.c : 4256 ] Fired timer again TQM link descriptor counter:%d +2061,iii,[ ar_wal_tqm.c : 2369 ] qos_to_nonqos_switch: Received tqm add_msdu status peer_id:%d status:%d buffer_id:%d +2060,iiii,[ ar_wal_tqm.c : 2666 ] Fired timer and paused TCL rings ring link descriptor counters mac0:%d mac1:%d mac2:%d sum:%d +2059,IIII,[ ar_wal_tqm.c : 2426 ] peer_id= 0x%x, wal_tqm_process_flush_cache_status:%x,%x,%x +2058,,[ ar_wal_tqm.c : 1070 ] wal_tqm_process_gen_mpdus_status: Null ptid +2057,III,[ ar_wal_tqm.c : 1939 ] qstats_status peer_id:%u tid_num:%u qtype:%u +2056,IIIII,[ ar_wal_tqm.c : 1568 ] FLUSHSTATS TQM remove_mpdu_status TLV:0x%x peerid:%u cmd_reason:%u mpdu:%u msdu:%u flushed +2055,IIII,[ ar_wal_tqm.c : 1618 ] peer_id= 0x%x, wal_tqm_process_remove_msdu_status:%x,%x,%x +2054,IIiII,[ ar_wal_tqm.c : 1738 ] FLUSHSTATS TQM remove_msdu_status TLV:0x%x peerid:%u cmd_reason:%d mpdu:%u msdu:%u flushed +2053,ii,[ ar_wal_tqm.c : 436 ] _wal_tqm_process_update_tx_msdu_flow_status tx_flow_number:%d update_requirements_not_met:%d +2052,Ii,[ ar_wal_tqm.c : 1282 ] FLUSHSTATS INFRA_0_X TQM copy flush_tlv:0x%x discarded, FAILED due to pool_alloc fail_count:%d +2051,I,[ ar_wal_tqm.c : 1288 ] FLUSHSTATS INFRA_0 TQM ALLOC buffer:0x%x +2050,III,[ ar_wal_tqm.c : 1298 ] FLUSHSTATS INFRA_1 TQM copied flush_tlv:0x%x to buffer:0x%x now rem_sz:%u bytes +2049,II,[ ar_wal_tqm.c : 1246 ] FLUSHSTATS INFRA_2 TQM SEND buffer:0x%x of size:%u +2048,ii,[ ar_wal_tqm.c : 2057 ] soft_msduq_delete: msduq got deleted :%d qtype:%d +2047,ii,[ ar_wal_tqm.c : 2061 ] soft_msduq_delete: delete req dropped :%d qtype:%d +2076,IIIIII,[ ar_tx_q_enque.c : 430 ] tx_q_enque_tqm_bypass: tid_num=0x%x, pdev_id=0x%0x, tid_paused=0x%x, type=0x%0x, len=0x%0x, num_mpdus_in_fq=0x%0x +2075,IIIIIIII,[ ar_tx_q_enque.c : 685 ] pn_alloc:fc=%x,comp_type=%x,flen=%lx,msdu_flags=%lx,id=%x,buffer_id=%x,enque_id=%x,pending_local=%x +2074,II,[ ar_tx_q_enque.c : 963 ] WAL_DBGID_TX_DISCARD id: %x, flag:%lx + +2073,IIIIIII,[ ar_tx_q_enque.c : 773 ] pn_alloc_complete:fc=%x,flen=%lx,msdu_flags=%lx,tid_num=%x,enque_id=%x,pn_idx=%x,pn=%llx +2072,IIIIII,[ ar_tx_q_enque.c : 816 ] pn_alloc failed: id:%x,flags:%x,tid_no:%x,fc:%x,enqeu_id=%x,pending_local=%x +2216,IIIIIIIIIII,[ ar_wal_tx_dbg.c : 850 ] txbf_su_ppdu_stats (legacy su = %lu)(ol ac su = %lu)(txbf ac su = %lu)(txbf ac %% = %lu)(ol ax su = %lu)(txbf ax su = %lu)(txbf ax %% = %lu) +2215,III,[ ar_wal_tx_dbg.c : 1800 ] TXDEWDOG TQM1:%u dummy_queued:%u last_time:%u +2214,,[ ar_wal_tx_dbg.c : 2097 ] No ul_resp_vdev or BSS-peer assigned !! +2213,I,[ ar_wal_tx_dbg.c : 2102 ] invalid ACTRL:%x +2212,iii,[ ar_wal_tx_dbg.c : 2166 ] fudge_txtime=%d, legacy_burst_per=%d, vht_burst_per=%d +2211,iii,[ ar_wal_tx_dbg.c : 2249 ] mu_mimo_ppdu_dur_hist_200us_bin_%d (Nr_%d) : %d +2210,III,[ ar_wal_tx_dbg.c : 899 ] txbf_su_mpdu_stats AX OL(ol ax su tried = %lu)(ol ax su failed = %lu)(ol ax su retried = %lu) +2209,iiiiiiiii,[ ar_wal_tx_dbg.c : 2265 ] mu_mimo_total_txop_ms_hist_MU%d_bin_%d - %d (Nr_%d) : %d, %d, %d, %d, %d +2208,iiii,[ ar_wal_tx_dbg.c : 2274 ] mu_mimo_mpdus_failed_hist_%d - %d (Nr_%d) : %d +2207,iiii,[ ar_wal_tx_dbg.c : 2279 ] mu_mimo_mpdus_failed_hist_%d - %d (Nr_%d) : %d +2206,iii,[ ar_wal_tx_dbg.c : 2288 ] mu_mimo_mpdus_tried_hist_%d (Nr_%d) : %d +2205,iiii,[ ar_wal_tx_dbg.c : 2293 ] mu_mimo_mpdus_tried_hist_%d - %d (Nr_%d) : %d +2204,iiii,[ ar_wal_tx_dbg.c : 2298 ] mu_mimo_mpdus_tried_hist_%d - %d (Nr_%d) : %d +2203,ii,[ ar_wal_tx_dbg.c : 2326 ] mu_mimo : Number of MU Sequences Posted (Nr_%d) : %d + +2202,iiiiiiii,[ ar_wal_tx_dbg.c : 2339 ] mu_mimo (Nr_%d) : Num of PPDUs Posted Per Burst [%d-%d] : %d,%d,%d,%d,%d + +2201,iiiiiiii,[ ar_wal_tx_dbg.c : 2353 ] mu_mimo (Nr_%d) : Num of MU PPDUs completed per burst [%d-%d] : %d,%d,%d,%d,%d + +2200,ii,[ ar_wal_tx_dbg.c : 2359 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_SUCCESS : %d + +2199,IIIIII,[ ar_wal_tx_dbg.c : 916 ] txbf_su_mpdu_stats AX (txbf sifs ax su tried = %lu)(txbf sifs ax su failed = %lu)(txbf sifs ax su retried = %lu)(txbf rbo ax su tried = %lu)(txbf rbo ax su failed = %lu)(txbf rbo ax su retried = %lu) +2198,ii,[ ar_wal_tx_dbg.c : 2363 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_FILTER: %d + +2197,ii,[ ar_wal_tx_dbg.c : 2367 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_RESP_TIMEOUT: %d + +2196,ii,[ ar_wal_tx_dbg.c : 2371 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_RATES_EXHAUSTED: %d + +2195,ii,[ ar_wal_tx_dbg.c : 2375 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_DATA_EXHAUSTED: %d + +2194,ii,[ ar_wal_tx_dbg.c : 2379 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_SEQ_ABORT: %d + +2193,ii,[ ar_wal_tx_dbg.c : 2383 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_NOTIFY_FRAME_ENCOUNTERED: %d + +2192,ii,[ ar_wal_tx_dbg.c : 2387 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_COMPLETION: %d + +2191,ii,[ ar_wal_tx_dbg.c : 2391 ] mu_mimo (Nr_%d) : MU seq. termination status WAL_TX_ISR_SCHED_IN_PROGRESS: %d + +2190,II,[ ar_wal_tx_dbg.c : 2408 ] TXDEWDOG prev_timeout:%u current_timeout:%u +2189,II,[ ar_wal_tx_dbg.c : 2504 ] read addr: 0x%x, value = 0x%x +2188,II,[ ar_wal_tx_dbg.c : 927 ] txbf_snd_stats(txbf_ac_snd = %lu)(txbf_ax_snd = %lu) +2187,IIIII,[ ar_wal_tx_dbg.c : 2605 ] ax_mu_mimo_ndpa_sch_status : WHAL_TXERR_NONE = %lu,WHAL_TXERR_RESP = %lu,WHAL_TXERR_FILT = %lu,WHAL_TXERR_FIFO = %lu,WHAL_TXERR_SWABORT = %lu + +2186,IIIII,[ ar_wal_tx_dbg.c : 2619 ] ax_mu_mimo_ndp_sch_status : WHAL_TXERR_NONE = %lu,WHAL_TXERR_RESP = %lu,WHAL_TXERR_FILT = %lu,WHAL_TXERR_FIFO = %lu,WHAL_TXERR_SWABORT = %lu + +2185,IIIII,[ ar_wal_tx_dbg.c : 2633 ] ax_mu_brp_sch_status : WHAL_TXERR_NONE = %lu,WHAL_TXERR_RESP = %lu,WHAL_TXERR_FILT = %lu,WHAL_TXERR_FIFO = %lu,WHAL_TXERR_SWABORT = %lu + +2184,I,[ ar_wal_tx_dbg.c : 2639 ] ax_mu_brp_trigger_hw_paused = %lu + +2183,IIIIIII,[ ar_wal_tx_dbg.c : 2658 ] ax_mu_mimo_ndp_sch_flag_err : WHAL_SCH_TSFLAG_FLUSH_RCVD_ERR = %lu,WHAL_SCH_TSFLAG_FILT_SCHED_CMD_ERR = %lu,WHAL_SCH_TSFLAG_RESP_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR = %lu,WHAL_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR = %lu + +2182,IIIIIII,[ ar_wal_tx_dbg.c : 2676 ] ax_mu_mimo_brp_sch_flag_err : WHAL_SCH_TSFLAG_FLUSH_RCVD_ERR = %lu,WHAL_SCH_TSFLAG_FILT_SCHED_CMD_ERR = %lu,WHAL_SCH_TSFLAG_RESP_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR = %lu,WHAL_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR = %lu,WHAL_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR = %lu + +2181,IIIII,[ ar_wal_tx_dbg.c : 2690 ] ax_mu_mimo_ndpa_user_status : WHAL_TXERR_NONE = %lu,WHAL_TXERR_RESP = %lu,WHAL_TXERR_FILT = %lu,WHAL_TXERR_FIFO = %lu,WHAL_TXERR_SWABORT = %lu + +2180,IIIII,[ ar_wal_tx_dbg.c : 2704 ] ax_mu_mimo_ndp_user_status : WHAL_TXERR_NONE = %lu,WHAL_TXERR_RESP = %lu,WHAL_TXERR_FILT = %lu,WHAL_TXERR_FIFO = %lu,WHAL_TXERR_SWABORT = %lu + +2179,IIIII,[ ar_wal_tx_dbg.c : 2718 ] ax_mu_mimo_ndp_user_flag_err : WHAL_USER_TSFLAG_RESP_MISMATCH_ERR = %lu,WHAL_USER_TSFLAG_RESP_MIMO_CTRL_MISMATCH_ERR = %lu,WHAL_USER_TSFLAG_RESP_CRC_FAIL_ERR = %lu,WHAL_USER_TSFLAG_RESP_TIMEOUT_ERR = %lu,WHAL_USER_TSFLAG_RESP_PROT_TIMEOUT_ERR = %lu + +2178,IIIII,[ ar_wal_tx_dbg.c : 2732 ] ax_mu_brp_user_flag_err : WHAL_USER_TSFLAG_RESP_MISMATCH_ERR = %lu,WHAL_USER_TSFLAG_RESP_MIMO_CTRL_MISMATCH_ERR = %lu,WHAL_USER_TSFLAG_RESP_CRC_FAIL_ERR = %lu,WHAL_USER_TSFLAG_RESP_TIMEOUT_ERR = %lu,WHAL_USER_TSFLAG_RESP_PROT_TIMEOUT_ERR = %lu + +2177,iii,[ ar_wal_tx_dbg.c : 939 ] %dms Burst: avg_txop_burst(ms) = %d,txop_on_burst_complete(ms) = %d + +2176,,[ ar_wal_tx_dbg.c : 2879 ] DEBUG_CACHE::Invalid Reg Operation + +2175,Ii,[ ar_wal_tx_dbg.c : 3088 ] sifs burst enable: 0x%x, pdev=%d + +2174,i,[ ar_wal_tx_dbg.c : 3111 ] # of MU-RTS : %d + +2173,IIIIII,[ ar_wal_tx_dbg.c : 3210 ] flush_38_hist: %02d %02d %02d %02d %02d %02d +2172,i,[ ar_wal_tx_dbg.c : 3281 ] WAL_PPDU: MU PPDU VAL:%d +2171,i,[ ar_wal_tx_dbg.c : 3323 ] g_ack_all_6Mbps : %d + +2170,IIIII,[ ar_wal_tx_dbg.c : 3378 ] PHYDBG: g_dbg_phydbg_default_events: 0x%08x, g_dbg_phydbg_pmi_events: 0x%08x, g_dbg_phydbg_mpi_events: 0x%08x, g_dbg_phydbg_rxtd_events: 0x%08x, g_dbg_phydbg_robe_events: 0x%08x +2169,IIIII,[ ar_wal_tx_dbg.c : 3542 ] twt_dbg_leak_hist_dl: Bins0-4: %u, %u, %u, %u, %u +2168,IIIII,[ ar_wal_tx_dbg.c : 3547 ] twt_dbg_leak_hist_dl: Bins5-9: %u, %u, %u, %u, %u +2167,IIIII,[ ar_wal_tx_dbg.c : 3553 ] twt_dbg_leak_hist_ul: Bins0-4: %u, %u, %u, %u, %u +2166,iiiiiiii,[ ar_wal_tx_dbg.c : 1141 ] sched_cmd_result[0] to sched_cmd_result[6] for HWQ id %d = {%d,%d,%d,%d,%d,%d,%d} + +2165,IIIII,[ ar_wal_tx_dbg.c : 3559 ] twt_dbg_leak_hist_ul: Bins0-4: %u, %u, %u, %u, %u +2164,i,[ ar_wal_tx_dbg.c : 3995 ] SelfGenResp: Dev id %d is in power saving state, not able to print. +2163,ii,[ ar_wal_tx_dbg.c : 4054 ] LOCAL: msduq_pool_ctxt total_alloc_cnt:%d cur_alloc_cnt:%d +2162,ii,[ ar_wal_tx_dbg.c : 4058 ] REMOTE: msduq_pool_ctxt total_alloc_cnt:%d cur_alloc_cnt:%d +2161,ii,[ ar_wal_tx_dbg.c : 4063 ] LOCAL: tid_swap_pool_ctxt total_alloc_cnt:%d cur_alloc_cnt:%d +2160,ii,[ ar_wal_tx_dbg.c : 4066 ] REMOTE: tid_swap_pool_ctxt total_alloc_cnt:%d cur_alloc_cnt:%d +2159,ii,[ ar_wal_tx_dbg.c : 4071 ] LOCAL: tid_state_pool total_alloc_cnt:%d cur_alloc_cnt:%d +2158,ii,[ ar_wal_tx_dbg.c : 4074 ] REMOTE: tid_state_pool total_alloc_cnt:%d cur_alloc_cnt:%d +2157,ii,[ ar_wal_tx_dbg.c : 4078 ] LOCAL: ul_tid_state_pool total_alloc_cnt:%d cur_alloc_cnt:%d +2156,ii,[ ar_wal_tx_dbg.c : 4081 ] REMOTE: ul_tid_state_pool total_alloc_cnt:%d cur_alloc_cnt:%d +2155,iiiiiii,[ ar_wal_tx_dbg.c : 1151 ] sched_cmd_result[7] to sched_cmd_result[12] for HWQ id %d = {%d,%d,%d,%d,%d, %d} + +2154,ii,[ ar_wal_tx_dbg.c : 4289 ] Profile Enabled : %d hist_intvl : %d +2153,iiii,[ ar_wal_tx_dbg.c : 4317 ] Profile ID : %d Count: %d Min : %d Max : %d +2152,iiiii,[ ar_wal_tx_dbg.c : 4329 ] Profile ID : %d hist_intvl: %d hist[0] : %d hist[1] : %d hist[2] : %d +2151,,[ ar_wal_tx_dbg.c : 4469 ] ctrl_path_stats_dbg : Disabling peer_dbg logs + +2150,,[ ar_wal_tx_dbg.c : 4476 ] ctrl_path_stats_dbg : Error seen + Usage +ctrl_path_stats_dbg: To Enable Stats: wifitool athX setUnitTestCmd 0x48 8 244 1 +ctrl_path_stats_dbg: To Disable Stats: wifitool athX setUnitTestCmd 0x48 2 244 0 + +2149,IIIIII,[ ar_wal_tx_dbg.c : 4499 ] ctrl_path_stats_dbg : args[2] = 0x%x args[3] = 0x%x args[4] = 0x%x args[5] = 0x%x args[6] = 0x%x args[7] = 0x%x + +2148,II,[ ar_wal_tx_dbg.c : 4502 ] ctrl_path_stats_dbg : mac_addr_31_0 = 0x%x mac_addr_47_32 = 0x%x + +2147,,[ ar_wal_tx_dbg.c : 4504 ] ctrl_path_stats_dbg: SW Peer ID Check + +2146,i,[ ar_wal_tx_dbg.c : 4507 ] ctrl_path_stats_dbg: vdev %d + +2145,,[ ar_wal_tx_dbg.c : 4515 ] ctrl_path_stats_dbg: bss +2144,i,[ ar_wal_tx_dbg.c : 1199 ] TX_IST_TRIGGER SENT %d + +2143,,[ ar_wal_tx_dbg.c : 4517 ] ctrl_path_stats_dbg: self +2142,iII,[ ar_wal_tx_dbg.c : 4520 ] ctrl_path_stats_dbg: peer %d, mac %x %x + +2141,iII,[ ar_wal_tx_dbg.c : 4522 ] ctrl_path_stats_dbg: sw_peer_id found peer %d, mac %x %x + +2140,,[ ar_wal_tx_dbg.c : 4557 ] s_stats!ERROR!:use:wifitool athX setUnitTestCmd 0x48 2 260 0/1 + +2139,II,[ ar_wal_tx_dbg.c : 4615 ] s_stats: dbg_num_bufs: %u, dbg_num_evt: %u + +2138,III,[ ar_wal_tx_dbg.c : 4616 ] s_stats: HOST_ring_HI : %u, TI : %u, S_TI : %u +2137,IIII,[ ar_wal_tx_dbg.c : 4617 ] s_stats: IN/SHADOW_ring_HI : %u, TI : %u, S_TI : %u, S_HI : %u +2136,IIII,[ ar_wal_tx_dbg.c : 4618 ] s_stats: OUT_ring_HI : %u TI : %u, S_TI : %u, S_HI : %u +2135,IIIII,[ ar_wal_tx_dbg.c : 4621 ] s_stats: IPC_ring_%u : HI : %u TI : %u, S_TI : %u, S_HI : %u +2134,,[ ar_wal_tx_dbg.c : 4623 ] s_stats: VREG_DET0 : + +2133,IIIIII,[ ar_wal_tx_dbg.c : 871 ] txbf_su_mpdu_stats (legacy su tried = %lu)(legacy su failed = %lu)(legacy su retried = %lu) ------------------------txbf_su_mpdu_stats AC OL(ol ac su tried = %lu)(ol ac su failed = %lu)(ol ac su retried = %lu) +2132,,[ ar_wal_tx_dbg.c : 1243 ] pdev_id can't be > 2, usage: wifitool ath0 setUnitTestCmd 0x48 2 56 +2131,III,[ ar_wal_tx_dbg.c : 4624 ] s_stats: ScanPri : %u, SCount : %u, SPrd : %u + +2130,III,[ ar_wal_tx_dbg.c : 4625 ] s_stats: ChnMask : %u, SEna : %u, SUpdtMask : 0x%x + +2129,IIII,[ ar_wal_tx_dbg.c : 4626 ] s_stats: SRdyIntrpt : %u, SPfmd : %u, IntrptsSent : %u, Scanpending : %u + + +2128,,[ ar_wal_tx_dbg.c : 4628 ] s_stats: VREG_DET1: + +2127,III,[ ar_wal_tx_dbg.c : 4629 ] s_stats: ScanPri : %u, SCount : %u, SPrd : %u + +2126,III,[ ar_wal_tx_dbg.c : 4630 ] s_stats: ChnMask : %u, SEna : %u, SUpdtMask : 0x%x + +2125,IIII,[ ar_wal_tx_dbg.c : 4631 ] s_stats: SRdyIntrpt : %u, SPfmd : %u, IntrptsSent : %u , Scanpending : %u + +2124,,[ ar_wal_tx_dbg.c : 4634 ] s_stats: VREG_DET_AGILE : + +2123,III,[ ar_wal_tx_dbg.c : 4635 ] s_stats: ScanPri : %u, SCount : %u, SPrd : %u + +2122,III,[ ar_wal_tx_dbg.c : 4636 ] s_stats: ChnMask : %u, SEna : %u, SUpdtMask : 0x%x + +2121,iiiiiiii,[ ar_wal_tx_dbg.c : 1263 ] WHAL_STATS for pdev id = %d: last_unpause_ppdu_id = %d hwsch_unpause_wait_tqm_write = %d hwsch_dummy_tlv_skipped = %d hwsch_misaligned_offset_received = %d hwsch_reset_count = %d hwsch_dev_reset_war = %d hwsch_delayed_pause = %d +2120,IIII,[ ar_wal_tx_dbg.c : 4637 ] s_stats: SRdyIntrpt : %u, SPfmd : %u, IntrptsSent : %u, Scanpending : %u + +2119,iiii,[ ar_wal_tx_dbg.c : 5020 ] delimiter user track: Number of total MU PPDU %d, MU PPDUs with delimiter users: %d, Percent:%d Average MU number of delimiter users %d +2118,i,[ ar_wal_tx_dbg.c : 5416 ] Num of sched commands dropped due to session ID mismatch - %d +2117,i,[ ar_wal_tx_dbg.c : 5417 ] Num of sched commands during TX abort - %d +2116,ii,[ ar_wal_tx_dbg.c : 5419 ] Num of seq start during resume: ISR - %d, DSR - %d +2115,,[ ar_wal_tx_dbg.c : 5433 ] TX abort/resume in progress. Ignoring request! +2114,iiii,[ ar_wal_tx_dbg.c : 5453 ] SFM_FLUSH_ISSUE sfm_wdg_with_flush_issue = %d, sfm_wdg_without_flush_issue = %d sfm_fatal_unknown = %d, num of times sfm issue got hit = %d +2113,i,[ ar_wal_tx_dbg.c : 5480 ] NOC PENDING TRANSACTIONS pending_noc_transactions_during_reset = %d +2112,iiiii,[ ar_wal_tx_dbg.c : 5572 ] CONG_CTRL Multicast_DBG buf_id:%d hcm_bin_idx:%d cur:%d, min:%d, max:%d +2111,iI,[ ar_wal_tx_dbg.c : 5638 ] mu edca timer stop: pdev_id = %d, ac_bitmap = %08x +2110,iiiiiiii,[ ar_wal_tx_dbg.c : 1283 ] hwsch_long_delayed_pause = %d sch_rx_ppdu_no_response = %d sch_selfgen_response = %d sch_rx_sifs_resp_trigger = %d sch_mpdu_info_bitmap_missed = %d hwsch_qcdd03911334 = %d hwsch_qcdd04031456 = %d hwsch_qcdd03955078 = %d +2109,iiiii,[ ar_wal_tx_dbg.c : 5695 ] tqm_sync_pipeling_stats: tqm_sync_sent = %d, tqm_sync_proc = %d, TAC/IST post = %d, tqm_sync_not_proc = %d, tqm_ist post = %d +2108,i,[ ar_wal_tx_dbg.c : 5717 ] MAC clock gating: %d +2107,,[ ar_wal_tx_dbg.c : 5814 ] HW_ERR_REINJECTION : Invalid no. of arguments during mac flush err injection +2106,,[ ar_wal_tx_dbg.c : 5832 ] HW_ERR_REINJECTION : Invalid host ring id during host ring bkpressure err injection +2105,,[ ar_wal_tx_dbg.c : 5835 ] HW_ERR_REINJECTION : Invalid no. of arguments during host ring bkpressure err injection +2104,,[ ar_wal_tx_dbg.c : 5853 ] HW_ERR_REINJECTION : Invalid fw ring id during fw ring bkpressure err injection +2103,,[ ar_wal_tx_dbg.c : 5856 ] HW_ERR_REINJECTION : Invalid no. of arguments during fw ring bkpressure err injection +2102,,[ ar_wal_tx_dbg.c : 5873 ] HW_ERR_REINJECTION : Invalid hw ring id during hw ring bkpressure err injection +2101,,[ ar_wal_tx_dbg.c : 5876 ] HW_ERR_REINJECTION : Invalid no. of arguments during hw ring bkpressure err injection +2100,,[ ar_wal_tx_dbg.c : 5891 ] HW_ERR_REINJECTION : Invalid no. of arguments during rx abort err injection +2099,iiiiiiii,[ ar_wal_tx_dbg.c : 1303 ] hwsch_backpressure_wdog = %d hwsch_pause_wdog = %d hwsch_fes_start_wdog = %d hwsch_life_time_expiry_valid_fes_offset = %d crypto_wdog_tmout = %d hwsch_fes_end_offset_wraparound = %d pdg_sfm_leak_rst_cnt = %d hwsch_cmd_ring_reset_war_dummy_completions = %d +2098,i,[ ar_wal_tx_dbg.c : 5917 ] RTT LUT enabled : %d +2097,,[ ar_wal_tx_dbg.c : 5991 ] AWGN_INT_DBG Wrong Input: wifitool athX setUnitTestCmd 0x48 4 400 1 +2096,ii,[ ar_wal_tx_dbg.c : 5996 ] AWGN_INT_DBG : intr = %d seg = %d +2095,,[ ar_wal_tx_dbg.c : 6004 ] AWGN_INT_DBG Wrong Input: wifitool athX setUnitTestCmd 0x48 3 400 2 +2094,ii,[ ar_wal_tx_dbg.c : 6008 ] AWGN_INT_DBG : intr = %d seg = %d +2093,,[ ar_wal_tx_dbg.c : 6016 ] AWGN_INT_DBG Wrong Input: wifitool athX setUnitTestCmd 0x48 4 400 3 +2092,ii,[ ar_wal_tx_dbg.c : 6021 ] AWGN_INT_DBG : tx_prop = %d rx_prop = %d +2091,,[ ar_wal_tx_dbg.c : 6025 ] AWGN_INT_DBG : wrong input + +2090,ii,[ ar_wal_tx_dbg.c : 6125 ] g_dbg_mgmt_drop_alloc_fail_peer_paused =%d, g_dbg_mgmt_drop_alloc_fail_peer_unpaused=%d +2089,iiiiiiii,[ ar_wal_tx_dbg.c : 1323 ] hwsch_flush_not_done = %d flush_tx_not_idle = %d hwsch_wd_unknown_reset = %d hwsch_mtu_wrap_wdog = %d crypto_fatal_unknown = %d txdma_fatal_unknown = %d sfm_fatal_unknown = %d mcmn_fatal_unknown = %d +2088,iiiiiiii,[ ar_wal_tx_dbg.c : 1343 ] txpcu_wdog_tout = %d txpcu_recd_lt_mpdu = %d txpcu_recd_gt_mpdu= %d pdg_fatal_unknown = %d hwsch_fatal_unknown = %d hwsch_wdog_unknown = %d mxi_fatal_unknown = %d txole_fatal_unknown = %d +2087,iiiiiii,[ ar_wal_tx_dbg.c : 1391 ] tx_flush_tlv_tag_oor_err = %d tx_flush_tlv_len_oor_err = %d tx_flush_tlv_taglen_mismatch_err = %d tx_flush_unexpected_tlv_end_err = %d tx_steer_frm_cnt = %d tx_flush_txdma_sfm_busy = %d phy_warm_reset = %d +2086,,[ ar_wal_tx_dbg.c : 1407 ] pdev_id can't be > 2, usage: wifitool ath0 setUnitTestCmd 0x48 2 57 +2085,,[ ar_wal_tx_dbg.c : 1418 ] No ul_resp_vdev assigned !! +2084,II,[ ar_wal_tx_dbg.c : 1422 ] ac:%x already in MU mode, reset timer to %x +2083,IIIIII,[ ar_wal_tx_dbg.c : 888 ] txbf_su_mpdu_stats AC (txbf sifs ac su tried = %lu)(txbf sifs ac su failed = %lu)(txbf sifs ac su retried = %lu)(txbf rbo ac su tried = %lu)(txbf rbo ac su failed = %lu)(txbf rbo ac su retried = %lu) +2082,I,[ ar_wal_tx_dbg.c : 1425 ] ac:%x switch to MU mode +2081,I,[ ar_wal_tx_dbg.c : 1570 ] flush hwq mask:%x +2080,I,[ ar_wal_tx_dbg.c : 1575 ] flush hwq mask:%x, ul_resp is not enabled +2079,iii,[ ar_wal_tx_dbg.c : 1652 ] g_eapol_rekey_min_rate_enable num_args:%d %d, %d +2078,IIII,[ ar_wal_tx_dbg.c : 1797 ] TXDEWDOG TCL1:%u full_ignore:%u dummy_queued:%u last_time:%u +2077,III,[ ar_wal_tx_dbg.c : 517 ] data_stall debug support is not allowed as the vdev_type is not STA pdev_id:8/vdev_id:8 0x%08x vdev:0x%x pdev:0x%x +2217,ii,[ ar_wal_tx_send_selfgen.c : 3746 ] UL_MUMIMO_DBG, seq_type %d, is_ul_mumimo: %d +2224,,[ ar_wal_tx_halphy_send.c : 629 ] HALPHY_TX_TBTT_FLUSH : DPD packet is flushed out +2223,,[ ar_wal_tx_halphy_send.c : 638 ] HALPHY_TX_ABORT : DPD packet is aborted +2222,,[ ar_wal_tx_halphy_send.c : 737 ] tx_send_halphy_abort_ppdu : DPD packet is aborted +2221,i,[ ar_wal_tx_halphy_send.c : 241 ] PAPRD dpd start tlv event : start evt latency %d +2220,i,[ ar_wal_tx_halphy_send.c : 1250 ] wal_check_ppdu_status DPD ppdu is stuck in the hardware queue %d +2219,i,[ ar_wal_tx_halphy_send.c : 1236 ] thread id %d +2218,iiiii,[ ar_wal_tx_halphy_send.c : 908 ] PAPRD Total PHY OFF %d Tx suspend fail %d Rx suspend fail %d Tx suspend %d, Tx suspend %d +2230,,[ ar_wal_tx_disa_send.c : 253 ] disa tx_frame NOT EXPECTED since no status would be recv +2229,,[ ar_wal_tx_disa_send.c : 116 ] wal_sw_peer_key allocation failed...!!! +2228,,[ ar_wal_tx_disa_send.c : 119 ] wal_sw_peer_key allocation SUCCESS +2227,i,[ ar_wal_tx_disa_send.c : 199 ] DISA tx_frame tx_buf_count %d +2226,i,[ ar_wal_tx_disa_send.c : 222 ] DISA tx_frame After Delay tx_buf_count %d +2225,i,[ ar_wal_tx_disa_send.c : 212 ] DISA tx_frame After Delay tx_buf_count %d +2231,iI,[ ar_wal_tx_flush.c : 414 ] _wal_peer_flush_tids: send msg to SCHED_ALGO, thread_id =%d tid_bitmap=0x%x + +2232,i,[ ar_wal_tx_send_isr.c : 495 ] TX_IST_TRIGGER RECEIVED %d + +2277,I,[ ar_wal_tx_send.c : 11981 ] TX_ABORT FAILED 0x%x +2276,Ii,[ ar_wal_tx_send.c : 3650 ] tx_send_attach failed 0x%x, line:%d +2275,iiii,[ ar_wal_tx_send.c : 12335 ] CONSECUTIVE_FLUSH9: pdev id %d,reset_mode %d consecutive flush 9 happen for %d times.Total WAR trigger %d times. +2274,ii,[ ar_wal_tx_send.c : 16579 ] pdev %d, WIFIMISSING_MPDU_INFO_E cnt: %d + +2273,i,[ ar_wal_tx_send.c : 16670 ] Retried BAR for %d times, clear BAR flag + +2272,iI,[ ar_wal_tx_send.c : 16683 ] BAR tx failure tid_num: %d, tid_flags:0x%x + +2271,II,[ ar_wal_tx_send.c : 16897 ] TX resuming on MAC: %p, %lx + +2270,III,[ ar_wal_tx_send.c : 16932 ] seq not cleaned ! queue_id:%x, txq:%p, seq_ctrl:%p + +2269,ii,[ ar_wal_tx_send.c : 10805 ] tx_send_dsr_ppdu_done increment peer->consecutive_eap_cnt : %d, sw_peer_id: %d +2268,ii,[ ar_wal_tx_send.c : 10812 ] tx_send_dsr_ppdu_done clear peer->consecutive_eap_cnt : %d, sw_peer_id: %d +2267,Iii,[ ar_wal_tx_send.c : 10826 ] tx_send_dsr_proc_ppdu_done consecutive_pm_filter_cnt %0x %d, %d MAC reset counter + +2266,iiiIIiii,[ ar_wal_tx_send.c : 10889 ] twt_dbg/ul_tcp: dsr_proc_ppdu_done txqid=%d, sched_id=%d, tx_status=%d, peer=%u, ftype=%u, queued=%d, tried=%d, failed=%d + +2265,II,[ ar_wal_tx_send.c : 17586 ] Pause UL ring - wal_txq_id:%x,wal_txq_id_sta_ul:%x +2264,iiiiiIII,[ ar_wal_tx_send.c : 17602 ] TTL tid:%d ppdu:%d %d,cmd:%d txq_id:%d,flg:%x %x,caller:%x +2263,iiii,[ ar_wal_tx_send.c : 17458 ] MSDUTTL TQM peer_id:%d deq:%d tid_num:%d qtype:%d +2262,I,[ ar_wal_tx_send.c : 18440 ] Received GTK frame for Qpeer=%p, but PTK not set +2261,III,[ ar_wal_tx_send.c : 19379 ] pdev:%u, RING(%x) pause finished(%x) +2260,III,[ ar_wal_tx_send.c : 19449 ] pdev:%u, pause ring(%x:%x) +2259,Iiiii,[ ar_wal_tx_send.c : 7997 ] allow_n_flags 0x%x sendn_frms_allowed %d sendn_frms_tried %d subfrms_max %d encap_type %d +2258,II,[ ar_wal_tx_send.c : 18263 ] peer:%p, tid:16/SSN:16 0x%08x +2257,II,[ ar_wal_tx_send.c : 18269 ] peer:%p, PN=%X +2256,I,[ ar_wal_tx_send.c : 6100 ] legacy frame with HT-ctrl, tid=%x +2255,II,[ ar_wal_tx_send.c : 6400 ] ppdu start time (%u) is in the past of current tsf (%u), deliver 1ms +2254,iiIiI,[ ar_wal_tx_send.c : 18836 ] tx_send_stop_mu_edca_timer: pdev:%d can't stop muedca timer vdev:%d mu_resp:%08X mu_edca_en:%d ac_bitmap:%08x +2253,ii,[ ar_wal_tx_send.c : 18864 ] tx_send_stop_mu_edca_timer: pdev:%d ac:%d stop muedca timer and back to legacy edca +2252,iiIiI,[ ar_wal_tx_send.c : 12931 ] tx_send_stop_muedca_timer: pdev:%d can't stop muedca timer vdev:%d mu_resp:%08X mu_edca_en:%d ac_bitmap:%08x +2251,,[ ar_wal_tx_send.c : 16306 ] INVALID TPC REGISTER + +2250,IIIIIIIII,[ ar_wal_tx_send.c : 14463 ] TXPPDU_0 peerid_tidnum_hwq:0x%08x ppdu_id:0x%08x tstamp:0x%08x%08x dur:%5u sw_sched_id__mpdutried__failed:0x%08x mcs_nss_bw_pream:0x%08x seqnum__sifs__sch:0x%08x tries__fes__flush:0x%08x +2249,IIIII,[ ar_wal_tx_send.c : 14479 ] TXPPDU_1_064 ssn__basn:0x%08x enq_bitmap:%08x_%08x compl_bitmap:%08x_%08x +2248,IIIIIIIII,[ ar_wal_tx_send.c : 14493 ] TXPPDU_1_256 ssn__basn:0x%08x compl_bitmap:%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x +2247,IIIIII,[ ar_wal_tx_send.c : 14511 ] TXPPDU_2 sched_id:%08x sch_flg:%08x swppdu_flg:%08x msdu_mpdu:%08x tpc:%08x cm:%x +2246,III,[ ar_wal_tx_send.c : 19311 ] pdev:%u, RING(%x) pause WAR triggered(%x) +2245,i,[ ar_wal_tx_send.c : 14030 ] delimiter user track: peer:%d runs out of data +2244,i,[ ar_wal_tx_send.c : 14101 ] delimiter user track: peer:%d runs out of data +2243,IiiI,[ ar_wal_tx_send.c : 15191 ] TXPPDU_0 ppdu_id:0x%08x sched_result:%d flush_reason:%d uid1__uid2:0x%08x +2242,IIIiiii,[ ar_wal_tx_send.c : 15298 ] dsr_ppdu_done pdev/FC=%X tid=0x%X cmd_result/flush=0x%X cca=%d tx=%d rx=%d cycle=%d + +2241,iiIiiiiII,[ ar_wal_tx_send.c : 14703 ] twt_dbg: update_dl_stats txqid=%d, sched_id=%d, ftype=%u, tx_status=%d, queued=%d, tried=%d, failed=%d,sched_ref_time_start=%u, sched_ref_time_end=%u + +2240,IIIII,[ ar_wal_tx_send.c : 14739 ] twt_dbg_leak: update_dl_stats: start_tsTstamp=%u, duration_us=%u, sch_eval_end_ts=%u, twt_sp_end=%u, offset_tsf2=%u + +2239,I,[ ar_wal_tx_send.c : 14743 ] twt_dbg_leak: update_dl_stats twt_sp leakage detected by %u us +2238,iiiIIIII,[ ar_wal_tx_send.c : 14775 ] twt_dbg_leak_ul: update_ul_stats: txqid=%d, sched_id=%d, tx_sw_status=%d, fes_start=%u, fes_end=%u, fes_duration=%u, sched_ref_time_start=%u, sched_ref_time_end=%u + +2237,IIII,[ ar_wal_tx_send.c : 14810 ] twt_dbg_leak_ul: update_ul_stats: sch_eval_start_ts=%u, sch_eval_end_ts=%u, twt_sp_end=%u, offset_tsf2=%u + +2236,I,[ ar_wal_tx_send.c : 14814 ] twt_dbg_leak_ul: update_ul_stats twt_sp leakage detected by %u us +2235,IIIIIIII,[ ar_wal_tx_send.c : 12777 ] update_hw_wmm_params: ac:%x,ul_resp=%x,txqid=%x,cw_min/cw_max:%x,aifs:%x,type=%x,txop_limit=%x %x +2234,iIi,[ ar_wal_tx_send.c : 2325 ] update pdev(%d) vdev(%p) wmm params, type=%d +2233,,[ ar_wal_tx_send.c : 2366 ] MU-EDCA being used while update its WMM parameters. +2280,,[ ar_wal_tx_seq.c : 4044 ] CW reset +2279,iiiiiiiI,[ ar_wal_tx_seq.c : 6101 ] 6G FCC: BW recipe state: max_bw_restricted - %d, max_queued_bw - %d, current_transmitted_bw - %d, resp_bw - %d, num_intereference_at_sec[%d/%d/%d], curr_time_us = %ld +2278,ii,[ ar_wal_tx_seq.c : 6233 ] tx_seq_trigger_ppdu_start_event_isr: can not switch to MUEDCA %d %d +2287,iiiiiiiii,[ tx_cong_ctrl.c : 278 ] CONGCTRL FW_CONTROL *OVERRIDE* peer_id:%d tid_num:%d traffic_enq:%d drop:%d deq:%d tot_deq:%d rate_max_allowed:%d old_threshold:%d max_extra:%d +2286,iiiiiiiii,[ tx_cong_ctrl.c : 291 ] CONGCTRL FW_CONTROL *DISABLED* peer_id:%d tid_num:%d traffic_enq:%d drop:%d deq:%d tot_deq:%d rate_max_allowed:%d old_threshold:%d max_extra:%d +2285,iIiiiiiii,[ tx_cong_ctrl.c : 307 ] CONGCTRL FW_CONTROL peer_id:%d tid_num__qtype__msduq_masks:0x%08x traffic_enq:%d drop:%d deq:%d tot_deq:%d rate_max_allowed:%d old_threshold:%d max_extra:%d +2284,iiiiii,[ tx_cong_ctrl.c : 51 ] CONG_CTRL_FD sw_pid:%d tid_num:%d buf_id:%d desc_id:%d bin_idx:%d cur:%d +2283,iii,[ tx_cong_ctrl.c : 69 ] CONG_CTRL_DiscD sw_pid:%d tid_num:%d buf_id:%d +2282,iiiiii,[ tx_cong_ctrl.c : 57 ] CONG_CTRL_AD sw_pid:%d tid_num:%d buf_id:%d desc_id:%d bin_idx:%d cur:%d +2281,iii,[ tx_cong_ctrl.c : 63 ] CONG_CTRL_DropD sw_pid:%d tid_num:%d buf_id:%d +2299,,[ ar_wal_txbf.c : 1367 ] WAL_POWER_STATE_FULL_SLEEP +2298,,[ ar_wal_txbf.c : 1394 ] WAL_POWER_STATE_AWAKE +2297,IIII,[ ar_wal_txbf.c : 1260 ] txbf_peer_setup:Peer_caps VHT:SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2296,IIII,[ ar_wal_txbf.c : 1268 ] txbf_peer_setup:Peer_caps HE :SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2295,IIII,[ ar_wal_txbf.c : 1276 ] txbf_peer_setup:Vdev_caps VHT :SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2294,IIII,[ ar_wal_txbf.c : 1284 ] txbf_peer_setup:Vdev_caps HE :SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2293,II,[ ar_wal_txbf.c : 1303 ] txbf_peer_setup:Txbfer:0x%x and txbfee count:0x%x +2292,IIII,[ ar_wal_txbf.c : 562 ] txbf_peer_teardown:Peer_caps VHT :SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2291,IIII,[ ar_wal_txbf.c : 570 ] txbf_peer_teardown:Peer_caps HE :SU:bfee=%x,bfer=%x MU:Bfee=%x,bfer=%x +2290,II,[ ar_wal_txbf.c : 584 ] txbf_peer_setup:Txbfer:0x%x and txbfee count:0x%x +2289,iI,[ ar_wal_txbf.c : 1341 ] wal_txbf_update_txbfee_filter:en:%d,txbfee_dis_bitmap:0x%x +2288,ii,[ ar_wal_txbf.c : 952 ] PHY set gid:%d, pos:%d +2324,IIIIIIII,[ wmi_svc.c : 363 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x +2323,III,[ wmi_svc.c : 374 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x +2322,IIII,[ wmi_svc.c : 377 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x 0x%08x +2321,IIIII,[ wmi_svc.c : 380 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x +2320,IIIIII,[ wmi_svc.c : 383 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x +2319,IIIIIII,[ wmi_svc.c : 386 ] WMI_CMD_PARAMS 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x +2318,Ii,[ wmi_svc.c : 556 ] WMI_CMD_RX CmdId = 0x%x Length = %d +2317,III,[ wmi_svc.c : 563 ] WMI Logging debug stats total_drops = 0x%x resume_cnts = 0x%x, suspend_cnts = 0x%x +2316,I,[ wmi_svc.c : 368 ] WMI_CMD_PARAMS 0x%08x +2315,I,[ wmi_svc.c : 577 ] WMI_SEND_EVENT_WRONG_TLV CmdId/EventId = 0x%x +2314,iiiI,[ wmi_svc.c : 602 ] WMI_CMD_RX process inline cmd=%d length=%d endPt=%d, pHTCbuf=%x +2313,I,[ wmi_svc.c : 605 ] start page log CmdId = 0x%x +2312,I,[ wmi_svc.c : 612 ] stop page log CmdId = 0x%x +2311,iiiIi,[ wmi_svc.c : 643 ] WMI_CMD_RX send dispatch msg to threads, cmd=%d length=%d endPt=%d, pHTCbuf=%x msg_size=%d +2310,II,[ wmi_svc.c : 371 ] WMI_CMD_PARAMS 0x%08x 0x%08x +2309,Ii,[ wmi_svc.c : 879 ] WMI_EVT completion msg to RT pEvt=%p, thread_id=%d +2308,iiI,[ wmi_svc.c : 1780 ] WMI_EVT msg to HIF EventId=%d length=%d pEvt=%p +2307,Ii,[ wmi_svc.c : 1918 ] WMI_EVENT_SEND EventId = 0x%x ep = %d +2306,iiIi,[ wmi_svc.c : 1961 ] RT WMI_EVT EventId=%d length=%d pEvt=%p filterAction:%d +2305,I,[ wmi_svc.c : 2013 ] pending EventId = 0x%x +2304,II,[ wmi_svc.c : 2025 ] WMI_EVENT_SEND drop EventId = 0x%x, action:0x%x +2303,iiiI,[ wmi_svc.c : 837 ] WMI_CMD_RX cmd comp. handle in hif --free buf cmd=%d length=%d endPt=%d, pHTCbuf=%x +2302,iiiI,[ wmi_svc.c : 774 ] WMI_CMD_RX handle in BE cmd=%d length=%d endPt=%d, pHTCbuf=%x +2301,iiiI,[ wmi_svc.c : 740 ] WMI_CMD_RX handle in data offload cmd=%d length=%d endPt=%d, pHTCbuf=%x +2300,iiiI,[ wmi_svc.c : 808 ] WMI_CMD_RX handle in RT cmd=%d length=%d endPt=%d, pHTCbuf=%x +2325,i,[ evt_tracer.c : 861 ] suspend_en:%d +2327,Iii,[ platform_page_log.c : 358 ] PF ADDR:0x%X, THREAD:%d, DSR:%d +2326,Iii,[ platform_page_log.c : 365 ] PF ADDR:0x%X, THREAD:%d, DSR:%d +2328,II,[ platform_m3.c : 1730 ] M3 DDR address = %ull, size = 0x%x +2329,,[ platform_ce.c : 112 ] platform_ce_send_use_hif: Sending msg to HIF thread to do SYNC CE copy +2330,i,[ platform_gpio.c : 248 ] ERR: setting output for input GPIO %d +2344,I,[ platform_bdf_and_cal.c : 1087 ] Initiating cal download (halphy)...temp_bin = 0x%x +2343,i,[ platform_bdf_and_cal.c : 1107 ] Cal download complete...cal file size = %d +2342,Ii,[ platform_bdf_and_cal.c : 1157 ] Initiating cal update (halphy)...temp_bin = 0x%x | file_size = %d +2341,,[ platform_bdf_and_cal.c : 1295 ] QMI Platform: Cold Cal done signal received +2340,,[ platform_bdf_and_cal.c : 1347 ] QMI Platform: Sending FW READY ind... +2339,,[ platform_bdf_and_cal.c : 1361 ] QMI Platform: Sending FW READY ind... +2338,i,[ platform_bdf_and_cal.c : 679 ] platorm_idx__download_req= %d, +2337,i,[ platform_bdf_and_cal.c : 514 ] platorm_idx= %d, +2336,i,[ platform_bdf_and_cal.c : 643 ] platform_proc_bdf_download_req: BDF download done, current_size = %d, +2335,i,[ platform_bdf_and_cal.c : 603 ] platform_proc_bdf_download_req: BDF download curr_size = %d, +2334,I,[ platform_bdf_and_cal.c : 292 ] QMI Platform: Cal download REQ received, seg_id 0x%x +2333,i,[ platform_bdf_and_cal.c : 199 ] QMI Platform: Cal Update remaining bytes = %d, +2332,,[ platform_bdf_and_cal.c : 1241 ] sending cal_done indication before changing state +2331,,[ platform_bdf_and_cal.c : 1283 ] QMI Platform: Sending FW READY ind... +2354,,[ platform_tsens.c : 1097 ] TSENS_MEMORY_ALLOC_FAILED +2353,iiiiiiii,[ platform_tsens.c : 1115 ] TSENS_PID_GET_CONFIG temp_thresh_1|2|3 %d %d %d kp = %d, ki = %d, kd = %d, max_temp = %d sensor = %d +2352,iiiiii,[ platform_tsens.c : 1145 ] TSENS_PID_SET_CONFIG algo = %d, temp_thresh_1|2 %d %d, kp = %d, ki = %d, kd = %d +2351,,[ platform_tsens.c : 1006 ] TSENS_MEMORY_ALLOC_FAILED +2350,iIIIIIii,[ platform_tsens.c : 1046 ] TSENS_TEMP_INFO algo = %d, err_info = 0x%x 0x%x 0x%x, num_client|num_sensor = 0x%x, temp_zone|sensor_id = 0x%x, tmr_running = %d last_dc = %d +2349,iiiiiiii,[ platform_tsens.c : 1056 ] TSENS_TEMP_OFFSET [0-7] %d %d %d %d %d %d %d %d +2348,iiiiiiii,[ platform_tsens.c : 1024 ] TSENS_PID_DATA temp_thresh_1|2|3 %d %d %d kp = %d, ki = %d, kd = %d, max_temp = %d sensor = %d +2347,iiiiiiii,[ platform_tsens.c : 1034 ] TSENS_TEMP_DATA_DEGC [0-7] %d %d %d %d %d %d %d %d +2346,iiiiii,[ platform_tsens.c : 1085 ] TSENS_PID_UPDATE_PARAM algo = %d, temp_thresh_1|2 %d %d, kp = %d, ki = %d, kd = %d +2345,iiiiiiii,[ platform_tsens.c : 989 ] TSENS_PID_DATA temp_thresh_1|2|3 %d %d %d kp = %d, ki = %d, kd = %d, update_temp_thresh_1|2degC %d %d +2359,iIIIIIIII,[ txde_thread.c : 101 ] %d [RING_STATS:RING_EMPTY]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +2358,iIIIIIIII,[ txde_thread.c : 140 ] %d [RING_STATS:RING_50_75_PER]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +2357,iIIIIIIII,[ txde_thread.c : 153 ] %d [RING_STATS:(RINGSZ - 12)]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +2356,iIIIIIIII,[ txde_thread.c : 114 ] %d [RING_STATS:RING_FULL]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +2355,iIIIIIIII,[ txde_thread.c : 127 ] %d [RING_STATS:RING_0_50_PER]==> 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x + +2361,IIi,[ wal_powersave_sta.c : 336 ] _wal_ps_sta_process_rx_event: frame_control=%0x, qos_control=%0x, thread_id=%d +2360,,[ wal_powersave_sta.c : 351 ] wal_ps_sta_process_rx_event: leaky AP detected +2372,iiiiii,[ wal_powersave_ap.c : 1391 ] WAL_AP_PS_DBGID_DETECT_OUT_OF_SYNC_STA: vdev_id=%d, AssocID=%d, Timestamp=%d, OldestTxBufferedWaitingMs=%d, detect_thresh=%d, QDepeth=%d +2371,iI,[ wal_powersave_ap.c : 645 ] wal_ps_ap_sa_thread_msg_handler: peer=%d, cmd_id:%u +2370,iiii,[ wal_powersave_ap.c : 1526 ] WAL_AP_PS_DBGID_SLEEP_STA_DEC vdev_id = %d num_sleeping_sta:%d is_tid_paused:%d tid_pause_bitmap:%d +2369,iiii,[ wal_powersave_ap.c : 1467 ] WAL_AP_PS_DBGID_SLEEP_STA_INC vdev_id = %d num_sleeping_sta:%d is_tid_paused:%d tid_pause_bitmap:%d +2368,iiii,[ wal_powersave_ap.c : 381 ] WAL_AP_PS_DBGID_PSPOLL_REQ AssocID = %d Aid = %d PeerPSEnabled = %d SendNInProgress = %d +2367,iii,[ wal_powersave_ap.c : 430 ] WAL_AP_PS_DBGID_DUPLICATE_TRIGGER AssocID = %d SeqNO = %d Tid = %d +2366,iii,[ wal_powersave_ap.c : 446 ] WAL_AP_PS_DBGID_NO_TRIGGER AssocID = %d peer_handle->uapsd_trigger_tids = %d Tid = %d +2365,iIiI,[ wal_powersave_ap.c : 502 ] wal_ps_buf_peer_rx_event_handler(RX): aid=%d, fc=0x%x, seq=%d, timestamp_us=%u +2364,iIiII,[ wal_powersave_ap.c : 518 ] wal_ps_buf_peer_rx_event_handler(DATA_PPDU): aid=%d, fc=0x%x, seq=%d, qos=0x%x, timestamp_us=%u +2363,iiii,[ wal_powersave_ap.c : 1234 ] WAL_AP_PS_DBGIG_SET_PARAM vdev_id = %d AssocID = %d Param = %d Value = %d +2362,iiII,[ wal_powersave_ap.c : 1296 ] WAL_AP_PS_DBGIG_UAPSD_CFG vdev_id = %d AssocID = %d UAPSDTriggerTids = 0x%x UAPSDDeliveryTids = 0x%x +2386,iii,[ wal_powersave_buf_peer_sm.c : 1169 ] WAL_AP_PS_DBGID_UPDATE_TIM vdev_id = %d AssocID = %d IsTimSet = %d +2385,iiiii,[ wal_powersave_buf_peer_sm.c : 970 ] WAL_AP_PS_DBGID_NEXT_RESPONSE vdev_id = %d AssocID = %d USPActive = %d PendingUSP = %d PendingPollResp = %d +2384,iiI,[ wal_powersave_buf_peer_sm.c : 979 ] WAL_AP_PS_DBGID_START_SP vdev_id = %d AssocID = %d last_rx_trigger_time = %u +2383,iiII,[ wal_powersave_buf_peer_sm.c : 1010 ] WAL_AP_PS_DBGID_COMPLETED_EOSP vdev_id = %d AssocID = %d tx_comp_ts = %u last_rx_trigger_time = %u +2382,iii,[ wal_powersave_buf_peer_sm.c : 1029 ] WAL_AP_PS_DBGID_COMPLETED_EOSP vdev_id = %d AssocID = %d retried %d +2381,iiIIii,[ wal_powersave_buf_peer_sm.c : 1061 ] WAL_AP_PS_DBGID_SEND_COMPLETE vdev_id = %d AssocID = %d FrameCtrl = 0x%x QoSCtrl = 0x%x USPActive = %d PendingPollResp = %d +2380,iiii,[ wal_powersave_buf_peer_sm.c : 1120 ] WAL_AP_PS_DBGID_SEND_N_COMPLETE vdev_id = %d AssocID = %d USPActive = %d PendingPollResp = %d +2379,iiIii,[ wal_powersave_buf_peer_sm.c : 746 ] WAL_AP_PS_DBGID_TRIGGER vdev_id = %d AssocID = %d A_MILLISECONDS = %u USPActive = %d SendNInProgress = %d +2378,iiI,[ wal_powersave_buf_peer_sm.c : 759 ] WAL_AP_PS_DBGID_START_SP vdev_id = %d AssocID = %d A_MILLISECONDS = %u +2377,iiiIIII,[ wal_powersave_buf_peer_sm.c : 480 ] WAL_AP_PS_DBGID_PSPOLL vdev_id = %d AssocID = %d Tid = %d Flags = 0x%x legacy_tidmask = 0x%x allowed_legacy_tidmask = 0x%x pending_legacy_tidmap = 0x%x +2376,iiiII,[ wal_powersave_buf_peer_sm.c : 492 ] WAL_AP_PS_DBGID_PSPOLL_ERROR vdev_id = %d AssocID = %d TidPaused = %d AllowdLegacyTidMask = 0x%x LegacyTidMask = 0x%x +2375,iiiiiIII,[ wal_powersave_buf_peer_sm.c : 693 ] WAL_AP_PS_DBGID_UAPSD_RESPONSE vdev_id = %d AssocID = %d Tid = %d NumMPDUToSend = %d need_extra_qnull = %d Flags = 0x%x allow_n_flags_qnull = 0x%x SPLength = 0x%x +2374,iiIIII,[ wal_powersave_buf_peer_sm.c : 727 ] WAL_AP_PS_DBGID_UAPSD_RESPONSE_ERROR vdev_id = %d AssocID = %d Tid/Paused = 0x%x AllowedUAPSDTidMask = 0x%x PendingTidMap = 0x%x SPLength = 0x%x +2373,iiIi,[ wal_powersave_buf_peer_sm.c : 1226 ] WAL_AP_PS_DBGID_SYNC_TIM vdev_id = %d AssocID = %d Tids = 0x%x TimSet = %d +2390,i,[ twt_protocol.c : 398 ] twt_info unexpected: resp_req(%d)!=0 +2389,i,[ twt_protocol.c : 402 ] twt_info unexpected: next_req(%d)!=0 +2388,I,[ twt_protocol.c : 471 ] twt_parse_teardown_frame(!wake_tbtt_nego): twt_flow=%u +2387,,[ twt_protocol.c : 67 ] twt_power_2_mantissa wrong parameters +2423,i,[ twt_ap.c : 1696 ] ap_twt_add_i_session(send_failed): status=%d +2422,ii,[ twt_ap.c : 869 ] ap_twt_del_all_session: peer=%d, status=%d +2421,ii,[ twt_ap.c : 1746 ] ap_twt_del_dialog[unknown dialog_id]: peer=%d, dialog_id=%d +2420,i,[ twt_ap.c : 814 ] twt_ap_twt_session_t == NULL, session_id=%d +2419,i,[ twt_ap.c : 1220 ] %d: AP TWT not initialized on this MAC +2418,i,[ twt_ap.c : 1226 ] %d: AP TWT: disable cmd cannot find SOC handle +2417,i,[ twt_ap.c : 829 ] twt_ap_twt_session_t == NULL, session_id=%d +2416,i,[ twt_ap.c : 1244 ] %d: AP TWT not initialized on this MAC +2415,i,[ twt_ap.c : 1250 ] %d: AP TWT: disable cmd cannot find SOC handle +2414,i,[ twt_ap.c : 846 ] twt_ap_twt_session_t == NULL, session_id=%d +2413,,[ twt_ap.c : 239 ] POOL ALLOC FAILURE +2412,i,[ twt_ap.c : 564 ] %d: ap_twt_setup_tx_completion: parse_setup_frame error +2411,ii,[ twt_ap.c : 568 ] ap_twt_setup_tx_completion: status=%d, comp_ctxt=%d +2410,i,[ twt_ap.c : 1766 ] %d: AP TWT not enabled on this vdev +2409,i,[ twt_ap.c : 1780 ] %d: AP TWT not enabled on this peer +2408,i,[ twt_ap.c : 1906 ] %d: AP TWT not enabled on this vdev +2407,i,[ twt_ap.c : 1917 ] %d: AP TWT peer memory not available on this vdev +2406,i,[ twt_ap.c : 2866 ] TWT AP Unexpected frame type %d +2405,i,[ twt_ap.c : 1832 ] %d: AP TWT not enabled on this vdev +2404,i,[ twt_ap.c : 1841 ] %d: AP TWT not enabled on this peer +2403,i,[ twt_ap.c : 1969 ] %d: AP TWT not enabled on this peer +2402,i,[ twt_ap.c : 1975 ] %d: AP TWT not enabled on this vdev +2401,i,[ twt_ap.c : 1196 ] %d: AP TWT not initialized on this MAC +2400,i,[ twt_ap.c : 1202 ] %d: AP TWT: disable cmd cannot find SOC handle +2399,ii,[ twt_ap.c : 2359 ] %d: session not found: session_id=%d +2398,i,[ twt_ap.c : 3031 ] %d: AP TWT not initialized on this MAC +2397,i,[ twt_ap.c : 2278 ] %d: AP TWT not enabled on this peer +2396,i,[ twt_ap.c : 2307 ] TWT AP Unexpected command %d +2395,i,[ twt_ap.c : 1157 ] %d: AP TWT not initialized on this MAC +2394,i,[ twt_ap.c : 1167 ] %d: AP TWT disable +2393,ii,[ twt_ap.c : 1083 ] %d: AP TWT not initialized on this MAC %d +2392,ii,[ twt_ap.c : 1093 ] %d: AP TWT enable on MAC %d +2391,iii,[ twt_ap.c : 1031 ] %d: Mismatch between reported number ofsessions %d and actual number of sessions %d +2427,i,[ twt_ap_session_sm.c : 847 ] sending teardown frame failed: status=%d +2426,i,[ twt_ap_session_sm.c : 521 ] sending pause frame failed: status=%d +2425,i,[ twt_ap_session_sm.c : 414 ] sending renego req frame failed: status=%d +2424,i,[ twt_ap_session_sm.c : 716 ] sending resume frame failed: status=%d +2432,I,[ twt_ap_adaptor.c : 716 ] TWT_ADD_TIME_POINT: tsf_cnt(%u) >= arr_len +2431,I,[ twt_ap_adaptor.c : 719 ] TWT_ADD_TIME_POINT: tsf_cnt(%u) >= arr_len +2430,I,[ twt_ap_adaptor.c : 872 ] TWT_ADD_TIME_POINT: tsf_cnt(%u) >= arr_len +2429,I,[ twt_ap_adaptor.c : 878 ] TWT_ADD_TIME_POINT: tsf_cnt(%u) >= arr_len +2428,I,[ twt_ap_adaptor.c : 877 ] TWT_ADD_TIME_POINT: tsf_cnt(%u) >= arr_len +2440,I,[ twt_ap_btwt.c : 553 ] ap_btwt_check_persist error: b_twt_persistence(%u) > 254 +2439,II,[ twt_ap_btwt.c : 560 ] ap_btwt_check_persist error: reducing more than 1, cur=%u, new=%u +2438,ii,[ twt_ap_btwt.c : 757 ] %d: session not found: session_id=%d +2437,i,[ twt_ap_btwt.c : 577 ] ap_btwt_session == NULL, session_id=%d +2436,,[ twt_ap_btwt.c : 816 ] btwt get session failure +2435,,[ twt_ap_btwt.c : 384 ] POOL ALLOC FAILURE +2434,,[ twt_ap_btwt.c : 613 ] btwt get session failure +2433,i,[ twt_ap_btwt.c : 1065 ] sending pause frame failed: status=%d +2448,,[ twt_ap_smartwt.c : 498 ] twt_assign_peer POOL ALLOC FAILURE +2447,,[ twt_ap_smartwt.c : 522 ] twt_assign_peer POOL ALLOC FAILURE +2446,,[ twt_ap_smartwt.c : 428 ] twt_slot POOL ALLOC FAILURE +2445,III,[ twt_ap_smartwt.c : 266 ] ap_smartwt_get_slot_idx_start_time_end_time last_slot_extra_dur_us %llu temp %llu diff_in_time %llu +2444,IIiI,[ twt_ap_smartwt.c : 34 ] : num_peer=%d, flags=0x%x +2443,IiiI,[ twt_ap_smartwt.c : 40 ] [slot%u] peer=%d, session=%d, flags=0x%x +2442,i,[ twt_ap_smartwt.c : 699 ] ap_smartwt_setup_comp(slot_match failed): slot_id=%d +2441,i,[ twt_ap_smartwt.c : 1632 ] ap_smartwt_setup_teardown_peers(send_failed): status=%d +2449,iIii,[ wal_beacon.c : 1035 ] vdev:%d adj tbtt:0x%x d:%d by:%d +2459,,[ wal_swba.c : 671 ] no vaps to send beacon. swba_map is empty +2458,II,[ wal_swba.c : 762 ] Staggered beacon drift: next_beacon = %u, next_hw_tbtt = %u +2457,III,[ wal_swba.c : 772 ] Staggered beacon drift recover: next_beacon = %u, beacon_period = %u, until_next_tbtt = %u +2456,I,[ wal_swba.c : 792 ] cur_tsf %u +2455,II,[ wal_swba.c : 873 ] Burst beacon drift: next_beacon = %u, next_hw_tbtt = %u +2454,III,[ wal_swba.c : 883 ] Burst beacon drift recover: next_beacon = %u, beacon_period = %u, until_next_tbtt = %u +2453,IIIIII,[ wal_swba.c : 737 ] swba_intr: misc=0x%x,period=%u,tsf=%u,tbtt-curr=%u/next=%u,diff=%u +2452,,[ wal_swba.c : 275 ] next beacon tsf slot is not proper +2451,IIII,[ wal_swba.c : 1602 ] _wal_swba_set_and_fire: cur_tsf=0x%x sta_offset=0x%x next_beacon=0x%x next_beacon_slot=%u +2450,iiii,[ wal_swba.c : 1209 ] Fils is already enabled on some other vdev. fils_period %d vdev_id %d old_fils_period %d old_vdev_id %d +2463,I,[ wal_chain_mgmt.c : 71 ] WAL_DBGID_GET_HW_CHAINMASK SHIFTED_RF_CM: Rx:0x%x +2462,I,[ wal_chain_mgmt.c : 54 ] WAL_DBGID_GET_HW_CHAINMASK SHIFTED_RF_CM: Tx:0x%x +2461,II,[ wal_chain_mgmt.c : 36 ] WAL_DBGID_GET_HW_CHAINMASK Tx:0x%x Rx:0x%x +2460,III,[ wal_chain_mgmt.c : 166 ] WAL_DBGID_SET_HW_CHAINMASK 0x%x 0x%x 0x%x +2464,i,[ wal_channel_change.c : 124 ] _wal_set_home_channel : num home chans = %d +2470,,[ wal_cold_boot_cal.c : 478 ] cold boot cal start +2469,iiiii,[ wal_cold_boot_cal.c : 603 ] CBC:: pdev %d phy_mode %d mhz %d freq1 %d freq2 %d +2468,I,[ wal_cold_boot_cal.c : 666 ] CBC:: Total time taken for CBC = %u us +2467,iI,[ wal_cold_boot_cal.c : 529 ] CBC:: phy mode %d cal duration so far %u us +2466,i,[ wal_cold_boot_cal.c : 553 ] Cold Boot Cal, 8 second timeout: actual time taken = %d +2465,i,[ wal_cold_boot_cal.c : 271 ] cold_boot_cal start time in USecs: %d +2481,iiiIIII,[ wal_concurrency.c : 526 ] tsf_alloc: pdev_id = %d vdev_id = %d type = %d tsf_id = 0x%x bss_id = 0x%x pdev_tsf_id_map = 0x%x pdev_bss_id_map = 0x%x +2480,iiIIIiII,[ wal_concurrency.c : 987 ] staid_alloc: pdev_id = %d vdev_id = %d (%x.%x.%x) type = %d sta_id = 0x%x pdev_sta_id_map = 0x%x +2479,iiIIIiII,[ wal_concurrency.c : 1099 ] staid_free: pdev_id = %d vdev_id = %d (%x.%x.%x) type = %d sta_id = 0x%x pdev_sta_id_map = 0x%x +2478,ii,[ wal_concurrency.c : 1030 ] wal_concurrency_vdev_attach: vdev_id = %d defer_mac_addr_reg = %d +2477,iiiIIII,[ wal_concurrency.c : 835 ] tsf_free: pdev_id = %d vdev_id = %d type = %d tsf_id = 0x%x bss_id = 0x%x pdev_tsf_id_map = 0x%x pdev_bss_id_map = 0x%x +2476,iiIII,[ wal_concurrency.c : 1540 ] wal_vdev_add_random_mac_addr: pdev_id = %d vdev_id = %d spoof_mac=%x.%x.%x +2475,iiIII,[ wal_concurrency.c : 1582 ] wal_vdev_del_random_mac_addr: pdev_id = %d vdev_id = %d spoof_mac=%x.%x.%x +2474,IiiiIIII,[ wal_concurrency.c : 617 ] tsf_realloc (flag=0x%x): pdev_id = %d vdev_id = %d type = %d tsf_id = 0x%x bss_id = 0x%x pdev_tsf_id_map = 0x%x pdev_bss_id_map = 0x%x +2473,iiiII,[ wal_concurrency.c : 1470 ] wal_vdev_restore_mac: pdev_id = %d vdev_id = %d spoof_type = %d sta_id = 0x%x spoof_sta_id=0x%x +2472,iiIIIIII,[ wal_concurrency.c : 1489 ] wal_vdev_set_mac_addr: pdev_id = %d vdev_id = %d mac=%02x:%02x:%02x:%02x:%02x:%02x +2471,iiIIIiII,[ wal_concurrency.c : 1390 ] wal_vdev_set_spoofed_mac_addr: pdev_id = %d vdev_id = %d spoof_mac=%x.%x.%x spoof_type=%d sta_id = 0x%x spoof_sta_id=0x%x +2510,IIIiiI,[ ar_wal_phy_dev.c : 1584 ] _wal_dev_reset: mode=%x,c0=%lx,c1=%lx,inprog=%d,dis=%d,en=%x +2509,ii,[ ar_wal_phy_dev.c : 4846 ] SMART ANTENNA : config_enable : %d config_mode : %d + +2508,,[ ar_wal_phy_dev.c : 526 ] Data stall force reset condition met +2507,iii,[ ar_wal_phy_dev.c : 567 ] DATA_STALL: Type=%d FAIL_CNT[%d]=%d +2506,i,[ ar_wal_phy_dev.c : 318 ] DATA_STALL detection: PAUSE, pdev_id:%d +2505,iii,[ ar_wal_phy_dev.c : 797 ] DATA_STALL monitor: TIMEOUT, pdev_id:%d pause_countdown:%d active_vdev_cnt:%d +2504,i,[ ar_wal_phy_dev.c : 3029 ] wal_pdev_flush_all_non_pause_tids: send msg to SCHED_ALGO, thread_id =%d + +2503,IIIIII,[ ar_wal_phy_dev.c : 5753 ] DISPLAY_TPC_STATS: ctl_array_type is %lu ctl_array_len is %lu d1 is %lu d2 is %lu d3 is %lu d4 is %lu +2502,,[ ar_wal_phy_dev.c : 5782 ] DISPLAY_TPC_STATS: CTL array contents do not match! +2501,,[ ar_wal_phy_dev.c : 5807 ] DISPLAY_TPC_STATS: CTL array contents do not match! +2500,II,[ ar_wal_phy_dev.c : 5628 ] DISPLAY_TPC_STATS: rate_array_type is %lu rate_array_len is %lu +2499,,[ ar_wal_phy_dev.c : 5652 ] DISPLAY_TPC_STATS: Rates array contents do not match! +2498,I,[ ar_wal_phy_dev.c : 5415 ] DISPLAY_TPC_STATS: wal_pdev_get_ctl_array_len totalSize = %lu +2497,I,[ ar_wal_phy_dev.c : 5440 ] DISPLAY_TPC_STATS: wal_pdev_get_rates_array_len: totalSize = %lu +2496,ii,[ ar_wal_phy_dev.c : 335 ] DATA_STALL: rssi:%d vdev_id:%d +2495,IIIIII,[ ar_wal_phy_dev.c : 5509 ] DISPLAY_TPC_STATS: reg_power_type is %lu reg_power_array_len is %lu d1 is %lu d2 is %lu d3 is %lu d4 is %lu +2494,,[ ar_wal_phy_dev.c : 5535 ] DISPLAY_TPC_STATS: Regulatory array contents do not match! +2493,,[ ar_wal_phy_dev.c : 5550 ] DISPLAY_TPC_STATS: Regulatory array contents do not match! +2492,,[ ar_wal_phy_dev.c : 5567 ] DISPLAY_TPC_STATS: Regulatory array contents do not match! +2491,,[ ar_wal_phy_dev.c : 5584 ] DISPLAY_TPC_STATS: Regulatory array contents do not match! +2490,III,[ ar_wal_phy_dev.c : 5366 ] DISPLAY_TPC_STATS: wmi_tpc_config tlv header is %lu, chanFreq is %lu, phyMode is %lu +2489,IIiIIIII,[ ar_wal_phy_dev.c : 5368 ] DISPLAY_TPC_STATS: maxAntennaGain is %lu twiceMaxRDPower is %lu userAntennaGain is %d powerLimit is %lu rateMax is %lu numTxChain is %lu cfgctl is %lu flags is %lu +2488,iiI,[ ar_wal_phy_dev.c : 3134 ] SU PPDU_DURATION %d AMSDU agg_type %d amsdu_factor %f +2487,iiI,[ ar_wal_phy_dev.c : 3135 ] MU PPDU_DURATION %d AMSDU agg_type %d amsdu_factor %f +2486,iII,[ ar_wal_phy_dev.c : 2691 ] WAL_DBGID_SET_POWER_STATE pdev = %d current = 0x%x desired = 0x%x +2485,iiI,[ ar_wal_phy_dev.c : 3279 ] SET_PDEV_PARAM: pdev_id=%d: param=%d value=0x%x +2484,i,[ ar_wal_phy_dev.c : 3843 ] SET_PDEV_PARAM: DATA_STALL flag param=%d +2483,ii,[ ar_wal_phy_dev.c : 4856 ] SMART ANTENNA : config_enable : %d rx_antenna : %d + +2482,i,[ ar_wal_phy_dev.c : 6049 ] VOW enable %d +2556,i,[ ar_wal_vdev.c : 907 ] start hwbmiss delay wake tmr, timeout:%d +2555,III,[ ar_wal_vdev.c : 6699 ] AWGN_INT_DBG bw = 0x%x ed = 0x%x gi = 0x%x + +2554,ii,[ ar_wal_vdev.c : 214 ] WAL_DBGID_VDEV_ADDR_REGISTER vdev_id = %d pdev_id = %d +2553,ii,[ ar_wal_vdev.c : 227 ] WAL_DBGID_VDEV_ADDR_UNREGISTER vdev_id = %d pdev_id = %d +2552,ii,[ ar_wal_vdev.c : 6523 ] wal_vdev_delete_all_peer_msg_hdlr: thread_id =%d, vdev_id=%d + +2551,ii,[ ar_wal_vdev.c : 6453 ] wal_vdev_delete_all_peer_resume: vdev = %d, delete_all_peer_in_progress %d + +2550,i,[ ar_wal_vdev.c : 6475 ] wal_vdev_delete_all_peer_resume: vdev = %d, set WAL_VDEV_DEL_ALL_PEER_CONF_FROM_LOCAL_FRAME_COMPL + +2549,iii,[ ar_wal_vdev.c : 6488 ] wal_vdev_delete_all_peer_resume: vdev = %d, thread_id = %d, msg_id = %d + +2548,iii,[ ar_wal_vdev.c : 6494 ] wal_vdev_delete_all_peer_resume: vdev = %d, thread_id = %d, msg_id = %d + +2547,iiiIi,[ ar_wal_vdev.c : 2332 ] wal_vdev_down pdev_id %d vdev_id %d vdev_type %d flags 0x%x cnt_per_opmode %d +2546,,[ ar_wal_vdev.c : 2410 ] AWGN_INT_DBG vdev_down clearing timer handler +2545,I,[ ar_wal_vdev.c : 4612 ] %s: NULL pointer + +2544,II,[ ar_wal_vdev.c : 384 ] flow_config:0x%x 0x%x +2543,iiI,[ ar_wal_vdev.c : 6624 ] delete_all_peer wal_vdev_free_event_confirmation: vdev_id=%d, flag = %d, vdev_flag_mask = %x + +2542,iiiiiii,[ ar_wal_vdev.c : 6630 ] delete_all_peer wal_vdev_free_event_confirmation: vdev_id=%d, dbg_rt_del_all_peer_num=%d, dbg_be_del_all_peer_num=%d, dbg_tx_de_del_all_peer_num=%d, dbg_sched_del_all_peer_num=%d, dbg_tqm_del_all_peer_num=%d, dbg_conf_del_all_peer_num = %d + +2541,iii,[ ar_wal_vdev.c : 6646 ] delete_all_peer wal_vdev_free_event_confirmation DEL_ALL_PEER_DEL_CONF: vdev_id=%d, thread_id = %d, msg_id = %d + +2540,iii,[ ar_wal_vdev.c : 6657 ] vdev_id:%d, prev_channel:%d, current_channel=%d +2539,iIiiii,[ ar_wal_vdev.c : 5541 ] wal_vdev_migrate (%d, 0x%x): pdev %d->%d, active=%d/%d +2538,ii,[ ar_wal_vdev.c : 5362 ] _wal_vdev_migrate_bring_up: vdev_id = %d rssi_beacon = %d +2537,iIII,[ ar_wal_vdev.c : 5398 ] _wal_vdev_migrate_bring_up: vdev_id = %d cur_tsf_64 = 0x%x sta_bss_tstamp = 0x%x time_at_sta_bss_tstamp = 0x%x +2536,ii,[ ar_wal_vdev.c : 5277 ] _wal_vdev_migrate_tear_down: vdev_id = %d rssi_beacon = %d +2535,iII,[ ar_wal_vdev.c : 5292 ] _wal_vdev_migrate_tear_down: vdev_id = %d sta_bss_tstamp = 0x%x time_at_sta_bss_tstamp = 0x%x +2534,iIi,[ ar_wal_vdev.c : 350 ] wal_vdev_event_handler: vdev_id=%d event_type=0x%x remote_peer_count=%d +2533,,[ ar_wal_vdev.c : 186 ] peer_bitmap POOL ALLOC FAILURE +2532,ii,[ ar_wal_vdev.c : 5224 ] wal_vdev_post_migrate - old_pdev is %d, new_pdev is = %d +2531,ii,[ ar_wal_vdev.c : 5087 ] wal_vdev_pre_migrate - old_pdev is %d, new_pdev is = %d +2530,ii,[ ar_wal_vdev.c : 1285 ] wal_vdev_reconfig vdev_id %d tsf_id is %d +2529,iII,[ ar_wal_vdev.c : 2546 ] [ERP_PROTECTION]: param_val %d default profile 0x%x new profile 0x%x +2528,ii,[ ar_wal_vdev.c : 2765 ] WAL_VDEV_PARAM_HE_RTS_THRESHOLD_TU: new_rts_thres=%d vdev_id=%d +2527,Ii,[ ar_wal_vdev.c : 2979 ] #### NEW_STATS MGMT_HDR_dbg monitor vdev %x packet_capture_mode %d #### +2526,i,[ ar_wal_vdev.c : 2990 ] #### stale_period_sec %d #### +2525,i,[ ar_wal_vdev.c : 2995 ] #### mcast_dra_enabled %d #### +2524,iIII,[ ar_wal_vdev.c : 3468 ] WAL_DBGID_SETUP_RSSI_INTERRUPTS vdev_id = %d 0x%x 0x%x 0x%x +2523,iiii,[ ar_wal_vdev.c : 1728 ] wal_vdev_start vdev_id %d vdev_type %d vdev's mac %dbss_peer %d +2522,,[ ar_wal_vdev.c : 6131 ] _wal_vdev_state_publish: Entry +2521,ii,[ ar_wal_vdev.c : 6135 ] _wal_vdev_state_publish: bytes is %d, less than output size = %d +2520,i,[ ar_wal_vdev.c : 6142 ] _wal_vdev_state_publish: vdev_id_map %d +2519,i,[ ar_wal_vdev.c : 6147 ] _wal_vdev_state_publish: vdev %d +2518,ii,[ ar_wal_vdev.c : 6173 ] _wal_vdev_state_publish: vdev_type_state is %d, vdev_id_state = %d +2517,iiiiii,[ ar_wal_vdev.c : 6182 ] _wal_vdev_state_publish: mac_address is %d:%d:%d:%d:%d:%d +2516,,[ ar_wal_vdev.c : 6187 ] _wal_vdev_state_publish: Exit +2515,i,[ ar_wal_vdev.c : 1854 ] Spectral disabled as vdevs are zero: pdev:%d +2514,ii,[ ar_wal_vdev.c : 1871 ] wal_vdev_stop vdev_id %d vdev_type %d +2513,IIIIII,[ ar_wal_vdev.c : 2165 ] pdev(%x)peer %x,vdev-up for tidLen update,refcnt=%x,htc=%x,remap=%x,security=%x +2512,,[ ar_wal_vdev.c : 2271 ] AWGN_INT_DBG vdev_up: type AWGN Timer initialised + +2511,iiiIi,[ ar_wal_vdev.c : 2262 ] wal_vdev_up: pdev_id %d vdev_id %d, vdev_type %d flags 0x%x cnt_per_opmode %d +2566,,[ ar_wal_soc_dev.c : 2065 ] _wal_soc_pkt_info_run_algo: No monitored phy mode or device in sleep mode, enabled pktlog. + +2565,iiiiii,[ ar_wal_soc_dev.c : 2120 ] pktlog from %d to %d: tx_msdu %d, threshold %d, tx_ppdu %d, threshold %d. + +2564,iiiiii,[ ar_wal_soc_dev.c : 2129 ] pktlog from %d to %d: rx_msdu %d, threshold %d, rx_ppdu %d, threshold %d. + +2563,iiiiiii,[ ar_wal_soc_dev.c : 2138 ] pktlog from %d to %d: tx_msdu %d, sum_msdu %d, threshold %d, sum_ppdu %d, threshold %d. + +2562,IIII,[ ar_wal_soc_dev.c : 2268 ] _wal_soc_register_pkt_info_handler 0x%x, 0x%x, 0x%x, 0x%x +2561,ii,[ ar_wal_soc_dev.c : 718 ] wal_soc_set_mac_active: nss applied for mac0 - %d and %d +2560,iiiii,[ ar_wal_soc_dev.c : 756 ] wal_soc_set_mac_active: mhz=%d mac_id=%d tx_resumed=%d last_pdev_state=%d dpd_cal=%d +2559,i,[ ar_wal_soc_dev.c : 1064 ] wal_soc_switch_mode: Start switching to mode = %d +2558,iiii,[ ar_wal_soc_dev.c : 1088 ] wal_soc_switch_mode: mac_id=%d Tx/Rx chainmask: %d %d pdev_state = %d +2557,IIII,[ ar_wal_soc_dev.c : 2316 ] _wal_soc_unregister_pkt_info_handler 0x%x, 0x%x, 0x%x, 0x%x +2611,i,[ wal_dfs.c : 1173 ] Clear NOL list %d +2610,,[ wal_dfs.c : 1176 ] 2G band : NOL is invalid +2609,ii,[ wal_dfs.c : 1187 ] removing NOL %d MHz / %d MHz +2608,i,[ wal_dfs.c : 377 ] DFS Domain=%d +2607,,[ wal_dfs.c : 928 ] DFS wal_dfs_disable_nol_tx_timeout_hdlr Blocking all tx activity Timer Triggered for 1 min +2606,iiiiii,[ wal_dfs.c : 735 ] seg=%d, sidx=%d, offset=%d, chirp=%d, phy_mode=%d, f=%d +2605,iiii,[ wal_dfs.c : 741 ] su_center_chan =%d ,freq1 = %d, freq2 = %d, offset=%d +2604,i,[ wal_dfs.c : 753 ] 20MHZ=%d +2603,i,[ wal_dfs.c : 761 ] 40MHZ=%d +2602,i,[ wal_dfs.c : 775 ] 80MHZ=%d +2601,i,[ wal_dfs.c : 778 ] channel phy_mode=%d is invalid +2600,iii,[ wal_dfs.c : 790 ] offset=%d, chan_freq=%d, f=%d +2599,I,[ wal_dfs.c : 436 ] b20MHZ=0x%x +2598,I,[ wal_dfs.c : 477 ] b160MHZ=0x%x +2597,iiiiiiiii,[ wal_dfs.c : 495 ] 160 MHZ ADFS FW NOL - center freq %d %d %d %d %d %d %d %d %d +2596,iiiii,[ wal_dfs.c : 513 ] 165 MHz ADFS FW NOL Freq1 %d %d %d %d %d +2595,iiii,[ wal_dfs.c : 521 ] center_chan =%d ,freq1 = %d, freq2 = %d, phymode = %d +2594,I,[ wal_dfs.c : 442 ] b40MHZ=0x%x +2593,I,[ wal_dfs.c : 451 ] b80MHZ=0x%x +2592,iiii,[ wal_dfs.c : 463 ] NOL - 80_80 MHz %d %d %d %d + +2591,i,[ wal_dfs.c : 392 ] current Channel in DFS=%d +2590,,[ wal_dfs.c : 1069 ] dfs is NULL +2589,,[ wal_dfs.c : 1074 ] adfs list is empty +2588,ii,[ wal_dfs.c : 1085 ] update NOL %d MHz / %d MHz +2587,iiIi,[ wal_dfs.c : 1116 ] new NOL channel %d MHz / %d MHz, %llu, threadid = %d +2586,,[ wal_dfs.c : 1122 ] failed to allocate memory for nol entry +2585,ii,[ wal_dfs.c : 1317 ] check NOL %d MHz / %d MHz +2584,,[ wal_dfs.c : 1330 ] NOL check Failed +2583,ii,[ wal_dfs.c : 1336 ] wal_dfs_nol_checknol: num %d, status=%d +2582,ii,[ wal_dfs.c : 1248 ] delete NOL %d MHz / %d MHz +2581,,[ wal_dfs.c : 1259 ] dfs_nol_count < 0 +2580,i,[ wal_dfs.c : 1208 ] FreeElem %d +2579,ii,[ wal_dfs.c : 1219 ] removing NOL %d MHz / %d MHz +2578,,[ wal_dfs.c : 1135 ] DFS_DBG wal_dfs_print_nol dfs is NULL +2577,iiiII,[ wal_dfs.c : 1151 ] DFS_DBG wal_dfs_print_nol nol:%d channel=%d MHz width=%d MHz time left=%u seconds nol starttick=%llu +2576,Ii,[ wal_dfs.c : 1153 ] DFS_DBG wal_dfs_print_nol timeout=%llu pdev_id %d +2575,ii,[ wal_dfs.c : 1635 ] DFS segment Id %d offset %d +2574,i,[ wal_dfs.c : 1651 ] Invalid num channels: %d +2573,I,[ wal_dfs.c : 1677 ] ch_freq=0x%x Added to NOL +2572,i,[ wal_dfs.c : 1797 ] res TX Status=%d +2571,i,[ wal_dfs.c : 1760 ] res SCHED Status=%d +2570,ii,[ wal_dfs.c : 326 ] WAL_DFS_SCHED_SUSPEND_HNDLR thrd_id = %d pdev_id = %d +2569,II,[ wal_dfs.c : 344 ] %s: thread_id=%lx received DFS_SUSPEND msg + +2568,i,[ wal_dfs.c : 1732 ] sus TX Status=%d +2567,,[ wal_dfs.c : 846 ] DFS WAL_PDEV_PARAM_SET_USE_NOL command received, Triggered Timer +2618,I,[ wal_disa.c : 76 ] crc32_calc: CRC=0x%08x +2617,I,[ wal_disa.c : 433 ] tx_send_disa_frame: Seq No = 0x%x +2616,,[ wal_disa.c : 460 ] No MEMORY for DISA frame!!! +2615,i,[ wal_disa.c : 446 ] DISA HW configuration failed!!! Status=%d +2614,,[ wal_disa.c : 132 ] disa_frm_buf allocation failed...!!! +2613,ii,[ wal_disa.c : 135 ] disa_frm_buf allocation success...%d %d !!! +2612,,[ wal_disa.c : 368 ] _wal_disa_prepare_80211_frame: QoS frame with order bit set to 1 +2655,Ii,[ ar_wal_connection_pause.c : 1845 ] Tx_Pause: WAL_PEER_EVENT_SEND_N_COMPLETE sent: peer:0X%x, tid_num:%d +2654,,[ ar_wal_connection_pause.c : 3108 ] POOL ALLOC FAILURE +2653,,[ ar_wal_connection_pause.c : 3648 ] wal_tx_pause_alloc_handle POOL ALLOC FAILURE +2652,IiiI,[ ar_wal_connection_pause.c : 3399 ] Tx_Pause: WAL_PEER_SEND_N_REQ rcvd: peer:0X%x, tidno:%d, num_frames:%d, flags:0X%x [No_Resp] +2651,I,[ ar_wal_connection_pause.c : 3481 ] Tx_Pause: WAL_TX_PAUSE_PEER_RESET rcvd: peer:0X%x [No_Resp] +2650,i,[ ar_wal_connection_pause.c : 3491 ] Tx_Pause: WAL_TX_PAUSE_HWQ_EMPTY rcvd: tid_num:%d [No_Resp] +2649,i,[ ar_wal_connection_pause.c : 3501 ] Tx_Pause: WAL_CHECK_PENDING_CMDS_VDEV rcvd: vdev_id:%d [No_Resp] +2648,i,[ ar_wal_connection_pause.c : 3511 ] Tx_Pause: WAL_CHECK_PENDING_CMDS_PDEV rcvd: pdev_id:%d [No_Resp] +2647,i,[ ar_wal_connection_pause.c : 3519 ] Tx_Pause: unsupported no-resp request id:%d +2646,IiiI,[ ar_wal_connection_pause.c : 3440 ] Tx_Pause: WAL_PEER_PS_PRE_REQ rcvd: peer:0X%x, force_ps:%d, pm_ts:%d, paused_tidmask:0X%x [No_Resp] +2645,i,[ ar_wal_connection_pause.c : 3450 ] Tx_Pause: WAL_VDEV_TX_PAUSE_RESET_IND rcvd: vdev_id:%d [No_Resp] +2644,Ii,[ ar_wal_connection_pause.c : 3461 ] Tx_Pause: WAL_TX_PAUSE_TID_CREATE rcvd: peer:0X%x, tid_num:%d [No_Resp] +2643,i,[ ar_wal_connection_pause.c : 3471 ] Tx_Pause: WAL_TX_PAUSE_VDEV_CREATE rcvd: vdev_id:%d [No_Resp] +2642,iiii,[ ar_wal_connection_pause.c : 3137 ] Tx_Pause: WAL_PDEV_TX_PAUSE_REQ rcvd: pdev_id:%d, module_id:%d, block:%d, filter:%d +2641,iii,[ ar_wal_connection_pause.c : 3166 ] Tx_Pause: WAL_PDEV_TX_UNPAUSE_REQ rcvd: pdev_id:%d, module_id:%d, block:%d +2640,i,[ ar_wal_connection_pause.c : 3186 ] Tx_Pause: unsupported pdev request id:%d +2639,IiIIi,[ ar_wal_connection_pause.c : 3277 ] Tx_Pause: WAL_PEER_TX_PAUSE_UNPAUSE_REQ rcvd: peer:0X%x, module_id:%d, tids_to_pause:0X%x, tids_to_unpause:0X%x, filter:%d +2638,IiIIi,[ ar_wal_connection_pause.c : 3330 ] Tx_Pause: WAL_PEER_TX_BLOCK_UNBLOCK_REQ rcvd: peer:0X%x, module_id:%d, tids_to_block:0X%x, tids_to_unblock:0X%x, filter:%d +2637,i,[ ar_wal_connection_pause.c : 3359 ] Tx_Pause: unsupported peer request id:%d +2636,IiII,[ ar_wal_connection_pause.c : 2408 ] Tx_Pause: WAL_PEER_TX_PAUSE_UNPAUSE_COMPLETE sent: peer:0X%x, module_id:%d, tids_to_pause:0X%x, tids_to_unpause:0X%x +2635,IiII,[ ar_wal_connection_pause.c : 2439 ] Tx_Pause: WAL_PEER_TX_BLOCK_UNBLOCK_COMPLETE sent: peer:0X%x, module_id:%d, tids_to_block:0X%x, tids_to_unblock:0X%x +2634,iii,[ ar_wal_connection_pause.c : 2467 ] Tx_Pause: WAL_VDEV_TX_PAUSE_COMPLETE sent: vdev_id:%d, module_id:%d, block:%d +2633,iii,[ ar_wal_connection_pause.c : 2494 ] Tx_Pause: WAL_VDEV_TX_UNPAUSE_COMPLETE sent: vdev_id:%d, module_id:%d, block:%d +2632,iii,[ ar_wal_connection_pause.c : 2521 ] Tx_Pause: WAL_PDEV_TX_PAUSE_COMPLETE sent: pdev_id:%d, module_id:%d, block:%d +2631,iii,[ ar_wal_connection_pause.c : 2548 ] Tx_Pause: WAL_PDEV_TX_UNPAUSE_COMPLETE sent: pdev_id:%d, module_id:%d, block:%d +2630,IiII,[ ar_wal_connection_pause.c : 2586 ] Tx_Pause: WAL_PEER_TX_PAUSE_UNPAUSE_REQ comp: peer:0X%x, module_id:%d, tids_to_pause:0X%x, tids_to_unpause:0X%x +2629,IiII,[ ar_wal_connection_pause.c : 2599 ] Tx_Pause: WAL_PEER_TX_BLOCK_UNBLOCK_REQ comp: peer:0X%x, module_id:%d, tids_to_block:0X%x, tids_to_unblock:0X%x +2628,iii,[ ar_wal_connection_pause.c : 2610 ] Tx_Pause: WAL_VDEV_TX_PAUSE_REQ comp: vdev_id:%d, module_id:%d, block:%d +2627,iii,[ ar_wal_connection_pause.c : 2621 ] Tx_Pause: WAL_VDEV_TX_UNPAUSE_REQ comp: vdev_id:%d, module_id:%d, block:%d +2626,iii,[ ar_wal_connection_pause.c : 2632 ] Tx_Pause: WAL_PDEV_TX_PAUSE_REQ comp: pdev_id:%d, module_id:%d, block:%d +2625,iii,[ ar_wal_connection_pause.c : 2643 ] Tx_Pause: WAL_PDEV_TX_UNPAUSE_REQ comp: pdev_id:%d, module_id:%d, block:%d +2624,iiii,[ ar_wal_connection_pause.c : 3209 ] Tx_Pause: WAL_VDEV_TX_PAUSE_REQ rcvd: vdev_id:%d, module_id:%d, block:%d, filter:%d +2623,iii,[ ar_wal_connection_pause.c : 3229 ] Tx_Pause: WAL_VDEV_TX_UNPAUSE_REQ rcvd: vdev_id:%d, module_id:%d, block:%d +2622,i,[ ar_wal_connection_pause.c : 3240 ] Tx_Pause: unsupported vdev request id:%d +2621,iiiI,[ ar_wal_connection_pause.c : 3787 ] tid_pause_data_stall tid_num:%d pause_module_id_map:%d block_module_id_map:%d peer:0X%x +2620,I,[ ar_wal_connection_pause.c : 2229 ] Tx_Pause: Pdev event PEER_CREATE for peer:0X%x rcvd +2619,i,[ ar_wal_connection_pause.c : 3564 ] Tx_Pause: unsupported request id:%d +2663,Iii,[ wal_avg_bmiss.c : 140 ] %p bcn_cnt:%d, bmiss_cnt:%d + +2662,I,[ wal_avg_bmiss.c : 164 ] %p enter high bmiss mode +2661,I,[ wal_avg_bmiss.c : 142 ] b:0x%08x + +2660,I,[ wal_avg_bmiss.c : 158 ] %p can't find vdev + +2659,Iii,[ wal_avg_bmiss.c : 195 ] %p bcn_cnt:%d, bmiss_cnt:%d + +2658,I,[ wal_avg_bmiss.c : 197 ] b:0x%08x + +2657,I,[ wal_avg_bmiss.c : 215 ] %p can't find vdev + +2656,I,[ wal_avg_bmiss.c : 223 ] %p enter low bmiss mode +2671,ii,[ wal_rc_peer.c : 2400 ] rx cck Stats publish :: input buffer size = %d ofdm stats buffer size = %d +2670,ii,[ wal_rc_peer.c : 2231 ] rx mcs 3d Stats publish :: input buffer size = %d 3d stats buffer size = %d +2669,iiI,[ wal_rc_peer.c : 2327 ] rx mcs Stats publish :: input buffer size = %d mcs stats buffer size = %d, nss:8/bw:8 0x%08x +2668,ii,[ wal_rc_peer.c : 2364 ] rx ofdm Stats publish :: input buffer size = %d ofdm stats buffer size = %d +2667,ii,[ wal_rc_peer.c : 2472 ] tx cck Stats publish :: input buffer size = %d ofdm stats buffer size = %d +2666,ii,[ wal_rc_peer.c : 2189 ] tx mcs 3d Stats publish :: input buffer size = %d 3d stats buffer size = %d +2665,iiI,[ wal_rc_peer.c : 2280 ] tx mcs Stats publish :: input buffer size = %d mcs stats buffer size = %d, nss:8/bw:8 0x%08x +2664,ii,[ wal_rc_peer.c : 2436 ] tx ofdm Stats publish :: input buffer size = %d ofdm stats buffer size = %d +2673,II,[ wal_rc_vdev.c : 600 ] RATECTRL_DBGID_WAL_SET_VDEV_DATA_RX: rc=0x%x data_rc=0x%x +2672,II,[ wal_rc_vdev.c : 125 ] RATECTRL_DBGID_WAL_SET_VDEV_DATA_RX rc=0x%x data_rc=0x%x +2674,iii,[ wal_rc_pdev.c : 723 ] SET tx_chain_mask[%d]: new=%d old=%d +2721,iii,[ wal_rtt.c : 169 ] Detected Outlier. i: %d rtt: %d bw: %d +2720,iiii,[ wal_rtt.c : 234 ] chain: %d cumilative_rtt_per_chain: %d, num_samples: %d min_mean_rtt: %d +2719,ii,[ wal_rtt.c : 2166 ] _wal_collect_report_info: pre %d bw %d +2718,IIi,[ wal_rtt.c : 1667 ] _wal_report_type2_buffer_done() buff = %p, curr: %p len: %d +2717,IIii,[ wal_rtt.c : 1650 ] _wal_report_type2_buffer_init buff = %p cur_p = %p chan = %d report_type = %d +2716,iiiiii,[ wal_rtt.c : 2344 ] _wal_report_type2_collect_report_info: total_time = %d num_frms = %d info1 = %d info2 = %d info3 = %d start_ts = %d +2715,IIi,[ wal_rtt.c : 2395 ] RTT_INITR_TSTAMP: t2= 0x%08x%08x fac= %d +2714,iIiiIIII,[ wal_rtt.c : 2455 ] _wal_report_type2_collect_report_info: rtt_ps: %d rssi=0x%x tx_preamble=%d tx_bw=%d tx_rate_info1 = 0x%x tx_rate_info2= 0x%x rx_rate_info1=0x%x, rx_rate_info2 = 0x%x +2713,IIiIIiiiI,[ wal_rtt.c : 2485 ] RTT_INITR_TSTAMP: t2=%u, t3=%u t3_del=%d t1=%u t4=%u t4_del=%d rtt=%d meas_count=%d num_rtt_per_frame_info_saved: %u +2712,IIII,[ wal_rtt.c : 2507 ] _wal_report_type2_collect_report_info: tx_rate_info1=0x%x, tx_rate_info2 =0x%x, rx_rate_info1=0x%x, rx_rate_info2=0x%x +2711,IIiIII,[ wal_rtt.c : 2533 ] RTT_INITR_TSTAMP: t2= 0x%08x%08x fac= %d rx_preamble=%u, rx_bw=%u rssi = 0x%x +2710,,[ wal_rtt.c : 2377 ] DISCARDING MEASUREMENT!! T3 not captured +2709,I,[ wal_rtt.c : 1861 ] _wal_report_type2_update_start_ts: start_ts(rtt_ctxt) start_ts(peer_head) %u +2708,III,[ wal_rtt.c : 1443 ] _wal_rtt_attach() pdev = %p rtt_pdev_ctxt = %p wal_rtt_ctxt = %p +2707,iiii,[ wal_rtt.c : 339 ] rtt_compute_distance num_meas: %d mean_rtt: %d median_rtt: %d distance_cm: %d +2706,iiiiiii,[ wal_rtt.c : 1947 ] wal_rtt_ctxt_clean: rxoffld_under_cnt: %d rxoffld_alloc_cnt: %d rxind_under_cnt: %d rxind_alloc_cnt: %d tm_rx_comp_cnt: %d rxoffld_drop_cnt: %d rxind_drop_cnt: %d +2705,iiiiII,[ wal_rtt.c : 1599 ] _wal_rtt_ctxt_init() :freq: %d is_qca: %d force_legacy_ack: %d enable_ht_vht_ack :%d self_mac: %08x%04x +2704,IIIIII,[ wal_rtt.c : 502 ] _wal_rtt_get_buffer_ptr:max_len:0x%x rem_len:0x%x reqd_len:0x%x buff:0x%x buf_p:0x%x cur_p:0x%x +2703,iIIIi,[ wal_rtt.c : 1473 ] _wal_rtt_init() pdev_id = %d rtt_ctxt: %p alloc_buff = %p buff = %p max_buff_len = %d +2702,I,[ wal_rtt.c : 1999 ] rtt_local_send() Not a valid rtt frame type, retrun error! txrx_cb_flags: 0x%x +2701,iIIIi,[ wal_rtt.c : 2052 ] _wal_rtt_local_frame_send_with_rate: acks%d tid_num 0x%x rate_info 0x%08x%08x report %d +2700,IIiiI,[ wal_rtt.c : 3617 ] _wal_rtt_mt_cb: msg:0x%x id:0x%x s_thr:%d d_thr:%d ticks:0x%x +2699,,[ wal_rtt.c : 2582 ] TX completion message was dropped. Report failure +2698,,[ wal_rtt.c : 2588 ] _wal_rtt_null_ack_hdl() is called after RTT session is completed !!! +2697,II,[ wal_rtt.c : 2595 ] Ignore NULL ack for stale entry: ath_buf: %p: last queued NULL frame ath_buf: %p +2696,iiiiiiii,[ wal_rtt.c : 375 ] index: %d count: %d rtt_ps: %d sum_rtt: %d tx_bw: %d, rx_bw: %d tx_ch_idx: %d rx_ch_idx: %d +2695,,[ wal_rtt.c : 2641 ] TX completion message was dropped. Report failure +2694,,[ wal_rtt.c : 2647 ] _wal_rtt_tm_ack_hdl() is called after RTT session is completed !!! +2693,II,[ wal_rtt.c : 2654 ] Ignore TM ack for stale entry: ath_buf: %p: last queued TM frame ath_buf: %p +2692,,[ wal_rtt.c : 2924 ] _wal_rtt_tm_rx_hdl: TM frame not directed to me. Don't process +2691,,[ wal_rtt.c : 2936 ] _wal_rtt_tm_rx_hdl: Not a valid TM frame. Don't process +2690,III,[ wal_rtt.c : 3043 ] _wal_rtt_tm_rx_hdl: rx_ts %10u now_ts %10u rx_proc_delay %10u +2689,i,[ wal_rtt.c : 3117 ] _wal_rtt_tm_rx_hdl: HT_VHT ack enable RTT_TM_FTM1 %d +2688,iii,[ wal_rtt.c : 3122 ] _wal_rtt_tm_rx_hdl: expect_token=%d, dia_token=%d, follow_token=%d +2687,IIII,[ wal_rtt.c : 3222 ] _wal_rtt_tm_rx_hdl: t1_32=0x%x, t1_0=0x%x, t4_32=0x%x, t4_0=0x%x +2686,II,[ wal_rtt.c : 3243 ] CFR/CIR report queue full; CFR/CIR data at 0x%04x%04x will be dropped +2685,i,[ wal_rtt.c : 3247 ] no CFR/CIR pending for report type %d +2684,iII,[ wal_rtt.c : 3254 ] CFR/CIR pending for report type %d; CFR/CIR data at 0x%04x%04x will be dropped +2683,,[ wal_rtt.c : 3397 ] wal_rtt_tx_ppdu_done(): rx_location_info is found to be invalid +2682,IIIIIIIIi,[ wal_rtt.c : 3602 ] _wal_rtt_tx_ppdu_done(%u-sided): abf: 0x0 tx_preamble=%u, retries=%u tod_32=%u tod_0=%u toa_32=%u toa_0=%u fac_valid: %u fac=%d +2681,II,[ wal_rtt.c : 3449 ] CFR/CIR report queue full; CFR/CIR data at 0x%04x%04x will be dropped +2680,i,[ wal_rtt.c : 3453 ] no CFR/CIR pending for report type %d +2679,iII,[ wal_rtt.c : 3460 ] CFR/CIR pending for report type %d; CFR/CIR data at 0x%04x%04x will be dropped +2678,II,[ wal_rtt.c : 3506 ] CFR/CIR report queue full; CFR/CIR data at 0x%04x%04x will be dropped +2677,i,[ wal_rtt.c : 3510 ] no CFR/CIR pending for responder report type %d +2676,iII,[ wal_rtt.c : 3517 ] CFR/CIR pending for responder report type %d; CFR/CIR data at 0x%04x%04x will be dropped +2675,ii,[ wal_rtt.c : 3745 ] wal_rtt_unit_test: debug_cnt[%d] = %d +2723,iII,[ wal_rtt_init.c : 83 ] _wal_rtt_psoc_init() wal_rtt_ctxt idx in rtt_psoc_handle: %d rtt_ctxt: %p alloc_buff_p: %p +2722,Iiii,[ wal_rtt_init.c : 92 ] _wal_rtt_psoc_init() psoc_rtt handle: %p sizes rtt_tx_pool: %d rtt_rx_pool handle: %d, rtt_rx_ofld_pool: %d +2725,iIIi,[ wal_cfir.c : 44 ] wal_cfir_resolve: pdev %d cfg 0x%08x => 0x%08x status %d +2724,I,[ wal_cfir.c : 87 ] wal_cfir_req_unregister: req %p already unregistered +2735,ii,[ wal_spectral.c : 376 ] Pdev id : %d WMI event with reset_delay %d +2734,iIIi,[ wal_spectral.c : 465 ] <%d>: WMI event called %p with %u buffers for module %d +2733,ii,[ wal_spectral.c : 523 ] out_ring reap : Before read shadow_tail_idx %d & After read shadow_tail_idx %d +2732,ii,[ wal_spectral.c : 553 ] SSCAN: cfg.ScanCountCopy %d cfg.ScanCount %d +2731,i,[ wal_spectral.c : 758 ] pdev_id = %d: spectral sig handler +2730,i,[ wal_spectral.c : 781 ] pdev_id = %d: spectral sig handler +2729,i,[ wal_spectral.c : 807 ] pdev_id = %d: spectral sig handler +2728,i,[ wal_spectral.c : 647 ] Resume SSCAN : pending elements in out_ring %d +2727,iiii,[ wal_spectral.c : 162 ] SSCAN_DUMP mac_id = %d: trigger = %d enable = %d scan_mode = %d +2726,I,[ wal_spectral.c : 174 ] SSCAN_DUMP: wal_spectral_scan_get_config called %p +2737,i,[ direct_dma_wmi.c : 213 ] pdev_id = %d: DMA is not attached +2736,i,[ direct_dma_wmi.c : 236 ] pdev_id = %d: DMA is not attached +2749,Iiii,[ wal_tx_common.c : 648 ] wal_peer_wow_null_per_stats_update: stats_start_time = 0x%x null_success = %d, null_fail = %d, cumulative_wake_time_ps_sta_ms = %d +2748,Ii,[ wal_tx_common.c : 42 ] WAL_DBGID_STA_KICKOUT: peer=0x%x consecutive_null_failure=%d +2747,iii,[ wal_tx_common.c : 46 ] WAL_DBGID_STA_KICKOUT: null_ppdu_fail_time:%dms delta:%dms vdev_type:%d +2746,iIiIIIIII,[ wal_tx_common.c : 712 ] WAL_DBGID_STA_KICKOUT: KICKOUT_REASON_NULL_PER_CHECK_FAILURE_TH null_per= %d% wake_per= %d% null_fail_count= 0x%x, null_pass_count= 0x%x cumulative_wake_time_ps_sta_ms= 0x%x , null_per_stats_start_time = 0x%x, curr_time= 0x%x +2745,iiIIIi,[ wal_tx_common.c : 169 ] consecutive_failure_reset : pdev=%d, vdev=%d, peer=0x%x, tid=0x%x (flags=0x%x), failure=%d -> 0 +2744,IIIIII,[ wal_tx_common.c : 382 ] tpc:16/rc_extended_flags:16 =0x%08x sch_cmd_result:0x%x flush_reason:0x%xfes_sched_try:0x%x fes_result:0x%x tsFlags:8/tsAttempts:8 0x%08x + +2743,IIIIiiIIi,[ wal_tx_common.c : 390 ] pdev_vdev_id=0x%x, peer=0x%x,tid=0x%x (flags=0x%x), consecutive failure=%d, kickout thresh=%d rate_code=0x%x, tsRate flags=0x%x, ppdu_mprot_type:%d +2742,IIIIIii,[ wal_tx_common.c : 394 ] pdev:8/vdev:8 =0x%08x, peer=0x%x,tid=0x%x (flags=0x%x %x), consecutive failure=%d, kickout thresh=%d +2741,IIiIIII,[ wal_tx_common.c : 428 ] pdev:8/vdev:8 0x%08x peer=0x%x consecutive_failure:%d cur_time:%x elapsed_ppdu_fail_time:%x tid_retryfailure:%x vdevtype:%x +2740,II,[ wal_tx_common.c : 518 ] WAL_DBGID_STA_KICKOUT 0x%x 0x%x +2739,IIII,[ wal_tx_common.c : 522 ] ppdu_fail_time:%x current_time:%x delta:%x type:%x +2738,III,[ wal_tx_common.c : 289 ] WAL_DBGID_XCESS_FAILURES %p 0x%x MAC:%x +2763,III,[ wal_wmm.c : 36 ] WMMAC_PAUSE_CB: peer=0x%x blocked tids=0x%x/0x%x +2762,Iiii,[ wal_wmm.c : 65 ] WMMAC_Q_REPRIO: peer=0x%x tid=%d qid:%d->%d +2761,iI,[ wal_wmm.c : 71 ] WMMAC_PAUSE_CB: unblock tid(%d)=0x%x +2760,Iiii,[ wal_wmm.c : 340 ] WMMAC_Q_DEPRIO: peer=0x%x tid=%d qid:%d->%d +2759,IiI,[ wal_wmm.c : 350 ] WMMAC_Q_DROP: peer=0x%x tid(%d)=0x%x +2758,Iiiiii,[ wal_wmm.c : 393 ] WMMAC_STATUS: peer=0x%x, used=%d, admitted=%d, txq_sts=%d/%d, downgrade=%d +2757,iIiii,[ wal_wmm.c : 424 ] WMMAC_TXQ_STATUS ac=%d txq_status=0x%02x used=%d admitted=%d downgrade=%d +2756,iiiII,[ wal_wmm.c : 108 ] WMMAC_ADD_DELTS: ac=%d admitted=%d acm=%d block=0x%x downgrade=0x%x +2755,iii,[ wal_wmm.c : 156 ] WMMAC_UPDATE: used_time=%d admitted_time=%d, downgrade=%d +2754,IIII,[ wal_wmm.c : 465 ] WMMAC_PERIODIC_UPDATE 0x%x 0x%x 0x%x 0x%x +2753,I,[ wal_wmm.c : 475 ] WMMAC_NO_DOWNGRADE: unblock tid mask=0x%x +2752,Iii,[ wal_wmm.c : 496 ] WMMAC_PERIODIC_UPDATE (VO): peer=0x%x, used=%d, admitted=%d +2751,Iii,[ wal_wmm.c : 506 ] WMMAC_PERIODIC_UPDATE (VI): peer=0x%x, used=%d, admitted=%d +2750,iii,[ wal_wmm.c : 181 ] WMMAC_USED_TIME_EXCEED: used=%d admitted=%d wmmac_q=%d +2778,ii,[ wlan_buf.c : 1025 ] MGMT buf get failure: mgmtbufCnt = %d, bsmall = %d +2777,ii,[ wlan_buf.c : 1053 ] MGMT buf get beacon: mac_id:%d, rsvd:%d +2776,iii,[ wlan_buf.c : 1086 ] MGMT buf abf failure: smgmtbufCnt = %d, bsmall = %d mgmtBufCnt = %d +2775,IiiiI,[ wlan_buf.c : 1107 ] MGMT buf get success: abf = 0x%x mgmtBufCnt =%d smgmtbuffcnt = %d bsmall = %d,flags = 0x%x +2774,,[ wlan_buf.c : 1196 ] wlan_buf_mac_buffer_dispatcher no buffers available in chain +2773,i,[ wlan_buf.c : 1209 ] wlan_buf_mac_buffer_dispatcher mac_id=%d + +2772,,[ wlan_buf.c : 1212 ] wlan_buf_mac_buffer_dispatcher oops +2771,,[ wlan_buf.c : 1224 ] wlan_buf_mac_buffer_dispatcher oops +2770,IiI,[ wlan_buf.c : 808 ] buf free: free the reused abf:0x%x, thread:%d, cb flags:0x%x +2769,iIiiI,[ wlan_buf.c : 883 ] MGMT buf free,small:%d,abf:0x%x,thread:%d,bufCnt:%d,caller:%x +2768,IiIi,[ wlan_buf.c : 816 ] free beacon abf:0x%x, thread:%d, cb flags:0x%x,rsvd:%d +2767,iIii,[ wlan_buf.c : 861 ] SMGMT buf free,small:%d,abf:0x%x,thread:%d,bufCnt:%d +2766,i,[ wlan_buf.c : 1257 ] wlan_buf_rxbuf_requeue mac_id=%d + +2765,,[ wlan_buf.c : 1262 ] wlan_buf_mac_buffer_dispatcher oops +2764,,[ wlan_buf.c : 1288 ] wlan_buf_mac_buffer_dispatcher oops +2779,,[ aes_gcm.c : 318 ] GCM: Tag mismatch +2780,III,[ cmnos_intmux.c : 97 ] cmnos_intmux_dsr_attach error: handler = %p, pinum = %p, pparg=%p +2790,IIII,[ cmnos_allocram.c : 503 ] unknown proxy_flag:0x%x, ret:0x%x, ret1:0x%x,ret2:0x%x +2789,IiII,[ cmnos_allocram.c : 246 ] arena_flags: 0x%x, bytes:%d, call1:0x%x, call2:0x%x + +2788,,[ cmnos_allocram.c : 633 ] Dumping allocram info into buffer... +2787,i,[ cmnos_allocram.c : 694 ] Wrote: %d bytes +2786,,[ cmnos_allocram.c : 713 ] Creating file... +2785,,[ cmnos_allocram.c : 568 ] BEGIN: cmnos_allocram_info_dump() +2784,,[ cmnos_allocram.c : 599 ] HEX_DUMP: +2783,,[ cmnos_allocram.c : 609 ] END: cmnos_allocram_info_dump() +2782,iIIiii,[ cmnos_allocram.c : 571 ] arena: %d, start: 0x%p, current: 0x%p, used = %d, remaining: %d, num_allocs: %d + +2781,iiiii,[ cmnos_allocram.c : 597 ] max: %d, idx: %d, total_num: %d, total_bytes: %d, length: %d +2802,II,[ cmnos_thread.c : 4732 ] assert:r0=0x%x, r1=0x%x + +2801,III,[ cmnos_thread.c : 3061 ] thread exit exception:r0=0x%x, r1=0x%x, line:0x%x + +2800,ii,[ cmnos_thread.c : 3954 ] CMNOS_Buf_Alloc_Failure Buffer_Full_thread_id = %d Current_thread_id = %d + +2799,Iiiii,[ cmnos_thread.c : 3853 ] LACK ROOM IN %s THREAD'S MSG QUEUE FIFO (need %d, have %d); readIndex=%d writeIndex=%d +2798,iii,[ cmnos_thread.c : 1958 ] APP THREAD ID %d thread stack: %dB used, %dB unused + +2797,,[ cmnos_thread.c : 1785 ] cmnos_threads_delete + +2796,I,[ cmnos_thread.c : 1805 ] cmnos_threads_delete: wait for thread app id 0x%x to exit + +2795,I,[ cmnos_thread.c : 1808 ] cmnos_threads_delete: thread app id 0x%x is done + +2794,,[ cmnos_thread.c : 1867 ] cmnos_threads_delete: clean up mutex locks + +2793,,[ cmnos_thread.c : 1876 ] cmnos_threads_delete: clean up thread barriers + +2792,,[ cmnos_thread.c : 1887 ] cmnos_threads_delete: do global cleanups + +2791,I,[ cmnos_thread.c : 1792 ] cmnos_threads_delete: send exit to 0x%x thread app id + +2806,,[ platform_init.c : 55 ] WLAN Platform: Starting wlan tasks... +2805,,[ platform_init.c : 249 ] QMI Platform: Sending msg to RT thread to do cold cal init... +2804,i,[ platform_init.c : 84 ] WLAN Adrastea/MSL HW init, enable_hw_debug =%d +2803,,[ platform_init.c : 142 ] QMI Platform: Starting wlan tasks... +2808,,[ platform_deinit.c : 33 ] QMI Platform: Deinit started... +2807,,[ platform_deinit.c : 80 ] QMI Platform: Threads killed... +2809,ii,[ platform_common.c : 151 ] plat_set_one_ce_service_map_cfg: ERROR - idx %d > PIPE_TO_CE_MAP_CNT %d +2813,,[ platform_athdiag.c : 239 ] plat_athdiag_proc_read_req: Sending msg to RT thread to do athdiag read +2812,,[ platform_athdiag.c : 182 ] plat_athdiag_white_list_add: only support limited security area +2811,IIi,[ platform_athdiag.c : 377 ] QMI Platform: Athdiag read REQ received...offset = 0x%x | mem_type = 0x%x | data_len = %d +2810,IIi,[ platform_athdiag.c : 462 ] QMI Platform: Athdiag write REQ received...offset = 0x%x | mem_type = 0x%x | data_len = %d +2881,II,[ qmi_platform.c : 838 ] Error code 0x%x in msg_id 0x%x +2880,i,[ qmi_platform.c : 2341 ] qmi_plat_check_state: error - received CFG download REQ at wrong state %d +2879,i,[ qmi_platform.c : 2306 ] platform_proc_qdss_cfg_download_req: QDSS cfg download curr_size = %d, +2878,i,[ qmi_platform.c : 2322 ] platform_proc_qdss_cfg_download_req: QDSS cfg download done, current_size = %d, +2877,IIII,[ qmi_platform.c : 487 ] qmi_event_history_log: msg_id = 0x%x, client_handle = 0x%x, event = 0x%x, tick = 0x%x +2876,i,[ qmi_platform.c : 152 ] qmi_plat_check_state: error - received HOST_CAP_REQ at wrong state %d +2875,iI,[ qmi_platform.c : 181 ] qmi_plat_check_state: ERROR: wrong state %d to receive msg_id 0x%x +2874,i,[ qmi_platform.c : 192 ] qmi_plat_check_state: error - received MSA INFO REQ at wrong state %d +2873,i,[ qmi_platform.c : 201 ] qmi_plat_check_state: error - received MSA READY REQ at wrong state %d +2872,i,[ qmi_platform.c : 210 ] qmi_plat_check_state: error - sending MSA READY IND at wrong state %d +2871,i,[ qmi_platform.c : 220 ] qmi_plat_check_state: error - received CAPABILITY REQ at wrong state %d +2870,i,[ qmi_platform.c : 244 ] qmi_plat_check_state: error - received CAPABILITY REQ at wrong state %d +2869,i,[ qmi_platform.c : 277 ] qmi_plat_check_state: error - received BDF DOWNLOAD REQ at wrong state %d +2868,i,[ qmi_platform.c : 163 ] qmi_plat_check_state: WARNING: wrong state to send remote ddr mem cfg indication, state = %d +2867,i,[ qmi_platform.c : 288 ] qmi_plat_check_state: error - received CAL_REPORT REQ at wrong state %d +2866,i,[ qmi_platform.c : 299 ] qmi_plat_check_state: error - received M3_INFO REQ at wrong state %d +2865,i,[ qmi_platform.c : 309 ] qmi_plat_check_state: error - send FW ready at wrong state %d +2864,Ii,[ qmi_platform.c : 346 ] qmi_plat_check_state: error - Try to send FW Ready ind at wrong mode 0x%x and wrong state %d +2863,i,[ qmi_platform.c : 356 ] qmi_plat_check_state: error - received CFG REQ at wrong state %d +2862,Ii,[ qmi_platform.c : 374 ] qmi_plat_check_state: error - received MODE REQ w/ mode = 0x%x at wrong state %d +2861,Ii,[ qmi_platform.c : 388 ] qmi_plat_check_state: error - received MODE REQ w/ mode = 0x%x at wrong state %d +2860,Ii,[ qmi_platform.c : 411 ] qmi_plat_check_state: error - received MODE REQ w/ mode = 0x%x at wrong state %d +2859,i,[ qmi_platform.c : 425 ] qmi_plat_check_state: error - Try to send CAL Done Ind at wrong state %d +2858,Ii,[ qmi_platform.c : 433 ] qmi_plat_check_state: error - Try to send Cal Done Ind at wrong mode 0x%x and wrong state %d +2857,iI,[ qmi_platform.c : 172 ] qmi_plat_check_state: ERROR: wrong state %d to receive msg_id 0x%x +2856,i,[ qmi_platform.c : 445 ] qmi_plat_check_state: error - Try to send SOC WAKE at wrong state %d +2855,i,[ qmi_platform.c : 459 ] qmi_plat_check_state: error - Try to send SOC WAKE at wrong state %d +2854,II,[ qmi_platform.c : 3572 ] M3SSR recipe complete mac_id:%x ts:%x +2853,I,[ qmi_platform.c : 687 ] Client with handle 0x%x connected +2852,I,[ qmi_platform.c : 718 ] Client with handle 0x%x disconnected +2851,,[ qmi_platform.c : 1849 ] QMI Platform: sending QMI_WLFW_FILE_SAVE_IND_V01 +2850,I,[ qmi_platform.c : 1813 ] QMI Platform: BDF download REQ received, seg_id 0x%x +2849,,[ qmi_platform.c : 2076 ] QMI Platform: Cal report REQ received +2848,,[ qmi_platform.c : 2047 ] QMI Platform: Cap REQ received +2847,ii,[ qmi_platform.c : 1874 ] QMI Platform: QMI_WLFW_FILE_DATA_REQ_V01 received, invalid parameter, req_id %d, cur_seg_id %d +2846,,[ qmi_platform.c : 1885 ] QMI Platform: QMI_WLFW_FILE_DATA_REQ_V01 received, cur_seg_id +2845,ii,[ qmi_platform.c : 1913 ] QMI Platform: QMI_WLFW_FILE_DATA_RESP_V01 sent, data %d, end %d +2844,II,[ qmi_platform.c : 1008 ] wlfw_handle_host_cap_req: num_clients=%x, nm_modem=%x +2843,,[ qmi_platform.c : 1131 ] QMI Platform: Ind register REQ received +2842,I,[ qmi_platform.c : 1165 ] Client with unique ID 0x%x registering +2841,I,[ qmi_platform.c : 1170 ] Client with unique ID 0x%x found in client_list +2840,i,[ qmi_platform.c : 1694 ] QMI Platform: INI REQ received, debug mode = %d +2839,ii,[ qmi_platform.c : 1712 ] QMI Platform: recieved INI REQ, enablefwlog_valid = %d, enablefwlog = %d +2838,ii,[ qmi_platform.c : 1716 ] QMI Platform: recieved INI REQ, enablefwlog_valid = %d, enablefwlog = %d +2837,ii,[ qmi_platform.c : 1723 ] QMI Platform: recieved INI REQ, enablefwlog_valid = %d, enablefwlog = %d +2836,ii,[ qmi_platform.c : 1727 ] QMI Platform: Did not recieve INI REQ, enablefwlog_valid = %d, enablefwlog = %d +2835,Ii,[ qmi_platform.c : 2035 ] QMI Platform: M3 download REQ received, paddr = %ul, size = %d +2834,,[ qmi_platform.c : 2097 ] QMI Platform: MAC addr REQ received +2833,IIIIII,[ qmi_platform.c : 2144 ] Valid mac addr received from modem NV: %x : %x : %x : %x : %x : %x +2832,,[ qmi_platform.c : 1919 ] I shouldn't have been called F +2831,,[ qmi_platform.c : 2527 ] QDSS mem info REQ received +2830,I,[ qmi_platform.c : 2421 ] QDSS mode REQ received, mode = 0x%x +2829,i,[ qmi_platform.c : 1238 ] wlfw_handle_remote_ddr_mem_req: INFO: num_mem_cfg = %d +2828,,[ qmi_platform.c : 2221 ] QMI Platform: Shutdown req recvd +2827,i,[ qmi_platform.c : 2241 ] QMI Platform: platform state %d +2826,,[ qmi_platform.c : 1552 ] QMI Platform: Wlan Cfg REQ received +2825,i,[ qmi_platform.c : 1639 ] wlfw_handle_wlan_cfg_req: svc_cfg_len - %d +2824,I,[ qmi_platform.c : 1304 ] QMI Platform: Wlan mode REQ received, mode = 0x%x +2823,,[ qmi_platform.c : 1331 ] wlfw_handle_wlan_mode_req: hw_debug_valid = d, hw_debug = d +2822,,[ qmi_platform.c : 1976 ] WHY DID YOU CALL ME +2821,,[ qmi_platform.c : 914 ] QMI Platform: sending QMI_WLFW_RESPOND_GET_INFO_IND_V01 +2820,II,[ qmi_platform.c : 578 ] Ind with id 0x%x sent to client handle 0x%x +2819,II,[ qmi_platform.c : 607 ] Ind with id 0x%x not sent to client handle 0x%x +2818,II,[ qmi_platform.c : 589 ] Setting fw_status_mask in handle 0x%x with FW READY; new value = 0x%x +2817,II,[ qmi_platform.c : 596 ] Handle 0x%x, fw_status_mask = 0x%x +2816,II,[ qmi_platform.c : 602 ] Indication sent failed. Err code = 0x%x id = 0x%x +2815,,[ qmi_platform.c : 908 ] QMI Platform: sending QMI_WLFW_QDSS_TRACE_FREE_IND_V01 +2814,,[ qmi_platform.c : 886 ] QMI Platform: sending QMI_WLFW_QDSS_TRACE_SAVE_IND_V01 +2882,I,[ pool_mgr_api.c : 406 ] product resulting in buffer overflow: num_of_elem * elem_sz = 0x%x +2884,i,[ latency_profile.c : 451 ] profile_report: #profiles enabled > WMI limit (=%d) +2883,i,[ latency_profile.c : 487 ] profile_report: could not alloc, size=%d +2890,IIIi,[ sm.c : 338 ] SM: %x:%x:%p : allocation from event pool failed for event %d +2889,IIIi,[ sm.c : 226 ] SM: %x:%x:%p : invalid event %d +2888,IIIIiIIII,[ sm.c : 246 ] [SM:RcvEvt] CurS:%x <-- Event:%x mod_id=%x instance=%x vapid =%d make_sm = 0x%x extra = 0x%x extra2 = 0x%x extra3 = 0x%x +2887,IIIii,[ sm.c : 255 ] SM: %x :%x :%p : event %d not handled in state %d +2886,iiIIiIIII,[ sm.c : 271 ] [SM:RcvEvt] Evt:%d not handled in CurS:%d mod_id=%x instance=%x vapid =%d make_sm = 0x%x extra = 0x%x extra2 = 0x%x extra3 = 0x%x +2885,IIIIiIIII,[ sm.c : 388 ] [SM:ChgSta] CurS:%x --> NextS:%x mod_id=%x instance=%x vapid =%d make_sm = 0x%x extra = 0x%x extra2 = 0x%x extra3 = 0x%x +2894,ii,[ mu_gid_mgmt.c : 99 ] 11ac MU-MIMO GID MGMT: user successfully assigned completed: assoc id: %d, mu_user_id: %d +2893,iii,[ mu_gid_mgmt.c : 116 ] 11ac MU-MIMO GID MGMT: Send GID MGMT failed. AID: %d, mu_user_id: %d, status: %d +2892,iiIIIIII,[ mu_gid_mgmt.c : 166 ] 11ac MU-MIMO GID MGMT: Sending GID MGMT frame: AID: %d, mu_user_id: %d, grp_status[0]: 0x%08x, grp_status[1]: 0x%08x, user_pos_map[0]: 0x%08x, user_pos_map[1]: 0x%08x, user_pos_map[2]: 0x%08x, user_pos_map[3]: 0x%08x +2891,ii,[ mu_gid_mgmt.c : 173 ] 11ac MU-MIMO GID MGMT: Send GID MGMT failed. AID: %d, mu_user_id: %d +2906,II,[ ratectrl.c : 7357 ] rc_get_nondata_rc: %x for peer:%p +2905,II,[ ratectrl.c : 7410 ] rc_get_ofdm_nondatarc: %x for peer:%p +2904,iIIII,[ ratectrl.c : 7526 ] pdev_id:%d rc_leg_rate_allowed=0x%x rc_legacy_mask=0x%x temp_cck_rate_bitmap=0x%x module_id=0x%x +2903,iIIIII,[ ratectrl.c : 7556 ] FINAL: pdev_id:%d rc_leg_rate_allowed=0x%x rc_legacy_mask=0x%x pdev->rc_legacy_mask: BT=0x%x LTE_COEX=0x%x HE_ASSOC=0x%x + +2902,,[ ratectrl.c : 5942 ] Set INVALID!!! RTS Rate Index +2901,ii,[ ratectrl.c : 5952 ] _RATE_SetRtsCtsRate: Def RTS Rate Rix %d Alt RTS Rate Rix %d +2900,I,[ ratectrl.c : 4722 ] SEC_RETRY skip PER update flags:0x%x +2899,iii,[ ratectrl.c : 4958 ] _rcUpdate_HT: Xretry Prot failure: After Toggle RTS -- rtsForFirstSeries %d --[RTS Profile %d Toggle %d] + +2898,IIIII,[ ratectrl.c : 7914 ] rc_update_rts_per: rts_rix 0x%x def_rix 0x%x alt_rix 0x%x curr_rix 0x%x ni_legacy_rate_set 0x%x + +2897,II,[ ratectrl.c : 2273 ] rc_validate_rateset/NON_HT: Before mask update ni_legacy_rate_set 0x%x validTxRateMask 0x%x +2896,II,[ ratectrl.c : 2316 ] rc_validate_rateset/NON_HT: After mask update ni_legacy_rate_set 0x%x validTxRateMask 0x%x +2895,iiIiiI,[ ratectrl.c : 2477 ] NSS Mismatch: 160nss %d, 160_mcs_nss_set %d, 160_mcs_nss_map %x, 80nss %d, 80_mcs_nss_set %d, 80_mcs_nss_map %x +2913,I,[ ratectrl_if.c : 271 ] is_rc_peer_mem_optimized: peer is invalid vdev:0x%x +2912,IIi,[ ratectrl_if.c : 2128 ] AUTORATE_RESET_USER_START_RATE: peer phymode:8/ht:8/vht:8 : 0x%08x ni_flags 0x%x user_start_rate %d +2911,,[ ratectrl_if.c : 1870 ] RATE_EnableCCKRatesInHTMode: No vdev's attached to pdev, rejecting WLAN_PDEV_ENABLE_CCK_RATE ! + +2910,IiiIiii,[ ratectrl_if.c : 1932 ] Enabling coex restriction (pdev - 0x%x) enable %d min_rate:%d on wlan_peer:0x%x rc_mode:%d rateMax:%d bestRate:%d +2909,i,[ ratectrl_if.c : 1942 ] vdev[%d] is NULL, rejecting WLAN_PDEV_ENABLE_CCK_RATE ! + +2908,IiiIiii,[ ratectrl_if.c : 1920 ] Enabling coex restriction (pdev - 0x%x) enable %d min_rate:%d on wlan_peer:0x%x rc_mode:%d rateMax:%d bestRate:%d +2907,IIiII,[ ratectrl_if.c : 2289 ] +org_rc_mask_null pdev_rc_mask[0]:%x pdev_rc_mask[1]:%x phymode:%d ni_legacy_rate_set:%x rc_legacy_mask_final:%llx +2933,,[ ratectrl_debug.c : 425 ] setUnitTestcmd FAILED : SUPPORT_AUTORATE_RESET not implemented +2932,Ii,[ ratectrl_debug.c : 516 ] RTS_DEBUG: vdev id:8/rts cts type:8/rts cts profile:16 0x%08x rts_rix %d + +2931,I,[ ratectrl_debug.c : 548 ] RT_UPDATE SU Mode, BW:8/NSS8: %08u. +2930,I,[ ratectrl_debug.c : 551 ] RT_UPDATE MU Mode, BW:8/NSS8: %08u. +2929,I,[ ratectrl_debug.c : 556 ] RT_UPDATE Last Probed BW:8/NSS:8/MCS:8 : %08u. +2928,IIIII,[ ratectrl_debug.c : 563 ] RT_UPDATE MCS_%u: PPDU Tried: %u, PPDU ACK Failed: %u, MPDUS Tried: %u, MPDUS Failed: %u. +2927,I,[ ratectrl_debug.c : 626 ] RA_DBG_CMDID_TEST_PER_CONV_UL_MUMIMO: ltPer:8/stPer:8/curr_per:8 : 0x%08x +2926,iiiiiiii,[ ratectrl_debug.c : 718 ] MCAST_RC: vdev_id: %d, Is mcast dra enabled: %d +MCAST_RC: stale_period_sec: %d +MCAST_RC: Number of stale clients: %d +MCAST_RC: Default Mcast rate: %d Mbps, rix: %d +MCAST_RC: Auto Mcast rate: %d Mbps, rix: %d + +2925,iii,[ ratectrl_debug.c : 453 ] Number of invalid peer assoc capabilities for HT %d, VHT %d, HE %d + +2924,iiii,[ ratectrl_debug.c : 721 ] MCAST_DBG_RC: RC queries %d, RC updates %d, RIX error: %d, Peer count error: %d + +2923,iii,[ ratectrl_debug.c : 726 ] MCAST_DBG_RC: Last stale peer id %d, current time %d, stale tx time %d + +2922,ii,[ ratectrl_debug.c : 733 ] MCAST_DBG_RC: %d Mbps - %d + +2921,iiiii,[ ratectrl_debug.c : 749 ] MCAST_DBG_RC: peer id: %d, rate kbps: %d, mcast rate kbps: %d, rix:%d, mcast rix:%d + +2920,,[ ratectrl_debug.c : 877 ] DISABLE_INVALID_RATES: Invalid arg count +2919,,[ ratectrl_debug.c : 882 ] DISABLE_INVALID_RATES: Invalid arg count +2918,,[ ratectrl_debug.c : 901 ] DISABLE_INVALID_RATES: Invalid preamble or bw or nss +2917,,[ ratectrl_debug.c : 907 ] DISABLE_INVALID_RATES: Invalid MCS +2916,,[ ratectrl_debug.c : 918 ] DISABLE_INVALID_RATES: Exceeded max invalid rate count, Disable and add invalid rate +2915,,[ ratectrl_debug.c : 936 ] DISABLE_INVALID_RATES: Invalid arg count +2914,i,[ ratectrl_debug.c : 481 ] g_dbg_enable_he_short_gi: %d + +2934,iiiiii,[ ratectrl_ofdma.c : 898 ] OFDMA_RC_DBG: aid: %d, ref_rix: %d, trialBaseRate: %d, complMismatchCnt: %d, ru_cnt: %d, rc_mode: %d +2948,i,[ ratectrl_ulmumimo.c : 830 ] UL_MUMIMO_DBG_RC, MonoRC forward, nRate %d +2947,i,[ ratectrl_ulmumimo.c : 841 ] UL_MUMIMO_DBG_RC, MonoRC backward, nRate %d +2946,iiiiiii,[ ratectrl_ulmumimo.c : 899 ] UL_MUMIMO_DBG_RC, intf_ss_type %d, Update next rate nss %d, mcs %d with PER %d and discount %d to ltPer %d, stPer %d +2945,iiii,[ ratectrl_ulmumimo.c : 163 ] UL_MUMIMO_DBG_RC, Best rate in backward rates: %d, %d, maxTp: %d %d +2944,iiii,[ ratectrl_ulmumimo.c : 114 ] UL_MUMIMO_DBG_RC, Best rate in forward rates: %d, %d, maxTp: %d %d +2943,iiiii,[ ratectrl_ulmumimo.c : 326 ] UL_MUMIMO_DBG_RC, rc_mode %d, forward, BestTput %d, bestRate%d, bestNss %d, nForward %d +2942,iiiii,[ ratectrl_ulmumimo.c : 398 ] UL_MUMIMO_DBG_RC, not in use rc_mode %d, backward, BestTput %d, bestRate%d, bestNss %d, nBackward %d +2941,iiiiii,[ ratectrl_ulmumimo.c : 463 ] UL_MUMIMO_DBG_RC, bw %d, rc_mode %d, Best rate : %d, %d, maxTp: %d %d +2940,iiiii,[ ratectrl_ulmumimo.c : 336 ] UL_MUMIMO_DBG_RC, rc_mode %d, backward, BestTput %d, bestRate%d, bestNss %d, nBackward %d +2939,iiiiii,[ ratectrl_ulmumimo.c : 386 ] UL_MUMIMO_DBG_RC, not in use rc_mode %d, last_rate %d, forward, BestTput %d, bestRate%d, bestNss %d, nForward %d +2938,iiiii,[ ratectrl_ulmumimo.c : 1226 ] UL_MUMIMO_DBG_RC, rc_sib_update_state, bw:%d, idx=%d, num_rix=%d, nss_idx=%d, lastSucRate=%d +2937,iiiiii,[ ratectrl_ulmumimo.c : 1039 ] UL_MUMIMO_DBG_RC, update PER, state_idx %d, ltPer %d, stPer %d, curr_per %d, nTotalMpdu %d, rix %d +2936,i,[ ratectrl_ulmumimo.c : 1108 ] UL_MUMIMO_DBG_RC, Update lower state %d +2935,iiii,[ ratectrl_ulmumimo.c : 1132 ] UL_MUMIMO_DBG_RC, Update BW %d, next higher state %d, rix %d with PER %d +3001,IIIiIII,[ sched_algo.c : 10932 ] AGGR_DBG: aid: %u avg_msdu_bytes: %u, amsdu_estimate: %u, required_bits: %d, required_mpdu: %u, ppdu duration: %u, phy_rate_kbps: %u +3000,iIIii,[ sched_algo.c : 1957 ] smart_basic_trig : skip_no_ul_data service_interval=%d, time_diff=%lu, last_sched_tsmp=%lu, aid=%d, tid_num=%d + +2999,iiIIii,[ sched_algo.c : 1963 ] smart_basic_trig : service_interval=%d, exp_bytes=%d, time_diff=%lu, last_sched_tsmp=%lu, aid=%d, tid_num=%d + +2998,I,[ sched_algo.c : 7303 ] BA recovery - mismatch ack type, tid:%x +2997,I,[ sched_algo.c : 2007 ] ul_dbg_check_eligibility: No UL Trig: is_wmm_txq_ul_trig_disabled=%u +2996,IiiiIIII,[ sched_algo.c : 2104 ] ul_dbg_check_eligibility: tid_q=%x, tid_num=%d, is_bsr_timeout=%d, num_frms=%d, curr_time = %u, tsf_now=%u, bsr_ts=%u, bsr_timeout_ms=%u +2995,i,[ sched_algo.c : 2111 ] ul_dbg_check_eligibility: trigger_state=%d +2994,iiii,[ sched_algo.c : 2157 ] OFDMA_SCHED_DECISION: aid: %d, tid_num: %d, unreliable_basic_trigger: %d, unreliable_metric: %d +2993,iIi,[ sched_algo.c : 6210 ] MISSING_BSR_DEBUG: aid: %d, trigger in flight=false, updated_ac_bmap: 0x%08x, miss_count: %d +2992,iIi,[ sched_algo.c : 6226 ] MISSING_BSR_DEBUG2: aid: %d, trigger in flight=false, updated_ac_bmap: 0x%08x, miss_count: %d +2991,iiii,[ sched_algo.c : 6257 ] MISSING_BSR_DEBUG: aid: %d, trigger in flight=false, ac=%d, orig_timeout: %d, new_timeout: %d +2990,iiIIiIII,[ sched_algo.c : 6295 ] twt_dbg/ul_dbg: sched_cmd_completion txqid=%d, sched_id=%d, seq_type=%u, peer_id=%u, pending_commands=%d,compl_ts=%u, user_resp=%u, seq_compl_flags=0x%x + +2989,IIIII,[ sched_algo.c : 6307 ] twt_dbg: sched_cmd_completion peer_id=%u, tid_num=%u, sched_flags=0x%x, trigger_state=%u, eosp_state=%u + +2988,i,[ sched_algo.c : 3246 ] STANDALONE:sched_algo_cmd_update_user_info NDPA FLAG NOT SET $$$tid_num=%d +2987,IIII,[ sched_algo.c : 4927 ] sched_algo_configure_ul_rts_protection: t_success_rts: %u, t_success_no_rts: %u, t_fail_no_rts: %u, t_fail_rts: %u +2986,iIIIIII,[ sched_algo.c : 4996 ] sched_algo_configure_ul_rts_protection: ac: %d, num_users: %u, tb_ppdu_duration: %u, trig_rix: %u, mba_rix: %u, min_coll_prob_to_enable_rts_cts: %u, cur_fail_pct: %u +2985,iII,[ sched_algo.c : 11440 ] sched_algo_disable_sched_mode_bmap_update: IN: txq_id: %d, disabled_sched_mode_bmap_req: 0x%08x, disabled_sched_mode_bmap: 0x%08x +2984,iII,[ sched_algo.c : 11467 ] sched_algo_disable_sched_mode_bmap_update: OUT: txq_id: %d, disabled_sched_mode_bmap_req: 0x%08x, disabled_sched_mode_bmap: 0x%08x +2983,IiiiiII,[ sched_algo.c : 5204 ] ul_dbg_sched_dispatch_result: tsf_lsb=%u, sched_mode=%d, tx_mode=%d, seq_type=%d, num_users=%d, tx_time_us=%u, txop_time_us=%u +2982,i,[ sched_algo.c : 5470 ] MISSING_BSR_DEBUG: aid: %d, trigger in flight=true +2981,,[ sched_algo.c : 5567 ] MBSSID_CTRL_FRM_DBG MBSSID Ctrl Frame Feature is in use +2980,,[ sched_algo.c : 5590 ] sched_algo_configure_ul_rts_protection: using shorter RTS duration for non-repeater environment +2979,iiiIiIII,[ sched_algo.c : 5702 ] twt_dbg_eosp / ul_dbg: sched_dispatch_sched_cmd txqid=%d, sched_id=%d, posted_commands=%d,sched_cmd_flags=0x%x, is_partial=%d, tsf_low=%u, start_time=%u, end_time=%u + +2978,IiiIII,[ sched_algo.c : 9942 ] twt_dbg_eosp: sched_algo_dl_eligible_check peer_id=%u, is_announced=%d, is_ul_received=%d,tidq->tid_num=%u, tid_ext_flags=0x%x, eosp_state=%u +2977,ii,[ sched_algo.c : 4535 ] TTL dropped count:%d, tid:%d +2976,iii,[ sched_algo.c : 10592 ] UL_FD_RSSI_DBG:sw peer id %d ulmumimo_fd_rssi_100x %d dbg_ulmumimo_fd_rssi_threshold_100x %d + +2975,iiiIiii,[ sched_algo.c : 10629 ] UL_MU_MIMO_TX_PARAMS: AID %d: NSS %d: MCS: %d, qdepth bytes: %lu, txtime %d, num frames: %d tidq_ul_mumimo_eligible %d + +2974,iiiii,[ sched_algo.c : 10728 ] OFDMA_SCHED_DECISION: top level eligibility: aid: %d, tid_num: %d, sta_is_lowq: %d, avg_txtime_us: %d, average_ul_qdepth_bytes: %d +2973,III,[ sched_algo.c : 8652 ] migrate peer in delete prog %p, flags:%x, sw_peer_id:%x +2972,iII,[ sched_algo.c : 8676 ] migrate peer %d, already on MAC(%u %u) +2971,II,[ sched_algo.c : 11360 ] MBSSID_CTRL_FRM_DBG peer_a RXCFM cap = %u, peer_b RXCFM cap = %u +2970,,[ sched_algo.c : 11370 ] MBSSID_CTRL_FRM_DBG Using MBSSID Control Frame - Triggering peers on different vdevs +2969,,[ sched_algo.c : 11388 ] MBSSID_CTRL_FRM_DBG Using MBSSID Control Frame - Triggering peers on different vdevs +2968,iiiiii,[ sched_algo.c : 3816 ] PPDU Duration debug: sched_id=%d, num_users=%d, txop_us=%d,txtime_us=%d, seq_type=%d, sched_type=%d +2967,iiI,[ sched_algo.c : 7480 ] soft_msduq_delete: tickle dropped :%d qtype:%d 0x%x +2966,IIIIII,[ sched_algo.c : 7500 ] sched_algo_process_trigger non_paused_tid enter: tid=0x%x,pdev=0x%x:0x%x,flag=0x%x, paused=0x%0x num_mpdus_in_fq=0x%0x +2965,IIIII,[ sched_algo.c : 7515 ] discard trigger msg as pdev mismatch peer_id=%x,tid=%x,pdev=%x:%x,flag=%x +2964,IIIIII,[ sched_algo.c : 7697 ] sched_algo_process_trigger non_paused_tid run_scheduler: tid=0x%x,pdev=0x%x:0x%x,flag=0x%x, paused=0x%0x num_mpdus_in_fq=0x%0x +2963,i,[ sched_algo.c : 9178 ] sched_algo_req_handler: unsupported msg type:%d +2962,iiiiii,[ sched_algo.c : 2661 ] twt_dbg: twt_sched_algo_return (slot ended):txqid=%d, tsf_now_msb=%d, lsb=%d, curr_slot_end msb=%d, lsb=%d slot_valid:%d +2961,iiI,[ sched_algo.c : 2720 ] ul_dbg_sched_new_run: txqid=%d, sched_cmd_space=%d, flags=0x%x +2960,iiI,[ sched_algo.c : 2795 ] twt_dbg: twt_sched_algo_run_policy: txqid=%d, sched_cmd_space=%d, flags=%x +2959,iiII,[ sched_algo.c : 6577 ] TTL tid:%d txq_id:%d, flg-clr:%x %x +2958,ii,[ sched_algo.c : 291 ] STANDALONE : SEND MESSAGE TO SCHEDULER %d thread id %d +2957,IIIIIIII,[ sched_algo.c : 4640 ] tcp_ul_dbg_sched_dispatch_result: tx_mode=%u, peer_sw_id=%u, sched_id=0x%x, qdepth_adv =%u, qdepth_implicit=%u, qdepth_implicit_final=%u, ru_start=%u, ru_end=%u +2956,ii,[ sched_algo.c : 1657 ] ul_dbg_sched_algo_tid_register: num_frames=%d, tid_num=%d +2955,iiiIi,[ sched_algo.c : 1695 ] TID REG:peer %d tidnum %d txqid %d flags %x num active %d + +2954,ii,[ sched_algo.c : 1761 ] ul_dbg_sched_algo_tid_unregister: num_frames=%d, tid_num=%d +2953,iiiIii,[ sched_algo.c : 1815 ] TID UNREG:peer %d tidnum %d txq %d flags %x num active %d, pause_tid:%d +2952,II,[ sched_algo.c : 3075 ] sched_algo_cmd_update_user_info: g_qnull_peer_id%x %x +2951,,[ sched_algo.c : 3081 ] NEW_STATS: qnull set +2950,iiiii,[ sched_algo.c : 11018 ] AGGR_DBG: user %d: assigned: %d, rate_kbps: %d, qdepth: %d, target_mpdu: %d + +2949,Iii,[ sched_algo.c : 3776 ] smart_basic_trig : last_sched_tsmp=%lu aid=%d, tid_num=%d + +3002,ii,[ sched_algo_rr.c : 290 ] twt_dbg: sched_algo_run_rr_scheduler_tidq0 skip tid tid:%d elgble: %d +3019,iiiiiii,[ sched_algo_qos.c : 2707 ] Duration based tx_mode %d, total_psdu_time %d, avg_su_psdu_dur %d, adj_avg_psdu_dur %d, txop_duration %d, max_avg_psdu_dur %d, total_psdu %d + +3018,iiiii,[ sched_algo_qos.c : 2719 ] Duration based num_txop %d, over_head %d, avg_chan_acc_lat_us %d, gain %d, total_latency %d + +3017,iiiii,[ sched_algo_qos.c : 2765 ] Duration based selected tx mode %d => tx latency %d : Max users %d candidate_list->num_entries %d chan_access_let %d + +3016,iiiiii,[ sched_algo_qos.c : 157 ] OFDMA_SCHED_DECISION: aid: %d, cur_time_ms: %d, use_ul_su_phy_rate: %d, avg_ul_su_phy_rate: %d, rix: %d, phy_rate_kbps: %d +3015,iiii,[ sched_algo_qos.c : 160 ] OFDMA_SCHED_DECISION: aid: %d, cur_time_ms: %d, ul_su_update_time: %d, ul_ofdma_trig_time: %d +3014,iiii,[ sched_algo_qos.c : 200 ] OFDMA_SCHED_DECISION: aid: %d, psd_boost_ref_phy_rate: %d, ul_max_nss: %d, ul_max_bw: %d +3013,iIiii,[ sched_algo_qos.c : 2214 ] ul_dbg_populate_bsr_CTL: tid_num=%d, tidq=0x%x, sch_inp_lsb=%d, last_bsr_lsb=%d, trigger_timeout_ms=%d +3012,ii,[ sched_algo_qos.c : 2228 ] UL_MUMIMO_DBG: select UL MU-MIMO candidate list. num_frms %d, txtime_us %d +3011,i,[ sched_algo_qos.c : 239 ] OFDMA_SCHED_DECISION: num_entries: %d +3010,iiiiI,[ sched_algo_qos.c : 273 ] OFDMA_SCHED_DECISION: aid: %d, avg_txtime_us: %d, avg_ul_qdepth_bytes: %d, txtime_us: %d, qdepth_bytes: %lu +3009,iii,[ sched_algo_qos.c : 290 ] OFDMA_SCHED_DECISION: num_entries: %d, lowq_users: %d, highq_low_mcs_users: %d +3008,IIIIII,[ sched_algo_qos.c : 2888 ] twt_dbg: check_eligibility:curr_time_us=%u, txqid=%u, peer_id=%u, tid_num=%u, is_skip_tid=%u, sched_eligible=%u +3007,ii,[ sched_algo_qos.c : 3027 ] Candidate list: Num entries = %d, TX_MODE = %d +3006,iiiiii,[ sched_algo_qos.c : 980 ] FORCE_SU_UL_TRIG: peer aid: %d, force_single_user_ul_ofdma: %d, cur_peer_requires_su_trigger: %d, force_2users_in_160_trigger %d, primary peer aid: %d, cur_time: %d +3005,i,[ sched_algo_qos.c : 1323 ] twt_dbg: twt_sched_algo_qos returned (CL empty): txqid=%d +3004,Ii,[ sched_algo_qos.c : 4043 ] ul_dbg_tid_unregister_qos: qpeer=0x%x, tid_num=%d +3003,iii,[ sched_algo_qos.c : 217 ] OFDMA_SCHED_DECISION: aid: %d, psd_boost_phy_rate_max: %d, phy_rate_estimate %d +3025,iiiiii,[ sched_algo_mu.c : 1555 ] UL_MUMIMO_DBG quit DL delaying for timeout, start_delay_time %d, delay_dur %d, cur_time %d, cur_cnt %d, max_cnt %d, target_cnt %d +3024,iiiiii,[ sched_algo_mu.c : 1609 ] UL_MUMIMO_DBG quit DL delaying not allowed, start_delay_time %d, delay_dur %d, cur_time %d, cur_cnt %d, max_cnt %d, target_cnt %d +3023,ii,[ sched_algo_mu.c : 1623 ] UL_MUMIMO_DBG start DL delaying,cur_cnt %d, max_cnt %d +3022,iiiiii,[ sched_algo_mu.c : 1580 ] UL_MUMIMO_DBG quit DL delaying enough users, start_delay_time %d, delay_dur %d, cur_time %d, cur_cnt %d, max_cnt %d, target_cnt %d +3021,iiiiii,[ sched_algo_mu.c : 1597 ] UL_MUMIMO_DBG keep on DL delaying, start_delay_time %d, delay_dur %d, cur_time %d, cur_cnt %d, max_cnt %d, target_cnt %d +3020,II,[ sched_algo_mu.c : 1855 ] mu_sort: sw peer id =%u, qdepth =%u +3037,iii,[ ru_allocator.c : 4663 ] RU Power imbalance Adjust: pre mcs %d, per_tone_pwr %d, interference_from_pre %d +3036,iii,[ ru_allocator.c : 4681 ] RU Power imbalance Adjust: next mcs %d, per_tone_pwr %d, interference_from_next %d +3035,iiiii,[ ru_allocator.c : 4713 ] RU Power imbalance Adjust: mcs %d, per_tone_pwr %d, interference_from_neigbor %d, margin %d, num_notches %d +3034,iii,[ ru_allocator.c : 4718 ] RU Power imbalance Adjust: pre mcs %d, per_tone_pwr %d, interference_from_pre %d +3033,ii,[ ru_allocator.c : 182 ] Dropping Static RU Unit Test Cmd - Num Args %d : Max Users: %d +3032,iii,[ ru_allocator.c : 243 ] RU idx exceeds max idx - ru_idx: %d : ru_size: %d : tx_bw: %d +3031,iii,[ ru_allocator.c : 249 ] Incorrect Static RU allocation - ru_idx: %d : ru_size: %d : tx_bw: %d +3030,iIIii,[ ru_allocator.c : 6188 ] RU_ALLOC DBG: id: %d, ru_input: flags: 0x%08x, tx_bw_mask 0x%08x, ppdu_time: %d, input user count: %d +3029,iiiiIiii,[ ru_allocator.c : 6208 ] RU_ALLOC DBG: id: %d, aid: %d, max_bw: %d, rix: %d, queue_depth: %u, qos_weight: %d, consec_no_mpdu_tried: %d, consec_skip_cnt: %d +3028,iiiIiii,[ ru_allocator.c : 6232 ] RU_ALLOC DBG: id: %d, ru_result: ret_val: %d, num_users: %d, tx_bw_mask 0x%08x, data_ppdu_dur[0]: %d, data_ppdu_dur[1]: %d, data_ppdu_dur[2]: %d +3027,iiii,[ ru_allocator.c : 6244 ] RU_ALLOC DBG: id: %d, ru_result: ul_ba_ppdu_duration_us[0]: %d, ul_ba_ppdu_duration_us[1]: %d, ul_ba_ppdu_duration_us[2]: %d +3026,ii,[ ru_allocator.c : 6252 ] RU_ALLOC DBG: id: %d, DROPPED_USER: aid: %d +3211,iiiiiiiii,[ sched_algo_dbg.c : 6513 ] AMSDU_DEBUG_CALC: rix=%d preamble=%d nss=%d mcs=%d gi=%d amsdu_64=%d amsdu_128=%d bw=%d rate_kbps=%d + +3210,iiiiiiiii,[ sched_algo_dbg.c : 6525 ] AMSDU_DEBUG_TBL: rix=%d preamble=%d nss=%d mcs=%d gi=%d amsdu_64=%d amsdu_128=%d bw=%d rate_kbps=%d + +3209,ii,[ sched_algo_dbg.c : 210 ] STANDALONE : TICKLE SCHEDULER %d thread id %d +3208,,[ sched_algo_dbg.c : 421 ] ATF stats + +3207,ii,[ sched_algo_dbg.c : 1462 ] ULMU_PRINT, ul_bsr_cnt %d, total_cnt %d +3206,iiiiiiii,[ sched_algo_dbg.c : 1474 ] ULMU_PRINT, dl_cnt[0-3] %d, %d, %d, %d ul_cnt[0-3] %d, %d, %d, %d +3205,iiiiiiii,[ sched_algo_dbg.c : 1485 ] ULMU_PRINT, dl_cnt[4-7] %d, %d, %d, %d ul_cnt[4-7] %d, %d, %d, %d +3204,iiiiii,[ sched_algo_dbg.c : 1541 ] ULMU_PRINT, mpdu_ok_per_AID, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d +3203,iiiiii,[ sched_algo_dbg.c : 1552 ] ULMU_PRINT, mpdu_fail_per_AID, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d +3202,,[ sched_algo_dbg.c : 454 ] bss +3201,iiiiiiii,[ sched_algo_dbg.c : 1942 ] mu_mimo_grp_stats:mu_grp_best_grp_size -> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3200,iiii,[ sched_algo_dbg.c : 1968 ] mu_mimo_grp_stats:mu_grp_best_num_users -> (%d, %d, %d, %d) + +3199,iiiii,[ sched_algo_dbg.c : 1979 ] mu_mimo_grp_stats:mu_mimo_tputs_observed (0-1500Mbps)> (%d, %d, %d, %d, %d ) + +3198,iiiii,[ sched_algo_dbg.c : 1990 ] mu_mimo_grp_stats:mu_mimo_tputs_observed (1500-3000Mbps) (%d, %d, %d, %d, %d) + +3197,iiiiiiiii,[ sched_algo_dbg.c : 2004 ] mu_mimo_grp_stats:num_mu_mimo_candidate(0-8 users)-> ( %d, %d, %d, %d, %d, %d, %d, %d, %d ) + +3196,iiiiiiii,[ sched_algo_dbg.c : 2017 ] mu_mimo_grp_stats:num_mu_mimo_candidate(9-16 users)-> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3195,iiiiiiii,[ sched_algo_dbg.c : 2030 ] mu_mimo_grp_stats:num_mu_mimo_candidate_nr4 -> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3194,iiiiiiii,[ sched_algo_dbg.c : 2043 ] mu_mimo_grp_stats:num_mu_mimo_candidate_nr8 -> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3193,iiiii,[ sched_algo_dbg.c : 2053 ] mu_mimo_grp_stats:sched_type -> (%d, %d, %d, %d, %d ) + +3192,i,[ sched_algo_dbg.c : 2056 ] mu_mimo_grp_stats:Group_id: %d +3191,,[ sched_algo_dbg.c : 456 ] self +3190,iiii,[ sched_algo_dbg.c : 2082 ] mu_mimo_grp_stats:cd_num_entries -> (%d, %d, %d, %d ) + +3189,iiiii,[ sched_algo_dbg.c : 2094 ] mu_mimo_grp_stats:tputs for this group id (0 - 1500 Mbps)-> (%d, %d, %d, %d, %d) +3188,iiiii,[ sched_algo_dbg.c : 2104 ] mu_mimo_grp_stats:tputs for this group id(1500-3000 Mbps) -> (%d, %d, %d, %d, %d) +3187,,[ sched_algo_dbg.c : 2107 ] mu_mimo_grp_stats:candidate_rc_mode -> + +3186,iiiii,[ sched_algo_dbg.c : 2137 ] mu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d) + +3185,,[ sched_algo_dbg.c : 2143 ] mu_mimo_grp_stats:candidate_best_nss -> + +3184,iiiii,[ sched_algo_dbg.c : 2173 ] mu_mimo_grp_stats:user %d -> (%d, %d, %d, %d) +3183,,[ sched_algo_dbg.c : 2179 ] mu_mimo_grp_stats:candidate_sched_type -> + +3182,iiiiii,[ sched_algo_dbg.c : 2196 ] mu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d, %d) +3181,,[ sched_algo_dbg.c : 2200 ] mu_mimo_grp_stats:candidate_sched_compatibility -> + +3180,iIIIIii,[ sched_algo_dbg.c : 467 ] peer %d, mac %x %x, tx resource consumption %u, rx resource consumption %u, atf units: expected %d actual %d + +3179,iiiiiiiii,[ sched_algo_dbg.c : 2223 ] mu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d, %d, %d, %d, %d) +3178,,[ sched_algo_dbg.c : 2227 ] mu_mimo_grp_stats:candidate_nr_index -> + +3177,iiiiiiiii,[ sched_algo_dbg.c : 2242 ] mu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d, %d, %d, %d, %d) +3176,iiii,[ sched_algo_dbg.c : 2270 ] mu_mimo_grp_stats:cd_num_eligible -> (%d, %d, %d, %d ) + +3175,,[ sched_algo_dbg.c : 2274 ] mu_mimo_grp_stats:mu_group_eligible_skip -> + +3174,iiiiiiiii,[ sched_algo_dbg.c : 2297 ] mu_mimo_grp_stats:user %d ->( %d, %d, %d, %d, %d, %d, %d, %d) +3173,iiiiiiiii,[ sched_algo_dbg.c : 2314 ] mu_mimo_grp_stats: mu_grp_invalid -> (%d, %d, %d, %d, %d, %d, %d, %d %d ) + +3172,i,[ sched_algo_dbg.c : 2320 ] mu_mimo_grp_stats:mu_grp_ineligible -> %d + +3171,i,[ sched_algo_dbg.c : 2326 ] mu_mimo_grp_stats:mu_grp_eligible -> %d + +3170,i,[ sched_algo_dbg.c : 2568 ] SCHED_RU_ALLOC_DBG: g_sched_algo_cfg.dbg.cnt.dl_mode_allocation_failed: %d +3169,,[ sched_algo_dbg.c : 485 ] Resetting ATF stats + +3168,i,[ sched_algo_dbg.c : 2572 ] SCHED_RU_ALLOC_DBG: g_sched_algo_cfg.dbg.cnt.ul_mode_allocation_failed: %d +3167,ii,[ sched_algo_dbg.c : 2581 ] SCHED_RU_ALLOC_DBG: g_sched_algo_cfg.dbg.cnt.sched_mode_disabled[%d]: %d +3166,i,[ sched_algo_dbg.c : 2588 ] SCHED_RU_ALLOC_DBG: g_dbg_ul_ofdma_160mhz_ru_war.peers_ineligible: %d +3165,i,[ sched_algo_dbg.c : 2592 ] SCHED_RU_ALLOC_DBG: g_dbg_ul_ofdma_160mhz_ru_war.peers_ineligible_ul_ofdma: %d +3164,i,[ sched_algo_dbg.c : 2596 ] SCHED_RU_ALLOC_DBG: g_dbg_ul_ofdma_160mhz_ru_war.peers_eligible_ul_ofdma: %d +3163,i,[ sched_algo_dbg.c : 2860 ] pdev %d not initialized + +3162,ii,[ sched_algo_dbg.c : 2864 ] pdev %d rx_ps_fifo_drop %d + +3161,iiii,[ sched_algo_dbg.c : 3045 ] ULMU_PRINT, FDRSSI_per_usr_nss_bin, %d, %d, %d: %d +3160,iiiiii,[ sched_algo_dbg.c : 3146 ] ULMU_PRINT, mcs_0_5_per_AID, 1, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3159,iiiiii,[ sched_algo_dbg.c : 3156 ] ULMU_PRINT, mcs_6_11_per_AID, 1, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3158,iiiii,[ sched_algo_dbg.c : 533 ] SCHED_LOGS: Num active tids in txq %d %d, %d, %d, %d + +3157,iiiiii,[ sched_algo_dbg.c : 3166 ] ULMU_PRINT, mcs_0_5_per_AID, 2, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3156,iiiiii,[ sched_algo_dbg.c : 3176 ] ULMU_PRINT, mcs_6_11_per_AID, 2, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3155,iiiiii,[ sched_algo_dbg.c : 3186 ] ULMU_PRINT, mcs_0_5_per_AID, 3, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3154,iiiiii,[ sched_algo_dbg.c : 3196 ] ULMU_PRINT, mcs_6_11_per_AID, 3, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3153,iiiiii,[ sched_algo_dbg.c : 3206 ] ULMU_PRINT, mcs_0_5_per_AID, 4, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3152,iiiiii,[ sched_algo_dbg.c : 3216 ] ULMU_PRINT, mcs_6_11_per_AID, 4, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3151,iiiiii,[ sched_algo_dbg.c : 3226 ] ULMU_PRINT, mcs_0_5_per_AID, 5, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3150,iiiiii,[ sched_algo_dbg.c : 3236 ] ULMU_PRINT, mcs_6_11_per_AID, 5, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3149,iiiiii,[ sched_algo_dbg.c : 3246 ] ULMU_PRINT, mcs_0_5_per_AID, 6, 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d +3148,iiiiii,[ sched_algo_dbg.c : 3256 ] ULMU_PRINT, mcs_6_11_per_AID, 6, 6:%d, 7:%d, 8:%d, 9:%d, 10:%d, 11:%d +3147,ii,[ sched_algo_dbg.c : 537 ] SCHED_LOGS: Registered tids in txq %d list %d + +3146,iiii,[ sched_algo_dbg.c : 3280 ] ULMU_PRINT, FDRSSI_per_AID_nss_bin, %d, %d, %d: %d +3145,iii,[ sched_algo_dbg.c : 3306 ] ULMU_PRINT, Target_RSSI_per_AID_bin, %d, %d: %d +3144,iiiiiii,[ sched_algo_dbg.c : 3660 ] ATM: group_id %d, group_units %d, flags %d, wmm_be_units %d, wmm_bk_units %d, wmm_vo_units %d, wmm_vi_units %d +3143,iiii,[ sched_algo_dbg.c : 3666 ] ATM: ERR_STATS Ivalid grp_id %d, Invalid group %d, Invalid group units %d, Invalid peer %d +3142,iiii,[ sched_algo_dbg.c : 3673 ] ATM: Eligibility counters 0: %d, 1: %d, 2: %d, 3: %d +3141,iii,[ sched_algo_dbg.c : 3714 ] STANDALONE INVALID SW PEER ID cmd num %d pdev id %d sw peer id %d +3140,iii,[ sched_algo_dbg.c : 3717 ] STANDALONE cmd num %d pdev id %d sw peer id %d +3139,I,[ sched_algo_dbg.c : 3780 ] effective_tput_gain_factor: %u. +3138,IIIII,[ sched_algo_dbg.c : 3845 ] UL_SCHED_DEC_STATS: ac: %u, count: %u, latency_sensitive: %u, psd_boost: %u, collision_reduction: %u +3137,II,[ sched_algo_dbg.c : 3875 ] PARTIAL_SND_STATS: : MU2 1:%u 2:%u +3136,i,[ sched_algo_dbg.c : 541 ] SCHED_LOGS: peer id %d + +3135,III,[ sched_algo_dbg.c : 3880 ] PARTIAL_SND_STATS: : MU3 1:%u 2:%u 3:%u +3134,IIII,[ sched_algo_dbg.c : 3886 ] PARTIAL_SND_STATS: : MU4 1:%u 2:%u 3:%u 4:%u +3133,II,[ sched_algo_dbg.c : 4016 ] dl_mu_mimo_my_cv_sync g_dbg_mu_cv_sync_counter: %u, g_dbg_mu_cv_sync_counter_invalid_idx: %u. +3132,iiiiii,[ sched_algo_dbg.c : 4160 ] SCHED_CMD_DBG: AVG Tx: %d, AVG legacy Rx %d, AVG HE Rx: %d rx < tx | rx < ax_rx: %d, rx > tx -> 1. With pending sched cmds %d 2. No sched cmd %d +3131,,[ sched_algo_dbg.c : 4192 ] SU_STATS_DBG: usage: wifitool athX setUnitTestCmd 0x47 3 258 < 0 / 1 > +3130,,[ sched_algo_dbg.c : 4216 ] SU_STATS_DBG: ---Cleared all SU Multi Destination and SU Only stats--- +3129,iiii,[ sched_algo_dbg.c : 4222 ] SU_STATS_DBG: num_su_multi_dest_scheduled: BK: %d | BE = %d | VI = %d | VO = %d +3128,iiii,[ sched_algo_dbg.c : 4228 ] SU_STATS_DBG: num_su_only_scheduled: BK: %d | BE = %d | VI = %d | VO = %d +3127,i,[ sched_algo_dbg.c : 4290 ] STANDALONE INVALID SW PEER ID %d +3126,,[ sched_algo_dbg.c : 4296 ] STANDALONE SEND MSG SUCCESSFUL +3125,iii,[ sched_algo_dbg.c : 428 ] atf pdev %d tx resource consumption %d, rx resource consumption %d + +3124,iii,[ sched_algo_dbg.c : 547 ] SCHED_LOGS: Pdev id %d, txq %d, last sched order idx %d + +3123,,[ sched_algo_dbg.c : 4298 ] STANDALONE SEND MSG FAILED +3122,iiii,[ sched_algo_dbg.c : 4320 ] AC_DBG: Requests BE: %d, BK: %d, VI: %d, VO: %d +3121,iiii,[ sched_algo_dbg.c : 4321 ] AC_DBG: Counters Data Txq : %d, Other Txq: %d, i/p max_sched_cmd < pending sched_cmds: %d, default %d +3120,I,[ sched_algo_dbg.c : 4430 ] CV_UPLOAD cv_fcs_err : %u +3119,I,[ sched_algo_dbg.c : 4433 ] CV_UPLOAD cv_frag_idx_mimatch : %u +3118,I,[ sched_algo_dbg.c : 4436 ] CV_UPLOAD cv_invalid_peer_id : %u +3117,I,[ sched_algo_dbg.c : 4439 ] CV_UPLOAD cv_dma_not_done_err : %u +3116,I,[ sched_algo_dbg.c : 4442 ] CV_UPLOAD cv_dma_timeout_err : %u +3115,I,[ sched_algo_dbg.c : 4445 ] CV_UPLOAD cv_nc_idx_mismatch : %u +3114,I,[ sched_algo_dbg.c : 4448 ] CV_UPLOAD cv_expiry_in_update : %u +3113,iiiii,[ sched_algo_dbg.c : 556 ] SCHED_LOGS: last scheduled peer ids %d, %d, %d, %d, %d +3112,I,[ sched_algo_dbg.c : 4451 ] CV_UPLOAD cv_update_failed : %u +3111,I,[ sched_algo_dbg.c : 4454 ] CV_UPLOAD cv_pkt_bw_exceed : %u +3110,I,[ sched_algo_dbg.c : 4505 ] DYN_MIMO_PS num_seq_posted: %u +3109,II,[ sched_algo_dbg.c : 4510 ] DYN_MIMO_PS num_dyn_mimo_ps_users [%u]: %u +3108,II,[ sched_algo_dbg.c : 4516 ] DYN_MIMO_PS num_users_posted [%u]: %u +3107,II,[ sched_algo_dbg.c : 4575 ] ULMU_PRINT: Num Triggers %u: %u +3106,II,[ sched_algo_dbg.c : 4578 ] ULMU_PRINT: Total Txop %u: %u +3105,iiiiiiii,[ sched_algo_dbg.c : 4683 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_grp_best_grp_size -> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3104,iiii,[ sched_algo_dbg.c : 4709 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_grp_best_num_users -> (%d, %d, %d, %d ) + +3103,iiiii,[ sched_algo_dbg.c : 4720 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_mimo_tputs_observed (0-1500Mbps)> (%d, %d, %d, %d, %d ) + +3102,iiiii,[ sched_algo_dbg.c : 1053 ] ac_mu_mimo : Num_users %d Per user txtime user%d_bin_%d - %d : %d +3101,iiiii,[ sched_algo_dbg.c : 4730 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_mimo_tputs_observed (1500-3000Mbps) (%d, %d, %d, %d, %d) + +3100,iiiiiiiii,[ sched_algo_dbg.c : 4744 ] ULMU_PRINT : ulmu_mimo_grp_stats:num_mu_mimo_candidate(0-8 users)-> ( %d, %d, %d, %d, %d, %d, %d, %d, %d ) + +3099,iiiiiiii,[ sched_algo_dbg.c : 4756 ] ULMU_PRINT: ulmu_mimo_grp_stats:num_mu_mimo_candidate(9-16 users)-> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3098,i,[ sched_algo_dbg.c : 4759 ] ULMU_PRINT: ulmu_mimo_grp_stats:Group_id: %d +3097,iiii,[ sched_algo_dbg.c : 4785 ] ULMU_PRINT: ulmu_mimo_grp_stats:cd_num_entries -> (%d, %d, %d, %d ) + +3096,iiiii,[ sched_algo_dbg.c : 4797 ] ULMU_PRINT: ulmu_mimo_grp_stats:tputs for this group id (0 - 1500 Mbps)-> (%d, %d, %d, %d, %d) +3095,iiiii,[ sched_algo_dbg.c : 4807 ] ULMU_PRINT: ulmu_mimo_grp_stats:tputs for this group id(1500-3000 Mbps) -> (%d, %d, %d, %d, %d) +3094,,[ sched_algo_dbg.c : 4810 ] ULMU_PRINT: ulmu_mimo_grp_stats:candidate_rc_mode -> + +3093,iiiii,[ sched_algo_dbg.c : 4840 ] ULMU_PRINT: ulmu_mimo_grp_stats:user %d -> (%d, %d, %d ,%d) + +3092,,[ sched_algo_dbg.c : 4846 ] ULMU_PRINT: ulmu_mimo_grp_stats:candidate_best_nss -> + +3091,ii,[ sched_algo_dbg.c : 1063 ] ac_mu_mimo : Num schedules with num_users as %d : %d +3090,iiiiiiiii,[ sched_algo_dbg.c : 4876 ] ULMU_PRINT: ulmu_mimo_grp_stats:user %d -> (%d, %d, %d, %d, %d, %d, %d, %d) +3089,,[ sched_algo_dbg.c : 4881 ] ULMU_PRINT: ulmu_mimo_grp_stats:candidate_sched_compatibility -> + +3088,iiiiiiiii,[ sched_algo_dbg.c : 4904 ] ULMU_PRINT: ulmu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d, %d, %d, %d, %d) +3087,,[ sched_algo_dbg.c : 4908 ] ULMU_PRINT: ulmu_mimo_grp_stats:candidate_nr_index -> + +3086,iiiiiiiii,[ sched_algo_dbg.c : 4923 ] ULMU_PRINT: ulmu_mimo_grp_stats:user %d -> ( %d, %d, %d, %d, %d, %d, %d, %d) +3085,iiii,[ sched_algo_dbg.c : 4952 ] ULMU_PRINT: ulmu_mimo_grp_stats:cd_num_eligible -> (%d, %d, %d, %d ) + +3084,,[ sched_algo_dbg.c : 4956 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_group_eligible_skip -> + +3083,iiiiiiiii,[ sched_algo_dbg.c : 4979 ] ULMU_PRINT: ulmu_mimo_grp_stats:user %d ->( %d, %d, %d, %d, %d, %d, %d, %d) +3082,iiiiiiii,[ sched_algo_dbg.c : 4994 ] ULMU_PRINT: ulmu_mimo_grp_stats: mu_grp_invalid -> (%d, %d, %d, %d, %d, %d, %d, %d ) + +3081,i,[ sched_algo_dbg.c : 5000 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_grp_ineligible -> %d + +3080,iiiii,[ sched_algo_dbg.c : 1117 ] SCHED_LOGS: Peer AID %d: num_schedules = %d, ppdus_queued = %d, mpdus_enqueued = %d, mpdus_failed = %d + +3079,i,[ sched_algo_dbg.c : 5006 ] ULMU_PRINT: ulmu_mimo_grp_stats:mu_grp_eligible -> %d + +3078,II,[ sched_algo_dbg.c : 5143 ] DYN_MIMO_PS sw_peer_id: %u, dyn_mimo_ps_enabled: %u. +3077,,[ sched_algo_dbg.c : 5238 ] punc stats + +3076,i,[ sched_algo_dbg.c : 5241 ] punc vdev %d + +3075,,[ sched_algo_dbg.c : 5254 ] punc bss +3074,,[ sched_algo_dbg.c : 5256 ] punc self +3073,iIIII,[ sched_algo_dbg.c : 5266 ] peer %d, mac %x %x, punc capability %x, host config %x + +3072,i,[ sched_algo_dbg.c : 5286 ] punc case 242 %d + +3071,i,[ sched_algo_dbg.c : 5287 ] punc empty case 242 %d + +3070,i,[ sched_algo_dbg.c : 5288 ] punc case 484 0 %d + +3069,I,[ sched_algo_dbg.c : 1171 ] SCHED_LOGS: Tx_SCHEDULE_CMD Tx mode = %u + +3068,i,[ sched_algo_dbg.c : 5289 ] punc case 484 1 %d + +3067,i,[ sched_algo_dbg.c : 5290 ] punc case 996 0 %d + +3066,i,[ sched_algo_dbg.c : 5291 ] punc case 996 1 %d + +3065,i,[ sched_algo_dbg.c : 5292 ] punc patt 1 %d + +3064,i,[ sched_algo_dbg.c : 5293 ] punc patt 2 %d + +3063,i,[ sched_algo_dbg.c : 5294 ] punc patt 3 %d + +3062,i,[ sched_algo_dbg.c : 5295 ] punc patt 4 %d + +3061,i,[ sched_algo_dbg.c : 5296 ] punc patt %d + +3060,i,[ sched_algo_dbg.c : 5297 ] punc legal_ru dl %d + +3059,i,[ sched_algo_dbg.c : 5298 ] punc legal_ru ul %d + +3058,IIiI,[ sched_algo_dbg.c : 1180 ] SCHED_LOGS: peer_aid = %u, weight = %u, OFDMA_status = %d, ru_width = %u + +3057,i,[ sched_algo_dbg.c : 5299 ] punc TLVs %d + +3056,i,[ sched_algo_dbg.c : 5300 ] punc BW 20 %d + +3055,i,[ sched_algo_dbg.c : 5301 ] punc BW 40 %d + +3054,i,[ sched_algo_dbg.c : 5302 ] punc BW 80 %d + +3053,i,[ sched_algo_dbg.c : 5303 ] punc BW 160 %d + +3052,i,[ sched_algo_dbg.c : 5306 ] punc ru242_idx %d + +3051,I,[ sched_algo_dbg.c : 5406 ] twt_dbg: g_dbg_disable_triggers_from_wmm_txq = %u +3050,I,[ sched_algo_dbg.c : 5470 ] dbg: g_dbg_disable_timeout_based_bsr_trigger = %u +3049,i,[ sched_algo_dbg.c : 5521 ] MBO txmode current AC : %d + +3048,ii,[ sched_algo_dbg.c : 5523 ] MBO txmode %d : %d + +3047,,[ sched_algo_dbg.c : 1185 ] SCHED_LOGS: PPDU_COMPLETION + +3046,I,[ sched_algo_dbg.c : 5548 ] Updated Idle condition trigger count as value = %u +3045,IIIIII,[ sched_algo_dbg.c : 1194 ] SCHED_LOGS: peer_aid = %u, ru_width = %u, rtxop = %u, ppdu_duration = %u, nss_usr = %u, BW = %u + +3044,II,[ sched_algo_dbg.c : 1201 ] SCHED_LOGS: Last populated index TxScheduleCmd = %u, PPDUCompletion = %u + +3043,i,[ sched_algo_dbg.c : 431 ] atf vdev %d + +3042,iiiiiiii,[ sched_algo_dbg.c : 1393 ] ULMU_PRINT, Avg_FDRSSI NSS:0 - 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d, 7:%d +3041,iiiiiiii,[ sched_algo_dbg.c : 1401 ] ULMU_PRINT, Avg_FDRSSI NSS:1 - 0:%d, 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d, 7:%d +3040,iiiiiiii,[ sched_algo_dbg.c : 1425 ] ULMU_PRINT, Avg_FDRSSI_AID NSS:0 - 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d, 7:%d, 8:%d +3039,iiiiiiii,[ sched_algo_dbg.c : 1432 ] ULMU_PRINT, Avg_FDRSSI_AID NSS:1 - 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d, 7:%d, 8:%d +3038,iiiiiiii,[ sched_algo_dbg.c : 1456 ] ULMU_PRINT, Avg_Target_RSSI AID - 1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d, 7:%d, 8:%d +3223,IIIII,[ sched_algo_twt.c : 230 ] twt_dbg: twt_construct_cl_super_cycle:peer_id=%u, START_TSF msb=%u, lsb=%u, peer_end_tsf msb=%u, lsb=%u +3222,I,[ sched_algo_twt.c : 239 ] twt_dbg: twt_construct_cl_super_cycle peer_id=%u +3221,IIIIIIII,[ sched_algo_twt.c : 949 ] twt_dbg_eosp: check_eosp_eligibility:tid_num=%u, inactivity_time_us=%u, last_activity_ts=%u, frms_swq=%u, frms_hwq=%u, is_eosp_eligible=%u,elapsed_time=%u, remaining_time=%u + +3220,II,[ sched_algo_twt.c : 638 ] twt_dbg: twt_peer_register peer_id=%u, twt_peer_count=%u +3219,II,[ sched_algo_twt.c : 642 ] twt_dbg: twt_peer_register g_dbg_disable_triggers_from_wmm_txq = %u; peer->is_wmm_txq_ul_trig_disabled = %u +3218,III,[ sched_algo_twt.c : 687 ] twt_dbg: twt_peer_unregister peer_id=%u, twt_peer_count=%u, peer_twt_state=0x%x +3217,IIiII,[ sched_algo_twt.c : 56 ] twt_dbg: twt_scheduler_timer1: tsf_now_msb=%u, lsb=%u, curr_slot_idx=%d, curr_slot_start msb=%u, lsb=%u +3216,iiII,[ sched_algo_twt.c : 63 ] twt_dbg: twt_scheduler_timer1: 5ghz=%d, next_slot_idx=%d, next_slot_start msb=%u, lsb=%u +3215,IIIi,[ sched_algo_twt.c : 98 ] twt_dbg: twt_scheduler_timer:peer_id=%u, peer_end_tsf msb=%u, lsb=%u, twt_qid=%d +3214,Iii,[ sched_algo_twt.c : 530 ] twt_dbg: sched_algo_twt_sp_info_update peer_id=%u, is_announced=%d, is_ul_received=%d +3213,I,[ sched_algo_twt.c : 557 ] twt_dbg: sched_algo_twt_sp_info_update_triggered_super_cycle peer_id=%u +3212,IIIII,[ sched_algo_twt.c : 479 ] twt_dbg: twt_update_start_end_time peer_id=%u, start_time=%u, end_time=%u, flags=0x%x, valid=%u +3225,IiIiii,[ sched_algo_ul_mumimo.c : 1022 ] UL_MUMIMO_DBG allocate1: peer=0x%x, tid_num=%d, tx_bw_mask=0x%x, ru_start_20=%d, ru_end_20=%d, stream_offset_20=%d +3224,iiiiii,[ sched_algo_ul_mumimo.c : 1033 ] UL_MUMIMO_DBG allocate2: ru_start_40=%d, ru_end_40=%d, ru_start_80=%d, ru_end_80=%d, stream_offset_40=%d, stream_offset_80=%d +3229,i,[ sched_algo_ulmu_grouping.c : 905 ] UL_MUMIMO_DBG: truncate UL MU-MIMO candidate list. num_entries %d +3228,i,[ sched_algo_ulmu_grouping.c : 941 ] UL_MUMIMO_DBG: max_mu_grp_sz: %d +3227,iii,[ sched_algo_ulmu_grouping.c : 493 ] UL_MUMIMO_DBG: sched_algo_construct_ulmu_candidate_table. group size %d, max_intf_nss %d, rc_mode_max %d +3226,i,[ sched_algo_ulmu_grouping.c : 586 ] UL_MUMIMO_DBG: sched_algo_construct_ulmu_candidate_table. number of entries added %d +3234,iiiii,[ sched_algo_qos_result.c : 719 ] ofdma_user_cap: tx_mode: %d, num_users: %d, sta_count_having_short_payload: %d, ul_sta_count_having_low_mcs: %d, truncate_candidate_list: %d +3233,IiIii,[ sched_algo_qos_result.c : 1109 ] ul_dbg_passed_ru_alloc: peer=0x%x, tid_num=%d, tx_bw_mask=0x%x, ru_start_20=%d, ru_end_20=%d +3232,iiii,[ sched_algo_qos_result.c : 1118 ] ul_dbg_passed_ru_alloc_2: ru_start_40=%d, ru_end_40=%d, ru_start_80=%d, ru_end_80=%d +3231,ii,[ sched_algo_qos_result.c : 1388 ] Per user txtime user%d : %d +3230,i,[ sched_algo_qos_result.c : 1314 ] ul_ppdu_count %d + +3245,IIIIIIIII,[ sched_algo_txbf.c : 830 ] SW Peer ID: %x cbf_mimo_ctrl VHT_HE: %x, NR: %x, NC: %x, FB: %x, BW: %x, NG: %x, CB: %x, BUF_IDX: %u. +3244,IIII,[ sched_algo_txbf.c : 851 ] cbf_mimo_ctrl NC index mismatch. SW_PEER_ID: %u, PEER_NC: %u, CV_NC: %u, Total Mismatch: %u. +3243,IIII,[ sched_algo_txbf.c : 1843 ] tone out of index: is_he:%x,cbf_bw:%x,pkt_bw:%x, ng:%x +3242,IIII,[ sched_algo_txbf.c : 1852 ] tone out of index: is_he:%x,cbf_bw:%x,pkt_bw:%x, ng:%x +3241,IIII,[ sched_algo_txbf.c : 1887 ] tone out of index: is_he:%x,cbf_bw:%x,pkt_bw:%x, ng:%x +3240,IIII,[ sched_algo_txbf.c : 1896 ] tone out of index: is_he:%x,cbf_bw:%x,pkt_bw:%x, ng:%x +3239,II,[ sched_algo_txbf.c : 1559 ] cbf nss mis-match cv_flags=%x cv_Nc=%x + +3238,II,[ sched_algo_txbf.c : 1585 ] OFDMA cbf bw mis-match cv_flags=%x cv_bw=%x + +3237,II,[ sched_algo_txbf.c : 1601 ] cbf bw mis-match cv_flags=%x cv_bw=%x + +3236,II,[ sched_algo_txbf.c : 1610 ] cbf nr mis-match cv_flags=%x cv_Nr=%x + +3235,Ii,[ sched_algo_txbf.c : 3493 ] cv_upload_dma invalid SW peer ID cv_buf->sw_peer_id 0x%x pdev_id %d +3259,i,[ sched_algo_txbf_ofdma.c : 560 ] ru_to_start_and_end_tone (bw > BW_CNT) bw = %d +3258,ii,[ sched_algo_txbf_ofdma.c : 565 ] ru_to_start_and_end_tone invalid ru_end (ru_end > MAX_RU_PER_BW[%d]) ru_end =%d +3257,ii,[ sched_algo_txbf_ofdma.c : 570 ] ru_to_start_and_end_tone invalid ru_start (ru_start > MAX_RU_PER_BW[%d]) ru_start =%d +3256,ii,[ sched_algo_txbf_ofdma.c : 576 ] ru_to_start_and_end_tone invalid ru_start/ru_end (ru_end < ru_start) ru_start = %d, ru_end = %d +3255,i,[ sched_algo_txbf_ofdma.c : 581 ] ru_to_start_and_end_tone invalid (NG > WAL_TXBF_HE_NG_MAX) ng = %d +3254,,[ sched_algo_txbf_ofdma.c : 586 ] ru_to_start_and_end_tone start_tone is NULL +3253,,[ sched_algo_txbf_ofdma.c : 591 ] ru_to_start_and_end_tone end_tone is NULL +3252,i,[ sched_algo_txbf_ofdma.c : 491 ] ru_to_tone_offset_size (bw > BW_CNT) bw = %d +3251,ii,[ sched_algo_txbf_ofdma.c : 496 ] ru_to_tone_offset_size invalid ru_end (ru_end > MAX_RU_PER_BW[%d]) ru_end =%d +3250,ii,[ sched_algo_txbf_ofdma.c : 501 ] ru_to_tone_offset_size invalid ru_start (ru_start > MAX_RU_PER_BW[%d]) ru_start =%d +3249,ii,[ sched_algo_txbf_ofdma.c : 507 ] ru_to_tone_offset_size invalid ru_start/ru_end (ru_end < ru_start) ru_start = %d, ru_end = %d +3248,i,[ sched_algo_txbf_ofdma.c : 512 ] ru_to_tone_offset_size invalid ng ( ng >= WAL_TXBF_HE_NG_MAX ), ng = %d +3247,,[ sched_algo_txbf_ofdma.c : 517 ] ru_to_tone_offset_size tone_offset is NULL +3246,,[ sched_algo_txbf_ofdma.c : 522 ] ru_to_tone_offset_size num_tones is NULL +3271,iiiiiiii,[ sched_algo_muedca.c : 406 ] MU_EDCA_DEBUG: compute_mu_edca_params: ac: %d, trig_capable_user_count: %d, non_trig_capable_user_count: %d, num_ulmu_non_cap_ax_sta: %d, rx_loading_pct: %d, num_mumimo_txop %d, ul_ppdu: %d, ul_tcp_ppdu: %d +3270,IIII,[ sched_algo_muedca.c : 104 ] MU_EDCA_DEBUG: AIFS for BE = %u, CWMIN = %u, num_ax_sta: %u, num_legacy_sta: %u +3269,II,[ sched_algo_muedca.c : 122 ] MU_EDCA_DEBUG: AIFS for VI = %u, CWMIN = %u +3268,IIIII,[ sched_algo_muedca.c : 57 ] MU_EDCA_DEBUG: ULMU- AIFS for BE = %u, CWMIN = %u, num_ax_sta: %u, num_legacy_sta: %u, num_non_ulmu_cap_sta: %u +3267,II,[ sched_algo_muedca.c : 75 ] MU_EDCA_DEBUG: ULMU- AIFS for VI = %u, CWMIN = %u +3266,iiiiii,[ sched_algo_muedca.c : 598 ] MU_EDCA_DEBUG: ac: %d, wal_txq_num: %d, qnum: %d, aifs_n: %d, cw_min: %d, cw_max: %d +3265,,[ sched_algo_muedca.c : 725 ] MU_EDCA_DEBUG: Running Dynamic MU EDCA update +3264,iiiiii,[ sched_algo_muedca.c : 206 ] MU_EDCA_DEBUG: tune_edca_parameters: trig_capable_user_count: %d, non_trig_capable_user_count: %d, non_ulmu_trig_capable_user_count: %d, rx_loading_pct: %d, curr_state: %d, new_state: %d +3263,iiiii,[ sched_algo_muedca.c : 238 ] MU_EDCA_DEBUG: tune_edca_parameters: applying config to ac %d, old aifs: %d, new aifs: %d, old cwmin: %d, new cwmin: %d +3262,II,[ sched_algo_muedca.c : 666 ] MU_EDCA_DEBUG: Current OFDMA Trigger Status = %u for AC = %u +3261,,[ sched_algo_muedca.c : 564 ] MU_EDCA_DEBUG: Sending WMI MESSAGE +3260,IIII,[ sched_algo_muedca.c : 566 ] MU_EDCA_DEBUG: aifsn be = %u, bk = %u, vi = %u, vo = %u +3274,,[ hca_HwComponentBbLithium_debug.cpp : 231 ] PHYDBG::Dump::Capture enable clear-Timeout + +3273,,[ hca_HwComponentBbLithium_debug.cpp : 932 ] PHYDBG DISABLE: HcaHwComponentBbLithium_debug::PHYDBG_disable +3272,,[ hca_HwComponentBbLithium_debug.cpp : 934 ] PHYDBG disabled + +3275,i,[ hca_HwComponentBbLithium_pcss_ipc.cpp : 530 ] PcssIpcRingIRQHandler: PS Mode, ignoring IPC Ring IRQ! phyId:%d +3276,I,[ hca_HwComponentBbLithium_phy.cpp : 139 ] %s + +3285,III,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 316 ] DFS_DUMPS Rejecting Radar since delta peak values are invalid : dl_delta_peak_match_count=%lu, dl_psidx_diff_match_count=%lu, rf_threshold=%lu + +3284,IIi,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 321 ] DFS_DUMPS %s: Rejecting Radar since duration diff %ld is more than %d + +3283,i,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 576 ] DFS_DUMPS Rejecteing as radar injected in non-DFS channel, freq offset=%d +3282,i,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 587 ] DFS_DUMPS Rejecteing as radar injected in non-DFS channel in 165MHZ. fre offset=%d +3281,,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 1009 ] DFS_DUMPS found bin5 radar + +3280,ii,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 1051 ] DFS_DUMPS Rejecting pulses on rssi rssi=%d, thresh=%d + +3279,iiii,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 1306 ] DFS_DUMPS Radar Found with Filter Id = %d min dur=%d sidx=%d freq_offset=%d + +3278,ii,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 1313 ] CHANNEL_CLOSE radarevent g_dfs_test_mode=%d event_data.detection_mode=%d + +3277,i,[ hca_HwComponentBbLithium_dfs_process_radarevent.cpp : 1414 ] DFS_DEBUGS false_radar dfs->dfs_seq_num =%d + +3299,I,[ hca_HwComponentBbLithium_debug_core.cpp : 520 ] PHYDBG LWod 0x%lx + +3298,I,[ hca_HwComponentBbLithium_debug_core.cpp : 521 ] PHYDBG UWod 0x%lx + +3297,Ii,[ hca_HwComponentBbLithium_debug_core.cpp : 273 ] %s skipping bank %d + +3296,I,[ hca_HwComponentBbLithium_debug_core.cpp : 471 ] PHYDBG_CAPTURE_U 0x%lx + +3295,I,[ hca_HwComponentBbLithium_debug_core.cpp : 472 ] PHYDBG_CAPTURE_L 0x%lx + +3294,I,[ hca_HwComponentBbLithium_debug_core.cpp : 473 ] PHYDBG_PLAYBACK_U 0x%lx + +3293,I,[ hca_HwComponentBbLithium_debug_core.cpp : 474 ] PHYDBG_PLAYBACK_L 0x%lx + +3292,I,[ hca_HwComponentBbLithium_debug_core.cpp : 475 ] PHYDBG_PHYRF_TX_PRE_DESC_WR_1_L 0x%lx + +3291,I,[ hca_HwComponentBbLithium_debug_core.cpp : 476 ] PHYDBG_WFAX_PHYRF_PHYRF_ACTIVATION_CTRL_L 0x%lx + +3290,I,[ hca_HwComponentBbLithium_debug_core.cpp : 477 ] PHYDBG_MODE_L 0x%lx + +3289,I,[ hca_HwComponentBbLithium_debug_core.cpp : 478 ] PHYDBG_TRIGGER_0_L 0x%lx + +3288,I,[ hca_HwComponentBbLithium_debug_core.cpp : 479 ] PHYDBG_TRIGGER_0_U 0x%lx + +3287,I,[ hca_HwComponentBbLithium_debug_core.cpp : 480 ] PHYDBG_TRIGGER_1_L 0x%lx + +3286,Ii,[ hca_HwComponentBbLithium_debug_core.cpp : 377 ] %s skipping bank %d + +3303,iiIiiiiii,[ hca_HwComponentBbLithium_dfs_phyerr_tlv.cpp : 294 ] DFS_DUMPS ts=%d diff_ts=%d sidx=%i dur=%d chirp=%d det=%d radar_check=%d agc_event=%d rssi=%d +3302,iiiii,[ hca_HwComponentBbLithium_dfs_phyerr_tlv.cpp : 300 ] DFS_DUMPS ts=%d delta_peak=%d delta_diff=%d total_gain=%d is_max_pw=%d +3301,iiiii,[ hca_HwComponentBbLithium_dfs_phyerr_tlv.cpp : 324 ] DFS_DUMP radar summary detection_mode=%d timestamp=%d pulse_rssi=%d is_chirp=%d sidx=%d + +3300,iiiiiIiii,[ hca_HwComponentBbLithium_dfs_phyerr_tlv.cpp : 191 ] DFS_DUMPS ts=%d fft_num=%d radar_check=%d total_gain=%d base_pwr=%d peak_sidx=%i relpwr=%d peak_mag=%d num_str_bins_ib=%d + +3313,ii,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 477 ] DFS_DUMP Dfs0Sighandler pHandle=%d ipc_ring_id=%d + +3312,ii,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 485 ] DFS_DUMP Dfs1Sighandler pHandle=%d ipc_ring_id=%d + +3311,ii,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 495 ] DFS_DUMP Dfs2Sighandler pHandle=%d ipc_ring_id=%d + +3310,,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 268 ] FFT_RAW START + +3309,II,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 272 ] FFT_RAW %p 0x%x + +3308,II,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 276 ] FFT_RAW %p 0x%x + +3307,II,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 278 ] FFT_RAW %p 0x%x + +3306,II,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 279 ] FFT_RAW %p 0x%x + +3305,,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 284 ] FFT_RAW END + +3304,iii,[ hca_HwComponentBbLithium_dfs_process_phyerr.cpp : 458 ] DFS_DUMP pcss_ipc_sig_handler_process_multiple_ring_element pHandle=%d ipc_ring_id=%d num_bufs=%d + +3314,ii,[ hca_HwComponentBbQcn9000_spectral.cpp : 483 ] SSCAN: BinIndices scanMode %d isChan165 %d +3336,I,[ hca_HwComponentBbQcn9000_reset.cpp : 511 ] PCSS_VR: Indicate ucode on channel/band change UCODE_MODE_MAP writen value %x + +3335,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 360 ] DFS_DUMPS Post Prog Init phyDfsEnMask=%d, synthSelMask=%d + +3334,iii,[ hca_HwComponentBbQcn9000_reset.cpp : 364 ] ASSCAN: Post Prog Init phySscanEnMask=%d, synthSelMask=%d aDfsSynthFreq=%d +3333,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 779 ] PerformPhyOff::BuildId=%d BranchId=%d is not supported + +3332,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 785 ] PerformPhyOff::BuildId=%d BranchId=%d is supported + +3331,Ii,[ hca_HwComponentBbQcn9000_reset.cpp : 797 ] PerformPhyOff:: q6_to_m3_ipc_address=0x%x q6_to_m3_ipc=%d + +3330,Ii,[ hca_HwComponentBbQcn9000_reset.cpp : 809 ] PerformPhyOff::(VR_Q6_TO_M3_10_L) failure status : 0x%x, loopCount=%d + +3329,i,[ hca_HwComponentBbQcn9000_reset.cpp : 838 ] M3_SSR::CheckIfPhyIsOff CF_active: %d +3328,,[ hca_HwComponentBbQcn9000_reset.cpp : 843 ] M3_SSR::CheckIfPhyIsOff:: Forcing CF_ACTIVE LOW +3327,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 848 ] M3_SSR::CheckIfPhyIsOff CF_active: %d readStatus: %d +3326,,[ hca_HwComponentBbQcn9000_reset.cpp : 864 ] CheckIfPhyIsOff::phyOff was not received by uCode, forcing phyOff via Interrupt + +3325,,[ hca_HwComponentBbQcn9000_reset.cpp : 870 ] CheckIfPhyIsOff::phyOff was received by uCode via TLV + +3324,i,[ hca_HwComponentBbQcn9000_reset.cpp : 602 ] ANI_DUMP_PHYID%d SAVE ANI DEFAULTS + +3323,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 186 ] ADFS_DUMPS / ASSCAN SetHwChainMasks phyDfsEnMask=%d phySscanEnMask=%d +3322,iiiIi,[ hca_HwComponentBbQcn9000_reset.cpp : 958 ] ADFS_DUMPS / ASSCAN PostSetChannelAgile phyDfsEnMask=%d, phySscanEnMask=%d, synthSelMask=%d, rxchainmsk=%, txchainmsk=%d +3321,i,[ hca_HwComponentBbQcn9000_reset.cpp : 221 ] Tx_Gain Overrided - %d + +3320,,[ hca_HwComponentBbQcn9000_reset.cpp : 239 ] Tx_Gain Removed + +3319,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 1516 ] Before ShiftChainMask: tx:%d rx:%d +3318,ii,[ hca_HwComponentBbQcn9000_reset.cpp : 1544 ] After ShiftChainMask: tx:%d rx:%d +3317,,[ hca_HwComponentBbQcn9000_reset.cpp : 592 ] CV_UPLOAD_SIGNED Enabled + +3316,,[ hca_HwComponentBbQcn9000_reset.cpp : 595 ] uCode does not advertised CV_UPLOAD_SIGNED Enabled + +3315,,[ hca_HwComponentBbQcn9000_reset.cpp : 732 ] M3_SSR::WarmReset calling CheckIfPhyIsOff +3338,,[ hca_HwComponentBbQcn9000_preInit.cpp : 236 ] No BDF merge since one of the pointer is NULL or invalid length +3337,i,[ hca_HwComponentBbQcn9000_preInit.cpp : 241 ] golden bdf_calversion : %d +3339,ii,[ hca_HwComponentBbQcn9000_pcss.cpp : 133 ] PCSS Version : Branch = %d, Build ID = %d +3340,iiiII,[ hca_HwComponentBbQcn9000_dfs_phyerr_tlv.cpp : 83 ] DFS_DUMP pcss_ipc_sig_handler_process_multiple_ring_element pHandle=%d ipc_ring_id=%d num_bufs=%d read_address=%p readaddressvalue=%p + +3347,iI,[ hca_HwComponentBbQcn9000_ani.cpp : 282 ] ANI_EDCCA_PHYID%d MAX_ED_CCA=0x%x + +3346,iIII,[ hca_HwComponentBbQcn9000_ani.cpp : 300 ] ANI_EDCCA_PHYID%d ED_A_VAL=0x%x ED_B_VAL=0x%x ED_C_VAL=0x%x + +3345,iII,[ hca_HwComponentBbQcn9000_ani.cpp : 177 ] ANI_DUMP_PHYID%d DISABLED ANI rxtd_rssi_thr_l=%x rxtd_rssi_thr_u=%x + +3344,iI,[ hca_HwComponentBbQcn9000_ani.cpp : 118 ] ANI_DUMP OFDM DL=%d RSSI_THR_L =%x + +3343,iii,[ hca_HwComponentBbQcn9000_ani.cpp : 202 ] STR_DET_WAR ERROR RATE %d < %d THR %d + +3342,iii,[ hca_HwComponentBbQcn9000_ani.cpp : 238 ] STR_DET_WAR ERROR RATE %d > %d THR %d + +3341,i,[ hca_HwComponentBbQcn9000_ani.cpp : 258 ] STR_DET_WAR ERROR RATE CONSECUTIVE LESS ERROR Reset Regs THR %d + +3352,,[ hca_HwComponentBbQcn9000_spurMit.cpp : 134 ] SpurMitigation: No 2G Spur freq available + +3351,,[ hca_HwComponentBbQcn9000_spurMit.cpp : 141 ] SpurMitigation: No 6G spur freq available + +3350,,[ hca_HwComponentBbQcn9000_spurMit.cpp : 143 ] SpurMitigation: No 5G spur freq available + +3349,IIII,[ hca_HwComponentBbQcn9000_spurMit.cpp : 498 ] %s PriCount : 0x%lx , 1stPriSpur : 0x%lx , 2ndPriSpur : 0x%lx + +3348,IIII,[ hca_HwComponentBbQcn9000_spurMit.cpp : 499 ] %s ExtCount : 0x%lx , 1stExtSpur : 0x%lx , 2ndExtSpur : 0x%lx + +3357,i,[ phyDevLibCommon.c : 67 ] Error: Invalid PHY ID [=%d] +3356,II,[ phyDevLibCommon.c : 125 ] Dumping PDMEM: [0x%08lx : 0x%08lx] +3355,,[ phyDevLibCommon.c : 130 ] Dumping PDMEM Done +3354,I,[ phyDevLibCommon.c : 88 ] Switch WCSS ENV to %s +3353,,[ phyDevLibCommon.c : 44 ] register polling disabled +3359,,[ phyIniAg.c : 411 ] Error: cannot commit NULL table! +3358,iI,[ phyIniAg.c : 438 ] Note: table filtered out. table[%d].filter = %c +3362,I,[ phy_dev_init.c : 281 ] Fatal Error! Invalid PHY ID[=%lu]. +3361,I,[ phy_dev_init.c : 89 ] wlan base: 0x%x +3360,III,[ phy_dev_init.c : 99 ] CHIP: %s ENV: %s VER: %s +3375,Ii,[ m3_init.c : 98 ] %s: phy%d +3374,,[ m3_init.c : 119 ] M3 Reset de-asserted [Running @640MHz] +3373,i,[ m3_init.c : 120 ] Polling for boot completion ... [max_poll_count = %d] +3372,,[ m3_init.c : 136 ] Warning: Max Poll Count Exceeded +3371,,[ m3_init.c : 143 ] M3 is idle +3370,,[ m3_init.c : 148 ] Alert: M3 has reported boot failure +3369,,[ m3_init.c : 156 ] Error: Could not detect M3 Boot completion +3368,,[ m3_init.c : 105 ] M3 is already Running. Asserting Reset +3367,,[ m3_init.c : 230 ] Recipe Complete +3366,,[ m3_init.c : 197 ] invalid phym3 binary, skip loading +3365,,[ m3_init.c : 201 ] Loading PDMEM (may take few minutes)... +3364,iIIII,[ m3_init.c : 207 ] seg%d: buf: %p dsize: %x msize: %x offset: %x +3363,,[ m3_init.c : 211 ] Loading PDMEM done +3382,ii,[ m3Config.c : 353 ] [uCode] Branch=%d Ver=%d +3381,i,[ m3Config.c : 357 ] Warning: uCode version mismatch detected [Expected Ver >= %d] +3380,i,[ m3Config.c : 114 ] Fatal Error: Invalid PHYID[=%d] +3379,I,[ m3Config.c : 239 ] forceCrashMask=0x%0.08x +3378,,[ m3Config.c : 269 ] DFS INI programmed +3377,i,[ m3Config.c : 126 ] phyM3Ini: phyId = %d +3376,,[ m3Config.c : 293 ] SPECTRAL SCAN INI programmed +3386,i,[ phy_dev_setChainMask.c : 130 ] phySetChainMask: setting chain mask for phyId = %d ... +3385,,[ phy_dev_setChainMask.c : 134 ] RXCHMASK will be forced to 0x1 +3384,i,[ phy_dev_setChainMask.c : 188 ] phySetChainMask: chain mask for phyId = %d completed +3383,iiI,[ phy_dev_setChainMask.c : 133 ] Warning: [PHYID=%d isSBS=%d RXCHMASK=0x%X] is not supported. +3388,i,[ phy_dev_setXbar.c : 75 ] phySetXbar: setting xbar for phyId = %d ... +3387,i,[ phy_dev_setXbar.c : 88 ] phySetXbar: xbar for phyId = %d completed +3390,iiii,[ phyHeavyClip.c : 219 ] isHcEn_qcn90xx : mcs[%d] nss[%d] pktType[%d] hcEn [%d] +3389,iii,[ phyHeavyClip.c : 259 ] heavyClipPerMcs:%d, heavyClipEnablePktType:%d, heavyClipNssThreshold:%d +3393,IIII,[ phyInitCfoCsr.c : 114 ] fc=%f fcPri20=%f shft_pri80in160=%f cfoCorrFracFloat=%f +3392,III,[ phyInitCfoCsr.c : 147 ] cfoCorrFracPri80=%hhd cfoCorrFracSec80=%hhd cfoCorrFrac_80in160=%hhd +3391,II,[ phyInitCfoCsr.c : 159 ] vsrc_ppm_fc_factor(%uMHz) = %u +3395,,[ phyRegIni.c : 336 ] DFS INI programmed +3394,,[ phyRegIni.c : 383 ] Sscan INI programmed +3415,,[ phyReset.c : 867 ] RxDco Cal complete. + +3414,i,[ phyReset.c : 93 ] [phyId=%d] +3413,i,[ phyReset.c : 96 ] [bandCode=%d] +3412,I,[ phyReset.c : 97 ] [rxChMask=0x%x] +3411,i,[ phyReset.c : 98 ] [dynPriChn=%d] +3410,i,[ phyReset.c : 99 ] [band_center_freq1=%dMHz] +3409,i,[ phyReset.c : 100 ] [band_center_freq2=%dMHz] +3408,I,[ phyReset.c : 101 ] [loadIniMask=0x%x] +3407,I,[ phyReset.c : 94 ] [phyBase=0x%0.08x] +3406,i,[ phyReset.c : 95 ] [bwCode=%d] +3405,,[ phyReset.c : 822 ] Recipe Complete phyChannelSwitch_qcn90xx +3404,,[ phyReset.c : 136 ] (Start) +3403,,[ phyReset.c : 153 ] (End) +3402,,[ phyReset.c : 848 ] Recipe Complete +3401,,[ phyReset.c : 111 ] phyRegAccessPass +3400,,[ phyReset.c : 707 ] Error: Skipping phyReset since reset_input is NULL!! +3399,I,[ phyReset.c : 712 ] [phyResetCtrl=0x%x] +3398,,[ phyReset.c : 717 ] Error: phyRegAccess Failed +3397,I,[ phyReset.c : 718 ] Skipping phyReset for [phyBase = 0x%0.08X] +3396,,[ phyReset.c : 781 ] Recipe Complete phyReset_qcn90xx +3417,i,[ phySetRx11bDetThr.c : 67 ] phySetRx11bDetCorrThr: Warning: numRxChain = %d was unexpected! +3416,,[ phySetRx11bDetThr.c : 78 ] Recipe Complete +3418,I,[ phySetRxfePerNrx.c : 139 ] numChains = %lu +3422,i,[ phyCfrCirCap.c : 41 ] Enable CFR ini programming phyId=%d +3421,i,[ phyCfrCirCap.c : 52 ] Restoring Enable CFR ini programed phyId=%d +3420,i,[ phyCfrCirCap.c : 63 ] Enable CFR ini programming phyId=%d +3419,i,[ phyCfrCirCap.c : 74 ] Restoring Enable CFR ini programed phyId=%d +3424,i,[ phyRtt.c : 41 ] RTT per busrt ini programming phyId=%d +3423,i,[ phyRtt.c : 53 ] Restoring RTT per burst ini programed phyId=%d +3426,iii,[ phySpurMitigation.c : 147 ] numberOfSpurs = %d + spur1Offset = %d + spur2Offset = %d +3425,I,[ phySpurMitigation.c : 248 ] WFAX_RXTD_NOTCH_CNTL_1_L = 0x%lx +3428,,[ phyWarmRst.c : 43 ] Executing Warm Reset on PHYA +3427,,[ phyWarmRst.c : 49 ] RECIPE COMPLETE +3429,iiiI,[ phyVersion.c : 18 ] HDL Version %d.%d.%d (Released On %s) +3504,iiiiii,[ phyrf_ani.c : 114 ] NFREAD%d PHYID=%d NFInDBr=%d NFToDBm=%d maxNumChain=%d maxNFInDBm=%d + +3503,ii,[ phyrf_ani.c : 125 ] ANI_LOG: ETSI Domain - maxNFInDBm=%d, DL_MAX value =%d +3502,i,[ phyrf_ani.c : 130 ] ANI_LOG - DL_MAX value =%d +3501,iiii,[ phyrf_ani.c : 163 ] ANI_EDCCA_PHYID%d CHAIN%d NFBDF=%d NFRUNTIME=%d +3500,iiiiii,[ phyrf_ani.c : 170 ] ANI_EDCCA_PHYID%d NFBDF=%d NFRUNTIME=%d DELTA=%d txChainMask=%d rxChainMask=%d +3499,i,[ phyrf_ani.c : 176 ] ANI_API_PHYID%d API: ANI CONFIGURE + +3498,iiiii,[ phyrf_ani.c : 241 ] ANI_DUMP_PHYID%d DL_OFDM %d DL_CCK %d DL_MIN %d DL_MAX %d + +3497,iiii,[ phyrf_ani.c : 244 ] ANI_DUMP_PHYID%d DL_OFDM %d DL_MIN %d DL_MAX %d + +3496,i,[ phyrf_ani.c : 373 ] ANI_LOG PHY%d ANI_RESET + +3495,i,[ phyrf_ani.c : 375 ] ANI_LOG PHY%d ANI_RESET + +3494,I,[ phyrf_ani.c : 380 ] ANI_CHANNEL_CHANGE - resetCause=%x + +3493,ii,[ phyrf_ani.c : 386 ] ANI_CHANNEL_CHANGE - clear ANI histogram counters phyID=%d ,size=%d + +3492,iiiii,[ phyrf_ani.c : 448 ] ANI_DUMP_PHYID%d ofdmPhyErrCnt %d lsigPhyErrCnt %d cckPhyErrCnt %d sizing1 %d + +3491,iiiiiii,[ phyrf_ani.c : 582 ] ANI_LOG PHYA POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL -%d + +3490,iiiiiii,[ phyrf_ani.c : 584 ] ANI_LOG PHYA POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL %d + +3489,ii,[ phyrf_ani.c : 593 ] ANI_DUMP_PHYID%d ERROR RATE < %d PERCENT + +3488,ii,[ phyrf_ani.c : 608 ] ANI_DUMP_PHYID%d ERROR RATE > %d PERCENT + +3487,i,[ phyrf_ani.c : 629 ] ANI_DUMP_PHYID%d CONSECUTIVE ERROR, INCREMENTING DESENSE LEVEL + +3486,i,[ phyrf_ani.c : 647 ] ANI_DUMP_PHYID%d CONSECUTIVE LESS ERROR, DECREMENTING DESENSE LEVEL + +3485,ii,[ phyrf_ani.c : 687 ] ANI_DUMP PHYID%d ramp_up_time %dms + +3484,ii,[ phyrf_ani.c : 703 ] ANI_DUMP PHYID%d ramp_down_time %dms + +3483,iiii,[ phyrf_ani.c : 454 ] ANI_LOW_POWER_CNTR_PHYID%d rxClearCnt %d ccaCntr0 %d time %d + +3482,iii,[ phyrf_ani.c : 455 ] ANI_DUMP_PHYID%d CYCLE_CNT %d time %d + +3481,iiiiii,[ phyrf_ani.c : 493 ] ANI_LOW_POWER_CNTR_PHYID%d cycleCnt %d txFrameCnt %d rxframecnt %d rxClearCnt %d time %d + +3480,iii,[ phyrf_ani.c : 495 ] ANI_EDCCA_PHYID%d raw_nfdelta=%d pedccaParam->curr_delta=%d + +3479,ii,[ phyrf_ani.c : 524 ] ANI_DUMP LISTEN_TIME=%d , log_cnt=%d + +3478,i,[ phyrf_ani.c : 542 ] ANI_DUMP Log_cnt=%d + +3477,ii,[ phyrf_ani.c : 548 ] ANI_DUMP 2GHZ bo=%d, bc=%d + +3476,iiiiiiii,[ phyrf_ani.c : 550 ] ANI_LOG PHYB POLL %dms LISTEN %dms: OFDM %d LSIG %d CCK %d SIZ1 %d M %d OFDM_DL -%d + +3475,iiiiiiii,[ phyrf_ani.c : 552 ] ANI_LOG PHYB POLL %dms LISTEN %dms: OFDM %d LSIG %d CCK %d SIZ1 %d M %d OFDM_DL %d + +3474,iiiiiiii,[ phyrf_ani.c : 554 ] ANI_LOG PHYB POLL %dms LISTEN %dms: OFDM %d LSIG %d CCK %d SIZ1 %d M %d OFDM_DL -%d + +3473,iiiiiiii,[ phyrf_ani.c : 556 ] ANI_LOG PHYB POLL %dms LISTEN %dms: OFDM %d LSIG %d CCK %d SIZ1 %d M %d OFDM_DL %d + +3472,,[ phyrf_ani.c : 561 ] ANI_DUMP 5GHZ + +3471,iiiiiii,[ phyrf_ani.c : 567 ] ANI_LOG PHYA1 POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL -%d + +3470,iiiiiii,[ phyrf_ani.c : 569 ] ANI_LOG PHYA1 POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL %d + +3469,iiiiiii,[ phyrf_ani.c : 574 ] ANI_LOG PHYA0 POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL -%d + +3468,iiiiiii,[ phyrf_ani.c : 576 ] ANI_LOG PHYA0 POLL %dms LISTEN %dms: OFDM %d LSIG %d SIZ1 %d M %d OFDM_DL %d + +3467,i,[ phyrf_ani.c : 805 ] ANI_LOG - phyrf_ani_EnableAni - g_ani_enable=%d + +3466,ii,[ phyrf_ani.c : 811 ] ANI_DUMP_PHYID%d ANI API ENABLED %d + +3465,ii,[ phyrf_ani.c : 837 ] ANI_DUMP_PHYID%d ENABLED %d + +3464,ii,[ phyrf_ani.c : 852 ] ANI_DUMP_PHYID%d DISABLED %d + +3463,ii,[ phyrf_ani.c : 949 ] ANI_DUMP_PHYID%d GET ANI STATE %d + +3462,i,[ phyrf_ani.c : 1539 ] phyrf_ani_GetCckLevel (Invalid PHY_ID) phyID=%d +3461,iii,[ phyrf_ani.c : 1551 ] phyrf_ani_GetCckLevel (ANI not enabled) phyID=%d, g_ani_enable[%d]=%d +3460,i,[ phyrf_ani.c : 358 ] ANI_LOG GetListenTime=%d +3459,i,[ phyrf_ani.c : 1515 ] phyrf_ani_GetOfdmLevel (Invalid PHY_ID) phyID=%d +3458,iii,[ phyrf_ani.c : 1527 ] phyrf_ani_GetOfdmLevel (ANI not enabled) phyID=%d, g_ani_enable[%d]=%d +3457,iii,[ phyrf_ani.c : 1140 ] ANI_LOG - OverrideAniDlMinMax aniMode=%d, DL_min=%d, DL_max=%d +3456,ii,[ phyrf_ani.c : 1081 ] ANI_LOG - SetAniCckImmunLevel - g_ani_trigger=%d, pAniParam->dl_cck=%d +3455,ii,[ phyrf_ani.c : 943 ] ANI_LOG PHYID%d SetAniListenPeriod %d + +3454,i,[ phyrf_ani.c : 1029 ] ANI_LOG PHYID%d SetAniOfdmImmunLevel error : ANI Disabled.Cannot set OFDM level + +3453,ii,[ phyrf_ani.c : 1053 ] ANI_LOG - SetAniOfdmImmunLevel - g_ani_trigger=%d, pAniParam->dl_ofdm=%d +3452,iiii,[ phyrf_ani.c : 1231 ] ANI_LOG - SetAniPollListenDesenseStepSize - PHYID=%d aniMode=%d SetAniPollPeriod=%d SetAniListenPeriod=%d +3451,ii,[ phyrf_ani.c : 936 ] ANI_LOG PHYID%d SetAniPollPeriod %d + +3450,iii,[ phyrf_ani.c : 1193 ] ANI_LOG - SetMinAniDl -MinAniDl_input=%d, DL_min=%d, DL_max=%d +3449,i,[ phyrf_ani.c : 1366 ] + ANI-VREG-ERR Invalid ANI hist types =%d +3448,,[ phyrf_ani.c : 1375 ] +ANI-VREG-ERR LIST +3447,i,[ phyrf_ani.c : 1376 ] +ANI-VREG-ERR phyId=%d +3446,i,[ phyrf_ani.c : 1377 ] +ANI-VREG-ERR Latest index in histogram =%d +3445,,[ phyrf_ani.c : 1380 ] +ANI-VREG-ERR collection_interval = 10ms + +3444,,[ phyrf_ani.c : 1382 ] +ANI-VREG-ERR collection_interval = 1second + +3443,i,[ phyrf_ani.c : 1384 ] +ANI-VREG-ERR Channel-frequency (Mhz) =%d +3442,,[ phyrf_ani.c : 1390 ] ANI-VREG-ERR |rx_ofdma_timing_err | rx_cck_fail |mac_tx_abort | mac_rx_abort |phy_tx_abort | phy_rx_abort | phyrf_defer_abort| sizing1_evt | sizing2_evt + +3441,IIIIIIIII,[ phyrf_ani.c : 1405 ] ANI-VREG-ERR |%20u|%13u|%13u|%14u|%13u|%14u|%18u|%13u|%13u + +3440,,[ phyrf_ani.c : 1414 ] ANI-VREG-ERR |RX_PKT_CNT_11A |RX_PKT_CNT_11B |RX_PKT_CNT_11N |RX_PKT_CNT_11AC |RX_PKT_CNT_11AX |RX_PKT_CNT_GF + +3439,IIIIII,[ phyrf_ani.c : 1426 ] ANI-VREG-ERR |%15u|%15u|%15u|%16u|%16u|%14u + +3438,,[ phyrf_ani.c : 1435 ] ANI-VREG-ERR |RX_PKT_CRC_PASS_CNT_11A |RX_PKT_CRC_PASS_CNT_11B |RX_PKT_CRC_PASS_CNT_11N |RX_PKT_CRC_PASS_CNT_11AC |RX_PKT_CRC_PASS_CNT_11AX |RX_PKT_CRC_PASS_CNT_GF + +3437,IIIIII,[ phyrf_ani.c : 1447 ] ANI-VREG-ERR |%24u|%24u|%24u|%25u|%25u|%23u + +3436,,[ phyrf_ani.c : 1456 ] ANI-VREG-ERR |LSIG_ERROR | HTSIG_ERROR |VHTSIG_ERROR |HESIG_ERROR |RXTD_OTA |RXTD_FATAL |TXFD |TXTD |PHYRF + +3435,IIIIIIIII,[ phyrf_ani.c : 1471 ] ANI-VREG-ERR |%11u|%13u|%13u|%12u|%9u|%11u|%5u|%5u|%5u + +3434,,[ phyrf_ani.c : 1480 ] ANI-VREG-ERR |VOTING_FAIL |WEAK_DET_FAIL |STRONG_SIG_FAIL |CCK_FAIL |POWER_SURGE |BTCF_TIMING |BTCF_PACKET_DETECT |COARSE_TIMEOUT + +3433,IIIIIIII,[ phyrf_ani.c : 1494 ] ANI-VREG-ERR |%12u|%14u|%16u|%9u|%12u|%12u|%19u|%14u + +3432,I,[ phyrf_ani.c : 1503 ] ANI-VREG-ERR - Invalid Error TYPE = %x + +3431,i,[ phyrf_ani.c : 396 ] ANI_DUMP_PHYID%d READ AND CACHE VREG VALUES + +3430,i,[ phyrf_ani.c : 271 ] ANI_DUMP_PHYID%d RESTORE DL + +3541,,[ phyrf_bdf.c : 4587 ] Functionality unavailable now +3540,,[ phyrf_bdf.c : 4623 ] phyrf_Set_BDFVersion: Feature support unavailable +3539,ii,[ phyrf_bdf.c : 4593 ] phyrf_Get_BDFVersion: SW major : %d , SW minor: %d +3538,I,[ phyrf_bdf.c : 4599 ] phyrf_Get_BDFVersion: setting meta no.: %u +3537,I,[ phyrf_bdf.c : 4611 ] phyrf_Get_BDFVersion: ProjectID: 0x%x +3536,,[ phyrf_bdf.c : 4616 ] phyrf_Get_BDFVersion:OPERATION UNALLOWED +3535,,[ phyrf_bdf.c : 4537 ] phyrf_Set_BDFVersion: setting BDF tpl ver. +3534,ii,[ phyrf_bdf.c : 4542 ] phyrf_Set_BDFVersion: major: %d, minor : %d +3533,I,[ phyrf_bdf.c : 4546 ] phyrf_Set_BDFVersion: meta: %u +3532,I,[ phyrf_bdf.c : 4557 ] phyrf_Set_BDFVersion: projectID: 0x%x +3531,I,[ phyrf_bdf.c : 4561 ] phyrf_Set_BDFVersion: ProjectID: 0x%x +3530,,[ phyrf_bdf.c : 4563 ] phyrf_Get_BDFVersion: ProjectID:ERROR! OTP WRITE UNALLOWED +3529,I,[ phyrf_bdf.c : 4566 ] phyrf_Set_BDFVersion:WARNING: OTP fused: projectID: 0x%x +3528,,[ phyrf_bdf.c : 4574 ] phyrf_Set_BDFVersion: Feature support unavailable +3527,II,[ phyrf_bdf.c : 4251 ] %s:EEPROM i2cResult - %ld +3526,I,[ phyrf_bdf.c : 4256 ] %s:EEPROM Init failed +3525,,[ phyrf_bdf.c : 2558 ] TPC: isFbin is TRUE +3524,i,[ phyrf_bdf.c : 2571 ] TPC: pTpcCalFreq=%d +3523,i,[ phyrf_bdf.c : 2579 ] TPC: chans5G=%d +3522,i,[ phyrf_bdf.c : 2591 ] TPC: chans5G=%d +3521,i,[ phyrf_bdf.c : 2624 ] TPC: chans6G=%d +3520,i,[ phyrf_bdf.c : 1074 ] TPC_DLOFDMA: Target power is %d + +3519,iiii,[ phyrf_bdf.c : 1418 ] DumpTpcPerPacket: rtIdx = %d numStreams %d numChains %d rateCode %d + +3518,iii,[ phyrf_bdf.c : 1489 ] DumpTpcPerPacket: Get Rate CTL pwr TPC pwr = ch0=%d ch1=%d phy: %d + +3517,iii,[ phyrf_bdf.c : 1539 ] DumpTpcPerPacket: Get Rate regulatory pwr TPC pwr = ch0=%d ch1=%d phy: %d + +3516,iii,[ phyrf_bdf.c : 1604 ] DumpTpcPerPacket: Get Rate regulatory pwr TPC pwr = ch0=%d ch1=%d phy: %d + +3515,iii,[ phyrf_bdf.c : 1479 ] DumpTpcPerPacket: Get Rate target pwr TPC pwr = ch0=%d ch1=%d phy: %d + +3514,,[ phyrf_bdf.c : 1848 ] phyrf_bdf_GetTpcMaxTxPwr :: Invalid Channel Frequency +3513,iiIi,[ phyrf_bdf.c : 1869 ] GetTpcMaxTxPwr: phyId %d txCM %d rcFlags 0x%x tpc_max_tx_power %d +3512,i,[ phyrf_bdf.c : 1877 ] MaxPwr tpc_max_tx %d + +3511,II,[ phyrf_bdf.c : 4391 ] %s: eeprom addr - %lx +3510,III,[ phyrf_bdf.c : 4392 ] %s: read failed expected - %ld retrived - %ld +3509,i,[ phyrf_bdf.c : 2845 ] phyrf_bdf_SetBoardCalVersion: New CalVersion %d is programmed +3508,,[ phyrf_bdf.c : 2848 ] phyrf_bdf_SetBoardCalVersion: SwCalVersion is zero, if MergeBDF() not executed due to NO-caldata in the board. +3507,II,[ phyrf_bdf.c : 4458 ] %s: eeprom addr - %lx +3506,III,[ phyrf_bdf.c : 4459 ] %s: write failed expected - %ld retrived - %ld +3505,,[ phyrf_bdf.c : 4779 ] DumpTpcPerPacket: Set regulatory Info Hal-phy call + +3549,IIIIIII,[ phyrf_cal.c : 791 ] phyid %u, mhz %4u, f1 %4u, f2 %4u, phyMode %2u, calType %2u, calResult %3u +3548,i,[ phyrf_cal.c : 104 ] Skip Periodic NFCAL for phyId %d +3547,i,[ phyrf_cal.c : 705 ] in phyrf_cal_RunDPDCalibration : %d + +3546,iiiI,[ phyrf_cal.c : 1087 ] cp_stats : total_num_cals %d num_pdev_ids_processed %d buf_length %d buf_ptr 0x%x +3545,iii,[ phyrf_cal.c : 1096 ] cp_stats param_tlv->pdev_ids %d mac_id %d phy_id %d +3544,iiiiii,[ phyrf_cal.c : 909 ] phyrf_cal_log_calibration_stats : CAL_STATS calProfile %d calType %d cal_triggered_cnt: %d cal_fail_cnt: %d cal_fcs_cnt: %d cal_fcs_fail_cnt: %d +3543,iii,[ phyrf_cal.c : 949 ] phyrf_cal_log_calibration_stats : CAL_STATS periodicCalType %d cal_triggered_cnt: %d cal_fail_cnt: %d +3542,IIiI,[ phyrf_cal.c : 1001 ] cp_stats cal_type 0x%x cal_profile 0x%x isPeriodic %d cal_info 0x%x +3561,IIII,[ phyrf_cal_sm.c : 853 ] CC::: inside cal_SM_Main, 0x%x, (pHandle=0x%x, smInput=0x%x, pCalSmTable=0x%x) +3560,iIII,[ phyrf_cal_sm.c : 934 ] CAL SM::: cal type idx=%d, ptrStandalone=%x, pIn=%x, pOut=%x +3559,Iii,[ phyrf_cal_sm.c : 551 ] CC::: generateCalSmTable=0x%x, callingContext=%d, curCalTypeIdx=%d +3558,iiiiiIIi,[ phyrf_cal_sm.c : 598 ] CALSM: globalCallingContext[%d]=%d, mhz=%d, freq1=%d, freq2=%d, phy_mode=%3d, chainMask=%2X, Total_cal_time=%d us +3557,ii,[ phyrf_cal_sm.c : 600 ] Summary starts: calibration with globalCallingContext[%d]=%d +3556,iiiii,[ phyrf_cal_sm.c : 612 ] :::::::: %d %d %d %d %d +3555,iI,[ phyrf_cal_sm.c : 657 ] CAL SM::: genCalTable calType=%d hwCalMask 0x%x +3554,iii,[ phyrf_cal_sm.c : 1032 ] CAL SM::: Phy mode=%d, IsTrue160supported=%d, bwcode=%d +3553,Iiiii,[ phyrf_cal_sm.c : 175 ] CALSM: %x, callingContext=%d, dB size = %d, masterCalDbExist()=%d, isSBS=%d +3552,iiiii,[ phyrf_cal_sm.c : 465 ] :::: shortenPhyId=%d, callingContext = %d, Final doCalFlag = %d, docalFlagRxDCO = %d doCalFlagCombIQ = %d +3551,iiiii,[ phyrf_cal_sm.c : 183 ] CALSM: final calDBEnableSetting=%d, final CalTimeOutSetting = %d, final PersistentEnable = %d, masterCalDbExist()=%d, ColdBootDfsCalEnable=%d +3550,iiii,[ phyrf_cal_sm.c : 322 ] :::: shortenPhyId=%d, callingContext = %d, Final doCalFlag = %d, doCalFlagCombIQ = %d +3615,,[ phyrf_caldb.c : 4469 ] CALDB ::: CheckCombCalForFCS [PREVIOUS_RECORD == PRESENT_RECORD] +3614,,[ phyrf_caldb.c : 4474 ] CALDB ::: CheckCombCalForFCS [PREVIOUS_RECORD != PRESENT_RECORD] +3613,,[ phyrf_caldb.c : 4479 ] CALDB ::: CheckCombCalForFCS [PRESENT_RECORD = INVALID] +3612,iiiiii,[ phyrf_caldb.c : 4538 ] CheckDpdMemForFCS() : maxChainIdx %d rfChainMask %d cur_tbl_idx %d subModeIndxFor80p80 %d phyId %d, chainIdx %d +3611,IIii,[ phyrf_caldb.c : 4543 ] previous hw tracking table %x , curremt tracking table %x tableValid %d CALDB_STATUS_VALID %d +3610,I,[ phyrf_caldb.c : 4555 ] CB::: CheckDpdMemForFCS() : %x, +3609,,[ phyrf_caldb.c : 4384 ] CALDB ::: CheckRXDCOForFCS [PREVIOUS_RECORD == PRESENT_RECORD] +3608,,[ phyrf_caldb.c : 4389 ] CALDB ::: CheckRXDCOForFCS [PREVIOUS_RECORD != PRESENT_RECORD] +3607,,[ phyrf_caldb.c : 4394 ] CALDB ::: CheckRXDCOForFCS [PRESENT_RECORD = INVALID] +3606,iiiiiIii,[ phyrf_caldb.c : 5908 ] TEMPSEN::: phyId = %d, chainIdx = %d, CBNormalizedOffset=%d, CBTempInC=%d, LastTempInC=%d, getTime=%u, curTempID=%d, CBtempeID=%d +3605,iiii,[ phyrf_caldb.c : 7078 ] chain %d MemDPDValidateCurChSwForFCS %d channel %d rssult %d +3604,iiiiii,[ phyrf_caldb.c : 2404 ] CALDB TEMPSEN::: phyId=%d, calType=%d rfChainMask = %d, chainIdx=%d, globalCallingContext=%d, UseAltTableAllowed=%d +3603,I,[ phyrf_caldb.c : 4598 ] CALDB::: IS_FTM_MODE() : %x, DISALBE_RESTORE_FOR_FTM is defined +3602,i,[ phyrf_caldb.c : 6574 ] dualband_enable_phyb = %d + +3601,i,[ phyrf_caldb.c : 1280 ] dual_lo_needed = %d + +3600,IIIII,[ phyrf_caldb.c : 6553 ] CALDB_DEBUG: Frequency table dump Start Freq %u | End freq %u | Sequential Index %u | Master Index %u | TPC mapped freq %u +3599,iiiiiii,[ phyrf_caldb.c : 6300 ] caldB_synopsis: [%d], phyID=%d, mHz=%d, f1=%d, f2=%d, phyMode=%d, fullResetTime(us)=%d +3598,i,[ phyrf_caldb.c : 6396 ] caldB_synopsis: No of coldboot channels : %d +3597,IIII,[ phyrf_caldb.c : 6324 ] caldB_synopsis: RXDCO Addr : 0x%08x 0x%08x, 0x%08x, 0x%08x +3596,IIII,[ phyrf_caldb.c : 6327 ] caldB_synopsis: RXDCO Valid: 0x%08x 0x%08x, ;0x%08x, 0x%08x +3595,IIII,[ phyrf_caldb.c : 6335 ] caldB_synopsis: RXDCO Addr : 0x%08x 0x%08x, 0x%08x, 0x%08x +3594,IIII,[ phyrf_caldb.c : 6338 ] caldB_synopsis: RXDCO Valid: 0x%08x 0x%08x, 0x%08x, 0x%08x +3593,II,[ phyrf_caldb.c : 6343 ] caldB_synopsis: RXDCO Addr : 0x%08x 0x%08x +3592,II,[ phyrf_caldb.c : 6345 ] caldB_synopsis: RXDCO Valid: 0x%08x 0x%08x +3591,IIII,[ phyrf_caldb.c : 6370 ] caldB_synopsis: COMIQ Addr : 0x%08x 0x%08x, 0x%08x, 0x%08x +3590,IIII,[ phyrf_caldb.c : 6373 ] caldB_synopsis: COMIQ Valid: 0x%08x 0x%08x, 0x%08x, 0x%08x +3589,IIII,[ phyrf_caldb.c : 6381 ] caldB_synopsis: COMIQ Addr : 0x%08x 0x%08x, 0x%08x, 0x%08x +3588,IIII,[ phyrf_caldb.c : 6384 ] caldB_synopsis: COMIQ Valid: 0x%08x 0x%08x, 0x%08x, 0x%08x +3587,II,[ phyrf_caldb.c : 6389 ] caldB_synopsis: COMIQ Addr : 0x%08x 0x%08x +3586,II,[ phyrf_caldb.c : 6391 ] caldB_synopsis: COMIQ Valid: 0x%08x 0x%08x +3585,iII,[ phyrf_caldb.c : 6502 ] caldB_synopsis: phyId=%d calFileVersionID=0x%08x calFileRevisionID=0x%08x +3584,,[ phyrf_caldb.c : 273 ] Secondary effrfchnmask: Invalid chainmask config!!! +3583,,[ phyrf_caldb.c : 311 ] Listen effrfchnmask- Invalid chainmask config!!! +3582,i,[ phyrf_caldb.c : 1805 ] CALDB ERROR: invalid band of %d + +3581,iiiiii,[ phyrf_caldb.c : 1966 ] CALDB :::: frequency=%d, bandw:%d calTypeIdx=%d, *mapToCalGroupIdx=%d, *rfsub =%d, *sequentialSubBandIdx=%d +3580,,[ phyrf_caldb.c : 1988 ] CALDB ERROR: illegal channel access detected! asserting here + +3579,,[ phyrf_caldb.c : 1822 ] CALDB ERROR: illegal band access detected! asserting here + +3578,III,[ phyrf_caldb.c : 3576 ] CC::: rxiqStart: %x, txiqStart: %x, txloStart: %x +3577,iiIi,[ phyrf_caldb.c : 3757 ] dpdStart address for cur_tbl_idx [%d] chainIdx %d is 0x%x channel %d +3576,,[ phyrf_caldb.c : 3343 ] error: phyId not matched to system supported number of PHYs. +3575,iii,[ phyrf_caldb.c : 6709 ] invalid Cal attemps %d chain index %d freq %d +3574,iii,[ phyrf_caldb.c : 6679 ] update Cal attemps %d chain index %d freq %d +3573,,[ phyrf_caldb.c : 2212 ] error: phyId not matched to system supported number of PHYs. +3572,iii,[ phyrf_caldb.c : 1426 ] Wow mode status operation : %d wow_mode_status (0: master calDB can be access) %d, wow entry cnt=%d +3571,,[ phyrf_caldb.c : 5377 ] ERROR: CalDB checksum failure +3570,,[ phyrf_caldb.c : 5185 ] error: phyId not matched to system supported number of PHYs. +3569,,[ phyrf_caldb.c : 158 ] ERROR: supported phy not match to phyId +3568,I,[ phyrf_caldb.c : 6539 ] eDPD ptr %p +3567,i,[ phyrf_caldb.c : 1355 ] isDFS = %d +3566,iiiiiii,[ phyrf_caldb.c : 6228 ] updating_caldB_synopsis: [%d], phyID=%d, mHz=%d, f1=%d, f2=%d, phyMode=%d, fullResetTime(us)=%d +3565,iII,[ phyrf_caldb.c : 6241 ] updating_caldB_synopsis: RXDCO, chainIdx=%d, Addr=0x%08x, Valid=0x%08x +3564,iiII,[ phyrf_caldb.c : 6256 ] updating_caldB_synopsis: COMBIQ, tableIdx=%d, chainIdx=%d, Addr=0x%08x, Valid=0x%08x +3563,II,[ phyrf_caldb.c : 7097 ] in fn updateCurChSwMemDpdCal address1 %x = address0 %x + +3562,,[ phyrf_caldb.c : 3450 ] error: phyId not matched to system supported number of PHYs. +3617,i,[ phyrf_cbc.c : 885 ] cbc: ENABLE_CHANNEL_LIST_IN_BDF not defined: repeatLimit=%d +3616,i,[ phyrf_cbc.c : 308 ] CALDB_DEBUG: skipping the wrong channel for the radio : %d + +3635,,[ phyrf_caldb_aging.c : 186 ] REGEN_CALDB: starting +3634,,[ phyrf_caldb_aging.c : 191 ] REGEN_CALDB: Invalid phy Handle. Exiting Caldb regen +3633,,[ phyrf_caldb_aging.c : 197 ] REGEN_CALDB: Invalid phyId. Exiting Caldb regen +3632,,[ phyrf_caldb_aging.c : 204 ] REGEN_CALDB: Software configuration to skip CalDb Regen +3631,,[ phyrf_caldb_aging.c : 220 ] REGEN_CALDB: Invalid Mac Handle. Exiting Caldb regen +3630,,[ phyrf_caldb_aging.c : 232 ] REGEN_CALDB: CALBD CLEARED: +3629,,[ phyrf_caldb_aging.c : 235 ] REGEN_CALDB: INVALID PHYID OR CALDB NOT CLEARED +3628,,[ phyrf_caldb_aging.c : 239 ] REGEN_CALDB: Save the pre regen channel +3627,,[ phyrf_caldb_aging.c : 256 ] REGEN_CALDB: Turning off phy pre regen +3626,II,[ phyrf_caldb_aging.c : 323 ] REGEN_CALDB: Skipping due to invalid PHYID groupMapping[%u][1] is %u +3625,iiii,[ phyrf_caldb_aging.c : 419 ] gurug REGEN_CALDB: calChEntry[%d][%d] %d chIdx %d +3624,,[ phyrf_caldb_aging.c : 471 ] REGEN_CALDB: Restore pre regen channel +3623,,[ phyrf_caldb_aging.c : 482 ] REGEN_CALDB: Turning on phy post regen +3622,I,[ phyrf_caldb_aging.c : 490 ] REGEN_CALDB: completed in %u uSec +3621,,[ phyrf_caldb_aging.c : 95 ] REGEN_CALDB: Invalid Phy Handle +3620,I,[ phyrf_caldb_aging.c : 117 ] REGEN_CALDB: Skipping cal as freq %u is not supported +3619,,[ phyrf_caldb_aging.c : 103 ] REGEN_CALDB: Invalid pdev Handle +3618,,[ phyrf_caldb_aging.c : 109 ] REGEN_CALDB: Invalid Mac Handle +3637,i,[ phyrf_debug.c : 759 ] HALPHY DUMP: WIFITOOL issued with subcommand ID %d +3636,i,[ phyrf_debug.c : 770 ] Invalid or Unsupported halphy debug sub command: %d +3648,ii,[ phyrf_debug_prdd.c : 559 ] PRDD - Invalid number of args (should be %d..%d) +3647,i,[ phyrf_debug_prdd.c : 730 ] PRDD - Invalid PRDD command (should be 0..%d) +3646,,[ phyrf_debug_prdd.c : 735 ] PRDD - Invalid number of args in PRDD command (should be >= 2 args) +3645,I,[ phyrf_debug_prdd.c : 742 ] PRDD - Invalid phyId - should be 0..%lu +3644,,[ phyrf_debug_prdd.c : 701 ] PRDD - Not enough memory to support fixed mode +3643,II,[ phyrf_debug_prdd.c : 454 ] PRDD - No report for phy%u at %u MHz +3642,iii,[ phyrf_debug_prdd.c : 311 ] PRDD - %d MHz, phy%d, 1swT %d ms +3641,iI,[ phyrf_debug_prdd.c : 400 ] PRDD - module%d 0x%08lx +3640,,[ phyrf_debug_prdd.c : 469 ] No PRDD report +3639,i,[ phyrf_debug_prdd.c : 121 ] PRDD - Could not find idx for freq %d +3638,ii,[ phyrf_debug_prdd.c : 964 ] PRDD - channel %d is not found in phy%d +3876,I,[ phyrf_debug_cmd.c : 2921 ] CAL_STATS: CAL PROFILE - COLD_BOOT_CAL (0x%x) +3875,I,[ phyrf_debug_cmd.c : 2924 ] CAL_STATS: CAL PROFILE - FULL_CHAN_SWITCH (0x%x) +3874,I,[ phyrf_debug_cmd.c : 2927 ] CAL_STATS: CAL PROFILE - SCAN_CHAN_SWITCH (0x%x) +3873,I,[ phyrf_debug_cmd.c : 2930 ] CAL_STATS: CAL PROFILE - DPD_SPLIT_CAL (0x%x) +3872,I,[ phyrf_debug_cmd.c : 2933 ] CAL_STATS: CAL PROFILE - TEMP_TRIGEER_CAL (0x%x) +3871,I,[ phyrf_debug_cmd.c : 2936 ] CAL_STATS: CAL PROFILE - POWER_SAVE_WAKE_UP (0x%x) +3870,I,[ phyrf_debug_cmd.c : 2939 ] CAL_STATS: CAL PROFILE - TIMER_TRIGGER_CAL (0x%x) +3869,I,[ phyrf_debug_cmd.c : 2942 ] CAL_STATS: CAL PROFILE - FTM_TRIGGER_CAL (0x%x) +3868,I,[ phyrf_debug_cmd.c : 2945 ] CAL_STATS: CAL PROFILE - POWER_DOWN_DTIM (0x%x) +3867,I,[ phyrf_debug_cmd.c : 2948 ] CAL_STATS: CAL PROFILE - NOISY_ENV_RXDO (0x%x) +3866,I,[ phyrf_debug_cmd.c : 2951 ] CAL_STATS: CAL PROFILE - UNKNOWN_PROFILE (0x%x) +3865,I,[ phyrf_debug_cmd.c : 2961 ] CAL_STATS: CAL TYPE - ADC (0x%x) +3864,I,[ phyrf_debug_cmd.c : 2964 ] CAL_STATS: CAL TYPE - DAC (0x%x) +3863,I,[ phyrf_debug_cmd.c : 2967 ] CAL_STATS: CAL TYPE - NOISE_FLOOR (0x%x) +3862,I,[ phyrf_debug_cmd.c : 2970 ] CAL_STATS: CAL TYPE - RXDCO (0x%x) +3861,I,[ phyrf_debug_cmd.c : 2973 ] CAL_STATS: CAL TYPE - COMB_TXLO_TXIQ_RXIQ (0x%x) +3860,I,[ phyrf_debug_cmd.c : 2976 ] CAL_STATS: CAL TYPE - DPD_MEMORYLESS (0x%x) +3859,I,[ phyrf_debug_cmd.c : 2979 ] CAL_STATS: CAL TYPE - DPD_MEMORY (0x%x) +3858,I,[ phyrf_debug_cmd.c : 2982 ] CAL_STATS: CAL TYPE - IBF (0x%x) +3857,I,[ phyrf_debug_cmd.c : 2985 ] CAL_STATS: CAL TYPE - PDET_AND_PAL (0x%x) +3856,I,[ phyrf_debug_cmd.c : 2988 ] CAL_STATS: CAL TYPE - RXDCO_DTIM (0x%x) +3855,I,[ phyrf_debug_cmd.c : 2991 ] CAL_STATS: CAL TYPE - RXDCO_IQ (0x%x) +3854,I,[ phyrf_debug_cmd.c : 2994 ] CAL_STATS: CAL TYPE - BWFILTER (0x%x) +3853,I,[ phyrf_debug_cmd.c : 2997 ] CAL_STATS: CAL TYPE - PADROOP (0x%x) +3852,I,[ phyrf_debug_cmd.c : 3000 ] CAL_STATS: CAL TYPE - INVALID_CAL_ID (0x%x) +3851,I,[ phyrf_debug_cmd.c : 3010 ] CAL_STATS: CAL TYPE - PERIODIC_NOISE_FLOOR (0x%x) +3850,I,[ phyrf_debug_cmd.c : 3013 ] CAL_STATS: CAL TYPE - PERIODIC_DPD_MEMORYLESS (0x%x) +3849,I,[ phyrf_debug_cmd.c : 3016 ] CAL_STATS: CAL TYPE - PERIODIC_INVALID_CAL (0x%x) +3848,,[ phyrf_debug_cmd.c : 933 ] WIFITOOL: PHYID is not active + +3847,iiii,[ phyrf_debug_cmd.c : 975 ] ANI_LOG PHYID%d ani_dl_min %d, ani_dl_max %d, error_threshold %d +3846,ii,[ phyrf_debug_cmd.c : 987 ] ANI_LOG PHYID%d ani_ramp_down %d + +3845,i,[ phyrf_debug_cmd.c : 996 ] ANI_LOG_ERR - Before- value of ANI histogram=%d +3844,i,[ phyrf_debug_cmd.c : 998 ] ANI_LOG_ERR - After - value of ANI histogram=%d +3843,,[ phyrf_debug_cmd.c : 1001 ] ANI_LOG_ERR VREG ERR COUNTER VALUES +3842,iiii,[ phyrf_debug_cmd.c : 3304 ] MMHostCmdAvgCFO : num_args %d cmd_id %d phy_id %d sub_cmd_id %d +3841,I,[ phyrf_debug_cmd.c : 3311 ] MMHostCmdAvgCFO : Invalid phyId %u +3840,I,[ phyrf_debug_cmd.c : 3319 ] MMHostCmdAvgCFO : Invalid pHandle for phyId %u +3839,i,[ phyrf_debug_cmd.c : 2141 ] BT_CLOCK_ENABLE: %d +3838,I,[ phyrf_debug_cmd.c : 3033 ] MMHostCmdCalStats : Invalid phyId %u +3837,I,[ phyrf_debug_cmd.c : 3041 ] MMHostCmdCalStats : Invalid pHandle for phyId %u +3836,iiii,[ phyrf_debug_cmd.c : 3052 ] MMHostCmdCalStats : num_args %d cmd_id %d phy_id %d sub_cmd_id %d +3835,,[ phyrf_debug_cmd.c : 3062 ] CAL_STATS : Reset calibration stats +3834,,[ phyrf_debug_cmd.c : 3068 ] CAL_STATS : Valid Cal profiles and cal types +3833,I,[ phyrf_debug_cmd.c : 3076 ] CAL_STATS : Number of cal types in this profile = %u +3832,,[ phyrf_debug_cmd.c : 3091 ] CAL_STATS : Calibration stats for valid Cal profiles and cal types +3831,,[ phyrf_debug_cmd.c : 3099 ] ************************************************ +3830,IIIII,[ phyrf_debug_cmd.c : 3113 ] CAL_STATS : cal_type = %u | cal_triggered_cnt = %u | cal_fail_cnt = %u | cal_fcs_cnt = %u | cal_fcs_fail_cnt = %u +3829,,[ phyrf_debug_cmd.c : 3117 ] ************************************************** +3828,,[ phyrf_debug_cmd.c : 3124 ] CAL_STATS : Calibration stats for valid Periodic Cal profiles and cal types +3827,I,[ phyrf_debug_cmd.c : 3128 ] CAL_STATS : PERIODIC CAL cal_profile = %u +3826,III,[ phyrf_debug_cmd.c : 3138 ] CAL_STATS : cal_type = %u | cal_triggered_cnt = %u | cal_fail_cnt = %u +3825,,[ phyrf_debug_cmd.c : 2633 ] Coldboot Calibration Feature Not Supported +3824,,[ phyrf_debug_cmd.c : 2638 ] Coldboot Calibration Feature: Invalid test arguments +3823,i,[ phyrf_debug_cmd.c : 1710 ] WIFITOOL: PHYID %d is not active + +3822,ii,[ phyrf_debug_cmd.c : 1715 ] EnableDssWarCFO: enable=%d FOR PHYID %d + +3821,iiII,[ phyrf_debug_cmd.c : 2204 ] CHAINMASKOVERRIDE %d - phy[%d]: txChMask 0x%x; rxChMask 0x%x +3820,,[ phyrf_debug_cmd.c : 609 ] CTL_DISABLE: Invalid test arguments +3819,,[ phyrf_debug_cmd.c : 615 ] CTL_DISABLE: Invalid phyId +3818,,[ phyrf_debug_cmd.c : 627 ] CTL_DISABLE: Disabling CTL power limits! +3817,,[ phyrf_debug_cmd.c : 632 ] CTL_DISABLE: Enabling back CTL power limits! +3816,,[ phyrf_debug_cmd.c : 2360 ] DFS_ENABLE: Invalid test arguments +3815,,[ phyrf_debug_cmd.c : 2366 ] DFS_ENABLE: Invalid phyId +3814,,[ phyrf_debug_cmd.c : 2576 ] PHYRF_DEBUG_MM_HOST_CMD_SET_DPD_EDPD_ENABLE Invalid Command +3813,Ii,[ phyrf_debug_cmd.c : 2583 ] PHYRF_DEBUG_MM_HOST_CMD_SET_DPD_EDPD_ENABLE: Invalid PHY ID = %u, phyrf_init_GetNumPhys()=%d +3812,i,[ phyrf_debug_cmd.c : 2591 ] PHYRF_DEBUG_MM_HOST_CMD_SET_DPD_EDPD_ENABLE: Invalid pHandle for phyId=%d +3811,iI,[ phyrf_debug_cmd.c : 2598 ] Set g_halphy_dpd_enable[%d] =0x%x + +3810,,[ phyrf_debug_cmd.c : 850 ] DO_NFCAL_ACTION Invalid Command +3809,I,[ phyrf_debug_cmd.c : 857 ] DO_NFCAL_ACTION: Invalid PHY ID = %u +3808,II,[ phyrf_debug_cmd.c : 876 ] DO_NFCAL_ACTION: Setting NF home channl IterCount to %u for phyId = %u +3807,II,[ phyrf_debug_cmd.c : 883 ] DO_NFCAL_ACTION: Setting pResetStruct->nfPeriodicCalControl to %u for phyId %u +3806,II,[ phyrf_debug_cmd.c : 890 ] DO_NFCAL_ACTION: Setting pResetStruct->nfPeriodicCalWithPhyOffPhyOnControl to %u for phyId %u +3805,II,[ phyrf_debug_cmd.c : 897 ] DO_NFCAL_ACTION: Setting pResetStruct->nfResetCalControl to %u for phyId %u +3804,II,[ phyrf_debug_cmd.c : 907 ] DO_NFCAL_ACTION: Triggering NFCAL with flags %x for phyId %u +3803,i,[ phyrf_debug_cmd.c : 1478 ] DSS: WIFITOOL ISSUED TO ENABLE/DISABLE DSS %d + +3802,i,[ phyrf_debug_cmd.c : 1489 ] DSS: G_SYNTH_CONTROL_FTM=%d FOR PHYID 0 + +3801,i,[ phyrf_debug_cmd.c : 1501 ] DSS: G_SYNTH_CONTROL=%d FOR PHYID 0 + +3800,i,[ phyrf_debug_cmd.c : 1690 ] WIFITOOL: PHYID %d is not active + +3799,ii,[ phyrf_debug_cmd.c : 1695 ] SetDssWarCFODeltaThreshold: cfo_threshold=%d FOR PHYID %d + +3798,i,[ phyrf_debug_cmd.c : 2673 ] DUMP_TPC_GLUT_WAKEUP_SLEEP: WIFITOOL ISSUED TO ENABLE TPC GLUT DUMP %d + +3797,,[ phyrf_debug_cmd.c : 2677 ] DUMP_TPC_GLUT_WAKEUP_SLEEP: wifitool : Invalid test arguments +3796,i,[ phyrf_debug_cmd.c : 2682 ] DUMP_TPC_GLUT_WAKEUP_SLEEP: WIFITOOL ISSUED TO DISABLE TPC GLUT DUMP %d + +3795,i,[ phyrf_debug_cmd.c : 2656 ] DUMP_TPC_REGS_ENABLE: WIFITOOL ISSUED TO ENABLE TPC REG DUMP %d + +3794,,[ phyrf_debug_cmd.c : 2660 ] DUMP_TPC_REGS_ENABLE: wifitool : Invalid test arguments +3793,I,[ phyrf_debug_cmd.c : 1057 ] pResetStruct->enable_ldocal_otp = %u +3792,i,[ phyrf_debug_cmd.c : 1144 ] PAPRD: Invalid PHY ID = %d +3791,ii,[ phyrf_debug_cmd.c : 1148 ] PAPRD: Phy ID %d | Enable for MM = %d +3790,ii,[ phyrf_debug_cmd.c : 1131 ] ANI_LOG PHYID%d error_threshold %d + +3789,,[ phyrf_debug_cmd.c : 2861 ] wrong no of arguments from unit test command +3788,ii,[ phyrf_debug_cmd.c : 1857 ] DSS: WIFITOOL ISSUED TO FORCED SYNTH phyId %d, Synth %d + +3787,i,[ phyrf_debug_cmd.c : 1860 ] FORCED_SYNTH: Invalid PHY ID = %d +3786,ii,[ phyrf_debug_cmd.c : 1876 ] FORCED SYNTH: G_SYNTH_CONTROL=%d FOR PHYID %d + +3785,ii,[ phyrf_debug_cmd.c : 1881 ] FORCED SYNTH: G_SYNTH_CONTROL=%d FOR PHYID %d + +3784,,[ phyrf_debug_cmd.c : 2820 ] CWOFFSET : wifitool : Invalid test arguments +3783,Ii,[ phyrf_debug_cmd.c : 2826 ] phyrf_debug_MMHostCmdGenerateCWToneAtOffset: Invalid PHY ID = %u, phyrf_init_GetNumPhys()=%d +3782,i,[ phyrf_debug_cmd.c : 2832 ] phyrf_debug_MMHostCmdGenerateCWToneAtOffset: Invalid pHandle for phyId=%d +3781,,[ phyrf_debug_cmd.c : 2848 ] phyrf_debug_MMHostCmdGenerateCWToneAtOffset: Invalid command +3780,,[ phyrf_debug_cmd.c : 3201 ] GET_BDF_FEATURE_FLAGS: wifitool : Invalid test arguments +3779,I,[ phyrf_debug_cmd.c : 3209 ] GET_BDF_FEATURE_FLAGS: Invalid PHY ID = %u +3778,iiII,[ phyrf_debug_cmd.c : 3236 ] GET_BDF_FEATURE_FLAGS: wifitool : nvCaldbEnable=%d calDbPersistentEnable=%d tpc_flag=0x%x commonBoardFlags=0x%x +3777,Iiii,[ phyrf_debug_cmd.c : 3237 ] GET_BDF_FEATURE_FLAGS: wifitool : projectId = 0x%x boardCalVersion=%d, bdfVersion=%d, iniVersion=%d +3776,ii,[ phyrf_debug_cmd.c : 3238 ] GET_BDF_FEATURE_FLAGS: wifitool :templateVersionMajor=%d templateVersionMinor=%d +3775,iii,[ phyrf_debug_cmd.c : 3240 ] GET_BDF_FEATURE_FLAGS: wifitool : dpdEnable =%d regMismatchFeatureEnable=%d antenna_gain_feature_enabled=%d +3774,,[ phyrf_debug_cmd.c : 2693 ] GET BOARD CAL DETAILS : wifitool : Invalid test arguments +3773,ii,[ phyrf_debug_cmd.c : 2697 ] GET BOARD CAL DETAILS : wifitool : SW version : %d.%d +3772,i,[ phyrf_debug_cmd.c : 2699 ] GET BOARD CAL DETAILS : wifitool : Meta version : %d +3771,I,[ phyrf_debug_cmd.c : 2702 ] GET BOARD CAL DETAILS : wifitool : ProjectID in OTP : 0x%x +3770,II,[ phyrf_debug_cmd.c : 1294 ] Unit Test ID %u :: phyrf_bdf_GetAllChanGradeInfo returns A_STATUS :: %u ( Internal Error ) +3769,II,[ phyrf_debug_cmd.c : 1298 ] Unit Test ID %u :: phyrf_bdf_GetAllChanGradeInfo returns A_STATUS :: %u ( No Entry ) +3768,II,[ phyrf_debug_cmd.c : 1302 ] Unit Test ID %u :: phyrf_bdf_GetAllChanGradeInfo returns A_STATUS :: %u ( No Memory) +3767,III,[ phyrf_debug_cmd.c : 1306 ] Unit Test ID %u :: phyrf_bdf_GetAllChanGradeInfo returns A_STATUS :: %u ( Success ), chanGradeInfoCount %u +3766,IIIi,[ phyrf_debug_cmd.c : 1315 ] %u. Freq %u, BW %u, ChanPerfMetric %d +3765,II,[ phyrf_debug_cmd.c : 1320 ] Unit Test ID %u :: phyrf_bdf_GetAllChanGradeInfo returns A_STATUS :: %u ( Unknown Error ) +3764,i,[ phyrf_debug_cmd.c : 1241 ] PCSS: Invalid PHY ID = %d +3763,iiii,[ phyrf_debug_cmd.c : 1228 ] PDL Version : %d.%d - RDL Version : %d.%d +3762,,[ phyrf_debug_cmd.c : 1332 ] GetSignalLevel : Invalid test arguments +3761,,[ phyrf_debug_cmd.c : 1348 ] GetSignalLevel : pHandle not found +3760,IIIII,[ phyrf_debug_cmd.c : 1356 ] GetSignalLevel phyId %u, snrInput %u, chainMask %x, bandwidth %u, combRssi %u +3759,I,[ phyrf_debug_cmd.c : 1360 ] GetSignalLevel : SNR Input %u +3758,III,[ phyrf_debug_cmd.c : 1375 ] GetSignalLevel : SNR BW Segment Input %8x%8x for Chain %u +3757,I,[ phyrf_debug_cmd.c : 1383 ] GetSignalLevel : Returns %u (WHAL_EINVAL) +3756,Ii,[ phyrf_debug_cmd.c : 1392 ] GetSignalLevel : SNR=%u RSSI=%d +3755,IIIIIi,[ phyrf_debug_cmd.c : 1406 ] GetSignalLevel : SNR[%u][%u]=%u RSSI[%u][%u]=%d +3754,I,[ phyrf_debug_cmd.c : 3157 ] GET_START_END_FREQ: Invalid PHY ID = %u +3753,,[ phyrf_debug_cmd.c : 3170 ] GET_START_END_FREQ: wifitool : Invalid test arguments +3752,iiii,[ phyrf_debug_cmd.c : 3174 ] GET_START_END_FREQ : wifitool : low_2ghz_chan = %d high_2ghz_chan=%d low_5ghz_chan=%d high_5ghz_chan=%d +3751,i,[ phyrf_debug_cmd.c : 2278 ] GTXENABLE: Invalid PHY ID = %d +3750,ii,[ phyrf_debug_cmd.c : 2284 ] GreenTx Enable[%d]=%d +3749,i,[ phyrf_debug_cmd.c : 2297 ] ImpsBmpsControl: Invalid PHY ID = %d +3748,ii,[ phyrf_debug_cmd.c : 2308 ] ImpsBmpsControl: enable=%d, phyId=%d +3747,iii,[ phyrf_debug_cmd.c : 2322 ] ImpsBmpsControl: imps=%d, enable=%d, phyId=%d +3746,iiii,[ phyrf_debug_cmd.c : 2341 ] ImpsBmpsControl: imps=%d, w2s=%d, enable=%d, phyId=%d +3745,I,[ phyrf_debug_cmd.c : 3256 ] MMHostCmdLMConfig :: LM_DBG: Invalid phyId %u +3744,I,[ phyrf_debug_cmd.c : 3264 ] MMHostCmdLMConfig :: LM_DBG: Invalid pHandle for phyId %u +3743,,[ phyrf_debug_cmd.c : 2110 ] LP_SYNTH: Invalid test arguments +3742,ii,[ phyrf_debug_cmd.c : 2127 ] LPSYNTHFORLEGACY: WIFITOOL ISSUED TO ENABLE LP SYNTH: legacy rate: %d, dtim: %d + +3741,I,[ phyrf_debug_cmd.c : 1076 ] ANI_LOG g_max_edcca=%x +3740,ii,[ phyrf_debug_cmd.c : 1090 ] ANI_LOG PHYID%d g_ani_cca %d + +3739,iii,[ phyrf_debug_cmd.c : 1110 ] ANI_LOG PHYID%d ani_dl_min %d, ani_dl_max %d + +3738,I,[ phyrf_debug_cmd.c : 1813 ] NFCAL_READ_TEST : phyId %u not available for test +3737,IIIIIi,[ phyrf_debug_cmd.c : 1831 ] NFCAL_READ_TEST : phyId %u, nfType 0x%x, bufferSize %u, validBuffer %u, bufferPointer 0x%x, returns %d +3736,IIIi,[ phyrf_debug_cmd.c : 1839 ] NFCAL_READ_TEST : phyId %u, nfType 0x%x, Chain %u, NFValue %d +3735,,[ phyrf_debug_cmd.c : 2406 ] IpcHandler_Enable: Invalid test arguments +3734,,[ phyrf_debug_cmd.c : 2412 ] IpcHandler_Enable: Invalid phyId +3733,ii,[ phyrf_debug_cmd.c : 2419 ] IpcHandler_Enable: enable=%d, phyId=%d +3732,ii,[ phyrf_debug_cmd.c : 1429 ] PHYDBG: g_phydbg_phy_disable[%d] = %d +3731,,[ phyrf_debug_cmd.c : 1446 ] phydbg_reconfigure : Invalid test arguments +3730,i,[ phyrf_debug_cmd.c : 1454 ] phydbg_reconfigure : Invalid PHY ID = %d + +3729,ii,[ phyrf_debug_cmd.c : 1458 ] phydbg_reconfigure : PHYID = %d ,Event = %d + +3728,,[ phyrf_debug_cmd.c : 2721 ] DebugCmdPhyOnOffSeq : Invalid test arguments +3727,I,[ phyrf_debug_cmd.c : 2728 ] DebugCmdPhyOnOffSeq : Invalid phyId %u +3726,I,[ phyrf_debug_cmd.c : 2736 ] DebugCmdPhyOnOffSeq : Invalid pHandle for phyId %u +3725,I,[ phyrf_debug_cmd.c : 2744 ] DebugCmdPhyOnOffSeq : Invalid pResetStruct for phyId %u +3724,IIII,[ phyrf_debug_cmd.c : 2753 ] DebugCmdPhyOnOffSeq : Pretest Counter phyId %u, cfActiveLow_Fail_cnt %04u, cfActiveLow_Pass_cnt %04u, phyOffThroughVregCnt %04u +3723,I,[ phyrf_debug_cmd.c : 2764 ] DebugCmdPhyOnOffSeq : Validating vreg based phyOff for phyId %u +3722,I,[ phyrf_debug_cmd.c : 2768 ] DebugCmdPhyOnOffSeq : Validating tlv based phyOff followed by vreg based phyOff for phyId %u +3721,I,[ phyrf_debug_cmd.c : 2773 ] DebugCmdPhyOnOffSeq : Validating calling vreg based phyOff twice for phyId %u +3720,I,[ phyrf_debug_cmd.c : 2779 ] DebugCmdPhyOnOffSeq : Validating tlv based phyOff for phyId %u +3719,IIII,[ phyrf_debug_cmd.c : 2792 ] DebugCmdPhyOnOffSeq : Posttest Counter phyId %u, cfActiveLow_Fail_cnt %04u, cfActiveLow_Pass_cnt %04u, phyOffThroughVregCnt %04u +3718,i,[ phyrf_debug_cmd.c : 680 ] BDF DUMP: Invalid NV Section %d +3717,i,[ phyrf_debug_cmd.c : 685 ] BDF DUMP: NV Section Size: %d +3716,ii,[ phyrf_debug_cmd.c : 696 ] BDF DUMP: sub-section size: %d sub-section id: 0x%d +3715,iI,[ phyrf_debug_cmd.c : 702 ] BDF DUMP: index: %d d: 0x%x +3714,iI,[ phyrf_debug_cmd.c : 711 ] BDF DUMP: index: %d d:0x%x +3713,I,[ phyrf_debug_cmd.c : 245 ] RegDumpId %u :: NFCAL_BDF_PER_CHAIN :: Exceptions :: Value = 1 : Chain Unsupported +3712,,[ phyrf_debug_cmd.c : 515 ] REGEN_CALDB: wal_pdev is NULL. Skipping +3711,ii,[ phyrf_debug_cmd.c : 583 ] TT-Chain=%d, Temperature=%d + +3710,II,[ phyrf_debug_cmd.c : 591 ] Avg temp across %u chains=%u +3709,IIIii,[ phyrf_debug_cmd.c : 281 ] RegDumpId %u :: NFCAL_RUNTIME_PER_CHAIN :: phyId %u :: Chain %u :: %d dBr :: %d dBm +3708,III,[ phyrf_debug_cmd.c : 291 ] RegDumpId %u :: XTAL CAPIN=%u CAPOUT=%u + +3707,IIi,[ phyrf_debug_cmd.c : 295 ] BdfDump :: XTAL CAPIN=%u CAPOUT=%u PPM=%d + +3706,IIi,[ phyrf_debug_cmd.c : 298 ] BdfDump :: XTAL CAPIN=%u CAPOUT=%u PPM=-%d + +3705,II,[ phyrf_debug_cmd.c : 318 ] RegDumpId %u :: TPC_DUMP MASK %u +3704,iii,[ phyrf_debug_cmd.c : 341 ] RxGainCalResult phyId:%d channel_idx:%d, channel_freq:%d +3703,iiiii,[ phyrf_debug_cmd.c : 347 ] RxGainCalResult phyId:%d channel_idx:%d, chain_idx:%d, DBr_value:%d, DBm_value:%d +3702,IIIii,[ phyrf_debug_cmd.c : 252 ] RegDumpId %u :: NFCAL_BDF_PER_CHAIN :: phyId %u :: Chain %u :: %d dBr :: %d dBm +3701,iI,[ phyrf_debug_cmd.c : 365 ] FTM_DEBUG: g_ftm_ctxt[%d] addr = %p +3700,iIIII,[ phyrf_debug_cmd.c : 376 ] FTM_DEBUG: g_ftm_ctxt[%d]: pdev = %p, vdev = %p, peer = %p, ftm_mode = 0x%x +3699,iIIII,[ phyrf_debug_cmd.c : 378 ] FTM_DEBUG: g_ftm_ctxt[%d]: send_mgmt = 0x%x, send_data = 0x%x, encap_cfg = %p, ctrl = %p +3698,,[ phyrf_debug_cmd.c : 382 ] FTM_DEBUG: encap_cfg pointer is NULL in g_ftm_ctxt !! +3697,iiiI,[ phyrf_debug_cmd.c : 390 ] FTM_DEBUG: g_ftm_ctxt[%d].encap_cfg: pkt_len = %d, pkt_type = %d, vdev = %p +3696,iIIIIII,[ phyrf_debug_cmd.c : 397 ] FTM_DEBUG: g_ftm_ctxt[%d].encap_cfg->sa_addr = 0x%02x:%02x:%02x:%02x:%02x:%02x +3695,iIIIIII,[ phyrf_debug_cmd.c : 405 ] FTM_DEBUG: g_ftm_ctxt[%d].encap_cfg->da_addr = 0x%02x:%02x:%02x:%02x:%02x:%02x +3694,iIIIIII,[ phyrf_debug_cmd.c : 413 ] FTM_DEBUG: g_ftm_ctxt[%d].encap_cfg->bss_addr = 0x%02x:%02x:%02x:%02x:%02x:%02x +3693,,[ phyrf_debug_cmd.c : 418 ] FTM_DEBUG: ctrl pointer is NULL in g_ftm_ctxt !! +3692,iii,[ phyrf_debug_cmd.c : 425 ] FTM_DEBUG: g_ftm_ctxt[%d].ctrl: num_pkts_to_send = %d, is_aggr_ok = %d +3691,I,[ phyrf_debug_cmd.c : 274 ] RegDumpId %u :: NFCAL_RUNTIME_PER_CHAIN :: Exceptions :: Value = 1 : Chain Unsupported, Value = 0 : NFCAL Convergence Failed +3690,iii,[ phyrf_debug_cmd.c : 432 ] FTM_DEBUG: g_dbg_overwrite_ppdu_dur_us = %d, g_dbg_gi_override = %d, g_dbg_he_ltf_override = %d +3689,iiii,[ phyrf_debug_cmd.c : 463 ] CALDB_DEBUG: calDBEnableSetting=%d, CalTimeOutSetting = %d, PersistentEnable = %d, masterCalDbExist()=%d +3688,Ii,[ phyrf_debug_cmd.c : 464 ] CALDB_DEBUG: CALDB_ADDRE= %x dB size = %d +3687,,[ phyrf_debug_cmd.c : 465 ] CALDB_DEBUG: Version info and CALDB Synopsis follows: +3686,,[ phyrf_debug_cmd.c : 499 ] REGEN_CALDB: Re-generating cold boot calibration over debug - Command - wait for 60seconds ... + +3685,iIIi,[ phyrf_debug_cmd.c : 1186 ] ADDRVAL: indx = %d addr = 0x%X val = 0x%X en=%d +3684,iIIi,[ phyrf_debug_cmd.c : 1196 ] ADDRVAL: indx = %d addr = 0x%X val = 0x%X en=%d +3683,iIIi,[ phyrf_debug_cmd.c : 1202 ] ADDRVAL: indx = %d addr = 0x%X val = 0x%X en=%d +3682,,[ phyrf_debug_cmd.c : 2541 ] phyrf_debug_MMHostCmdSetCalMask Invalid Command +3681,Ii,[ phyrf_debug_cmd.c : 2548 ] phyrf_debug_MMHostCmdSetCalMask: Invalid PHY ID = %u, phyrf_init_GetNumPhys()=%d +3680,i,[ phyrf_debug_cmd.c : 2556 ] phyrf_debug_MMHostCmdSetCalMask: Invalid pHandle for phyId=%d +3679,I,[ phyrf_debug_cmd.c : 2563 ] Set g_halphy_debug_cal_mask =0x%x + +3678,,[ phyrf_debug_cmd.c : 2427 ] SetCcaThreshold: Invalid test arguments +3677,,[ phyrf_debug_cmd.c : 2433 ] SetCcaThreshold: Invalid phyId +3676,I,[ phyrf_debug_cmd.c : 2088 ] Set g_halphy_debug_mask =0x%x + +3675,I,[ phyrf_debug_cmd.c : 2094 ] Set phyDebugMask =0x%x + +3674,,[ phyrf_debug_cmd.c : 1894 ] PAPRD: Invalid test arguments +3673,i,[ phyrf_debug_cmd.c : 1902 ] PAPRD: Invalid PHY ID = %d + +3672,ii,[ phyrf_debug_cmd.c : 1906 ] PAPRD: PHYID = %d ,Event = %d + +3671,i,[ phyrf_debug_cmd.c : 2017 ] Setting PBS Mode to %d + +3670,,[ phyrf_debug_cmd.c : 2802 ] FUSE BOARD ID VALUE TO OTP : wifitool : Invalid test arguments +3669,,[ phyrf_debug_cmd.c : 2808 ] FUSE BOARD ID VALUE TO OTP : wifitool :Completed +3668,,[ phyrf_debug_cmd.c : 2228 ] SPECTRAL_ENABLE: Invalid test arguments +3667,,[ phyrf_debug_cmd.c : 2234 ] SPECTRAL_ENABLE: Invalid phyId +3666,,[ phyrf_debug_cmd.c : 2240 ] SPECTRAL_ENABLE: Invalid scanMode +3665,i,[ phyrf_debug_cmd.c : 2882 ] phyrf_debug_MMHostCmdTPCDebug g_clpc_corr_thr %d +3664,ii,[ phyrf_debug_cmd.c : 2897 ] phyrf_debug_MMHostCmdTPCDebug pdadc_read %d meas_pwr %d +3663,ii,[ phyrf_debug_cmd.c : 2902 ] phyrf_debug_MMHostCmdTPCDebug PLUT[%d] = %d +3662,,[ phyrf_debug_cmd.c : 2909 ] phyrf_debug_MMHostCmdTPCDebug Invalid commands +3661,i,[ phyrf_debug_cmd.c : 1034 ] THERMAL: Invalid PHY ID = %d +3660,ii,[ phyrf_debug_cmd.c : 1041 ] g_ThermalEnable[%d]=%d +3659,,[ phyrf_debug_cmd.c : 2512 ] TPC CLPC SWITCH: Invalid test arguments +3658,,[ phyrf_debug_cmd.c : 2518 ] TPC CLPC: Invalid phyId +3657,,[ phyrf_debug_cmd.c : 2525 ] TPC CLPC: TO BE IMPLEMENTED +3656,,[ phyrf_debug_cmd.c : 2465 ] TpcPowerOverride: Invalid test arguments +3655,,[ phyrf_debug_cmd.c : 2471 ] TpcPowerOverride: Invalid phy ID +3654,,[ phyrf_debug_cmd.c : 2489 ] TpcPowerOverride: Invalid test arguments +3653,ii,[ phyrf_debug_cmd.c : 2497 ] TpcPowerOverride: chain %d: power: %d +3652,i,[ phyrf_debug_cmd.c : 1015 ] XTAL: Invalid PHY ID = %d +3651,ii,[ phyrf_debug_cmd.c : 1020 ] g_XtalCalPPM[%d]=%d +3650,i,[ phyrf_debug_cmd.c : 3288 ] WIFITOOL ISSUED TO ENABLE/DISABLE PER-PACKET CHAINMASK SUPPORT = %d + +3649,i,[ phyrf_debug_cmd.c : 3292 ] ENABLE/DISABLE PER-PACKET CHAINMASK SUPPORT: INVALID INPUT %d + +3877,i,[ dfs_fcc_bin5.c : 110 ] DFS_DUMPS Rejecting pulses as they are not chirp %d + +3910,,[ phyrf_dfs.c : 678 ] Invalid Channel Number +3909,i,[ phyrf_dfs.c : 711 ] Invalid frequency : %d +3908,I,[ phyrf_dfs.c : 761 ] %s: DFS ic is Invalid +3907,II,[ phyrf_dfs.c : 768 ] %s: allocation of dfs_ic->ic_curchan failed %zu +3906,iiiii,[ phyrf_dfs.c : 788 ] ADFS_DUMPS : req_chan=%d, ic_ieee_chan=%d, center_freq1=%d, center_freq2=%d, chan_wodth=%d + +3905,I,[ phyrf_dfs.c : 802 ] %s: ADFS- CHANNEL CONFIGURED +3904,iii,[ phyrf_dfs.c : 407 ] DFS_DUMPS regdomain %d phyId=%d g_DfsConfiguration=%d + +3903,,[ phyrf_dfs.c : 234 ] DFS_DUMPS set 0x8000 + +3902,,[ phyrf_dfs.c : 257 ] DFS_DUMP set g_dfs_test_mode + +3901,,[ phyrf_dfs.c : 262 ] DFS_DUMP clear g_dfs_test_mode + +3900,,[ phyrf_dfs.c : 267 ] DFS_DUMP Send Radar summary pulse to host + +3899,,[ phyrf_dfs.c : 271 ] DFS_DUMP stop Sending Radar summary pulse to host + +3898,,[ phyrf_dfs.c : 276 ] DFS_DUMPS Print all the pulse information + +3897,,[ phyrf_dfs.c : 281 ] DFS_DUMPS Stop printing pulse information + +3896,i,[ phyrf_dfs.c : 286 ] DFS_DUMPS RAW_FFT Data Dump set to %d + +3895,iiiiiiiii,[ phyrf_dfs.c : 247 ] DFS_DUMPS timestamp=%d diff_ts=%d pulse_rssi=%d pulse_duration=%d is_chirp=%d sidx=%d detector_id=%d + false_radar=%d radar_check=%d +3894,,[ phyrf_dfs.c : 252 ] DFS_DUMPS set 0x8001 + +3893,II,[ phyrf_dfs.c : 972 ] %s:Allocation of g_dfs_ic[dfs_detector_id] failed %zu +3892,I,[ phyrf_dfs.c : 525 ] %s: DFS ic is Invalid +3891,I,[ phyrf_dfs.c : 541 ] %s: DFS-FCC domain +3890,I,[ phyrf_dfs.c : 549 ] %s: DFS-ETSI domain +3889,I,[ phyrf_dfs.c : 564 ] %s:DFS-MKKN domain +3888,I,[ phyrf_dfs.c : 582 ] %s: DFS-MKK domain +3887,I,[ phyrf_dfs.c : 598 ] %s: DFS_CN_DOMAIN +3886,I,[ phyrf_dfs.c : 612 ] %s: DFS_KR_DOMAIN +3885,I,[ phyrf_dfs.c : 630 ] %s: DFS-UNINT domain +3884,,[ phyrf_dfs.c : 653 ] PRDD_Test_Radar_Enable +3883,Ii,[ phyrf_dfs.c : 656 ] %s[%d]: DFS- Radar Detection Enabling Failed +3882,I,[ phyrf_dfs.c : 850 ] %s: DFS ic is Invalid +3881,I,[ phyrf_dfs.c : 953 ] %s: DFS- CHANNEL CONFIGURED +3880,II,[ phyrf_dfs.c : 861 ] %s: allocation of dfs_ic->ic_curchan failed %zu +3879,iiiii,[ phyrf_dfs.c : 883 ] DFS_DUMPS : req_chan=%d, ic_ieee_chan=%d, center_freq1=%d, center_freq2=%d, chan_wodth=%d + +3878,Ii,[ phyrf_dfs.c : 933 ] %s: Recieved a wrong channel width %d +3911,III,[ wma_dfs_interface.c : 63 ] %s: called; ptr=%p, radar_info=%p + +3913,,[ hca_rf_ftmIf_api.cpp : 140 ] ftmIf_SetRxDeaf +3912,,[ hca_rf_ftmIf_api.cpp : 154 ] ftmIf_SetRxListen +3914,i,[ hca_HwComponentTrx.cpp : 78 ] Error: processCmd ID of %d, unknown state. +3915,i,[ hca_config.cpp : 85 ] Invalid HW component type %d + +3988,i,[ phyrf_mc_paprd.c : 2113 ] PAPRD:Tx stats : hw_queued %d +3987,i,[ phyrf_mc_paprd.c : 2114 ] PAPRD:Tx stats : hw_reaped %d +3986,i,[ phyrf_mc_paprd.c : 2115 ] PAPRD:Tx stats : tx_done %d +3985,i,[ phyrf_mc_paprd.c : 2116 ] PAPRD:Tx stats : tx_abort %d +3984,i,[ phyrf_mc_paprd.c : 2117 ] PAPRD:Tx stats : tx_abort_compl_err_status %d +3983,i,[ phyrf_mc_paprd.c : 2118 ] PAPRD:Tx stats : tx_abort_pdev_suspend %d +3982,i,[ phyrf_mc_paprd.c : 2119 ] PAPRD:Tx stats : tx_async_enqueue %d +3981,i,[ phyrf_mc_paprd.c : 2120 ] PAPRD:Tx stats : tx_async_dequeue %d +3980,i,[ phyrf_mc_paprd.c : 2121 ] PAPRD:Tx stats : tx_fail %d +3979,,[ phyrf_mc_paprd.c : 786 ] PAPRD: pHandle NULL +3978,i,[ phyrf_mc_paprd.c : 796 ] PAPRD: PhyId %d Inactive, returning without CAL +3977,i,[ phyrf_mc_paprd.c : 802 ] PAPRD: Start Calibration : %d ms Timer expired +3976,,[ phyrf_mc_paprd.c : 2607 ] PAPRD: pHandle NULL +3975,i,[ phyrf_mc_paprd.c : 2614 ] PAPRD: PhyId %d dpd_cal_sync_timer_handler_0, releasing the wal_lock +3974,iiiiii,[ phyrf_mc_paprd.c : 1949 ] PAPRD: Abort TempRecal phy %d, curr time %d, currTemp %d, last calTemp %d curr Channel %d thermal channel %d +3973,iiii,[ phyrf_mc_paprd.c : 1963 ] PAPRD : FTM PHY id %d currTemp %d cal temp %d tempDiff_scale %d +3972,iiiiii,[ phyrf_mc_paprd.c : 1974 ] PAPRD : TempRecal triggered phy %d, curr time %d, currTemp %d, last calTemp %d channel %d tempDiff %d +3971,iiii,[ phyrf_mc_paprd.c : 1991 ] PAPRD : PHY id %d currTemp %d cal temp %d tempDiff_scale %d +3970,iiiiii,[ phyrf_mc_paprd.c : 2446 ] (chan %d ,cm %d halphyMemDPDValidateCalDB , result [%d %d], cal_attempts[%d %d] +3969,iiiii,[ phyrf_mc_paprd.c : 2450 ] (chan %d ,cm %d halphyMemDPDValidateCalDB , max attemps %d temp [%d %d] +3968,iiii,[ phyrf_mc_paprd.c : 2416 ] halphyPaprdValidateMemCalibration calattempts %d %d, validBits %d %d +3967,,[ phyrf_mc_paprd.c : 2421 ] CALIBRATION COMPLETE chain 0, result 1 +3966,,[ phyrf_mc_paprd.c : 2425 ] CALIBRATION COMPLETE chain 1, result 1 +3965,,[ phyrf_mc_paprd.c : 2522 ] Do not have access to masterCalDb or localCalDb, failed to restore DPD +3964,ii,[ phyrf_mc_paprd.c : 2526 ] DPD Memory : paprd_restore : finalCase %d channel %d +3963,,[ phyrf_mc_paprd.c : 2588 ] PAPRD: pHandle NULL +3962,iiii,[ phyrf_mc_paprd.c : 1612 ] PAPRD: cur_channel %d, wal_channel %d, scan_channel %d, phyReset %d +3961,iiiii,[ phyrf_mc_paprd.c : 1187 ] PAPRD: DPD calibration aborted on chain %d, tableIdx %d, channel %d, state %d, new_channel_change_request %d +3960,i,[ phyrf_mc_paprd.c : 1204 ] PAPRD: DPD calibration aborted on channel %d +3959,i,[ phyrf_mc_paprd.c : 238 ] PAPRD:SM state %d +3958,ii,[ phyrf_mc_paprd.c : 330 ] PAPRD: MEM DPD Aborting Excess Retries. retry_dpd %d, Tx_Err %d +3957,,[ phyrf_mc_paprd.c : 331 ] PAPRD: Enabling DPD because eDPD failed +3956,ii,[ phyrf_mc_paprd.c : 334 ] PAPRD: Aborting Excess Retries. retry_dpd %d, Tx_Err %d +3955,ii,[ phyrf_mc_paprd.c : 434 ] PAPRD: incrementing retry_dpd %d, Tx_Err %d +3954,ii,[ phyrf_mc_paprd.c : 440 ] 2: PAPRD: incrementing retry_dpd %d, Tx_Err %d +3953,i,[ phyrf_mc_paprd.c : 444 ] PAPRD: PAPRD_CAL_SM_DPD_TRAINING_PROCESS_DATA hwPaPrdStatus(fail) retry_dpd %d +3952,iii,[ phyrf_mc_paprd.c : 506 ] PAPRD: TRAINING_PROCESS_DATA chain %d tableIdx %d processing_time %d +3951,,[ phyrf_mc_paprd.c : 282 ] PAPRD: UCODE VREG WAR enabled +3950,i,[ phyrf_mc_paprd.c : 542 ] DPD Aborted due to BG thread activated in FTM mode : smState %d +3949,,[ phyrf_mc_paprd.c : 603 ] PAPRD: PAPRD_CAL_SM_TEARDOWN_TRAINING : DPD ABORT +3948,iii,[ phyrf_mc_paprd.c : 624 ] PAPRD: is160mode %d secondary %d primary_done %d +3947,iii,[ phyrf_mc_paprd.c : 642 ] PAPRD: phy_a0_done %d phy_a1_done %d phy_a1_secondary_done %d +3946,ii,[ phyrf_mc_paprd.c : 654 ] PAPRD: PAPRDTUNING DONE. total_caltime %d, phyOff_cnt %d +3945,,[ phyrf_mc_paprd.c : 664 ] ----- PAPRDTUNING SECONDARY started----- +3944,ii,[ phyrf_mc_paprd.c : 674 ] PAPRD: PAPRDTUNING DONE. total_caltime %d, phyOff_cnt %d +3943,iii,[ phyrf_mc_paprd.c : 679 ] PAPRD: is160mode %d, secondary %d, isExtn %d +3942,ii,[ phyrf_mc_paprd.c : 680 ] PAPRD: lastcalTime %d, current_time %d +3941,iiii,[ phyrf_mc_paprd.c : 302 ] PAPRD: State m/c : channel %d, txchain %d, table %d, state %d +3940,ii,[ phyrf_mc_paprd.c : 1134 ] PAPRD: Channel = %d, dpd_enable = %d +3939,iii,[ phyrf_mc_paprd.c : 1153 ] PAPRD: Chain = %d, txgainIdx = %d, dacgain = %d +3938,,[ phyrf_mc_paprd.c : 927 ] PAPRD : phyrf_mc_PaprdStartTimer: +3937,iiiiiii,[ phyrf_mc_paprd.c : 1717 ] PAPRD: phyrf_mc_SendTxCompletion : channel %d, txchain %d, table %d, new_channel_change_request %d, cal abort_ppdu %d, status %d, retry_cnt %d +3936,iiiiiii,[ phyrf_mc_paprd.c : 1731 ] PAPRD: new_channel_change_request : channel %d, txchain %d, table %d, new_channel_change_request %d, cal abort_ppdu %d, status %d, retry_cnt %d +3935,iiiii,[ phyrf_mc_paprd.c : 1756 ] PAPRD: Status %d, whal_tx_err_status_t %d, Flush_req_reason %d, tx_ctxt_flags %d, pdev_paused %d +3934,i,[ phyrf_mc_paprd.c : 1773 ] PAPRD: HALPHY_TX_TBTT_FLUSH : condition hit , flush_req_reason = %d +3933,iiii,[ phyrf_mc_paprd.c : 1792 ] PAPRD: Tx Completion Status(HALPHY_TX_ERROR) %d, whal_tx_err_status_t = %d , retrying (chain %d table %d) +3932,iiiiii,[ phyrf_mc_paprd.c : 1642 ] PAPRD: TxChain %d, tableIdx %d, channel %d, state %d, new_channel_change_request %d, startEvtLatency %d +3931,,[ phyrf_mc_paprd.c : 1681 ] PAPRD: phyrf_paprd_TrainingStatus fail +3930,,[ phyrf_mc_paprd.c : 1657 ] PAPRD: PPDU Start Event Delayed - skip further processing and retry DPD +3929,iii,[ phyrf_mc_paprd.c : 1671 ] PAPRD: Aborted. Status %d abort_ppdu %d cur_tbl_idx %d +3928,,[ phyrf_mc_paprd.c : 1677 ] PAPRD: phyrf_paprd_TrainingStatus success +3927,i,[ phyrf_mc_paprd.c : 153 ] PAPRD: Paprd Done status is %d + +3926,iiii,[ phyrf_mc_paprd.c : 1851 ] PAPRD: phyId %d, txchainmask %d chain %d, degC %d +3925,iiii,[ phyrf_mc_paprd.c : 1856 ] PAPRD: phyId %d, txchainmask %d currtime %d, degC %d +3924,iiii,[ phyrf_mc_paprd.c : 2144 ] PAPRD ApplyTempScaling: PhyId %d slope %d temp delta %d scaling %d +3923,iiii,[ phyrf_mc_paprd.c : 2667 ] PAPRD: last_valid_chain_idx %d last_valid_table_index %d pPaprdStruct->txChain %d pPaprdStruct->tableIndex %d + +3922,ii,[ phyrf_mc_paprd.c : 2677 ] PAPRD: phyrf_paprd_HandleMaxRetry pPaprdStruct->training_fail_table %d and calAttempts %d + +3921,iiiiiii,[ phyrf_mc_paprd.c : 2366 ] phyId %d thread context : workingChannel %d txChainMask %d bHomeChan %d phyrfMode %d WoW Mode %d curr Channel %d +3920,ii,[ phyrf_mc_paprd.c : 2384 ] MEM_DPD THREAD (START the new table) : UPDATING CALDB POST PROCESSING DATA : %d %d +3919,iiii,[ phyrf_mc_paprd.c : 2397 ] BG THREAD CONTEXT is DIFFERENT : %d %d, curr channel %d bChannelContext %d +3918,ii,[ phyrf_mc_paprd.c : 2084 ] thermal scaling value is %d and thermal slope is %d +3917,iii,[ phyrf_mc_paprd.c : 2101 ] PAPRD: temp_recal_timer started. tempRecalcount %d, phyId %d, calTemp %d +3916,iiiiii,[ phyrf_mc_paprd.c : 2577 ] phyId %d thread context : workingChannel %d txChainMask %d bHomeChan %d phyrfMode %d WoW Mode %d +3989,I,[ phyrf_phy.c : 79 ] MAC FW Vreg update RU26 Tx disable = %x +4033,iii,[ phyrf_regulatory.c : 264 ] RegDB-6G MaxBW AP SP - %d, LPI - %d, VLP - %d + +4032,iii,[ phyrf_regulatory.c : 270 ] RegDB-6G MaxBW CLIENT SP - %d, LPI - %d, VLP - %d + +4031,,[ phyrf_regulatory.c : 277 ] RegDB - phyrf_regulatory_FillMinBW_6g + +4030,iii,[ phyrf_regulatory.c : 281 ] RegDB-6G MinBW AP SP - %d, LPI - %d, VLP - %d + +4029,iii,[ phyrf_regulatory.c : 287 ] RegDB-6G MinBW CLIENT SP - %d, LPI - %d, VLP - %d + +4028,iii,[ phyrf_regulatory.c : 297 ] RegDB-6G NumRules AP SP - %d, LPI - %d, VLP - %d + +4027,iii,[ phyrf_regulatory.c : 303 ] RegDB-6G NumRules CLIENT SP - %d, LPI - %d, VLP - %d + +4026,Ii,[ phyrf_regulatory.c : 1899 ] RegDB-Test_Super Domain 6G %x %d + +4025,iii,[ phyrf_regulatory.c : 924 ] RegDB-BDF CC %d BDF RD %d CC Type %d + +4024,i,[ phyrf_regulatory.c : 1123 ] RegDB-Status %d + +4023,iiiiiiii,[ phyrf_regulatory.c : 1124 ] RegDB-Final Result alpha0 %d alpha1 %d alpha_size %d max_rules %d get_type %d cc_type %d ctryID %d dmnCode %d + +4022,iiiiiiii,[ phyrf_regulatory.c : 1125 ] RegDB-Final Result num_2g_rules %d num_5g_rules %d phybitmap %d dfsregion %d min_bw_2g %d min_bw_5g %d max_bw_2g %d max_bw_5g %d + +4021,i,[ phyrf_regulatory.c : 956 ] RegDB-No Reg_Dmn diff with BDF %d + +4020,,[ phyrf_regulatory.c : 962 ] RegDB-Has a 6G domain ID + +4019,,[ phyrf_regulatory.c : 967 ] RegDB-Valid 6G super dmn and 5G2G reg pair Combo + +4018,,[ phyrf_regulatory.c : 974 ] RegDB-Invlid Combo + +4017,ii,[ phyrf_regulatory.c : 1055 ] RegDB-6G Super Dmn %d Max BW %d + +4016,ii,[ phyrf_regulatory.c : 1060 ] RegDB-Valid country ID %d Correspondig RegDmn %d + +4015,ii,[ phyrf_regulatory.c : 1107 ] RegDB-6G Super Dmn %d Max BW %d + +4014,ii,[ phyrf_regulatory.c : 1112 ] RegDB-Valid country ID %d Correspondig RegDmn %d + +4013,,[ phyrf_regulatory.c : 612 ] RegDB-New Extended Event Invoked + +4012,iii,[ phyrf_regulatory.c : 648 ] RegDB-Super Dmn Id %d validity %d Idx %d + +4011,iii,[ phyrf_regulatory.c : 693 ] RegDB-Super Dmn Id %d validity %d Idx %d + +4010,iii,[ phyrf_regulatory.c : 739 ] RegDB - Ext Event Status - 2G5G %d 6G %d Overall %d + +4009,iiiiiiii,[ phyrf_regulatory.c : 740 ] RegDB-Final Result_Ext alpha0 %d alpha1 %d alpha_size %d max_rules %d get_type %d cc_type %d ctryID %d dmnCode %d + +4008,iiiiiiii,[ phyrf_regulatory.c : 741 ] RegDB-Final Result_Ext num_2g_rules %d num_5g_rules %d phybitmap %d dfsregion %d min_bw_2g %d min_bw_5g %d max_bw_2g %d max_bw_5g %d + +4007,Ii,[ phyrf_regulatory.c : 1748 ] RegDB-Test_Super Domain 6G %x %d + +4006,ii,[ phyrf_regulatory.c : 451 ] RegDB-Getting 6G_AP_LPI Rules dmn_id %d num_rules %d + +4005,ii,[ phyrf_regulatory.c : 454 ] RegDB-Getting 6G_AP_SP Rules dmn_id %d num_rules %d + +4004,ii,[ phyrf_regulatory.c : 457 ] RegDB-Getting 6G_AP_VLP Rules dmn_id %d num_rules %d + +4003,ii,[ phyrf_regulatory.c : 462 ] RegDB-Getting 6G_CLIENT_LPI Rules dmn_id %d num_rules %d + +4002,ii,[ phyrf_regulatory.c : 469 ] RegDB-Getting 6G_CLIENT_SP Rules dmn_id %d num_rules %d + +4001,ii,[ phyrf_regulatory.c : 476 ] RegDB-Getting 6G_CLIENT_VLP Rules dmn_id %d num_rules %d + +4000,i,[ phyrf_regulatory.c : 1149 ] RegDB-Valid reg dmn pair id %d + +3999,ii,[ phyrf_regulatory.c : 1163 ] RegDB-Valid domain 2g rules %d 5g rules %d + +3998,,[ phyrf_regulatory.c : 1264 ] Invalid country code. Setting to "US". +3997,,[ phyrf_regulatory.c : 1338 ] Invalid country_code/domain_code. No currentRD or ctl value change. +3996,ii,[ phyrf_regulatory.c : 1572 ] REGDB isG=%d dmncode=%d +3995,ii,[ phyrf_regulatory.c : 1529 ] REGDB isG=%d dmncode=%d +3994,ii,[ phyrf_regulatory.c : 1551 ] REGDB isG=%d dmncode=%d +3993,iiiiii,[ phyrf_regulatory.c : 209 ] RegDB 2G-Rule%d start %d end %d max_bw %d reg_power %d flags %d + +3992,iiiiii,[ phyrf_regulatory.c : 237 ] RegDB 5G-Rule%d start %d end %d max_bw %d reg_power %d flags %d + +3991,ii,[ phyrf_regulatory.c : 310 ] RegDB 6G Getting Rules dmn_id %d num_rules %d + +3990,iiiiiii,[ phyrf_regulatory.c : 321 ] RegDB 6G-Rule%d start %d end %d max_bw %d tx_power_eirp %d max_psd_eirp %d flags %d + +4062,iii,[ phyrf_reset.c : 673 ] DumpTpc-3: set trasmit chan power: %d, forced: %d, max tx: %d +4061,i,[ phyrf_reset.c : 674 ] phyrf_reset_ForceTxPower: homeChanFlag: %d +4060,i,[ phyrf_reset.c : 3293 ] Invalid number of chains %d. Resetting PPET to all 0s +4059,iI,[ phyrf_reset.c : 3336 ] ppet16_8ru0_3[%d] = 0x%x +4058,iI,[ phyrf_reset.c : 3338 ] update_ppet->numNss_m1 %d, update_ppet->ruMask 0x%x +4057,i,[ phyrf_reset.c : 3265 ] Invalid ChainIndex %d. Returning the input chainIndex without translating +4056,i,[ phyrf_reset.c : 3272 ] Invalid ChainIndex %d. Returning the input chainIndex without translating +4055,i,[ phyrf_reset.c : 3277 ] Translated ChainIndex %d +4054,I,[ phyrf_reset.c : 3222 ] Translated chainmask 0x%x +4053,I,[ phyrf_reset.c : 1194 ] HALPHY_RESET_SETUP: Reset cause is %lu + +4052,I,[ phyrf_reset.c : 1201 ] HALPHY_RESET_SETUP: Scan to home channel change & reset cause is %lu + +4051,I,[ phyrf_reset.c : 1206 ] HALPHY_RESET_SETUP: Returning to a different home channel and resetCause is %lu + +4050,,[ phyrf_reset.c : 1210 ] HALPHY_RESET_SETUP: Home to scan channel change! + +4049,,[ phyrf_reset.c : 1214 ] HALPHY_RESET_SETUP: Home channel change! + +4048,iiii,[ phyrf_reset.c : 1249 ] DumpTpc-5: set trasmit chan power: %d, 2g limit: %d, 5g limit: %d, max tx: %d +4047,II,[ phyrf_reset.c : 3122 ] PowerMode setting for phyId : 0x%x, value : 0x%x +4046,ii,[ phyrf_reset.c : 1658 ] SetChainMasks: tx:%d rx:%d +4045,ii,[ phyrf_reset.c : 746 ] Not a 160 channel chan->band_center_freq1 %d, chan->band_center_freq2 %d +4044,iiii,[ phyrf_reset.c : 479 ] DumpTpc-1: set trasmit chan power: %d, 2g limit: %d, 5g limit: %d, max tx: %d +4043,i,[ phyrf_reset.c : 506 ] halphySetTxChannelPowerLimit homeChanFlag: %d +4042,iiii,[ phyrf_reset.c : 505 ] halphySetTxChannelPowerLimit phyId %d limit %d maxTxPower %d curChan->mhz %d +4041,iiii,[ phyrf_reset.c : 428 ] DumpTpc-4: set trasmit chan power: %d, 2g limit: %d, 5g limit: %d, max tx: %d +4040,i,[ phyrf_reset.c : 429 ] phyrf_reset_SetTxPowerLimit: homeChanFlag: %d +4039,iiii,[ phyrf_reset.c : 929 ] DumpTpc-4: set trasmit chan power: %d, 2g limit: %d, 5g limit: %d, max tx: %d +4038,i,[ phyrf_reset.c : 930 ] phyrf_reset_SetTxPowerScale: homeChanFlag: %d +4037,iiii,[ phyrf_reset.c : 1135 ] UpdateResetParms : homeChannel[0] %d homeChannel[1] %d curChan freq1 %d curChan freq2 %d +4036,iiIi,[ phyrf_reset.c : 3360 ] PPET numNss_m1 %d, nss_2g %d, chainmask %x, numchains %d +4035,iiIi,[ phyrf_reset.c : 3376 ] PPET numNss_m1 %d, nss_5g %d, chainmask %x, numchains %d +4034,iii,[ phyrf_reset.c : 3386 ] PPET updated = %d (1=YES,0=NO) phyId %d rf_mode %d +4067,,[ phyrf_spectral.c : 306 ] SSCAN: Activating spectral scan +4066,,[ phyrf_spectral.c : 326 ] SSCAN: Deactivating spectral scan +4065,,[ phyrf_spectral.c : 457 ] SSCAN: Disabling spectral scan +4064,,[ phyrf_spectral.c : 228 ] SSCAN: Enabling spectral scan +4063,,[ phyrf_spectral.c : 350 ] SSCAN: Resetting spectral scan +4071,III,[ phyrf_tpc.c : 347 ] %s:chan 0x%x flag:0x%x + +4070,i,[ phyrf_tpc.c : 416 ] TPC_ED WarmReset %d + +4069,i,[ phyrf_tpc.c : 419 ] TPC_ED WarmReset %d + +4068,ii,[ phyrf_tpc.c : 494 ] setting plut and alut for 160 chan1 %d chan2 %d +4078,iii,[ phyrf_bdf_tpc.c : 1194 ] phyrf_tpc_device_ClpcPlutAlutUpdate tpcPowerOffset[%d] %d twoPtOffset[cmask] %d +4077,iiiii,[ phyrf_bdf_tpc.c : 231 ] return from phyrf_tpc_device_AlutGeneration as pdadc meas seems to be zero %d %d %d %d %d +4076,ii,[ phyrf_bdf_tpc.c : 802 ] ##TPC_DBG: GVC Chan %d CalDB %d + +4075,i,[ phyrf_bdf_tpc.c : 907 ] GLUT_PROG_ERROR: pRawCalPerPointOlpcGtxExt was unexpectedly NULL, last 2 entries of GLUT NOT BEING PROGRAMMED maxGlutIdx = %d +4074,Iiiiii,[ phyrf_bdf_tpc.c : 1014 ] ##GVC0 chIDX %lu, pwr %d, dGain %d, gIdx %d, paCfg %d, maxGlutIdx %d + +4073,ii,[ phyrf_bdf_tpc.c : 807 ] ##TPC_DBG: sec80 Chan %d sec80 CalDB %d + +4072,i,[ phyrf_bdf_tpc.c : 820 ] Zero TPC FreqPiers for the band %d + +4099,,[ wlan_stats.c : 2024 ] PS_STA_AVG_CHANNEL_CONGESTION(ERROR0):total_awake_period == 0 +4098,II,[ wlan_stats.c : 2043 ] PS_STA_AVG_CHANNEL_CONGESTION(ERROR1):diff_all(%u) < diff_tx(%u) +4097,I,[ wlan_stats.c : 2061 ] PS_STA_AVG_CHANNEL_CONGESTION(ERROR2): chan_activity(%u) > 100 +4096,IIIIIII,[ wlan_stats.c : 2084 ] PS_STA_AVG_CHANNEL_CONGESTION: vdev_id=%u, running_avg=%u, chan_activity=%u, total_period=%u, busy_activity=%u, diff_all=%u, diff_tx=%u +4095,,[ wlan_stats.c : 1839 ] chan_init POOL ALLOC FAILURE +4094,iii,[ wlan_stats.c : 529 ] wlan_stats_processor:vdev_id:%d ch%d_snr:%d +4093,,[ wlan_stats.c : 4138 ] _wlan_iface_link_stats_process: vdev is NULL +4092,iii,[ wlan_stats.c : 4248 ] total_num_peers:%d num_peer_stats_events:%d num_peer_in_event: %d +4091,,[ wlan_stats.c : 4081 ] radio_link_stats_process no buffer +4090,ii,[ wlan_stats.c : 4108 ] radio_link_stats_process cur_pwr_state:%d next_pwr_state:%d +4089,,[ wlan_stats.c : 4941 ] WMI_VDEV_SEND_BIG_DATA_EVENTID Err mem alloc failed +4088,ii,[ wlan_stats.c : 4981 ] wlan_send_big_data_to_host : VDEV EVT:WMI_VDEV_SEND_BIG_DATA_EVENTID vdevId=%d time=%d +4087,ii,[ wlan_stats.c : 428 ] PS_STA_AVG_CHANNEL_CONGESTION BusyChanRunningAvg = %d %d +4086,ii,[ wlan_stats.c : 1144 ] wlan_stats_processor:vdev_id:%d mac_snr:%d +4085,iii,[ wlan_stats.c : 1320 ] wlan_stats_processor: peer_stats->peer_tx_rate = %d rx_rate = %d rssi = %d +4084,,[ wlan_stats.c : 1626 ] wlan_stats_processor: Ran out of buffers; Aborting Report generation; Sending Report to Host +4083,ii,[ wlan_stats.c : 1168 ] wlan_stats_processor:vdev_id:%d invalid_snr:%d +4082,ii,[ wlan_stats.c : 1179 ] wlan_stats_processor:vdev_id:%d bcn_snr:%d +4081,,[ wlan_stats.c : 4776 ] _wlan_wlm_stats_process: vdev is NULL +4080,,[ wlan_stats.c : 4784 ] _wlan_wlm_stats_process: wal_vdev is NULL +4079,i,[ wlan_stats.c : 4789 ] _wlan_wlm_stats_process: cmd->vdev_id:%d is not up or sta +4105,I,[ wlan_wmi_ctrl_path_stats.c : 419 ] cp_stats print stats for pdev_id =0x%X +4104,I,[ wlan_wmi_ctrl_path_stats.c : 108 ] cp_stats event_send_complete & released buffer= 0x%X +4103,II,[ wlan_wmi_ctrl_path_stats.c : 695 ] cp_stats Reeived cp stats_req with stats_id_mask =0x%X action =0x%X +4102,,[ wlan_wmi_ctrl_path_stats.c : 136 ] cp_stats calling send event +4101,II,[ wlan_wmi_ctrl_path_stats.c : 166 ] cp_stats send wmi event with more data = 0x%X event_status = 0x%X +4100,I,[ wlan_wmi_ctrl_path_stats.c : 672 ] cp_stats call send event with more data = 0x%X +4123,iIIiiII,[ wlan_rssi_monitor.c : 250 ] RSSI_MONITOR_ARBITER: vdevid=%d, client=%u, rssi_threshold_type=%u, low_rssi_threshold=%d, high_rssi_threshold=%d, configure_low_rssi_thresh=%u, configure_high_rssi_thresh=%u +4122,iIiIiIii,[ wlan_rssi_monitor.c : 311 ] RSSI_MONITOR_ARBITER_CONFIG_HW: vdevid=%d, configure_low_rssi_thresh=%u, final_low_rssi_thresh=%d, configure_high_rssi_thresh=%u, final_high_rssi_thresh=%d, rssi_weight=%u low client:%d high client:%d +4121,ii,[ wlan_rssi_monitor.c : 163 ] RSSI_MONITOR_CHECK_AND_DELIVER_EVENT: vdevid=%d, current_rssi=%d +4120,iIII,[ wlan_rssi_monitor.c : 145 ] RSSI_MONITOR_DELIVER_EVENT: vdevid=%d, client=%u, evt_type=%u, cb_fn=%#x +4119,iII,[ wlan_rssi_monitor.c : 419 ] RSSI_MONITOR_DISABLE_THRESHOLDS_CLIENT_REQ: vdevid=%d, client=%u, rssi_threshold_type=%u +4118,iI,[ wlan_rssi_monitor.c : 424 ] RSSI_MONITOR_DISABLE_THRESHOLDS_CLIENT_REQ_ERR(!vdev_rssi_monitor): vdevid=%d, client=%u +4117,iIIii,[ wlan_rssi_monitor.c : 343 ] RSSI_MONITOR_ENABLE_THRESHOLDS_CLIENT_REQ: vdevid=%d, client=%u, rssi_threshold_type=%u, low_rssi_threshold=%d, high_rssi_threshold=%d +4116,iI,[ wlan_rssi_monitor.c : 348 ] RSSI_MONITOR_ENABLE_THRESHOLDS_CLIENT_REQ_ERR(!vdev_rssi_monitor): vdevid=%d, client=%u +4115,iI,[ wlan_rssi_monitor.c : 391 ] RSSI_MONITOR_ENABLE_THRESHOLDS_CLIENT_REQ_ERR(!client_data): vdevid=%d, client=%u +4114,iii,[ wlan_rssi_monitor.c : 52 ] RSSI_MONITOR_GET_BEACON_RSSI_AVG: vdevid=%d, rssi_avg=%d, mac_id=%d +4113,iI,[ wlan_rssi_monitor.c : 461 ] RSSI_MONITOR_HW_EVENT: vdevid=%d, event_type=%x +4112,i,[ wlan_rssi_monitor.c : 475 ] RSSI_MONITOR_HW_EVENT(!low_rssi_threshold_configured): vdevid=%d +4111,i,[ wlan_rssi_monitor.c : 492 ] RSSI_MONITOR_HW_EVENT(!high_rssi_threshold_configured): vdevid=%d +4110,iIIiii,[ wlan_rssi_monitor.c : 119 ] RSSI_MONITOR_UPDATE_BEACON_RSSI: vdevid=%d, mac_id=%u, rssi_last=%u, rssi_avg_last=%d rssi_new=%d rssi_avg_new=%d +4109,iIIiii,[ wlan_rssi_monitor.c : 123 ] RSSI_MONITOR_UPDATE_BEACON_RSSI: vdevid=%d, mac_id=%u, rssi_last=%u, rssi_avg_last=%d rssi_new=%d rssi_avg_new=%d +4108,iI,[ wlan_rssi_monitor.c : 512 ] RSSI_MONITOR_VDEV_EVENT: vdevid=%d, notif=%u +4107,i,[ wlan_rssi_monitor.c : 596 ] RSSI_MONITOR_VDEV_FREE: vdevid=%d +4106,i,[ wlan_rssi_monitor.c : 584 ] RSSI_MONITOR_VDEV_INIT: vdevid=%d +4131,ii,[ wlan_opmode.c : 76 ] WLAN_OPMODE_SET_PMAC_LATENCY: mac_id=%d, opmode_latency=%d +4130,ii,[ wlan_opmode.c : 85 ] WLAN_OPMODE_SET_PMAC_LATENCY: mac_id=%d, opmode_latency=%d [!WAL_EOK returned] +4129,iiii,[ wlan_opmode.c : 142 ] WLAN_OPMODE_UPDATE_PMAC_LATENCY: mac_id=%d, final_latency=%d, power_state=%d, is_pmac_idle=%d +4128,i,[ wlan_opmode.c : 259 ] WLAN_OPMODE_VDEV_FREE: vdev_id=%d +4127,i,[ wlan_opmode.c : 243 ] WLAN_OPMODE_VDEV_INIT: vdev_id=%d +4126,i,[ wlan_opmode.c : 250 ] WLAN_OPMODE_VDEV_INIT: vdev_id=%d [!A_OK returned] +4125,iI,[ wlan_opmode.c : 157 ] WLAN_OPMODE_WAL_PDEV_EVT: pmac_id=%d, event=0x%x +4124,ii,[ wlan_opmode.c : 182 ] WLAN_OPMODE_VDEV_EVT: vdev_id=%d, event=%d +4140,ii,[ wlan_pm_arbiter.c : 486 ] wlan_pm_arbiter_dump_wake_stats: mac_id=%d, ModuleID=%d +4139,iii,[ wlan_pm_arbiter.c : 471 ] wlan_pm_arbiter_req_migration: vdevid=%d, old_mac_id=%d, new_mac_id=%d +4138,iiiIiiI,[ wlan_pm_arbiter.c : 763 ] PS_STA_PM_ARB_REQUEST: vdev_id=%d, mac_id=%d, ModuleID=%d, Flags=0x%x, LastRequestTime=%d, Request=%d pm_arb_req_handle = 0x%x +4137,IIII,[ wlan_pm_arbiter.c : 770 ] Updated wake lock module bitmask, bitmask[0]=0x%x, bitmask[1]=0x%x, bitmask[2]=0x%x, bitmask[3]=0x%x +4136,ii,[ wlan_pm_arbiter.c : 334 ] PS_STA_PM_ARB_RESOLVE: macid=%d, power_state=%d +4135,ii,[ wlan_pm_arbiter.c : 638 ] wake_monitor mac:%d win_len:%dms +4134,iiiiii,[ wlan_pm_arbiter.c : 682 ] wake_monitor mac:%d s_list mod:%d vdev:%d total_time:%dms total_cnt:%d max_time:%dms +4133,iiiiii,[ wlan_pm_arbiter.c : 661 ] wake_monitor mac:%d w_list mod:%d vdev:%d total_time:%dms total_cnt:%d max_time:%dms +4132,iii,[ wlan_pm_arbiter.c : 422 ] wlan_pm_arbiter_vdev_migration: vdevid=%d, old_mac_id=%d, new_mac_id=%d +4145,iiiIi,[ wlan_powersave_ap.c : 2320 ] AP_PS_DBGID_DELIVER_CAB vdev_id = %d Tid = %d NumMPDU = %d Flags = 0x%x RetryOther = %d +4144,i,[ wlan_powersave_ap.c : 2258 ] AP_PS_DBGID_CAB_FINISH vdev_id = %d +4143,i,[ wlan_powersave_ap.c : 2414 ] AP_PS_DBGID_START_CAB vdev_id = %d +4142,i,[ wlan_powersave_ap.c : 3136 ] AP_PS_DBGID_VDEV_CREATION_FAILURE AP PS:vdev_id = %d vdev alloc failed +4141,Ii,[ wlan_powersave_ap.c : 3343 ] AP_PS_DBGID_HOST_TX_PAUSE vdev_map = %0x, pause: %d +4162,iiiiiI,[ wlan_powersave_sta.c : 2729 ] PS_STA_PSPOLL_SEQ_DONE vdev_id = %d QueueTime = %d CompleteTime = %d ResponseTime = %d ResponseDuration = %d ResponseFrameCtrl/QosCtrl = 0x%x +4161,,[ wlan_powersave_sta.c : 1454 ] sta_handle POOL ALLOC FAILURE +4160,iii,[ wlan_powersave_sta.c : 1861 ] PS_STA_DELIVER_EVENT vdev_id = %d EventType = %d Statue = %d +4159,ii,[ wlan_powersave_sta.c : 3337 ] wlan_ps_sta_enable_disable_dbg_logs vdev_id = %d, enable = %d +4158,iI,[ wlan_powersave_sta.c : 2991 ] STA PS: wlan_ps_sta_health_monitor_timeout: vdev_id=%d sta_flags=0x%X +4157,iI,[ wlan_powersave_sta.c : 1702 ] wlan_ps_sta_pause: vdev_id=%d, timeout_us=%u +4156,iiIi,[ wlan_powersave_sta.c : 1780 ] PS_STA_PSPOLL_ALLOW vdev_id = %d Allow = %d Flags = 0x%x Time = %d +4155,iiIIII,[ wlan_powersave_sta.c : 1009 ] PS_STA_RESYNC vdev_id = %d VDevUpCnt = %d IsBTConnected = 0x%x Flags = 0x%x VDevSubMode = 0x%x BitMap = 0x%x +4154,ii,[ wlan_powersave_sta.c : 2599 ] PS_STA_COEX_MODE vdev_id = %d Enable = %d +4153,ii,[ wlan_powersave_sta.c : 2610 ] PS_STA_WOW_MODE vdev_id = %d Enable = %d +4152,iII,[ wlan_powersave_sta.c : 1936 ] PS_STA_SET_PARAM vdev_id = %d param = 0x%x value = 0x%x +4151,i,[ wlan_powersave_sta.c : 736 ] STA PS vdev_id = %d, No buffers available for null frames +4150,ii,[ wlan_powersave_sta.c : 871 ] PS_STA_INACTIVITY_INFO ITO picked = %d us, current ITO = %d, +4149,i,[ wlan_powersave_sta.c : 1750 ] wlan_ps_sta_unpause: vdev_id=%d +4148,Iiii,[ wlan_powersave_sta.c : 2913 ] STA PS: VOWiFi: voip_notify: vdev_id=%u, vo_call_start=%d, intvl_ms=%d media_quality=%d +4147,ii,[ wlan_powersave_sta.c : 2447 ] PS_STA_UAPSD_AUTO_TRIG VdevID = %d NumAC = %d +4146,iiiiii,[ wlan_powersave_sta.c : 2468 ] PS_STA_UAPSD_AUTO_TRIG_PER_AC vdev_id = %d WMM_AC = %d UserPriority = %d SrvIntl = %d SuspIntl = %d DelayIntl = %d +4171,ii,[ wlan_powersave_sta_sm.c : 668 ] wlan_ps_sta_data_activity_pending: vdev_id=%d, inactive_time_us=%d +4170,ii,[ wlan_powersave_sta_sm.c : 1342 ] wlan_ps_sta_state_pause_event: vdev id = %d, pause_stat_rx_frms_leaked = %d +4169,iii,[ wlan_powersave_sta_sm.c : 3361 ] SPEC_PSPOLL_TIMEOUT: vdevid=%d, spec=%d, timeout=%d +4168,iiii,[ wlan_powersave_sta_sm.c : 2823 ] sleep_awake_event_rx: MD=%d, pspoll_count=%d, is_qos_null:%d, nodata_count=%d +4167,iiii,[ wlan_powersave_sta_sm.c : 2828 ] sleep_awake_event_rx: is_qos_null:%d, wakeup_dur=%d, nodata_count=%d, max_count=%d +4166,,[ wlan_powersave_sta_sm.c : 3072 ] total_spec_pspoll_count reaches MAX: reset it +4165,iIIiI,[ wlan_powersave_sta_sm.c : 378 ] wlan_ps_sta_tx_sent_send_nullfunc: vdevid=%d, force_ps=0X%x, sta_handle=%p, peer_type=%d, blocked_tids=0X%x +4164,ii,[ wlan_powersave_sta_sm.c : 1824 ] PS_STA_SPECPOLL_TIMER_STARTED vdev_id = %d SpecPsPollNoDataCnt = %d +4163,i,[ wlan_powersave_sta_sm.c : 1837 ] PS_STA_SPECPOLL_TIMER_STOPPED: vdev_id = %d +4224,iiiiiii,[ wlan_smps.c : 2412 ] STA_SMPS_VHT_OP_MODE_NOTIF_PEER_COMPLETE : vdevid = %d peerid = %d completion_status = %d peer_smps_frames_sent_mask = %d vedevNotif = %dsm_power_control = %d, vcLastSMpwrCntrl = %d +4223,i,[ wlan_smps.c : 2481 ] SMPS Action TX frame not sent, attemps:%d +4222,ii,[ wlan_smps.c : 2488 ] SMPS action frame attempt mask %d smps_power_control %d +4221,,[ wlan_smps.c : 2654 ] SMPS_AP Action frame could not send BW OMN notification connection is not VHT +4220,i,[ wlan_smps.c : 2695 ] SMPS Action TX frame not sent, attemps:%d +4219,iii,[ wlan_smps.c : 2542 ] STA_SMPS_SEND_VHT_OPMODE_NOTIF_FRAME_TO_PEER vdevid = %d peerid = %d ret_value = %d +4218,i,[ wlan_smps.c : 4323 ] SMPS Build Operation mode notification IE: enable = %d +4217,,[ wlan_smps.c : 3462 ] wlan_smps_cfg_change_timeout + +4216,iii,[ wlan_smps.c : 3604 ] wlan_smps_cfg_notify_done: status:%d, stage:%d->0 smps_cfg_notify_compl_args.ctxt=%d +4215,iiiIi,[ wlan_smps.c : 3638 ] wlan_smps_chainmask_change_handle_done: status:%d, stage:%d->0,smps_cfg_notify_compl_args.ctxt=%d cur_chain_h16/next_chain=0x%x,smstate:%d +4214,,[ wlan_smps.c : 3293 ] wlan_smps_vc_cfg_notify queued cfg + +4213,iI,[ wlan_smps.c : 4347 ] SMPS get Operation mode notification IE length %d %p +4212,ii,[ wlan_smps.c : 1299 ] wlan_smps_get_peer_bandwidth channel_width = %d, peer_bw = %d +4211,ii,[ wlan_smps.c : 2783 ] STA_SMPS_CREATE_NON_STA_INSTANCE vdevid = %d smps_handle = %d +4210,ii,[ wlan_smps.c : 2794 ] STA_SMPS_DELETE_NON_STA_INSTANCE : vdevid = %d smps_handle = %d +4209,iii,[ wlan_smps.c : 2052 ] STA_SMPS_DTIM_CHMASK_UPDATE_AWAKE : tx_chainmask = %d rx_chainmask = %d orig_rx_chainmask = %d +4208,ii,[ wlan_smps.c : 2057 ] DTIM_UPDATE_CHAIN_ON_AWAKE: update chain in single chain, hwchain=%d, new=%d +4207,i,[ wlan_smps.c : 2024 ] wlan_smps_pdev_update_dtim_chmask_on_sleep RSSI_INDICATION = %d +4206,I,[ wlan_smps.c : 3563 ] wlan_smps_set_current_cfg vdev level notification hence no update vdev_map = 0x%x +4205,i,[ wlan_smps.c : 2312 ] STA_SMPS_CREATE_STA_INSTANCE : sta_handle = %d +4204,i,[ wlan_smps.c : 2335 ] STA_SMPS_DELETE_STA_INSTANCE : sta_handle = %d +4203,,[ wlan_smps.c : 1451 ] SMPS_STA Action frame could not send BW OMN/OMI notification connection is not VHT +4202,,[ wlan_smps.c : 1496 ] SMPS_STA Action frame could not send BW OMN/OMI notification wrong rx NSS +4201,,[ wlan_smps.c : 1506 ] SMPS_STA Action frame could not send BW OMN/OMI notification wrong tx NSS +4200,,[ wlan_smps.c : 1511 ] wlan_smps_sta_send_action_frame IEEE80211_NODE_HE +4199,ii,[ wlan_smps.c : 1549 ] SMPS_STA Action frame send power_control: %d ret_value:%d +4198,iIIiIi,[ wlan_smps.c : 4049 ] wlan_smps_vc_cfg_notify : arg %d req rx_chainmask = 0x%x currVCrxnss = 0x%xnew_channel_width = %d , updatecfg= 0x%x, is_vdev_notif = %d +4197,I,[ wlan_smps.c : 4063 ] SMPS not supported on current channel 0x%x +4196,iIi,[ wlan_smps.c : 4071 ] wlan_smps_vc_cfg_notify vc_handle->cfg_change_stage=%d, new_cfg.update_cf=%x, new_cfg.vdev_map = %d +4195,,[ wlan_smps.c : 4085 ] wlan_smps_rejecting_queuing, something is already queued + +4194,Ii,[ wlan_smps.c : 4108 ] wlan_smps_vc_cfg_notify queued cb = 0x%x, ret = %d +4193,i,[ wlan_smps.c : 4118 ] invalid smps cfg notification value new_cfg.channel_width = %d +4192,,[ wlan_smps.c : 4158 ] SMPS_CFG_CHANGE_NOTIFY: rejected due to duplicate request +4191,IiI,[ wlan_smps.c : 4243 ] SMPS_CFG_CHANGE_NOTIFY: ONLY CFG PARAM CHANGE mhz: 0x%x, ret = %d, Notification mask = 0x%x +4190,Iiiii,[ wlan_smps.c : 4254 ] SMPS_CFG_CHANGE_NOTIFY: mhz: 0x%x, ret = %d, prev_vc_rx_chain_mode: %d, next_vc_rx_chain_mode: %d, chain_mask_change_stage: %d +4189,I,[ wlan_smps.c : 4256 ] SMPS_CFG_CHANGE_NOTIFY: Invalid VC handle %p +4188,iiIIII,[ wlan_smps.c : 3894 ] invalid smps cfg notification requested ul_disablemu = %d, channel_width = %d rx_chainmask = 0x%x, tx_chainmask = 0x%x, update cfg = %x, vdev map = %x +4187,I,[ wlan_smps.c : 3973 ] vdev level notification is requested = 0x%x +4186,iiiii,[ wlan_smps.c : 891 ] STA_SMPS_VC_ACTION_FRAME_TX_COMPL_OLD_DBG : power control = %d vc_handle->last_frame_sm_pwr_ctrl = %d completion status = %d current_state = %d vc_handle->cfg_change_stage = %d +4185,iI,[ wlan_smps.c : 895 ] STA_SMPS_VC_ACTION_FRAME_TX_COMPL Additional params: prev_forced_mode = %d channel mhz = 0x%x +4184,,[ wlan_smps.c : 993 ] STA_SMPS_VC_ACTION_FRAME_TX_COMPL : incorrect state readjustment + +4183,,[ wlan_smps.c : 1024 ] STA_SMPS_VC_ACTION_FRAME_TX_COMPL : fallback on legacy SMPS configuration + +4182,i,[ wlan_smps.c : 1086 ] STA_SMPS_VC_ACTION_FRAME_TX_COMPL : action_valid = %d + +4181,,[ wlan_smps.c : 1098 ] wlan_smps_vc_cfg_notify queued cfg + +4180,i,[ wlan_smps.c : 2877 ] STA_SMPS_CREATE_VIRTUAL_CHAN_INSTANCE : vc_handle = %d +4179,i,[ wlan_smps.c : 2953 ] STA_SMPS_DELETE_VIRTUAL_CHAN_INSTANCE : vc_handle = %d +4178,ii,[ wlan_smps.c : 340 ] STA_SMPS_VIRTUAL_CHAN_SMPS_START : vc_handle = %d, vc_handle->enabled = %d +4177,ii,[ wlan_smps.c : 357 ] SMPSVC CHNL START : STA_SMPS_INVALID_SM_EVENT event = %d dynamicSMPSSupported = %d +4176,ii,[ wlan_smps.c : 387 ] STA_SMPS_VIRTUAL_CHAN_SMPS_STOP : vc_handle = %d, vc_handle->enabled = %d +4175,iiiiii,[ wlan_smps.c : 415 ] wlan_smps_virtual_chan_update : vc_handle = %d, vc_handle->enabled = %d,vc_handle->cfg_notification_mode = %d, vc_handle->fw_forced_mode =%d , vc_handle->host_forced_mode = %d, smps_cur_state = %d +4174,,[ wlan_smps.c : 449 ] wlan_smps_virtual_chan_update : smps action frame sent +4173,,[ wlan_smps.c : 444 ] wlan_smps_virtual_chan_update : smps restarted +4172,i,[ wlan_smps.c : 1704 ] wlan_smps_virtual_chan_update_dtim_chmask WAL_PM_MAC_PARAM_RSSI_INDICATION = %d +4225,ii,[ wlan_smps_sm.c : 186 ] SMPS_STATE_STATIC_EVENT: chain: %d, dropped ev:%d +4245,ii,[ wlan_twt.c : 334 ] wlan_twt_wmi_add_dialog: vdev_id=%d, id=%d +4244,iii,[ wlan_twt.c : 428 ] wlan_twt_wmi_add_dialog_complete_event: vdev=%d, id=%d, status=%d +4243,ii,[ wlan_twt.c : 745 ] wmi_twt_btwt_invite_sta: vdev_id=%d, id=%d +4242,III,[ wlan_twt.c : 752 ] AP TWT: Cant find peer: lsb_mac=%x:%x:%x +4241,III,[ wlan_twt.c : 760 ] wlan_twt_wmi_btwt_invite_sta: WMI_PEER_TYPE_SELF: lsb_mac=%x:%x:%x +4240,iii,[ wlan_twt.c : 785 ] wlan_twt_wmi_btwt_invite_sta_complete_event: vdev=%d, id=%d, status=%d +4239,ii,[ wlan_twt.c : 828 ] wmi_twt_btwt_remove_sta: vdev_id=%d, id=%d +4238,III,[ wlan_twt.c : 835 ] AP TWT: Cant find peer: lsb_mac=%x:%x:%x +4237,III,[ wlan_twt.c : 843 ] wlan_twt_wmi_btwt_remove_sta: WMI_PEER_TYPE_SELF: lsb_mac=%x:%x:%x +4236,iii,[ wlan_twt.c : 868 ] wlan_twt_wmi_btwt_remove_sta_complete_event: vdev=%d, id=%d, status=%d +4235,iii,[ wlan_twt.c : 502 ] wlan_twt_wmi_del_dialog: vdev_id=%d, id=%d, b_twt_persistence=%d +4234,iii,[ wlan_twt.c : 540 ] wlan_twt_wmi_del_dialog_complete_event: vdev=%d, id=%d, status=%d +4233,iI,[ wlan_twt.c : 235 ] wlan_twt_wmi_disable: pdev_id=%d, flags=0x%x +4232,i,[ wlan_twt.c : 280 ] wlan_twt_wmi_disable_complete_event: pdev_id=%d +4231,iiI,[ wlan_twt.c : 120 ] wlan_twt_wmi_enable: pdev_id=%d, sta_cong_timer_ms=%d, pdev-flags=0x%x +4230,ii,[ wlan_twt.c : 163 ] wlan_twt_wmi_enable_complete_event: pdev_id=%d, status=%d +4229,ii,[ wlan_twt.c : 581 ] wlan_twt_wmi_pause_dialog: vdev_id=%d, id=%d +4228,iii,[ wlan_twt.c : 614 ] wlan_twt_wmi_pause_dialog_complete_event: vdev=%d, id=%d, status=%d +4227,iii,[ wlan_twt.c : 655 ] wlan_twt_wmi_resume_dialog: vdev_id=%d, id=%d, next_twt_size=%d +4226,iii,[ wlan_twt.c : 700 ] wlan_twt_wmi_resume_dialog_complete_event: vdev=%d, id=%d, status=%d +4246,iii,[ wlan_twt_protocol.c : 236 ] wlan_twt_action_frame_handler: cat=%d, act=%d, len=%d +4251,III,[ wlan_twt_ap.c : 259 ] AP TWT: Cant find peer lsb_mac=%x:%x:%x +4250,i,[ wlan_twt_ap.c : 491 ] AP TWT: Vdev id = %d not TWT enabled +4249,i,[ wlan_twt_ap.c : 889 ] AP TWT: Vdev id = %d not TWT enabled +4248,i,[ wlan_twt_ap.c : 647 ] AP TWT: peer id = %d not TWT enabled +4247,i,[ wlan_twt_ap.c : 824 ] AP TWT: Vdev id = %d not TWT enabled +4255,iiiiiiii,[ wlan_twt_unit_test.c : 745 ] wlan_twt_unit_test: vdev_id=%d, num_args=%d, type=%d, args:%d-%d-%d-%d-%d +4254,i,[ wlan_twt_unit_test.c : 748 ] vdev == NULL: %d +4253,i,[ wlan_twt_unit_test.c : 749 ] !vdev->ifUp, %d +4252,III,[ wlan_twt_unit_test.c : 492 ] AP TWT: Cant find peer: lsb_mac=%x:%x:%x +4367,I,[ hca_HwComponentRf_bdf_v1.cpp : 88 ] %s NOT available + +4366,I,[ hca_HwComponentRf_bdf_v1.cpp : 38 ] %s NOT available + +4365,I,[ hca_HwComponentRf_bdf_v1.cpp : 96 ] %s NOT available + +4364,I,[ hca_HwComponentRf_bdf_v1.cpp : 79 ] %s NOT available + +4363,I,[ hca_HwComponentRf_bdf_v1.cpp : 115 ] %s NOT available + +4362,I,[ hca_HwComponentRf_bdf_v1.cpp : 70 ] %s NOT available + +4361,I,[ hca_HwComponentRf_bdf_v1.cpp : 60 ] %s NOT available + +4360,I,[ hca_HwComponentRf_bdf_v1.cpp : 77 ] %s NOT available + +4359,I,[ hca_HwComponentRf_bdf_v1.cpp : 64 ] %s NOT available + +4358,I,[ hca_HwComponentRf_bdf_v1.cpp : 71 ] %s NOT available + +4357,I,[ hca_HwComponentRf_bdf_v1.cpp : 89 ] %s NOT available + +4356,I,[ hca_HwComponentRf_bdf_v1.cpp : 76 ] %s NOT available + +4355,I,[ hca_HwComponentRf_bdf_v1.cpp : 105 ] %s NOT available + +4354,I,[ hca_HwComponentRf_bdf_v1.cpp : 129 ] %s NOT available + +4353,I,[ hca_HwComponentRf_bdf_v1.cpp : 91 ] %s NOT available + +4352,I,[ hca_HwComponentRf_bdf_v1.cpp : 75 ] %s NOT available + +4351,I,[ hca_HwComponentRf_bdf_v1.cpp : 45 ] %s NOT available + +4350,I,[ hca_HwComponentRf_bdf_v1.cpp : 95 ] %s NOT available + +4349,I,[ hca_HwComponentRf_bdf_v1.cpp : 51 ] %s NOT available + +4348,I,[ hca_HwComponentRf_bdf_v1.cpp : 40 ] %s NOT available + +4347,I,[ hca_HwComponentRf_bdf_v1.cpp : 65 ] %s NOT available + +4346,I,[ hca_HwComponentRf_bdf_v1.cpp : 81 ] %s NOT available + +4345,I,[ hca_HwComponentRf_bdf_v1.cpp : 78 ] %s NOT available + +4344,I,[ hca_HwComponentRf_bdf_v1.cpp : 92 ] %s NOT available + +4343,I,[ hca_HwComponentRf_bdf_v1.cpp : 101 ] %s NOT available + +4342,I,[ hca_HwComponentRf_bdf_v1.cpp : 69 ] %s NOT available + +4341,I,[ hca_HwComponentRf_bdf_v1.cpp : 100 ] %s NOT available + +4340,I,[ hca_HwComponentRf_bdf_v1.cpp : 99 ] %s NOT available + +4339,I,[ hca_HwComponentRf_bdf_v1.cpp : 116 ] %s NOT available + +4338,I,[ hca_HwComponentRf_bdf_v1.cpp : 128 ] %s NOT available + +4337,I,[ hca_HwComponentRf_bdf_v1.cpp : 73 ] %s NOT available + +4336,I,[ hca_HwComponentRf_bdf_v1.cpp : 39 ] %s NOT available + +4335,I,[ hca_HwComponentRf_bdf_v1.cpp : 50 ] %s NOT available + +4334,I,[ hca_HwComponentRf_bdf_v1.cpp : 80 ] %s NOT available + +4333,I,[ hca_HwComponentRf_bdf_v1.cpp : 63 ] %s NOT available + +4332,I,[ hca_HwComponentRf_bdf_v1.cpp : 55 ] %s NOT available + +4331,I,[ hca_HwComponentRf_bdf_v1.cpp : 46 ] %s NOT available + +4330,I,[ hca_HwComponentRf_bdf_v1.cpp : 67 ] %s NOT available + +4329,I,[ hca_HwComponentRf_bdf_v1.cpp : 74 ] %s NOT available + +4328,I,[ hca_HwComponentRf_bdf_v1.cpp : 44 ] %s NOT available + +4327,I,[ hca_HwComponentRf_bdf_v1.cpp : 68 ] %s NOT available + +4326,I,[ hca_HwComponentRf_bdf_v1.cpp : 42 ] %s NOT available + +4325,I,[ hca_HwComponentRf_bdf_v1.cpp : 58 ] %s NOT available + +4324,I,[ hca_HwComponentRf_bdf_v1.cpp : 102 ] %s NOT available + +4323,I,[ hca_HwComponentRf_bdf_v1.cpp : 41 ] %s NOT available + +4322,I,[ hca_HwComponentRf_bdf_v1.cpp : 90 ] %s NOT available + +4321,I,[ hca_HwComponentRf_bdf_v1.cpp : 57 ] %s NOT available + +4320,I,[ hca_HwComponentRf_bdf_v1.cpp : 56 ] %s NOT available + +4319,I,[ hca_HwComponentRf_bdf_v1.cpp : 110 ] %s NOT available + +4318,I,[ hca_HwComponentRf_bdf_v1.cpp : 103 ] %s NOT available + +4317,I,[ hca_HwComponentRf_bdf_v1.cpp : 61 ] %s NOT available + +4316,I,[ hca_HwComponentRf_bdf_v1.cpp : 93 ] %s NOT available + +4315,I,[ hca_HwComponentRf_bdf_v1.cpp : 43 ] %s NOT available + +4314,I,[ hca_HwComponentRf_bdf_v1.cpp : 107 ] %s NOT available + +4313,I,[ hca_HwComponentRf_bdf_v1.cpp : 114 ] %s NOT available + +4312,I,[ hca_HwComponentRf_bdf_v1.cpp : 111 ] %s NOT available + +4311,I,[ hca_HwComponentRf_bdf_v1.cpp : 106 ] %s NOT available + +4310,I,[ hca_HwComponentRf_bdf_v1.cpp : 47 ] %s NOT available + +4309,I,[ hca_HwComponentRf_bdf_v1.cpp : 48 ] %s NOT available + +4308,I,[ hca_HwComponentRf_bdf_v1.cpp : 109 ] %s NOT available + +4307,I,[ hca_HwComponentRf_bdf_v1.cpp : 82 ] %s NOT available + +4306,I,[ hca_HwComponentRf_bdf_v1.cpp : 83 ] %s NOT available + +4289,I,[ hca_HwComponentRf_bdf_v1.cpp : 118 ] %s NOT available + +4305,I,[ hca_HwComponentRf_bdf_v1.cpp : 126 ] %s NOT available + +4304,I,[ hca_HwComponentRf_bdf_v1.cpp : 72 ] %s NOT available + +4303,I,[ hca_HwComponentRf_bdf_v1.cpp : 104 ] %s NOT available + +4290,I,[ hca_HwComponentRf_bdf_v1.cpp : 119 ] %s NOT available + +4302,I,[ hca_HwComponentRf_bdf_v1.cpp : 85 ] %s NOT available + +4301,I,[ hca_HwComponentRf_bdf_v1.cpp : 112 ] %s NOT available + +4300,I,[ hca_HwComponentRf_bdf_v1.cpp : 113 ] %s NOT available + +4299,I,[ hca_HwComponentRf_bdf_v1.cpp : 66 ] %s NOT available + +4298,I,[ hca_HwComponentRf_bdf_v1.cpp : 62 ] %s NOT available + +4297,I,[ hca_HwComponentRf_bdf_v1.cpp : 84 ] %s NOT available + +4296,I,[ hca_HwComponentRf_bdf_v1.cpp : 94 ] %s NOT available + +4295,I,[ hca_HwComponentRf_bdf_v1.cpp : 108 ] %s NOT available + +4294,I,[ hca_HwComponentRf_bdf_v1.cpp : 52 ] %s NOT available + +4293,I,[ hca_HwComponentRf_bdf_v1.cpp : 86 ] %s NOT available + +4292,I,[ hca_HwComponentRf_bdf_v1.cpp : 59 ] %s NOT available + +4291,I,[ hca_HwComponentRf_bdf_v1.cpp : 37 ] %s NOT available + +4287,i,[ hca_HwComponentRf_bdf_v1.cpp : 2540 ] RTT - Invalid preamble: %d; return 0 delays +4286,iiiiiiii,[ hca_HwComponentRf_bdf_v1.cpp : 2553 ] RTT - phy%d chainNum: %d txRxIdx: %d, dynBw: %d, preamble: %d, heLtf: %d, pktBw: %d, whalRate: %d +4285,i,[ hca_HwComponentRf_bdf_v1.cpp : 2564 ] RTT - base=%d +4284,ii,[ hca_HwComponentRf_bdf_v1.cpp : 2568 ] RTT - freq %d, delta=%d +4283,i,[ hca_HwComponentRf_bdf_v1.cpp : 2574 ] RTT - pri20, delta=%d +4282,ii,[ hca_HwComponentRf_bdf_v1.cpp : 2582 ] RTT - chain %d delta=%d +4281,i,[ hca_HwComponentRf_bdf_v1.cpp : 2589 ] RTT - IQ, delta=%d +4280,i,[ hca_HwComponentRf_bdf_v1.cpp : 2594 ] RTT - LCP, delta=%d +4279,i,[ hca_HwComponentRf_bdf_v1.cpp : 2605 ] RTT - heavyclip, delta=%d +4278,i,[ hca_HwComponentRf_bdf_v1.cpp : 2610 ] RTT - DPD PEF, delta=%d +4277,i,[ hca_HwComponentRf_bdf_v1.cpp : 2615 ] RTT - Tx DAC, delta=%d +4276,i,[ hca_HwComponentRf_bdf_v1.cpp : 2624 ] RTT - Ti ADC, delta=%d +4275,i,[ hca_HwComponentRf_bdf_v1.cpp : 2629 ] RTT - VSRC, delta=%d +4274,i,[ hca_HwComponentRf_bdf_v1.cpp : 2634 ] RTT - spur mit, delta=%d +4273,,[ hca_HwComponentRf_bdf_v1.cpp : 2643 ] RTT - apply 2G 6us offset + +4272,i,[ hca_HwComponentRf_bdf_v1.cpp : 2648 ] RTT - delayPs=%d ps +4271,,[ hca_HwComponentRf_bdf_v1.cpp : 2723 ] NEED to implement GetTpcCalFreq in chip specific class +4270,iiI,[ hca_HwComponentRf_bdf_v1.cpp : 565 ] ccaThresh:%d deltaNF:%d reg:%x +4269,,[ hca_HwComponentRf_bdf_v1.cpp : 3666 ] FTM CALDB: Skipping regeneration of CALDB: + +4268,,[ hca_HwComponentRf_bdf_v1.cpp : 3668 ] FTM CALDB: NOT Skipping regeneration of CALDB: + +4267,,[ hca_HwComponentRf_bdf_v1.cpp : 2802 ] TPC_CTL: STBC type and NSS was 1 for NTx >= 2 so setting NSS 2 + +4266,,[ hca_HwComponentRf_bdf_v1.cpp : 2808 ] TPC_CTL: STBC type but NSS was not 1 + +4265,ii,[ hca_HwComponentRf_bdf_v1.cpp : 2511 ] RTT - pktBw %d is not valid in dynamicBw %d +4264,III,[ hca_HwComponentRf_bdf_v1.cpp : 1922 ] sticky - add 0x%08lx, flag 0x%08lx, val 0x%08lx +4263,iii,[ hca_HwComponentRf_bdf_v1.cpp : 2384 ] GetCalVersionDetails:: SWCAL DEBUG swCalVersion =%d, boardCalVersion=%d, calStatus=%d +4262,i,[ hca_HwComponentRf_bdf_v1.cpp : 2091 ] returning from phyrf_bdf_GetRxGainCalCfgLocalByBand: %d + +4261,iiii,[ hca_HwComponentRf_bdf_v1.cpp : 3164 ] DumpTpcPerPacket: Get regulatory pwr EIRP: %d, is PSD: %d, New regdb WMI call: %d, curr_BW:%d + +4260,iii,[ hca_HwComponentRf_bdf_v1.cpp : 3240 ] DumpTpcPerPacket: Get regulatory Final combined power : %d CurrBW: %d, isValidTxPwr: %d + +4259,I,[ hca_HwComponentRf_bdf_v1.cpp : 346 ] WHAL_ERROR_EEPROM_MACADDR - sum = %lx + +4258,iiii,[ hca_HwComponentRf_bdf_v1.cpp : 2484 ] tempCode ch%d = %d, calTemp %d, tempSlope %d + +4257,ii,[ hca_HwComponentRf_bdf_v1.cpp : 2488 ] ##########bdf thermCode %d, calTemp %d + +4256,i,[ hca_HwComponentRf_bdf_v1.cpp : 2492 ] ##########bdf temp slope %d + +4290,I,[ hca_HwComponentRf_bdf_v1.cpp : 119 ] %s NOT available + +4289,I,[ hca_HwComponentRf_bdf_v1.cpp : 118 ] %s NOT available + +4288,I,[ hca_HwComponentRf_bdf_v1.cpp : 142 ] %s NOT available + +4371,I,[ phy_dev_calUtils.c : 259 ] otpRead: otp_read_en = 0x%08x +4370,i,[ phy_dev_calUtils.c : 264 ] Invalid OTP_WORD[=%d]. +4369,,[ phy_dev_calUtils.c : 319 ] Recipe failure +4368,I,[ phy_dev_calUtils.c : 320 ] [trigger_cal Recipe failure=%x] +4385,i,[ phy_dev_fdmtCombCal.c : 958 ] FDMT: CAL_INFO_MEM_0: RUN %d: START +4384,i,[ phy_dev_fdmtCombCal.c : 961 ] FDMT: CAL_INFO_MEM_0: RUN %d: END +4383,i,[ phy_dev_fdmtCombCal.c : 963 ] FDMT: CAL_INFO_MEM_1: RUN %d: START +4382,i,[ phy_dev_fdmtCombCal.c : 966 ] FDMT: CAL_INFO_MEM_1: RUN %d: END +4381,II,[ phy_dev_fdmtCombCal.c : 82 ] FDMT: ADDR: 0x%08x VAL: 0x%08x +4380,i,[ phy_dev_fdmtCombCal.c : 168 ] FDMT: RXIQ: CHAIN%d-PRI: +4379,i,[ phy_dev_fdmtCombCal.c : 171 ] FDMT: RXIQ: CHAIN%d-SEC: +4378,i,[ phy_dev_fdmtCombCal.c : 174 ] FDMT: RXIQ: CHAIN%d-FCS: +4377,i,[ phy_dev_fdmtCombCal.c : 132 ] FDMT: TXCL: CHAIN%d-PRI: +4376,i,[ phy_dev_fdmtCombCal.c : 135 ] FDMT: TXCL: CHAIN%d-FCS: +4375,i,[ phy_dev_fdmtCombCal.c : 105 ] FDMT: TXDCOC: CHAIN%d-PRI-PRISYN: +4374,i,[ phy_dev_fdmtCombCal.c : 108 ] FDMT: TXDCOC: CHAIN%d-FCS-PRISYN: +4373,i,[ phy_dev_fdmtCombCal.c : 150 ] FDMT: TXIQ: CHAIN%d-PRI: +4372,i,[ phy_dev_fdmtCombCal.c : 153 ] FDMT: TXIQ: CHAIN%d-FCS: +4392,,[ phy_dev_NFCal.c : 753 ] NFCAL: Enter NFCAL Mode +4391,,[ phy_dev_NFCal.c : 767 ] NFCAL: Exit NFCAL Mode +4390,ii,[ phy_dev_NFCal.c : 741 ] NFCAL: Forcing Chain%d MINCCAPWR_PRI80_DB2 with %ddBm +4389,ii,[ phy_dev_NFCal.c : 742 ] NFCAL: Forcing Chain%d MINCCAPWR_SEC80_DB2 with %ddBm +4388,ii,[ phy_dev_NFCal.c : 579 ] NFCAL: Converged value for Chain%d MINCCAPWR_OUT_DB2 is %ddBm +4387,,[ phy_dev_NFCal.c : 68 ] NFCAL: Running Noise Floor CAL +4386,,[ phy_dev_NFCal.c : 72 ] NFCAL: Noise Floor CAL completed +4483,,[ phy_dev_paprd_device.c : 128 ] eDPD SendDpdTrainPktFtpg: Invaild PHY BW!!!! + +4482,III,[ phy_dev_paprd_device.c : 139 ] DPD SendDpdTrainPktFtpg: mcs %u, mpduLen, %u, pktBWCode, %u + +4481,i,[ phy_dev_paprd_device.c : 3949 ] -Q5-PAPRD-:channel freq %d + +4480,ii,[ phy_dev_paprd_device.c : 3950 ] -Q5-PAPRD-:txChain %d tableIndex %d + +4479,i,[ phy_dev_paprd_device.c : 3951 ] -Q5-PAPRD-:forced_sq_idx %d +4478,ii,[ phy_dev_paprd_device.c : 3952 ] -Q5-PAPRD-:sq_idx_sw %d sq_idx_hw %d + +4477,,[ phy_dev_paprd_device.c : 1447 ] Stopping phyDBG capture enable +4476,I,[ phy_dev_paprd_device.c : 1469 ] -Q5-PAPRDTUNING-:DPD training AGC2 size %lx + +4475,I,[ phy_dev_paprd_device.c : 1472 ] -Q5-PAPRDTUNING-:DPD training AGC2 pwr 0x%8lx + +4474,I,[ phy_dev_paprd_device.c : 1474 ] -Q5-PAPRDTUNING-:DPD training rx gain idx 0x%lx + +4473,I,[ phy_dev_paprd_device.c : 1478 ] -Q5-PAPRD-:DPD training active %lu + +4472,I,[ phy_dev_paprd_device.c : 1481 ] -Q5-PAPRD-:DPD training incomplete %lu + +4471,I,[ phy_dev_paprd_device.c : 1484 ] -Q5-PAPRDTUNING-:SQ index HW is %lu + +4470,i,[ phy_dev_paprd_device.c : 1496 ] -Q5-PAPRD-:DC estimate I %d + +4469,i,[ phy_dev_paprd_device.c : 1497 ] -Q5-PAPRD-:DC estimate Q %d + +4468,I,[ phy_dev_paprd_device.c : 1503 ] -Q5-PAPRD-:HW calculated stage2 min dispersion = %lu + +4467,I,[ phy_dev_paprd_device.c : 1504 ] -Q5-PAPRD-:Dispersion value at SQ Stage2 (minimum index - 1) = %lu + +4466,I,[ phy_dev_paprd_device.c : 1505 ] -Q5-PAPRD-:Dispersion value at SQ Stage2 (minimum index + 1) = %lu + +4465,II,[ phy_dev_paprd_device.c : 4035 ] --Q5--PAPRD: validmask 0x%lx phyInput->validChainMask 0x%x + +4464,,[ phy_dev_paprd_device.c : 523 ] PAPRD: HWDISABLE ALL + +4463,i,[ phy_dev_paprd_device.c : 510 ] PAPRD: HWDISABLE CHAIN : %d + +4462,i,[ phy_dev_paprd_device.c : 291 ] --Q5-PAPRD : For DPD Cal - Choosing GLUT %d + +4461,i,[ phy_dev_paprd_device.c : 301 ] --Q5-PAPRD : txMaskImprFlag %d + +4460,i,[ phy_dev_paprd_device.c : 448 ] eDPD SendDpdTrainPkt: %d + +4459,i,[ phy_dev_paprd_device.c : 806 ] -Q5-PAPRDTUNING-:DynBW = %d + +4458,,[ phy_dev_paprd_device.c : 978 ] force SQ + +4457,iI,[ phy_dev_paprd_device.c : 981 ] -Q5-PAPRDTUNING-:Forcing sq index hw for table %d with %lu + +4456,iii,[ phy_dev_paprd_device.c : 828 ] TxCount = %d table index = %d, txChina = %d + +4455,iiii,[ phy_dev_paprd_device.c : 860 ] -Q5-PAPRD : TxCount = %d table index = %d, txChina = %d, dacGain = %d + +4454,i,[ phy_dev_paprd_device.c : 875 ] -Q5 - PAPRDTUNING - :min loopback delay = %d + +4453,ii,[ phy_dev_paprd_device.c : 885 ] ADC OVRD VAL is %d with j as %d +4452,ii,[ phy_dev_paprd_device.c : 891 ] ADC OVRD VAL is %d with j as %d +4451,,[ phy_dev_paprd_device.c : 951 ] Enabling PHY DBG capture +4450,,[ phy_dev_paprd_device.c : 959 ] force SQ + +4449,,[ phy_dev_paprd_device.c : 966 ] NOT force SQ + +4448,ii,[ phy_dev_paprd_device.c : 973 ] Table Index = %d TxCount = %d + +4447,iI,[ phy_dev_paprd_device.c : 597 ] -Q5-PAPRD-:Chain = %d, Tx Cal Sub Mode = %lu + +4446,iiI,[ phy_dev_paprd_device.c : 602 ] -Q5-PAPRD-:Chain = %d, dpd Rx loop chian %d Rx Cal Sub Mode = %lu + +4445,ii,[ phy_dev_paprd_device.c : 606 ] -Q5-PAPRD-: HWIO : Tx Chain %d Attenuation value %d + +4444,ii,[ phy_dev_paprd_device.c : 611 ] -Q5-PAPRD-: HWIO : Rx Chain %d Attenuation value %d + +4443,,[ phy_dev_paprd_device.c : 748 ] -Q5-PAPRD-: phy_paprd_device_Iron_programming + +4442,II,[ phy_dev_paprd_device.c : 3329 ] Populate DPD LUT of Chain %hhu at table_idx %hhu + +4441,,[ phy_dev_paprd_device.c : 3383 ] Invalid tableOffset + +4440,,[ phy_dev_paprd_device.c : 3436 ] Invalid tableOffset + +4439,,[ phy_dev_paprd_device.c : 3442 ] Invalid tableType + +4438,iiiI,[ phy_dev_paprd_device.c : 3455 ] PAPRD:tableType: %d tableIdx: %d at even entry: %d from is : %lx + +4437,iiiI,[ phy_dev_paprd_device.c : 3457 ] PAPRD:tableType: %d tableIdx: %d at odd entry: %d from is : %lx + +4436,,[ phy_dev_paprd_device.c : 3465 ] Start Populated MemoryDPD Table! + +4435,i,[ phy_dev_paprd_device.c : 3470 ] int delay ddr x1 = %d + +4434,i,[ phy_dev_paprd_device.c : 3471 ] int delay ddr x2 = %d + +4433,i,[ phy_dev_paprd_device.c : 3472 ] int delay ddr x3 = %d + +4432,i,[ phy_dev_paprd_device.c : 3473 ] int delay ddr x4 = %d + +4431,i,[ phy_dev_paprd_device.c : 3474 ] int delay ddr x5 = %d + +4430,i,[ phy_dev_paprd_device.c : 3475 ] int delay ddr x6 = %d + +4429,,[ phy_dev_paprd_device.c : 3659 ] Invalid tableOffset + +4428,,[ phy_dev_paprd_device.c : 3683 ] Invalid tableOffset + +4427,,[ phy_dev_paprd_device.c : 3692 ] Finished populating DPD LUT into memory! +4426,,[ phy_dev_paprd_device.c : 1672 ] -Q5-PAPRD-:Read back DPD training data from memory: + +4425,ii,[ phy_dev_paprd_device.c : 1673 ] -Q5-PAPRD-:Raw Data: chain %d table %d + +4424,,[ phy_dev_paprd_device.c : 1674 ] -Q5-PAPRD-:DpdTrainData0 DpdTrainData1 DpdTrainData2 DpdTrainData3 + +4423,IIII,[ phy_dev_paprd_device.c : 1677 ] -Q5-PAPRD-:%lu %lu %lu %lu + +4422,iii,[ phy_dev_paprd_device.c : 472 ] PAPRD: Current Temp is %d Temp Threshold is %d dynGlutEn %d + +4421,iiIIii,[ phy_dev_paprd_device.c : 500 ] PAPRD:Chain = %d, tpc_index = %d, table_offset = %lu, glut_idx_offset = %lx, txgain_index = %d Power=%d + +4420,IIIII,[ phy_dev_paprd_device.c : 3883 ] -Q5-PAPRD- : RestorePreCalSettings savePreCalSettings[0] 0x%x [1] 0x%x [3] 0x%x [4] 0x%x [2] 0x%x +4419,IIIIi,[ phy_dev_paprd_device.c : 3890 ] -Q5-PAPRD- : RestorePreCalSettings TPC_FORCE_CTRL 0x%x PHYDBG_MODE 0x%x PHYDBG_CAPTURE_L 0x%x PHYDBG_CAPTURE_U 0x%x PHYDBG_TRIGGER_1_L 0x%d +4418,iI,[ phy_dev_paprd_device.c : 3894 ] -Q5-PAPRD- : RestorePreCalSettings RXBB-EN0 for Chain %d 0x%x +4417,ii,[ phy_dev_paprd_device.c : 3897 ] -Q5-PAPRD- : RestorePreCalSettings PHYRF_CAL_SEQ_CTRL_19_L %d PHYRF_CAL_MEAS_CTRL_4_U %d +4416,IIIIi,[ phy_dev_paprd_device.c : 3833 ] -Q5-PAPRD- : SavePreCalSettings TPC_FORCE_CTRL 0x%x PHYDBG_MODE 0x%x PHYDBG_CAPTURE_L 0x%x PHYDBG_CAPTURE_U 0x%x PHYDBG_TRIGGER_1_L 0x%d +4415,iI,[ phy_dev_paprd_device.c : 3837 ] -Q5-PAPRD- : SavePreCalSettings RXBB-EN0 for Chain %d 0x%x +4414,ii,[ phy_dev_paprd_device.c : 3841 ] -Q5-PAPRD- : savePreCalSettings PHYRF_CAL_SEQ_CTRL_19_L %d PHYRF_CAL_MEAS_CTRL_4_U %d +4413,i,[ phy_dev_paprd_device.c : 1038 ] agc2pwr = %d +4412,i,[ phy_dev_paprd_device.c : 1192 ] -Q5-PAPRD : StopTraining for Chain = %d + +4411,iiii,[ phy_dev_paprd_device.c : 1594 ] -Q5-PAPRD-: In training signal quality --- Bin idx %d -- accum count = %d, X value = %d, Average X = %d + +4410,i,[ phy_dev_paprd_device.c : 1602 ] -Q5-PAPRD-:Max value of Averaged X = %d + +4409,iiii,[ phy_dev_paprd_device.c : 1620 ] -Q5-PAPRD-:Bin %d chk_acc = %d, cnt = %d, diffn = %d +4408,i,[ phy_dev_paprd_device.c : 1634 ] -Q5-PAPRD-: Averaged SQ value is %d + +4407,i,[ phy_dev_paprd_device.c : 1323 ] -Q5-PAPRD : TRAINING DONE value is %d + +4406,i,[ phy_dev_paprd_device.c : 1331 ] SQ value is %d + +4405,I,[ phy_dev_paprd_device.c : 1355 ] -Q5-PAPRDTUNING-:TABLE 0 1 SQ index HW is %lu + +4404,iIi,[ phy_dev_paprd_device.c : 1371 ] -Q5-PAPRDTUNING-:sq PASS: sq_idx_sw %d sq_idx_hw %ld force_sq_idx %d + +4403,iiIi,[ phy_dev_paprd_device.c : 1379 ] -Q5-PAPRDTUNING-:sq FAIL : %d sq_idx_sw %d sq_idx_hw %ld force_sq_idx %d + +4402,,[ phy_dev_paprd_device.c : 1386 ] -Q5-PAPRD-:DPD training Failed. Paprd Done bit is not set in HW! + +4401,,[ phy_dev_paprd_device.c : 1126 ] -Q5-PAPRD-: phy_paprd_device_XmitTrainningFrame + +4400,iI,[ phy_dev_paprd_device.c : 3764 ] -Q5-PAPRD-:Exit Cal function - Chain = %d, Tx Cal Sub Mode = %lu + +4399,iiI,[ phy_dev_paprd_device.c : 3769 ] -Q5-PAPRD-:Exit Cal function - Chain = %d, dpd Rx loop chain %d Rx Cal Sub Mode = %lu + +4398,,[ phy_dev_paprd_device.c : 535 ] PAPRD: Force enable tlv + +4397,i,[ phy_dev_paprd_device.c : 767 ] PAPRD: txgain_index = %d + +4396,i,[ phy_dev_paprd_device.c : 780 ] PAPRD: dpdDacGain = %d + +4395,I,[ phy_dev_paprd_device.c : 1207 ] --Q5--PAPRDPHYDBG Base = 0x%lx + +4394,iIIII,[ phy_dev_paprd_device.c : 1244 ] --Q5--PAPRDPHYDBG-IQ %d %05d %05d %05d %05d + +4393,,[ phy_dev_paprd_device.c : 1248 ] --Q5--PAPRDPHYDBG-IQ delay 1ms +4504,iI,[ phy_dev_paprd_core.c : 642 ] phy_core_PaprdCalcGainFxp : max bins %d X[GfxpIdx] %lu + +4503,Ii,[ phy_dev_paprd_core.c : 647 ] -Q5-PAPRD : small signal gain is %ld, max_bins %d + +4502,ii,[ phy_dev_paprd_core.c : 46 ] phy_core_PaprdChangeTrainingIndex(): Change training position to chain index %d and dpd table index %d + +4501,ii,[ phy_dev_paprd_core.c : 441 ] -Q5-PAPRD : Max_index = %d, lssCount = %d +4500,I,[ phy_dev_paprd_core.c : 612 ] small signal gain is %ld + +4499,iI,[ phy_dev_paprd_core.c : 619 ] -Q5-PAPRD : PA_in[%d] = 0x%lx + +4498,i,[ phy_dev_paprd_core.c : 98 ] Channel %d is not in valid range + +4497,i,[ phy_dev_paprd_core.c : 69 ] Invalid channel %d + +4496,ii,[ phy_dev_paprd_core.c : 145 ] pPaprdStruct->tableIndex = %d, pPaprdStruct->txChain = %d + +4495,,[ phy_dev_paprd_core.c : 160 ] ******Memless DPD +4494,I,[ phy_dev_paprd_core.c : 197 ] SQ is %lu and update DPD table + +4493,ii,[ phy_dev_paprd_core.c : 210 ] SQ > SQ limit, DPD cal failed at chain %d and table index %d + +4492,I,[ phy_dev_paprd_core.c : 211 ] SQ = %lu + +4491,i,[ phy_dev_paprd_core.c : 148 ] training_done_for_curr_table_idx %d + +4490,i,[ phy_dev_paprd_core.c : 335 ] -Q5-PAPRD-:max_idx = %d (before adding bin#1) + +4489,,[ phy_dev_paprd_core.c : 340 ] -Q5-PAPRD-:X Y theta accCount + +4488,IIii,[ phy_dev_paprd_core.c : 344 ] -Q5-PAPRD-:%lu %lu %d %d + +4487,i,[ phy_dev_paprd_core.c : 256 ] Channel %d is not in valid range + +4486,i,[ phy_dev_paprd_core.c : 839 ] -Q5-PAPRDTUNING-: max_bin %d +4485,i,[ phy_dev_paprd_core.c : 840 ] -Q5-PAPRDTUNING-: base_bin %d +4484,i,[ phy_dev_paprd_core.c : 867 ] -Q5-PAPRD : Compression Ratio is %d +4520,i,[ phy_dev_DPDCal.c : 85 ] phyId : %d + +4519,i,[ phy_dev_DPDCal.c : 87 ] txmask = %d + +4518,i,[ phy_dev_DPDCal.c : 88 ] rxmask = %d + +4517,i,[ phy_dev_DPDCal.c : 89 ] gi = %d + +4516,,[ phy_dev_DPDCal.c : 102 ] Start to setup DPD cal: phy_DPDCal_InitTrainingData() + +4515,i,[ phy_dev_DPDCal.c : 103 ] phyId = %d + +4514,i,[ phy_dev_DPDCal.c : 104 ] txmask = %d + +4513,i,[ phy_dev_DPDCal.c : 105 ] gi = %d + +4512,,[ phy_dev_DPDCal.c : 115 ] Start to transmit training packet: phy_paprd_device_TransmitTrainingPacket() +4511,iIII,[ phy_dev_DPDCal.c : 131 ] %d 0x%08x 0x%05x%08x +4510,,[ phy_dev_DPDCal.c : 139 ] Training Done, Start post-processing + +4509,,[ phy_dev_DPDCal.c : 146 ] Finished post-processing + +4508,I,[ phy_dev_DPDCal.c : 86 ] phyBase = 0x%lx + +4507,,[ phy_dev_DPDCal.c : 151 ] Training data not valid poor SQ + +4506,,[ phy_dev_DPDCal.c : 157 ] train_done flag cannot be set by HW, DPD Cal hits an critical error and abort + +4505,,[ phy_dev_DPDCal.c : 301 ] DPDCal Recipe Start!!! + +4529,iI,[ phy_dev_DACCal.c : 139 ] Q5-DACcal: calibration completed for chain%d, result = 0x%x +4528,iI,[ phy_dev_DACCal.c : 144 ] Q5-DACcal: calibration failed for chain%d, result = 0x%x +4527,,[ phy_dev_DACCal.c : 166 ] Disabling TxBBF before DAC Cal for every chain +4526,i,[ phy_dev_DACCal.c : 192 ] DAC Cal time: = %d us + +4525,,[ phy_dev_DACCal.c : 182 ] Restoring TxBBF settings +4524,,[ phy_dev_DACCal.c : 230 ] DAC Cal Restore +4523,,[ phy_dev_DACCal.c : 205 ] DAC Cal Save +4522,i,[ phy_dev_DACCal.c : 70 ] running dac_cal_setup for chain%d +4521,ii,[ phy_dev_DACCal.c : 94 ] running enable_dac_cal for chain%d in mode %d +4540,,[ phy_dev_PkDetCal.c : 100 ] Enter Peak Detector CAL +4539,Iii,[ phy_dev_PkDetCal.c : 189 ] remainingChains = %x DCOC_RES_Chain%d= 'd%d +4538,Iii,[ phy_dev_PkDetCal.c : 193 ] calStatus check failed, remainingChains = %x chain = %d calStatus=%d +4537,I,[ phy_dev_PkDetCal.c : 216 ] D_AGC_PKDET_GAIN is set to %x +4536,iiii,[ phy_dev_PkDetCal.c : 218 ] PKDET_DCOC_RES_OVD for chain %d is = 'd%d is_sbs=%d PKDET_THRES_5G = %d +4535,I,[ phy_dev_PkDetCal.c : 224 ] D_AGC_PKDET_GAIN is set to %x +4534,iiii,[ phy_dev_PkDetCal.c : 226 ] PKDET_DCOC_RES_OVD for chain %d is = 'd%d is_sbs=%d PKDET_THRES_2G = %d +4533,II,[ phy_dev_PkDetCal.c : 113 ] rxChMask=%x,counter:%x +4532,IIII,[ phy_dev_PkDetCal.c : 182 ] PKdet cal check result, RO_AGC_CAL=%x , current chain=%x , remain chain=%x , counter=%x +4531,IIIii,[ phy_dev_PkDetCal.c : 345 ] pkdet_restore :: regCalResult = 0x%x regParameters[0] = 0x%x regParameters[1] = 0x%x chain = %d is_sbs=%d +4530,IIIii,[ phy_dev_PkDetCal.c : 302 ] pkdet_save :: regCalResult = 0x%x regParameters[0] = 0x%x regParameters[1] = 0x%x chain = %d is_sbs=%d +4586,i,[ phy_dev_RxDCOCal.c : 1841 ] RxDCO: Cal failed on chain%d! Writing zeros to DCO LUT... +4585,iii,[ phy_dev_RxDCOCal.c : 1847 ] RXDCO: Using forced value:Ch[%d] (I,Q)=(%d, %d) +4584,,[ phy_dev_RxDCOCal.c : 2049 ] phyRxDCOCal_qcn90xx +4583,,[ phy_dev_RxDCOCal.c : 1871 ] restore_rxdco_calResult +4582,,[ phy_dev_RxDCOCal.c : 1887 ] RXDCO: Allocating memory for DcoLut +4581,I,[ phy_dev_RxDCOCal.c : 1410 ] RXDCO: A_DELAY_USECS cal_done time out calDoneCount=%u +4580,i,[ phy_dev_RxDCOCal.c : 1414 ] RXDCO: A_DELAY_USECS cal_done early calDoneCount=%d +4579,I,[ phy_dev_RxDCOCal.c : 1417 ] do cal after triggered=0x%X +4578,,[ phy_dev_RxDCOCal.c : 1423 ] RXDCO: cal_done failure and reset DO_CALIBRATE bit and CF_RESET_CORE !!!!! +4577,I,[ phy_dev_RxDCOCal.c : 1426 ] WFAX_PHYRF_CAL_SEQ_CTRL_16_L.DO_CALIBRATE= %lu +4576,,[ phy_dev_RxDCOCal.c : 2034 ] rxdco_disable +4575,,[ phy_dev_RxDCOCal.c : 155 ] rxdco_docal +4574,,[ phy_dev_RxDCOCal.c : 271 ] RXDCO: Allocating memory for DcoLut +4573,i,[ phy_dev_RxDCOCal.c : 278 ] rxdco_docal, RXDCO TIMER1: %d + +4572,i,[ phy_dev_RxDCOCal.c : 290 ] rxdco_docal, RXDCO TIMER2: %d +4571,,[ phy_dev_RxDCOCal.c : 298 ] RXDCO: Allocating memory for CalResult +4570,I,[ phy_dev_RxDCOCal.c : 156 ] RxDCO CAL DEBUG VERSION - 0x%x + +4569,i,[ phy_dev_RxDCOCal.c : 263 ] rxdco_docal, RXDCO TIMER0: %d +4568,,[ phy_dev_RxDCOCal.c : 2024 ] rxdco_enable +4567,,[ phy_dev_RxDCOCal.c : 1598 ] index out of range +4566,I,[ phy_dev_RxDCOCal.c : 1284 ] xfem_gpo_cfg= 0x%x +4565,,[ phy_dev_RxDCOCal.c : 999 ] RESULT>>> ch_idx, odac_range, cal_gain, Success, ODAC_I, ODAC_Q, Res_I, Res_Q, interf_pwr, interf_var +4564,II,[ phy_dev_RxDCOCal.c : 1002 ] ch_idx = [0x%x] rxChMask = 0x%x +4563,,[ phy_dev_RxDCOCal.c : 2000 ] rxdco_restore +4562,,[ phy_dev_RxDCOCal.c : 528 ] RXDCO: Cal for MIn Gain +4561,i,[ phy_dev_RxDCOCal.c : 567 ] RxDCO: Cal failed on chain%d! Writing zeros to DCO LUT... +4560,iii,[ phy_dev_RxDCOCal.c : 573 ] RXDCO: Using forced value:Ch[%d] (I,Q)=(%d, %d) +4559,,[ phy_dev_RxDCOCal.c : 533 ] RXDCO: Cal for MAx Gain +4558,,[ phy_dev_RxDCOCal.c : 556 ] RXDCO: Cal for MIn Gain +4557,,[ phy_dev_RxDCOCal.c : 362 ] RXDCO: *************************************** HW cal timeout +4556,i,[ phy_dev_RxDCOCal.c : 371 ] RXDCO: cal done successful, range_iter=%d +4555,i,[ phy_dev_RxDCOCal.c : 390 ] Condition for Cal Success: cal_success= %d +4554,i,[ phy_dev_RxDCOCal.c : 396 ] rxdco_run_rxdco_hw_cal: range_iter= %d +4553,,[ phy_dev_RxDCOCal.c : 444 ] RXDCO: Failed in all tries! +4552,,[ phy_dev_RxDCOCal.c : 1976 ] rxdco_save +4551,,[ phy_dev_RxDCOCal.c : 1991 ] RxDCO: Invalid selection. CAL_SAVE is not supported for raw Cal Results +4550,,[ phy_dev_RxDCOCal.c : 1179 ] RXDCO Cal: rxdco_validate_hw_results +4549,iiiii,[ phy_dev_RxDCOCal.c : 1224 ] ch_idx=%d i=%d Overall_Success=%d RangeOK=%d ResidualOK=%d +4548,ii,[ phy_dev_RxDCOCal.c : 1225 ] RC_CH[%d]= %d +4547,i,[ phy_dev_RxDCOCal.c : 1230 ] RXDCO Cal: rxdco_validate_hw_results: dcoc_range= %d +4546,i,[ phy_dev_RxDCOCal.c : 1242 ] skip_forceTRSW= %d +4545,i,[ phy_dev_RxDCOCal.c : 1253 ] forceTRSW= %d +4544,II,[ phy_dev_RxDCOCal.c : 761 ] mode = [0x%x] rxChMask = 0x%x +4543,i,[ phy_dev_RxDCOCal.c : 771 ] Def_GainTbl_Max = %d +4542,,[ phy_dev_RxDCOCal.c : 1638 ] save_restore_rxdco_DcoLut +4541,I,[ phy_dev_RxDCOCal.c : 1680 ] save_restore_rxdco_DcoLut:::Override mode is not restored for table mode: Value = %x +4592,,[ phy_dev_RxDCOCal_SWPP.c : 540 ] 2G 20MHz + +4591,,[ phy_dev_RxDCOCal_SWPP.c : 586 ] 5G Set0 + +4590,,[ phy_dev_RxDCOCal_SWPP.c : 608 ] 5G Set1 + +4589,,[ phy_dev_RxDCOCal_SWPP.c : 635 ] 6G Set0 + +4588,,[ phy_dev_RxDCOCal_SWPP.c : 657 ] 6G Set1 + +4587,,[ phy_dev_RxDCOCal_SWPP.c : 560 ] 2G 40MHz + +4673,I,[ phy_dev_TPCcal.c : 1074 ] GLUT - Chain %u + +4672,I,[ phy_dev_TPCcal.c : 2587 ] In CLPCModeICOUPLER_IS: txChainMask = 0x%x + +4671,I,[ phy_dev_TPCcal.c : 2640 ] In CLPCModeICOUPLER_PO: txChainMask = 0x%x + +4670,I,[ phy_dev_TPCcal.c : 2705 ] In CLPCModePdet: txChainMask = 0x%x + +4669,I,[ phy_dev_TPCcal.c : 2685 ] In CLPCModeVdet: txChainMask = 0x%x + +4668,,[ phy_dev_TPCcal.c : 1032 ] In clearalut routine, Clearing ALUT indices +4667,,[ phy_dev_TPCcal.c : 999 ] In clearglut routine, Clearing GLUT indices +4666,i,[ phy_dev_TPCcal.c : 2055 ] Q5-TPC: HW_PDET_CAL: Count is %d + +4665,,[ phy_dev_TPCcal.c : 2059 ] Q5-TPC: HW_PDET_CAL: LG CAL PAILED !!!!!!!!! + +4664,i,[ phy_dev_TPCcal.c : 2083 ] Q5-TPC: HW_PDET_CAL: Count is %d + +4663,,[ phy_dev_TPCcal.c : 2087 ] Q5-TPC: HW_PDET_CAL: HG CAL PAILED !!!!!!!!! + +4662,II,[ phy_dev_TPCcal.c : 752 ] PDL_TPC: EnableTPCMode input->tgtPwrClpcThrDb4 %x with shift %x +4661,,[ phy_dev_TPCcal.c : 1228 ] Invalid GLUT numEntries! + +4660,I,[ phy_dev_TPCcal.c : 1248 ] GLUT - Chain %u + +4659,i,[ phy_dev_TPCcal.c : 176 ] HeavyClippingOffsetSetup %d +4658,,[ phy_dev_TPCcal.c : 2296 ] OverrideHwPdetCalValues +4657,I,[ phy_dev_TPCcal.c : 1148 ] PLUT - Chain %u + +4656,IIIIIII,[ phy_dev_TPCcal.c : 502 ] TPC_PHYDEVLIB maxQAM[0..6] %x %x %x %x %x %x %x +4655,IIIIIII,[ phy_dev_TPCcal.c : 504 ] TPC_PHYDEVLIB minQAM[0..6] %x %x %x %x %x %x %x +4654,IIIIIII,[ phy_dev_TPCcal.c : 506 ] TPC_PHYDEVLIB maxQAM MU[0..6] %x %x %x %x %x %x %x +4653,IIIIIII,[ phy_dev_TPCcal.c : 508 ] TPC_PHYDEVLIB minQAM MU[0..6] %x %x %x %x %x %x %x +4652,i,[ phy_dev_TPCcal.c : 389 ] In ProgramGLUTIndicesByRange: powerRange = %d + +4651,,[ phy_dev_TPCcal.c : 393 ] Programming GLUT Indices Range 0 + +4650,,[ phy_dev_TPCcal.c : 411 ] Programming GLUT Indices Range 1 + +4649,,[ phy_dev_TPCcal.c : 424 ] Programming GLUT Indices Range 2 + +4648,,[ phy_dev_TPCcal.c : 437 ] Programming GLUT Indices Range 3 + +4647,i,[ phy_dev_TPCcal.c : 326 ] pktMCSType = %d + +4646,IiI,[ phy_dev_TPCcal.c : 961 ] programGLUT: Address of the GLUt base = 0x%x: GLUT_Idx = %d; Measured power = %hx + +4645,I,[ phy_dev_TPCcal.c : 600 ] TPC_PHYDEVLIB: TPC_GLUT_TARGET_PWR_LEVEL %x +4644,I,[ phy_dev_TPCcal.c : 608 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_4_L %x +4643,I,[ phy_dev_TPCcal.c : 616 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_5_L %x +4642,I,[ phy_dev_TPCcal.c : 624 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_2_L %x +4641,I,[ phy_dev_TPCcal.c : 632 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_3_L %x +4640,I,[ phy_dev_TPCcal.c : 640 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_0_L %x +4639,I,[ phy_dev_TPCcal.c : 648 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_1_L %x +4638,I,[ phy_dev_TPCcal.c : 656 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_6_L %x +4637,I,[ phy_dev_TPCcal.c : 664 ] TPC_PHYDEVLIB: TPC_GLUT_IDX_7_L %x +4636,IIII,[ phy_dev_TPCcal.c : 3202 ] tpcOnepointCal:: thermCalValue %u alphaTherm %u thermGainErrMax %u for chain %u +4635,ii,[ phy_dev_TPCcal.c : 1615 ] TX_CONV: Invalid chain_idx:%d for phy_idx:%d +4634,iii,[ phy_dev_TPCcal.c : 1658 ] TX_CONV: TxConvergenceRegRead phy_idx:%d for chain_idx:%d state:%d +4633,i,[ phy_dev_TPCcal.c : 1659 ] TX_CONV: txgain_count:%d +4632,i,[ phy_dev_TPCcal.c : 1660 ] TX_CONV: stat_latest_fwd:%d +4631,i,[ phy_dev_TPCcal.c : 1661 ] TX_CONV: stat_latest_lb:%d +4630,iii,[ phy_dev_TPCcal.c : 1704 ] TX_CONV: TX_CONVERGENCE_VALIDATION_RETRY_SUCCESS phy_idx:%d chain_idx:%d retry_cnt:%d +4629,iii,[ phy_dev_TPCcal.c : 1709 ] TX_CONV: TX_CONVERGENCE_VALIDATION_RETRY phy_idx:%d chain_idx:%d retry_cnt:%d +4628,iii,[ phy_dev_TPCcal.c : 1712 ] TX_CONV: TX_CONVERGENCE_VALIDATION_FAILURE phy_idx:%d chain_idx:%d retry_cnt:%d +4627,iiii,[ phy_dev_TPCcal.c : 1721 ] TX_CONV: mhz:%d phy_idx:%d chain_idx:%d state:%d +4626,,[ phy_dev_TPCcal.c : 1726 ] TX_CONV: TX_CONVERGENCE_CLEAR +4625,,[ phy_dev_TPCcal.c : 1732 ] TX_CONV: TX_CONVERGENCE_INIT +4624,,[ phy_dev_TPCcal.c : 1737 ] TX_CONV: TX_CONVERGENCE_UPDATE +4623,,[ phy_dev_TPCcal.c : 1745 ] TX_CONV: TX_CONVERGENCE_UPDATE_RETRY +4622,i,[ phy_dev_TPCcal.c : 1758 ] TX_CONV: Invalid state: %d +4621,iiii,[ phy_dev_TPCcal.c : 1683 ] TX_CONV: phy_idx:%d chain_idx:%d txgain_count_delta:%d latest_pwr_delta:%d +4620,,[ phy_dev_TPCcal.c : 1687 ] TX_CONV: TX_CONVERGENCE_VALIDATION_SUCCESS +4619,i,[ phy_dev_TPCcal.c : 2527 ] ov_rel1:%d +4618,,[ phy_dev_TPCcal.c : 1421 ] Printing all the input paramters + +4617,iI,[ phy_dev_TPCcal.c : 1429 ] ForcedDacGain[%d] = 0x%x + +4616,iI,[ phy_dev_TPCcal.c : 1430 ] ForcedTxGainIdx[%d] = 0x%x + +4615,iI,[ phy_dev_TPCcal.c : 1431 ] ForcedGLUTIdx[%d] = 0x%x + +4614,I,[ phy_dev_TPCcal.c : 1439 ] Force target Power = 0x%x + +4613,i,[ phy_dev_TPCcal.c : 1422 ] bandCode - %d + +4612,I,[ phy_dev_TPCcal.c : 1423 ] ForcedTargetPower - 0x%x + +4611,I,[ phy_dev_TPCcal.c : 1424 ] ForceDacGain - 0x%x + +4610,I,[ phy_dev_TPCcal.c : 1425 ] ForceTxGainIdx - 0x%x + +4609,,[ phy_dev_TPCcal.c : 1833 ] -Q5-TPC:- phyLatestAccumulatedCLPCError_qcn90xx was passed NULL Ptr +4608,iII,[ phy_dev_TPCcal.c : 1847 ] -Q5-TPC:- tpcOnepointCal::bandCode %d Chain %u latestAccumulatedClpcError %u +4607,ii,[ phy_dev_TPCcal.c : 1878 ] temp %d = %d +4606,,[ phy_dev_TPCcal.c : 1886 ] phyLatestThermValue_qcn90xx was passed NULL Ptr +4605,iII,[ phy_dev_TPCcal.c : 1892 ] -Q5-TPC :- tpcOnepointCal::phyId %d Chain %u thermalVal %u +4604,,[ phy_dev_TPCcal.c : 3218 ] phyOLPCTempComp_qcn90xx +4603,,[ phy_dev_TPCcal.c : 3231 ] phyOLPCTempUpdate_qcn90xx +4602,IIII,[ phy_dev_TPCcal.c : 100 ] Get the Modes - CLPCMode - 0x%x readTPCStatus - 0x%x Force Mode - 0x%x Forced gain - 0x%x +4601,,[ phy_dev_TPCcal.c : 127 ] Incorrect Test Selection ... +4600,II,[ phy_dev_TPCcal.c : 161 ] set ch %x TPC_OVERRIDE_3 to %x + +4599,iii,[ phy_dev_TPCcal.c : 1799 ] TX_CONV: TX_CONVERGENCE_VALIDATION_FAILURE invalid phy_base_addr:%d phy_idx:%d chain_idx:%d +4598,iii,[ phy_dev_TPCcal.c : 1804 ] TX_CONV: phyInput->bandCode:%d, phyInput->txChMask:%d, tx_active_chain_mask:%d +4597,i,[ phy_dev_TPCcal.c : 1816 ] TX_CONV: End: tx_converged:%d +4596,i,[ phy_dev_TPCcal.c : 229 ] -Q5-TPC : In setupTPC: fcsEnabled = %d + +4595,i,[ phy_dev_TPCcal.c : 235 ] -Q5-TPC : Configuring TPC Mode on PHY with BandCode - %d + +4594,,[ phy_dev_TPCcal.c : 275 ] -Q5-TPC : Completed the Setup TPC settings... +4593,iiii,[ phy_dev_TPCcal.c : 2478 ] PDL_TPC_DBG: pdadc[0] %d dcVal[0] %d pdadc[1] %d dcVal[1] %d +4682,II,[ phy_dev_TxBBFCal.c : 167 ] beol: 0x%x pw: 0x%x + +4681,,[ phy_dev_TxBBFCal.c : 189 ] Beol and/or pw came back as zero - OTP is likely not programmed +4680,iii,[ phy_dev_TxBBFCal.c : 203 ] rSkew: %d rc3Skew: %d rc4Skew: %d +4679,iiiii,[ phy_dev_TxBBFCal.c : 204 ] beol40: %d beol75: %d beol120: %d beol150: %d beol270: %d +4678,IIIII,[ phy_dev_TxBBFCal.c : 238 ] tiaRtuneTarget: %u lvlRtuneTarget: %u bqRtune1Target: %u bqRtune2Target: %u bqRtune3Target: %u +4677,IIIII,[ phy_dev_TxBBFCal.c : 239 ] tiaCcompTarget: %u tiaCfwrdTarget: %u tiaCtuneTarget: %u bqC1CtuneTarget: %u bqC2CtuneTarget: %u +4676,IIIII,[ phy_dev_TxBBFCal.c : 292 ] tiaRtuneTarget: %u lvlRtuneTarget: %u bqRtune1Target: %u bqRtune2Target: %u bqRtune3Target: %u +4675,IIIII,[ phy_dev_TxBBFCal.c : 293 ] tiaCcompTarget: %u tiaCfwrdTarget: %u tiaCtuneTarget: %u bqC1CtuneTarget: %u bqC2CtuneTarget: %u +4674,II,[ phy_dev_TxBBFCal.c : 181 ] beol_1.25: 0x%x pw_1.25: 0x%x + +4695,I,[ phy_dev_RxBBFCal.c : 247 ] rfa_otp_address_base= 0x%08x +4694,,[ phy_dev_RxBBFCal.c : 267 ] Beol came back as Zero - OTP is likely not programmed +4693,,[ phy_dev_RxBBFCal.c : 268 ] no action taken +4692,ii,[ phy_dev_RxBBFCal.c : 273 ] rTune: %d rInt: %d +4691,,[ phy_dev_RxBBFCal.c : 288 ] RXBBFCAL: bw code too large!!! Defaulting to 0 +4690,,[ phy_dev_RxBBFCal.c : 294 ] RXBBFCAL: bw code 80P80 or 160 or 165 +4689,III,[ phy_dev_RxBBFCal.c : 303 ] rc_corner_scale : %u r_corner_scale: %u c_corner_scale: %u +4688,IIII,[ phy_dev_RxBBFCal.c : 392 ] Reg_TIA_Gain: %u tia_Gain_Factor[Reg_TIA_Gain]: %u chainIdx: %u ch_factor[chainIdx] = %u +4687,I,[ phy_dev_RxBBFCal.c : 251 ] hirc 0x%x + +4686,III,[ phy_dev_RxBBFCal.c : 401 ] bq_cfb_total_ref: %u bq_cfb_fixed: %u bq_cfb_tuned = %u +4685,II,[ phy_dev_RxBBFCal.c : 405 ] chainIdx: %u ch_factor_BQ_2G[chainIdx] = %u +4684,II,[ phy_dev_RxBBFCal.c : 410 ] chainIdx: %u ch_factor_BQ_5G[chainIdx] = %u +4683,I,[ phy_dev_RxBBFCal.c : 263 ] hirc_1.25 0x%x + +4715,I,[ rfaConfig.c : 199 ] INVALID FREQUENCY1 %u +4714,III,[ rfaConfig.c : 229 ] NfNbna: LOFrequency=%0.2fMHz NBNA=0x%x NF=0x%x +4713,,[ rfaConfig.c : 1065 ] ironInit +4712,,[ rfaConfig.c : 1087 ] +4711,,[ rfaConfig.c : 785 ] phyRfaIni +4710,,[ rfaConfig.c : 790 ] ERROR! UNKNOWN WCSS ENVIRONMENT +4709,,[ rfaConfig.c : 856 ] RfaIni Done +4708,,[ rfaConfig.c : 1042 ] set channel Agile Recipe Start +4707,,[ rfaConfig.c : 1054 ] set channel Agile Recipe Complete +4706,,[ rfaConfig.c : 1020 ] set channel Recipe Start +4705,,[ rfaConfig.c : 1032 ] set channel Recipe Complete +4704,,[ rfaConfig.c : 369 ] Error! : Synth frequency is out of range from defined list +4703,iii,[ rfaConfig.c : 947 ] freq=%dMHz chanIdx=%d sBandCode=%d +4702,,[ rfaConfig.c : 905 ] aDFS Configuration not supported +4701,,[ rfaConfig.c : 323 ] Error! : Synth frequency is out of range from defined list +4700,I,[ rfaConfig.c : 326 ] da_ctune = 0x%x +4699,I,[ rfaConfig.c : 329 ] da_ctune = 0x%x +4698,,[ rfaConfig.c : 283 ] Error! : Synth frequency is out of range from defined list +4697,III,[ rfaConfig.c : 286 ] ctune[1, 3, 5] = [0x%x, 0x%x, 0x%x] +4696,III,[ rfaConfig.c : 289 ] ctune[1, 3, 5] = [0x%x, 0x%x, 0x%x] +4726,III,[ hca_HwComponentTrxPine_tpc.cpp : 140 ] TPC_DBG:EnableCLPC clpc thresh from BDF %x clpc thresh in alutGen %x out %x +4725,i,[ hca_HwComponentTrxPine_tpc.cpp : 248 ] HcaHwComponentTrxPine_tpc::EnableCLPC=%d PDET Cal executed +4724,i,[ hca_HwComponentTrxPine_tpc.cpp : 377 ] ov_rel0:%d +4723,iii,[ hca_HwComponentTrxPine_tpc.cpp : 324 ] force glut: chain%d, gainindex%d: dacgain=%d + +4722,i,[ hca_HwComponentTrxPine_tpc.cpp : 393 ] OPC: phyId:%d state +4721,,[ hca_HwComponentTrxPine_tpc.cpp : 639 ] OLPC_TEMP_COMP: Invalid latestThermValue! + +4720,I,[ hca_HwComponentTrxPine_tpc.cpp : 650 ] OLPC_TEMP_COMP: latestThermValue = %u + +4719,II,[ hca_HwComponentTrxPine_tpc.cpp : 678 ] TPC_DUMP: PrimaryChan %u, SecondaryChan %u + +4718,IIIIIIII,[ hca_HwComponentTrxPine_tpc.cpp : 717 ] TPC_DUMP_GLUT: tpcTblIdx %3u | tpcChainIdx %3u | tpcGainIdx %3u | pwrMeas %3d | minDacGain %3d | txGainIdx %3d | clpcError %3d | tpcClPktCnt %3d +4717,IIIIIIIII,[ hca_HwComponentTrxPine_tpc.cpp : 749 ] TPC_DUMP_PLUT: tpcTblIdx %3u | tpcChainIdx %3u | tpcPlutIdx %3u | pdadc[%3u-%3u] HEX:%8x | pdadc[%3u-%3u] HEX:%8x | +4716,IIIIIIIII,[ hca_HwComponentTrxPine_tpc.cpp : 781 ] TPC_DUMP_ALUT: tpcTblIdx %3u | tpcChainIdx %3u | tpcAlutIdx %3u | Alut tgtPwr Step [%3u-%3u] HEX:%8x | Alut tgtPwr Step [%3u-%3u] HEX:%8x +4736,II,[ hca_HwComponentTrxPine_cal.cpp : 159 ] RY: RestoreSetHwChainMasks: forceTxChainMask=%x, forceRxChainMask=%x +4735,i,[ hca_HwComponentTrxPine_cal.cpp : 775 ] VK_NF minNfLimit=%d +4734,Iii,[ hca_HwComponentTrxPine_cal.cpp : 817 ] DBG_NF per chain : rxChainMask 0x%x nfPerChain[%d] = %d +4733,i,[ hca_HwComponentTrxPine_cal.cpp : 245 ] NFCAL, itercount : %d +4732,iii,[ hca_HwComponentTrxPine_cal.cpp : 720 ] AoA - phy%d, numChains %d, freq %d +4731,iiiiii,[ hca_HwComponentTrxPine_cal.cpp : 732 ] AoA - ch%d, gnIdx %d, dataSz %d, bdfVal %d calVal %d, AoAphase %d +4730,IIIII,[ hca_HwComponentTrxPine_cal.cpp : 532 ] NFCAL backed up phyId %u, rssiThr1aDb %x, rssiThr1bDb %x, rssiThr1cDb %x, rssiThr1dDb %x +4729,IIIII,[ hca_HwComponentTrxPine_cal.cpp : 688 ] NFCAL phyId %u, Result %u, ccaCountMax %u, firPwrThrdB2 %u, relPwrThrdB2 %u +4728,IIIIIIIi,[ hca_HwComponentTrxPine_cal.cpp : 692 ] NFCAL phyId %u, Chan %u, Chain %u, curCCaCnt %u, firpwrCnt %u, relPwrCnt %u, nf_cal_gtc_mask %u, nf %d +4727,i,[ hca_HwComponentTrxPine_cal.cpp : 618 ] VK_NF minNfLimit=%d +4741,I,[ hca_HwComponentTrxPine_xtalCal.cpp : 165 ] XTAL_CAL_PINE - Enable flag =0x%x + +4740,i,[ hca_HwComponentTrxPine_xtalCal.cpp : 183 ] XTAL_CAL- CWgain_index=%d +4739,i,[ hca_HwComponentTrxPine_xtalCal.cpp : 189 ] XTAL_CAL clear - gainIdx4XtalCal=%d +4738,iiI,[ hca_HwComponentTrxPine_xtalCal.cpp : 240 ] XTAL_CAL_PINE :SET -Reg_values, chain=%d, idx=%d , value=0x%x + +4737,iiI,[ hca_HwComponentTrxPine_xtalCal.cpp : 304 ] XTAL_CAL_PINE :Clear - Reg_values, chain=%d, idx=%d , value=0x%x + +4816,,[ hca_HwComponentTrxPine_bdf.cpp : 2633 ] TPC_DBG: using 2G data +4815,,[ hca_HwComponentTrxPine_bdf.cpp : 2648 ] TPC_DBG: using 6G data +4814,,[ hca_HwComponentTrxPine_bdf.cpp : 2661 ] TPC_DBG: using 5G2 data +4813,i,[ hca_HwComponentTrxPine_bdf.cpp : 6483 ] TLMM:::: GPIO config Success for freq: %d +4812,,[ hca_HwComponentTrxPine_bdf.cpp : 2811 ] SetCtlTable halphy api called. Access to BDF CTL data temporarily disabled. +4811,,[ hca_HwComponentTrxPine_bdf.cpp : 2816 ] CTL DATA push failed. +4810,iiiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 2827 ] Variables: isG: %d, seq: %d, endflag: %d, totalLen: %d, ctl_ptr: %d, beginning actual address: %d, BDF beginning: %d +4809,i,[ hca_HwComponentTrxPine_bdf.cpp : 2829 ] CTL 2G DATA push under process at seq %d +4808,i,[ hca_HwComponentTrxPine_bdf.cpp : 2830 ] Size being copied in this iteration: %d +4807,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2831 ] Value at address %d before copy: %d +4806,,[ hca_HwComponentTrxPine_bdf.cpp : 2834 ] Invalid CTL data size. Access denied to copy this fragment. Please copy CTL blob from beginning with right size. +4805,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2840 ] Value at address %d after copy: %d +4804,i,[ hca_HwComponentTrxPine_bdf.cpp : 2841 ] Size copied: %d +4803,iiiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 2849 ] Variables: isG: %d, seq: %d, endflag: %d, totalLen: %d, ctl_ptr: %d, beginning actual address: %d, BDF beginning: %d +4802,i,[ hca_HwComponentTrxPine_bdf.cpp : 2851 ] CTL 6G DATA push under process at seq %d +4801,i,[ hca_HwComponentTrxPine_bdf.cpp : 2852 ] Size being copied in this iteration: %d +4800,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2853 ] Value at address %d before copy: %d +4799,,[ hca_HwComponentTrxPine_bdf.cpp : 2856 ] Invalid CTL data size. Access denied to copy this fragment. Please copy CTL blob from beginning with right size. +4798,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2862 ] Value at address %d after copy: %d +4797,i,[ hca_HwComponentTrxPine_bdf.cpp : 2863 ] Size copied: %d +4796,iiiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 2872 ] Variables: isG: %d, seq: %d, endflag: %d, totalLen: %d, ctl_ptr: %d, beginning actual address: %d, BDF beginning: %d +4795,i,[ hca_HwComponentTrxPine_bdf.cpp : 2874 ] CTL 5G DATA push under process at seq %d +4794,i,[ hca_HwComponentTrxPine_bdf.cpp : 2875 ] Size being copied in this iteration: %d +4793,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2876 ] Value at address %d before copy: %d +4792,,[ hca_HwComponentTrxPine_bdf.cpp : 2879 ] Invalid CTL data size. Access denied to copy this fragment. Please copy CTL blob from beginning with right size. +4791,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2885 ] Value at address %d after copy: %d +4790,i,[ hca_HwComponentTrxPine_bdf.cpp : 2886 ] Size copied: %d +4789,,[ hca_HwComponentTrxPine_bdf.cpp : 2891 ] CTL DATA push successful. CTL parsing will be allowed. +4788,i,[ hca_HwComponentTrxPine_bdf.cpp : 6498 ] TLMM:::: DAL_DeviceAttach TLMM: Failed due to Dal result %d + +4787,,[ hca_HwComponentTrxPine_bdf.cpp : 6506 ] TLMM:::: Null pointer exception on gpiointConfig +4786,i,[ hca_HwComponentTrxPine_bdf.cpp : 6512 ] TLMM:::: DalTlmm_ConfigGpio: Failed due to Dal result %d + +4785,i,[ hca_HwComponentTrxPine_bdf.cpp : 6519 ] TLMM:::: DalTlmm_GpioOut: Failed due to Dal result %d + +4784,iii,[ hca_HwComponentTrxPine_bdf.cpp : 5508 ] ACR : cfgCtl2G=%d, isG[2G=1,5G=0,6G=2]=%d, acrSetting=%d + +4783,IIIIIII,[ hca_HwComponentTrxPine_bdf.cpp : 4644 ] tpcOnepointCal:: chosen phyId %u alphaThermFreq[%u] %u curChan %u curChain %u tempIdx %u alphaThermValue %u +4782,i,[ hca_HwComponentTrxPine_bdf.cpp : 2677 ] TPC_DBG: precaldata band %d +4781,,[ hca_HwComponentTrxPine_bdf.cpp : 1192 ] TPC_CTL: Unable to find channel and power index for RD!!!Hence setting max power + +4780,iiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 6970 ] perPacketCMFeatureEnable rcFlag=%d ctlPwr=%d tmpPwr=%d finCtlPwr=%d numChRes=%d finChMsk=%d +4779,iiiiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 2901 ] RegModeFlags part1 %d %d %d %d %d %d %d %d +4778,iiiiiiii,[ hca_HwComponentTrxPine_bdf.cpp : 2902 ] RegModeFlags part2 %d %d %d %d %d %d %d %d +4777,,[ hca_HwComponentTrxPine_bdf.cpp : 2765 ] Board data address pointer is NULL !! +4776,,[ hca_HwComponentTrxPine_bdf.cpp : 7014 ] DFS_DUMP :: radar det thresh programming +4775,,[ hca_HwComponentTrxPine_bdf.cpp : 7083 ] DFS_DUMP :: radar det thresh programming +4774,ii,[ hca_HwComponentTrxPine_bdf.cpp : 3274 ] phyrf_tpc_device_GetOnePointTpcOffset channel %d chosen_chanid = %d +4773,iiii,[ hca_HwComponentTrxPine_bdf.cpp : 3296 ] tpcOnepointCal::channel:%d cmask:%d is2GHz:%d tpcPowerOffset:%d + +4772,ii,[ hca_HwComponentTrxPine_bdf.cpp : 259 ] RTT - pri20 %d is not valid in dynamicBw %d +4771,i,[ hca_HwComponentTrxPine_bdf.cpp : 294 ] RTT - Invalid dynamicBw %d +4770,i,[ hca_HwComponentTrxPine_bdf.cpp : 108 ] RTT - Error: unsupported pktBw %d +4769,,[ hca_HwComponentTrxPine_bdf.cpp : 2934 ] Board data address pointer is NULL !! +4768,,[ hca_HwComponentTrxPine_bdf.cpp : 1446 ] CTL table under update process. CTL table will not be parsed/updated at this time. +4767,i,[ hca_HwComponentTrxPine_bdf.cpp : 1504 ] CTL6G Value %d + +4766,i,[ hca_HwComponentTrxPine_bdf.cpp : 169 ] RTT - Error: unsupported pktBw %d +4765,ii,[ hca_HwComponentTrxPine_bdf.cpp : 2480 ] ProgramGIcorrGICCAThr is6Ghz:%d and is6gFCC:%d GICorr and GI CCA Thr settings +4764,iii,[ hca_HwComponentTrxPine_bdf.cpp : 5355 ] HC: band: %d, chan %d, hcliteThr %d +4763,IIIIIi,[ hca_HwComponentTrxPine_bdf.cpp : 4431 ] tpcOnepointCal:: chosen phyId %u calFreq[%u] %u curChan %u curChain %u onePointThermOffset %d +4762,i,[ hca_HwComponentTrxPine_bdf.cpp : 213 ] RTT - Invalid dynamicBw %d for 2G +4761,iI,[ hca_HwComponentTrxPine_bdf.cpp : 2510 ] wmi ccaThres programming for phyId:%d reg:0x%x +4760,i,[ hca_HwComponentTrxPine_bdf.cpp : 194 ] RTT - Invalid dynamicBw %d for 5G +4759,IIII,[ hca_HwComponentTrxPine_bdf.cpp : 5847 ] PhyId: %lu, Mode : %lu, Rate : %lu, Target Power: %lu +4758,IIIIIi,[ hca_HwComponentTrxPine_bdf.cpp : 4319 ] tpcOnepointCal:: chosen phyId %u calFreq[%u] %u curChan %u curChain %u onePointTpcGLUTOffset %d +4757,,[ hca_HwComponentTrxPine_bdf.cpp : 2974 ] Board data address pointer is NULL !! +4756,,[ hca_HwComponentTrxPine_bdf.cpp : 3025 ] Board data address pointer is NULL !! +4755,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3064 ] tpcOnepointCal::Saving to BDF txPwrOffset_db8 %d for Band %u, Chain %u,Chan %u, calAttempts %u +4754,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3073 ] tpcOnepointCal::Saving to BDF glutOffset %d for Band %u, Chain %u,Chan %u, calAttempts %u +4753,IIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3083 ] tpcOnepointCal:: Saving to BDF thermalOffset %u for Band %u, Chain %u,Chan %u, calAttempts %u +4752,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3095 ] tpcOnepointCal::Saving to BDF txPwrOffset_db8 %d for Band %u, Chain %u,Chan %u, calAttempts %u +4751,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3104 ] tpcOnepointCal::Saving to BDF glutOffset %d for Band %u, Chain %u,Chan %u, calAttempts %u +4750,IIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3114 ] tpcOnepointCal:: Saving to BDF thermalOffset %u for Band %u, Chain %u,Chan %u, calAttempts %u +4749,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3128 ] tpcOnepointCal::Saving to BDF txPwrOffset_db8 %d for Band %u, Chain %u,Chan %u, calAttempts %u +4748,iIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3137 ] tpcOnepointCal::Saving to BDF glutOffset %d for Band %u, Chain %u,Chan %u, calAttempts %u +4747,IIIII,[ hca_HwComponentTrxPine_bdf.cpp : 3147 ] tpcOnepointCal:: Saving to BDF thermalOffset %u for Band %u, Chain %u,Chan %u, calAttempts %u +4746,i,[ hca_HwComponentTrxPine_bdf.cpp : 6985 ] Per-Packet Chainmask support is Disabled. perPacketCMFeatureEnable = %d +4745,i,[ hca_HwComponentTrxPine_bdf.cpp : 6988 ] Per-Packet Chainmask support is Enabled. perPacketCMFeatureEnable = %d +4744,ii,[ hca_HwComponentTrxPine_bdf.cpp : 6990 ] Per-Packet Chainmask support: perPacketCMFeatureEnable = %d, Debug Log = %d +4743,ii,[ hca_HwComponentTrxPine_bdf.cpp : 6993 ] Per-Packet Chainmask support: perPacketCMFeatureEnable = %d, DebugLogEnabled = %d +4742,ii,[ hca_HwComponentTrxPine_bdf.cpp : 6996 ] Per-Packet Chainmask support: perPacketCMFeatureEnable = %d, DebugLogDisabled = %d +4826,,[ hca_HwComponentTrxPine_efuse.cpp : 290 ] HcaHwComponentTrxPine_efuse::ReadPerRfa apply_xo_param bit is enabled +4825,ii,[ hca_HwComponentTrxPine_efuse.cpp : 295 ] HcaHwComponentTrxPine_efuse::ReadPerRfa %d, %d +4824,iii,[ hca_HwComponentTrxPine_efuse.cpp : 331 ] HcaHwComponentTrxPine_efuse::WritePerRfa::XO cdacin %d, cdacout %d rc %d +4823,II,[ hca_HwComponentTrxPine_efuse.cpp : 37 ] Error: buffer is out of bounds. offset = %lu, numBytes = %lu + +4822,iII,[ hca_HwComponentTrxPine_efuse.cpp : 44 ] efuseR[%d] ->address [%lu] Value 0x%lx + +4821,II,[ hca_HwComponentTrxPine_efuse.cpp : 58 ] Error: buffer is out of bounds. offset = %lu, numBytes = %lu + +4820,I,[ hca_HwComponentTrxPine_efuse.cpp : 64 ] Error; numBytes not a mulpile of 4, numBytes = %lu + +4819,iII,[ hca_HwComponentTrxPine_efuse.cpp : 88 ] efuseW[%d] ->address [%lu] Value 0x%lx + +4818,III,[ hca_HwComponentTrxPine_efuse.cpp : 111 ] efuseR[%lu] = 0x%lx != 0x%lx + +4817,II,[ hca_HwComponentTrxPine_efuse.cpp : 117 ] Error: %lu/%lu bytes were not written to eFuse correctly. + +4829,i,[ hca_HwComponentTrxPine_config.cpp : 185 ] PRDD-DFS ADFS SynthFreq - %d +4828,,[ hca_HwComponentTrxPine_config.cpp : 259 ] Agile DFS Channel in Secondary 80 of 165 MHz +4827,,[ hca_HwComponentTrxPine_config.cpp : 266 ] Agile Non DFS Channel in Secondary 80 of 165 MHz +4836,I,[ hca_HwComponentTrxPine_calDb.cpp : 890 ] CALDB_DEBUG: channel list table dump 2G 20 %u +4835,I,[ hca_HwComponentTrxPine_calDb.cpp : 894 ] CALDB_DEBUG: channel list table dump 2G 40 %u +4834,I,[ hca_HwComponentTrxPine_calDb.cpp : 898 ] CALDB_DEBUG: channel list table dump 5G 20 %u +4833,I,[ hca_HwComponentTrxPine_calDb.cpp : 902 ] CALDB_DEBUG: channel list table dump 5G 40 %u +4832,I,[ hca_HwComponentTrxPine_calDb.cpp : 906 ] CALDB_DEBUG: channel list table dump 5G 80 %u +4831,I,[ hca_HwComponentTrxPine_calDb.cpp : 910 ] CALDB_DEBUG: channel list table dump 5G 160 %u +4830,i,[ hca_HwComponentTrxPine_calDb.cpp : 914 ] CALDB_DEBUG: groupMapping[i][1]=%d +4850,ii,[ hca_HwComponentTrxPine_paprd.cpp : 669 ] PAPRD HcaHwComponentTrxPine_paprd::FtmControl : channel %d dpd_enable %d +4849,iii,[ hca_HwComponentTrxPine_paprd.cpp : 694 ] PAPRD ResetParams phyExtn = %d phyId %d enable %d +4848,i,[ hca_HwComponentTrxPine_paprd.cpp : 784 ] PAPRD: Unknown PHY Id %d +4847,I,[ hca_HwComponentTrxPine_paprd.cpp : 83 ] PAPRD: Debugflag entered %x +4846,iii,[ hca_HwComponentTrxPine_paprd.cpp : 656 ] PAPRD SetPaprdEnable : enable %d paprdEnable2G %d paprdEnable5G %d +4845,iiiiii,[ hca_HwComponentTrxPine_paprd.cpp : 739 ] PAPRD: GetDPDChannelRange PHY ID %d isG %d start %d end %d chan start %d chan end %d +4844,iiII,[ hca_HwComponentTrxPine_paprd.cpp : 319 ] PAPRD PDL secondary %d cur cal Temperature %d phyInput->txChMask 0x%x tx mask 0x%x +4843,ii,[ hca_HwComponentTrxPine_paprd.cpp : 153 ] PAPRDTUNING: SETTING - LoopBack Attn | Glut %d Value %d +4842,ii,[ hca_HwComponentTrxPine_paprd.cpp : 158 ] PAPRDTUNING: SETTING - Timing Delay | Glut %d Value %d +4841,iiii,[ hca_HwComponentTrxPine_paprd.cpp : 560 ] PAPRDTUNING: Channel %d chainIdx %d glutIdx %d gainIdx %d + +4840,iiii,[ hca_HwComponentTrxPine_paprd.cpp : 562 ] PAPRDTUNING: Channel %d chainIdx %d glutIdx %d gainIdx %d + +4839,i,[ hca_HwComponentTrxPine_paprd.cpp : 386 ] PAPRD: XmitTrainingFrame failed. Status %d + +4838,iIi,[ hca_HwComponentTrxPine_paprd.cpp : 388 ] PAPRD: XmitTrainingFrame tx_count %d, tx_ctxt_flags 0x%x cal type %d +4837,Ii,[ hca_HwComponentTrxPine_paprd.cpp : 47 ] PAPRD:HcaHwComponentTrxPine_paprd::HwDisable all : PhyBase %8x channel %d +4857,iiIII,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 78 ] phyInput->homeCh %d + phyInput->bandCode %d + phyInput->phyBase 0x%x + phyInput->txChMask 0x%x + phyInput->rxChMask 0x%x + +4856,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 79 ] phyInput->bwCode %d + +4855,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 80 ] ACR : rx_bbf_cal_input->acrSetting %d + +4854,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 128 ] TxBBF and RxBBF cals loadIniMask %d +4853,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 131 ] Skipping TxBBF and RxBBF cals. Reason: No BW/Band change loadIniMask %d +4852,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 145 ] TxBBF cal completed result=%d + +4851,i,[ hca_HwComponentTrxPine_calSmBwFilter.cpp : 155 ] RxBBF cal completed result=%d + +4862,ii,[ hca_HwComponentTrxPine_calSmDpdMemoryLess.cpp : 95 ] DPD Cal State m/c ::: new_channel_change_request(%d) on channel %d +4861,,[ hca_HwComponentTrxPine_calSmDpdMemoryLess.cpp : 126 ] PAPRD: DPD disabled for this range of frequency +4860,Iiiiiii,[ hca_HwComponentTrxPine_calSmDpdMemoryLess.cpp : 151 ] Run DPD Calibration ::: pHdl=%x, phyMode=%d, phyID=%d, channel %d, bwCode %d, txCM=%d, rxCM=%d +4859,iiii,[ hca_HwComponentTrxPine_calSmDpdMemoryLess.cpp : 155 ] DPD Cal State m/c ::: Channel %d= State %d, DPD Queue %d, tx pkt cnt %d +4858,,[ hca_HwComponentTrxPine_calSmDpdMemoryLess.cpp : 162 ] PAPRD: DPD not triggered. + +4976,iI,[ hca_HwComponentTrxPine_calSmComb.cpp : 970 ] combCal_SM_save: RXIQ: chainIdx=%d, pStartRxIq=%x +4975,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1018 ] cannot update RxIq table in caldb for chainIdx = %d! +4974,iI,[ hca_HwComponentTrxPine_calSmComb.cpp : 1068 ] combCal_SM_save: TXIQ: chainIdx=%d, pStartTxIq=%x +4973,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1088 ] cannot update TxIq table in caldb for chainIdx = %d! +4972,iIi,[ hca_HwComponentTrxPine_calSmComb.cpp : 1132 ] combCal_SM_save: TXLO: chainIdx=%d, pStartTxLo=%x, 4 * NUM_GAINS_PER_MODE_DIG_ANA_CL=%d +4971,Iii,[ hca_HwComponentTrxPine_calSmComb.cpp : 1141 ] #### SAVE rxChainMask=%x, maxChain=%d, fdmtCombCalInput->chainIdx = %d +4970,ii,[ hca_HwComponentTrxPine_calSmComb.cpp : 1142 ] #### SAVE fdmtCombCalInput->combCalType = %d (COMB_CAL_TYPE_CL=%d) +4969,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1143 ] #### SAVE fdmtCombCalInput->calCmdId=%d +4968,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1144 ] #### ADDR SAVE:pStartTxLo=%x +4967,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1205 ] cannot update txlo table in caldb for chainIdx = %d! +4966,,[ hca_HwComponentTrxPine_calSmComb.cpp : 286 ] APPLICALBE_RESUBMISSION_ONLY:: failure on not getting pStart (= NULL) from caldb! +4965,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1617 ] CAL_COMMON_PARAM pHandle =%x +4964,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1618 ] CAL_COMMON_PARAM calType =%d +4963,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1619 ] CAL_COMMON_PARAM cmdGroupId =%d +4962,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1620 ] CAL_COMMON_PARAM isRestoreOnly =%d +4961,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1621 ] CAL_COMMON_PARAM calTypeVarianceId =%d +4960,iii,[ hca_HwComponentTrxPine_calSmComb.cpp : 1622 ] CAL_COMMON_PARAM reserved =%d %d %d +4959,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1623 ] CAL_COMMON_PARAM (pIn->pHandle).phyId =%x +4958,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1624 ] CAL_COMMON_PARAM halphyBW =%x +4957,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1625 ] PHYDEVLIB_PHY_INPUT phyId =%d +4956,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1626 ] PHYDEVLIB_PHY_INPUT bandCode =%d +4955,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1627 ] PHYDEVLIB_PHY_INPUT bwCode =%d +4954,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1628 ] PHYDEVLIB_PHY_INPUT phyMode =%d +4953,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1629 ] PHYDEVLIB_PHY_INPUT band_center_freq1 =%d +4952,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1630 ] PHYDEVLIB_PHY_INPUT band_center_freq2 =%d +4951,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1631 ] PHYDEVLIB_PHY_INPUT txChMask =%x +4950,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1632 ] PHYDEVLIB_PHY_INPUT rxChMask =%x +4949,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1633 ] PHYDEVLIB_PHY_INPUT phyBase =%x +4948,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1634 ] PHYDEVLIB_PHY_INPUT phyBaseExt =%x +4947,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1635 ] PHYDEVLIB_PHY_INPUT concMode =%d +4946,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1636 ] PHYDEVLIB_PHY_INPUT dynPriChan =%d +4945,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1637 ] PHYDEVLIB_PHY_INPUT homeCh =%d +4944,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1638 ] PHYDEVLIB_PHY_INPUT dtim =%d +4943,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1639 ] PHYDEVLIB_PHY_INPUT extLNA =%d +4942,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1640 ] PHYDEVLIB_PHY_INPUT extPA =%d +4941,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1641 ] PHYDEVLIB_PHY_INPUT phyrf_init_GetPhyRfMode =%x +4940,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1642 ] PHYDEVLIB_PHY_INPUT isSBSmode =%d +4939,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1643 ] PHYDEVLIB_PHY_INPUT loType =%d +4938,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1644 ] PHYDEVLIB_PHY_INPUT dpdMode =%d +4937,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1645 ] PHYDEVLIB_PHY_INPUT loadIniMask =%d +4936,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1646 ] PHYDEVLIB_PHY_INPUT calMask =%d +4935,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1647 ] PHYDEVLIB_PHY_INPUT cal_mode_ctrl =%d +4934,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1649 ] CCAL_INPUT calCmdId =%d +4933,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1650 ] CCAL_INPUT cal_chain_mask =%x +4932,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1651 ] CCAL_INPUT cal_mode =%d +4931,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1652 ] CCAL_INPUT mode (80p80 mode) =%d +4930,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1653 ] CCAL_INPUT fixed_gain =%d +4929,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1654 ] CCAL_INPUT engineSharing =%d +4928,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1655 ] CCAL_INPUT driveTxGLUTIdx =%d +4927,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1656 ] CCAL_INPUT enableBlockAccAvg =%d +4926,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1657 ] CCAL_INPUT blockSize =%d +4925,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1658 ] CCAL_INPUT dcEstWindowSize =%d +4924,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1659 ] CCAL_INPUT numOfBlocks =%d +4923,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1660 ] CCAL_INPUT numSamplesToReadback[0] =%d +4922,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1661 ] CCAL_INPUT numSamplesToReadback[1] =%d +4921,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1662 ] CCAL_INPUT numSamplesToReadback[2] =%d +4920,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1663 ] CCAL_INPUT rxGainSettlingTime =%d +4919,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1664 ] CCAL_INPUT txGainSettlingTime =%d +4918,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1665 ] CCAL_INPUT txShiftSettlingTime =%d +4917,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1666 ] CCAL_INPUT calModeSettlingTime =%d +4916,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1667 ] CCAL_INPUT loopbackSettlingTime =%d +4915,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1668 ] CCAL_INPUT txResidueSettlingTime =%d +4914,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1669 ] CCAL_INPUT numTaps[0] =%d +4913,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1670 ] CCAL_INPUT numTaps[1] =%d +4912,iI,[ hca_HwComponentTrxPine_calSmComb.cpp : 677 ] combCal_SM_restore: RXIQ: chainIdx=%d, pStartRxIq=%x +4911,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 721 ] cannot update RxIq table in caldb for chainIdx = %d! +4910,iI,[ hca_HwComponentTrxPine_calSmComb.cpp : 800 ] combCal_SM_restore: TXIQ: chainIdx=%d, pStartTxIq=%x +4909,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 814 ] cannot update TxIq table in caldb for chainIdx = %d! +4908,iI,[ hca_HwComponentTrxPine_calSmComb.cpp : 866 ] combCal_SM_restore: TXLO: chainIdx=%d, pStartTxLo=%x +4907,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 885 ] cannot update txlo table in caldb for chainIdx = %d! +4906,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1311 ] MODE2CALID in *calMode =%d +4905,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1312 ] MODE2CALID in *calId =%d +4904,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1313 ] MODE2CALID in retValue =%d +4903,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1371 ] OVERRIDE FINALCASE pHandle =%x +4902,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1372 ] OVERRIDE FINALCASE callingContext =%d +4901,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1373 ] OVERRIDE FINALCASE calId =%d +4900,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1374 ] OVERRIDE FINALCASE in finalCase =%d +4899,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1390 ] OVERRIDE FINALCASE out finalCase =%d +4898,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1470 ] FC_HANDLE pHandle =%x +4897,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1471 ] FC_HANDLE phyInput =%x +4896,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1472 ] FC_HANDLE fdmtCombCalInput =%x +4895,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1473 ] FC_HANDLE fdmtCombCalOutput =%x +4894,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1474 ] FC_HANDLE finalCase =%d +4893,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1475 ] FC_HANDLE rfChainMask =%x +4892,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1551 ] #### reset current associated table only +4891,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1562 ] path to call docal due to NEED_TO_DO_CAL, calCmdId =%d +4890,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1398 ] ITER2CMDIDX iterIdx =%d +4889,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1423 ] ITER2CMDIDX cmdIdx =%d +4888,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1435 ] UPDATE_COMBC_TRACKING pHandle =%x +4887,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1436 ] UPDATE_COMBC_TRACKING calMode =%d +4886,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1437 ] UPDATE_COMBC_TRACKING rfChainMask =%x +4885,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1438 ] UPDATE_COMBC_TRACKING subMode80p80 =%d +4884,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1443 ] UPDATE_COMBC_TRACKING COMB_TXLO_TXIQ_RXIQ +4883,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1448 ] UPDATE_COMBC_TRACKING COMB_CAL_MODE_DPD_LP_RXIQ +4882,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1225 ] COMPOSE CMBIQ INPUT pIn =%x +4881,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1226 ] COMPOSE CMBIQ INPUT phyInput =%x +4880,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1227 ] COMPOSE CMBIQ INPUT rxdcoInput =%x +4879,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1228 ] COMPOSE CMBIQ INPUT in *calId =%x +4878,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1287 ] COMPOSE CMBIQ INPUT out *calId =%x +4877,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1329 ] FINALCASE pHandle =%x +4876,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1330 ] FINALCASE callingContext =%d +4875,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1331 ] FINALCASE calMode =%x +4874,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1332 ] FINALCASE calId =%d +4873,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1333 ] FINALCASE rfChainMask =%x +4872,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1334 ] FINALCASE in finalCase =%x +4871,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1335 ] FINALCASE statusChainMask =%x +4870,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1336 ] FINALCASE subMode80p80 =%x +4869,I,[ hca_HwComponentTrxPine_calSmComb.cpp : 1359 ] FINALCASE out finalCase =%x +4868,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1730 ] skipping comb I and Q on DFS channel in cold boot time +4867,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1821 ] CalSM: scan cal end phyId=%d +4866,i,[ hca_HwComponentTrxPine_calSmComb.cpp : 1857 ] CalSM: cal end phyId=%d +4865,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1866 ] :::: phyrf_turn_on is called +4864,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1868 ] :::: phyrf_turn_off is called +4863,,[ hca_HwComponentTrxPine_calSmComb.cpp : 1680 ] Welcome, cal SM for Comb Cal will be created.. + +4984,,[ hca_HwComponentTrxPine_calSmDac.cpp : 161 ] DACCAL_SM ::: SKIP for Scan Radio +4983,I,[ hca_HwComponentTrxPine_calSmDac.cpp : 165 ] DACCAL_SM ::: START resetCause: %x +4982,i,[ hca_HwComponentTrxPine_calSmDac.cpp : 192 ] DACCAL_SM: RECIPE : %d +4981,iiI,[ hca_HwComponentTrxPine_calSmDac.cpp : 205 ] DACCAL_SM: save invoked on chainIdx = %d bandcode= %d pDACData:0x%x +4980,iiI,[ hca_HwComponentTrxPine_calSmDac.cpp : 227 ] DACCAL_SM: restore invoked cal on chainIdx = %d bandcode=%d pDACData:0x%x +4979,,[ hca_HwComponentTrxPine_calSmDac.cpp : 241 ] CalSM: DAC cal end +4978,,[ hca_HwComponentTrxPine_calSmDac.cpp : 249 ] :::: phyrf_turn_on is called +4977,,[ hca_HwComponentTrxPine_calSmDac.cpp : 251 ] :::: phyrf_turn_off is called +4985,,[ hca_HwComponentTrxPine_calSmPadroop.cpp : 31 ] Welcome, cal SM for Dadroop Cal will be created.. + +4989,,[ hca_HwComponentTrxPine_calSmIbf.cpp : 115 ] HcaHwComponentTrxPine_calSmIbf enter + +4988,,[ hca_HwComponentTrxPine_calSmIbf.cpp : 137 ] :::: phyrf_turn_on is called +4987,,[ hca_HwComponentTrxPine_calSmIbf.cpp : 139 ] :::: phyrf_turn_off is called +4986,,[ hca_HwComponentTrxPine_calSmIbf.cpp : 34 ] Welcome, cal SM for IBF will be created.. + +5011,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 427 ] PALCAL STARTED +5010,i,[ hca_HwComponentTrxPine_calSmPdet.cpp : 438 ] PALCAL CONF final pal_cal_input->pcalMethod=%d +5009,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 439 ] PALCAL COMPLETED +5008,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 446 ] :::: phyrf_turn_on is called +5007,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 448 ] :::: phyrf_turn_off is called +5006,i,[ hca_HwComponentTrxPine_calSmPdet.cpp : 212 ] PALCAL_INPUT calCmdId =%d +5005,I,[ hca_HwComponentTrxPine_calSmPdet.cpp : 213 ] PALCAL_INPUT pPalDlyVals =%x +5004,i,[ hca_HwComponentTrxPine_calSmPdet.cpp : 214 ] PALCAL_INPUT pcalMethod =%d +5003,i,[ hca_HwComponentTrxPine_calSmPdet.cpp : 215 ] PALCAL_INPUT pcalOptDoSetEDandDM =%d +5002,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 218 ] PALCAL CONF ModeStatus[phyId=%d][ConfMode=%d][0] =%d +5001,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 219 ] PALCAL CONF ModeStatus[phyId=%d][ConfMode=%d][1] =%d +5000,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 220 ] PALCAL CONF ModeStatus[phyId=%d][ConfMode=%d][2] =%d +4999,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 221 ] PALCAL STORE palCalDlyVals[phyId=%d][%d][0] =%d +4998,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 222 ] PALCAL STORE palCalDlyVals[phyId=%d]{%d][1] =%d +4997,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 223 ] PALCAL STORE palCalDlyVals[phyId=%d][%d][2] =%d +4996,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 224 ] PALCAL STORE palCalDlyVals[phyId=%d][%d][3] =%d +4995,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 225 ] PALCAL STORE palCalDlyVals[phyId=%d][%d][4] =%d +4994,iii,[ hca_HwComponentTrxPine_calSmPdet.cpp : 226 ] PALCAL STORE palCalDlyVals[phyId=%d][%d][5] =%d +4993,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 493 ] PAL cal is disabled by BDF cal mask flag +4992,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 498 ] PAL cal is disabled for HW SBS specific board for now +4991,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 504 ] PAL cal Option control parameter is not equal to desired PAL CAL OPTION, PAL is skipped +4990,,[ hca_HwComponentTrxPine_calSmPdet.cpp : 347 ] Welcome, cal SM for Pdet Cal will be created +5113,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 345 ] CAL_COMMON_PARAM pHandle =%x +5112,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 346 ] CAL_COMMON_PARAM calType =%d +5111,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 347 ] CAL_COMMON_PARAM cmdGroupId =%d +5110,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 348 ] CAL_COMMON_PARAM isRestoreOnly =%d +5109,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 349 ] CAL_COMMON_PARAM calTypeVarianceId =%d +5108,iii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 350 ] CAL_COMMON_PARAM reserved =%d %d %d +5107,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 351 ] CAL_COMMON_PARAM (pIn->pHandle).phyId =%x +5106,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 352 ] CAL_COMMON_PARAM halphyBW =%x +5105,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 353 ] PHYDEVLIB_PHY_INPUT phyId =%d +5104,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 354 ] PHYDEVLIB_PHY_INPUT bandCode =%d +5103,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 355 ] PHYDEVLIB_PHY_INPUT bwCode =%d +5102,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 356 ] PHYDEVLIB_PHY_INPUT phyMode =%d +5101,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 357 ] PHYDEVLIB_PHY_INPUT band_center_freq1 =%d +5100,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 358 ] PHYDEVLIB_PHY_INPUT band_center_freq2 =%d +5099,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 359 ] PHYDEVLIB_PHY_INPUT txChMask =%x +5098,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 360 ] PHYDEVLIB_PHY_INPUT rxChMask =%x +5097,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 361 ] PHYDEVLIB_PHY_INPUT phyBase =%x +5096,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 362 ] PHYDEVLIB_PHY_INPUT phyBaseExt =%x +5095,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 363 ] PHYDEVLIB_PHY_INPUT concMode =%d +5094,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 364 ] PHYDEVLIB_PHY_INPUT dynPriChan =%d +5093,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 365 ] PHYDEVLIB_PHY_INPUT homeCh =%d +5092,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 366 ] PHYDEVLIB_PHY_INPUT dtim =%d +5091,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 367 ] PHYDEVLIB_PHY_INPUT extLNA =%d +5090,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 368 ] PHYDEVLIB_PHY_INPUT extPA =%d +5089,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 369 ] PHYDEVLIB_PHY_INPUT phyrf_init_GetPhyRfMode =%x +5088,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 370 ] PHYDEVLIB_PHY_INPUT isSBSmode =%d +5087,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 371 ] PHYDEVLIB_PHY_INPUT loType =%d +5086,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 372 ] PHYDEVLIB_PHY_INPUT dpdMode =%d +5085,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 373 ] PHYDEVLIB_PHY_INPUT loadIniMask =%d +5084,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 374 ] PHYDEVLIB_PHY_INPUT calMask =%x +5083,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 375 ] PHYDEVLIB_PHY_INPUT cal_mode_ctrl =%d +5082,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 376 ] PHYDEVLIB_PHY_INPUT boardId =%d +5081,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 377 ] PHYDEVLIB_PHY_INPUT phySscanEnMask =0x%x +5080,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 378 ] PHYDEVLIB_PHY_INPUT phyDfsEnMask =0x%x +5079,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 696 ] ITER2CMDIDX iterIdx =%d +5078,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 722 ] ITER2CMDIDX cmdIdx =%d +5077,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 269 ] MODE2CALID in *calMode =%d +5076,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 270 ] MODE2CALID in *calId =%d +5075,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 271 ] MODE2CALID in retValue =%d +5074,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 491 ] FC_HANDLE pHandle =%x +5073,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 492 ] FC_HANDLE phyInput =%x +5072,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 493 ] FC_HANDLE rxdcoInput =%x +5071,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 495 ] FC_HANDLE finalCase =%d +5070,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 496 ] FC_HANDLE rfChainMask =%x +5069,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 497 ] FC_HANDLE subMode80p80 =%d +5068,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 536 ] RXDCO ****** invokes rxdco RESTORE ***** +5067,iii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 594 ] RXDCO ::: BF CAL_RESTORE bwCode=%d, chainIdx=%d homech=%d +5066,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 597 ] RXDCO restore ::: pDcoLut chain 0: img:%d real:%d +5065,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 600 ] RXDCO restore ::: pDcoLut chain 1: img:%d real:%d +5064,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 603 ] RXDCO restore ::: pDcoLut chain 2: img:%d real:%d +5063,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 607 ] RXDCO restore ::: pDcoLut chain 3: img:%d real:%d +5062,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 629 ] FC_HANDLE autoIterativeIdx =%d +5061,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 630 ] FC_HANDLE rxdcoInput->calCmdId =%d +5060,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 631 ] FC_HANDLE iterIdx =%d +5059,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 632 ] RXDCO ****** invokes rxdco cal ***** +5058,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 636 ] RXDCO ::: recipe : %d , cal_mode : %d +5057,iii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 651 ] RXDCO ::: BF CAL_SAVE bwCode=%d, chainIdx=%d homeCh=%d +5056,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 654 ] RXDCO save ::: pDcoLut chain 0: img:%d real:%d +5055,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 657 ] RXDCO save ::: pDcoLut chain 1: img:%d real:%d +5054,ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 660 ] RXDCO save ::: pDcoLut chain 2: img:%d real:%d +5053,iii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 664 ] RXDCO save ::: pDcoLut chain 3: img:%d real:%d range:%d +5052,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 669 ] RXDCO ::: AFTER:CAL_SAVE convertNewRxdcoLutfromCalDb failed + +5051,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 467 ] OVERRIDE FINALCASE out finalCase =%d +5050,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 732 ] UPDATE_RXDCO_TRACKING pHandle =%x +5049,iii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 733 ] UPDATE_RXDCO_TRACKING calMode =%d (RXDCO_CAL_MODE_NORMAL=%d,RXDCO_CAL_MODE_DTIM=%d +5048,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 734 ] UPDATE_RXDCO_TRACKING rfChainMask =%x +5047,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 735 ] UPDATE_RXDCO_TRACKING subMode80p80 =%d +5046,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 740 ] UPDATE_RXDCO_TRACKING RXDCO_CAL_MODE_NORMAL +5045,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 745 ] UPDATE_RXDCO_TRACKING RXDCO_CAL_MODE_NORMAL +5044,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 291 ] COMPOSE RXDCO INPUT pIn =%x +5043,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 292 ] COMPOSE RXDCO INPUT phyInput =%x +5042,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 293 ] COMPOSE RXDCO INPUT rxdcoInput =%x +5041,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 294 ] COMPOSE RXDCO INPUT pUnionDcoLut =%x +5040,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 295 ] COMPOSE RXDCO INPUT in *calId =%x +5039,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 313 ] COMPOSE RXDCO INPUT override bwCode =%x +5038,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 337 ] COMPOSE RXDCO INPUT out *calId =%x +5037,iI,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 803 ] RXDCO ::: save TablePtr chain:%d = %p +5036,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 828 ] NEED_TO_DO_CAL:: cannot update rxdco caldb for chainIdx = %d! +5035,iI,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 762 ] RXDCO ::: restore TablePtr chain:%d = %p +5034,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 783 ] APPLICALBE_RESUBMISSION_ONLY:: failure on not getting pStart (= NULL) from caldb! +5033,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 394 ] FINALCASE pHandle =%x +5032,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 395 ] FINALCASE callingContext =%d +5031,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 396 ] FINALCASE calMode =%x +5030,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 397 ] FINALCASE calId =%d +5029,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 398 ] FINALCASE rfChainMask =%x +5028,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 399 ] FINALCASE in finalCase =%x +5027,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 400 ] FINALCASE statusChainMask =%x +5026,I,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 401 ] FINALCASE subMode80p80 =%x +5025,Ii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 434 ] FINALCASE out finalCase =%x for calMode=%d +5024,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 897 ] RXDCO SM COLDBOOT SUPPORT VERSION ************** +5023,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 910 ] RXDCO SM FINAL VERSION bandw=%d>>>>>>>>>>>>>>>>>> +5022,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 929 ] RXDCO callingContext = %d --> AFS_CAL_PROFILE +5021,iiii,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 959 ] RXDCO SM::bwCode=%d, bandCode=%d, calCmdId=%d, cal_mode=%d +5020,IiiiI,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 960 ] RXDCO SM::rxChainMask=%x, homech=%d, phyMode=%d, dtim=%d boardId=0x%x +5019,iiIi,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 965 ] RXDCO SM SKIPPED:::finalCase = %d, doCalFlag = %d, skipMask = %x, previousCalResultAtHomeCh=%d +5018,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 970 ] RXDCO SM::FCS mode, so for home channel noCal +5017,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 972 ] RXDCO SM::FCS calflag is wrong, should be doCal +5016,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 996 ] RXDCO SM FINALCASE BASED +5015,i,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 1001 ] RXDCO callingContext = %d restore doCalFlag--> AFS_CAL_PROFILE +5014,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 1011 ] :::: phyrf_turn_on is called +5013,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 1013 ] :::: phyrf_turn_off is called +5012,,[ hca_HwComponentTrxPine_calSmRxDco.cpp : 1016 ] RXDCO SM FINAL VERSION <<<<<<<<<<<<<<<<<< diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/amss.bin b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/amss.bin index befaa7bee..8ffeb5432 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/amss.bin and b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/amss.bin differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/board-2.bin b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/board-2.bin index c411b5851..11be042ba 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/board-2.bin and b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/board-2.bin differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature.ini b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature.ini new file mode 100644 index 000000000..123111331 --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature.ini @@ -0,0 +1,221 @@ + +# Copyright (c) 2018-2020 Qualcomm Technologies, Inc. +# All Rights Reserved. +# Confidential and Proprietary - Qualcomm Technologies, Inc. +# + +#Host firstly will be looking for board specific macros, if not available default macros for that specific chip is to be used. +#So add all the default strings at the end of each board type. +#Format for HK V1/V2 chipsets with same boardnames : +# boardname_v_default_ +#Format for other boards : +# boardname_default_ + +#IMPORTANT NOTE: +# 1. Duplicate entries for same board name should not be added. Please modify only the values and not add new lines for same board +# 2. Do not add boardname search strings in comments. As the host script search patterns are for boardnames in the file and does not ignore comments +############################################################################################################# +#CYPRESS-RDPs +ap-cp02-c1_enable_daemon_support=1 +ap-cp02-c1_enable_cold_boot_support=1 +ap-cp02-c1_enable_qdss_tracing=1 + +ap-cp03-c1_enable_daemon_support=1 +ap-cp03-c1_enable_cold_boot_support=1 +ap-cp03-c1_enable_qdss_tracing=1 + +#Cypress+Pine RDP, For Cypress internal radio +ap-cp01-c3_enable_daemon_support=1 +ap-cp01-c3_enable_cold_boot_support=1 +ap-cp01-c3_enable_qdss_tracing=1 + +#Cypress+Pine RDP, For Pine PCIE radio +ap-cp01-c3_qcn9000_pci0_enable_daemon_support=1 +ap-cp01-c3_qcn9000_pci0_enable_cold_boot_support=1 +ap-cp01-c3_qcn9000_pci0_enable_qdss_tracing=1 + +#For other Cypress boards enabled by default +ap-cp_default_enable_daemon_support=1 +ap-cp_default_enable_cold_boot_support=1 +ap-cp_default_enable_qdss_tracing=1 + +############################################################################################################# +#HAWKEYE-RDPs +#Hawkeye has V1 and V2 chipsets. Differentiating them by v1/v2 naming +ap-hk06_v2_enable_daemon_support=0 +ap-hk06_v2_enable_cold_boot_support=0 +ap-hk06_v2_enable_qdss_tracing=0 + +ap-hk_v1_default_enable_daemon_support=1 +ap-hk_v1_default_enable_cold_boot_support=1 +ap-hk_v1_default_enable_qdss_tracing=0 + +ap-hk_v2_default_enable_daemon_support=1 +ap-hk_v2_default_enable_cold_boot_support=1 +ap-hk_v2_default_enable_qdss_tracing=1 + +############################################################################################################# +#HK10 - Pine RDPs + +#For HK10-C1 board - HK2G internal radio +ap-hk10-c1_enable_daemon_support=1 +ap-hk10-c1_enable_cold_boot_support=1 +ap-hk10-c1_enable_qdss_tracing=1 + +#For HK10-C1 board - Pine PCIE 0 +ap-hk10-c1_qcn9000_pci0_enable_daemon_support=1 +ap-hk10-c1_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk10-c1_qcn9000_pci0_enable_qdss_tracing=1 + +#For HK10-C1 board - Pine PCIE 1 +ap-hk10-c1_qcn9000_pci1_enable_daemon_support=1 +ap-hk10-c1_qcn9000_pci1_enable_cold_boot_support=1 +ap-hk10-c1_qcn9000_pci1_enable_qdss_tracing=1 + +#For HK10-C2 board - HK2G internal radio is not present. So keep it disabled. +ap-hk10-c2_enable_daemon_support=0 +ap-hk10-c2_enable_cold_boot_support=0 +ap-hk10-c2_enable_qdss_tracing=0 + +#For HK10-C2 board - Pine PCIE 0 +ap-hk10-c2_qcn9000_pci0_enable_daemon_support=1 +ap-hk10-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk10-c2_qcn9000_pci0_enable_qdss_tracing=1 + +#For HK10-C2 board - Pine PCIE 1 +ap-hk10-c2_qcn9000_pci1_enable_daemon_support=1 +ap-hk10-c2_qcn9000_pci1_enable_cold_boot_support=1 +ap-hk10-c2_qcn9000_pci1_enable_qdss_tracing=1 + +#HK14 - Pine RDPs : Pine6G + HK(2G+5G) in HK09 platform +#For HK14 board - HK(2G+5G) internal radios (i.e, HK09 internal radios) +ap-hk14_enable_daemon_support=1 +ap-hk14_enable_cold_boot_support=1 +ap-hk14_enable_qdss_tracing=1 + +#For HK14 board - Pine PCIE 0 +ap-hk14_qcn9000_pci0_enable_daemon_support=1 +ap-hk14_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk14_qcn9000_pci0_enable_qdss_tracing=0 + +#HK01-C6 - Pine RDPs : Pine6G + HK(2G+5G) in HK01 platform +#For HK01-C6 board - HK(2G+5G) internal radios (i.e, HKv2 internal radios) +ap-hk01-c6_enable_daemon_support=1 +ap-hk01-c6_enable_cold_boot_support=1 +ap-hk01-c6_enable_qdss_tracing=0 + +#For HK01-C6 board - Pine PCIE 0 +ap-hk01-c6_qcn9000_pci0_enable_daemon_support=1 +ap-hk01-c6_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk01-c6_qcn9000_pci0_enable_qdss_tracing=1 +#No explicit defualt tags for HK10/HK14 board as of now. All Combinations of HK10/HK14 are explicitily addressed above. +#HK10/HK14 defaults to HKv2 default macros + +############################################################################################################# +#ACORN-RDPs +ap-ac_default_enable_daemon_support=1 +ap-ac_default_enable_cold_boot_support=1 +ap-ac_default_enable_qdss_tracing=1 + +############################################################################################################# +#OAK-RDPs +ap-oak_default_enable_daemon_support=1 +ap-oak_default_enable_cold_boot_support=1 +ap-oak_default_enable_qdss_tracing=1 + +############################################################################################################# +#MAPLE-RDPS + + +#Maple+Pine +ap-mp03.1_enable_daemon_support=1 +ap-mp03.1_enable_cold_boot_support=1 +ap-mp03.1_enable_qdss_tracing=1 + +ap-mp03.1_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.1_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.1_qcn9000_pci0_enable_qdss_tracing=0 + +#Maple+Pine emmc +ap-mp03.1-c2_enable_daemon_support=1 +ap-mp03.1-c2_enable_cold_boot_support=1 +ap-mp03.1-c2_enable_qdss_tracing=1 + +ap-mp03.1-c2_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.1-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.1-c2_qcn9000_pci0_enable_qdss_tracing=0 + +#Maple+Pine+Spruce +ap-mp03.3_enable_daemon_support=1 +ap-mp03.3_enable_cold_boot_support=1 +ap-mp03.3_enable_qdss_tracing=1 + +ap-mp03.3_qcn6122_pci0_enable_daemon_support=1 +ap-mp03.3_qcn6122_pci0_enable_cold_boot_support=1 +ap-mp03.3_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp03.3_qcn9000_pci1_enable_daemon_support=1 +ap-mp03.3_qcn9000_pci1_enable_cold_boot_support=1 +ap-mp03.3_qcn9000_pci1_enable_qdss_tracing=1 + +#Maple+Pine+Spruce emmc +ap-mp03.3-c2_enable_daemon_support=1 +ap-mp03.3-c2_enable_cold_boot_support=1 +ap-mp03.3-c2_enable_qdss_tracing=1 + +ap-mp03.3-c2_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.3-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.3-c2_qcn9000_pci0_enable_qdss_tracing=1 + +ap-mp03.3-c2_qcn6122_pci1_enable_daemon_support=1 +ap-mp03.3-c2_qcn6122_pci1_enable_cold_boot_support=1 +ap-mp03.3-c2_qcn6122_pci1_enable_qdss_tracing=1 + +#Maple+Spruce+Spruce +ap-mp02.1_enable_daemon_support=1 +ap-mp02.1_enable_cold_boot_support=0 +ap-mp02.1_enable_qdss_tracing=1 + +ap-mp02.1_qcn6122_pci0_enable_daemon_support=1 +ap-mp02.1_qcn6122_pci0_enable_cold_boot_support=0 +ap-mp02.1_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp02.1_qcn6122_pci1_enable_daemon_support=1 +ap-mp02.1_qcn6122_pci1_enable_cold_boot_support=0 +ap-mp02.1_qcn6122_pci1_enable_qdss_tracing=1 + +#Maple+Pine+Pine +ap-mp03.4-c1_enable_daemon_support=1 +ap-mp03.4-c1_enable_cold_boot_support=0 +ap-mp03.4-c1_enable_qdss_tracing=1 + +ap-mp03.4-c1_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.4-c1_qcn9000_pci0_enable_cold_boot_support=0 +ap-mp03.4-c1_qcn9000_pci0_enable_qdss_tracing=1 + +ap-mp03.4-c1_qcn9000_pci1_enable_daemon_support=1 +ap-mp03.4-c1_qcn9000_pci1_enable_cold_boot_support=0 +ap-mp03.4-c1_qcn9000_pci1_enable_qdss_tracing=1 + +#Maple+Spruce+Spruce +ap-mp03.5-c1_enable_daemon_support=1 +ap-mp03.5-c1_enable_cold_boot_support=1 +ap-mp03.5-c1_enable_qdss_tracing=1 + +ap-mp03.5-c1_qcn6122_pci0_enable_daemon_support=1 +ap-mp03.5-c1_qcn6122_pci0_enable_cold_boot_support=1 +ap-mp03.5-c1_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp03.5-c1_qcn6122_pci1_enable_daemon_support=1 +ap-mp03.5-c1_qcn6122_pci1_enable_cold_boot_support=1 +ap-mp03.5-c1_qcn6122_pci1_enable_qdss_tracing=1 + +ap-mp_default_enable_daemon_support=1 +ap-mp_default_enable_cold_boot_support=0 +ap-mp_default_enable_qdss_tracing=1 + +############################################################################################################# +#TEST-BOARDS +db_default_enable_daemon_support=0 +db_default_enable_cold_boot_support=0 +db_default_enable_qdss_tracing=0 diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature_512P.ini b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature_512P.ini new file mode 100644 index 000000000..344bcfdd2 --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/firmware_rdp_feature_512P.ini @@ -0,0 +1,221 @@ +# +# Copyright (c) 2018-2021 Qualcomm Technologies, Inc. +# All Rights Reserved. +# Confidential and Proprietary - Qualcomm Technologies, Inc. +# + +#Host firstly will be looking for board specific macros, if not available default macros for that specific chip is to be used. +#So add all the default strings at the end of each board type. +#Format for HK V1/V2 chipsets with same boardnames : +# boardname_v_default_ +#Format for other boards : +# boardname_default_ + +#IMPORTANT NOTE: +# 1. Duplicate entries for same board name should not be added. Please modify only the values and not add new lines for same board +# 2. Do not add boardname search strings in comments. As the host script search patterns are for boardnames in the file and does not ignore comments +############################################################################################################# +#CYPRESS-RDPs +ap-cp02-c1_enable_daemon_support=1 +ap-cp02-c1_enable_cold_boot_support=1 +ap-cp02-c1_enable_qdss_tracing=1 + +ap-cp03-c1_enable_daemon_support=1 +ap-cp03-c1_enable_cold_boot_support=1 +ap-cp03-c1_enable_qdss_tracing=1 + +#Cypress+Pine RDP, For Cypress internal radio +ap-cp01-c3_enable_daemon_support=1 +ap-cp01-c3_enable_cold_boot_support=1 +ap-cp01-c3_enable_qdss_tracing=1 + +#Cypress+Pine RDP, For Pine PCIE radio +ap-cp01-c3_qcn9000_pci0_enable_daemon_support=1 +ap-cp01-c3_qcn9000_pci0_enable_cold_boot_support=1 +ap-cp01-c3_qcn9000_pci0_enable_qdss_tracing=1 + +#For other Cypress boards enabled by default +ap-cp_default_enable_daemon_support=1 +ap-cp_default_enable_cold_boot_support=1 +ap-cp_default_enable_qdss_tracing=1 + +############################################################################################################# +#HAWKEYE-RDPs +#Hawkeye has V1 and V2 chipsets. Differentiating them by v1/v2 naming +ap-hk06_v2_enable_daemon_support=0 +ap-hk06_v2_enable_cold_boot_support=0 +ap-hk06_v2_enable_qdss_tracing=0 + +ap-hk_v1_default_enable_daemon_support=1 +ap-hk_v1_default_enable_cold_boot_support=1 +ap-hk_v1_default_enable_qdss_tracing=0 + +ap-hk_v2_default_enable_daemon_support=1 +ap-hk_v2_default_enable_cold_boot_support=1 +ap-hk_v2_default_enable_qdss_tracing=1 + +############################################################################################################# +#HK10 - Pine RDPs + +#For HK10-C1 board - HK2G internal radio +ap-hk10-c1_enable_daemon_support=1 +ap-hk10-c1_enable_cold_boot_support=1 +ap-hk10-c1_enable_qdss_tracing=1 + +#For HK10-C1 board - Pine PCIE 0 +ap-hk10-c1_qcn9000_pci0_enable_daemon_support=1 +ap-hk10-c1_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk10-c1_qcn9000_pci0_enable_qdss_tracing=1 + +#For HK10-C1 board - Pine PCIE 1 +ap-hk10-c1_qcn9000_pci1_enable_daemon_support=1 +ap-hk10-c1_qcn9000_pci1_enable_cold_boot_support=1 +ap-hk10-c1_qcn9000_pci1_enable_qdss_tracing=1 + +#For HK10-C2 board - HK2G internal radio is not present. So keep it disabled. +ap-hk10-c2_enable_daemon_support=0 +ap-hk10-c2_enable_cold_boot_support=0 +ap-hk10-c2_enable_qdss_tracing=0 + +#For HK10-C2 board - Pine PCIE 0 +ap-hk10-c2_qcn9000_pci0_enable_daemon_support=1 +ap-hk10-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk10-c2_qcn9000_pci0_enable_qdss_tracing=1 + +#For HK10-C2 board - Pine PCIE 1 +ap-hk10-c2_qcn9000_pci1_enable_daemon_support=1 +ap-hk10-c2_qcn9000_pci1_enable_cold_boot_support=1 +ap-hk10-c2_qcn9000_pci1_enable_qdss_tracing=1 + +#HK14 - Pine RDPs : Pine6G + HK(2G+5G) in HK09 platform +#For HK14 board - HK(2G+5G) internal radios (i.e, HK09 internal radios) +ap-hk14_enable_daemon_support=1 +ap-hk14_enable_cold_boot_support=1 +ap-hk14_enable_qdss_tracing=0 + +#For HK14 board - Pine PCIE 0 +ap-hk14_qcn9000_pci0_enable_daemon_support=1 +ap-hk14_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk14_qcn9000_pci0_enable_qdss_tracing=0 + +#HK01-C6 - Pine RDPs : Pine6G + HK(2G+5G) in HK01 platform +#For HK01-C6 board - HK(2G+5G) internal radios (i.e, HKv2 internal radios) +ap-hk01-c6_enable_daemon_support=1 +ap-hk01-c6_enable_cold_boot_support=1 +ap-hk01-c6_enable_qdss_tracing=1 + +#For HK01-C6 board - Pine PCIE 0 +ap-hk01-c6_qcn9000_pci0_enable_daemon_support=1 +ap-hk01-c6_qcn9000_pci0_enable_cold_boot_support=1 +ap-hk01-c6_qcn9000_pci0_enable_qdss_tracing=1 +#No explicit defualt tags for HK10/HK14 board as of now. All Combinations of HK10/HK14 are explicitily addressed above. +#HK10/HK14 defaults to HKv2 default macros + +############################################################################################################# +#ACORN-RDPs +ap-ac_default_enable_daemon_support=1 +ap-ac_default_enable_cold_boot_support=1 +ap-ac_default_enable_qdss_tracing=1 + +############################################################################################################# +#OAK-RDPs +ap-oak_default_enable_daemon_support=1 +ap-oak_default_enable_cold_boot_support=1 +ap-oak_default_enable_qdss_tracing=1 + +############################################################################################################# +#MAPLE-RDPS + + +#Maple+Pine +ap-mp03.1_enable_daemon_support=1 +ap-mp03.1_enable_cold_boot_support=1 +ap-mp03.1_enable_qdss_tracing=1 + +ap-mp03.1_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.1_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.1_qcn9000_pci0_enable_qdss_tracing=0 + +#Maple+Pine emmc +ap-mp03.1-c2_enable_daemon_support=1 +ap-mp03.1-c2_enable_cold_boot_support=1 +ap-mp03.1-c2_enable_qdss_tracing=1 + +ap-mp03.1-c2_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.1-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.1-c2_qcn9000_pci0_enable_qdss_tracing=0 + +#Maple+Pine+Spruce +ap-mp03.3_enable_daemon_support=1 +ap-mp03.3_enable_cold_boot_support=1 +ap-mp03.3_enable_qdss_tracing=1 + +ap-mp03.3_qcn6122_pci0_enable_daemon_support=1 +ap-mp03.3_qcn6122_pci0_enable_cold_boot_support=1 +ap-mp03.3_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp03.3_qcn9000_pci1_enable_daemon_support=1 +ap-mp03.3_qcn9000_pci1_enable_cold_boot_support=1 +ap-mp03.3_qcn9000_pci1_enable_qdss_tracing=1 + +#Maple+Pine+Spruce emmc +ap-mp03.3-c2_enable_daemon_support=1 +ap-mp03.3-c2_enable_cold_boot_support=1 +ap-mp03.3-c2_enable_qdss_tracing=1 + +ap-mp03.3-c2_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.3-c2_qcn9000_pci0_enable_cold_boot_support=1 +ap-mp03.3-c2_qcn9000_pci0_enable_qdss_tracing=1 + +ap-mp03.3-c2_qcn6122_pci1_enable_daemon_support=1 +ap-mp03.3-c2_qcn6122_pci1_enable_cold_boot_support=1 +ap-mp03.3-c2_qcn6122_pci1_enable_qdss_tracing=1 + +#Maple+Spruce+Spruce +ap-mp02.1_enable_daemon_support=1 +ap-mp02.1_enable_cold_boot_support=0 +ap-mp02.1_enable_qdss_tracing=1 + +ap-mp02.1_qcn6122_pci0_enable_daemon_support=1 +ap-mp02.1_qcn6122_pci0_enable_cold_boot_support=0 +ap-mp02.1_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp02.1_qcn6122_pci1_enable_daemon_support=1 +ap-mp02.1_qcn6122_pci1_enable_cold_boot_support=0 +ap-mp02.1_qcn6122_pci1_enable_qdss_tracing=1 + +#Maple+Pine+Pine +ap-mp03.4-c1_enable_daemon_support=1 +ap-mp03.4-c1_enable_cold_boot_support=0 +ap-mp03.4-c1_enable_qdss_tracing=1 + +ap-mp03.4-c1_qcn9000_pci0_enable_daemon_support=1 +ap-mp03.4-c1_qcn9000_pci0_enable_cold_boot_support=0 +ap-mp03.4-c1_qcn9000_pci0_enable_qdss_tracing=1 + +ap-mp03.4-c1_qcn9000_pci1_enable_daemon_support=1 +ap-mp03.4-c1_qcn9000_pci1_enable_cold_boot_support=0 +ap-mp03.4-c1_qcn9000_pci1_enable_qdss_tracing=1 + +#Maple+Spruce+Spruce +ap-mp03.5-c1_enable_daemon_support=1 +ap-mp03.5-c1_enable_cold_boot_support=1 +ap-mp03.5-c1_enable_qdss_tracing=1 + +ap-mp03.5-c1_qcn6122_pci0_enable_daemon_support=1 +ap-mp03.5-c1_qcn6122_pci0_enable_cold_boot_support=1 +ap-mp03.5-c1_qcn6122_pci0_enable_qdss_tracing=1 + +ap-mp03.5-c1_qcn6122_pci1_enable_daemon_support=1 +ap-mp03.5-c1_qcn6122_pci1_enable_cold_boot_support=1 +ap-mp03.5-c1_qcn6122_pci1_enable_qdss_tracing=1 + +ap-mp_default_enable_daemon_support=1 +ap-mp_default_enable_cold_boot_support=0 +ap-mp_default_enable_qdss_tracing=1 + +############################################################################################################# +#TEST-BOARDS +db_default_enable_daemon_support=0 +db_default_enable_cold_boot_support=0 +db_default_enable_qdss_tracing=0 diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/fw_version.txt b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/fw_version.txt new file mode 100644 index 000000000..660aa75df --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/fw_version.txt @@ -0,0 +1 @@ +WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 v1 diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/m3.bin b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/m3.bin index 77f248593..394a20c69 100644 Binary files a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/m3.bin and b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/m3.bin differ diff --git a/feeds/wifi-ax/ath11k-firmware/files/QCN9000/qdss_trace_config.bin b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/qdss_trace_config.bin new file mode 100644 index 000000000..477dc20cf --- /dev/null +++ b/feeds/wifi-ax/ath11k-firmware/files/QCN9000/qdss_trace_config.bin @@ -0,0 +1,104 @@ +//This comment and parser will ignore +//Tracer scenario(or commands) always +//starts with start keyword +//Below commands to enable Event traces on UMAC,MAC0,MAC1 +seq_start; +seq_type:mem_req; +//memory size always given in KB. beow example reserves 3 buffers segments of 16 KB. +sink:etr_ddr,0x1,0x400; +seq_end; +//Below commands to enable Event traces on UMAC,MAC0,MAC1 +seq_start; +seq_type:mac_event_trace; +sink:etr_ddr; +subsys_cfg_start:mac0; +swevt:0x0, 0xFFFFFFFF,0xFFFFFFFF,0x0,0x0; +hwsch:0x1, 0x6FFFF3, 0x60000, 0x00000000, 0x00000000; +rxdma:0x2, 0x3F37FE47, 0x0001E004, 0x00000000, 0x00000000; +crypto:0x3, 0xF7DB3770, 0x00000000, 0x00000000, 0x00000000; +txpcu:0x4, 0xD6C7F4E7, 0x200001D2, 0x00000000, 0x00000000; +rxole:0x5, 0x00000000, 0xFFC00000, 0x00000000, 0x00000000; +txole:0x6, 0x7C0FFE26, 0x00000000, 0x00000000, 0x00000000; +mxi:0x7, 0x00122234, 0x00000000, 0x00000000, 0x00000000; +txdma:0x8, 0x39800064, 0x00000084, 0x00000000, 0x00000000; +subsys_cfg_end:mac0; +//subsys_cfg_start:mac1; +//swevt:0x0, 0xFFFFFFFF,0xFFFFFFFF,0x0,0x0; +//hwsch:0x8, 0xEFFF1, 0x1036052C, 0x00000000, 0x00000000; +//rxdma:0x9, 0x00003400, 0x00008000, 0x00000000, 0x00000000; +//crypto:0xa, 0xf79B3770, 0x00000000, 0x00000000, 0x00000000; +//txpcu:0xb, 0xD6C7B447, 0x000000D2, 0x00000000, 0x00000000; +//txdma:0xc, 0x00001734, 0x00000084, 0x00000000, 0x00000000; +//txole:0xd, 0x7C0FFE26, 0x00000000, 0x00000000, 0x00000000; +//pdg:0xe, 0x00C00002, 0x00000000, 0x00000000, 0x00000000; +//subsys_cfg_end:mac1; +swap:0xFFFFFFFF; +trigger_start:trc; +wfi:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +ts0:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +ts1:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +ts2:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +ts3:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +ts4:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +trigger_end:trc; +memw:0xFFFFFFFF,0xFFFFFFFF; +seq_end; +// Below commands to enable obo trace on the mac0 +//seq_start; +//seq_type:mac_obo_trace; +//sink:etb_wcss; +//subsys_cfg_start:mac0; +//hwsch:0x1,0xABCDABCD; +//subsys_cfg_end:mac0; +//swap:0xABCDABCD; +//trigger_start:trc; +//wfi:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//ts0:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//ts1:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//ts2:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//ts3:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//ts4:0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF; +//trigger_end:trc; +//memw:0xFFFFFFFF,0xFFFFFFFF; +//seq_end; +// Below commands to enable TLV trace on the mac0 +//seq_start; +//seq_type:mac_tlv_trace; +//sink:etb_wcss; +//subsys_cfg_start:mac0; +//tlv_port:PDG_TXDMA_TLV; +//subsys_cfg_end:mac0; +//seq_end; +// Below commands to enable q6 etm +//seq_start; +//seq_type:q6_etm_trace; +//sink:etr_ddr; +//seq_end; +// Below commands to enable umac noc traces +//seq_start; +//seq_type:umac_noc_trace; +//sink:etb_wcss; +//ctrl:0x12; +//port_sel:0x4; +//lut:0xA; +//routeid_base:0x01000000; +//routeid_mask:0x01c00000; +//addr_lo:0x0; +//addr_hi:0x0; +//win_size:0x25; +//req_opcode:0x3; +//res_status:0x3; +//fltr_len:0xF; +//async_period:0xC; +//seq_end; +// Below commands to enable umac noc traces +//seq_start; +//seq_type:phy_tlv_trace; +//sink:etr_ddr; +//seq_end; +//seq_start; +//seq_type:phy_event_trace; +//sink:etr_ddr; +//phya:0x1,0x1; +//phyb:0x1,0x1; +//seq_end; diff --git a/feeds/wifi-ax/ath11k-wifi/Makefile b/feeds/wifi-ax/ath11k-wifi/Makefile index f7b2ee22e..523ecdd9a 100644 --- a/feeds/wifi-ax/ath11k-wifi/Makefile +++ b/feeds/wifi-ax/ath11k-wifi/Makefile @@ -102,7 +102,7 @@ define Package/ath11k-wifi-qcom-ipq8074/install endef define Package/ath11k-wifi-qcom-ipq6018/install - $(INSTALL_DIR) $(1)/lib/firmware/IPQ6018/ + $(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ $(INSTALL_DATA) ./board-2.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board-2.bin endef diff --git a/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ6018 b/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ6018 index 2731c434b..8c384dc89 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ6018 and b/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ6018 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ8074 b/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ8074 index 7310cb3f9..bf8ec2986 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ8074 and b/feeds/wifi-ax/ath11k-wifi/board-2.bin.IPQ8074 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-cig-wf188n.bin.IPQ6018 b/feeds/wifi-ax/ath11k-wifi/board-cig-wf188n.bin.IPQ6018 index 72596da49..108e2cc44 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-cig-wf188n.bin.IPQ6018 and b/feeds/wifi-ax/ath11k-wifi/board-cig-wf188n.bin.IPQ6018 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-cig-wf194c.bin.IPQ8074 b/feeds/wifi-ax/ath11k-wifi/board-cig-wf194c.bin.IPQ8074 index e2024dc84..8feb582e2 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-cig-wf194c.bin.IPQ8074 and b/feeds/wifi-ax/ath11k-wifi/board-cig-wf194c.bin.IPQ8074 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap101.bin.IPQ6018 b/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap101.bin.IPQ6018 index ecad13849..108e2cc44 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap101.bin.IPQ6018 and b/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap101.bin.IPQ6018 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap102.bin.IPQ8074 b/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap102.bin.IPQ8074 index 88fce866b..8feb582e2 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap102.bin.IPQ8074 and b/feeds/wifi-ax/ath11k-wifi/board-edgecore-eap102.bin.IPQ8074 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-tplink-ex227.bin.IPQ8074 b/feeds/wifi-ax/ath11k-wifi/board-tplink-ex227.bin.IPQ8074 index 3ce61fda7..127c8ef47 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-tplink-ex227.bin.IPQ8074 and b/feeds/wifi-ax/ath11k-wifi/board-tplink-ex227.bin.IPQ8074 differ diff --git a/feeds/wifi-ax/ath11k-wifi/board-tplink-ex447.bin.IPQ8074 b/feeds/wifi-ax/ath11k-wifi/board-tplink-ex447.bin.IPQ8074 index 31eb856b8..548c7dcf0 100644 Binary files a/feeds/wifi-ax/ath11k-wifi/board-tplink-ex447.bin.IPQ8074 and b/feeds/wifi-ax/ath11k-wifi/board-tplink-ex447.bin.IPQ8074 differ diff --git a/feeds/wifi-ax/batman-adv/src/compat-qca.h b/feeds/wifi-ax/batman-adv/src/compat-qca.h index 8bd04ce5b..9e2709eac 100644 --- a/feeds/wifi-ax/batman-adv/src/compat-qca.h +++ b/feeds/wifi-ax/batman-adv/src/compat-qca.h @@ -52,21 +52,6 @@ int ipv6_mc_check_mld(struct sk_buff *skb); #include_next #include_next -static inline int batadv_ipv6_mc_check_mld1(struct sk_buff *skb) -{ - return ipv6_mc_check_mld(skb, NULL); -} - -static inline int batadv_ipv6_mc_check_mld2(struct sk_buff *skb, - struct sk_buff **skb_trimmed) -{ - return ipv6_mc_check_mld(skb, skb_trimmed); -} - -#define ipv6_mc_check_mld_get(_1, _2, ipv6_mc_check_mld_name, ...) ipv6_mc_check_mld_name -#define ipv6_mc_check_mld(...) \ - ipv6_mc_check_mld_get(__VA_ARGS__, batadv_ipv6_mc_check_mld2, batadv_ipv6_mc_check_mld1)(__VA_ARGS__) - static inline int batadv_ip_mc_check_igmp1(struct sk_buff *skb) { return ip_mc_check_igmp(skb, NULL); @@ -229,17 +214,3 @@ static inline int batadv_access_ok(int type, const void __user *p, #endif #endif /* < KERNEL_VERSION(5, 4, 0) */ - - -#if LINUX_VERSION_IS_LESS(5, 10, 0) - -#define netif_rx_any_context batadv_netif_rx_any_context -static inline int batadv_netif_rx_any_context(struct sk_buff *skb) -{ - if (in_interrupt()) - return netif_rx(skb); - else - return netif_rx_ni(skb); -} - -#endif /* LINUX_VERSION_IS_LESS(5, 10, 0) */ diff --git a/feeds/wifi-ax/hostapd/Config.in b/feeds/wifi-ax/hostapd/Config.in index 81a374c65..5c00f3e24 100644 --- a/feeds/wifi-ax/hostapd/Config.in +++ b/feeds/wifi-ax/hostapd/Config.in @@ -13,6 +13,8 @@ config WPA_RFKILL_SUPPORT PACKAGE_wpad-openssl || \ PACKAGE_wpad-wolfssl || \ PACKAGE_wpad-basic || \ + PACKAGE_wpad-basic-openssl || \ + PACKAGE_wpad-basic-wolfssl || \ PACKAGE_wpad-mini || \ PACKAGE_wpad-mesh-openssl || \ PACKAGE_wpad-mesh-wolfssl @@ -32,6 +34,8 @@ config WPA_MSG_MIN_PRIORITY PACKAGE_wpad-openssl || \ PACKAGE_wpad-wolfssl || \ PACKAGE_wpad-basic || \ + PACKAGE_wpad-basic-openssl || \ + PACKAGE_wpad-basic-wolfssl || \ PACKAGE_wpad-mini || \ PACKAGE_wpad-mesh-openssl || \ PACKAGE_wpad-mesh-wolfssl @@ -49,6 +53,7 @@ config WPA_WOLFSSL bool default PACKAGE_wpa-supplicant-wolfssl ||\ PACKAGE_wpad-wolfssl ||\ + PACKAGE_wpad-basic-wolfssl || \ PACKAGE_wpad-mesh-wolfssl ||\ PACKAGE_eapol-test-wolfssl select WOLFSSL_HAS_AES_CCM @@ -74,10 +79,6 @@ config DRIVER_11AX_SUPPORT bool default n -config DRIVER_11W_SUPPORT - bool - default n - config WPA_ENABLE_WEP bool "Enable support for unsecure and obsolete WEP" help diff --git a/feeds/wifi-ax/hostapd/Makefile b/feeds/wifi-ax/hostapd/Makefile index 1eee6925b..2142fa9a1 100644 --- a/feeds/wifi-ax/hostapd/Makefile +++ b/feeds/wifi-ax/hostapd/Makefile @@ -1,19 +1,17 @@ -# Copyright (C) 2006-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. +# SPDX-License-Identifier: GPL-2.0-only # +# Copyright (C) 2006-2021 OpenWrt.org include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-07-02 -PKG_SOURCE_VERSION:=58b384f467 -PKG_MIRROR_HASH:=75547b2cca6edf1010180af2b6b0ab0592ffc2c13c861c163ff851490108f81b +PKG_SOURCE_DATE:=2021-02-20 +PKG_SOURCE_VERSION:=59e9794c7d7e +PKG_MIRROR_HASH:=22ef855a2731aa5889e19d1e61f0128ba5a092a94c15de5cadad3baf42048f3d PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -94,35 +92,37 @@ DRIVER_MAKEOPTS= \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ -ifneq ($(LOCAL_VARIANT),mini) - DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) +ifeq ($(SSL_VARIANT),openssl) + DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y + TARGET_LDFLAGS += -lcrypto -lssl + + ifeq ($(LOCAL_VARIANT),basic) + DRIVER_MAKEOPTS += CONFIG_OWE=y + endif + ifeq ($(LOCAL_VARIANT),mesh) + DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y + endif + ifeq ($(LOCAL_VARIANT),full) + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y + endif endif -ifeq ($(LOCAL_VARIANT),full) - DRIVER_MAKEOPTS += CONFIG_HS20=y CONFIG_INTERWORKING=y - ifeq ($(SSL_VARIANT),openssl) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y - TARGET_LDFLAGS += -lcrypto -lssl +ifeq ($(SSL_VARIANT),wolfssl) + DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y + TARGET_LDFLAGS += -lwolfssl + + ifeq ($(LOCAL_VARIANT),basic) + DRIVER_MAKEOPTS += CONFIG_OWE=y endif - ifeq ($(SSL_VARIANT),wolfssl) - DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y - TARGET_LDFLAGS += -lwolfssl + ifeq ($(LOCAL_VARIANT),mesh) + DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 + endif + ifeq ($(LOCAL_VARIANT),full) + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 endif endif ifneq ($(LOCAL_TYPE),hostapd) - DRIVER_MAKEOPTS += CONFIG_HS20=y CONFIG_INTERWORKING=y - ifeq ($(LOCAL_VARIANT),mesh) - ifeq ($(SSL_VARIANT),openssl) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y - TARGET_LDFLAGS += -lcrypto -lssl - endif - ifeq ($(SSL_VARIANT),wolfssl) - DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y - TARGET_LDFLAGS += -lwolfssl - endif - endif - ifdef CONFIG_WPA_RFKILL_SUPPORT DRIVER_MAKEOPTS += NEED_RFKILL=y endif @@ -143,6 +143,7 @@ define Package/hostapd/Default TITLE:=IEEE 802.1x Authenticator URL:=http://hostap.epitest.fi/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + USERID:=network=101:network=101 PROVIDES:=hostapd CONFLICTS:=$(HOSTAPD_PROVIDERS) HOSTAPD_PROVIDERS+=$(1) @@ -150,7 +151,7 @@ endef define Package/hostapd $(call Package/hostapd/Default,$(1)) - TITLE+= (full) + TITLE+= (built-in full) VARIANT:=full-internal endef @@ -161,7 +162,7 @@ endef define Package/hostapd-openssl $(call Package/hostapd/Default,$(1)) - TITLE+= (full) + TITLE+= (OpenSSL full) VARIANT:=full-openssl DEPENDS+=+libopenssl endef @@ -170,7 +171,7 @@ Package/hostapd-openssl/description = $(Package/hostapd/description) define Package/hostapd-wolfssl $(call Package/hostapd/Default,$(1)) - TITLE+= (full) + TITLE+= (wolfSSL full) VARIANT:=full-wolfssl DEPENDS+=+libwolfssl endef @@ -179,7 +180,7 @@ Package/hostapd-wolfssl/description = $(Package/hostapd/description) define Package/hostapd-basic $(call Package/hostapd/Default,$(1)) - TITLE+= (WPA-PSK, 11r and 11w) + TITLE+= (WPA-PSK, 11r, 11w) VARIANT:=basic endef @@ -187,6 +188,28 @@ define Package/hostapd-basic/description This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. endef +define Package/hostapd-basic-openssl +$(call Package/hostapd/Default,$(1)) + TITLE+= (WPA-PSK, 11r and 11w) + VARIANT:=basic-openssl + DEPENDS+=+libopenssl +endef + +define Package/hostapd-basic-openssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. +endef + +define Package/hostapd-basic-wolfssl +$(call Package/hostapd/Default,$(1)) + TITLE+= (WPA-PSK, 11r and 11w) + VARIANT:=basic-wolfssl + DEPENDS+=+libwolfssl +endef + +define Package/hostapd-basic-wolfssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. +endef + define Package/hostapd-mini $(call Package/hostapd/Default,$(1)) TITLE+= (WPA-PSK only) @@ -202,8 +225,9 @@ define Package/wpad/Default SECTION:=net CATEGORY:=Network SUBMENU:=WirelessAPD - TITLE:=IEEE 802.1x Authenticator/Supplicant + TITLE:=IEEE 802.1x Auth/Supplicant DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + USERID:=network=101:network=101 URL:=http://hostap.epitest.fi/ PROVIDES:=hostapd wpa-supplicant CONFLICTS:=$(HOSTAPD_PROVIDERS) $(SUPPLICANT_PROVIDERS) @@ -213,7 +237,7 @@ endef define Package/wpad $(call Package/wpad/Default,$(1)) - TITLE+= (full) + TITLE+= (built-in full) VARIANT:=wpad-full-internal endef @@ -224,7 +248,7 @@ endef define Package/wpad-openssl $(call Package/wpad/Default,$(1)) - TITLE+= (full) + TITLE+= (OpenSSL full) VARIANT:=wpad-full-openssl DEPENDS+=+libopenssl endef @@ -233,7 +257,7 @@ Package/wpad-openssl/description = $(Package/wpad/description) define Package/wpad-wolfssl $(call Package/wpad/Default,$(1)) - TITLE+= (full) + TITLE+= (wolfSSL full) VARIANT:=wpad-full-wolfssl DEPENDS+=+libwolfssl endef @@ -242,7 +266,7 @@ Package/wpad-wolfssl/description = $(Package/wpad/description) define Package/wpad-basic $(call Package/wpad/Default,$(1)) - TITLE+= (WPA-PSK, 11r and 11w) + TITLE+= (WPA-PSK, 11r, 11w) VARIANT:=wpad-basic endef @@ -250,6 +274,28 @@ define Package/wpad-basic/description This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, 802.11r and 802.11w support. endef +define Package/wpad-basic-openssl +$(call Package/wpad/Default,$(1)) + TITLE+= (OpenSSL, 11r, 11w) + VARIANT:=wpad-basic-openssl + DEPENDS+=+libopenssl +endef + +define Package/wpad-basic-openssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support. +endef + +define Package/wpad-basic-wolfssl +$(call Package/wpad/Default,$(1)) + TITLE+= (wolfSSL, 11r, 11w) + VARIANT:=wpad-basic-wolfssl + DEPENDS+=+libwolfssl +endef + +define Package/wpad-basic-wolfssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support. +endef + define Package/wpad-mini $(call Package/wpad/Default,$(1)) TITLE+= (WPA-PSK only) @@ -262,7 +308,6 @@ endef define Package/wpad-mesh $(call Package/wpad/Default,$(1)) - TITLE+= (with 802.11s mesh and SAE support) DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) PROVIDES+=wpa-supplicant-mesh wpad-mesh endef @@ -273,6 +318,7 @@ endef define Package/wpad-mesh-openssl $(call Package/wpad-mesh,$(1)) + TITLE+= (OpenSSL, 11s, SAE) DEPENDS+=+libopenssl VARIANT:=wpad-mesh-openssl endef @@ -281,6 +327,7 @@ Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description) define Package/wpad-mesh-wolfssl $(call Package/wpad-mesh,$(1)) + TITLE+= (wolfSSL, 11s, SAE) DEPENDS+=+libwolfssl VARIANT:=wpad-mesh-wolfssl endef @@ -295,6 +342,7 @@ define Package/wpa-supplicant/Default TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + USERID:=network=101:network=101 PROVIDES:=wpa-supplicant CONFLICTS:=$(SUPPLICANT_PROVIDERS) SUPPLICANT_PROVIDERS+=$(1) @@ -302,17 +350,20 @@ endef define Package/wpa-supplicant $(call Package/wpa-supplicant/Default,$(1)) + TITLE+= (built-in full) VARIANT:=supplicant-full-internal endef define Package/wpa-supplicant-openssl $(call Package/wpa-supplicant/Default,$(1)) + TITLE+= (OpenSSL full) VARIANT:=supplicant-full-openssl DEPENDS+=+libopenssl endef define Package/wpa-supplicant-wolfssl $(call Package/wpa-supplicant/Default,$(1)) + TITLE+= (wolfSSL full) VARIANT:=supplicant-full-wolfssl DEPENDS+=+libwolfssl endef @@ -323,39 +374,40 @@ endef define Package/wpa-supplicant-p2p $(call Package/wpa-supplicant/Default,$(1)) - TITLE+= (with Wi-Fi P2P support) + TITLE+= (Wi-Fi P2P support) DEPENDS+=@PACKAGE_kmod-cfg80211 VARIANT:=supplicant-p2p-internal endef define Package/wpa-supplicant-mesh/Default $(call Package/wpa-supplicant/Default,$(1)) - TITLE+= (with 802.11s and SAE) DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) PROVIDES+=wpa-supplicant-mesh endef define Package/wpa-supplicant-mesh-openssl $(call Package/wpa-supplicant-mesh/Default,$(1)) + TITLE+= (OpenSSL, 11s, SAE) VARIANT:=supplicant-mesh-openssl DEPENDS+=+libopenssl endef define Package/wpa-supplicant-mesh-wolfssl $(call Package/wpa-supplicant-mesh/Default,$(1)) + TITLE+= (wolfSSL, 11s, SAE) VARIANT:=supplicant-mesh-wolfssl DEPENDS+=+libwolfssl endef define Package/wpa-supplicant-basic $(call Package/wpa-supplicant/Default,$(1)) - TITLE+= (with 11r and 11w) + TITLE+= (11r, 11w) VARIANT:=supplicant-basic endef define Package/wpa-supplicant-mini $(call Package/wpa-supplicant/Default,$(1)) - TITLE+= (minimal version) + TITLE+= (minimal) VARIANT:=supplicant-mini endef @@ -389,34 +441,35 @@ define Package/wpa-cli TITLE:=WPA Supplicant command line control utility endef -define Package/eapol-test - TITLE:=802.1x authentication test utility +define Package/eapol-test/Default + TITLE:=802.1x auth test utility SECTION:=net SUBMENU:=WirelessAPD CATEGORY:=Network - VARIANT:=supplicant-full-internal DEPENDS:=$(DRV_DEPENDS) +libubus endef +define Package/eapol-test + $(call Package/eapol-test/Default,$(1)) + TITLE+= (built-in full) + VARIANT:=supplicant-full-internal +endef + define Package/eapol-test-openssl - TITLE:=802.1x authentication test utility - SECTION:=net - CATEGORY:=Network - SUBMENU:=WirelessAPD + $(call Package/eapol-test/Default,$(1)) + TITLE+= (OpenSSL full) VARIANT:=supplicant-full-openssl CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS)) - DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl + DEPENDS+=+libopenssl PROVIDES:=eapol-test endef define Package/eapol-test-wolfssl - TITLE:=802.1x authentication test utility - SECTION:=net - CATEGORY:=Network - SUBMENU:=WirelessAPD + $(call Package/eapol-test/Default,$(1)) + TITLE+= (wolfSSL full) VARIANT:=supplicant-full-wolfssl CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS))) - DEPENDS:=$(DRV_DEPENDS) +libubus +libwolfssl + DEPENDS+=+libwolfssl PROVIDES:=eapol-test endef @@ -436,7 +489,9 @@ define Build/Configure $(if $(wildcard ./files/hostapd-$(CONFIG_VARIANT).config), \ $(CP) ./files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \ ) - $(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config + $(if $(wildcard ./files/wpa_supplicant-$(CONFIG_VARIANT).config), \ + $(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config + ) endef TARGET_CPPFLAGS := \ @@ -467,6 +522,7 @@ define Build/RunMake LIBS_c="$(TARGET_LDFLAGS_C)" \ AR="$(TARGET_CROSS)gcc-ar" \ BCHECK= \ + $(if $(findstring s,$(OPENWRT_VERBOSE)),V=1) \ $(2) endef @@ -539,10 +595,12 @@ define Install/supplicant endef define Package/hostapd-common/install - $(INSTALL_DIR) $(1)/lib/netifd $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps + $(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d + $(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities endef define Package/hostapd/install @@ -550,6 +608,8 @@ define Package/hostapd/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/ endef Package/hostapd-basic/install = $(Package/hostapd/install) +Package/hostapd-basic-openssl/install = $(Package/hostapd/install) +Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install) Package/hostapd-mini/install = $(Package/hostapd/install) Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install) @@ -569,6 +629,8 @@ define Package/wpad/install $(LN) wpad $(1)/usr/sbin/wpa_supplicant endef Package/wpad-basic/install = $(Package/wpad/install) +Package/wpad-basic-openssl/install = $(Package/wpad/install) +Package/wpad-basic-wolfssl/install = $(Package/wpad/install) Package/wpad-mini/install = $(Package/wpad/install) Package/wpad-openssl/install = $(Package/wpad/install) Package/wpad-wolfssl/install = $(Package/wpad/install) @@ -617,6 +679,8 @@ endif $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-basic)) +$(eval $(call BuildPackage,hostapd-basic-openssl)) +$(eval $(call BuildPackage,hostapd-basic-wolfssl)) $(eval $(call BuildPackage,hostapd-mini)) $(eval $(call BuildPackage,hostapd-openssl)) $(eval $(call BuildPackage,hostapd-wolfssl)) @@ -624,6 +688,8 @@ $(eval $(call BuildPackage,wpad)) $(eval $(call BuildPackage,wpad-mesh-openssl)) $(eval $(call BuildPackage,wpad-mesh-wolfssl)) $(eval $(call BuildPackage,wpad-basic)) +$(eval $(call BuildPackage,wpad-basic-openssl)) +$(eval $(call BuildPackage,wpad-basic-wolfssl)) $(eval $(call BuildPackage,wpad-mini)) $(eval $(call BuildPackage,wpad-openssl)) $(eval $(call BuildPackage,wpad-wolfssl)) diff --git a/feeds/wifi-ax/hostapd/files/hostapd-basic.config b/feeds/wifi-ax/hostapd/files/hostapd-basic.config index c3726dd55..33c38192b 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd-basic.config +++ b/feeds/wifi-ax/hostapd/files/hostapd-basic.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -CONFIG_IEEE80211AX=y +#CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging @@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y @@ -384,7 +384,7 @@ CONFIG_TLS=internal #CONFIG_OWE=y # Airtime policy support -#CONFIG_AIRTIME_POLICY=y +CONFIG_AIRTIME_POLICY=y # Override default value for the wpa_disable_eapol_key_retries configuration # parameter. See that parameter in hostapd.conf for more details. diff --git a/feeds/wifi-ax/hostapd/files/hostapd-full.config b/feeds/wifi-ax/hostapd/files/hostapd-full.config index f3530e6e6..61b6daf86 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd-full.config +++ b/feeds/wifi-ax/hostapd/files/hostapd-full.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -CONFIG_IEEE80211AX=y +#CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging @@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y @@ -313,7 +313,7 @@ CONFIG_INTERNAL_LIBTOMMATH=y # Interworking (IEEE 802.11u) # This can be used to enable functionality to improve interworking with # external networks. -#CONFIG_INTERWORKING=y +CONFIG_INTERWORKING=y # Hotspot 2.0 #CONFIG_HS20=y @@ -384,7 +384,7 @@ CONFIG_TAXONOMY=y #CONFIG_OWE=y # Airtime policy support -#CONFIG_AIRTIME_POLICY=y +CONFIG_AIRTIME_POLICY=y # Override default value for the wpa_disable_eapol_key_retries configuration # parameter. See that parameter in hostapd.conf for more details. diff --git a/feeds/wifi-ax/hostapd/files/hostapd-mini.config b/feeds/wifi-ax/hostapd/files/hostapd-mini.config index 8589c41bd..b3050f7bb 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd-mini.config +++ b/feeds/wifi-ax/hostapd/files/hostapd-mini.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -CONFIG_IEEE80211AX=y +#CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging @@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y diff --git a/feeds/wifi-ax/hostapd/files/wpa_supplicant-basic.config b/feeds/wifi-ax/hostapd/files/wpa_supplicant-basic.config index db3f7c7a1..c550b37b2 100644 --- a/feeds/wifi-ax/hostapd/files/wpa_supplicant-basic.config +++ b/feeds/wifi-ax/hostapd/files/wpa_supplicant-basic.config @@ -290,7 +290,7 @@ CONFIG_NO_CONFIG_WRITE=y #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y diff --git a/feeds/wifi-ax/hostapd/files/wpa_supplicant-full.config b/feeds/wifi-ax/hostapd/files/wpa_supplicant-full.config index 982f4d553..b3e85d073 100644 --- a/feeds/wifi-ax/hostapd/files/wpa_supplicant-full.config +++ b/feeds/wifi-ax/hostapd/files/wpa_supplicant-full.config @@ -290,7 +290,7 @@ CONFIG_BACKEND=file #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y @@ -490,10 +490,10 @@ CONFIG_WNM=y # This can be used to enable functionality to improve interworking with # external networks (GAS/ANQP to learn more about the networks and network # selection based on available credentials). -#CONFIG_INTERWORKING=y +CONFIG_INTERWORKING=y # Hotspot 2.0 -#CONFIG_HS20=y +CONFIG_HS20=y # Enable interface matching in wpa_supplicant #CONFIG_MATCH_IFACE=y diff --git a/feeds/wifi-ax/hostapd/files/wpa_supplicant-mini.config b/feeds/wifi-ax/hostapd/files/wpa_supplicant-mini.config index c1e0141ed..9eb1111e5 100644 --- a/feeds/wifi-ax/hostapd/files/wpa_supplicant-mini.config +++ b/feeds/wifi-ax/hostapd/files/wpa_supplicant-mini.config @@ -290,7 +290,7 @@ CONFIG_NO_CONFIG_WRITE=y #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y diff --git a/feeds/wifi-ax/hostapd/files/wpa_supplicant-p2p.config b/feeds/wifi-ax/hostapd/files/wpa_supplicant-p2p.config index 515604828..b00847a25 100644 --- a/feeds/wifi-ax/hostapd/files/wpa_supplicant-p2p.config +++ b/feeds/wifi-ax/hostapd/files/wpa_supplicant-p2p.config @@ -290,7 +290,7 @@ CONFIG_BACKEND=file #CONFIG_ELOOP_POLL=y # Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y +CONFIG_ELOOP_EPOLL=y # Should we use kqueue instead of select? Select is used by default. #CONFIG_ELOOP_KQUEUE=y diff --git a/feeds/wifi-ax/hostapd/files/wpad.init b/feeds/wifi-ax/hostapd/files/wpad.init index e2cd380cb..79c5bf107 100644 --- a/feeds/wifi-ax/hostapd/files/wpad.init +++ b/feeds/wifi-ax/hostapd/files/wpad.init @@ -9,17 +9,33 @@ NAME=wpad start_service() { if [ -x "/usr/sbin/hostapd" ]; then mkdir -p /var/run/hostapd + chown network:network /var/run/hostapd procd_open_instance hostapd procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global - procd_set_param respawn 3600 5 0 + procd_set_param respawn 3600 1 0 + [ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && { + procd_add_jail hostapd + procd_set_param capabilities /etc/capabilities/wpad.json + procd_set_param user network + procd_set_param group network + procd_set_param no_new_privs 1 + } procd_close_instance fi if [ -x "/usr/sbin/wpa_supplicant" ]; then mkdir -p /var/run/wpa_supplicant + chown network:network /var/run/wpa_supplicant procd_open_instance supplicant procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global - procd_set_param respawn 3600 5 0 + procd_set_param respawn 3600 1 0 + [ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && { + procd_add_jail wpa_supplicant + procd_set_param capabilities /etc/capabilities/wpad.json + procd_set_param user network + procd_set_param group network + procd_set_param no_new_privs 1 + } procd_close_instance fi } diff --git a/feeds/wifi-ax/hostapd/files/wpad.json b/feeds/wifi-ax/hostapd/files/wpad.json new file mode 100644 index 000000000..c73f3d98b --- /dev/null +++ b/feeds/wifi-ax/hostapd/files/wpad.json @@ -0,0 +1,22 @@ +{ + "bounding": [ + "CAP_NET_ADMIN", + "CAP_NET_RAW" + ], + "effective": [ + "CAP_NET_ADMIN", + "CAP_NET_RAW" + ], + "ambient": [ + "CAP_NET_ADMIN", + "CAP_NET_RAW" + ], + "permitted": [ + "CAP_NET_ADMIN", + "CAP_NET_RAW" + ], + "inheritable": [ + "CAP_NET_ADMIN", + "CAP_NET_RAW" + ] +} diff --git a/feeds/wifi-ax/hostapd/files/wpad_acl.json b/feeds/wifi-ax/hostapd/files/wpad_acl.json new file mode 100644 index 000000000..c77ccd8ea --- /dev/null +++ b/feeds/wifi-ax/hostapd/files/wpad_acl.json @@ -0,0 +1,10 @@ +{ + "user": "network", + "access": { + "service": { + "methods": [ "event" ] + } + }, + "publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ], + "send": [ "bss.*", "wps_credentials" ] +} diff --git a/feeds/wifi-ax/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch b/feeds/wifi-ax/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch new file mode 100644 index 000000000..84fc1c935 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch @@ -0,0 +1,43 @@ +From 21ce83b4ae2b9563175fdb4fc4312096cc399cf8 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Wed, 5 May 2021 00:44:34 +0200 +Subject: [PATCH] wolfssl: add RNG to EC key + +Since upstream commit 6467de5a8840 ("Randomize z ordinates in +scalar mult when timing resistant") WolfSSL requires a RNG for +the EC key when built hardened which is the default. + +Set the RNG for the EC key to fix connections for OWE clients. + +Signed-off-by: David Bauer +--- + src/crypto/crypto_wolfssl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/src/crypto/crypto_wolfssl.c ++++ b/src/crypto/crypto_wolfssl.c +@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point * + + struct crypto_ec { + ecc_key key; ++ WC_RNG rng; + mp_int a; + mp_int prime; + mp_int order; +@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int gr + return NULL; + + if (wc_ecc_init(&e->key) != 0 || ++ wc_InitRng(&e->rng) != 0 || ++ wc_ecc_set_rng(&e->key, &e->rng) != 0 || + wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || + mp_init(&e->a) != MP_OKAY || + mp_init(&e->prime) != MP_OKAY || +@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* + mp_clear(&e->order); + mp_clear(&e->prime); + mp_clear(&e->a); ++ wc_FreeRng(&e->rng); + wc_ecc_free(&e->key); + os_free(e); + } diff --git a/feeds/wifi-ax/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch b/feeds/wifi-ax/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch deleted file mode 100644 index 54dea274f..000000000 --- a/feeds/wifi-ax/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch +++ /dev/null @@ -1,124 +0,0 @@ -From c05ace7510ead96e72b97ce47b33f7b5865d6d36 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:38 -0700 -Subject: [PATCH 1/7] mesh: use setup completion callback to complete mesh join - -mesh join function is the last function to be called during -mesh join process, but it's been called a bit earlier than -it's supposed to be, so that some mesh parameter values -such as VHT capabilities not applied correct when mesh join -is in process. -Moreover current design of mesh join that is called directly -after mesh initialization isn't suitable for DFS channels to use, -since mesh join process should be paused until DFS CAC is -done and resumed after it's done. -The callback will be called by hostapd_setup_interface_complete_sync. -There is possiblity that completing mesh init fails, so add error -handle codes. - -Signed-off-by: Peter Oh -Signed-off-by: Peter Oh ---- - src/ap/hostapd.c | 11 ++++++++++- - wpa_supplicant/mesh.c | 13 +++++++------ - 2 files changed, 17 insertions(+), 7 deletions(-) - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -434,6 +434,8 @@ static void hostapd_free_hapd_data(struc - #ifdef CONFIG_MESH - wpabuf_free(hapd->mesh_pending_auth); - hapd->mesh_pending_auth = NULL; -+ /* handling setup failure is already done */ -+ hapd->setup_complete_cb = NULL; - #endif /* CONFIG_MESH */ - - hostapd_clean_rrm(hapd); -@@ -2156,6 +2158,13 @@ dfs_offload: - if (hapd->setup_complete_cb) - hapd->setup_complete_cb(hapd->setup_complete_cb_ctx); - -+#ifdef CONFIG_MESH -+ if (delay_apply_cfg && !iface->mconf) { -+ wpa_printf(MSG_ERROR, "Error while completing mesh init"); -+ goto fail; -+ } -+#endif /* CONFIG_MESH */ -+ - wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", - iface->bss[0]->conf->iface); - if (iface->interfaces && iface->interfaces->terminate_on_error > 0) -@@ -2299,7 +2308,7 @@ int hostapd_setup_interface(struct hosta - ret = setup_interface(iface); - if (ret) { - wpa_printf(MSG_ERROR, "%s: Unable to setup interface.", -- iface->bss[0]->conf->iface); -+ iface->conf ? iface->conf->bss[0]->iface : "N/A"); - return -1; - } - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -194,8 +194,9 @@ static int wpas_mesh_init_rsn(struct wpa - } - - --static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) -+static void wpas_mesh_complete_cb(void *ctx) - { -+ struct wpa_supplicant *wpa_s = ctx; - struct hostapd_iface *ifmsh = wpa_s->ifmsh; - struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params; - struct wpa_ssid *ssid = wpa_s->current_ssid; -@@ -204,7 +205,7 @@ static int wpas_mesh_complete(struct wpa - if (!params || !ssid || !ifmsh) { - wpa_printf(MSG_ERROR, "mesh: %s called without active mesh", - __func__); -- return -1; -+ return; - } - - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && -@@ -213,7 +214,7 @@ static int wpas_mesh_complete(struct wpa - "mesh: RSN initialization failed - deinit mesh"); - wpa_supplicant_mesh_deinit(wpa_s); - wpa_drv_leave_mesh(wpa_s); -- return -1; -+ return; - } - - if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) { -@@ -239,8 +240,6 @@ static int wpas_mesh_complete(struct wpa - - if (!ret) - wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); -- -- return ret; - } - - -@@ -267,6 +266,7 @@ static int wpa_supplicant_mesh_init(stru - if (!ifmsh) - return -ENOMEM; - -+ ifmsh->owner = wpa_s; - ifmsh->drv_flags = wpa_s->drv_flags; - ifmsh->drv_flags2 = wpa_s->drv_flags2; - ifmsh->num_bss = 1; -@@ -285,6 +285,8 @@ static int wpa_supplicant_mesh_init(stru - bss->drv_priv = wpa_s->drv_priv; - bss->iface = ifmsh; - bss->mesh_sta_free_cb = mesh_mpm_free_sta; -+ bss->setup_complete_cb = wpas_mesh_complete_cb; -+ bss->setup_complete_cb_ctx = wpa_s; - frequency = ssid->frequency; - if (frequency != freq->freq && - frequency == freq->freq + freq->sec_channel_offset * 20) { -@@ -526,7 +528,6 @@ int wpa_supplicant_join_mesh(struct wpa_ - goto out; - } - -- ret = wpas_mesh_complete(wpa_s); - out: - return ret; - } diff --git a/feeds/wifi-ax/hostapd/patches/005-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch b/feeds/wifi-ax/hostapd/patches/005-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch deleted file mode 100644 index 1167982ba..000000000 --- a/feeds/wifi-ax/hostapd/patches/005-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c56f18380d1d404a2abc0ea5373d294508ef1e54 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:41 -0700 -Subject: [PATCH 2/7] mesh: update ssid->frequency as pri/sec channel switch - -ssid->frequency is one of variables used to gets channel -number from given frequency. Leave it as unchanged when -pri/sec channel switched will cause picking up wrong -channel number after applying secondary channel offset -for HT40 and leads failing interface bring-up. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -292,6 +292,7 @@ static int wpa_supplicant_mesh_init(stru - frequency == freq->freq + freq->sec_channel_offset * 20) { - wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched"); - frequency = freq->freq; -+ ssid->frequency = frequency; - } - wpa_s->assoc_freq = frequency; - wpa_s->current_ssid = ssid; diff --git a/feeds/wifi-ax/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch b/feeds/wifi-ax/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch deleted file mode 100644 index 2ca15e5d1..000000000 --- a/feeds/wifi-ax/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 593602b7f14be5c2695979639764b1c50f01bbec Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:49 -0700 -Subject: [PATCH 7/7] mesh: inform kernel driver DFS handler in userspace - -NL80211_ATTR_HANDLE_DFS is required by kerenel space -to enable DFS channels that indicates DFS handler -resides in userspace. - -Signed-off-by: Peter Oh ---- - src/drivers/driver.h | 1 + - src/drivers/driver_nl80211.c | 3 +++ - wpa_supplicant/mesh.c | 1 + - 3 files changed, 5 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1542,6 +1542,7 @@ struct wpa_driver_mesh_join_params { - #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 - #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 - unsigned int flags; -+ u8 handle_dfs; - }; - - struct wpa_driver_set_key_params { ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -10051,6 +10051,9 @@ static int nl80211_join_mesh(struct i802 - - wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); - -+ if (params->handle_dfs) -+ if (nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS)) -+ goto fail; - container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP); - if (!container) - goto fail; ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -314,6 +314,7 @@ static int wpa_supplicant_mesh_init(stru - conf->country[0] = wpa_s->conf->country[0]; - conf->country[1] = wpa_s->conf->country[1]; - conf->country[2] = ' '; -+ wpa_s->mesh_params->handle_dfs = 1; - } - - bss->iconf = conf; diff --git a/feeds/wifi-ax/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch b/feeds/wifi-ax/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch deleted file mode 100644 index a0d20023b..000000000 --- a/feeds/wifi-ax/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 2564184440d9d6041d11a8c7d50b31368634c3bd Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:40 -0700 -Subject: [PATCH] mesh: Apply channel attributes before setup interface - -This helps mesh interface initialization with correct channel -parameters. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -253,7 +253,7 @@ static int wpa_supplicant_mesh_init(stru - struct mesh_conf *mconf; - int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 }; - int rate_len; -- int frequency; -+ int frequency, saved_freq; - - if (!wpa_s->conf->user_mpm) { - /* not much for us to do here */ -@@ -391,6 +391,13 @@ static int wpa_supplicant_mesh_init(stru - conf->basic_rates[rate_len] = -1; - } - -+ /* Handle pri/sec switch frequency within AP configuration parameter -+ * generation without changing the stored network profile in the end. */ -+ saved_freq = ssid->frequency; -+ ssid->frequency = frequency; -+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -+ ssid->frequency = saved_freq; -+ - if (wpa_drv_init_mesh(wpa_s)) { - wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver"); - return -1; -@@ -402,8 +409,6 @@ static int wpa_supplicant_mesh_init(stru - return -1; - } - -- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -- - return 0; - out_free: - wpa_supplicant_mesh_deinit(wpa_s); diff --git a/feeds/wifi-ax/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/feeds/wifi-ax/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch similarity index 72% rename from feeds/wifi-ax/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch rename to feeds/wifi-ax/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch index 3a9b84717..d948c41b3 100644 --- a/feeds/wifi-ax/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/feeds/wifi-ax/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch @@ -1,28 +1,29 @@ -From 89fa0d75fb1be82330258082ed3d7fd452eb6076 Mon Sep 17 00:00:00 2001 +From 8de8cd8380af0c43d4fde67a668d79ef73b26b26 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:45 -0700 -Subject: [PATCH 3/7] mesh: Allow DFS channels to be selected if dfs is enabled +Date: Tue, 30 Jun 2020 14:18:58 +0200 +Subject: [PATCH 10/19] mesh: Allow DFS channels to be selected if dfs is + enabled Note: DFS is assumed to be usable if a country code has been set Signed-off-by: Benjamin Berg Signed-off-by: Peter Oh --- - wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------ - 1 file changed, 18 insertions(+), 6 deletions(-) + wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup int chwidth, seg0, seg1; u32 vht_caps = 0; int is_24ghz; + int dfs_enabled = wpa_s->conf->country[0] && -+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); ++ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); freq->freq = ssid->frequency; -@@ -2436,8 +2438,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check primary channel flags */ @@ -35,7 +36,7 @@ Signed-off-by: Peter Oh freq->channel = pri_chan->chan; -@@ -2470,8 +2475,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check secondary channel flags */ @@ -48,7 +49,7 @@ Signed-off-by: Peter Oh if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) -@@ -2564,8 +2572,11 @@ skip_ht40: +@@ -2612,8 +2620,11 @@ skip_ht40: return; /* Back to HT configuration if channel not usable */ @@ -61,7 +62,7 @@ Signed-off-by: Peter Oh } chwidth = CHANWIDTH_80MHZ; -@@ -2585,10 +2596,11 @@ skip_ht40: +@@ -2633,10 +2644,12 @@ skip_ht40: if (!chan) continue; @@ -70,7 +71,8 @@ Signed-off-by: Peter Oh - HOSTAPD_CHAN_RADAR)) + if (chan->flag & HOSTAPD_CHAN_DISABLED) continue; -+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR)) ++ if (chan->flag & (HOSTAPD_CHAN_RADAR | ++ HOSTAPD_CHAN_NO_IR)) + if (!dfs_enabled) + continue; diff --git a/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch b/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch new file mode 100644 index 000000000..03a1e339a --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch @@ -0,0 +1,81 @@ +From fc8ea40f6130ac18d9c66797de2cf1d5af55d496 Mon Sep 17 00:00:00 2001 +From: Markus Theil +Date: Tue, 30 Jun 2020 14:19:07 +0200 +Subject: [PATCH 19/19] mesh: use deterministic channel on channel switch + +This patch uses a deterministic channel on DFS channel switch +in mesh networks. Otherwise, when switching to a usable but not +available channel, no CSA can be sent and a random channel is choosen +without notification of other nodes. It is then quite likely, that +the mesh network gets disconnected. + +Fix this by using a deterministic number, based on the sha256 hash +of the mesh ID, in order to use at least a different number in each +mesh network. + +Signed-off-by: Markus Theil +--- + src/ap/dfs.c | 20 +++++++++++++++++++- + src/drivers/driver_nl80211.c | 4 ++++ + 2 files changed, 23 insertions(+), 1 deletion(-) + +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -17,6 +17,7 @@ + #include "ap_drv_ops.h" + #include "drivers/driver.h" + #include "dfs.h" ++#include "crypto/crypto.h" + + + static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1) +@@ -480,9 +481,14 @@ dfs_get_valid_channel(struct hostapd_ifa + int num_available_chandefs; + int chan_idx, chan_idx2; + int sec_chan_idx_80p80 = -1; ++ bool is_mesh = false; + int i; + u32 _rand; + ++#ifdef CONFIG_MESH ++ is_mesh = iface->mconf; ++#endif ++ + wpa_printf(MSG_DEBUG, "DFS: Selecting random channel"); + *secondary_channel = 0; + *oper_centr_freq_seg0_idx = 0; +@@ -502,8 +508,20 @@ dfs_get_valid_channel(struct hostapd_ifa + if (num_available_chandefs == 0) + return NULL; + +- if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0) ++ /* try to use deterministic channel in mesh, so that both sides ++ * have a chance to switch to the same channel */ ++ if (is_mesh) { ++#ifdef CONFIG_MESH ++ u64 hash[4]; ++ const u8 *meshid[1] = { &iface->mconf->meshid[0] }; ++ const size_t meshid_len = iface->mconf->meshid_len; ++ ++ sha256_vector(1, meshid, &meshid_len, (u8 *)&hash[0]); ++ _rand = hash[0] + hash[1] + hash[2] + hash[3]; ++#endif ++ } else if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0) + return NULL; ++ + chan_idx = _rand % num_available_chandefs; + dfs_find_channel(iface, &chan, chan_idx, skip_radar); + if (!chan) { +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void * + if (ret) + goto error; + ++ if (drv->nlmode == NL80211_IFTYPE_MESH_POINT) { ++ nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS); ++ } ++ + /* beacon_csa params */ + beacon_csa = nla_nest_start(msg, NL80211_ATTR_CSA_IES); + if (!beacon_csa) diff --git a/feeds/wifi-ax/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch b/feeds/wifi-ax/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch deleted file mode 100644 index 45c18fb3b..000000000 --- a/feeds/wifi-ax/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4f4a9b9e2e61fba334a21dadea749e4b440f42e6 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:48 -0700 -Subject: [PATCH 6/7] mesh: don't allow pri/sec channel switch - -This limitation isn't backed by standard, but it is known that -mesh doesn't have capability to handle 20/40 coex change in -current implementation and it will not able to establish -PLINK when channel switch between primary and secondary happens. - -Since it's unknown when we will have the implementation of handling -20/40 coex change for mesh, it'd better to avoid them from happening -until standard based implementation is introduced. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -391,6 +391,7 @@ static int wpa_supplicant_mesh_init(stru - conf->basic_rates[rate_len] = -1; - } - -+ conf->no_pri_sec_switch = 1; - /* Handle pri/sec switch frequency within AP configuration parameter - * generation without changing the stored network profile in the end. */ - saved_freq = ssid->frequency; diff --git a/feeds/wifi-ax/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch b/feeds/wifi-ax/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch deleted file mode 100644 index 7c6f249a0..000000000 --- a/feeds/wifi-ax/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 71e9c65a7c8af90a5fd11072062b596421316452 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:46 -0700 -Subject: [PATCH 4/7] mesh: do not set offchanok on DFS channels in non-ETSI - -mac80211 does not allow mgmt tx to use off channel on -DFS channels in non-ETSI domain, because it will invalidate -CAC result on current operating channel. -(mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f) -Hence don't set offchanok for mgmt tx in case of DFS channels -in non-ETSI. - -Signed-off-by: Peter Oh ---- - src/drivers/driver_nl80211.c | 21 ++++++++++++++++++++- - 1 file changed, 20 insertions(+), 1 deletion(-) - ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7789,6 +7789,10 @@ static int wpa_driver_nl80211_send_actio - u8 *buf; - struct ieee80211_hdr *hdr; - int offchanok = 1; -+ struct hostapd_hw_modes *modes; -+ int i; -+ u16 num_modes, flags; -+ u8 dfs_domain; - - if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq && - bss->beacon_set) -@@ -7817,6 +7821,21 @@ static int wpa_driver_nl80211_send_actio - os_memset(bss->rand_addr, 0, ETH_ALEN); - } - -+ if (is_mesh_interface(drv->nlmode)) { -+ modes = nl80211_get_hw_feature_data(bss, &num_modes, -+ &flags, &dfs_domain); -+ if (dfs_domain != HOSTAPD_DFS_REGION_ETSI && -+ ieee80211_is_dfs(bss->freq, modes, num_modes)) -+ offchanok = 0; -+ if (modes) { -+ for (i = 0; i < num_modes; i++) { -+ os_free(modes[i].channels); -+ os_free(modes[i].rates); -+ } -+ os_free(modes); -+ } -+ } -+ - if (is_ap_interface(drv->nlmode) && - (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || - (int) freq == bss->freq || drv->device_ap_sme || diff --git a/feeds/wifi-ax/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch b/feeds/wifi-ax/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch deleted file mode 100644 index 6b52abf98..000000000 --- a/feeds/wifi-ax/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 5913d6e2a741683e7c747c046f72ca790bbe1337 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Mon, 27 Aug 2018 14:28:47 -0700 -Subject: [PATCH 5/7] mesh: fix channel switch error during CAC - -Mesh interface has used its channel parameters that configured -during its initialization even after channel switched due to -DFS radar detection during CAC which caused channel switch error. -This change fixes the error by updating its channel parameters -when channel's been changed from initial one. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -13,6 +13,7 @@ - #include "utils/uuid.h" - #include "common/ieee802_11_defs.h" - #include "common/wpa_ctrl.h" -+#include "common/hw_features_common.h" - #include "ap/sta_info.h" - #include "ap/hostapd.h" - #include "ap/ieee802_11.h" -@@ -208,6 +209,34 @@ static void wpas_mesh_complete_cb(void * - return; - } - -+ /* -+ * inspect if channel's been changed since initialized. -+ * i.e. DFS radar detection -+ */ -+ if (ifmsh->freq != params->freq.freq) { -+ wpa_s->assoc_freq = ifmsh->freq; -+ ssid->frequency = ifmsh->freq; -+ if (hostapd_set_freq_params(¶ms->freq, -+ ifmsh->conf->hw_mode, -+ ifmsh->freq, -+ ifmsh->conf->channel, -+ ifmsh->conf->enable_edmg, -+ ifmsh->conf->edmg_channel, -+ ifmsh->conf->ieee80211n, -+ ifmsh->conf->ieee80211ac, -+ ifmsh->conf->ieee80211ax, -+ ifmsh->conf->secondary_channel, -+ hostapd_get_oper_chwidth(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -+ ifmsh->current_mode->vht_capab, -+ &ifmsh->current_mode->he_capab[IEEE80211_MODE_AP])) { -+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -+ wpa_supplicant_mesh_deinit(wpa_s); -+ return; -+ } -+ } -+ - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, diff --git a/feeds/wifi-ax/hostapd/patches/018-mesh-make-forwarding-configurable.patch b/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch similarity index 89% rename from feeds/wifi-ax/hostapd/patches/018-mesh-make-forwarding-configurable.patch rename to feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch index 0bdc4cc15..75726a675 100644 --- a/feeds/wifi-ax/hostapd/patches/018-mesh-make-forwarding-configurable.patch +++ b/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch @@ -31,7 +31,7 @@ Signed-off-by: Daniel Golle }; #define MAX_STA_COUNT 2007 -@@ -701,6 +702,7 @@ struct hostapd_bss_config { +@@ -696,6 +697,7 @@ struct hostapd_bss_config { #define MESH_ENABLED BIT(0) int mesh; @@ -41,7 +41,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1515,6 +1515,7 @@ struct wpa_driver_mesh_bss_params { +@@ -1584,6 +1584,7 @@ struct wpa_driver_mesh_bss_params { #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004 #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008 #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010 @@ -49,7 +49,7 @@ Signed-off-by: Daniel Golle /* * TODO: Other mesh configuration parameters would go here. * See NL80211_MESHCONF_* for all the mesh config parameters. -@@ -1524,6 +1525,7 @@ struct wpa_driver_mesh_bss_params { +@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params { int peer_link_timeout; int max_peer_links; int rssi_threshold; @@ -59,7 +59,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10019,6 +10019,9 @@ static int nl80211_put_mesh_config(struc +@@ -10456,6 +10456,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || @@ -71,7 +71,7 @@ Signed-off-by: Daniel Golle params->max_peer_links)) || --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2473,6 +2473,7 @@ static const struct parse_data ssid_fiel +@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel #ifdef CONFIG_MESH { INT_RANGE(mode, 0, 5) }, { INT_RANGE(no_auto_peer, 0, 1) }, @@ -79,7 +79,7 @@ Signed-off-by: Daniel Golle { INT_RANGE(mesh_rssi_threshold, -255, 1) }, #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, -@@ -3047,6 +3048,7 @@ void wpa_config_set_network_defaults(str +@@ -3106,6 +3107,7 @@ void wpa_config_set_network_defaults(str ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT; ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT; ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT; @@ -87,7 +87,7 @@ Signed-off-by: Daniel Golle ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD; #endif /* CONFIG_MESH */ #ifdef CONFIG_HT_OVERRIDES -@@ -4274,6 +4276,7 @@ struct wpa_config * wpa_config_alloc_emp +@@ -4347,6 +4349,7 @@ struct wpa_config * wpa_config_alloc_emp config->user_mpm = DEFAULT_USER_MPM; config->max_peer_links = DEFAULT_MAX_PEER_LINKS; config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY; @@ -95,7 +95,7 @@ Signed-off-by: Daniel Golle config->dot11RSNASAERetransPeriod = DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD; config->fast_reauth = DEFAULT_FAST_REAUTH; -@@ -4912,6 +4915,7 @@ static const struct global_parse_data gl +@@ -5047,6 +5050,7 @@ static const struct global_parse_data gl { INT(user_mpm), 0 }, { INT_RANGE(max_peer_links, 0, 255), 0 }, { INT(mesh_max_inactivity), 0 }, @@ -113,7 +113,7 @@ Signed-off-by: Daniel Golle /* * The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard, * but use 1000 ms in practice to avoid issues on low power CPUs. -@@ -1351,6 +1352,14 @@ struct wpa_config { +@@ -1378,6 +1379,14 @@ struct wpa_config { int mesh_max_inactivity; /** @@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle * This timeout value is used in mesh STA to retransmit --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL +@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -138,7 +138,7 @@ Signed-off-by: Daniel Golle INT(frequency); INT(enable_edmg); INT(edmg_channel); -@@ -1527,6 +1528,9 @@ static void wpa_config_write_global(FILE +@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE fprintf(f, "mesh_max_inactivity=%d\n", config->mesh_max_inactivity); @@ -164,7 +164,7 @@ Signed-off-by: Daniel Golle --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -130,6 +130,7 @@ static struct mesh_conf * mesh_config_cr +@@ -140,6 +140,7 @@ static struct mesh_conf * mesh_config_cr conf->mesh_cc_id = 0; conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET; conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0; @@ -172,7 +172,7 @@ Signed-off-by: Daniel Golle conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; -@@ -335,6 +336,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -441,6 +442,7 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; @@ -180,7 +180,7 @@ Signed-off-by: Daniel Golle if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { -@@ -556,6 +558,10 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_ } params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity; diff --git a/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch b/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch new file mode 100644 index 000000000..124fd8bdf --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch @@ -0,0 +1,26 @@ +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos + * drivers to accept the STA parameter configuration. Since this is + * after a new FT-over-DS exchange, a new TK has been derived, so key + * reinstallation is not a concern for this case. ++ * ++ * If the STA was associated and authorized earlier, but came for a new ++ * connection (!added_unassoc + !reassoc), remove the existing STA entry ++ * so that it can be re-added. This case is rarely seen when the AP could ++ * not receive the deauth/disassoc frame from the STA. And the STA comes ++ * back with new connection within a short period or before the inactive ++ * STA entry is removed from the list. + */ + wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR + " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", +@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos + (!(sta->flags & WLAN_STA_AUTHORIZED) || + (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || + (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && +- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) { ++ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) || ++ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) { + hostapd_drv_sta_remove(hapd, sta->addr); + wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED); + set = 0; diff --git a/feeds/wifi-ax/hostapd/patches/200-multicall.patch b/feeds/wifi-ax/hostapd/patches/200-multicall.patch index 0b371afe3..8dce26087 100644 --- a/feeds/wifi-ax/hostapd/patches/200-multicall.patch +++ b/feeds/wifi-ax/hostapd/patches/200-multicall.patch @@ -1,14 +1,14 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -31,6 +31,7 @@ CFLAGS += -I$(abspath ../src/utils) - export BINDIR ?= /usr/local/bin/ +@@ -1,6 +1,7 @@ + ALL=hostapd hostapd_cli + CONFIG_FILE = .config - -include .config +-include $(if $(MULTICALL), ../wpa_supplicant/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -204,7 +205,8 @@ endif + ifdef LIBS +@@ -199,7 +200,8 @@ endif ifdef CONFIG_NO_VLAN CFLAGS += -DCONFIG_NO_VLAN @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO +@@ -349,10 +351,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,9 +36,9 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1311,6 +1317,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) - - BCHECK=../src/drivers/build.hostapd +@@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) + _OBJS_VAR := OBJS + include ../src/objs.mk +hostapd_multi.a: $(BCHECK) $(OBJS) + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c @@ -46,12 +46,12 @@ + @rm -f $@ + @$(AR) cr $@ hostapd_multi.o $(OBJS) + - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1374,6 +1386,12 @@ SOBJS += ../src/crypto/sha256-kdf.o - SOBJS += ../src/crypto/sha384-kdf.o - SOBJS += ../src/crypto/sha512-kdf.o +@@ -1351,6 +1363,12 @@ include ../src/objs.mk + _OBJS_VAR := SOBJS + include ../src/objs.mk +dump_cflags: + @printf "%s " "$(CFLAGS)" @@ -64,15 +64,15 @@ @$(E) " LD " $@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) +@@ -17,6 +17,7 @@ endif + EXTRA_TARGETS=dynamic_eap_methods - -include .config + CONFIG_FILE=.config +-include $(if $(MULTICALL),../hostapd/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -369,7 +370,9 @@ endif + ifdef LIBS +@@ -359,7 +360,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -890,6 +893,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -897,6 +900,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -93,7 +93,7 @@ endif ifdef CONFIG_AP -@@ -897,9 +904,11 @@ NEED_EAP_COMMON=y +@@ -904,9 +911,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -979,6 +988,12 @@ endif +@@ -986,6 +995,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -987,7 +1002,9 @@ CFLAGS += -DCONFIG_MBO +@@ -994,7 +1009,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,10 +128,10 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1897,6 +1914,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) - - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config +@@ -1889,6 +1906,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) + _OBJS_VAR := OBJS + include ../src/objs.mk +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c + @$(E) " CC " $< @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1997,6 +2020,12 @@ endif +@@ -2021,6 +2044,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5886,8 +5886,8 @@ union wpa_event_data { +@@ -6025,8 +6025,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5899,7 +5899,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1789,8 +1789,8 @@ err: +@@ -1836,8 +1836,8 @@ err: #endif /* CONFIG_OWE */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2035,7 +2035,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4579,8 +4579,8 @@ static void wpas_event_unprot_beacon(str +@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -5398,7 +5398,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6597,7 +6597,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -6634,6 +6633,11 @@ static int wpa_supplicant_match_existing +@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6890,6 +6894,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -296,7 +296,7 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -684,6 +689,8 @@ int main(int argc, char *argv[]) +@@ -683,6 +688,8 @@ int main(int argc, char *argv[]) return -1; #endif /* CONFIG_DPP */ @@ -333,7 +333,7 @@ const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; -@@ -1292,6 +1297,10 @@ static void usage(void) +@@ -1291,6 +1296,10 @@ static void usage(void) "option several times.\n"); } @@ -344,7 +344,7 @@ int main(int argc, char *argv[]) { -@@ -1312,6 +1321,8 @@ int main(int argc, char *argv[]) +@@ -1311,6 +1320,8 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; diff --git a/feeds/wifi-ax/hostapd/patches/300-noscan.patch b/feeds/wifi-ax/hostapd/patches/300-noscan.patch index 638b76f84..93b093428 100644 --- a/feeds/wifi-ax/hostapd/patches/300-noscan.patch +++ b/feeds/wifi-ax/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3493,6 +3493,10 @@ static int hostapd_config_fill(struct ho +@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho if (bss->ocv && !bss->ieee80211w) bss->ieee80211w = 1; #endif /* CONFIG_OCV */ @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -984,6 +984,8 @@ struct hostapd_config { +@@ -1009,6 +1009,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -500,7 +500,8 @@ static int ieee80211n_check_40mhz(struct +@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/feeds/wifi-ax/hostapd/patches/301-mesh-noscan.patch b/feeds/wifi-ax/hostapd/patches/301-mesh-noscan.patch index fac9bffab..0d7832944 100644 --- a/feeds/wifi-ax/hostapd/patches/301-mesh-noscan.patch +++ b/feeds/wifi-ax/hostapd/patches/301-mesh-noscan.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2478,6 +2478,7 @@ static const struct parse_data ssid_fiel +@@ -2532,6 +2532,7 @@ static const struct parse_data ssid_fiel #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, #endif /* CONFIG_MESH */ @@ -10,7 +10,7 @@ { STR(id_str) }, --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL +@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -20,18 +20,18 @@ INT(enable_edmg); --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -368,6 +368,8 @@ static int wpa_supplicant_mesh_init(stru +@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru frequency); goto out_free; } + if (ssid->noscan) + conf->noscan = 1; - if (ssid->ht40) - conf->secondary_channel = ssid->ht40; - if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { + + if (ssid->mesh_basic_rates == NULL) { + /* --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2338,12 +2338,12 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode); enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; @@ -46,7 +46,7 @@ unsigned int j, k; struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; -@@ -2425,7 +2425,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup #endif /* CONFIG_HE_OVERRIDES */ /* Setup higher BW only for 5 GHz */ diff --git a/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch b/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch index be2be615e..7f5e20706 100644 --- a/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch +++ b/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4952,7 +4952,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch b/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch index a703c7e13..01537790e 100644 --- a/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch +++ b/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch @@ -1,6 +1,6 @@ --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak -@@ -50,7 +50,6 @@ NEED_SME=y +@@ -54,7 +54,6 @@ NEED_SME=y NEED_AP_MLME=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -8,7 +8,7 @@ NEED_RADIOTAP=y NEED_LIBNL=y endif -@@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT +@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT CONFIG_WIRELESS_EXTENSION=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -16,7 +16,7 @@ endif ifdef CONFIG_DRIVER_NDIS -@@ -133,7 +131,6 @@ endif +@@ -137,7 +135,6 @@ endif ifdef CONFIG_WIRELESS_EXTENSION DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION DRV_WPA_OBJS += ../src/drivers/driver_wext.o @@ -24,7 +24,7 @@ endif ifdef NEED_NETLINK -@@ -142,6 +139,7 @@ endif +@@ -146,6 +143,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o diff --git a/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch b/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch index 9e2551ce6..9ced08801 100644 --- a/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4646,7 +4646,7 @@ static int nl80211_set_channel(struct i8 +@@ -4973,7 +4973,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch b/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch index e0e62c2a1..3d51a47a1 100644 --- a/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch +++ b/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -114,6 +114,28 @@ static void hostapd_reload_bss(struct ho +@@ -115,6 +115,28 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -29,7 +29,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -215,6 +237,7 @@ int hostapd_reload_config(struct hostapd +@@ -216,6 +238,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -37,7 +37,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -265,24 +288,20 @@ int hostapd_reload_config(struct hostapd +@@ -266,24 +289,20 @@ int hostapd_reload_config(struct hostapd } iface->conf = newconf; diff --git a/feeds/wifi-ax/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch b/feeds/wifi-ax/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch index a1e59cc95..73f81f65e 100644 --- a/feeds/wifi-ax/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch +++ b/feeds/wifi-ax/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1426,15 +1426,35 @@ int ap_switch_channel(struct wpa_supplic +@@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic #ifdef CONFIG_CTRL_IFACE diff --git a/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch b/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch index 7d4064e65..1f9b74e97 100644 --- a/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,8 +1,6 @@ -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -@@ -2860,10 +2860,15 @@ static int wpa_driver_nl80211_del_beacon +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -2918,10 +2918,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; struct wpa_driver_nl80211_data *drv = bss->drv; @@ -20,7 +18,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); } -@@ -5335,7 +5340,7 @@ static void nl80211_teardown_ap(struct i +@@ -5602,7 +5607,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); nl80211_put_wiphy_data_ap(bss); @@ -29,7 +27,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c } -@@ -7767,8 +7772,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -8051,8 +8056,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -38,7 +36,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -8162,7 +8165,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -8449,7 +8452,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -46,7 +44,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c /* * If the P2P GO interface was dynamically added, then it is -@@ -8182,7 +8184,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -8469,7 +8471,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch b/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch index 31c5102cb..349522e06 100644 --- a/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch +++ b/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -65,6 +65,7 @@ +@@ -67,6 +67,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -80,6 +81,7 @@ static void hostapd_ctrl_iface_send(stru +@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(stru enum wpa_msg_type type, const char *buf, size_t len); @@ -16,7 +16,7 @@ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -131,6 +133,61 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -78,7 +78,7 @@ #ifdef NEED_AP_MLME static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd, -@@ -3546,6 +3603,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); @@ -89,7 +89,7 @@ #ifdef RADIUS_SERVER --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -917,7 +917,13 @@ int hostapd_parse_csa_settings(const cha +@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) { diff --git a/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch b/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch index f96017de2..9ffd7e2a0 100644 --- a/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch +++ b/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch @@ -1,17 +1,8 @@ ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -26,6 +26,10 @@ CFLAGS += $(EXTRA_CFLAGS) - CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) - -+ifdef MULTICALL -+CFLAGS += -DMULTICALL -+endif -+ - -include .config - -include $(if $(MULTICALL),../hostapd/.config) - -@@ -118,6 +122,8 @@ OBJS_c += ../src/utils/common.o +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/Makefile ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile +@@ -103,6 +103,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -20,8 +11,10 @@ ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS CONFIG_OS=win32 ---- a/wpa_supplicant/bss.c -+++ b/wpa_supplicant/bss.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/bss.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.c @@ -11,6 +11,7 @@ #include "utils/common.h" #include "utils/eloop.h" @@ -30,7 +23,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -294,6 +295,10 @@ void calculate_update_time(const struct +@@ -282,6 +283,10 @@ void calculate_update_time(const struct static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { @@ -41,7 +34,7 @@ dst->flags = src->flags; os_memcpy(dst->bssid, src->bssid, ETH_ALEN); dst->freq = src->freq; -@@ -306,6 +311,15 @@ static void wpa_bss_copy_res(struct wpa_ +@@ -294,6 +299,15 @@ static void wpa_bss_copy_res(struct wpa_ dst->est_throughput = src->est_throughput; dst->snr = src->snr; @@ -57,9 +50,11 @@ calculate_update_time(fetch_time, src->age, &dst->last_update); } ---- a/wpa_supplicant/bss.h -+++ b/wpa_supplicant/bss.h -@@ -83,6 +83,10 @@ struct wpa_bss { +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/bss.h ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.h +@@ -94,6 +94,10 @@ struct wpa_bss { u8 ssid[SSID_MAX_LEN]; /** Length of SSID */ size_t ssid_len; @@ -70,8 +65,10 @@ /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */ int freq; /** Beacon interval in TUs (host byte order) */ ---- a/wpa_supplicant/main.c -+++ b/wpa_supplicant/main.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/main.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c @@ -34,7 +34,7 @@ static void usage(void) "vW] [-P] " "[-g] \\\n" @@ -108,9 +105,11 @@ case 'i': iface->ifname = optarg; break; ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -129,6 +129,54 @@ static void wpas_update_fils_connect_par +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +@@ -130,6 +130,54 @@ static void wpas_update_fils_connect_par static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s); #endif /* CONFIG_OWE */ @@ -165,7 +164,7 @@ #ifdef CONFIG_WEP /* Configure default/group WEP keys for static WEP */ -@@ -991,6 +1039,8 @@ void wpa_supplicant_set_state(struct wpa +@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa sme_sched_obss_scan(wpa_s, 1); @@ -174,7 +173,7 @@ #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) if (!fils_hlp_sent && ssid && ssid->eap.erp) update_fils_connect_params = true; -@@ -1001,6 +1051,8 @@ void wpa_supplicant_set_state(struct wpa +@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa #endif /* CONFIG_OWE */ } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || state == WPA_ASSOCIATED) { @@ -183,16 +182,16 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -2229,6 +2281,8 @@ void wpa_supplicant_associate(struct wpa - wpa_ssid_txt(ssid->ssid, ssid->ssid_len), - ssid->id); - wpas_notify_mesh_group_started(wpa_s, ssid); +@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa + return; + } + wpa_s->current_bss = bss; + if (wpa_s->hostapd) + hostapd_reload(wpa_s, wpa_s->current_bss); #else /* CONFIG_MESH */ wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -6210,6 +6264,16 @@ static int wpa_supplicant_init_iface(str +@@ -6419,6 +6473,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -209,7 +208,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, false); eapol_sm_notify_portValid(wpa_s->eapol, false); -@@ -6543,6 +6607,11 @@ static void wpa_supplicant_deinit_iface( +@@ -6756,6 +6820,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -221,9 +220,11 @@ if (wpa_s->ctrl_iface) { wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); wpa_s->ctrl_iface = NULL; ---- a/wpa_supplicant/wpa_supplicant_i.h -+++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -104,6 +104,11 @@ struct wpa_interface { +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant_i.h ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h +@@ -103,6 +103,11 @@ struct wpa_interface { const char *ifname; /** @@ -235,7 +236,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -530,6 +535,8 @@ struct wpa_supplicant { +@@ -611,6 +616,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -244,9 +245,11 @@ char *confname; char *confanother; ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -2712,6 +2712,11 @@ static int hostapd_ctrl_iface_chan_switc +Index: hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/hostapd/ctrl_iface.c ++++ hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c +@@ -2781,6 +2781,11 @@ static int hostapd_ctrl_iface_chan_switc return 0; } @@ -257,10 +260,12 @@ + for (i = 0; i < iface->num_bss; i++) { - /* Save CHAN_SWITCH VHT config */ ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -1468,11 +1468,6 @@ int ieee802_11_set_beacon(struct hostapd + /* Save CHAN_SWITCH VHT and HE config */ +Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/beacon.c ++++ hostapd-2021-02-20-59e9794c/src/ap/beacon.c +@@ -1753,11 +1753,6 @@ int ieee802_11_set_beacon(struct hostapd struct wpabuf *beacon, *proberesp, *assocresp; int res, ret = -1; @@ -272,9 +277,11 @@ hapd->beacon_set_done = 1; if (ieee802_11_build_ap_params(hapd, ¶ms) < 0) ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -4579,6 +4579,60 @@ static void wpas_event_unprot_beacon(str +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/events.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/events.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/events.c +@@ -4666,6 +4666,60 @@ static void wpas_event_unprot_beacon(str } @@ -335,7 +342,7 @@ void supplicant_event(void *ctx, enum wpa_event_type event, union wpa_event_data *data) { -@@ -4881,8 +4935,10 @@ void supplicant_event(void *ctx, enum wp +@@ -4981,8 +5035,10 @@ void supplicant_event(void *ctx, enum wp channel_width_to_string(data->ch_switch.ch_width), data->ch_switch.cf1, data->ch_switch.cf2); @@ -347,9 +354,11 @@ wpa_s->assoc_freq = data->ch_switch.freq; wpa_s->current_ssid->frequency = data->ch_switch.freq; ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -5690,6 +5690,7 @@ union wpa_event_data { +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver.h +@@ -5822,6 +5822,7 @@ union wpa_event_data { /** * struct ch_switch @@ -357,7 +366,7 @@ * @freq: Frequency of new channel in MHz * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -5698,6 +5699,7 @@ union wpa_event_data { +@@ -5830,6 +5831,7 @@ union wpa_event_data { * @cf2: Center frequency 2 */ struct ch_switch { @@ -365,9 +374,11 @@ int freq; int ht_enabled; int ch_offset; ---- a/src/drivers/driver_nl80211_event.c -+++ b/src/drivers/driver_nl80211_event.c -@@ -541,7 +541,7 @@ static void mlme_event_ch_switch(struct +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_event.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211_event.c ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_event.c +@@ -655,7 +655,7 @@ static void mlme_event_ch_switch(struct struct nlattr *ifindex, struct nlattr *freq, struct nlattr *type, struct nlattr *bw, struct nlattr *cf1, struct nlattr *cf2, @@ -376,7 +387,7 @@ { struct i802_bss *bss; union wpa_event_data data; -@@ -600,6 +600,8 @@ static void mlme_event_ch_switch(struct +@@ -714,6 +714,8 @@ static void mlme_event_ch_switch(struct data.ch_switch.cf1 = nla_get_u32(cf1); if (cf2) data.ch_switch.cf2 = nla_get_u32(cf2); @@ -385,7 +396,7 @@ if (finished) bss->freq = data.ch_switch.freq; -@@ -2686,6 +2688,7 @@ static void do_process_drv_event(struct +@@ -2886,6 +2888,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], @@ -393,7 +404,7 @@ 0); break; case NL80211_CMD_CH_SWITCH_NOTIFY: -@@ -2696,6 +2699,7 @@ static void do_process_drv_event(struct +@@ -2896,6 +2899,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], diff --git a/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch b/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch index cd4a2c9f1..ca634077b 100644 --- a/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -226,6 +226,9 @@ endif +@@ -221,6 +221,9 @@ endif ifdef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_NO_CTRL_IFACE else @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3370,6 +3370,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3569,6 +3569,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -3411,6 +3412,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3610,6 +3611,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,7 +30,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -952,6 +952,9 @@ ifdef CONFIG_FILS +@@ -955,6 +955,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2267,7 +2267,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -10366,6 +10366,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -10378,6 +10379,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10862,6 +10864,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -10870,12 +10873,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -109,7 +109,7 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -806,12 +808,12 @@ int hostapd_ctrl_iface_status(struct hos +@@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos return len; len += ret; } @@ -126,7 +126,7 @@ if (os_snprintf_error(buflen - len, ret)) --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2711,6 +2711,7 @@ static const char * bool_txt(bool val) +@@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val) return val ? "TRUE" : "FALSE"; } @@ -134,7 +134,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2897,6 +2898,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2898,6 +2899,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -144,7 +144,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4451,6 +4451,7 @@ static const char * wpa_bool_txt(int val +@@ -4519,6 +4519,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -152,7 +152,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -4601,7 +4602,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -4669,7 +4670,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -163,7 +163,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2728,6 +2728,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -172,7 +172,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2809,6 +2811,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -182,7 +182,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1284,7 +1284,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/feeds/wifi-ax/hostapd/patches/390-wpa_ie_cap_workaround.patch b/feeds/wifi-ax/hostapd/patches/390-wpa_ie_cap_workaround.patch index 9dee2d738..65a8b07e6 100644 --- a/feeds/wifi-ax/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/feeds/wifi-ax/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -2121,6 +2121,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -2444,6 +2444,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -2128,8 +2153,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -2451,8 +2476,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch b/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch index 9f216347f..f9dff6607 100644 --- a/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch +++ b/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch @@ -8,7 +8,7 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -692,7 +693,7 @@ int main(int argc, char *argv[]) +@@ -691,7 +692,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -17,7 +17,7 @@ if (c < 0) break; switch (c) { -@@ -729,6 +730,8 @@ int main(int argc, char *argv[]) +@@ -728,6 +729,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch b/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch index 3744464c8..dc1fa3d29 100644 --- a/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -32,7 +32,7 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1532,13 +1528,10 @@ static const struct hostapd_cli_cmd host +@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd host { "disassociate", hostapd_cli_cmd_disassociate, hostapd_complete_stations, " = disassociate a station" }, @@ -46,7 +46,7 @@ { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1563,7 +1556,6 @@ static const struct hostapd_cli_cmd host +@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, diff --git a/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 0a16af309..e0e687e16 100644 --- a/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli #include "common/defs.h" #include "common/ieee802_11_defs.h" #include "common/wpa_common.h" -@@ -850,6 +851,9 @@ struct wpa_driver_associate_params { +@@ -851,6 +852,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -2269,6 +2270,97 @@ static char * wpa_config_write_peerkey(c +@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(c #endif /* NO_CONFIG_WRITE */ @@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2552,6 +2644,8 @@ static const struct parse_data ssid_fiel +@@ -2606,6 +2698,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3641,6 +3641,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 61d2089bc..1d2a053fa 100644 --- a/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5584,7 +5584,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -5951,7 +5951,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5611,6 +5611,37 @@ retry: +@@ -5978,6 +5978,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch b/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch index 5bb014234..1794befe9 100644 --- a/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,17 +19,17 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1549,6 +1549,7 @@ struct wpa_driver_mesh_join_params { +@@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; - u8 handle_dfs; + bool handle_dfs; + int mcast_rate; }; struct wpa_driver_set_key_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10039,6 +10039,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -10476,6 +10476,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -10100,6 +10112,7 @@ static int nl80211_join_mesh(struct i802 +@@ -10537,6 +10549,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || @@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -501,6 +501,7 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch b/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch index 5f1f8e3d8..4c7cb9ea3 100644 --- a/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2411,11 +2411,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch b/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch index 57a78ee86..efd82599d 100644 --- a/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch +++ b/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -415,20 +409,19 @@ static int acs_usable_vht160_chan(const +@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch b/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch index 46030859d..1475590d0 100644 --- a/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch +++ b/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch @@ -1,16 +1,17 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -1327,14 +1327,14 @@ hostapd_multi.a: $(BCHECK) $(OBJS) +@@ -1293,7 +1293,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS) - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) - $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) + +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ ifdef CONFIG_WPA_TRACE - OBJS_c += ../src/utils/trace.o - endif +@@ -1304,7 +1304,7 @@ _OBJS_VAR := OBJS_c + include ../src/objs.mk + hostapd_cli: $(OBJS_c) - $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) @@ -19,7 +20,7 @@ NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1930,23 +1930,23 @@ wpa_supplicant_multi.a: .config $(BCHECK +@@ -1918,31 +1918,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) @@ -27,21 +28,29 @@ + +$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t + include ../src/objs.mk eapol_test: $(OBJS_t) - $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t2 + include ../src/objs.mk preauth_test: $(OBJS_t2) - $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_p + include ../src/objs.mk wpa_passphrase: $(OBJS_p) - $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_c + include ../src/objs.mk wpa_cli: $(OBJS_c) - $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) diff --git a/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch b/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch index 6f6acf318..005ed54e0 100644 --- a/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch +++ b/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -171,6 +171,11 @@ OBJS += ../src/common/hw_features_common +@@ -166,6 +166,11 @@ OBJS += ../src/common/hw_features_common OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -39,7 +39,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -603,6 +605,7 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -610,6 +612,7 @@ hostapd_alloc_bss_data(struct hostapd_if struct hostapd_bss_config *bss); int hostapd_setup_interface(struct hostapd_iface *iface); int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); @@ -49,7 +49,7 @@ struct hostapd_iface * hostapd_alloc_iface(void); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -395,6 +395,7 @@ static void hostapd_free_hapd_data(struc +@@ -396,6 +396,7 @@ void hostapd_free_hapd_data(struct hosta hapd->beacon_set_done = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -57,7 +57,7 @@ accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); -@@ -1417,6 +1418,8 @@ static int hostapd_setup_bss(struct host +@@ -1422,6 +1423,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -66,7 +66,7 @@ return 0; } -@@ -1999,6 +2002,7 @@ static int hostapd_setup_interface_compl +@@ -2028,6 +2031,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -74,7 +74,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->freq) { #ifdef NEED_AP_MLME -@@ -2196,6 +2200,7 @@ dfs_offload: +@@ -2225,6 +2229,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -82,7 +82,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2669,6 +2674,7 @@ void hostapd_interface_deinit_free(struc +@@ -2700,6 +2705,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -92,7 +92,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2327,13 +2327,18 @@ static void handle_auth(struct hostapd_d +@@ -3553,13 +3553,18 @@ static void handle_auth(struct hostapd_d u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; struct sta_info *sta = NULL; @@ -112,7 +112,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -2493,6 +2498,13 @@ static void handle_auth(struct hostapd_d +@@ -3727,6 +3732,13 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -126,16 +126,16 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -4166,7 +4178,7 @@ static void handle_assoc(struct hostapd_ +@@ -5454,7 +5466,7 @@ static void handle_assoc(struct hostapd_ int resp = WLAN_STATUS_SUCCESS; - u16 reply_res; + u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; const u8 *pos; - int left, i; + int left, i, ubus_resp; struct sta_info *sta; u8 *tmp = NULL; #ifdef CONFIG_FILS -@@ -4379,6 +4391,11 @@ static void handle_assoc(struct hostapd_ +@@ -5667,6 +5679,11 @@ static void handle_assoc(struct hostapd_ left = res; } #endif /* CONFIG_FILS */ @@ -147,7 +147,7 @@ /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -4543,6 +4560,14 @@ static void handle_assoc(struct hostapd_ +@@ -5831,6 +5848,14 @@ static void handle_assoc(struct hostapd_ pos, left, rssi, omit_rsnxe); os_free(tmp); @@ -160,9 +160,9 @@ + } + /* - * Remove the station in case tranmission of a success response fails + * Remove the station in case transmission of a success response fails * (the STA was added associated to the driver) or if the station was -@@ -4570,6 +4595,7 @@ static void handle_disassoc(struct hosta +@@ -5858,6 +5883,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -170,9 +170,9 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -4636,6 +4662,8 @@ static void handle_deauth(struct hostapd - " reason_code=%d", - MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); +@@ -5927,6 +5953,8 @@ static void handle_deauth(struct hostapd + /* Clear the PTKSA cache entries for PASN */ + ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); + hostapd_ubus_notify(hapd, "deauth", mgmt->sa); + @@ -181,7 +181,7 @@ wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -814,6 +814,12 @@ void handle_probe_req(struct hostapd_dat +@@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat u16 csa_offs[2]; size_t csa_offs_len; struct radius_sta rad_info; @@ -192,9 +192,9 @@ + .elems = &elems, + }; - if (len < IEEE80211_HDRLEN) - return; -@@ -996,6 +1002,12 @@ void handle_probe_req(struct hostapd_dat + if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && + ssi_signal < hapd->iconf->rssi_ignore_probe_request) +@@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -209,7 +209,7 @@ --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -119,6 +119,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; int status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -220,7 +220,7 @@ if (addr == NULL) { /* -@@ -211,6 +215,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -235,7 +235,7 @@ wpabuf_free(sta->p2p_ie); --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -424,6 +424,7 @@ void ap_handle_timer(void *eloop_ctx, vo +@@ -459,6 +459,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); ap_free_sta(hapd, sta); @@ -243,7 +243,7 @@ return; } -@@ -579,6 +580,7 @@ skip_poll: +@@ -614,6 +615,7 @@ skip_poll: hapd, sta, WLAN_REASON_PREV_AUTH_NOT_VALID); ap_free_sta(hapd, sta); @@ -251,7 +251,7 @@ break; } } -@@ -1294,6 +1296,7 @@ void ap_sta_set_authorized(struct hostap +@@ -1329,6 +1331,7 @@ void ap_sta_set_authorized(struct hostap buf, ip_addr, keyid_buf); } else { wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); @@ -261,7 +261,7 @@ hapd->msg_ctx_parent != hapd->msg_ctx) --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -259,6 +259,7 @@ static void hostapd_wpa_auth_psk_failure +@@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, MAC2STR(addr)); @@ -271,7 +271,7 @@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -190,6 +190,12 @@ ifdef CONFIG_EAPOL_TEST +@@ -176,6 +176,12 @@ ifdef CONFIG_EAPOL_TEST CFLAGS += -Werror -DEAPOL_TEST endif @@ -284,19 +284,19 @@ ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -887,6 +893,9 @@ OBJS += ../src/pae/ieee802_1x_secy_ops.o - ifdef CONFIG_AP - OBJS += ../src/ap/wpa_auth_kay.o +@@ -959,6 +965,9 @@ ifdef CONFIG_CTRL_IFACE_MIB + CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif + OBJS += ../src/ap/ctrl_iface_ap.o +ifdef CONFIG_UBUS +OBJS += ../src/ap/ubus.o +endif endif - ifdef CONFIG_IEEE8021X_EAPOL + CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6797,6 +6797,8 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7017,6 +7017,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -305,7 +305,7 @@ return wpa_s; } -@@ -6823,6 +6825,8 @@ int wpa_supplicant_remove_iface(struct w +@@ -7043,6 +7045,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -314,7 +314,7 @@ /* Remove interface from the global list of interfaces */ prev = global->ifaces; if (prev == wpa_s) { -@@ -7126,8 +7130,12 @@ int wpa_supplicant_run(struct wpa_global +@@ -7346,8 +7350,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -329,7 +329,7 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -17,6 +17,7 @@ +@@ -19,6 +19,7 @@ #include "wps/wps_defs.h" #include "config_ssid.h" #include "wmm_ac.h" @@ -337,7 +337,7 @@ extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -310,6 +311,8 @@ struct wpa_global { +@@ -321,6 +322,8 @@ struct wpa_global { #endif /* CONFIG_WIFI_DISPLAY */ struct psk_list_entry *add_psk; /* From group formation */ @@ -346,7 +346,7 @@ }; -@@ -520,6 +523,7 @@ struct wpa_supplicant { +@@ -605,6 +608,7 @@ struct wpa_supplicant { unsigned char own_addr[ETH_ALEN]; unsigned char perm_addr[ETH_ALEN]; char ifname[100]; @@ -375,7 +375,7 @@ --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -896,6 +896,7 @@ int main(int argc, char *argv[]) +@@ -895,6 +895,7 @@ int main(int argc, char *argv[]) } hostapd_global_ctrl_iface_init(&interfaces); @@ -383,7 +383,7 @@ if (hostapd_global_run(&interfaces, daemonize, pid_file)) { wpa_printf(MSG_ERROR, "Failed to start eloop"); -@@ -905,6 +906,7 @@ int main(int argc, char *argv[]) +@@ -904,6 +905,7 @@ int main(int argc, char *argv[]) ret = 0; out: @@ -464,7 +464,7 @@ --- a/src/ap/dfs.c +++ b/src/ap/dfs.c -@@ -1179,6 +1179,8 @@ int hostapd_dfs_radar_detected(struct ho +@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", freq, ht_enabled, chan_offset, chan_width, cf1, cf2); diff --git a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch b/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch index 2fdba4072..5993b0d44 100644 --- a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch +++ b/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2501,6 +2501,8 @@ static int hostapd_config_fill(struct ho +@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { bss->ap_max_inactivity = atoi(pos); @@ -9,7 +9,7 @@ } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { bss->skip_inactivity_poll = atoi(pos); } else if (os_strcmp(buf, "country_code") == 0) { -@@ -3197,6 +3199,8 @@ static int hostapd_config_fill(struct ho +@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho } } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { conf->acs_exclude_dfs = atoi(pos); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "channel") == 0) { --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -780,6 +780,7 @@ void hostapd_config_free_bss(struct host +@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host os_free(conf->radius_req_attr_sqlite); os_free(conf->rsn_preauth_interfaces); os_free(conf->ctrl_interface); @@ -28,7 +28,7 @@ os_free(conf->ca_cert); os_free(conf->server_cert); os_free(conf->server_cert2); -@@ -972,6 +973,7 @@ void hostapd_config_free(struct hostapd_ +@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_ for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(conf->bss[i]); @@ -38,25 +38,26 @@ os_free(conf->basic_rates); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -871,6 +871,7 @@ struct hostapd_bss_config { - */ - u8 mka_psk_set; - #endif /* CONFIG_MACSEC */ +@@ -279,6 +279,8 @@ struct hostapd_bss_config { + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; + + char *config_id; - }; ++ + enum hostapd_logger_level logger_syslog_level, logger_stdout_level; - /** -@@ -1062,6 +1063,7 @@ struct hostapd_config { - unsigned int airtime_update_interval; - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) - #endif /* CONFIG_AIRTIME_POLICY */ + unsigned int logger_syslog; /* module bitfield */ +@@ -938,6 +940,7 @@ struct spatial_reuse { + struct hostapd_config { + struct hostapd_bss_config **bss, *last_bss; + size_t num_bss; + char *config_id; - }; - + u16 beacon_int; + int rts_threshold; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -218,6 +218,10 @@ static int hostapd_iface_conf_changed(st +@@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st { size_t i; @@ -67,7 +68,7 @@ if (newconf->num_bss != oldconf->num_bss) return 1; -@@ -231,7 +235,7 @@ static int hostapd_iface_conf_changed(st +@@ -232,7 +236,7 @@ static int hostapd_iface_conf_changed(st } @@ -76,7 +77,7 @@ { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; -@@ -254,13 +258,16 @@ int hostapd_reload_config(struct hostapd +@@ -255,13 +259,16 @@ int hostapd_reload_config(struct hostapd if (newconf == NULL) return -1; @@ -95,7 +96,7 @@ wpa_printf(MSG_DEBUG, "Configuration changes include interface/BSS modification - force full disable+enable sequence"); fname = os_strdup(iface->config_fname); -@@ -285,6 +292,24 @@ int hostapd_reload_config(struct hostapd +@@ -286,6 +293,24 @@ int hostapd_reload_config(struct hostapd wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -120,7 +121,7 @@ } iface->conf = newconf; -@@ -301,6 +326,12 @@ int hostapd_reload_config(struct hostapd +@@ -302,6 +327,12 @@ int hostapd_reload_config(struct hostapd for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -133,7 +134,7 @@ hapd->iconf = newconf; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); -@@ -2366,6 +2397,10 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -2397,6 +2428,10 @@ hostapd_alloc_bss_data(struct hostapd_if hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; @@ -163,7 +164,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -597,7 +598,7 @@ struct hostapd_iface { +@@ -604,7 +605,7 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -174,7 +175,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4511,6 +4511,9 @@ static int wpa_driver_nl80211_set_ap(voi +@@ -4820,6 +4820,9 @@ static int wpa_driver_nl80211_set_ap(voi if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", ret, strerror(-ret)); @@ -186,7 +187,7 @@ nl80211_set_bss(bss, params->cts_protect, params->preamble, --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -184,7 +184,7 @@ static int hostapd_ctrl_iface_update(str +@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; reload_opts = txt; diff --git a/feeds/wifi-ax/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch b/feeds/wifi-ax/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch deleted file mode 100644 index e2db99eee..000000000 --- a/feeds/wifi-ax/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch +++ /dev/null @@ -1,37 +0,0 @@ -From cefc52e6b93731c713f1bba1cb5e7e92105b758b Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Fri, 3 Jul 2020 23:00:34 +0200 -Subject: [PATCH] dfs: enter DFS state if no available channel is found - -Previously hostapd would not stop transmitting when a DFS event was -detected and no available channel to switch to was available. - -Disable and re-enable the interface to enter DFS state. This way, TX -does not happen until the kernel notifies hostapd about the NOP -expiring. - -Signed-off-by: David Bauer ---- - src/ap/dfs.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1066,8 +1066,15 @@ static int hostapd_dfs_start_channel_swi - &oper_centr_freq_seg0_idx, - &oper_centr_freq_seg1_idx, - &skip_radar); -- if (!channel) -- return err; -+ if (!channel) { -+ /* -+ * Toggle interface state to enter DFS state -+ * until NOP is finished. -+ */ -+ hostapd_disable_iface(iface); -+ hostapd_enable_iface(iface); -+ return 0; -+ } - if (!skip_radar) { - iface->freq = channel->freq; - iface->conf->channel = channel->chan; diff --git a/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch b/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch deleted file mode 100644 index 182a3bb86..000000000 --- a/feeds/wifi-ax/hostapd/patches/800-probe_request-ignore-when-rssi-is-too-low.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e15b04870a7d7517a9b129d8d5cbebe6b8a25cb8 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Wed, 29 Jul 2020 17:38:15 +0200 -Subject: [PATCH 1/2] probe_request: ignore when rssi is too low - -Signed-off-by: John Crispin ---- - hostapd/config_file.c | 2 ++ - src/ap/ap_config.c | 1 + - src/ap/ap_config.h | 1 + - src/ap/beacon.c | 4 ++++ - 4 files changed, 8 insertions(+) - -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 13396aad2..e0b182c8e 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -4454,6 +4454,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, - conf->rssi_reject_assoc_rssi = atoi(pos); - } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) { - conf->rssi_reject_assoc_timeout = atoi(pos); -+ } else if (os_strcmp(buf, "rssi_ignore_probe_request") == 0) { -+ conf->rssi_ignore_probe_request = atoi(pos); - } else if (os_strcmp(buf, "pbss") == 0) { - bss->pbss = atoi(pos); - } else if (os_strcmp(buf, "transition_disable") == 0) { -diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c -index 56a4ac388..088bb831a 100644 ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c -@@ -277,6 +277,7 @@ struct hostapd_config * hostapd_config_defaults(void) - - conf->rssi_reject_assoc_rssi = 0; - conf->rssi_reject_assoc_timeout = 30; -+ conf->rssi_ignore_probe_request = 0; - - #ifdef CONFIG_AIRTIME_POLICY - conf->airtime_update_interval = AIRTIME_DEFAULT_UPDATE_INTERVAL; -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 7fe418363..a69a8d324 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1042,6 +1042,7 @@ struct hostapd_config { - - int rssi_reject_assoc_rssi; - int rssi_reject_assoc_timeout; -+ int rssi_ignore_probe_request; - - #ifdef CONFIG_AIRTIME_POLICY - enum { -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index ffb2e04d1..21fe04c2f 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -829,6 +829,10 @@ void handle_probe_req(struct hostapd_data *hapd, - struct radius_sta rad_info; - struct hostapd_data *resp_bss = hapd; - -+ if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && -+ ssi_signal < hapd->iconf->rssi_ignore_probe_request) -+ return; -+ - if (len < IEEE80211_HDRLEN) - return; - ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch b/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch index bf16db885..80377e444 100644 --- a/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch +++ b/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch @@ -1,6 +1,8 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -2420,6 +2420,8 @@ static int hostapd_config_fill(struct ho +Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c ++++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c +@@ -2458,6 +2458,8 @@ static int hostapd_config_fill(struct ho conf->ieee80211d = atoi(pos); } else if (os_strcmp(buf, "ieee80211h") == 0) { conf->ieee80211h = atoi(pos); @@ -9,9 +11,11 @@ } else if (os_strcmp(buf, "ieee8021x") == 0) { bss->ieee802_1x = atoi(pos); } else if (os_strcmp(buf, "eapol_version") == 0) { ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -949,6 +949,7 @@ struct hostapd_config { +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +@@ -979,6 +979,7 @@ struct hostapd_config { int ieee80211d; int ieee80211h; /* DFS */ @@ -19,18 +23,20 @@ /* * Local power constraint is an octet encoded as an unsigned integer in ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -17,6 +17,8 @@ - #include "ap_drv_ops.h" +Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.c ++++ hostapd-2021-02-20-59e9794c/src/ap/dfs.c +@@ -18,6 +18,8 @@ #include "drivers/driver.h" #include "dfs.h" + #include "crypto/crypto.h" +#include "beacon.h" +#include "eloop.h" static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1) -@@ -1015,6 +1017,73 @@ static int hostapd_dfs_start_channel_swi +@@ -1036,6 +1038,73 @@ static int hostapd_dfs_start_channel_swi return err; } @@ -104,7 +110,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) { -@@ -1049,6 +1118,9 @@ static int hostapd_dfs_start_channel_swi +@@ -1071,6 +1140,9 @@ static int hostapd_dfs_start_channel_swi if (iface->dfs_domain == HOSTAPD_DFS_REGION_ETSI) skip_radar = 0; @@ -114,7 +120,7 @@ /* Perform channel switch/CSA */ channel = dfs_get_valid_channel(iface, &secondary_channel, &oper_centr_freq_seg0_idx, -@@ -1172,6 +1244,12 @@ int hostapd_dfs_radar_detected(struct ho +@@ -1208,6 +1280,12 @@ int hostapd_dfs_radar_detected(struct ho if (!res) return 0; @@ -127,8 +133,10 @@ /* Skip if reported radar event not overlapped our channels */ res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2); if (!res) ---- a/src/ap/dfs.h -+++ b/src/ap/dfs.h +Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.h ++++ hostapd-2021-02-20-59e9794c/src/ap/dfs.h @@ -9,6 +9,11 @@ #ifndef DFS_H #define DFS_H @@ -141,9 +149,11 @@ int hostapd_handle_dfs(struct hostapd_iface *iface); int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq, ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -2767,6 +2767,7 @@ int hostapd_disable_iface(struct hostapd +Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c ++++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c +@@ -2866,6 +2866,7 @@ int hostapd_disable_iface(struct hostapd hostapd_cleanup_cs_params(hapd_iface->bss[j]); #endif /* NEED_AP_MLME */ diff --git a/feeds/wifi-ax/hostapd/patches/a00-108-supplicant-tdls-peer-inactivity.patch b/feeds/wifi-ax/hostapd/patches/a00-108-supplicant-tdls-peer-inactivity.patch deleted file mode 100644 index ba8748351..000000000 --- a/feeds/wifi-ax/hostapd/patches/a00-108-supplicant-tdls-peer-inactivity.patch +++ /dev/null @@ -1,402 +0,0 @@ ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1934,6 +1934,7 @@ struct wpa_driver_capa { - /** Driver supports Extended Key ID */ - #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x8000000000000000ULL - u64 flags; -+#define WPA_DRIVER_FLAGS_TDLS_INACTIVITY_TIMER 0x0000040000000000ULL - - /** Driver supports a separate control port RX for EAPOL frames */ - #define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL -@@ -4402,6 +4403,16 @@ struct wpa_driver_ops { - const u8 *bssid); - - /** -+ * get_peer_inactive_time - Get peer inactive time -+ * @priv: Private driver interface data -+ * @addr: MAC address of the peer -+ * -+ * Get the peer inactive time in seconds, for now used only for -+ * TDLS peers. -+ */ -+ int (*get_peer_inactive_time)(void *priv, const u8 *addr); -+ -+ /** - * update_connect_params - Update the connection parameters - * @priv: Private driver interface data - * @params: Association parameters ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -11797,6 +11797,7 @@ const struct wpa_driver_ops wpa_driver_n - #endif /* CONFIG_DRIVER_NL80211_QCA */ - .configure_data_frame_filters = nl80211_configure_data_frame_filters, - .get_ext_capab = nl80211_get_ext_capab, -+ .get_peer_inactive_time = i802_get_inact_sec, - .update_connect_params = nl80211_update_connection_params, - .send_external_auth_status = nl80211_send_external_auth_status, - .set_4addr_mode = nl80211_set_4addr_mode, ---- a/src/rsn_supp/tdls.c -+++ b/src/rsn_supp/tdls.c -@@ -723,12 +723,12 @@ static void wpa_tdls_peer_clear(struct w - - static void wpa_tdls_peer_free(struct wpa_sm *sm, struct wpa_tdls_peer *peer) - { -+ eloop_cancel_timeout(wpa_tdls_peer_inactivity_handler, sm, peer); - wpa_tdls_peer_clear(sm, peer); - wpa_tdls_peer_remove_from_list(sm, peer); - os_free(peer); - } - -- - static void wpa_tdls_linkid(struct wpa_sm *sm, struct wpa_tdls_peer *peer, - struct wpa_tdls_lnkid *lnkid) - { -@@ -1782,7 +1782,6 @@ static int tdls_nonce_set(const u8 *nonc - return 0; - } - -- - static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr, - const u8 *buf, size_t len) - { -@@ -2143,9 +2142,68 @@ error: - return -1; - } - -+void wpa_tdls_peer_inactivity_handler(void *eloop_data, void *user_data) -+{ -+ struct wpa_sm *sm = eloop_data; -+ struct wpa_tdls_peer *peer = user_data; -+ int inactive_time = 0; -+ unsigned long next_time = 0; -+ u8 teardown = 0; -+ -+ if (peer->tpk_in_progress) -+ return; -+ -+ inactive_time = wpa_sm_tdls_get_peer_inactive_time(sm, -+ peer->addr); -+ -+ if (inactive_time == -1) { -+ wpa_printf(MSG_DEBUG, "TDLS: failed to get station info " -+ "for " MACSTR, MAC2STR(peer->addr)); -+ -+ next_time = sm->tdls_peer_max_inactive_time; -+ } else if (inactive_time == -ENOENT) { -+ wpa_printf(MSG_DEBUG, "TDLS: failed to find kernel entry for " -+ "peer " MACSTR ", teardown the link", -+ MAC2STR(peer->addr)); -+ -+ teardown = 1; -+ } else if (inactive_time < sm->tdls_peer_max_inactive_time) { -+ wpa_printf(MSG_DEBUG, "TDLS: peer " MACSTR " has been inactive " -+ "for %d seconds", MAC2STR(peer->addr), inactive_time); -+ -+ next_time = sm->tdls_peer_max_inactive_time - inactive_time; -+ } else { -+ wpa_printf(MSG_DEBUG, "TDLS: peer " MACSTR " has been inactive " -+ "for long time: %d seconds, max inactive time: %d seconds", -+ MAC2STR(peer->addr), inactive_time, -+ sm->tdls_peer_max_inactive_time); -+ -+ teardown = 1; -+ } -+ -+ if (teardown) { -+ wpa_printf(MSG_DEBUG, "TDLS: tearing down TDLS link with peer " -+ MACSTR " (due to inactivity)", MAC2STR(peer->addr)); -+ -+ wpa_tdls_do_teardown(sm, peer, -+ WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED); -+ return; -+ } -+ -+ if (next_time) { -+ wpa_printf(MSG_DEBUG, "TDLS: reschedule inactivity timer for " -+ "peer " MACSTR " (%lu seconds)", MAC2STR(peer->addr), -+ next_time); -+ -+ eloop_register_timeout(next_time, 0, wpa_tdls_peer_inactivity_handler, -+ sm, peer); -+ } -+} - - static int wpa_tdls_enable_link(struct wpa_sm *sm, struct wpa_tdls_peer *peer) - { -+ int ret; -+ - peer->tpk_success = 1; - peer->tpk_in_progress = 0; - eloop_cancel_timeout(wpa_tdls_tpk_timeout, sm, peer); -@@ -2175,7 +2233,23 @@ static int wpa_tdls_enable_link(struct w - } - peer->reconfig_key = 0; - -- return wpa_sm_tdls_oper(sm, TDLS_ENABLE_LINK, peer->addr); -+ ret = wpa_sm_tdls_oper(sm, TDLS_ENABLE_LINK, peer->addr); -+ -+ /* Do not trigger supplicant inactivity logic if driver -+ * already supports it -+ */ -+ if (!ret && !sm->tdls_inactivity_teardown && -+ (sm->tdls_peer_max_inactive_time > 0)) { -+ wpa_printf(MSG_DEBUG, "TDLS: register inactivity handler for " -+ "peer "MACSTR " (%d seconds)", MAC2STR(peer->addr), -+ sm->tdls_peer_max_inactive_time); -+ -+ eloop_register_timeout(sm->tdls_peer_max_inactive_time, -+ 0, wpa_tdls_peer_inactivity_handler, -+ sm, peer); -+ } -+ -+ return ret; - } - - -@@ -2824,9 +2898,12 @@ int wpa_tdls_init(struct wpa_sm *sm) - */ - if (wpa_sm_tdls_get_capa(sm, &sm->tdls_supported, - &sm->tdls_external_setup, -- &sm->tdls_chan_switch) < 0) { -+ &sm->tdls_chan_switch, -+ &sm->tdls_inactivity_teardown, -+ &sm->tdls_peer_max_inactive_time) < 0) { - sm->tdls_supported = 1; - sm->tdls_external_setup = 0; -+ sm->tdls_inactivity_teardown = 1; - } - - wpa_printf(MSG_DEBUG, "TDLS: TDLS operation%s supported by " -@@ -2835,6 +2912,8 @@ int wpa_tdls_init(struct wpa_sm *sm) - sm->tdls_external_setup ? "external" : "internal"); - wpa_printf(MSG_DEBUG, "TDLS: Driver %s TDLS channel switching", - sm->tdls_chan_switch ? "supports" : "does not support"); -+ wpa_printf(MSG_DEBUG, "TDLS: Driver %s TDLS peer inactivity teardown", -+ sm->tdls_inactivity_teardown ? "supports" : "does not support"); - - return 0; - } ---- a/src/rsn_supp/wpa.h -+++ b/src/rsn_supp/wpa.h -@@ -58,7 +58,8 @@ struct wpa_sm_ctx { - int (*mark_authenticated)(void *ctx, const u8 *target_ap); - #ifdef CONFIG_TDLS - int (*tdls_get_capa)(void *ctx, int *tdls_supported, -- int *tdls_ext_setup, int *tdls_chan_switch); -+ int *tdls_ext_setup, int *tdls_chan_switch, -+ int *tdls_inact_teardown, int *tdls_inact_timeout); - int (*send_tdls_mgmt)(void *ctx, const u8 *dst, - u8 action_code, u8 dialog_token, - u16 status_code, u32 peer_capab, -@@ -78,6 +79,7 @@ struct wpa_sm_ctx { - void *ctx, const u8 *addr, u8 oper_class, - const struct hostapd_freq_params *params); - int (*tdls_disable_channel_switch)(void *ctx, const u8 *addr); -+ int (*tdls_get_peer_inact_time)(void *ctx, const u8 *addr); - #endif /* CONFIG_TDLS */ - void (*set_rekey_offload)(void *ctx, const u8 *kek, size_t kek_len, - const u8 *kck, size_t kck_len, -@@ -476,6 +478,7 @@ int wpa_tdls_enable_chan_switch(struct w - u8 oper_class, - struct hostapd_freq_params *freq_params); - int wpa_tdls_disable_chan_switch(struct wpa_sm *sm, const u8 *addr); -+void wpa_tdls_peer_inactivity_handler(void *eloop_data, void *user_data); - #ifdef CONFIG_TDLS_TESTING - extern unsigned int tdls_testing; - #endif /* CONFIG_TDLS_TESTING */ ---- a/src/rsn_supp/wpa_i.h -+++ b/src/rsn_supp/wpa_i.h -@@ -121,6 +121,12 @@ struct wpa_sm { - - /* The driver supports TDLS channel switching */ - int tdls_chan_switch; -+ -+ /* Driver supports TDLS peer inactivity teardown */ -+ int tdls_inactivity_teardown; -+ -+ /* Supplicant TDLS inactivity logic uses this timeout */ -+ int tdls_peer_max_inactive_time; - #endif /* CONFIG_TDLS */ - - #ifdef CONFIG_IEEE80211R -@@ -333,11 +339,15 @@ static inline void wpa_sm_set_rekey_offl - static inline int wpa_sm_tdls_get_capa(struct wpa_sm *sm, - int *tdls_supported, - int *tdls_ext_setup, -- int *tdls_chan_switch) -+ int *tdls_chan_switch, -+ int *tdls_inact_teardown, -+ int *tdls_inact_timeout) - { - if (sm->ctx->tdls_get_capa) - return sm->ctx->tdls_get_capa(sm->ctx->ctx, tdls_supported, -- tdls_ext_setup, tdls_chan_switch); -+ tdls_ext_setup, tdls_chan_switch, -+ tdls_inact_teardown, -+ tdls_inact_timeout); - return -1; - } - -@@ -406,6 +416,14 @@ wpa_sm_tdls_disable_channel_switch(struc - return sm->ctx->tdls_disable_channel_switch(sm->ctx->ctx, addr); - return -1; - } -+ -+static inline int -+wpa_sm_tdls_get_peer_inactive_time(struct wpa_sm *sm, const u8 *addr) -+{ -+ if (sm->ctx->tdls_get_peer_inact_time) -+ return sm->ctx->tdls_get_peer_inact_time(sm->ctx->ctx, addr); -+ return -1; -+} - #endif /* CONFIG_TDLS */ - - static inline int wpa_sm_key_mgmt_set_pmk(struct wpa_sm *sm, ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -4492,6 +4492,8 @@ struct wpa_config * wpa_config_alloc_emp - config->driver_param = os_strdup(driver_param); - config->gas_rand_addr_lifetime = DEFAULT_RAND_ADDR_LIFETIME; - -+ config->tdls_peer_max_inactivity = DEFAULT_TDLS_PEER_MAX_INACTIVITY; -+ - return config; - } - -@@ -5240,6 +5242,7 @@ static const struct global_parse_data gl - { STR(dpp_mud_url), 0 }, - #endif /* CONFIG_DPP */ - { INT_RANGE(coloc_intf_reporting, 0, 1), 0 }, -+ { INT(tdls_peer_max_inactivity), 0 }, - #ifdef CONFIG_WNM - { INT_RANGE(disable_btm, 0, 1), CFG_CHANGED_DISABLE_BTM }, - { INT_RANGE(extended_key_id, 0, 1), 0 }, ---- a/wpa_supplicant/config.h -+++ b/wpa_supplicant/config.h -@@ -44,6 +44,7 @@ - #define DEFAULT_MBO_CELL_CAPA MBO_CELL_CAPA_NOT_SUPPORTED - #define DEFAULT_DISASSOC_IMMINENT_RSSI_THRESHOLD -75 - #define DEFAULT_OCE_SUPPORT OCE_STA -+#define DEFAULT_TDLS_PEER_MAX_INACTIVITY 300 - #define DEFAULT_EXTENDED_KEY_ID 0 - - #include "config_ssid.h" -@@ -1536,6 +1537,15 @@ struct wpa_config { - int coloc_intf_reporting; - - /** -+ * tdls_peer_max_inactivity - Timeout to detect TDLS peer inactivity -+ * -+ * Time duration in seconds to detect TDLS peer inactivity and clean up -+ * of inactive TDLS peers. -+ * Default Value: 300 seconds. -+ */ -+ int tdls_peer_max_inactivity; -+ -+ /** - * p2p_device_random_mac_addr - P2P Device MAC address policy default - * - * 0 = use permanent MAC address ---- a/wpa_supplicant/config_file.c -+++ b/wpa_supplicant/config_file.c -@@ -1591,6 +1591,9 @@ static void wpa_config_write_global(FILE - if (config->coloc_intf_reporting) - fprintf(f, "coloc_intf_reporting=%d\n", - config->coloc_intf_reporting); -+ if (config->tdls_peer_max_inactivity != DEFAULT_TDLS_PEER_MAX_INACTIVITY) -+ fprintf(f, "tdls_peer_max_inactivity=%d\n", -+ config->tdls_peer_max_inactivity); - if (config->p2p_device_random_mac_addr) - fprintf(f, "p2p_device_random_mac_addr=%d\n", - config->p2p_device_random_mac_addr); ---- a/wpa_supplicant/driver_i.h -+++ b/wpa_supplicant/driver_i.h -@@ -1115,4 +1115,12 @@ static inline int wpa_drv_dpp_listen(str - return wpa_s->driver->dpp_listen(wpa_s->drv_priv, enable); - } - -+static inline int wpa_drv_get_inactive_time(struct wpa_supplicant *wpa_s, -+ const u8 *addr) -+{ -+ if (!wpa_s->driver->get_peer_inactive_time) -+ return -1; -+ return wpa_s->driver->get_peer_inactive_time(wpa_s->drv_priv, addr); -+} -+ - #endif /* DRIVER_I_H */ ---- a/wpa_supplicant/wpa_supplicant.conf -+++ b/wpa_supplicant/wpa_supplicant.conf -@@ -1646,6 +1646,18 @@ fast_reauth=1 - # In STA mode it defines the EDMG channel for connection (if supported by AP). - #edmg_channel=9 - -+# Inactivity limit for TDLS peers -+# -+# If a TDLS peer is inactive for tdls_peer_max_inactivity seconds, -+# the direct link with that TDLS peer will be terminated. This does -+# not break the communication between the peers, they can still -+# communicate through the AP, only the direct link will be torn down. -+# -+# When teardown happens, the STA entries of the TDLS peers will be -+# flushed out so that the TDLS link can be re-established if required. -+# default: 300 seconds -+#tdls_peer_max_inactivity=300 -+ - # Example blocks: - - # Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers ---- a/wpa_supplicant/wpas_glue.c -+++ b/wpa_supplicant/wpas_glue.c -@@ -728,13 +728,17 @@ static int wpa_supplicant_mark_authentic - - static int wpa_supplicant_tdls_get_capa(void *ctx, int *tdls_supported, - int *tdls_ext_setup, -- int *tdls_chan_switch) -+ int *tdls_chan_switch, -+ int *tdls_inact_teardown, -+ int *tdls_inact_timeout) - { - struct wpa_supplicant *wpa_s = ctx; - - *tdls_supported = 0; - *tdls_ext_setup = 0; - *tdls_chan_switch = 0; -+ *tdls_inact_teardown = 0; -+ *tdls_inact_timeout = 0; - - if (!wpa_s->drv_capa_known) - return -1; -@@ -748,6 +752,11 @@ static int wpa_supplicant_tdls_get_capa( - if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH) - *tdls_chan_switch = 1; - -+ if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_INACTIVITY_TIMER) -+ *tdls_inact_teardown = 1; -+ -+ *tdls_inact_timeout = wpa_s->conf->tdls_peer_max_inactivity; -+ - return 0; - } - -@@ -834,6 +843,13 @@ static int wpa_supplicant_tdls_disable_c - return wpa_drv_tdls_disable_channel_switch(wpa_s, addr); - } - -+static int wpa_supplicant_tdls_get_peer_inact_time(void *ctx, const u8 *addr) -+{ -+ struct wpa_supplicant *wpa_s = ctx; -+ -+ return wpa_drv_get_inactive_time(wpa_s, addr); -+} -+ - #endif /* CONFIG_TDLS */ - - #endif /* CONFIG_NO_WPA */ -@@ -1388,6 +1404,7 @@ int wpa_supplicant_init_wpa(struct wpa_s - wpa_supplicant_tdls_enable_channel_switch; - ctx->tdls_disable_channel_switch = - wpa_supplicant_tdls_disable_channel_switch; -+ ctx->tdls_get_peer_inact_time = wpa_supplicant_tdls_get_peer_inact_time; - #endif /* CONFIG_TDLS */ - ctx->set_rekey_offload = wpa_supplicant_set_rekey_offload; - ctx->key_mgmt_set_pmk = wpa_supplicant_key_mgmt_set_pmk; diff --git a/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch b/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch index 7b7dd4c93..ad96f8e73 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch @@ -8,7 +8,7 @@ #include "wps_hostapd.h" #include "ap_drv_ops.h" #include "ap_config.h" -@@ -2002,6 +2003,7 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2030,6 +2031,7 @@ void hostapd_wpa_event(void *ctx, enum w * Try to re-enable interface if the driver stopped it * when the interface got disabled. */ diff --git a/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch b/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch index c751fd6a3..d1c840a8e 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch @@ -9,7 +9,7 @@ wpa_hexdump(MSG_MSGDUMP, "WPA: EAPOL-Key Key MIC", mic, mic_len); if (key_data_length > data_len - sizeof(*hdr) - keyhdrlen) { -@@ -3079,7 +3079,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING) +@@ -3086,7 +3086,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING) idx = bitfield_get_first_zero(wpa_auth->ip_pool); if (idx >= 0) { u32 start = WPA_GET_BE32(wpa_auth->conf.ip_addr_start); diff --git a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch index 8f4fbdf55..a5bf71409 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3098,6 +3098,92 @@ set: +@@ -3112,6 +3112,92 @@ set: return ret; } @@ -93,7 +93,7 @@ static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, char *buf) -@@ -3768,6 +3854,10 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3790,6 +3876,10 @@ static int hostapd_ctrl_iface_receive_pr if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) reply_len = -1; #endif /* RADIUS_SERVER */ @@ -119,7 +119,7 @@ #ifdef CONFIG_DPP -@@ -1673,6 +1679,8 @@ static const struct hostapd_cli_cmd host +@@ -1705,6 +1711,8 @@ static const struct hostapd_cli_cmd host "=Add/Delete/Show/Clear deny MAC ACL" }, { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, " = poll a STA to check connectivity with a QoS null frame" }, diff --git a/feeds/wifi-ax/hostapd/patches/b00-033-wpa_supplicant-don-t-initate-TDLS-connection-if-stat.patch b/feeds/wifi-ax/hostapd/patches/b00-033-wpa_supplicant-don-t-initate-TDLS-connection-if-stat.patch deleted file mode 100644 index 8cc47c0fb..000000000 --- a/feeds/wifi-ax/hostapd/patches/b00-033-wpa_supplicant-don-t-initate-TDLS-connection-if-stat.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/wpa_supplicant/ctrl_iface.c -+++ b/wpa_supplicant/ctrl_iface.c -@@ -975,6 +975,12 @@ static int wpa_supplicant_ctrl_iface_tdl - u8 peer[ETH_ALEN]; - int ret; - -+ if (wpa_s->wpa_state != WPA_COMPLETED || wpa_s->current_ssid == NULL) { -+ wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP : ignoring request " -+ "not associated!"); -+ return -ENOTCONN; -+ } -+ - if (hwaddr_aton(addr, peer)) { - wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_DISCOVER: invalid " - "address '%s'", addr); -@@ -999,6 +1005,12 @@ static int wpa_supplicant_ctrl_iface_tdl - u8 peer[ETH_ALEN]; - int ret; - -+ if (wpa_s->wpa_state != WPA_COMPLETED || wpa_s->current_ssid == NULL) { -+ wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP : ignoring request " -+ "not associated!"); -+ return -ENOTCONN; -+ } -+ - if (hwaddr_aton(addr, peer)) { - wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP: invalid " - "address '%s'", addr); diff --git a/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch b/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch index a4ffe5d4f..a6e174dbc 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch @@ -157,7 +157,7 @@ Date: Thu Dec 6 15:17:46 2018 +0800 return len; } -@@ -800,6 +933,20 @@ int hostapd_ctrl_iface_status(struct hos +@@ -798,6 +931,20 @@ int hostapd_ctrl_iface_status(struct hos if (os_snprintf_error(buflen - len, ret)) return len; len += ret; @@ -178,7 +178,7 @@ Date: Thu Dec 6 15:17:46 2018 +0800 } if (iface->conf->ieee80211n && !hapd->conf->disable_11n) { -@@ -834,8 +981,33 @@ int hostapd_ctrl_iface_status(struct hos +@@ -832,8 +979,33 @@ int hostapd_ctrl_iface_status(struct hos if (os_snprintf_error(buflen - len, ret)) return len; len += ret; diff --git a/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch b/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch index 404d6ca3e..3251904f4 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4229,6 +4229,8 @@ static int hostapd_config_fill(struct ho +@@ -4235,6 +4235,8 @@ static int hostapd_config_fill(struct ho } else if (os_strcmp(buf, "wowlan_triggers") == 0) { os_free(bss->wowlan_triggers); bss->wowlan_triggers = os_strdup(pos); @@ -11,7 +11,7 @@ size_t len = os_strlen(pos); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1017,6 +1017,7 @@ struct hostapd_config { +@@ -1018,6 +1018,7 @@ struct hostapd_config { } *acs_chan_bias; unsigned int num_acs_chan_bias; #endif /* CONFIG_ACS */ diff --git a/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch b/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch index 2ffcfed8c..8de804a54 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch @@ -12,12 +12,14 @@ Signed-off-by: John Crispin src/drivers/nl80211_copy.h | 75 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 38 deletions(-) ---- a/src/drivers/nl80211_copy.h -+++ b/src/drivers/nl80211_copy.h -@@ -4447,6 +4447,10 @@ enum nl80211_chan_width { - NL80211_CHAN_WIDTH_160, - NL80211_CHAN_WIDTH_5, - NL80211_CHAN_WIDTH_10, +Index: hostapd-2021-02-08/src/drivers/nl80211_copy.h +=================================================================== +--- hostapd-2021-02-08.orig/src/drivers/nl80211_copy.h ++++ hostapd-2021-02-08/src/drivers/nl80211_copy.h +@@ -4541,6 +4541,10 @@ enum nl80211_chan_width { + NL80211_CHAN_WIDTH_4, + NL80211_CHAN_WIDTH_8, + NL80211_CHAN_WIDTH_16, + + /* keep last */ + __NL80211_CHAN_WIDTH_NUM, @@ -25,9 +27,11 @@ Signed-off-by: John Crispin }; /** ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1048,13 +1048,17 @@ static int hostapd_dfs_testmode_set_beac +Index: hostapd-2021-02-08/src/ap/dfs.c +=================================================================== +--- hostapd-2021-02-08.orig/src/ap/dfs.c ++++ hostapd-2021-02-08/src/ap/dfs.c +@@ -1051,13 +1051,17 @@ static int hostapd_dfs_testmode_set_beac iface->conf->hw_mode, iface->freq, iface->conf->channel, diff --git a/feeds/wifi-ax/hostapd/patches/c00-003-HE-fix-ieee80211_he_capabilities-size.patch b/feeds/wifi-ax/hostapd/patches/c00-003-HE-fix-ieee80211_he_capabilities-size.patch deleted file mode 100644 index a38672bda..000000000 --- a/feeds/wifi-ax/hostapd/patches/c00-003-HE-fix-ieee80211_he_capabilities-size.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 1c3efa63d93882899fa3ee996ec71a008289871b Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 1 Jul 2019 15:27:08 +0200 -Subject: [PATCH 1/2] HE: fix ieee80211_he_capabilities size - -Set the max value of optional bytes inside the data structure. This -requires us to calculate the actually used size when copying the -HE capabilities and generating the IE. - -Signed-off-by: John Crispin ---- - src/ap/ieee802_11_he.c | 35 +++++++++++++++++++++++++++++++---- - src/common/ieee802_11_defs.h | 2 +- - 2 files changed, 32 insertions(+), 5 deletions(-) - ---- a/src/ap/ieee802_11_he.c -+++ b/src/ap/ieee802_11_he.c -@@ -79,7 +79,6 @@ static int ieee80211_invalid_he_cap_size - return len != cap_len; - } - -- - u8 * hostapd_eid_he_capab(struct hostapd_data *hapd, u8 *eid, - enum ieee80211_op_mode opmode) - { -@@ -420,8 +419,7 @@ u16 copy_sta_he_capab(struct hostapd_dat - { - if (!he_capab || !hapd->iconf->ieee80211ax || - !check_valid_he_mcs(hapd, he_capab, opmode) || -- ieee80211_invalid_he_cap_size(he_capab, he_capab_len) || -- he_capab_len > sizeof(struct ieee80211_he_capabilities)) { -+ ieee80211_invalid_he_cap_size(he_capab, he_capab_len)) { - sta->flags &= ~WLAN_STA_HE; - os_free(sta->he_capab); - sta->he_capab = NULL; -@@ -430,13 +428,12 @@ u16 copy_sta_he_capab(struct hostapd_dat - - if (!sta->he_capab) { - sta->he_capab = -- os_zalloc(sizeof(struct ieee80211_he_capabilities)); -+ os_zalloc(he_capab_len); - if (!sta->he_capab) - return WLAN_STATUS_UNSPECIFIED_FAILURE; - } - - sta->flags |= WLAN_STA_HE; -- os_memset(sta->he_capab, 0, sizeof(struct ieee80211_he_capabilities)); - os_memcpy(sta->he_capab, he_capab, he_capab_len); - sta->he_capab_len = he_capab_len; - diff --git a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch index 850affe31..5f0748722 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch @@ -11,8 +11,10 @@ Signed-off-by: Miles Hu src/common/ieee802_11_defs.h | 12 +++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) ---- a/src/ap/hw_features.c -+++ b/src/ap/hw_features.c +Index: hostapd-2021-02-08/src/ap/hw_features.c +=================================================================== +--- hostapd-2021-02-08.orig/src/ap/hw_features.c ++++ hostapd-2021-02-08/src/ap/hw_features.c @@ -660,8 +660,63 @@ static int ieee80211ac_supported_vht_cap @@ -77,9 +79,11 @@ Signed-off-by: Miles Hu return 1; } #endif /* CONFIG_IEEE80211AX */ ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -2216,7 +2216,10 @@ struct ieee80211_spatial_reuse { +Index: hostapd-2021-02-08/src/common/ieee802_11_defs.h +=================================================================== +--- hostapd-2021-02-08.orig/src/common/ieee802_11_defs.h ++++ hostapd-2021-02-08/src/common/ieee802_11_defs.h +@@ -2233,7 +2233,10 @@ struct ieee80211_spatial_reuse { /* HE Capabilities Information defines */ @@ -91,7 +95,7 @@ Signed-off-by: Miles Hu #define HE_PHYCAP_CHANNEL_WIDTH_SET_IDX 0 #define HE_PHYCAP_CHANNEL_WIDTH_MASK ((u8) (BIT(1) | BIT(2) | \ -@@ -2233,6 +2236,13 @@ struct ieee80211_spatial_reuse { +@@ -2250,6 +2253,13 @@ struct ieee80211_spatial_reuse { #define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX 4 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB ((u8) BIT(1)) diff --git a/feeds/wifi-ax/hostapd/patches/c00-008-nl80211-Don-t-force-VHT-channel-definition-with-HE.patch b/feeds/wifi-ax/hostapd/patches/c00-008-nl80211-Don-t-force-VHT-channel-definition-with-HE.patch deleted file mode 100644 index 9cc1582cd..000000000 --- a/feeds/wifi-ax/hostapd/patches/c00-008-nl80211-Don-t-force-VHT-channel-definition-with-HE.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 47dec75fa3e1ac2156fe0edf9c80ba06e309cb0e Mon Sep 17 00:00:00 2001 -From: Sven Eckelmann -Date: Mon, 1 Jul 2019 15:34:08 +0200 -Subject: [PATCH] nl80211: Don't force VHT channel definition with HE - -HE (802.11ax) is also supported on 2.4GHz. And the 2.4GHz band isn't -supposed to use VHT opers. Some codepaths in wpa_supplicant will therefore -not initialize the freq->bandwidth or the freq->center_freq1/2 members. As -a result, the nl80211_put_freq_params will directly return an error (-1) or -the kernel will return an error due to the invalid channel definition. - -Instead, the channel definitions should be created based on the actual -HT/VHT/none information on 2.4GHz. - -Fixes: ad9a1bfe788e ("nl80211: Share VHT channel configuration for HE") -Signed-off-by: Sven Eckelmann ---- - src/drivers/driver_nl80211.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4633,8 +4633,8 @@ static int nl80211_put_freq_params(struc - wpa_printf(MSG_DEBUG, " * ht_enabled=%d", freq->ht_enabled); - - hw_mode = ieee80211_freq_to_chan(freq->freq, &channel); -- is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G || -- hw_mode == HOSTAPD_MODE_IEEE80211B; -+ is_24ghz = ((hw_mode == HOSTAPD_MODE_IEEE80211G) || -+ (hw_mode == HOSTAPD_MODE_IEEE80211B)); - - if (freq->vht_enabled || (freq->he_enabled && !is_24ghz)) { - enum nl80211_chan_width cw; diff --git a/feeds/wifi-ax/hostapd/patches/c00-009-hostapd-detect-active-sta-using-TX-duration-in-ATF.patch b/feeds/wifi-ax/hostapd/patches/c00-009-hostapd-detect-active-sta-using-TX-duration-in-ATF.patch deleted file mode 100644 index b1346b993..000000000 --- a/feeds/wifi-ax/hostapd/patches/c00-009-hostapd-detect-active-sta-using-TX-duration-in-ATF.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/src/ap/airtime_policy.c -+++ b/src/ap/airtime_policy.c -@@ -80,8 +80,12 @@ static void count_backlogged_sta(struct - if (hostapd_drv_read_sta_data(hapd, &data, sta->addr)) - continue; - -- if (data.backlog_bytes > 0) -+ if (data.backlog_bytes > 0 || -+ data.tx_airtime > sta->tx_airtime) { - set_new_backlog_time(hapd, sta, &now); -+ sta->tx_airtime = data.tx_airtime; -+ } -+ - if (os_reltime_before(&now, &sta->backlogged_until)) - num_backlogged++; - } ---- a/src/ap/sta_info.h -+++ b/src/ap/sta_info.h -@@ -286,6 +286,7 @@ struct sta_info { - #ifdef CONFIG_AIRTIME_POLICY - unsigned int airtime_weight; - struct os_reltime backlogged_until; -+ unsigned long long tx_airtime; - #endif /* CONFIG_AIRTIME_POLICY */ - }; - diff --git a/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch b/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch index 8e3dc43cc..8232429c5 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2636,7 +2636,7 @@ skip_ht40: +@@ -2653,7 +2653,7 @@ skip_ht40: if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, freq->channel, ssid->enable_edmg, ssid->edmg_channel, freq->ht_enabled, diff --git a/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch b/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch index 55ea57fe4..3b10235d7 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4065,10 +4065,12 @@ static int hostapd_config_fill(struct ho +@@ -4143,10 +4143,12 @@ static int hostapd_config_fill(struct ho #ifdef CONFIG_MBO } else if (os_strcmp(buf, "mbo") == 0) { bss->mbo_enabled = atoi(pos); @@ -17,7 +17,7 @@ #define PARSE_TEST_PROBABILITY(_val) \ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -880,10 +880,11 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -882,10 +882,11 @@ static int hostapd_ctrl_iface_bss_tm_req if (pos) { pos += 10; req_mode |= WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED; @@ -31,9 +31,18 @@ end = os_strchr(pos, ','); if (end == NULL) { wpa_printf(MSG_DEBUG, "Invalid bss_term data"); +@@ -895,7 +896,7 @@ static int hostapd_ctrl_iface_bss_tm_req + WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); + } + +- nei_len = ieee802_11_parse_candidate_list(cmd, nei_rep, ++ nei_len = ieee802_11_parse_candidate_list(cmd, sta, nei_rep, + sizeof(nei_rep)); + if (nei_len < 0) + return -1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -712,6 +712,11 @@ struct hostapd_bss_config { +@@ -714,6 +714,11 @@ struct hostapd_bss_config { * - Set BIT(2) to enable OCE in AP mode */ unsigned int oce; @@ -131,7 +140,7 @@ u8 * hostapd_eid_mbo(struct hostapd_data *hapd, u8 *eid, size_t len); --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c -@@ -797,11 +797,13 @@ u8 * hostapd_eid_mbo(struct hostapd_data +@@ -801,11 +801,13 @@ u8 * hostapd_eid_mbo(struct hostapd_data !OCE_STA_CFON_ENABLED(hapd) && !OCE_AP_ENABLED(hapd)) return eid; @@ -196,19 +205,19 @@ #define MAX_TFS_IE_LEN 1024 -@@ -364,11 +365,26 @@ static int ieee802_11_send_bss_trans_mgm +@@ -366,11 +367,27 @@ static int ieee802_11_send_bss_trans_mgm u8 dialog_token) { struct ieee80211_mgmt *mgmt; - size_t len; -- u8 *pos; + size_t len, nr_len = 0; -+ u8 *pos, *nr_pos; + u8 *pos; + u8 req_mode = 0; int res; - mgmt = os_zalloc(sizeof(*mgmt)); +#ifdef CONFIG_MBO ++ u8 *nr_pos; + struct hostapd_neighbor_entry *nr; + struct wpabuf *nrbuf = NULL; + if (hapd->conf->mbo_enabled) { @@ -226,7 +235,7 @@ if (mgmt == NULL) return -1; os_memcpy(mgmt->da, addr, ETH_ALEN); -@@ -379,7 +395,11 @@ static int ieee802_11_send_bss_trans_mgm +@@ -381,7 +398,11 @@ static int ieee802_11_send_bss_trans_mgm mgmt->u.action.category = WLAN_ACTION_WNM; mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ; mgmt->u.action.u.bss_tm_req.dialog_token = dialog_token; @@ -239,7 +248,7 @@ mgmt->u.action.u.bss_tm_req.disassoc_timer = host_to_le16(0); mgmt->u.action.u.bss_tm_req.validity_interval = 1; pos = mgmt->u.action.u.bss_tm_req.variable; -@@ -392,6 +412,25 @@ static int ieee802_11_send_bss_trans_mgm +@@ -394,6 +415,25 @@ static int ieee802_11_send_bss_trans_mgm le_to_host16(mgmt->u.action.u.bss_tm_req.disassoc_timer), mgmt->u.action.u.bss_tm_req.validity_interval); @@ -265,3 +274,97 @@ len = pos - &mgmt->u.action.category; res = hostapd_drv_send_action(hapd, hapd->iface->freq, 0, mgmt->da, &mgmt->u.action.category, len); +--- a/src/common/ieee802_11_common.c ++++ b/src/common/ieee802_11_common.c +@@ -2290,11 +2290,21 @@ bool is_6ghz_psc_frequency(int freq) + } + + +-int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep, +- size_t nei_rep_len) ++int ieee802_11_parse_candidate_list(const char *pos, struct sta_info *sta, ++ u8 *nei_rep, size_t nei_rep_len) + { + u8 *nei_pos = nei_rep; + const char *end; ++#ifdef CONFIG_MBO ++ u8 non_pref_chan = 0; ++ u8 *pref_pos = NULL; ++ int i; ++ ++ struct mbo_non_pref_chan_info *info = NULL; ++ ++ if (sta && sta->non_pref_chan) ++ info = sta->non_pref_chan; ++#endif + + /* + * BSS Transition Candidate List Entries - Neighbor Report elements +@@ -2350,6 +2360,9 @@ int ieee802_11_parse_candidate_list(cons + pos++; + + *nei_pos++ = atoi(pos); /* Channel Number */ ++#ifdef CONFIG_MBO ++ non_pref_chan = atoi(pos); ++#endif + pos = os_strchr(pos, ','); + if (pos == NULL) { + wpa_printf(MSG_DEBUG, "Missing PHY Type"); +@@ -2381,6 +2394,25 @@ int ieee802_11_parse_candidate_list(cons + "Invalid neighbor subelement info"); + return -1; + } ++#ifdef CONFIG_MBO ++ if (info) { ++ for (i = 0; i < (len / 2); i++) ++ if (nei_pos[i] == WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE && ++ nei_pos[i + 1] == 0x1) /* length */ ++ pref_pos = (nei_pos + i + 2); ++ ++ /* If STA had updated MBO non-pref chan report, ++ * use the same candidate preference value in the ++ * BSS Transition Candidate sub-element. ++ */ ++ for ( ; info ; info = info->next) ++ for (i = 0; i < info->num_channels; i++) ++ if (non_pref_chan == info->channels[i]) ++ *pref_pos = info->pref; ++ ++ info = sta->non_pref_chan; ++ } ++#endif + nei_pos += len / 2; + pos = end; + } +--- a/src/common/ieee802_11_common.h ++++ b/src/common/ieee802_11_common.h +@@ -11,6 +11,7 @@ + + #include "defs.h" + #include "ieee802_11_defs.h" ++#include "ap/sta_info.h" + + struct element { + u8 id; +@@ -265,8 +266,8 @@ bool is_6ghz_freq(int freq); + bool is_6ghz_op_class(u8 op_class); + bool is_6ghz_psc_frequency(int freq); + +-int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep, +- size_t nei_rep_len); ++int ieee802_11_parse_candidate_list(const char *pos, struct sta_info *sta, ++ u8 *nei_rep, size_t nei_rep_len); + + int ieee802_11_ext_capab(const u8 *ie, unsigned int capab); + int op_class_to_bandwidth(u8 op_class); +--- a/wpa_supplicant/wnm_sta.c ++++ b/wpa_supplicant/wnm_sta.c +@@ -1630,7 +1630,7 @@ int wnm_send_bss_transition_mgmt_query(s + return ret; + } + +- ret = ieee802_11_parse_candidate_list(btm_candidates, ++ ret = ieee802_11_parse_candidate_list(btm_candidates, NULL, + wpabuf_put(buf, 0), + max_len); + if (ret < 0) { diff --git a/feeds/wifi-ax/hostapd/patches/c00-012-AP-Allow-downgrading-to-20MHz-based-on-OBSS-results.patch b/feeds/wifi-ax/hostapd/patches/c00-012-AP-Allow-downgrading-to-20MHz-based-on-OBSS-results.patch deleted file mode 100644 index 6546e6fb1..000000000 --- a/feeds/wifi-ax/hostapd/patches/c00-012-AP-Allow-downgrading-to-20MHz-based-on-OBSS-results.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/src/ap/hw_features.c -+++ b/src/ap/hw_features.c -@@ -313,7 +313,7 @@ static void ieee80211n_check_scan(struct - { - struct wpa_scan_results *scan_res; - int oper40; -- int res; -+ int res = 0; - - /* Check list of neighboring BSSes (from scan) to see whether 40 MHz is - * allowed per IEEE Std 802.11-2012, 10.15.3.2 */ -@@ -349,8 +349,16 @@ static void ieee80211n_check_scan(struct - } - } - -- res = ieee80211n_allowed_ht40_channel_pair(iface); -+ /* -+ * Secondary channel is set to 0 if OBSS failed. -+ * The function ieee80211n_allowed_ht40_channel_pair() sets primary -+ * and secondary channel to same value in this case. -+ */ -+ if(iface->conf->secondary_channel) -+ res = ieee80211n_allowed_ht40_channel_pair(iface); -+ - if (!res) { -+ /* Downgrade to 20MHz. */ - iface->conf->secondary_channel = 0; - hostapd_set_oper_centr_freq_seg0_idx(iface->conf, 0); - hostapd_set_oper_centr_freq_seg1_idx(iface->conf, 0); diff --git a/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch b/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch deleted file mode 100644 index fa74551e7..000000000 --- a/feeds/wifi-ax/hostapd/patches/d00-001-add-HE-support-to-chan-switch-cmd.patch +++ /dev/null @@ -1,182 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -2658,9 +2658,9 @@ static int hostapd_ctrl_iface_chan_switc - - for (i = 0; i < iface->num_bss; i++) { - -- /* Save CHAN_SWITCH VHT config */ -- hostapd_chan_switch_vht_config( -- iface->bss[i], settings.freq_params.vht_enabled); -+ /* Save CHAN_SWITCH VHT and HE config */ -+ hostapd_chan_switch_config( -+ iface->bss[i], &settings.freq_params); - - ret = hostapd_switch_channel(iface->bss[i], &settings); - if (ret) { ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1039,6 +1039,13 @@ struct hostapd_config { - u8 he_oper_centr_freq_seg1_idx; - #endif /* CONFIG_IEEE80211AX */ - -+#ifdef CONFIG_IEEE80211AX -+ /* HE enable/disable config from CHAN_SWITCH */ -+#define CH_SWITCH_HE_ENABLED BIT(0) -+#define CH_SWITCH_HE_DISABLED BIT(1) -+ unsigned int ch_switch_he_config; -+#endif /* CONFIG_IEEE80211AX */ -+ - /* VHT enable/disable config from CHAN_SWITCH */ - #define CH_SWITCH_VHT_ENABLED BIT(0) - #define CH_SWITCH_VHT_DISABLED BIT(1) ---- a/src/ap/ctrl_iface_ap.c -+++ b/src/ap/ctrl_iface_ap.c -@@ -1084,6 +1084,7 @@ int hostapd_parse_csa_settings(const cha - SET_CSA_SETTING(sec_channel_offset); - settings->freq_params.ht_enabled = !!os_strstr(pos, " ht"); - settings->freq_params.vht_enabled = !!os_strstr(pos, " vht"); -+ settings->freq_params.he_enabled = !!os_strstr(pos, " he"); - settings->block_tx = !!os_strstr(pos, " blocktx"); - #undef SET_CSA_SETTING - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -3546,15 +3546,22 @@ void hostapd_cleanup_cs_params(struct ho - } - - --void hostapd_chan_switch_vht_config(struct hostapd_data *hapd, int vht_enabled) -+void hostapd_chan_switch_config(struct hostapd_data *hapd, struct hostapd_freq_params *freq_params) - { -- if (vht_enabled) -+ if (freq_params->he_enabled) -+ hapd->iconf->ch_switch_he_config |= CH_SWITCH_HE_ENABLED; -+ else -+ hapd->iconf->ch_switch_he_config |= CH_SWITCH_HE_DISABLED; -+ -+ if (freq_params->vht_enabled) - hapd->iconf->ch_switch_vht_config |= CH_SWITCH_VHT_ENABLED; - else - hapd->iconf->ch_switch_vht_config |= CH_SWITCH_VHT_DISABLED; - - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -- HOSTAPD_LEVEL_INFO, "CHAN_SWITCH VHT CONFIG 0x%x", -+ HOSTAPD_LEVEL_INFO, "CHAN_SWITCH HE CONFIG 0x%x " -+ "CHAN_SWITCH VHT CONFIG 0x%x", -+ hapd->iconf->ch_switch_he_config, - hapd->iconf->ch_switch_vht_config); - } - ---- a/src/common/ieee802_11_common.c -+++ b/src/common/ieee802_11_common.c -@@ -870,10 +870,10 @@ enum hostapd_hw_mode ieee80211_freq_to_c - - /** - * ieee80211_freq_to_channel_ext - Convert frequency into channel info -- * for HT40 and VHT. DFS channels are not covered. -+ * for HT40 VHT and HE, DFS channels are not covered. - * @freq: Frequency (MHz) to convert - * @sec_channel: 0 = non-HT40, 1 = sec. channel above, -1 = sec. channel below -- * @chanwidth: VHT/EDMG channel width (CHANWIDTH_*) -+ * @chanwidth: VHT/HE channel width (CHANWIDTH_*) - * @op_class: Buffer for returning operating class - * @channel: Buffer for returning channel number - * Returns: hw_mode on success, NUM_HOSTAPD_MODES on failure ---- a/src/common/ieee802_11_common.h -+++ b/src/common/ieee802_11_common.h -@@ -209,7 +209,7 @@ int hostapd_config_tx_queue(struct hosta - enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel); - int ieee80211_chan_to_freq(const char *country, u8 op_class, u8 chan); - enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq, -- int sec_channel, int vht, -+ int sec_channel, int chan_width, - u8 *op_class, u8 *channel); - int ieee80211_chaninfo_to_channel(unsigned int freq, enum chan_width chanwidth, - int sec_channel, u8 *op_class, u8 *channel); ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -1293,7 +1293,7 @@ struct ieee80211_ampe_ie { - - #define VHT_RX_NSS_MAX_STREAMS 8 - --/* VHT/EDMG channel widths */ -+/* HE and VHT channel widths */ - #define CHANWIDTH_USE_HT 0 - #define CHANWIDTH_80MHZ 1 - #define CHANWIDTH_160MHZ 2 ---- a/src/ap/drv_callbacks.c -+++ b/src/ap/drv_callbacks.c -@@ -862,9 +862,10 @@ void hostapd_event_ch_switch(struct host - - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_INFO, -- "driver %s channel switch: freq=%d, ht=%d, vht_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d", -+ "driver %s channel switch: freq=%d, ht=%d, vht_ch=0x%x, he_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d", - finished ? "had" : "starting", -- freq, ht, hapd->iconf->ch_switch_vht_config, offset, -+ freq, ht, hapd->iconf->ch_switch_vht_config, -+ hapd->iconf->ch_switch_he_config, offset, - width, channel_width_to_string(width), cf1, cf2); - - if (!hapd->iface->current_mode) { -@@ -919,16 +920,30 @@ void hostapd_event_ch_switch(struct host - hapd->iconf->ieee80211n = ht; - if (!ht) { - hapd->iconf->ieee80211ac = 0; -- } else if (hapd->iconf->ch_switch_vht_config) { -- /* CHAN_SWITCH VHT config */ -- if (hapd->iconf->ch_switch_vht_config & -- CH_SWITCH_VHT_ENABLED) -- hapd->iconf->ieee80211ac = 1; -- else if (hapd->iconf->ch_switch_vht_config & -- CH_SWITCH_VHT_DISABLED) -- hapd->iconf->ieee80211ac = 0; -+ hapd->iconf->ieee80211ax = 0; -+ } else { -+ if (hapd->iconf->ch_switch_vht_config) { -+ /* CHAN_SWITCH VHT config */ -+ if (hapd->iconf->ch_switch_vht_config & -+ CH_SWITCH_VHT_ENABLED) -+ hapd->iconf->ieee80211ac = 1; -+ else if (hapd->iconf->ch_switch_vht_config & -+ CH_SWITCH_VHT_DISABLED) -+ hapd->iconf->ieee80211ac = 0; -+ } -+ if (hapd->iconf->ch_switch_he_config) { -+ /* CHAN_SWITCH HE config */ -+ if (hapd->iconf->ch_switch_he_config & -+ CH_SWITCH_HE_ENABLED){ -+ hapd->iconf->ieee80211ax = 1; -+ hapd->iconf->ieee80211ac = 1; -+ } else if (hapd->iconf->ch_switch_he_config & -+ CH_SWITCH_HE_DISABLED) -+ hapd->iconf->ieee80211ax = 0; -+ } - } - hapd->iconf->ch_switch_vht_config = 0; -+ hapd->iconf->ch_switch_he_config = 0; - - hapd->iconf->secondary_channel = offset; - hostapd_set_oper_chwidth(hapd->iconf, chwidth); ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -627,7 +627,7 @@ void hostapd_channel_list_updated(struct - void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s); - const char * hostapd_state_text(enum hostapd_iface_state s); - int hostapd_csa_in_progress(struct hostapd_iface *iface); --void hostapd_chan_switch_vht_config(struct hostapd_data *hapd, int vht_enabled); -+void hostapd_chan_switch_config(struct hostapd_data *hapd, struct hostapd_freq_params *freq_params); - int hostapd_switch_channel(struct hostapd_data *hapd, - struct csa_settings *settings); - void ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4672,7 +4672,7 @@ static int nl80211_put_freq_params(struc - nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, - freq->center_freq2))) - return -ENOBUFS; -- } else if (freq->ht_enabled) { -+ } else if (freq->ht_enabled || (freq->he_enabled && is_24ghz)) { - enum nl80211_channel_type ct; - - wpa_printf(MSG_DEBUG, " * sec_channel_offset=%d", diff --git a/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch b/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch new file mode 100644 index 000000000..b8ee16442 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch @@ -0,0 +1,30 @@ +From 950186814b355d91bcb15ce544eed6f5727da791 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Tue, 17 Nov 2020 19:23:46 +0530 +Subject: [PATCH] hostapd: Add channel width config in htcapab for 40MHz + +HT Support Channel Width field needs to be set in HT capabilities for +40MHz BW operation. + +Signed-off-by: Lavanya Suresh +--- + src/ap/hostapd.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index be9ef82..346d83c 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3532,6 +3532,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd, + if (!iface || !iface->freq || hapd->csa_in_progress) + return -1; + ++ if (settings->freq_params.bandwidth != 20) ++ hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; ++ + switch (settings->freq_params.bandwidth) { + case 80: + if (settings->freq_params.center_freq2) +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch index db8aa1330..a5ef7905f 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch @@ -1,96 +1,43 @@ -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h -@@ -1193,6 +1193,12 @@ struct wpa_driver_associate_params { - * fils_erp_rrk_len - Length of fils_erp_rrk in bytes - */ - size_t fils_erp_rrk_len; -+#ifdef CONFIG_HE_OVERRIDES -+ /** -+ * Disable HE for this connection -+ */ -+ int disable_he; -+#endif /* CONFIG_HE_OVERRIDES */ - }; - - enum hide_ssid { -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/config.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/config.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/config.c -@@ -2676,6 +2676,9 @@ static const struct parse_data ssid_fiel - { INT_RANGE(owe_ptk_workaround, 0, 1) }, - { INT_RANGE(multi_ap_backhaul_sta, 0, 1) }, - { INT_RANGE(ft_eap_pmksa_caching, 0, 1) }, -+#ifdef CONFIG_HE_OVERRIDES -+ { INT_RANGE(disable_he,0,1)}, -+#endif - { INT_RANGE(beacon_prot, 0, 1) }, - { INT_RANGE(transition_disable, 0, 255) }, - { INT_RANGE(sae_pk, 0, 2) }, -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/config_ssid.h -@@ -1111,7 +1111,12 @@ struct wpa_ssid { +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_ssid.h ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h +@@ -1121,7 +1121,6 @@ struct wpa_ssid { * FT initial mobility domain association. */ int ft_eap_pmksa_caching; - -+#ifdef CONFIG_HE_OVERRIDES -+ /** -+ * Disable HE for this connection -+ */ -+ int disable_he; -+#endif /* CONFIG_HE_OVERRIDES */ /** * beacon_prot - Whether Beacon protection is enabled * -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_cli.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_cli.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_cli.c -@@ -1485,6 +1485,9 @@ static const char *network_fields[] = { - "update_identifier", - #endif /* CONFIG_HS20 */ - "mac_addr", "pbss", "wps_disabled" -+#ifdef CONFIG_HE_OVERRIDES -+ "disable_he" -+#endif /* CONFIG_HE_OVERRIDES */ - }; - - -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c -@@ -2480,17 +2480,17 @@ void ibss_mesh_setup_freq(struct wpa_sup +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +@@ -2521,16 +2521,14 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Allow HE on 2.4 GHz without VHT: see nl80211_put_freq_params() */ -+#ifdef CONFIG_HE_OVERRIDES +- if (is_24ghz) +- freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; + if (is_24ghz) { + #ifdef CONFIG_HE_OVERRIDES +- if (is_24ghz && ssid->disable_he) +- freq->he_enabled = 0; + if (ssid->disable_he) + freq->he_enabled = 0; + else -+ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; -+#else - if (is_24ghz) - freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; --#ifdef CONFIG_HE_OVERRIDES -- if (is_24ghz && ssid->disable_he) -- freq->he_enabled = 0; #endif /* CONFIG_HE_OVERRIDES */ - +- - /* Setup higher BW only for 5 GHz */ - if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan)) - return; -- ++ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; ++ } + for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { pri_chan = &mode->channels[chan_idx]; - if (pri_chan->chan == channel) -@@ -2585,6 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2626,6 +2624,11 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); } @@ -102,7 +49,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_HT_OVERRIDES skip_ht40: -@@ -2617,6 +2622,11 @@ skip_ht40: +@@ -2658,6 +2661,11 @@ skip_ht40: /* Enable HE with VHT for 5 GHz */ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; diff --git a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch index adddcce12..dbe2dec33 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3444,6 +3444,8 @@ static int hostapd_config_fill(struct ho +@@ -3448,6 +3448,8 @@ static int hostapd_config_fill(struct ho conf->he_phy_capab.he_su_beamformee = atoi(pos); } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { conf->he_phy_capab.he_mu_beamformer = atoi(pos); @@ -37,7 +37,7 @@ conf->he_op.he_bss_color = 1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -874,6 +874,7 @@ struct he_phy_capabilities_info { +@@ -875,6 +875,7 @@ struct he_phy_capabilities_info { bool he_su_beamformer; bool he_su_beamformee; bool he_mu_beamformer; @@ -47,9 +47,9 @@ /** --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -714,9 +714,10 @@ static int ieee80211ax_supported_he_capa - HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SPR_SR_CAPB, - HE_PHYCAP_SPR_SR_CAPB_IDX, conf->spr.sr_control); +@@ -717,9 +717,10 @@ static int ieee80211ax_supported_he_capa + (SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT | + SPATIAL_REUSE_SRG_INFORMATION_PRESENT)))); - HE_CAP_CHECK2(hw->phy_cap, HE_PHYCAP_UL_MUMIMO_CAPB, - HE_PHYCAP_UL_MUMIMO_CAPB_IDX, HE_PHYCAP_UL_MUOFDMA_CAPB, diff --git a/feeds/wifi-ax/hostapd/patches/d00-005-hostapd-fix-btm-cand-pref-update.patch b/feeds/wifi-ax/hostapd/patches/d00-005-hostapd-fix-btm-cand-pref-update.patch deleted file mode 100644 index 4af53f2f7..000000000 --- a/feeds/wifi-ax/hostapd/patches/d00-005-hostapd-fix-btm-cand-pref-update.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -894,7 +894,7 @@ static int hostapd_ctrl_iface_bss_tm_req - WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); - } - -- nei_len = ieee802_11_parse_candidate_list(cmd, nei_rep, -+ nei_len = ieee802_11_parse_candidate_list(cmd, sta, nei_rep, - sizeof(nei_rep)); - if (nei_len < 0) - return -1; ---- a/src/common/ieee802_11_common.c -+++ b/src/common/ieee802_11_common.c -@@ -2257,11 +2257,21 @@ int is_6ghz_psc_frequency(int freq) - } - - --int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep, -- size_t nei_rep_len) -+int ieee802_11_parse_candidate_list(const char *pos, struct sta_info *sta, -+ u8 *nei_rep, size_t nei_rep_len) - { - u8 *nei_pos = nei_rep; - const char *end; -+#ifdef CONFIG_MBO -+ u8 non_pref_chan = 0; -+ u8 *pref_pos = NULL; -+ int i; -+ -+ struct mbo_non_pref_chan_info *info = NULL; -+ -+ if (sta && sta->non_pref_chan) -+ info = sta->non_pref_chan; -+#endif - - /* - * BSS Transition Candidate List Entries - Neighbor Report elements -@@ -2317,6 +2327,9 @@ int ieee802_11_parse_candidate_list(cons - pos++; - - *nei_pos++ = atoi(pos); /* Channel Number */ -+#ifdef CONFIG_MBO -+ non_pref_chan = atoi(pos); -+#endif - pos = os_strchr(pos, ','); - if (pos == NULL) { - wpa_printf(MSG_DEBUG, "Missing PHY Type"); -@@ -2348,6 +2361,25 @@ int ieee802_11_parse_candidate_list(cons - "Invalid neighbor subelement info"); - return -1; - } -+#ifdef CONFIG_MBO -+ if (info) { -+ for (i = 0; i < (len / 2); i++) -+ if (nei_pos[i] == WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE && -+ nei_pos[i + 1] == 0x1) /* length */ -+ pref_pos = (nei_pos + i + 2); -+ -+ /* If STA had updated MBO non-pref chan report, -+ * use the same candidate preference value in the -+ * BSS Transition Candidate sub-element. -+ */ -+ for ( ; info ; info = info->next) -+ for (i = 0; i < info->num_channels; i++) -+ if (non_pref_chan == info->channels[i]) -+ *pref_pos = info->pref; -+ -+ info = sta->non_pref_chan; -+ } -+#endif - nei_pos += len / 2; - pos = end; - } ---- a/src/common/ieee802_11_common.h -+++ b/src/common/ieee802_11_common.h -@@ -11,6 +11,7 @@ - - #include "defs.h" - #include "ieee802_11_defs.h" -+#include "ap/sta_info.h" - - struct element { - u8 id; -@@ -262,8 +263,8 @@ int is_6ghz_freq(int freq); - int is_6ghz_op_class(u8 op_class); - int is_6ghz_psc_frequency(int freq); - --int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep, -- size_t nei_rep_len); -+int ieee802_11_parse_candidate_list(const char *pos, struct sta_info *sta, -+ u8 *nei_rep, size_t nei_rep_len); - - int ieee802_11_ext_capab(const u8 *ie, unsigned int capab); - int op_class_to_bandwidth(u8 op_class); ---- a/wpa_supplicant/wnm_sta.c -+++ b/wpa_supplicant/wnm_sta.c -@@ -1621,7 +1621,7 @@ int wnm_send_bss_transition_mgmt_query(s - return ret; - } - -- ret = ieee802_11_parse_candidate_list(btm_candidates, -+ ret = ieee802_11_parse_candidate_list(btm_candidates, NULL, - wpabuf_put(buf, 0), - max_len); - if (ret < 0) { diff --git a/feeds/wifi-ax/hostapd/patches/d00-006-hostapd-fix-sending-proper-vlan-id.patch b/feeds/wifi-ax/hostapd/patches/d00-006-hostapd-fix-sending-proper-vlan-id.patch deleted file mode 100644 index e45330a8f..000000000 --- a/feeds/wifi-ax/hostapd/patches/d00-006-hostapd-fix-sending-proper-vlan-id.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7026,7 +7026,7 @@ static int i802_set_sta_vlan(struct i802 - MAC2STR(addr), ifname, if_nametoindex(ifname), vlan_id); - if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || - nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || -- ((drv->capa.flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD) && -+ (vlan_id && (drv->capa.flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD) && - nla_put_u16(msg, NL80211_ATTR_VLAN_ID, vlan_id)) || - nla_put_u32(msg, NL80211_ATTR_STA_VLAN, if_nametoindex(ifname))) { - nlmsg_free(msg); diff --git a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch index dac816215..528f130b4 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch @@ -20,20 +20,9 @@ Signed-off-by: Karthikeyan Kathirvel src/rsn_supp/wpa.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -4159,7 +4159,7 @@ static void handle_assoc(struct hostapd_ - { - u16 capab_info, listen_interval, seq_ctrl, fc; - int resp = WLAN_STATUS_SUCCESS; -- u16 reply_res; -+ u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; - const u8 *pos; - int left, i; - struct sta_info *sta; --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4446,12 +4446,13 @@ void wpa_gtk_rekey(struct wpa_authentica +@@ -4454,12 +4454,13 @@ void wpa_gtk_rekey(struct wpa_authentica } @@ -50,7 +39,7 @@ Signed-off-by: Karthikeyan Kathirvel #define RSN_SUITE_ARG(s) \ --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2689,7 +2689,7 @@ out: +@@ -2701,7 +2701,7 @@ out: } @@ -61,7 +50,7 @@ Signed-off-by: Karthikeyan Kathirvel switch (sm->key_mgmt) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4855,7 +4855,7 @@ static int wpa_driver_nl80211_sta_add(vo +@@ -4859,7 +4859,7 @@ static int wpa_driver_nl80211_sta_add(vo if (params->he_capab) { wpa_hexdump(MSG_DEBUG, " * he_capab", @@ -81,3 +70,38 @@ Signed-off-by: Karthikeyan Kathirvel pos = resp; end = resp + len; +--- a/src/crypto/sha1-internal.c ++++ b/src/crypto/sha1-internal.c +@@ -141,17 +141,32 @@ A million repetitions of "a" + block->l[(i + 8) & 15] ^ block->l[(i + 2) & 15] ^ block->l[i & 15], 1)) + + /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ ++#ifdef R0 ++#undef R0 ++#endif + #define R0(v,w,x,y,z,i) \ + z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \ + w = rol(w, 30); ++#ifdef R1 ++#undef R1 ++#endif + #define R1(v,w,x,y,z,i) \ + z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \ + w = rol(w, 30); ++#ifdef R2 ++#undef R2 ++#endif + #define R2(v,w,x,y,z,i) \ + z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30); ++#ifdef R3 ++#undef R3 ++#endif + #define R3(v,w,x,y,z,i) \ + z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \ + w = rol(w, 30); ++#ifdef R4 ++#undef R4 ++#endif + #define R4(v,w,x,y,z,i) \ + z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ + w=rol(w, 30); diff --git a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch index 33c47a78d..3bca898b8 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch @@ -20,20 +20,11 @@ Signed-off-by: Pradeep Kumar Chitrapu wpa_supplicant/op_classes.c | 8 ++++---- 4 files changed, 15 insertions(+), 14 deletions(-) ---- a/src/common/hw_features_common.c -+++ b/src/common/hw_features_common.c -@@ -415,7 +415,7 @@ int hostapd_set_freq_params(struct hosta - return -1; - } - -- if (center_idx_to_bw_6ghz(channel) != 0) { -+ if (center_idx_to_bw_6ghz(channel) < 0) { - wpa_printf(MSG_ERROR, - "Invalid control channel for 6 GHz band"); - return -1; ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -10654,7 +10654,8 @@ static int add_acs_ch_list(struct nl_msg +Index: hostapd-2021-02-20/src/drivers/driver_nl80211.c +=================================================================== +--- hostapd-2021-02-20.orig/src/drivers/driver_nl80211.c ++++ hostapd-2021-02-20/src/drivers/driver_nl80211.c +@@ -10936,7 +10936,8 @@ static int add_acs_ch_list(struct nl_msg * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && @@ -43,9 +34,11 @@ Signed-off-by: Pradeep Kumar Chitrapu continue; hw_mode = ieee80211_freq_to_chan(freq, &ch_list[num_channels]); if (hw_mode != NUM_HOSTAPD_MODES) ---- a/wpa_supplicant/op_classes.c -+++ b/wpa_supplicant/op_classes.c -@@ -242,7 +242,7 @@ static int wpas_op_class_supported(struc +Index: hostapd-2021-02-20/wpa_supplicant/op_classes.c +=================================================================== +--- hostapd-2021-02-20.orig/wpa_supplicant/op_classes.c ++++ hostapd-2021-02-20/wpa_supplicant/op_classes.c +@@ -270,7 +270,7 @@ static int wpas_op_class_supported(struc if (f == 0) break; /* end of list */ @@ -54,7 +47,7 @@ Signed-off-by: Pradeep Kumar Chitrapu freq5 = 1; else if (f > 2400 && f < 2500) freq2 = 1; -@@ -253,7 +253,7 @@ static int wpas_op_class_supported(struc +@@ -281,7 +281,7 @@ static int wpas_op_class_supported(struc freq2 = freq5 = 1; } @@ -63,8 +56,10 @@ Signed-off-by: Pradeep Kumar Chitrapu return 0; if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2) return 0; ---- a/src/ap/acs.c -+++ b/src/ap/acs.c +Index: hostapd-2021-02-20/src/ap/acs.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/acs.c ++++ hostapd-2021-02-20/src/ap/acs.c @@ -372,40 +372,44 @@ acs_survey_chan_interference_factor(stru } @@ -93,9 +88,9 @@ Signed-off-by: Pradeep Kumar Chitrapu +static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) { - const int allowed[] = { 36, 52, 100, 116, 132, 149 }; -+ const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5680, 5955, 6035, 6115, -+ 6195, 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, -+ 6915, 6995 }; ++ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 6035, 6115, 6195, ++ 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, 6915, ++ 6995 }; unsigned int i; for (i = 0; i < ARRAY_SIZE(allowed); i++) @@ -191,9 +186,11 @@ Signed-off-by: Pradeep Kumar Chitrapu /* TODO: VHT/HE80+80. Update acs_adjust_center_freq() too. */ wpa_printf(MSG_DEBUG, ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -1689,6 +1689,10 @@ static int setup_interface2(struct hosta +Index: hostapd-2021-02-20/src/ap/hostapd.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/hostapd.c ++++ hostapd-2021-02-20/src/ap/hostapd.c +@@ -1691,6 +1691,10 @@ static int setup_interface2(struct hosta ch_width = op_class_to_ch_width(iface->conf->op_class); hostapd_set_oper_chwidth(iface->conf, ch_width); @@ -204,11 +201,11 @@ Signed-off-by: Pradeep Kumar Chitrapu } ret = hostapd_select_hw_mode(iface); -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 668d9094e28d..ff17b2f00e85 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -486,8 +486,10 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +Index: hostapd-2021-02-20/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/beacon.c ++++ hostapd-2021-02-20/src/ap/beacon.c +@@ -481,8 +481,10 @@ static u8 * hostapd_gen_probe_resp(struc resp->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, WLAN_FC_STYPE_PROBE_RESP); @@ -220,11 +217,11 @@ index 668d9094e28d..ff17b2f00e85 100644 os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN); os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN); -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index c1630d09a254..56f40edc0fdc 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -512,6 +512,8 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, +Index: hostapd-2021-02-20/wpa_supplicant/mesh.c +=================================================================== +--- hostapd-2021-02-20.orig/wpa_supplicant/mesh.c ++++ hostapd-2021-02-20/wpa_supplicant/mesh.c +@@ -644,6 +644,8 @@ int wpa_supplicant_join_mesh(struct wpa_ params->flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH; params->flags |= WPA_DRIVER_MESH_FLAG_AMPE; wpa_s->conf->user_mpm = 1; diff --git a/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch index befc99932..31314d94d 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch @@ -1,6 +1,6 @@ --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1747,6 +1747,39 @@ static void hostapd_event_wds_sta_interf +@@ -1775,6 +1775,39 @@ static void hostapd_event_wds_sta_interf ifname, MAC2STR(addr)); } @@ -40,7 +40,7 @@ #ifdef CONFIG_OWE static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, -@@ -2055,6 +2088,9 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2083,6 +2116,9 @@ void hostapd_wpa_event(void *ctx, enum w data->wds_sta_interface.ifname, data->wds_sta_interface.sta_addr); break; @@ -52,7 +52,7 @@ break; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5052,6 +5052,15 @@ enum wpa_event_type { +@@ -5038,6 +5038,15 @@ enum wpa_event_type { * is required to provide more details of the frame. */ EVENT_UNPROT_BEACON, @@ -68,7 +68,7 @@ }; -@@ -5911,6 +5920,16 @@ union wpa_event_data { +@@ -5897,6 +5906,16 @@ union wpa_event_data { struct unprot_beacon { const u8 *sa; } unprot_beacon; @@ -87,7 +87,7 @@ /** --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -2584,6 +2584,35 @@ static void nl80211_sta_opmode_change_ev +@@ -2540,6 +2540,35 @@ static void nl80211_sta_opmode_change_ev wpa_supplicant_event(drv->ctx, EVENT_STATION_OPMODE_CHANGED, &ed); } @@ -123,7 +123,7 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, struct nlattr **tb) -@@ -2641,7 +2670,6 @@ nl80211_control_port_frame_tx_status(str +@@ -2597,7 +2626,6 @@ nl80211_control_port_frame_tx_status(str wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event); } @@ -131,7 +131,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, struct nlattr **tb) { -@@ -2869,6 +2897,9 @@ static void do_process_drv_event(struct +@@ -2825,6 +2853,9 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_ACK], tb[NL80211_ATTR_COOKIE]); break; @@ -193,7 +193,7 @@ return "UNKNOWN"; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3541,6 +3541,10 @@ static int hostapd_fill_csa_settings(str +@@ -3525,6 +3525,10 @@ static int hostapd_fill_csa_settings(str hapd->cs_count = settings->cs_count; hapd->cs_block_tx = settings->block_tx; @@ -206,13 +206,13 @@ free_beacon_data(&settings->beacon_after); --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -1471,6 +1471,11 @@ static int hostapd_ctrl_iface_set(struct +@@ -1472,6 +1472,11 @@ static int hostapd_ctrl_iface_set(struct } else if (os_strncmp(cmd, "wme_ac_", 7) == 0 || os_strncmp(cmd, "wmm_ac_", 7) == 0) { hapd->parameter_set_count++; + /* Incrementing MU-EDCA Parameter Set Update Count*/ + hapd->iface->conf->he_mu_edca.he_qos_info = -+ hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0 | ++ (hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0) | + ((hapd->iface->conf->he_mu_edca.he_qos_info + 1) & + 0xf); if (ieee802_11_update_beacons(hapd->iface)) @@ -220,14 +220,63 @@ "Failed to update beacons with WMM parameters"); --- a/src/ap/wmm.c +++ b/src/ap/wmm.c +@@ -68,8 +68,8 @@ wmm_set_regulatory_limit(const struct ho + /* + * Calculate WMM regulatory limit if any. + */ +-static void wmm_calc_regulatory_limit(struct hostapd_data *hapd, +- struct hostapd_wmm_ac_params *acp) ++void wmm_calc_regulatory_limit(struct hostapd_data *hapd, ++ struct hostapd_wmm_ac_params *acp) + { + struct hostapd_hw_modes *mode = hapd->iface->current_mode; + int c; @@ -98,6 +98,10 @@ static void wmm_calc_regulatory_limit(st os_memcpy(hapd->iface->prev_wmm, acp, sizeof(hapd->iconf->wmm_ac_params)); hapd->parameter_set_count++; + /* Incrementing MU-EDCA Parameter Set Update Count*/ + hapd->iface->conf->he_mu_edca.he_qos_info = -+ hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0 | ++ (hapd->iface->conf->he_mu_edca.he_qos_info & 0xf0) | + ((hapd->iface->conf->he_mu_edca.he_qos_info + 1) & 0xf); } } +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -18,6 +18,7 @@ + #include "sta_info.h" + #include "ieee802_11.h" + #include "dfs.h" ++#include "wmm.h" + + static u8 ieee80211_he_ppet_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) + { +@@ -247,9 +248,16 @@ u8 * hostapd_eid_he_operation(struct hos + u8 * hostapd_eid_he_mu_edca_parameter_set(struct hostapd_data *hapd, u8 *eid) + { + struct ieee80211_he_mu_edca_parameter_set *edca; ++ struct hostapd_wmm_ac_params wmmp[WMM_AC_NUM]; + u8 *pos; + size_t i; + ++ /* Updating WME Parameter Set Count to avoid mismatch */ ++ os_memset(wmmp, 0, sizeof(wmmp)); ++ ++ if (hapd->conf->wmm_enabled) ++ wmm_calc_regulatory_limit(hapd, wmmp); ++ + pos = (u8 *) &hapd->iface->conf->he_mu_edca; + for (i = 0; i < sizeof(*edca); i++) { + if (pos[i]) +--- a/src/ap/wmm.h ++++ b/src/ap/wmm.h +@@ -13,6 +13,8 @@ + struct ieee80211_mgmt; + struct wmm_tspec_element; + ++void wmm_calc_regulatory_limit(struct hostapd_data *hapd, ++ struct hostapd_wmm_ac_params *acp); + u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid); + int hostapd_eid_wmm_valid(struct hostapd_data *hapd, const u8 *eid, + size_t len); diff --git a/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch index bb04eb445..fd4ab4c84 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch @@ -1,724 +1,315 @@ -Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c -+++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c -@@ -3561,6 +3561,10 @@ static int hostapd_config_fill(struct ho - conf->he_oper_centr_freq_seg0_idx = atoi(pos); - } else if (os_strcmp(buf, "he_oper_centr_freq_seg1_idx") == 0) { - conf->he_oper_centr_freq_seg1_idx = atoi(pos); -+ } else if (os_strcmp(buf, -+ "unsol_bcast_probe_resp_interval") == 0) { -+ bss->unsol_bcast_probe_resp_interval = -+ (atoi(pos) > 20) ? 20 : atoi(pos); - #endif /* CONFIG_IEEE80211AX */ - } else if (os_strcmp(buf, "max_listen_interval") == 0) { - bss->max_listen_interval = atoi(pos); -@@ -4369,6 +4373,10 @@ static int hostapd_config_fill(struct ho - bss->dhcp_server_port = atoi(pos); - } else if (os_strcmp(buf, "dhcp_relay_port") == 0) { - bss->dhcp_relay_port = atoi(pos); -+ } else if (os_strcmp(buf, "fils_discovery_min_interval") == 0) { -+ bss->fils_discovery_min_int = atoi(pos); -+ } else if (os_strcmp(buf, "fils_discovery_max_interval") == 0) { -+ bss->fils_discovery_max_int = atoi(pos); - #endif /* CONFIG_FILS */ - } else if (os_strcmp(buf, "multicast_to_unicast") == 0) { - bss->multicast_to_unicast = atoi(pos); -Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/hostapd.conf -+++ hostapd-2020-07-02-58b384f4/hostapd/hostapd.conf -@@ -873,6 +873,12 @@ wmm_ac_vo_acm=0 - #he_spr_srg_obss_pd_min_offset - #he_spr_srg_obss_pd_max_offset +From b8811424b33126941645ef541a223ea7efc31cf1 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Mon, 16 Nov 2020 19:16:22 -0800 +Subject: [PATCH] hostapd: FILS discovery and unsolicited bcast probe response +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Both features are used in 6GHz for in-band discovery. + +Additions for FILS Discovery support: +(1) IEEE Std 802.11ai-2016 9.6.8.36 FILS discovery frame elements + (Figures 9-687b, 9-687c) and 6GHz specific definitions + from IEEE P802.11ax/D6.0, Table 9-386—PHY Index subfield + and 26.17.2.3.2, AP behavior for fast passive scanning. +(2) Configuration options for FILS discovery transmission, + fils_discovery_min_interval - Default 20 TUs + fils_discovery_max_interval - Default 0 (disabled) +(3) Nested attribute, NL80211_ATTR_FILS_DISCOVERY which uses + struct nl80211_fils_discovery_attributes. +(4) Netlink command NL80211_CMD_SET_FILS_DISCOVERY to configure + the transmission. + +Additions for unsolicited broadcast probe response support: +(1) Configuration option to set packet interval, + unsol_bcast_probe_resp_interval - Default 0 (disabled). +(2) Nested attribute, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP which uses + struct nl80211_unsol_bcast_probe_resp_attributes +(3) Netlink command NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP to + configure the transmission. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 2 +- + src/drivers/driver_nl80211.c | 170 +++++++++++++++++++++-------------- + src/drivers/nl80211_copy.h | 10 +++ + 3 files changed, 116 insertions(+), 66 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 510670da64a8..c873f5b744d0 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1374,7 +1374,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) -+# Unsolicited broadcast probe response transmission settings, 6GHz only. -+# If interval is set to non-zero, the AP schedules unsolicited -+# broadcast probe response frames for in-band discovery. Refer to -+# IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for fast passive scanning. -+#unsol_bcast_probe_resp_interval=0(default) to 20 TUs. -+ - ##### IEEE 802.1X-2004 related configuration ################################## - - # Require IEEE 802.1X authorization -@@ -1914,6 +1920,11 @@ own_ip_addr=127.0.0.1 - # default: 30 TUs (= 30.72 milliseconds) - #fils_hlp_wait_time=30 - -+# FILS discovery transmission minimum and maximum packet interval settings. -+# If maximum interval is non-zero, the AP schedules FILS discovery transmission -+#fils_discovery_max_interval=0 to 10000 (in TUs). -+#fils_discovery_min_interval=0 to 10000 (in TUs). -+ - # Transition Disable indication - # The AP can notify authenticated stations to disable transition mode in their - # network profiles when the network has completed transition steps, i.e., once -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.c -@@ -131,6 +131,7 @@ void hostapd_config_defaults_bss(struct - bss->fils_hlp_wait_time = 30; - bss->dhcp_server_port = DHCP_SERVER_PORT; - bss->dhcp_relay_port = DHCP_SERVER_PORT; -+ bss->fils_discovery_min_int = 20; - #endif /* CONFIG_FILS */ - - bss->broadcast_deauth = 1; -@@ -1334,6 +1335,15 @@ static int hostapd_config_check_bss(stru - } - #endif /* CONFIG_SAE_PK */ - -+#ifdef CONFIG_FILS -+ if (bss->fils_discovery_max_int && -+ bss->unsol_bcast_probe_resp_interval) { -+ wpa_printf(MSG_ERROR, -+ "Cannot enable both FILS discovery and unsolicited broadcast probe response at the same time"); -+ return -1; -+ } -+#endif /* CONFIG_FILS */ -+ - return 0; + *len = pos - (u8 *) head; + wpa_hexdump(MSG_DEBUG, "FILS Discovery frame template", +- head, pos - (u8 *) head); ++ (u8 *) head, pos - (u8 *) head); + return (u8 *) head; } -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -@@ -735,6 +735,8 @@ struct hostapd_bss_config { - unsigned int fils_hlp_wait_time; - u16 dhcp_server_port; - u16 dhcp_relay_port; -+ u32 fils_discovery_min_int; -+ u32 fils_discovery_max_int; - #endif /* CONFIG_FILS */ - - int multicast_to_unicast; -@@ -868,6 +870,7 @@ struct hostapd_bss_config { - u8 mka_psk_set; - #endif /* CONFIG_MACSEC */ - char *config_id; -+ u32 unsol_bcast_probe_resp_interval; - }; - - /** -Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/beacon.c -+++ hostapd-2020-07-02-58b384f4/src/ap/beacon.c -@@ -1127,6 +1127,21 @@ static u8 * hostapd_probe_resp_offloads( - - #endif /* NEED_AP_MLME */ - -+#ifdef CONFIG_IEEE80211AX -+/* Unsolicited broadcast probe response transmission, 6GHz only */ -+static u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd, -+ struct wpa_driver_ap_params *params) -+{ -+ if (!is_6ghz_op_class(hapd->iconf->op_class)) -+ return NULL; -+ -+ params->unsol_bcast_probe_resp_interval = -+ hapd->conf->unsol_bcast_probe_resp_interval; -+ -+ return hostapd_gen_probe_resp(hapd, NULL, 0, -+ ¶ms->unsol_bcast_probe_resp_tmpl_len); -+} -+#endif /* CONFIG_IEEE80211AX */ - - void sta_track_del(struct hostapd_sta_info *info) - { -@@ -1138,6 +1153,271 @@ void sta_track_del(struct hostapd_sta_in - } - - -+#ifdef CONFIG_FILS -+static u8 hostapd_fils_discovery_rsn(struct hostapd_data *hapd, u16 *cap, -+ u32 *suite_selector_ptr) -+{ -+ const u8 *ie, *start; -+ u8 len; -+ u16 cnt; -+ u32 suite_selector = 0; -+ -+ ie = hostapd_wpa_ie(hapd, WLAN_EID_RSN); -+ if (!ie || ie[1] < 6) -+ return 0; -+ -+ len = ie[1]; -+ start = &ie[2]; -+ ie += 4; -+ do { -+ /* Group Data Cipher Suite Selector */ -+ suite_selector = ie[3]; -+ ie += 4; -+ -+ /* Pairwise Cipher Suite Selector */ -+ if ((ie - start) >= len) -+ break; -+ os_memcpy((u8 *) &cnt, ie, 2); -+ ie += 2; -+ if (cnt) { -+ suite_selector |= (((u32) ie[3]) << 12); -+ ie += (4 * cnt); -+ } -+ -+ /* AKM Cipher Suite Selector */ -+ if ((ie - start) >= len) -+ break; -+ os_memcpy((u8 *) &cnt, ie, 2); -+ ie += 2; -+ if (cnt) { -+ suite_selector |= (((u32) ie[3]) << 18); -+ ie += (4 * cnt); -+ } -+ -+ /* RSN capabilities */ -+ if ((ie - start) >= len) -+ break; -+ os_memcpy((u8 *) cap, ie, 2); -+ ie += 2; -+ -+ /* Group Management Cipher Suite Selector */ -+ if ((ie - start) < len) -+ suite_selector |= (((u32) ie[3]) << 6); -+ } while (0); -+ -+ *suite_selector_ptr = suite_selector; -+ return 1; -+} -+ -+ -+u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd) -+{ -+ u16 cap_info = 0, nss_mask = 0x0003; -+ u8 nss = 0, chwidth = 0; -+ int i; -+ -+ cap_info = FILS_DISCOVERY_CAP_ESS | -+ (hapd->conf->wpa ? FILS_DISCOVERY_CAP_PRIVACY : 0) | -+ (hapd->iconf->multiple_bssid ? -+ FILS_DISCOVERY_CAP_MULTIPLE_BSSID_PRESENT : 0); -+ -+ if (is_6ghz_op_class(hapd->iconf->op_class)) { -+ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HE << -+ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); -+ -+ switch (hapd->iconf->op_class) { -+ case 132: -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_40; -+ break; -+ case 133: -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_80; -+ break; -+ case 134: -+ case 135: -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080; -+ break; -+ } -+ } else { -+ switch (hostapd_get_oper_chwidth(hapd->iconf)) { -+ case CHANWIDTH_80P80MHZ: -+ case CHANWIDTH_160MHZ: -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080; -+ break; -+ case CHANWIDTH_80MHZ: -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_80; -+ break; -+ case CHANWIDTH_USE_HT: -+ if (hapd->iconf->secondary_channel) -+ chwidth = FILS_DISCOVERY_CAP_BSS_CHWIDTH_40; -+ break; -+ } -+ -+ if (hapd->iconf->ieee80211ax) { -+#ifdef CONFIG_IEEE80211AX -+ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HE << -+ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); -+#endif /* CONFIG_IEEE80211AX */ -+ } else if (hapd->conf->vendor_vht) { -+#ifdef CONFIG_IEEE80211AC -+ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_VHT << -+ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); -+#endif /* CONFIG_IEEE80211AC */ -+ } else if (hapd->iconf->ieee80211n && -+ !hapd->conf->disable_11n) { -+ cap_info |= (FILS_DISCOVERY_CAP_PHY_INDEX_HT << -+ FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT); -+ } -+ } -+ -+ cap_info |= (chwidth << FILS_DISCOVERY_CAP_BSS_CHWIDTH_SHIFT); -+ -+ for (i = 0; i < 8; i++) { -+ if ((hapd->iconf->he_op.he_basic_mcs_nss_set & nss_mask) != -+ nss_mask) -+ nss++; -+ nss_mask = nss_mask << 2; -+ } -+ if (nss > 4) -+ cap_info |= (4 << FILS_DISCOVERY_CAP_NSS_SHIFT); -+ else -+ cap_info |= ((nss - 1) << FILS_DISCOVERY_CAP_NSS_SHIFT); -+ -+ /* TODO: FILS minimum rate */ -+ return cap_info; -+} -+ -+ -+static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) -+{ -+ struct ieee80211_mgmt *head; -+ const u8 *mobility_domain; -+ u8 *pos, *length_pos, rsn = 0, buf[200], buf_len; -+ u16 frm_cntl = 0, rsn_cap = 0; -+ u32 suite_selectors = 0, total_len; -+ -+#define FILS_DISOVERY_TMPL_HEAD_LEN 26 -+#define FILS_DISOVERY_TMPL_MIN_LEN 19 -+ -+ total_len = FILS_DISOVERY_TMPL_HEAD_LEN + FILS_DISOVERY_TMPL_MIN_LEN; -+ -+ /* FILS discovery frame control: 2 bytes */ -+ frm_cntl = (sizeof(hapd->conf->ssid.short_ssid) - 1) | -+ FILS_DISCOVERY_FRM_CNTL_CAP_PRESENT | -+ FILS_DISCOVERY_FRM_CNTL_SHORT_SSID_PRESENT | -+ FILS_DISCOVERY_FRM_CNTL_LENGTH_PRESENT; -+ -+ /* Check for optional subfields and calculate length */ -+ rsn = hostapd_fils_discovery_rsn(hapd, &rsn_cap, &suite_selectors); -+ if (rsn) { -+ frm_cntl |= FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT; -+ total_len += 5; -+ } -+ -+ mobility_domain = hostapd_wpa_ie(hapd, WLAN_EID_MOBILITY_DOMAIN); -+ if (mobility_domain) { -+ frm_cntl |= FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT; -+ total_len += 3; -+ } -+ -+ total_len += hostapd_eid_reduced_neighbor_report_len(hapd); -+ -+ pos = hostapd_eid_fils_indic(hapd, buf, 0); -+ buf_len = pos - buf; -+ total_len += buf_len; -+ -+ head = os_zalloc(total_len); -+ if (!head) -+ return NULL; -+ -+ head->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, -+ WLAN_FC_STYPE_ACTION); -+ os_memset(head->da, 0xff, ETH_ALEN); -+ os_memcpy(head->sa, hapd->own_addr, ETH_ALEN); -+ os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN); -+ -+ head->u.action.category = WLAN_ACTION_PUBLIC; -+ head->u.action.u.public_action.action = WLAN_PA_FILS_DISCOVERY; -+ -+ pos = &head->u.action.u.public_action.variable[0]; -+ *((u16 *) pos) = host_to_le16(frm_cntl); -+ pos += 2; -+ -+ /* hardware or low-level driver will setup timestamp */ -+ pos += 8; -+ -+ /* Beacon interval */ -+ *((u16 *) pos) = host_to_le16(hapd->iconf->beacon_int); -+ pos += 2; -+ -+ /* Short SSID */ -+ *((u32 *) pos) = host_to_le32(hapd->conf->ssid.short_ssid); -+ pos += sizeof(hapd->conf->ssid.short_ssid); -+ -+ /* Store position of FILS discovery information element length field */ -+ length_pos = pos++; -+ -+ /* FD Capability : total 2 bytes */ -+ *((u16 *) pos) = host_to_le16(hostapd_fils_discovery_cap(hapd)); -+ pos += 2; -+ -+ /* RSN */ -+ if (frm_cntl & FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT) { -+ os_memcpy(pos, &rsn_cap, 2); -+ os_memcpy(&pos[2], &suite_selectors, 3); -+ pos += 5; -+ } -+ -+ /* Mobility Domain */ -+ if (frm_cntl & FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT) { -+ os_memcpy(pos, &mobility_domain[2], 3); -+ pos += 3; -+ } -+ -+ /* Fill the FILS discovery information element length */ -+ *length_pos = pos - (length_pos + 1); -+ -+ /* Reduced Neighbor Report element */ -+ pos = hostapd_eid_reduced_neighbor_report(hapd, pos); -+ -+ /* FILS indication element */ -+ if (buf_len) { -+ os_memcpy(pos, buf, buf_len); -+ pos += buf_len; -+ } -+ -+ *len = pos - (u8 *) head; -+ return ((u8 *) head); -+} -+ -+ -+/* Configure FILS discovery transmission */ -+static u8 * hostapd_fils_discovery(struct hostapd_data *hapd, -+ struct wpa_driver_ap_params *params) -+{ -+ if (hapd->iconf->multiple_bssid && hapd != hapd->iface->bss[0]) -+ return NULL; -+ -+#define VALID_INTERVAL(x,y) { x = (x > y) ? y : x; } -+ -+ params->fils_discovery_max_int = hapd->conf->fils_discovery_max_int; -+ if (is_6ghz_op_class(hapd->iconf->op_class)) -+ VALID_INTERVAL(params->fils_discovery_max_int, -+ FILS_DISCOVERY_MAX_INTERVAL_6GHZ); -+ -+ params->fils_discovery_min_int = hapd->conf->fils_discovery_min_int; -+ VALID_INTERVAL(params->fils_discovery_min_int, -+ params->fils_discovery_max_int); -+#undef VALID_INTERVAL -+ -+ if (params->fils_discovery_max_int) -+ return hostapd_gen_fils_discovery(hapd, -+ ¶ms->fils_discovery_tmpl_len); -+ -+ return NULL; -+} -+#endif /* CONFIG_FILS */ -+ -+ - int ieee802_11_build_ap_params(struct hostapd_data *hapd, - struct wpa_driver_ap_params *params) - { -@@ -1475,6 +1755,14 @@ void ieee802_11_free_ap_params(struct wp - params->head = NULL; - os_free(params->proberesp); - params->proberesp = NULL; -+#ifdef CONFIG_FILS -+ os_free(params->fils_discovery_tmpl); -+ params->fils_discovery_tmpl = NULL; -+#endif /* CONFIG_FILS */ -+#ifdef CONFIG_IEEE80211AX -+ os_free(params->unsol_bcast_probe_resp_tmpl); -+ params->unsol_bcast_probe_resp_tmpl = NULL; -+#endif /* CONFIG_IEEE80211AX */ - } - - -@@ -1514,9 +1802,15 @@ int ieee802_11_set_beacon(struct hostapd - params.he_bss_color = hapd->iface->conf->he_op.he_bss_color; - params.twt_responder = hostapd_get_he_twt_responder(hapd, - IEEE80211_MODE_AP); -+ params.unsol_bcast_probe_resp_tmpl = -+ hostapd_unsol_bcast_probe_resp(hapd, ¶ms); - #endif /* CONFIG_IEEE80211AX */ - hapd->reenable_beacon = 0; - -+#ifdef CONFIG_FILS -+ params.fils_discovery_tmpl = hostapd_fils_discovery(hapd, ¶ms); -+#endif /* CONFIG_FILS */ -+ - if (cmode && - hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq, - iconf->channel, iconf->enable_edmg, -Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_defs.h -+++ hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h -@@ -2350,4 +2350,40 @@ enum edmg_bw_config { - /* DPP Public Action frame identifiers - OUI_WFA */ - #define DPP_OUI_TYPE 0x1A - -+/** -+ * IEEE Std 802.11ai-2016 9.6.8.36 FILS Discovery frame format, -+ * Figure 9-687b - FILS Discovery Frame Control subfield format -+ */ -+#define FILS_DISCOVERY_FRM_CNTL_CAP_PRESENT ((u16)BIT(5)) -+#define FILS_DISCOVERY_FRM_CNTL_SHORT_SSID_PRESENT ((u16)BIT(6)) -+#define FILS_DISCOVERY_FRM_CNTL_AP_CSN_PRESENT ((u16)BIT(7)) -+#define FILS_DISCOVERY_FRM_CNTL_ANO_PRESENT ((u16)BIT(8)) -+#define FILS_DISCOVERY_FRM_CNTL_FREQ_SEG1_PRESENT ((u16)BIT(9)) -+#define FILS_DISCOVERY_FRM_CNTL_PRI_CHAN_PRESENT ((u16)BIT(10)) -+#define FILS_DISCOVERY_FRM_CNTL_RSN_INFO_PRESENT ((u16)BIT(11)) -+#define FILS_DISCOVERY_FRM_CNTL_LENGTH_PRESENT ((u16)BIT(12)) -+#define FILS_DISCOVERY_FRM_CNTL_MOBILITY_DOMAIN_PRESENT ((u16)BIT(13)) -+ -+/** -+ * IEEE Std 802.11ai-2016 9.6.8.36 FILS Discovery frame format, -+ * Figure 9-687c - FD Capability subfield format -+ */ -+#define FILS_DISCOVERY_CAP_ESS BIT(0) -+#define FILS_DISCOVERY_CAP_PRIVACY BIT(1) -+#define FILS_DISCOVERY_CAP_MULTIPLE_BSSID_PRESENT BIT(9) -+#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_20 0 -+#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_40 1 -+#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_80 2 -+#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_160_8080 3 -+#define FILS_DISCOVERY_CAP_BSS_CHWIDTH_SHIFT 2 -+#define FILS_DISCOVERY_CAP_NSS_SHIFT 5 -+#define FILS_DISCOVERY_CAP_PHY_INDEX_SHIFT 10 -+#define FILS_DISCOVERY_CAP_PHY_INDEX_HT 2 -+#define FILS_DISCOVERY_CAP_PHY_INDEX_VHT 3 -+ -+/** -+ * IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for fast passive scanning -+ */ -+#define FILS_DISCOVERY_CAP_PHY_INDEX_HE 4 -+#define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 - #endif /* IEEE802_11_DEFS_H */ -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h -@@ -1518,6 +1518,41 @@ struct wpa_driver_ap_params { - * twt_responder - Whether Target Wait Time responder is enabled - */ - int twt_responder; -+ -+ /** -+ * FILS discovery minimum interval -+ */ -+ u32 fils_discovery_min_int; -+ -+ /** -+ * FILS discovery maximum interval -+ */ -+ u32 fils_discovery_max_int; -+ -+ /** -+ * FILS discovery template data -+ */ -+ u8 *fils_discovery_tmpl; -+ -+ /** -+ * FILS discovery template length -+ */ -+ size_t fils_discovery_tmpl_len; -+ -+ /** -+ * Unsolicited broadcast probe response interval -+ */ -+ u32 unsol_bcast_probe_resp_interval; -+ -+ /** -+ * Unsolicited broadcast probe response template data -+ */ -+ u8 *unsol_bcast_probe_resp_tmpl; -+ -+ /** -+ * Unsolicited broadcast probe response template length -+ */ -+ size_t unsol_bcast_probe_resp_tmpl_len; - }; - - struct wpa_driver_mesh_bss_params { -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -@@ -4255,7 +4255,6 @@ static int nl80211_put_beacon_rate(struc - return 0; +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index f4c646180b36..84ba66be3e4f 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4381,94 +4381,135 @@ static int nl80211_set_multicast_to_unicast(struct i802_bss *bss, + return ret; } - - static int nl80211_set_multicast_to_unicast(struct i802_bss *bss, - int multicast_to_unicast) - { -@@ -4302,6 +4301,75 @@ static int nl80211_set_multicast_to_unic - } - - +-#ifdef CONFIG_SAE +-static int nl80211_put_sae_pwe(struct nl_msg *msg, int pwe) +#ifdef CONFIG_FILS -+static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg, ++static int nl80211_fils_discovery(struct i802_bss *bss, + struct wpa_driver_ap_params *params) -+{ + { +- u8 sae_pwe; + struct nlattr *attr; -+ ++ struct wpa_driver_nl80211_data *drv = bss->drv; ++ struct nl_msg *msg; + +- wpa_printf(MSG_DEBUG, "nl802111: sae_pwe=%d", pwe); +- if (pwe == 0) +- sae_pwe = NL80211_SAE_PWE_HUNT_AND_PECK; +- else if (pwe == 1) +- sae_pwe = NL80211_SAE_PWE_HASH_TO_ELEMENT; +- else if (pwe == 2) +- sae_pwe = NL80211_SAE_PWE_BOTH; +- else if (pwe == 3) +- return 0; /* special test mode */ +- else +- return -1; +- if (nla_put_u8(msg, NL80211_ATTR_SAE_PWE, sae_pwe)) +- return -1; ++ if (!params->fd_max_int) ++ return 0; + +- return 0; +-} +-#endif /* CONFIG_SAE */ ++ wpa_printf(MSG_DEBUG, ++ "nl80211: FILS discovery maximum interval=%u, minimum interval=%u", ++ params->fd_max_int, ++ params->fd_min_int); + ++ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_FILS_DISCOVERY); ++ if (!msg) ++ return -ENOBUFS; + +-#ifdef CONFIG_FILS +-static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg, +- struct wpa_driver_ap_params *params) +-{ +- struct nlattr *attr; + attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY); + if (!attr) -+ return -1; -+ -+ if (nla_put_u32(msg, NL80211_FILS_DISCOVERY_INT_MIN, -+ params->fils_discovery_min_int) || -+ nla_put_u32(msg, NL80211_FILS_DISCOVERY_INT_MAX, -+ params->fils_discovery_max_int)) { ++ goto error; + +- if (!bss->drv->fils_discovery) { ++ if (nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MIN, ++ params->fd_min_int) || ++ nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MAX, ++ params->fd_max_int)) { + wpa_printf(MSG_ERROR, +- "nl80211: Driver does not support FILS Discovery frame transmission for %s", ++ "nl80211: Failed to build FILS discovery msg for %s\n", + bss->ifname); +- return -1; ++ goto error; + } + +- attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY); +- if (!attr || +- nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MIN, +- params->fd_min_int) || +- nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MAX, +- params->fd_max_int) || +- (params->fd_frame_tmpl && +- nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL, +- params->fd_frame_tmpl_len, params->fd_frame_tmpl))) +- return -1; ++ if (params->fd_frame_tmpl && ++ nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL, ++ params->fd_frame_tmpl_len, ++ params->fd_frame_tmpl)) { + wpa_printf(MSG_ERROR, + "nl80211: Failed to build FILS discovery msg for %s\n", + bss->ifname); -+ return -1; ++ goto error; + } + + nla_nest_end(msg, attr); +- return 0; + -+ if (params->fils_discovery_tmpl && -+ nla_put(msg, NL80211_FILS_DISCOVERY_TMPL, -+ params->fils_discovery_tmpl_len, -+ params->fils_discovery_tmpl)) { -+ wpa_printf(MSG_ERROR, -+ "nl80211: Failed to build FILS discovery msg for %s\n", -+ bss->ifname); -+ return -1; -+ } ++ return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); + -+ nla_nest_end(msg, attr); -+ return 0; -+} -+#endif /* CONFIG_FILS */ ++error: ++ nlmsg_free(msg); ++ return -1; + } + #endif /* CONFIG_FILS */ + +- + #ifdef CONFIG_IEEE80211AX + static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, +- struct nl_msg *msg, + struct wpa_driver_ap_params *params) + { + struct nlattr *attr; ++ struct wpa_driver_nl80211_data *drv = bss->drv; ++ struct nl_msg *msg; + +- if (!bss->drv->unsol_bcast_probe_resp) { +- wpa_printf(MSG_ERROR, +- "nl80211: Driver does not support unsolicited broadcast Probe Response frame transmission for %s", +- bss->ifname); +- return -1; +- } ++ if (!params->unsol_bcast_probe_resp_interval) ++ return 0; + + wpa_printf(MSG_DEBUG, +- "nl80211: Unsolicited broadcast Probe Response frame interval: %u", ++ "nl80211: Unsolicited broadcast probe response interval=%u", + params->unsol_bcast_probe_resp_interval); + -+#ifdef CONFIG_IEEE80211AX -+static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, -+ struct nl_msg *msg, -+ struct wpa_driver_ap_params *params) -+{ -+ struct nlattr *attr; ++ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP); ++ if (!msg) ++ return -ENOBUFS; + -+ attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP); + attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP); +- if (!attr || +- nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT, +- params->unsol_bcast_probe_resp_interval) || +- (params->unsol_bcast_probe_resp_tmpl && +- nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL, +- params->unsol_bcast_probe_resp_tmpl_len, +- params->unsol_bcast_probe_resp_tmpl))) +- return -1; + if (!attr) -+ return -1; ++ goto error; + -+ if (nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_INT, ++ if (nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT, + params->unsol_bcast_probe_resp_interval)) { + wpa_printf(MSG_ERROR, + "nl80211: Failed to build unsolicited broadcast probe response msg for %s\n", + bss->ifname); -+ return -1; ++ goto error; + } + + if (params->unsol_bcast_probe_resp_tmpl && -+ nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_TMPL, ++ nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL, + params->unsol_bcast_probe_resp_tmpl_len, + params->unsol_bcast_probe_resp_tmpl)) { + wpa_printf(MSG_ERROR, + "nl80211: Failed to build unsolicited broadcast probe response msg for %s\n", + bss->ifname); -+ return -1; ++ goto error; + } + + nla_nest_end(msg, attr); +- return 0; ++ return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); ++ ++error: ++ nlmsg_free(msg); ++ return -1; + } + #endif /* CONFIG_IEEE80211AX */ + + ++#ifdef CONFIG_SAE ++static int nl80211_put_sae_pwe(struct nl_msg *msg, int pwe) ++{ ++ u8 sae_pwe; ++ ++ wpa_printf(MSG_DEBUG, "nl802111: sae_pwe=%d", pwe); ++ if (pwe == 0) ++ sae_pwe = NL80211_SAE_PWE_HUNT_AND_PECK; ++ else if (pwe == 1) ++ sae_pwe = NL80211_SAE_PWE_HASH_TO_ELEMENT; ++ else if (pwe == 2) ++ sae_pwe = NL80211_SAE_PWE_BOTH; ++ else if (pwe == 3) ++ return 0; /* special test mode */ ++ else ++ return -1; ++ if (nla_put_u8(msg, NL80211_ATTR_SAE_PWE, sae_pwe)) ++ return -1; + -+ nla_nest_end(msg, attr); + return 0; +} -+#endif /* CONFIG_IEEE80211AX */ ++#endif /* CONFIG_SAE */ ++ + static int wpa_driver_nl80211_set_ap(void *priv, struct wpa_driver_ap_params *params) { -@@ -4560,8 +4628,18 @@ static int wpa_driver_nl80211_set_ap(voi - if (nla_put_flag(msg, NL80211_ATTR_TWT_RESPONDER)) +@@ -4746,9 +4787,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, goto fail; } -+ -+ ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); -+ if (ret < 0) -+ goto fail; + +- if (params->unsol_bcast_probe_resp_interval && +- nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0) +- goto fail; #endif /* CONFIG_IEEE80211AX */ -+#ifdef CONFIG_FILS -+ ret = nl80211_fils_discovery(bss, msg, params); -+ if (ret < 0) -+ goto fail; -+#endif /* CONFIG_FILS */ -+ + #ifdef CONFIG_SAE +@@ -4758,11 +4796,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, + goto fail; + #endif /* CONFIG_SAE */ + +-#ifdef CONFIG_FILS +- if (params->fd_max_int && nl80211_fils_discovery(bss, msg, params) < 0) +- goto fail; +-#endif /* CONFIG_FILS */ +- ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h -=================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/nl80211_copy.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h -@@ -2514,6 +2514,14 @@ enum nl80211_commands { - * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the - NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. +@@ -4775,6 +4808,13 @@ static int wpa_driver_nl80211_set_ap(void *priv, + params->isolate, params->basic_rates); + nl80211_set_multicast_to_unicast(bss, + params->multicast_to_unicast); ++#ifdef CONFIG_FILS ++ nl80211_fils_discovery(bss, params); ++#endif /* CONFIG_FILS */ ++#ifdef CONFIG_IEEE80211AX ++ nl80211_unsol_bcast_probe_resp(bss, params); ++#endif /* CONFIG_IEEE80211AX */ ++ + if (beacon_set && params->freq && + params->freq->bandwidth != bss->bandwidth) { + wpa_printf(MSG_DEBUG, +diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h +index a4a611992ca0..1084c6d4c080 100644 +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -1187,6 +1187,12 @@ + * were indicated by driver and now need to be reflected in + * Beacon frame. * -+ * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS -+ * discovery. It is a nested attribute, see -+ * &enum nl80211_fils_discovery_attributes. ++ * @NL80211_CMD_SET_FILS_DISCOVERY: Command to set FILS discovery transmission ++ * parameters. + * -+ * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure -+ * unsolicited broadcast probe response. It is a nested attribute, see -+ * &enum nl80211_unsol_bcast_probe_resp_attributes. ++ * @NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP: Command to set unsolicited ++ * broadcast probe response transmission parameters. + * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2997,6 +3005,11 @@ enum nl80211_attrs { - NL80211_ATTR_HE_6GHZ_CAPABILITY, + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1420,6 +1426,10 @@ enum nl80211_commands { + NL80211_CMD_SET_SAR_SPECS, - NL80211_ATTR_HE_MUEDCA_PARAMS, + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, + -+ NL80211_ATTR_FILS_DISCOVERY, ++ NL80211_CMD_SET_FILS_DISCOVERY, ++ NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, + -+ NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, -+ - /* add attributes here, update the policy in nl80211.c */ + /* add new commands above here */ - __NL80211_ATTR_AFTER_LAST, -@@ -6936,4 +6949,61 @@ enum nl80211_iftype_akm_attributes { - NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, - }; - -+/** -+ * enum nl80211_fils_discovery_attributes - FILS discovery configuration -+ * from IEEE Std 802.11ai-2016, Annex C.3 MIB detail. -+ * -+ * @__NL80211_FILS_DISCOVERY_INVALID: Invalid -+ * -+ * @NL80211_FILS_DISCOVERY_INT_MIN: Minimum packet interval (u32, TU). -+ * Allowed range: 0..10000 (TU = Time Unit) -+ * @NL80211_FILS_DISCOVERY_INT_MAX: Maximum packet interval (u32, TU). -+ * Allowed range: 0..10000 (TU = Time Unit) -+ * @NL80211_FILS_DISCOVERY_TMPL: Optional FILS discovery template. -+ * It has contents of IEEE Std 802.11ai-2016 9.6.8.36 FILS discovery frame -+ * (Figure 9-687a). -+ * It may include 6GHz specific data specified in IEEE P802.11ax/D6.0, -+ * 9.6.7.36 FILS Discovery frame format. -+ * -+ * @__NL80211_FILS_DISCOVERY_LAST: Internal -+ * @NL80211_FILS_DISCOVERY_MAX: highest attribute -+ */ -+enum nl80211_fils_discovery_attributes { -+ __NL80211_FILS_DISCOVERY_INVALID, -+ -+ NL80211_FILS_DISCOVERY_INT_MIN, -+ NL80211_FILS_DISCOVERY_INT_MAX, -+ NL80211_FILS_DISCOVERY_TMPL, -+ -+ /* keep last */ -+ __NL80211_FILS_DISCOVERY_LAST, -+ NL80211_FILS_DISCOVERY_MAX = __NL80211_FILS_DISCOVERY_LAST - 1 -+}; -+ -+/** -+ * enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe -+ * response configuration. Applicable only in 6GHz. -+ * -+ * @__NL80211_UNSOL_BCAST_PROBE_RESP_INVALID: Invalid -+ * -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_INT: Maximum packet interval (u32, TU). -+ * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0 -+ * 26.17.2.3.2 (AP behavior for fast passive scanning. -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_TMPL: Unsolicited broadcast probe response -+ * frame template (binary). -+ * -+ * @__NL80211_UNSOL_BCAST_PROBE_RESP_LAST: Internal -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_MAX: highest attribute -+ */ -+enum nl80211_unsol_bcast_probe_resp_attributes { -+ __NL80211_UNSOL_BCAST_PROBE_RESP_INVALID, -+ -+ NL80211_UNSOL_BCAST_PROBE_RESP_INT, -+ NL80211_UNSOL_BCAST_PROBE_RESP_TMPL, -+ -+ /* keep last */ -+ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST, -+ NL80211_UNSOL_BCAST_PROBE_RESP_MAX = -+ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST - 1 -+}; - #endif /* __LINUX_NL80211_H */ + /* used to define NL80211_CMD_MAX below */ +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch index e8db36ab5..26b17d1c4 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch @@ -1,34 +1,21 @@ -From be8312cd122fbe35e45173d23e936fa1b76e56e8 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Wed, 3 Jun 2020 16:32:11 +0200 -Subject: [PATCH 1/7] multiple_bssid: add the config file - -This patch adds a new config option to enable this feature. - -Signed-off-by: John Crispin ---- - hostapd/config_file.c | 2 ++ - src/ap/ap_config.h | 2 ++ - 2 files changed, 4 insertions(+) - -Index: hostapd-2020-07-02-58b384f4/hostapd/config_file.c +Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/config_file.c -+++ hostapd-2020-07-02-58b384f4/hostapd/config_file.c -@@ -4587,6 +4587,8 @@ static int hostapd_config_fill(struct ho +--- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c ++++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c +@@ -4681,6 +4681,8 @@ static int hostapd_config_fill(struct ho } bss->mka_psk_set |= MKA_PSK_SET_CKN; #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "multiple_bssid") == 0) { + conf->multiple_bssid = atoi(pos); - } else { - wpa_printf(MSG_ERROR, - "Line %d: unknown configuration item '%s'", -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h + } else if (os_strcmp(buf, "disable_11n") == 0) { + bss->disable_11n = !!atoi(pos); + } else if (os_strcmp(buf, "disable_11ac") == 0) { +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_config.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_config.h -@@ -1001,6 +1001,8 @@ struct hostapd_config { +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +@@ -1025,6 +1025,8 @@ struct hostapd_config { u8 vht_oper_centr_freq_seg1_idx; u8 ht40_plus_minus_allowed; @@ -37,10 +24,10 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ap_config.h /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c +Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.c -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.c +--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c ++++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c @@ -87,6 +87,26 @@ int hostapd_for_each_interface(struct ha } @@ -68,7 +55,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c void hostapd_reconfig_encryption(struct hostapd_data *hapd) { if (hapd->wpa_auth) -@@ -1182,6 +1202,13 @@ static int hostapd_setup_bss(struct host +@@ -1206,6 +1226,13 @@ static int hostapd_setup_bss(struct host if (!first || first == -1) { u8 *addr = hapd->own_addr; @@ -82,7 +69,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c if (!is_zero_ether_addr(conf->bssid)) { /* Allocate the configured BSSID. */ -@@ -1209,7 +1236,7 @@ static int hostapd_setup_bss(struct host +@@ -1233,7 +1260,7 @@ static int hostapd_setup_bss(struct host conf->iface, addr, hapd, &hapd->drv_priv, force_ifname, if_addr, conf->bridge[0] ? conf->bridge : NULL, @@ -91,11 +78,11 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" MACSTR ")", MAC2STR(hapd->own_addr)); hapd->interface_added = 0; -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.h +Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.h -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.h -@@ -598,6 +598,8 @@ struct hostapd_iface { +--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h ++++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h +@@ -603,6 +603,8 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -104,10 +91,10 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.h int hostapd_reload_config(struct hostapd_iface *iface, int reconf); void hostapd_reconfig_encryption(struct hostapd_data *hapd); struct hostapd_data * -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.c +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_drv_ops.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.c +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_drv_ops.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c @@ -321,7 +321,7 @@ int hostapd_vlan_if_add(struct hostapd_d char force_ifname[IFNAMSIZ]; u8 if_addr[ETH_ALEN]; @@ -135,10 +122,10 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.c } -Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.h +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ap_drv_ops.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.h +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_drv_ops.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.h @@ -54,7 +54,8 @@ int hostapd_set_ssid(struct hostapd_data int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, @@ -149,10 +136,10 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ap_drv_ops.h int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname); int hostapd_set_ieee8021x(struct hostapd_data *hapd, -Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c +Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/beacon.c -+++ hostapd-2020-07-02-58b384f4/src/ap/beacon.c +--- hostapd-2021-02-20-59e9794c.orig/src/ap/beacon.c ++++ hostapd-2021-02-20-59e9794c/src/ap/beacon.c @@ -293,7 +293,7 @@ static const u8 * hostapd_vendor_wpa_ie( } @@ -191,9 +178,9 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); if (csa_pos != pos) -@@ -826,6 +834,10 @@ void handle_probe_req(struct hostapd_dat - .elems = &elems, - }; +@@ -836,6 +844,10 @@ void handle_probe_req(struct hostapd_dat + ssi_signal < hapd->iconf->rssi_ignore_probe_request) + return; + if (hapd->iconf->multiple_bssid && + hapd != hostapd_get_primary_bss(hapd)) @@ -202,7 +189,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c if (len < IEEE80211_HDRLEN) return; ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; -@@ -1075,7 +1087,7 @@ void handle_probe_req(struct hostapd_dat +@@ -1085,7 +1097,7 @@ void handle_probe_req(struct hostapd_dat hapd->cs_c_off_ecsa_proberesp; } @@ -211,18 +198,18 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c csa_offs_len ? csa_offs : NULL, csa_offs_len, 0); -@@ -1755,6 +1767,8 @@ void ieee802_11_free_ap_params(struct wp +@@ -1746,6 +1758,8 @@ void ieee802_11_free_ap_params(struct wp params->head = NULL; os_free(params->proberesp); params->proberesp = NULL; + os_free(params->multiple_bssid_ies); + params->multiple_bssid_ies = NULL; #ifdef CONFIG_FILS - os_free(params->fils_discovery_tmpl); - params->fils_discovery_tmpl = NULL; -@@ -1805,6 +1819,22 @@ int ieee802_11_set_beacon(struct hostapd + os_free(params->fd_frame_tmpl); + params->fd_frame_tmpl = NULL; +@@ -1802,6 +1816,22 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = - hostapd_unsol_bcast_probe_resp(hapd, ¶ms); + hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ + if (hapd->iconf->multiple_bssid) { + int len = hostapd_eid_multiple_bssid_len(hapd); @@ -241,13 +228,13 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/beacon.c + params.multiple_bssid_ie_len = end - params.multiple_bssid_ies; + } hapd->reenable_beacon = 0; - - #ifdef CONFIG_FILS -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h + #ifdef CONFIG_SAE + params.sae_pwe = hapd->conf->sae_pwe; +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h -@@ -1222,6 +1222,8 @@ struct wowlan_triggers { +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver.h +@@ -1224,6 +1224,8 @@ struct wowlan_triggers { u8 rfkill_release; }; @@ -256,8 +243,8 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h struct wpa_driver_ap_params { /** * head - Beacon head from IEEE 802.11 header to IEs before TIM IE -@@ -1553,6 +1555,41 @@ struct wpa_driver_ap_params { - * Unsolicited broadcast probe response template length +@@ -1580,6 +1582,41 @@ struct wpa_driver_ap_params { + * Unsolicited broadcast Probe Response template length */ size_t unsol_bcast_probe_resp_tmpl_len; + @@ -298,7 +285,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h }; struct wpa_driver_mesh_bss_params { -@@ -3294,7 +3331,8 @@ struct wpa_driver_ops { +@@ -3344,7 +3381,8 @@ struct wpa_driver_ops { int (*if_add)(void *priv, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr, @@ -308,10 +295,10 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h /** * if_remove - Remove a virtual interface -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/driver_i.h +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/driver_i.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/driver_i.h -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/driver_i.h +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/driver_i.h ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/driver_i.h @@ -444,7 +444,7 @@ static inline int wpa_drv_if_add(struct if (wpa_s->driver->if_add) return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname, @@ -321,13 +308,13 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/driver_i.h return -1; } -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c -@@ -4640,6 +4640,27 @@ static int wpa_driver_nl80211_set_ap(voi +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.c ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c +@@ -4794,6 +4794,27 @@ static int wpa_driver_nl80211_set_ap(voi goto fail; - #endif /* CONFIG_FILS */ + #endif /* CONFIG_SAE */ + if (params->multiple_bssid_count) { + nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_INDEX, @@ -353,7 +340,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -@@ -5232,13 +5253,13 @@ const char * nl80211_iftype_str(enum nl8 +@@ -5405,13 +5426,13 @@ const char * nl80211_iftype_str(enum nl8 } } @@ -369,7 +356,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c { struct nl_msg *msg; int ifidx; -@@ -5267,6 +5288,17 @@ static int nl80211_create_iface_once(str +@@ -5440,6 +5461,17 @@ static int nl80211_create_iface_once(str goto fail; } @@ -387,7 +374,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c /* * Tell cfg80211 that the interface belongs to the socket that created * it, and the interface should be deleted when the socket is closed. -@@ -5320,12 +5352,15 @@ int nl80211_create_iface(struct wpa_driv +@@ -5497,12 +5529,15 @@ int nl80211_create_iface(struct wpa_driv const char *ifname, enum nl80211_iftype iftype, const u8 *addr, int wds, int (*handler)(struct nl_msg *, void *), @@ -405,7 +392,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c /* if error occurred and interface exists already */ if (ret == -ENFILE && if_nametoindex(ifname)) { -@@ -5351,7 +5386,9 @@ int nl80211_create_iface(struct wpa_driv +@@ -5528,7 +5563,9 @@ int nl80211_create_iface(struct wpa_driv /* Try to create the interface again */ ret = nl80211_create_iface_once(drv, ifname, iftype, addr, @@ -416,7 +403,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c } if (ret >= 0 && is_p2p_net_interface(iftype)) { -@@ -7331,7 +7368,7 @@ static int i802_set_wds_sta(void *priv, +@@ -7518,7 +7555,7 @@ static int i802_set_wds_sta(void *priv, if (!if_nametoindex(name)) { if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, @@ -425,7 +412,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c 0) return -1; if (bridge_ifname && -@@ -7678,7 +7715,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7863,7 +7900,9 @@ static int wpa_driver_nl80211_if_add(voi void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr, const char *bridge, int use_existing, @@ -436,7 +423,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c { enum nl80211_iftype nlmode; struct i802_bss *bss = priv; -@@ -7695,7 +7734,8 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7880,7 +7919,8 @@ static int wpa_driver_nl80211_if_add(voi os_memset(&p2pdev_info, 0, sizeof(p2pdev_info)); ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, 0, nl80211_wdev_handler, @@ -446,7 +433,7 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c if (!p2pdev_info.wdev_id_set || ifidx != 0) { wpa_printf(MSG_ERROR, "nl80211: Failed to create a P2P Device interface %s", ifname); -@@ -7711,7 +7751,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7896,7 +7936,9 @@ static int wpa_driver_nl80211_if_add(voi (long long unsigned int) p2pdev_info.wdev_id); } else { ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, @@ -457,11 +444,11 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.c if (use_existing && ifidx == -ENFILE) { added = 0; ifidx = if_nametoindex(ifname); -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.h +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.h -@@ -240,7 +240,9 @@ int nl80211_create_iface(struct wpa_driv +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.h +@@ -251,7 +251,9 @@ int nl80211_create_iface(struct wpa_driv const char *ifname, enum nl80211_iftype iftype, const u8 *addr, int wds, int (*handler)(struct nl_msg *, void *), @@ -472,10 +459,10 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211.h void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv, int ifidx); unsigned int nl80211_get_assoc_freq(struct wpa_driver_nl80211_data *drv); int nl80211_get_assoc_ssid(struct wpa_driver_nl80211_data *drv, u8 *ssid); -Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211_monitor.c +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_monitor.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver_nl80211_monitor.c -+++ hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211_monitor.c +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211_monitor.c ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_monitor.c @@ -381,7 +381,7 @@ int nl80211_create_monitor_interface(str drv->monitor_ifidx = @@ -485,13 +472,13 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/driver_nl80211_monitor.c if (drv->monitor_ifidx == -EOPNOTSUPP) { /* -Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h +Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/drivers/nl80211_copy.h -+++ hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h -@@ -2522,6 +2522,20 @@ enum nl80211_commands { - * unsolicited broadcast probe response. It is a nested attribute, see - * &enum nl80211_unsol_bcast_probe_resp_attributes. +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/nl80211_copy.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h +@@ -2576,6 +2576,20 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. * + * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this + * BSSIDs beacon. @@ -510,10 +497,11 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3010,6 +3024,12 @@ enum nl80211_attrs { - - NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, +@@ -3074,6 +3088,13 @@ enum nl80211_attrs { + NL80211_ATTR_DISABLE_HE, + NL80211_ATTR_HE_MUEDCA_PARAMS, ++ + NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING, + NL80211_ATTR_MULTIPLE_BSSID_PARENT, + NL80211_ATTR_MULTIPLE_BSSID_INDEX, @@ -523,10 +511,10 @@ Index: hostapd-2020-07-02-58b384f4/src/drivers/nl80211_copy.h /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c +Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c @@ -6,6 +6,7 @@ * See README for more details. */ @@ -535,7 +523,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c #include "utils/includes.h" #ifndef CONFIG_NATIVE_WINDOWS -@@ -2712,7 +2713,11 @@ int hostapd_get_aid(struct hostapd_data +@@ -3859,7 +3860,11 @@ int hostapd_get_aid(struct hostapd_data } if (j == 32) return -1; @@ -548,7 +536,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c if (aid > 2007) return -1; -@@ -4384,7 +4389,7 @@ static void handle_assoc(struct hostapd_ +@@ -5560,7 +5565,7 @@ static void handle_assoc(struct hostapd_ goto fail; omit_rsnxe = !get_ie(pos, left, WLAN_EID_RSNX); @@ -557,7 +545,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, "No room for more AIDs"); resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; -@@ -5645,4 +5650,117 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct +@@ -6970,4 +6975,117 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct return eid; } @@ -675,10 +663,10 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.c +} + #endif /* CONFIG_NATIVE_WINDOWS */ -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h +Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11.h -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.h @@ -119,7 +119,10 @@ u8 * hostapd_eid_time_zone(struct hostap int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); @@ -698,11 +686,11 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11.h +u8 * hostapd_get_rsne(struct hostapd_data *hapd, u8 *pos, size_t len); #endif /* IEEE802_11_H */ -Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h +Index: hostapd-2021-02-20-59e9794c/src/common/ieee802_11_defs.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/common/ieee802_11_defs.h -+++ hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h -@@ -452,6 +452,8 @@ +--- hostapd-2021-02-20-59e9794c.orig/src/common/ieee802_11_defs.h ++++ hostapd-2021-02-20-59e9794c/src/common/ieee802_11_defs.h +@@ -457,6 +457,8 @@ #define WLAN_EID_RSNX 244 #define WLAN_EID_EXTENSION 255 @@ -711,11 +699,11 @@ Index: hostapd-2020-07-02-58b384f4/src/common/ieee802_11_defs.h /* Element ID Extension (EID 255) values */ #define WLAN_EID_EXT_ASSOC_DELAY_INFO 1 #define WLAN_EID_EXT_FILS_REQ_PARAMS 2 -Index: hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c +Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11_shared.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ieee802_11_shared.c -@@ -356,6 +356,8 @@ static void hostapd_ext_capab_byte(struc +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11_shared.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11_shared.c +@@ -357,6 +357,8 @@ static void hostapd_ext_capab_byte(struc *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */ if (hapd->conf->bss_transition) *pos |= 0x08; /* Bit 19 - BSS Transition */ diff --git a/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch index c9aca1c83..be5749ef9 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch @@ -12,8 +12,6 @@ Signed-off-by: John Crispin src/ap/hostapd.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 38d1dd7ac4ed..95cd779ec8a0 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -13,6 +13,7 @@ @@ -24,7 +22,7 @@ index 38d1dd7ac4ed..95cd779ec8a0 100644 #include "common/ieee802_11_defs.h" #include "common/sae.h" #include "crypto/sha256.h" -@@ -2355,6 +2356,12 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -2359,6 +2360,12 @@ static int hostapd_config_fill(struct ho } os_memcpy(bss->ssid.ssid, pos, bss->ssid.ssid_len); bss->ssid.ssid_set = 1; @@ -37,8 +35,6 @@ index 38d1dd7ac4ed..95cd779ec8a0 100644 } else if (os_strcmp(buf, "ssid2") == 0) { size_t slen; char *str = wpa_config_parse_string(pos, &slen); -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index a23e05e556e9..bbb2c642bd19 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -13,7 +13,6 @@ @@ -49,7 +45,7 @@ index a23e05e556e9..bbb2c642bd19 100644 #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" -@@ -1247,12 +1246,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) +@@ -1247,12 +1246,6 @@ static int hostapd_setup_bss(struct host os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } @@ -62,5 +58,3 @@ index a23e05e556e9..bbb2c642bd19 100644 if (!hostapd_drv_none(hapd)) { wpa_printf(MSG_DEBUG, "Using interface %s with hwaddr " MACSTR " and ssid \"%s\"", --- -2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch index 065379c2a..7712636d2 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch @@ -16,11 +16,9 @@ Signed-off-by: John Crispin src/ap/neighbor_db.h | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) -diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index 0a5712e33305..f61210d5e282 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3004,6 +3004,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) +@@ -3023,6 +3023,7 @@ static int hostapd_ctrl_iface_set_neighb u8 bssid[ETH_ALEN]; struct wpabuf *nr, *lci = NULL, *civic = NULL; int stationary = 0; @@ -28,7 +26,7 @@ index 0a5712e33305..f61210d5e282 100644 char *tmp; int ret; -@@ -3088,9 +3089,22 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) +@@ -3107,9 +3108,22 @@ static int hostapd_ctrl_iface_set_neighb if (os_strstr(buf, "stat")) stationary = 1; @@ -52,8 +50,6 @@ index 0a5712e33305..f61210d5e282 100644 wpabuf_free(nr); wpabuf_free(lci); -diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index cab845714135..e7eacd235fa5 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -139,6 +139,7 @@ struct hostapd_neighbor_entry { @@ -64,11 +60,9 @@ index cab845714135..e7eacd235fa5 100644 }; struct hostapd_sae_commit_queue { -diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index 97840681247b..4f8233c78bf3 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c -@@ -120,7 +120,8 @@ hostapd_neighbor_add(struct hostapd_data *hapd) +@@ -120,7 +120,8 @@ hostapd_neighbor_add(struct hostapd_data int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, const struct wpa_ssid_value *ssid, const struct wpabuf *nr, const struct wpabuf *lci, @@ -78,7 +72,7 @@ index 97840681247b..4f8233c78bf3 100644 { struct hostapd_neighbor_entry *entry; -@@ -152,6 +153,7 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, +@@ -152,6 +153,7 @@ int hostapd_neighbor_set(struct hostapd_ } entry->stationary = stationary; @@ -86,7 +80,7 @@ index 97840681247b..4f8233c78bf3 100644 return 0; -@@ -329,7 +331,7 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) +@@ -329,7 +331,7 @@ void hostapd_neighbor_set_own_report(str wpabuf_put_u8(nr, center_freq2_idx); hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci, @@ -95,11 +89,9 @@ index 97840681247b..4f8233c78bf3 100644 wpabuf_free(nr); #endif /* NEED_AP_MLME */ -diff --git a/src/ap/neighbor_db.h b/src/ap/neighbor_db.h -index f15ea1aa411d..2b20d8920018 100644 --- a/src/ap/neighbor_db.h +++ b/src/ap/neighbor_db.h -@@ -17,7 +17,8 @@ int hostapd_neighbor_show(struct hostapd_data *hapd, char *buf, size_t buflen); +@@ -17,7 +17,8 @@ int hostapd_neighbor_show(struct hostapd int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, const struct wpa_ssid_value *ssid, const struct wpabuf *nr, const struct wpabuf *lci, @@ -109,5 +101,3 @@ index f15ea1aa411d..2b20d8920018 100644 void hostapd_neighbor_set_own_report(struct hostapd_data *hapd); int hostapd_prepare_neighbor_buf(struct hostapd_data *hapd, const u8 *bssid, struct wpabuf *nrbuf); --- -2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch index b36a31a06..c3d7b16ff 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin src/ap/neighbor_db.c | 2 ++ 2 files changed, 3 insertions(+) -diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index e7eacd235fa5..16ffeeb4ac82 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -140,6 +140,7 @@ struct hostapd_neighbor_entry { @@ -23,8 +21,6 @@ index e7eacd235fa5..16ffeeb4ac82 100644 }; struct hostapd_sae_commit_queue { -diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index 4f8233c78bf3..06f6691342a0 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c @@ -10,6 +10,7 @@ @@ -35,7 +31,7 @@ index 4f8233c78bf3..06f6691342a0 100644 #include "hostapd.h" #include "ieee802_11.h" #include "neighbor_db.h" -@@ -135,6 +136,7 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, +@@ -135,6 +136,7 @@ int hostapd_neighbor_set(struct hostapd_ os_memcpy(entry->bssid, bssid, ETH_ALEN); os_memcpy(&entry->ssid, ssid, sizeof(entry->ssid)); @@ -43,5 +39,3 @@ index 4f8233c78bf3..06f6691342a0 100644 entry->nr = wpabuf_dup(nr); if (!entry->nr) --- -2.17.1 diff --git a/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch index 3a4fc0a42..33bed2d9c 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch @@ -19,20 +19,24 @@ Signed-off-by: Pradeep Kumar Chitrapu src/common/ieee802_11_defs.h | 14 ++++++ 7 files changed, 113 insertions(+) ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -4592,6 +4592,8 @@ static int hostapd_config_fill(struct ho +Index: hostapd-2021-02-18/hostapd/config_file.c +=================================================================== +--- hostapd-2021-02-18.orig/hostapd/config_file.c ++++ hostapd-2021-02-18/hostapd/config_file.c +@@ -4672,6 +4672,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); + } else if (os_strcmp(buf, "rnr_beacon") == 0) { + bss->rnr_beacon = atoi(pos); - } else { - wpa_printf(MSG_ERROR, - "Line %d: unknown configuration item '%s'", ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -2786,6 +2786,9 @@ own_ip_addr=127.0.0.1 + } else if (os_strcmp(buf, "disable_11n") == 0) { + bss->disable_11n = !!atoi(pos); + } else if (os_strcmp(buf, "disable_11ac") == 0) { +Index: hostapd-2021-02-18/hostapd/hostapd.conf +=================================================================== +--- hostapd-2021-02-18.orig/hostapd/hostapd.conf ++++ hostapd-2021-02-18/hostapd/hostapd.conf +@@ -2885,6 +2885,9 @@ own_ip_addr=127.0.0.1 # that allows sending of such data. Default: 0. #stationary_ap=0 @@ -42,19 +46,23 @@ Signed-off-by: Pradeep Kumar Chitrapu ##### Airtime policy configuration ########################################### # Set the airtime policy operating mode: ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -869,6 +869,7 @@ struct hostapd_bss_config { - #endif /* CONFIG_MACSEC */ +Index: hostapd-2021-02-18/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ap_config.h ++++ hostapd-2021-02-18/src/ap/ap_config.h +@@ -885,6 +885,7 @@ struct hostapd_bss_config { + #endif /* CONFIG_PASN */ - u32 unsol_bcast_probe_resp_interval; + unsigned int unsol_bcast_probe_resp_interval; + u8 rnr_beacon; }; /** ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -1475,6 +1475,7 @@ int ieee802_11_build_ap_params(struct ho +Index: hostapd-2021-02-18/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/beacon.c ++++ hostapd-2021-02-18/src/ap/beacon.c +@@ -1467,6 +1467,7 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); @@ -62,7 +70,7 @@ Signed-off-by: Pradeep Kumar Chitrapu tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1648,6 +1649,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1643,6 +1644,7 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_owe_trans(hapd, tailpos, tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); @@ -70,9 +78,11 @@ Signed-off-by: Pradeep Kumar Chitrapu if (hapd->conf->vendor_elements) { os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -5762,4 +5762,93 @@ u8 * hostapd_eid_multiple_bssid(struct h +Index: hostapd-2021-02-18/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-18/src/ap/ieee802_11.c +@@ -7079,4 +7079,93 @@ u8 * hostapd_eid_multiple_bssid(struct h return eid; } @@ -166,8 +176,10 @@ Signed-off-by: Pradeep Kumar Chitrapu +} + #endif /* CONFIG_NATIVE_WINDOWS */ ---- a/src/ap/ieee802_11.h -+++ b/src/ap/ieee802_11.h +Index: hostapd-2021-02-18/src/ap/ieee802_11.h +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-18/src/ap/ieee802_11.h @@ -123,6 +123,8 @@ u8 * hostapd_eid_multiple_bssid(struct h u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max); @@ -177,13 +189,14 @@ Signed-off-by: Pradeep Kumar Chitrapu int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -2387,4 +2387,18 @@ enum edmg_bw_config { +Index: hostapd-2021-02-18/src/common/ieee802_11_defs.h +=================================================================== +--- hostapd-2021-02-18.orig/src/common/ieee802_11_defs.h ++++ hostapd-2021-02-18/src/common/ieee802_11_defs.h +@@ -2437,4 +2437,17 @@ enum mscs_description_subelem { */ - #define FILS_DISCOVERY_CAP_PHY_INDEX_HE 4 - #define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 -+ + #define FD_MAX_INTERVAL_6GHZ 20 /* TUs */ + +/* TBTT Information field defines */ +#define TBTT_HEADER_LENGTH 4 +#define TBTT_INFO_LENGTH 12 diff --git a/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch b/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch deleted file mode 100644 index 066cc2eaf..000000000 --- a/feeds/wifi-ax/hostapd/patches/e00-001-send-6ghz-cap-to-kernel-and-fix-6ghz-op-class.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4960,6 +4960,14 @@ static int wpa_driver_nl80211_sta_add(vo - goto fail; - } - -+ if (params->he_6ghz_capab) { -+ wpa_hexdump(MSG_DEBUG, " * he_6ghz_capab", -+ (u8 *) params->he_6ghz_capab, sizeof(*params->he_6ghz_capab)); -+ if (nla_put(msg, NL80211_ATTR_HE_6GHZ_CAPABILITY, -+ sizeof(*params->he_6ghz_capab), params->he_6ghz_capab)) -+ goto fail; -+ } -+ - if (params->ext_capab) { - wpa_hexdump(MSG_DEBUG, " * ext_capab", - params->ext_capab, params->ext_capab_len); ---- a/src/common/ieee802_11_common.c -+++ b/src/common/ieee802_11_common.c -@@ -884,6 +884,7 @@ enum hostapd_hw_mode ieee80211_freq_to_c - u8 *op_class, u8 *channel) - { - u8 vht_opclass; -+ u8 he_6ghz_opclass; - - /* TODO: more operating classes */ - -@@ -931,15 +932,19 @@ enum hostapd_hw_mode ieee80211_freq_to_c - switch (chanwidth) { - case CHANWIDTH_80MHZ: - vht_opclass = 128; -+ he_6ghz_opclass = 133; - break; - case CHANWIDTH_160MHZ: - vht_opclass = 129; -+ he_6ghz_opclass = 134; - break; - case CHANWIDTH_80P80MHZ: - vht_opclass = 130; -+ he_6ghz_opclass = 135; - break; - default: - vht_opclass = 0; -+ he_6ghz_opclass = 0; - break; - } - -@@ -1030,15 +1035,17 @@ enum hostapd_hw_mode ieee80211_freq_to_c - } - - if (freq > 5950 && freq <= 7115) { -- int bw; -- u8 idx = (freq - 5950) / 5; -- -- bw = center_idx_to_bw_6ghz(idx); -- if (bw < 0) -+ if ((freq - 5950) % 5) - return NUM_HOSTAPD_MODES; - -- *channel = idx; -- *op_class = 131 + bw; -+ if (he_6ghz_opclass) -+ *op_class = he_6ghz_opclass; -+ else if (sec_channel == 1 || sec_channel == -1) -+ *op_class = 132; -+ else -+ *op_class = 131; -+ -+ *channel = (freq - 5950) / 5; - return HOSTAPD_MODE_IEEE80211A; - } - diff --git a/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch b/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch deleted file mode 100644 index aa1ec76c9..000000000 --- a/feeds/wifi-ax/hostapd/patches/e00-002-6G-enable-TX-power-envelope-IE-incase-of-6GHz.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -563,7 +563,6 @@ static u8 * hostapd_gen_probe_resp(struc - !is_6ghz_op_class(hapd->iconf->op_class)) { - pos = hostapd_eid_vht_capabilities(hapd, pos, 0); - pos = hostapd_eid_vht_operation(hapd, pos); -- pos = hostapd_eid_txpower_envelope(hapd, pos); - } - #endif /* CONFIG_IEEE80211AC */ - -@@ -571,6 +570,7 @@ static u8 * hostapd_gen_probe_resp(struc - hapd->iconf->ieee80211ax) - pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); - -+ pos = hostapd_eid_txpower_envelope(hapd, pos); - pos = hostapd_eid_fils_indic(hapd, pos, 0); - pos = hostapd_get_rsnxe(hapd, pos, epos - pos); - -@@ -1577,7 +1577,6 @@ int ieee802_11_build_ap_params(struct ho - if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { - tailpos = hostapd_eid_vht_capabilities(hapd, tailpos, 0); - tailpos = hostapd_eid_vht_operation(hapd, tailpos); -- tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); - } - #endif /* CONFIG_IEEE80211AC */ - -@@ -1585,6 +1584,7 @@ int ieee802_11_build_ap_params(struct ho - hapd->iconf->ieee80211ax) - tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); - -+ tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); - tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0); - tailpos = hostapd_get_rsnxe(hapd, tailpos, tailend - tailpos); - ---- a/src/ap/ieee802_11_vht.c -+++ b/src/ap/ieee802_11_vht.c -@@ -177,8 +177,10 @@ u8 * hostapd_eid_txpower_envelope(struct - u8 channel, tx_pwr_count, local_pwr_constraint; - int max_tx_power; - u8 tx_pwr; -+ u8 oper_chwidth; - -- if (!mode) -+ if (!mode || (!(hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) && -+ !hapd->iconf->ieee80211ax)) - return eid; - - if (ieee80211_freq_to_chan(iface->freq, &channel) == NUM_HOSTAPD_MODES) -@@ -191,7 +193,12 @@ u8 * hostapd_eid_txpower_envelope(struct - if (i == mode->num_channels) - return eid; - -- switch (iface->conf->vht_oper_chwidth) { -+ if (is_6ghz_op_class(iconf->op_class)) -+ oper_chwidth = iface->conf->he_oper_chwidth; -+ else -+ oper_chwidth = iface->conf->vht_oper_chwidth; -+ -+ switch (oper_chwidth) { - case CHANWIDTH_USE_HT: - if (iconf->secondary_channel == 0) { - /* Max Transmit Power count = 0 (20 MHz) */ diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch b/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch deleted file mode 100644 index 77a4013b0..000000000 --- a/feeds/wifi-ax/hostapd/patches/e00-003-6G-security-constraints.patch +++ /dev/null @@ -1,314 +0,0 @@ -From dea995bbaf7693c59c37c08b69ac23d5a04d25eb Mon Sep 17 00:00:00 2001 -From: Aloka Dixit -Date: Tue, 8 Sep 2020 16:36:32 -0700 -Subject: [PATCH] AP: Add 6GHz security constraints - -Add security constraints in 6GHz band as given in IEEE P802.11ax/D6.1, -section 12.13.2 (Security constraints in the 6 GHz band). - -Additionally this commit also adds checks for following: -(1) Make management frame protection mandatory in 6GHz. -(2) For WPA3-SAE, only H2E mechanism is allowed. - -Signed-off-by: Aloka Dixit ---- - src/ap/beacon.c | 2 + - src/drivers/driver.h | 14 ++++ - src/drivers/driver_nl80211.c | 140 +++++++++++++++++++++++++++++++---- - wpa_supplicant/ap.c | 1 + - 4 files changed, 144 insertions(+), 13 deletions(-) - -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 26422b65f321..3094979907c3 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -1699,6 +1699,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, - params->auth_algs = hapd->conf->auth_algs; - params->wpa_version = hapd->conf->wpa; - params->privacy = hapd->conf->wpa; -+ params->ieee80211w = hapd->conf->ieee80211w; -+ params->sae_pwe = hapd->conf->sae_pwe; - #ifdef CONFIG_WEP - params->privacy |= hapd->conf->ssid.wep.keys_set || - (hapd->conf->ieee802_1x && -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 1a44254405ef..d574d8179c65 100644 ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1201,6 +1201,10 @@ struct wpa_driver_associate_params { - */ - int disable_he; - #endif /* CONFIG_HE_OVERRIDES */ -+ /** -+ * PWE derivation mechanism for SAE -+ */ -+ int sae_pwe; - }; - - enum hide_ssid { -@@ -1592,6 +1596,16 @@ struct wpa_driver_ap_params { - * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets - */ - int multiple_bssid_ie_count; -+ -+ /** -+ * Management frame protection -+ */ -+ enum mfp_options ieee80211w; -+ -+ /** -+ * PWE derivation mechanism for SAE -+ */ -+ int sae_pwe; - }; - - struct wpa_driver_mesh_bss_params { -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 89607cfa3ecb..1c79c54c4018 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4369,6 +4369,46 @@ static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, - } - #endif /* CONFIG_IEEE80211AX */ - -+ -+static bool wpa_driver_6g_crypto_validity(int n_suite, u32 *suite, -+ u32 suite_type, int sae_pwe) -+{ -+ int i; -+ switch (suite_type) { -+ case NL80211_ATTR_AKM_SUITES: -+ for (i = 0; i < n_suite; i++) { -+ if (suite[i] == RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X || -+ suite[i] == RSN_AUTH_KEY_MGMT_FT_PSK || -+ suite[i] == RSN_AUTH_KEY_MGMT_PSK_SHA256) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: Invalid AKM suite\n"); -+ return false; -+ } -+ if (suite[i] == RSN_AUTH_KEY_MGMT_SAE && sae_pwe != 1) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: Only H2E allowed for SAE in 6GHz\n"); -+ return false; -+ } -+ } -+ break; -+ case NL80211_ATTR_CIPHER_SUITES_PAIRWISE: -+ case NL80211_ATTR_CIPHER_SUITE_GROUP: -+ for (i = 0; i < n_suite; i++) { -+ if (suite[i] == RSN_CIPHER_SUITE_NONE || -+ suite[i] == RSN_CIPHER_SUITE_WEP40 || -+ suite[i] == WPA_CIPHER_WEP104 || -+ suite[i] == RSN_CIPHER_SUITE_TKIP) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: Invalid cipher suite\n"); -+ return false; -+ } -+ } -+ break; -+ } -+ return true; -+} -+ -+ - static int wpa_driver_nl80211_set_ap(void *priv, - struct wpa_driver_ap_params *params) - { -@@ -4380,7 +4420,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, - int beacon_set; - int num_suites; - u32 suites[20], suite; -- u32 ver; -+ u32 ver, band = 0; - #ifdef CONFIG_MESH - struct wpa_driver_mesh_bss_params mesh_params; - #endif /* CONFIG_MESH */ -@@ -4461,12 +4501,25 @@ static int wpa_driver_nl80211_set_ap(void *priv, - goto fail; - } - -+ if ((params->freq->freq > 5950 && params->freq->freq <= 7115) || -+ params->freq->freq == 5935) -+ band = NL80211_BAND_6GHZ; -+ - wpa_printf(MSG_DEBUG, "nl80211: wpa_version=0x%x", params->wpa_version); - ver = 0; - if (params->wpa_version & WPA_PROTO_WPA) - ver |= NL80211_WPA_VERSION_1; - if (params->wpa_version & WPA_PROTO_RSN) - ver |= NL80211_WPA_VERSION_2; -+ if (band == NL80211_BAND_6GHZ) { -+ if (ver != NL80211_WPA_VERSION_2) { -+ wpa_printf(MSG_DEBUG, "nl80211: Only WPA3 allowed in 6GHz\n"); -+ goto fail; -+ } else if (params->ieee80211w != MGMT_FRAME_PROTECTION_REQUIRED) { -+ wpa_printf(MSG_DEBUG, "nl80211: Management frame protection is required in 6GHz\n"); -+ goto fail; -+ } -+ } - if (ver && - nla_put_u32(msg, NL80211_ATTR_WPA_VERSIONS, ver)) - goto fail; -@@ -4479,10 +4532,17 @@ static int wpa_driver_nl80211_set_ap(void *priv, - wpa_printf(MSG_DEBUG, - "nl80211: Not enough room for all AKM suites (num_suites=%d > NL80211_MAX_NR_AKM_SUITES)", - num_suites); -- else if (num_suites && -- nla_put(msg, NL80211_ATTR_AKM_SUITES, num_suites * sizeof(u32), -- suites)) -- goto fail; -+ else if (num_suites) { -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(num_suites, suites, -+ NL80211_ATTR_AKM_SUITES, -+ params->sae_pwe)) -+ goto fail; -+ -+ if (nla_put(msg, NL80211_ATTR_AKM_SUITES, -+ num_suites * sizeof(u32), suites)) -+ goto fail; -+ } - - if (params->key_mgmt_suites & WPA_KEY_MGMT_IEEE8021X_NO_WPA && - (!params->pairwise_ciphers || -@@ -4500,17 +4560,31 @@ static int wpa_driver_nl80211_set_ap(void *priv, - params->pairwise_ciphers); - num_suites = wpa_cipher_to_cipher_suites(params->pairwise_ciphers, - suites, ARRAY_SIZE(suites)); -- if (num_suites && -- nla_put(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, -- num_suites * sizeof(u32), suites)) -+ if (num_suites) { -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(num_suites, suites, -+ NL80211_ATTR_CIPHER_SUITES_PAIRWISE, -+ params->sae_pwe)) -+ goto fail; -+ -+ if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, -+ num_suites * sizeof(u32), suites)) - goto fail; -+ } - - wpa_printf(MSG_DEBUG, "nl80211: group_cipher=0x%x", - params->group_cipher); - suite = wpa_cipher_to_cipher_suite(params->group_cipher); -- if (suite && -- nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite)) -- goto fail; -+ if (suite) { -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(num_suites, suites, -+ NL80211_ATTR_CIPHER_SUITE_GROUP, -+ params->sae_pwe)) -+ goto fail; -+ -+ if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite)) -+ goto fail; -+ } - - if (params->beacon_ies) { - wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies", -@@ -5977,6 +6051,8 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - struct wpa_driver_associate_params *params, - struct nl_msg *msg) - { -+ u32 band = 0; -+ - if (nla_put_flag(msg, NL80211_ATTR_IFACE_SOCKET_OWNER)) - return -1; - -@@ -6001,6 +6077,10 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - params->freq.freq)) - return -1; - drv->assoc_freq = params->freq.freq; -+ -+ if ((params->freq.freq > 5950 && params->freq.freq >= 7115) || -+ params->freq.freq == 5935) -+ band = NL80211_BAND_6GHZ; - } else - drv->assoc_freq = 0; - -@@ -6048,6 +6128,19 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - nla_put(msg, NL80211_ATTR_IE, params->wpa_ie_len, params->wpa_ie)) - return -1; - -+ if (band == NL80211_BAND_6GHZ) { -+ if (params->wpa_proto != NL80211_WPA_VERSION_2) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: Only WPA3 allowed in 6GHz\n"); -+ return -1; -+ } else if (params->mgmt_frame_protection != -+ MGMT_FRAME_PROTECTION_REQUIRED) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: Management frame protection is required in 6GHz\n"); -+ return -1; -+ } -+ } -+ - if (params->wpa_proto) { - enum nl80211_wpa_versions ver = 0; - -@@ -6064,6 +6157,13 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - if (params->pairwise_suite != WPA_CIPHER_NONE) { - u32 cipher = wpa_cipher_to_cipher_suite(params->pairwise_suite); - wpa_printf(MSG_DEBUG, " * pairwise=0x%x", cipher); -+ -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(1, &cipher, -+ NL80211_ATTR_CIPHER_SUITES_PAIRWISE, -+ params->sae_pwe)) -+ return -1; -+ - if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, - cipher)) - return -1; -@@ -6076,10 +6176,17 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - * advertise support for operations without GTK. - */ - wpa_printf(MSG_DEBUG, " * skip group cipher configuration for GTK_NOT_USED due to missing driver support advertisement"); -- } else if (params->group_suite != WPA_CIPHER_NONE) { -+ } else { - u32 cipher = wpa_cipher_to_cipher_suite(params->group_suite); - wpa_printf(MSG_DEBUG, " * group=0x%x", cipher); -- if (nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, cipher)) -+ -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(1, &cipher, -+ NL80211_ATTR_CIPHER_SUITE_GROUP, -+ params->sae_pwe)) -+ return -1; -+ if (params->group_suite != WPA_CIPHER_NONE && -+ nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, cipher)) - return -1; - } - -@@ -6165,6 +6272,13 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, - break; - } - wpa_printf(MSG_DEBUG, " * akm=0x%x", mgmt); -+ -+ if (band == NL80211_BAND_6GHZ && -+ !wpa_driver_6g_crypto_validity(1, &mgmt, -+ NL80211_ATTR_AKM_SUITES, -+ params->sae_pwe)) -+ return -1; -+ - if (nla_put_u32(msg, NL80211_ATTR_AKM_SUITES, mgmt)) - return -1; - } -diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index e961ff2983c0..0a0bc22fc514 100644 ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -810,6 +810,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s, - } - params.pairwise_suite = wpa_s->pairwise_cipher; - params.group_suite = params.pairwise_suite; -+ params.sae_pwe = wpa_s->conf->sae_pwe; - - #ifdef CONFIG_P2P - if (ssid->mode == WPAS_MODE_P2P_GO || --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch index e88272247..c9bbe2218 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch @@ -14,19 +14,35 @@ Signed-off-by: Muna Sinada src/ap/drv_callbacks.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c -index 35ee8fff8cca..f1d0b26678c7 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -903,18 +903,8 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, +@@ -876,7 +876,7 @@ void hostapd_event_ch_switch(struct host + { + #ifdef NEED_AP_MLME + int channel, chwidth, is_dfs; +- u8 seg0_idx = 0, seg1_idx = 0; ++ u8 seg0_idx = 0, seg1_idx = 0, op_class; + size_t i; + + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, +@@ -922,27 +922,8 @@ void hostapd_event_ch_switch(struct host break; } - switch (hapd->iface->current_mode->mode) { - case HOSTAPD_MODE_IEEE80211A: -- if (cf1 > 5000) +- if (cf1 == 5935) +- seg0_idx = (cf1 - 5925) / 5; +- else if (cf1 > 5950) +- seg0_idx = (cf1 - 5950) / 5; +- else if (cf1 > 5000) - seg0_idx = (cf1 - 5000) / 5; -- if (cf2 > 5000) +- +- if (cf2 == 5935) +- seg1_idx = (cf2 - 5925) / 5; +- else if (cf2 > 5950) +- seg1_idx = (cf2 - 5950) / 5; +- else if (cf2 > 5000) - seg1_idx = (cf2 - 5000) / 5; - break; - default: @@ -34,11 +50,16 @@ index 35ee8fff8cca..f1d0b26678c7 100644 - ieee80211_freq_to_chan(cf2, &seg1_idx); - break; - } -+ ieee80211_freq_to_chan(cf1, &seg0_idx); ++ ieee80211_freq_to_channel_ext(cf1, offset, chwidth, &op_class, &seg0_idx); + ieee80211_freq_to_chan(cf2, &seg1_idx); hapd->iconf->channel = channel; hapd->iconf->ieee80211n = ht; --- -2.7.4 - +@@ -977,6 +958,7 @@ void hostapd_event_ch_switch(struct host + hostapd_set_oper_chwidth(hapd->iconf, chwidth); + hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx); + hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx); ++ hapd->iconf->op_class = op_class; + + is_dfs = ieee80211_is_dfs(freq, hapd->iface->hw_features, + hapd->iface->num_hw_features); diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch index 0df15fdf8..ca9140f13 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch @@ -1,49 +1,25 @@ -From 38823a3ae9fd084ee5822dfb228e109656187e85 Mon Sep 17 00:00:00 2001 -From: Pradeep Kumar Chitrapu -Date: Tue, 8 Sep 2020 14:24:37 -0700 -Subject: [PATCH] hostapd: Enable 6ghz support in 11s mesh - -Enable 6ghz frequencies support in 11s mesh. -Configurations are similar to 5G/2G bands. -example: - network={ - ssid="pr6gmesh123" - key_mgmt=SAE - mode=5 - frequency=6195 - psk="1234567890" - } - -Also, fix assigning secondary channel for only bandwidth greater -than 20 MHz. - -Signed-off-by: Pradeep Kumar Chitrapu ---- - wpa_supplicant/mesh.c | 6 ++++ - wpa_supplicant/wpa_supplicant.c | 54 +++++++++++++++++++++------------ - 2 files changed, 41 insertions(+), 21 deletions(-) - -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/mesh.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh.c -@@ -370,6 +370,11 @@ static int wpa_supplicant_mesh_init(stru +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c +@@ -453,6 +453,12 @@ static int wpa_supplicant_mesh_init(stru + conf->country[2] = ' '; + wpa_s->mesh_params->handle_dfs = true; } - if (ssid->noscan) - conf->noscan = 1; + ifmsh->freq = frequency; + + /* set 6GHz op_class defaulted to 80MHz */ + if (is_6ghz_freq(frequency)) + conf->op_class = 133; - if (ssid->ht40) - conf->secondary_channel = ssid->ht40; - if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c ++ + + bss->iconf = conf; + ifmsh->conf = conf; +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c -@@ -2401,7 +2401,9 @@ void ibss_mesh_setup_freq(struct wpa_sup +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +@@ -2440,7 +2440,9 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_hw_modes *mode = NULL; int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 184, 192 }; @@ -54,18 +30,18 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; u8 channel; int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); -@@ -2409,7 +2411,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2448,7 +2450,7 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; u32 vht_caps = 0; - int is_24ghz; + int is_24ghz, is_6ghz; int dfs_enabled = wpa_s->conf->country[0] && - (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); -@@ -2465,9 +2467,16 @@ void ibss_mesh_setup_freq(struct wpa_sup - if (!mode) - return; +@@ -2506,9 +2508,16 @@ void ibss_mesh_setup_freq(struct wpa_sup + + freq->channel = channel; + freq->channel = channel; + @@ -80,7 +56,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht) { freq->ht_enabled = 0; -@@ -2606,8 +2615,6 @@ skip_ht40: +@@ -2645,8 +2654,6 @@ skip_ht40: !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_VHT_IBSS)) return; @@ -89,7 +65,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_VHT_OVERRIDES if (ssid->disable_vht) { freq->vht_enabled = 0; -@@ -2615,12 +2622,16 @@ skip_ht40: +@@ -2654,12 +2661,16 @@ skip_ht40: } #endif /* CONFIG_VHT_OVERRIDES */ @@ -108,7 +84,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_HE_OVERRIDES if (is_24ghz) -@@ -2628,16 +2639,14 @@ skip_ht40: +@@ -2667,16 +2678,14 @@ skip_ht40: #endif /* CONFIG_HE_OVERRIDES */ /* setup center_freq1, bandwidth */ @@ -129,7 +105,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c struct hostapd_channel_data *chan; chan = hw_get_channel_chan(mode, i, NULL); -@@ -2653,16 +2662,20 @@ skip_ht40: +@@ -2692,16 +2701,20 @@ skip_ht40: } chwidth = CHANWIDTH_80MHZ; @@ -154,7 +130,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c struct hostapd_channel_data *chan; chan = hw_get_channel_chan(mode, i, NULL); -@@ -2677,9 +2690,10 @@ skip_ht40: +@@ -2717,9 +2730,10 @@ skip_ht40: /* Found a suitable second segment for 80+80 */ chwidth = CHANWIDTH_80P80MHZ; @@ -168,7 +144,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c } if (chwidth == CHANWIDTH_80P80MHZ) -@@ -2697,7 +2711,7 @@ skip_ht40: +@@ -2737,7 +2751,7 @@ skip_ht40: } } else if (ssid->max_oper_chwidth == CHANWIDTH_USE_HT) { chwidth = CHANWIDTH_USE_HT; @@ -177,18 +153,27 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht40) seg0 = 0; -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/ap.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/ap.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/ap.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/ap.c -@@ -237,11 +237,11 @@ int wpa_supplicant_conf_ap_ht(struct wpa - wpas_conf_ap_vht(wpa_s, ssid, conf, mode); - } +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/ap.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/ap.c +@@ -305,20 +305,16 @@ int wpa_supplicant_conf_ap_ht(struct wpa + HT_CAP_INFO_TX_STBC | + HT_CAP_INFO_MAX_AMSDU_SIZE); +- /* check this before VHT, because setting oper chan +- * width and friends is the same call for HE and VHT +- * and checks if conf->ieee8021ax == 1 */ - if (mode->he_capab[wpas_mode_to_ieee80211_mode( - ssid->mode)].he_supported && - ssid->he) - conf->ieee80211ax = 1; +- + if (mode->vht_capab && ssid->vht) { + conf->ieee80211ac = 1; + conf->vht_capab |= mode->vht_capab; + wpas_conf_ap_vht(wpa_s, ssid, conf, mode); + } } + if (mode->he_capab[wpas_mode_to_ieee80211_mode( + ssid->mode)].he_supported && ssid->he) @@ -197,10 +182,10 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/ap.c } if (conf->secondary_channel) { -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh_mpm.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/mesh_mpm.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh_mpm.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh_mpm.c @@ -251,6 +251,9 @@ static void mesh_mpm_send_plink_action(s HE_MAX_MCS_CAPAB_SIZE + HE_MAX_PPET_CAPAB_SIZE; @@ -219,7 +204,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c wpabuf_put_data(buf, he_capa_oper, pos - he_capa_oper); } #endif /* CONFIG_IEEE80211AX */ -@@ -746,6 +750,7 @@ static struct sta_info * mesh_mpm_add_pe +@@ -749,6 +753,7 @@ static struct sta_info * mesh_mpm_add_pe #ifdef CONFIG_IEEE80211AX copy_sta_he_capab(data, sta, IEEE80211_MODE_MESH, elems->he_capabilities, elems->he_capabilities_len); @@ -227,7 +212,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/mesh_mpm.c #endif /* CONFIG_IEEE80211AX */ if (hostapd_get_aid(data, sta) < 0) { -@@ -767,6 +772,7 @@ static struct sta_info * mesh_mpm_add_pe +@@ -770,6 +775,7 @@ static struct sta_info * mesh_mpm_add_pe params.vht_capabilities = sta->vht_capabilities; params.he_capab = sta->he_capab; params.he_capab_len = sta->he_capab_len; diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch index 4edc2ddae..406e34588 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch @@ -1,30 +1,8 @@ -From 01845904f9a5cdbd60f6aabdcfc0a8b191d90785 Mon Sep 17 00:00:00 2001 -From: P Praneesh -Date: Sun, 27 Sep 2020 00:21:21 +0530 -Subject: [PATCH] hostapd: Enable 160MHz support for 6G in 11s mesh - -Since 6G has no dfs channel, enable 6G 160MHz bandwidth -as a default configuration for 11s mesh. - -example: - network={ - ssid="6gmesh160" - key_mgmt=SAE - mode=5 - frequency=6275 - psk="1234567890" - } - -Signed-off-by: P Praneesh ---- - wpa_supplicant/wpa_supplicant.c | 15 ++++++++++++++- - 1 file changed, 14 insertions(+), 1 deletion(-) - -Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c -@@ -2391,6 +2391,22 @@ static int drv_supports_vht(struct wpa_s +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +@@ -2430,6 +2430,22 @@ static int drv_supports_vht(struct wpa_s return mode->vht_capab != 0; } @@ -47,7 +25,7 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, -@@ -2404,6 +2420,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2443,6 +2459,7 @@ void ibss_mesh_setup_freq(struct wpa_sup unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035, 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, 6915, 6995 }; @@ -55,3 +33,52 @@ Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; u8 channel; int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); +@@ -2685,25 +2702,34 @@ skip_to_6ghz: + if (j == ARRAY_SIZE(bw80)) + return; + +- for (i = freq->channel; i < freq->channel + 16; i += 4) { +- struct hostapd_channel_data *chan; +- +- chan = hw_get_channel_chan(mode, i, NULL); +- if (!chan) +- return; +- +- /* Back to HT configuration if channel not usable */ +- if (chan->flag & HOSTAPD_CHAN_DISABLED) +- return; +- if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR)) +- if (!dfs_enabled) +- return; +- } ++ /* Back to HT configuration if channel not usable */ ++ if (!ibss_mesh_is_80mhz_avail(freq->channel, mode)) ++ return; + + chwidth = CHANWIDTH_80MHZ; + seg0 = freq->channel + 6; + seg1 = 0; + ++ /* setup center_freq1 for 6G 160MHz */ ++ if ((mode->he_capab[ieee80211_mode].phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & ++ HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && is_6ghz) { ++ ++ for (j = 0; j < ARRAY_SIZE(bw160); j++) { ++ if (freq->freq == bw160[j]) { ++ /* In 160MHz, Initial four 20MHz channels validated before, ++ * check remaining four 20MHz channels in total 160MHz bandwidth ++ */ ++ int channel = freq->channel + 16; ++ ++ if (!ibss_mesh_is_80mhz_avail(channel, mode)) ++ return; ++ ++ chwidth = CHANWIDTH_160MHZ; ++ seg0 = freq->channel + 14; ++ } ++ } ++ } ++ + if (ssid->max_oper_chwidth == CHANWIDTH_80P80MHZ) { + /* setup center_freq2, bandwidth */ + for (k = 0; k < ARRAY_SIZE(bw80); k++) { diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch index 0894abc34..c910e2ff7 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch @@ -22,11 +22,11 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11_shared.c | 7 +++++- 2 files changed, 35 insertions(+), 20 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index a8d58c309125..b9202a977e06 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -433,7 +433,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +Index: hostapd-2021-02-18/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/beacon.c ++++ hostapd-2021-02-18/src/ap/beacon.c +@@ -433,7 +433,7 @@ static u8 * hostapd_gen_probe_resp(struc int is_p2p, size_t *resp_len) { struct ieee80211_mgmt *resp; @@ -35,7 +35,7 @@ index a8d58c309125..b9202a977e06 100644 size_t buflen; if (hapd->iconf->multiple_bssid) -@@ -545,7 +545,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -547,7 +547,11 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_ht_capabilities(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); @@ -47,7 +47,7 @@ index a8d58c309125..b9202a977e06 100644 pos = hostapd_eid_time_adv(hapd, pos); pos = hostapd_eid_time_zone(hapd, pos); -@@ -1437,12 +1441,12 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1701,12 +1705,12 @@ int ieee802_11_build_ap_params(struct ho { struct ieee80211_mgmt *head = NULL; u8 *tail = NULL; @@ -62,7 +62,7 @@ index a8d58c309125..b9202a977e06 100644 #define BEACON_HEAD_BUF_SIZE 256 #define BEACON_TAIL_BUF_SIZE 512 -@@ -1568,7 +1572,9 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1832,7 +1836,9 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); tailpos = hostapd_eid_ht_operation(hapd, tailpos); @@ -72,7 +72,7 @@ index a8d58c309125..b9202a977e06 100644 /* * TODO: Time Advertisement element should only be included in some -@@ -1764,6 +1770,26 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -2032,6 +2038,26 @@ int ieee802_11_build_ap_params(struct ho } } @@ -99,9 +99,9 @@ index a8d58c309125..b9202a977e06 100644 return 0; } -@@ -1833,22 +1859,6 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) +@@ -2107,22 +2133,6 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = - hostapd_unsol_bcast_probe_resp(hapd, ¶ms); + hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ - if (hapd->iconf->multiple_bssid) { - int len = hostapd_eid_multiple_bssid_len(hapd); @@ -120,13 +120,13 @@ index a8d58c309125..b9202a977e06 100644 - params.multiple_bssid_ie_len = end - params.multiple_bssid_ies; - } hapd->reenable_beacon = 0; - - #ifdef CONFIG_FILS -diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c -index aa4fc0a2bc9b..0e5a2a28bf62 100644 ---- a/src/ap/ieee802_11_shared.c -+++ b/src/ap/ieee802_11_shared.c -@@ -426,6 +426,10 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx) + #ifdef CONFIG_SAE + params.sae_pwe = hapd->conf->sae_pwe; +Index: hostapd-2021-02-18/src/ap/ieee802_11_shared.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11_shared.c ++++ hostapd-2021-02-18/src/ap/ieee802_11_shared.c +@@ -427,6 +427,10 @@ static void hostapd_ext_capab_byte(struc * Identifiers Used Exclusively */ } #endif /* CONFIG_SAE */ @@ -134,19 +134,15 @@ index aa4fc0a2bc9b..0e5a2a28bf62 100644 + * Currently enabled by default if MBSSID IE is enabled */ + if (hapd->iconf->multiple_bssid) + *pos |= 0x08; - if (hapd->conf->beacon_prot) - *pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */ - break; -@@ -495,7 +499,8 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) + if (hapd->conf->beacon_prot && + (hapd->iface->drv_flags & + WPA_DRIVER_FLAGS_BEACON_PROTECTION)) +@@ -498,7 +502,7 @@ u8 * hostapd_eid_ext_capab(struct hostap hostapd_sae_pw_id_in_use(hapd->conf)) len = 11; #endif /* CONFIG_SAE */ -- if (len < 11 && hapd->conf->beacon_prot) -+ if (len < 11 && (hapd->conf->beacon_prot || -+ hapd->iconf->multiple_bssid)) +- if (len < 11 && hapd->conf->beacon_prot && ++ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->multiple_bssid) && + (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION)) len = 11; #ifdef CONFIG_SAE_PK - if (len < 12 && hapd->conf->wpa && --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch b/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch deleted file mode 100644 index 5f5567c6f..000000000 --- a/feeds/wifi-ax/hostapd/patches/e00-005-Remove-unnecessary-nl80211-messages.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 2a50fe7307d9cc86632ca6a9262381ac8018c6ca Mon Sep 17 00:00:00 2001 -From: Aloka Dixit -Date: Sun, 20 Sep 2020 23:44:04 -0700 -Subject: [PATCH] AP: Remove unnecessary nl80211 messages - -Hostapd should send FILS discovery and unsolicited broadcast probe -response related nl80211 message only if the packet interval is set to a -non-zero value. - -Sending these messages without such checks is resulting in memory -shortage causing failure to bring up more interfaces per radio using -multiple BSSID. - -This patch fixes this issue and adds debug messages. - -Signed-off-by: Aloka Dixit ---- - src/ap/beacon.c | 7 ++++++- - src/drivers/driver_nl80211.c | 23 +++++++++++++++++------ - 2 files changed, 23 insertions(+), 7 deletions(-) - -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 3094979907c3..668d9094e28d 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -1149,6 +1149,10 @@ static u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd, - if (!is_6ghz_op_class(hapd->iconf->op_class)) - return NULL; - -+ if (hapd->iconf->multiple_bssid && -+ hapd != hostapd_get_primary_bss(hapd)) -+ return NULL; -+ - params->unsol_bcast_probe_resp_interval = - hapd->conf->unsol_bcast_probe_resp_interval; - -@@ -1408,7 +1412,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) - static u8 * hostapd_fils_discovery(struct hostapd_data *hapd, - struct wpa_driver_ap_params *params) - { -- if (hapd->iconf->multiple_bssid && hapd != hapd->iface->bss[0]) -+ if (hapd->iconf->multiple_bssid && -+ hapd != hostapd_get_primary_bss(hapd)) - return NULL; - - #define VALID_INTERVAL(x,y) { x = (x > y) ? y : x; } -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 8b8435b2fbfd..f2aa2a434b21 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4701,15 +4701,26 @@ static int wpa_driver_nl80211_set_ap(void *priv, - goto fail; - } - -- ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); -- if (ret < 0) -- goto fail; -+ if (params->unsol_bcast_probe_resp_interval) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: unsolicited probe response interval=%u\n", -+ params->unsol_bcast_probe_resp_interval); -+ ret = nl80211_unsol_bcast_probe_resp(bss, msg, params); -+ if (ret < 0) -+ goto fail; -+ } - #endif /* CONFIG_IEEE80211AX */ - - #ifdef CONFIG_FILS -- ret = nl80211_fils_discovery(bss, msg, params); -- if (ret < 0) -- goto fail; -+ if (params->fils_discovery_max_int) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: FILS discovery maximum interval=%u, minimum interval=%u\n", -+ params->fils_discovery_max_int, -+ params->fils_discovery_min_int); -+ ret = nl80211_fils_discovery(bss, msg, params); -+ if (ret < 0) -+ goto fail; -+ } - #endif /* CONFIG_FILS */ - - if (params->multiple_bssid_count) { --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch b/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch deleted file mode 100644 index 51cf2a6a1..000000000 --- a/feeds/wifi-ax/hostapd/patches/e00-006-AP-Extend-Spatial-Reuse-Parameter-Set.patch +++ /dev/null @@ -1,276 +0,0 @@ -From f7a2dce12232984cec2cd2bf8d3316b3208893cb Mon Sep 17 00:00:00 2001 -From: Rajkumar Manoharan -Date: Sun, 27 Sep 2020 23:38:14 -0700 -Subject: [PATCH] AP: Extend Spatial Reuse Parameter Set - -Extend SPR element to support following fields and pass all -information to kernel for driver use. - * Non-SRG OBSS PD Max Offset - * SRG BSS Color Bitmap - * SRG Partial BSSID Bitmap - -Signed-off-by: Rajkumar Manoharan ---- - hostapd/config_file.c | 46 +++++++++++++++++++++++++++++++++++++++++++- - hostapd/hostapd.conf | 15 +++++++++++++++ - src/ap/ap_config.h | 4 ++-- - src/ap/beacon.c | 8 +++++++- - src/ap/ieee802_11_he.c | 5 +++++ - src/drivers/driver.h | 25 ++++++++++++++++++++---- - src/drivers/driver_nl80211.c | 30 ++++++++++++++++++++++------- - src/drivers/nl80211_copy.h | 11 +++++++++++ - 8 files changed, 129 insertions(+), 15 deletions(-) - ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -906,6 +906,32 @@ static int hostapd_parse_intlist(int **i - } - - -+static int hostapd_parse_he_srg_bitmap(u8 *bitmap, char *val) -+{ -+ int bitpos; -+ char *pos, *end; -+ -+ os_memset(bitmap, 0, 8); -+ pos = val; -+ while (*pos != '\0') { -+ end = os_strchr(pos, ' '); -+ if (end) -+ *end = '\0'; -+ -+ bitpos = atoi(pos); -+ if (bitpos < 0 || bitpos > 63) -+ return -1; -+ -+ bitmap[bitpos / 8] |= (1 << (bitpos % 8)); -+ if (!end) -+ break; -+ pos = end + 1; -+ } -+ -+ return 0; -+} -+ -+ - static int hostapd_config_bss(struct hostapd_config *conf, const char *ifname) - { - struct hostapd_bss_config **all, *bss; -@@ -3551,13 +3577,31 @@ static int hostapd_config_fill(struct ho - conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_TIMER_IDX] = - atoi(pos) & 0xff; - } else if (os_strcmp(buf, "he_spr_sr_control") == 0) { -- conf->spr.sr_control = atoi(pos) & 0xff; -+ conf->spr.sr_control = atoi(pos) & 0x1f; - } else if (os_strcmp(buf, "he_spr_non_srg_obss_pd_max_offset") == 0) { - conf->spr.non_srg_obss_pd_max_offset = atoi(pos); - } else if (os_strcmp(buf, "he_spr_srg_obss_pd_min_offset") == 0) { - conf->spr.srg_obss_pd_min_offset = atoi(pos); - } else if (os_strcmp(buf, "he_spr_srg_obss_pd_max_offset") == 0) { - conf->spr.srg_obss_pd_max_offset = atoi(pos); -+ } else if (os_strcmp(buf, "he_spr_srg_bss_colors") == 0) { -+ if (hostapd_parse_he_srg_bitmap( -+ conf->spr.srg_bss_color_bitmap, -+ pos)) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid srg bss colors list '%s'", -+ line, pos); -+ return 1; -+ } -+ } else if (os_strcmp(buf, "he_spr_srg_partial_bssid") == 0) { -+ if (hostapd_parse_he_srg_bitmap( -+ conf->spr.srg_partial_bssid_bitmap, -+ pos)) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid srg partial bssid list '%s'", -+ line, pos); -+ return 1; -+ } - } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { - conf->he_oper_chwidth = atoi(pos); - } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -872,6 +872,21 @@ wmm_ac_vo_acm=0 - #he_spr_non_srg_obss_pd_max_offset - #he_spr_srg_obss_pd_min_offset - #he_spr_srg_obss_pd_max_offset -+# -+# SPR SRG BSS Color -+# This config represents SRG BSS Color Bitmap field of Spatial Reuse Parameter -+# Set element that indicates the BSS color values used by members of the -+# SRG of which the transmitting STA is a member. The value is in range of 0 - 63. -+#he_spr_srg_bss_colors=1 2 10 63 -+# -+# SPR SRG Partial BSSID -+# This config represents SRG Partial BSSID Bitmap field of Spatial Reuse Parameter -+# Set element that indicates the Partial BSSID values used by members of the SRG of -+# which the transmitting STA is a member. The value range corresponds to one of the 64 -+# possible values of BSSID[39:44], where the lowest numbered bit corresponds to Partial -+# BSSID value 0 and the highest numbered bit corresponds to Partial BSSID value 63. -+#he_spr_srg_partial_bssid=0 1 3 63 -+# - - # Unsolicited broadcast probe response transmission settings, 6GHz only. - # If interval is set to non-zero, the AP schedules unsolicited ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -903,8 +903,8 @@ struct spatial_reuse { - u8 non_srg_obss_pd_max_offset; - u8 srg_obss_pd_min_offset; - u8 srg_obss_pd_max_offset; -- u8 srg_obss_color_bitmap; -- u8 srg_obss_color_partial_bitmap; -+ u8 srg_bss_color_bitmap[8]; -+ u8 srg_partial_bssid_bitmap[8]; - }; - - /** ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -1842,11 +1842,17 @@ int ieee802_11_set_beacon(struct hostapd - params.assocresp_ies = assocresp; - params.reenable = hapd->reenable_beacon; - #ifdef CONFIG_IEEE80211AX -- params.he_spr = !!hapd->iface->conf->spr.sr_control; -+ params.he_spr_ctrl = hapd->iface->conf->spr.sr_control; -+ params.he_spr_non_srg_obss_pd_max_offset = -+ hapd->iface->conf->spr.non_srg_obss_pd_max_offset; - params.he_spr_srg_obss_pd_min_offset = - hapd->iface->conf->spr.srg_obss_pd_min_offset; - params.he_spr_srg_obss_pd_max_offset = - hapd->iface->conf->spr.srg_obss_pd_max_offset; -+ os_memcpy(params.he_spr_bss_color_bitmap, -+ hapd->iface->conf->spr.srg_bss_color_bitmap, 8); -+ os_memcpy(params.he_spr_partial_bssid_bitmap, -+ hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); - params.he_bss_color_disabled = - hapd->iface->conf->he_op.he_bss_color_disabled; - params.he_bss_color_partial = ---- a/src/ap/ieee802_11_he.c -+++ b/src/ap/ieee802_11_he.c -@@ -310,6 +310,11 @@ u8 * hostapd_eid_spatial_reuse(struct ho - if (spr->sr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) { - *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_min_offset; - *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_max_offset; -+ os_memcpy(spr_param, -+ hapd->iface->conf->spr.srg_bss_color_bitmap, 8); -+ spr_param += 8; -+ os_memcpy(spr_param, -+ hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); - pos += 18; - } - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1493,19 +1493,36 @@ struct wpa_driver_ap_params { - const struct wpabuf *civic; - - /** -- * he_spr - Whether Spatial Reuse is enabled -+ * he_spr_ctrl - Spatial Reuse control field of SPR element - */ -- int he_spr; -+ u8 he_spr_ctrl; -+ -+ /** -+ * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset -+ */ -+ u8 he_spr_non_srg_obss_pd_max_offset; - - /** - * he_spr_srg_obss_pd_min_offset - Minimum TX power offset - */ -- int he_spr_srg_obss_pd_min_offset; -+ u8 he_spr_srg_obss_pd_min_offset; - - /** - * he_spr_srg_obss_pd_max_offset - Maximum TX power offset - */ -- int he_spr_srg_obss_pd_max_offset; -+ u8 he_spr_srg_obss_pd_max_offset; -+ -+ /** -+ * he_spr_bss_color_bitmap - BSS color values used by members of the -+ * SRG. -+ */ -+ u8 he_spr_bss_color_bitmap[8]; -+ -+ /** -+ * he_spr_partial_bssid_bitmap - Partial BSSID values used by members -+ * of the SRG. -+ */ -+ u8 he_spr_partial_bssid_bitmap[8]; - - /** - * he_bss_color - Whether the BSS Color is disabled ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4664,17 +4664,33 @@ static int wpa_driver_nl80211_set_ap(voi - } - - #ifdef CONFIG_IEEE80211AX -- if (params->he_spr) { -+ if (params->he_spr_ctrl) { - struct nlattr *spr; - - spr = nla_nest_start(msg, NL80211_ATTR_HE_OBSS_PD); -- wpa_printf(MSG_DEBUG, "nl80211: he_spr=%d", params->he_spr); -+ wpa_printf(MSG_DEBUG, "nl80211: he_spr_ctrl=%x", -+ params->he_spr_ctrl); - -- if (!spr || -- nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, -- params->he_spr_srg_obss_pd_min_offset) || -- nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, -- params->he_spr_srg_obss_pd_max_offset)) -+ if (!spr || nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_SR_CTRL, -+ params->he_spr_ctrl)) -+ goto fail; -+ -+ if ((params->he_spr_ctrl & SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT) && -+ nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, -+ params->he_spr_non_srg_obss_pd_max_offset)) -+ goto fail; -+ -+ if ((params->he_spr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) && -+ (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, -+ params->he_spr_srg_obss_pd_min_offset) || -+ nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, -+ params->he_spr_srg_obss_pd_max_offset) || -+ nla_put(msg, NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, -+ sizeof(params->he_spr_bss_color_bitmap), -+ params->he_spr_bss_color_bitmap) || -+ nla_put(msg, NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, -+ sizeof(params->he_spr_partial_bssid_bitmap), -+ params->he_spr_partial_bssid_bitmap))) - goto fail; - - nla_nest_end(msg, spr); ---- a/src/drivers/nl80211_copy.h -+++ b/src/drivers/nl80211_copy.h -@@ -6907,6 +6907,13 @@ enum nl80211_peer_measurement_ftm_resp { - * - * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset. - * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset. -+ * @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum -+ * tx power offset. -+ * @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color -+ * values used by members of the SRG. -+ * @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial -+ * BSSID values used by members of the SRG. -+ * @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element. - * - * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal - * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute. -@@ -6916,6 +6923,10 @@ enum nl80211_obss_pd_attributes { - - NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, - NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, -+ NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, -+ NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, -+ NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, -+ NL80211_HE_OBSS_PD_ATTR_SR_CTRL, - - /* keep last */ - __NL80211_HE_OBSS_PD_ATTR_LAST, diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch index 5416fdeb6..c4ef5bce8 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch @@ -13,11 +13,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.h | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index be59d20729ef..2897f14aa4fb 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -319,7 +319,7 @@ static u8 * hostapd_get_mde(struct hostapd_data *hapd, u8 *pos, size_t len) +@@ -319,7 +319,7 @@ static u8 * hostapd_get_mde(struct hosta } @@ -26,11 +24,9 @@ index be59d20729ef..2897f14aa4fb 100644 { const u8 *ie; -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 65a556e3a606..579c1f538f9a 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5654,17 +5654,29 @@ static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, +@@ -5676,17 +5676,29 @@ static int hostapd_eid_multiple_bssid_ch int *count) { /* ID + size + count */ @@ -66,7 +62,7 @@ index 65a556e3a606..579c1f538f9a 100644 } multiple_bssid_too_big: -@@ -5689,7 +5701,7 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +@@ -5711,7 +5723,7 @@ static u8 * hostapd_eid_multiple_bssid_c u8 *eid, u8 *end, int *count, u8 is_beacon) { @@ -75,7 +71,7 @@ index 65a556e3a606..579c1f538f9a 100644 int i; *eid++ = WLAN_EID_MULTIPLE_BSSID; -@@ -5725,13 +5737,13 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +@@ -5747,13 +5759,13 @@ static u8 * hostapd_eid_multiple_bssid_c *index_size_offset = (eid - index_size_offset) - 1; eid = hostapd_get_rsne(bss, eid, end - eid); @@ -90,17 +86,12 @@ index 65a556e3a606..579c1f538f9a 100644 } multiple_bssid_too_big: -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 9ccfe6c10bd4..2fa2a7d44edc 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h -@@ -203,5 +203,5 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth, +@@ -203,5 +203,5 @@ int get_tx_parameters(struct sta_info *s void auth_sae_process_commit(void *eloop_ctx, void *user_ctx); u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len); u8 * hostapd_get_rsne(struct hostapd_data *hapd, u8 *pos, size_t len); - +u8 * hostapd_get_rsnxe(struct hostapd_data *hapd, u8 *pos, size_t len); #endif /* IEEE802_11_H */ --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch index 8e89961b0..d29d05d28 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch @@ -23,11 +23,11 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11_shared.c | 8 +++----- 7 files changed, 22 insertions(+), 14 deletions(-) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 3fe179274a70..ee19958e013f 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -4592,6 +4592,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +Index: hostapd-2021-02-18/hostapd/config_file.c +=================================================================== +--- hostapd-2021-02-18.orig/hostapd/config_file.c ++++ hostapd-2021-02-18/hostapd/config_file.c +@@ -4672,6 +4672,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); @@ -35,12 +35,12 @@ index 3fe179274a70..ee19958e013f 100644 + conf->ema = atoi(pos); } else if (os_strcmp(buf, "rnr_beacon") == 0) { bss->rnr_beacon = atoi(pos); - } else { -diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c -index 73d1b1f00a24..50427abae8e0 100644 ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c -@@ -1401,6 +1401,12 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config) + } else if (os_strcmp(buf, "disable_11n") == 0) { +Index: hostapd-2021-02-18/src/ap/ap_config.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ap_config.c ++++ hostapd-2021-02-18/src/ap/ap_config.c +@@ -1486,6 +1486,12 @@ int hostapd_config_check(struct hostapd_ return -1; } @@ -53,11 +53,11 @@ index 73d1b1f00a24..50427abae8e0 100644 for (i = 0; i < conf->num_bss; i++) { if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) return -1; -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 4314d5ada62a..b5a20822c227 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1001,6 +1001,7 @@ struct hostapd_config { +Index: hostapd-2021-02-18/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ap_config.h ++++ hostapd-2021-02-18/src/ap/ap_config.h +@@ -1017,6 +1017,7 @@ struct hostapd_config { u8 ht40_plus_minus_allowed; u8 multiple_bssid; @@ -65,11 +65,11 @@ index 4314d5ada62a..b5a20822c227 100644 /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index e29cd999bf21..3ee2f7c65ada 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -533,7 +533,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +Index: hostapd-2021-02-18/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/beacon.c ++++ hostapd-2021-02-18/src/ap/beacon.c +@@ -535,7 +535,7 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_get_mde(hapd, pos, epos - pos); if (hapd->iconf->multiple_bssid) @@ -78,7 +78,7 @@ index e29cd999bf21..3ee2f7c65ada 100644 /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); -@@ -547,8 +547,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -549,8 +549,7 @@ static u8 * hostapd_gen_probe_resp(struc ext_cap_pos = pos; pos = hostapd_eid_ext_capab(hapd, pos); @@ -88,7 +88,7 @@ index e29cd999bf21..3ee2f7c65ada 100644 ext_cap_pos[12] |= 0x01; pos = hostapd_eid_time_adv(hapd, pos); -@@ -1781,10 +1780,11 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -2051,10 +2050,11 @@ int ieee802_11_build_ap_params(struct ho params->multiple_bssid_ies + len, 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, @@ -103,11 +103,11 @@ index e29cd999bf21..3ee2f7c65ada 100644 ext_cap_pos[12] |= 0x01; } -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 65a556e3a606..4a6323bc623e 100644 ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -5747,12 +5747,13 @@ multiple_bssid_too_big: +Index: hostapd-2021-02-18/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-18/src/ap/ieee802_11.c +@@ -7076,12 +7076,13 @@ multiple_bssid_too_big: u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, u8 is_beacon, u8 **eid_offsets, int *eid_count, @@ -123,11 +123,11 @@ index 65a556e3a606..4a6323bc623e 100644 eid_offsets[*eid_count] = eid; *eid_count = *eid_count + 1; } -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 9ccfe6c10bd4..ff2595078869 100644 ---- a/src/ap/ieee802_11.h -+++ b/src/ap/ieee802_11.h -@@ -121,7 +121,7 @@ void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); +Index: hostapd-2021-02-18/src/ap/ieee802_11.h +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-18/src/ap/ieee802_11.h +@@ -121,7 +121,7 @@ void hostapd_client_poll_ok(struct hosta u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, u8 is_beacon, u8 **eid_offsets, int *eid_count, @@ -136,11 +136,11 @@ index 9ccfe6c10bd4..ff2595078869 100644 int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); -diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c -index 0e5a2a28bf62..0e0132a3a05e 100644 ---- a/src/ap/ieee802_11_shared.c -+++ b/src/ap/ieee802_11_shared.c -@@ -426,9 +426,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx) +Index: hostapd-2021-02-18/src/ap/ieee802_11_shared.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11_shared.c ++++ hostapd-2021-02-18/src/ap/ieee802_11_shared.c +@@ -427,9 +427,8 @@ static void hostapd_ext_capab_byte(struc * Identifiers Used Exclusively */ } #endif /* CONFIG_SAE */ @@ -150,18 +150,14 @@ index 0e5a2a28bf62..0e0132a3a05e 100644 + /* Bit 83 - EMA AP Support */ + if (hapd->iconf->ema) *pos |= 0x08; - if (hapd->conf->beacon_prot) - *pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */ -@@ -499,8 +498,7 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) + if (hapd->conf->beacon_prot && + (hapd->iface->drv_flags & +@@ -502,7 +501,7 @@ u8 * hostapd_eid_ext_capab(struct hostap hostapd_sae_pw_id_in_use(hapd->conf)) len = 11; #endif /* CONFIG_SAE */ -- if (len < 11 && (hapd->conf->beacon_prot || -- hapd->iconf->multiple_bssid)) -+ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema)) +- if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->multiple_bssid) && ++ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema) && + (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION)) len = 11; #ifdef CONFIG_SAE_PK - if (len < 12 && hapd->conf->wpa && --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch index 9d0701d1b..f3bd7dd6b 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch @@ -20,11 +20,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 65a556e3a606..a8ca9dcef0b5 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2718,7 +2718,7 @@ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) +@@ -2719,7 +2719,7 @@ int hostapd_get_aid(struct hostapd_data return -1; aid = i * 32 + j; if (hapd->iconf->multiple_bssid) @@ -33,6 +31,3 @@ index 65a556e3a606..a8ca9dcef0b5 100644 else aid += 1; if (aid > 2007) --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch index 644a2e83c..cc303fa6b 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch @@ -31,11 +31,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.c | 47 ++++++++++++++++++++--- 3 files changed, 108 insertions(+), 33 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index f616cec5afde..f3862dbb17f1 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1788,6 +1788,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1788,6 +1788,7 @@ int ieee802_11_build_ap_params(struct ho if ((params->multiple_bssid_ie_count <= 1) && (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) ext_cap_pos[12] |= 0x01; @@ -43,11 +41,9 @@ index f616cec5afde..f3862dbb17f1 100644 } return 0; -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 6a9f617e0e04..54c954e74b37 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1109,19 +1109,60 @@ static int db_table_create_radius_attributes(sqlite3 *db) +@@ -1109,19 +1109,60 @@ static int db_table_create_radius_attrib #endif /* CONFIG_NO_RADIUS */ @@ -109,7 +105,7 @@ index 6a9f617e0e04..54c954e74b37 100644 { struct hostapd_bss_config *conf = hapd->conf; u8 ssid[SSID_MAX_LEN + 1]; -@@ -1393,31 +1434,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) +@@ -1393,31 +1434,8 @@ static int hostapd_setup_bss(struct host return -1; } @@ -143,7 +139,7 @@ index 6a9f617e0e04..54c954e74b37 100644 return 0; } -@@ -2109,7 +2127,8 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, +@@ -2109,7 +2127,8 @@ static int hostapd_setup_interface_compl hapd = iface->bss[j]; if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); @@ -153,7 +149,7 @@ index 6a9f617e0e04..54c954e74b37 100644 for (;;) { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); -@@ -2123,6 +2142,24 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, +@@ -2123,6 +2142,24 @@ static int hostapd_setup_interface_compl if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } @@ -178,7 +174,7 @@ index 6a9f617e0e04..54c954e74b37 100644 hapd = iface->bss[0]; hostapd_tx_queue_params(iface); -@@ -2989,7 +3026,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) +@@ -2989,7 +3026,7 @@ int hostapd_add_iface(struct hapd_interf if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && @@ -187,11 +183,9 @@ index 6a9f617e0e04..54c954e74b37 100644 hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 74261ad7c0df..bb24bf91125a 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5699,7 +5699,7 @@ int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd) +@@ -5721,7 +5721,7 @@ int hostapd_eid_multiple_bssid_len(struc static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, u8 *eid, u8 *end, int *count, @@ -200,7 +194,7 @@ index 74261ad7c0df..bb24bf91125a 100644 { u8 *size_offset, *num_offset; int i; -@@ -5731,6 +5731,7 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +@@ -5753,6 +5753,7 @@ static u8 * hostapd_eid_multiple_bssid_c index_size_offset = eid++; *eid++ = i; if (is_beacon) { @@ -208,7 +202,7 @@ index 74261ad7c0df..bb24bf91125a 100644 *eid++ = bss->conf->dtim_period; *eid++ = 0xFF; } -@@ -5761,17 +5762,53 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, +@@ -5783,17 +5784,53 @@ u8 * hostapd_eid_multiple_bssid(struct h u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max, u8 ema_beacon) { @@ -266,6 +260,3 @@ index 74261ad7c0df..bb24bf91125a 100644 return eid; } --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch index f08302dab..cc83d4ca5 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch @@ -15,11 +15,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 65a556e3a606..806e8b02b732 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5771,6 +5771,8 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) +@@ -5843,6 +5843,8 @@ size_t hostapd_eid_reduced_neighbor_repo len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); if (!dl_list_empty(&hapd->nr_db)) len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); @@ -28,7 +26,7 @@ index 65a556e3a606..806e8b02b732 100644 return len; } -@@ -5781,12 +5783,13 @@ u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid) +@@ -5853,12 +5855,13 @@ u8 * hostapd_eid_reduced_neighbor_report size_t len = hostapd_eid_reduced_neighbor_report_len(hapd); struct hostapd_neighbor_entry *nr; int i, count = 0; @@ -43,7 +41,7 @@ index 65a556e3a606..806e8b02b732 100644 if (hapd->iface->num_bss > 1) { u8 op_class, channel; -@@ -5848,6 +5851,9 @@ nr_db: +@@ -5920,6 +5923,9 @@ nr_db: if (!count) eid -= 2; @@ -53,6 +51,3 @@ index 65a556e3a606..806e8b02b732 100644 return eid; } --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch index 7036f34e1..714b44e11 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch @@ -20,11 +20,11 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.h | 7 ++++-- 3 files changed, 62 insertions(+), 25 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index f3862dbb17f1..808a2d939cbe 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -432,12 +432,16 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +Index: hostapd-2021-02-20/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/beacon.c ++++ hostapd-2021-02-20/src/ap/beacon.c +@@ -432,12 +432,16 @@ static u8 * hostapd_gen_probe_resp(struc const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len) { @@ -42,7 +42,7 @@ index f3862dbb17f1..808a2d939cbe 100644 #define MAX_PROBERESP_LEN 768 buflen = MAX_PROBERESP_LEN; -@@ -476,7 +480,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -476,7 +480,7 @@ static u8 * hostapd_gen_probe_resp(struc buflen += hostapd_eid_owe_trans_len(hapd); buflen += hostapd_eid_dpp_cc_len(hapd); if (hapd->iconf->multiple_bssid) @@ -51,7 +51,32 @@ index f3862dbb17f1..808a2d939cbe 100644 resp = os_zalloc(buflen); if (resp == NULL) -@@ -535,7 +539,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -502,9 +506,21 @@ static u8 * hostapd_gen_probe_resp(struc + + pos = resp->u.probe_resp.variable; + *pos++ = WLAN_EID_SSID; +- *pos++ = hapd->conf->ssid.ssid_len; +- os_memcpy(pos, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len); +- pos += hapd->conf->ssid.ssid_len; ++ if (hapd->iconf->multiple_bssid && hidden && ++ hapd->conf->ignore_broadcast_ssid == 2) { ++ /* clear the data, but keep the correct length of the SSID */ ++ *pos++ = hapd->conf->ssid.ssid_len; ++ os_memset(pos, 0, hapd->conf->ssid.ssid_len); ++ pos += hapd->conf->ssid.ssid_len; ++ } else if (hapd->iconf->multiple_bssid && hidden && ++ hapd->conf->ignore_broadcast_ssid) { ++ *pos++ = 0; /* empty SSID */ ++ } else { ++ *pos++ = hapd->conf->ssid.ssid_len; ++ os_memcpy(pos, hapd->conf->ssid.ssid, ++ hapd->conf->ssid.ssid_len); ++ pos += hapd->conf->ssid.ssid_len; ++ } + + /* Supported rates */ + pos = hostapd_eid_supp_rates(hapd, pos); +@@ -535,7 +551,8 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_get_mde(hapd, pos, epos - pos); if (hapd->iconf->multiple_bssid) @@ -61,7 +86,7 @@ index f3862dbb17f1..808a2d939cbe 100644 /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); -@@ -837,10 +842,6 @@ void handle_probe_req(struct hostapd_data *hapd, +@@ -847,10 +864,6 @@ void handle_probe_req(struct hostapd_dat .frame_info = fi, }; @@ -72,7 +97,7 @@ index f3862dbb17f1..808a2d939cbe 100644 if (len < IEEE80211_HDRLEN) return; ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; -@@ -1067,6 +1068,10 @@ void handle_probe_req(struct hostapd_data *hapd, +@@ -1077,6 +1090,10 @@ void handle_probe_req(struct hostapd_dat wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR " signal=%d", MAC2STR(mgmt->sa), ssi_signal); @@ -83,7 +108,7 @@ index f3862dbb17f1..808a2d939cbe 100644 resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, &resp_len); if (resp == NULL) -@@ -1770,7 +1775,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1754,7 +1771,7 @@ int ieee802_11_build_ap_params(struct ho } if (hapd->iconf->multiple_bssid) { @@ -92,7 +117,7 @@ index f3862dbb17f1..808a2d939cbe 100644 u8 *end; params->multiple_bssid_index = hostapd_get_bss_index(hapd); -@@ -1778,7 +1783,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1762,7 +1779,8 @@ int ieee802_11_build_ap_params(struct ho params->multiple_bssid_ies = os_zalloc(len); if (params->multiple_bssid_ies == NULL) return -1; @@ -102,11 +127,11 @@ index f3862dbb17f1..808a2d939cbe 100644 params->multiple_bssid_ies + len, 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 88c06d43d341..ffbadc535711 100644 ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -5651,24 +5651,35 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid) +Index: hostapd-2021-02-20/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-20/src/ap/ieee802_11.c +@@ -6968,24 +6968,35 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, @@ -146,7 +171,7 @@ index 88c06d43d341..ffbadc535711 100644 if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) nontx_profile_len += ies_len; -@@ -5686,21 +5697,27 @@ multiple_bssid_too_big: +@@ -7003,21 +7014,27 @@ multiple_bssid_too_big: } @@ -176,7 +201,7 @@ index 88c06d43d341..ffbadc535711 100644 u8 *size_offset, *num_offset; int i; -@@ -5709,7 +5726,8 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +@@ -7026,7 +7043,8 @@ static u8 * hostapd_eid_multiple_bssid_c num_offset = eid++; for (i = *count; i < hapd->iface->num_bss; i++) { @@ -186,7 +211,7 @@ index 88c06d43d341..ffbadc535711 100644 u8 *bss_size_offset, *index_size_offset, *pos = eid; u16 capab_info; -@@ -5723,16 +5741,24 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +@@ -7040,16 +7058,24 @@ static u8 * hostapd_eid_multiple_bssid_c eid += sizeof(capab_info); *eid++ = WLAN_EID_SSID; @@ -215,7 +240,7 @@ index 88c06d43d341..ffbadc535711 100644 *eid++ = 0xFF; } *index_size_offset = (eid - index_size_offset) - 1; -@@ -5758,7 +5784,8 @@ multiple_bssid_too_big: +@@ -7075,7 +7101,8 @@ multiple_bssid_too_big: } @@ -225,7 +250,7 @@ index 88c06d43d341..ffbadc535711 100644 u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max, u8 ema_beacon) { -@@ -5777,8 +5804,9 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, +@@ -7094,8 +7121,9 @@ u8 * hostapd_eid_multiple_bssid(struct h eid_offsets[*eid_count] = eid; *eid_count = *eid_count + 1; } @@ -236,12 +261,12 @@ index 88c06d43d341..ffbadc535711 100644 + dtim_offset); } - if (!eid_count) -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 9fbe89ed7c8e..1145210dbfc7 100644 ---- a/src/ap/ieee802_11.h -+++ b/src/ap/ieee802_11.h -@@ -119,10 +119,13 @@ u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid); + if (!eid_count || !(*eid_count)) { +Index: hostapd-2021-02-20/src/ap/ieee802_11.h +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-20/src/ap/ieee802_11.h +@@ -119,10 +119,13 @@ u8 * hostapd_eid_time_zone(struct hostap int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); @@ -257,6 +282,3 @@ index 9fbe89ed7c8e..1145210dbfc7 100644 u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch index 2fe290398..668ff5020 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch @@ -1,4 +1,4 @@ -From 147810b51909c31fe9483190996190b6a89252fd Mon Sep 17 00:00:00 2001 +From 101daf566661f208f78081de2d7d4040141ea5e1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 6 Oct 2020 15:03:13 -0700 Subject: [PATCH 1/4] co-located: add a config option to indicate co locate @@ -14,25 +14,25 @@ Signed-off-by: John Crispin 3 files changed, 6 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 0638b675bc34..18fc13569bc3 100644 +index 0bdf526..bbdd969 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3612,6 +3612,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, - "unsol_bcast_probe_resp_interval") == 0) { - bss->unsol_bcast_probe_resp_interval = - (atoi(pos) > 20) ? 20 : atoi(pos); +@@ -3642,6 +3642,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + return 1; + } + bss->unsol_bcast_probe_resp_interval = val; + } else if (os_strcmp(buf, "he_co_locate") == 0) { + conf->he_co_locate = atoi(pos); #endif /* CONFIG_IEEE80211AX */ } else if (os_strcmp(buf, "max_listen_interval") == 0) { bss->max_listen_interval = atoi(pos); diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index d593bba97c83..48207af9b0b5 100644 +index ef26fe3..7c371cb 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -571,6 +571,9 @@ wmm_ac_vo_acm=0 - # Default: 1 (enabled) - #broadcast_deauth=1 +@@ -577,6 +577,9 @@ wmm_ac_vo_acm=0 + # Default: 0 (disabled) + #notify_mgmt_frames=0 +# Enable co-locate for a 6GHz radio +#co_locate=0 @@ -41,22 +41,21 @@ index d593bba97c83..48207af9b0b5 100644 # ieee80211n: Whether IEEE 802.11n (HT) is enabled diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 440384136b74..0c1afced5cfe 100644 +index 95e44fa..5ae9187 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1046,6 +1046,7 @@ struct hostapd_config { - u8 he_oper_chwidth; - u8 he_oper_centr_freq_seg0_idx; - u8 he_oper_centr_freq_seg1_idx; +@@ -1066,6 +1066,7 @@ struct hostapd_config { + u8 he_6ghz_max_ampdu_len_exp; + u8 he_6ghz_rx_ant_pat; + u8 he_6ghz_tx_ant_pat; + bool he_co_locate; #endif /* CONFIG_IEEE80211AX */ - #ifdef CONFIG_IEEE80211AX + /* VHT enable/disable config from CHAN_SWITCH */ -- 2.7.4 - -From 7624ae547dc5623a8e9e7d7e891b5968f73cf9db Mon Sep 17 00:00:00 2001 +From e9263d5c0a8e166e025a63f823288266d1085942 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 6 Oct 2020 15:05:24 -0700 Subject: [PATCH 2/4] neighbor_db: set the co-locate bit @@ -71,7 +70,7 @@ Signed-off-by: John Crispin 2 files changed, 5 insertions(+) diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index 06f6691342a0..2e63bebc5f13 100644 +index ce6cfa9..6a0e8c3 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c @@ -282,6 +282,9 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) @@ -85,10 +84,10 @@ index 06f6691342a0..2e63bebc5f13 100644 if (ieee80211_freq_to_channel_ext(hapd->iface->freq, diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index b7d0787280e9..94dd677b3308 100644 +index 8c73156..3a2cb6c 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2128,6 +2128,8 @@ enum phy_type { +@@ -2145,6 +2145,8 @@ enum phy_type { #define NEI_REP_BSSID_INFO_VHT BIT(12) #define NEI_REP_BSSID_INFO_FTM BIT(13) #define NEI_REP_BSSID_INFO_HE BIT(14) @@ -100,8 +99,7 @@ index b7d0787280e9..94dd677b3308 100644 -- 2.7.4 - -From a2ec27dae137affda5f033c0dc26d3cf6a5ca6ed Mon Sep 17 00:00:00 2001 +From 92d786ddb2568b688ed4d25e32f3987e926c0ca4 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 21 Sep 2020 13:50:58 +0200 Subject: [PATCH 3/4] rrm: add handling for co-located BSS @@ -115,7 +113,7 @@ Signed-off-by: John Crispin 1 file changed, 74 insertions(+), 43 deletions(-) diff --git a/src/ap/rrm.c b/src/ap/rrm.c -index f2d5cd16e885..c9d51dfa7132 100644 +index f2d5cd1..c9d51df 100644 --- a/src/ap/rrm.c +++ b/src/ap/rrm.c @@ -196,6 +196,63 @@ static size_t hostapd_neighbor_report_len(struct wpabuf *buf, @@ -263,8 +261,7 @@ index f2d5cd16e885..c9d51dfa7132 100644 -- 2.7.4 - -From 9e0865b8135bf1286c864ae3da601c40e3325153 Mon Sep 17 00:00:00 2001 +From fe0833e906559efb41ec9ee3f3e77049b968e6aa Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 21 Oct 2020 11:47:22 -0700 Subject: [PATCH 4/4] rnr: add reduced neighbor reporting @@ -276,14 +273,14 @@ Signed-off-by: John Crispin Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada --- - src/ap/beacon.c | 40 ++++++++-- + src/ap/beacon.c | 40 +++++++++- src/ap/ieee802_11.c | 177 ++++++++++++++++++++++++++++++++----------- src/ap/ieee802_11.h | 4 +- src/common/ieee802_11_defs.h | 6 +- - 4 files changed, 171 insertions(+), 56 deletions(-) + 4 files changed, 173 insertions(+), 54 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 808a2d939cbe..b6592f219e65 100644 +index 769e0d0..8afaf7a 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -481,6 +481,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, @@ -295,7 +292,7 @@ index 808a2d939cbe..b6592f219e65 100644 resp = os_zalloc(buflen); if (resp == NULL) -@@ -639,6 +641,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -645,6 +647,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); @@ -304,7 +301,7 @@ index 808a2d939cbe..b6592f219e65 100644 if (hapd->conf->vendor_elements) { os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -654,7 +658,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -660,7 +664,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, enum ssid_match_result { NO_SSID_MATCH, EXACT_SSID_MATCH, @@ -314,7 +311,7 @@ index 808a2d939cbe..b6592f219e65 100644 }; static enum ssid_match_result ssid_match(struct hostapd_data *hapd, -@@ -666,6 +671,7 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, +@@ -672,6 +677,7 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, { const u8 *pos, *end; int wildcard = 0; @@ -322,7 +319,7 @@ index 808a2d939cbe..b6592f219e65 100644 if (ssid_len == 0) wildcard = 1; -@@ -699,6 +705,25 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, +@@ -705,6 +711,25 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, } } @@ -348,7 +345,7 @@ index 808a2d939cbe..b6592f219e65 100644 return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; } -@@ -1069,7 +1094,8 @@ void handle_probe_req(struct hostapd_data *hapd, +@@ -1079,7 +1104,8 @@ void handle_probe_req(struct hostapd_data *hapd, " signal=%d", MAC2STR(mgmt->sa), ssi_signal); if (hapd->iconf->multiple_bssid && @@ -358,25 +355,25 @@ index 808a2d939cbe..b6592f219e65 100644 return; resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, -@@ -1343,7 +1369,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) +@@ -1318,6 +1344,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) total_len += 3; } -- total_len += hostapd_eid_reduced_neighbor_report_len(hapd); + total_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); - ++ pos = hostapd_eid_fils_indic(hapd, buf, 0); buf_len = pos - buf; -@@ -1401,7 +1427,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, u32 *len) + total_len += buf_len; +@@ -1386,6 +1414,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) + /* Fill in the Length field value */ *length_pos = pos - (length_pos + 1); - /* Reduced Neighbor Report element */ -- pos = hostapd_eid_reduced_neighbor_report(hapd, pos); + pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 0); - - /* FILS indication element */ ++ + /* FILS Indication element */ if (buf_len) { -@@ -1496,7 +1522,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + os_memcpy(pos, buf, buf_len); +@@ -1475,7 +1505,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); @@ -386,7 +383,7 @@ index 808a2d939cbe..b6592f219e65 100644 tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1668,7 +1695,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1654,7 +1685,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tailpos = hostapd_eid_owe_trans(hapd, tailpos, tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); @@ -397,10 +394,10 @@ index 808a2d939cbe..b6592f219e65 100644 if (hapd->conf->vendor_elements) { os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 9c0f38fc0bf1..3be299a477b9 100644 +index 668c4db..408c764 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5841,14 +5841,45 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +@@ -7158,14 +7158,45 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, } @@ -449,7 +446,7 @@ index 9c0f38fc0bf1..3be299a477b9 100644 if (len) len += 2; /* Element ID and length */ -@@ -5856,58 +5887,76 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) +@@ -7173,58 +7204,76 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) } @@ -547,7 +544,7 @@ index 9c0f38fc0bf1..3be299a477b9 100644 + + *eid++ = bss_param; + /* Setting 20 MHz PSD */ -+ *eid++ = TBTT_PSD_MAX_TXPOWER; ++ *eid++ = TBTT_PSD_MAX_TXPOWER - 1; + *count += 1; + tbtt_count++; } @@ -568,13 +565,13 @@ index 9c0f38fc0bf1..3be299a477b9 100644 dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { if (!nr->nr || wpabuf_len(nr->nr) < 12) -@@ -5924,9 +5973,45 @@ nr_db: +@@ -7241,9 +7290,45 @@ nr_db: os_memcpy(eid, &nr->short_ssid, 4); eid += 4; *eid++ = nr->bss_parameters; - count++; + /* setting 20 MHZ PSD */ -+ *eid++ = TBTT_PSD_MAX_TXPOWER; ++ *eid++ = TBTT_PSD_MAX_TXPOWER - 1; + *count += 1; } @@ -616,7 +613,7 @@ index 9c0f38fc0bf1..3be299a477b9 100644 eid -= 2; else diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 1145210dbfc7..2f45b615f15d 100644 +index 1145210..2f45b61 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -126,8 +126,8 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, @@ -631,10 +628,10 @@ index 1145210dbfc7..2f45b615f15d 100644 #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 94dd677b3308..2ac497db067e 100644 +index 3a2cb6c..4c438dd 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2393,7 +2393,7 @@ enum edmg_bw_config { +@@ -2441,7 +2441,7 @@ enum mscs_description_subelem { /* TBTT Information field defines */ #define TBTT_HEADER_LENGTH 4 @@ -643,7 +640,7 @@ index 94dd677b3308..2ac497db067e 100644 #define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) #define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) #define TBTT_AP_OFFSET_UNKNOWN 255 -@@ -2401,7 +2401,9 @@ enum edmg_bw_config { +@@ -2449,7 +2449,9 @@ enum mscs_description_subelem { #define TBTT_BSS_PARAM_SAME_SSID BIT(1) #define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) #define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) diff --git a/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch b/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch new file mode 100644 index 000000000..a72f24760 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch @@ -0,0 +1,47 @@ +From dadbaf6d113470f6b013dd5cbd0d734634f3d5f9 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Tue, 5 Jan 2021 01:32:39 +0530 +Subject: [PATCH] hostapd: update 160MHz center freq calculation in 6GHz + +In 6G Operation channel information, The Channel Center Frequency +Segment 0 field indicates the channel center frequency index for +the 20 MHz, 40 MHz or 80 MHz, or 80+80 MHz channel on which the +BSS operates in the 6 GHz band. If the BSS channel width is 160 MHz +then the Channel Center Frequency Segment 0 field indicates the +channel center frequency index of the primary 80 MHz. + +The Channel Center Frequency Segment 1 field indicates the channel +center frequency index of the 160 MHz channel on which the BSS operates +in the 6 GHz band. + +Since Channel Center Frequency Segment 1 is 0 for 160MHz, some of the +6G third party clients associated in 80MHz. Hence updated seg0 and +seg1 field as per standard (Draft P802.11_ax_D7.0). + +Signed-off-by: P Praneesh +--- + src/ap/ieee802_11_he.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c +index 8391f94..18436a6 100644 +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -233,6 +233,14 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) + *pos++ = center_idx_to_bw_6ghz(seg0); + + /* Channel Center Freq Seg0/Seg1 */ ++ if (hapd->iconf->he_oper_chwidth == 2) { ++ seg1 = seg0; ++ if (hapd->iconf->channel < seg0) ++ seg0 -= 8; ++ else ++ seg0 += 8; ++ } ++ + *pos++ = seg0; + *pos++ = seg1; + /* Minimum Rate */ +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch b/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch new file mode 100644 index 000000000..9a03c58ca --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch @@ -0,0 +1,142 @@ +From d4c4ef302f98fd6bce173b8636e7e350d8b44981 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Fri, 19 Mar 2021 12:17:27 +0530 +Subject: [PATCH] hostapd: update cfs0 and cfs1 for 160MHz + +As per standard Draft P802.11ax_D8.0,( Table 26-9—Setting +of the VHT Channel Width and VHT NSS at an HE STA +transmitting the OM Control subfield ), center frequency of +160MHz should be published in HT information subset 2 of +HT information when EXT NSS BW field is enabled. + +If the supported number of NSS in 160MHz is at least max NSS +support, then center_freq_seg0 indicates the center frequency of 80MHz and +center_freq_seg1 indicates the center frequency of 160MHz. + +If the supported number of NSS in 160MHz is less than max NSS +support, then center_freq_seg0 indicates the center frequency of 80MHz and +center_freq_seg1 is 0. The center frequency of 160MHz is published in HT +operation information element instead. + +Signed-off-by: P Praneesh +--- + hostapd/config_file.c | 2 ++ + src/ap/ieee802_11_ht.c | 7 +++++++ + src/ap/ieee802_11_vht.c | 16 ++++++++++++++++ + src/common/hw_features_common.c | 1 + + src/common/ieee802_11_defs.h | 1 + + 5 files changed, 27 insertions(+) + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -1195,6 +1195,8 @@ static int hostapd_config_vht_capab(stru + conf->vht_capab |= VHT_CAP_RX_ANTENNA_PATTERN; + if (os_strstr(capab, "[TX-ANTENNA-PATTERN]")) + conf->vht_capab |= VHT_CAP_TX_ANTENNA_PATTERN; ++ if (os_strstr(capab, "[EXT-NSS-BW-SUPP]")) ++ conf->vht_capab |= VHT_CAP_EXTENDED_NSS_BW_SUPPORT; + return 0; + } + #endif /* CONFIG_IEEE80211AC */ +--- a/src/ap/ieee802_11_ht.c ++++ b/src/ap/ieee802_11_ht.c +@@ -82,7 +82,9 @@ u8 * hostapd_eid_ht_capabilities(struct + u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid) + { + struct ieee80211_ht_operation *oper; ++ le32 vht_capabilities_info; + u8 *pos = eid; ++ u8 chwidth; + + if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n || + is_6ghz_op_class(hapd->iconf->op_class)) +@@ -103,6 +105,13 @@ u8 * hostapd_eid_ht_operation(struct hos + oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW | + HT_INFO_HT_PARAM_STA_CHNL_WIDTH; + ++ vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab); ++ chwidth = hostapd_get_oper_chwidth(hapd->iconf); ++ if (vht_capabilities_info & VHT_CAP_EXTENDED_NSS_BW_SUPPORT ++ && ((chwidth == CHANWIDTH_160MHZ) || (chwidth == CHANWIDTH_80P80MHZ))) { ++ oper->operation_mode = host_to_le16(hapd->iconf->vht_oper_centr_freq_seg0_idx << 5); ++ } ++ + pos += sizeof(*oper); + + return pos; +--- a/src/ap/ieee802_11_vht.c ++++ b/src/ap/ieee802_11_vht.c +@@ -25,6 +25,7 @@ u8 * hostapd_eid_vht_capabilities(struct + struct ieee80211_vht_capabilities *cap; + struct hostapd_hw_modes *mode = hapd->iface->current_mode; + u8 *pos = eid; ++ u8 chwidth; + + if (!mode || is_6ghz_op_class(hapd->iconf->op_class)) + return eid; +@@ -62,6 +63,17 @@ u8 * hostapd_eid_vht_capabilities(struct + host_to_le32(nsts << VHT_CAP_BEAMFORMEE_STS_OFFSET); + } + ++ chwidth = hostapd_get_oper_chwidth(hapd->iconf); ++ if (((host_to_le32(mode->vht_capab)) & VHT_CAP_EXTENDED_NSS_BW_SUPPORT) ++ && ((chwidth == CHANWIDTH_160MHZ) || (chwidth == CHANWIDTH_80P80MHZ))) { ++ cap->vht_capabilities_info |= VHT_CAP_EXTENDED_NSS_BW_SUPPORT; ++ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)); ++ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_160MHZ)); ++ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_MASK)); ++ } else { ++ cap->vht_capabilities_info &= ~VHT_CAP_EXTENDED_NSS_BW_SUPPORT_MASK; ++ } ++ + /* Supported MCS set comes from hw */ + os_memcpy(&cap->vht_supported_mcs_set, mode->vht_mcs_set, 8); + +@@ -74,6 +86,7 @@ u8 * hostapd_eid_vht_capabilities(struct + u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid) + { + struct ieee80211_vht_operation *oper; ++ le32 vht_capabilities_info; + u8 *pos = eid; + + if (is_6ghz_op_class(hapd->iconf->op_class)) +@@ -96,6 +109,7 @@ u8 * hostapd_eid_vht_operation(struct ho + hapd->iconf->vht_oper_centr_freq_seg1_idx; + + oper->vht_op_info_chwidth = hapd->iconf->vht_oper_chwidth; ++ vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab); + if (hapd->iconf->vht_oper_chwidth == 2) { + /* + * Convert 160 MHz channel width to new style as interop +@@ -109,6 +123,10 @@ u8 * hostapd_eid_vht_operation(struct ho + oper->vht_op_info_chan_center_freq_seg0_idx -= 8; + else + oper->vht_op_info_chan_center_freq_seg0_idx += 8; ++ ++ if (vht_capabilities_info & VHT_CAP_EXTENDED_NSS_BW_SUPPORT) ++ oper->vht_op_info_chan_center_freq_seg1_idx = 0; ++ + } else if (hapd->iconf->vht_oper_chwidth == 3) { + /* + * Convert 80+80 MHz channel width to new style as interop +--- a/src/common/hw_features_common.c ++++ b/src/common/hw_features_common.c +@@ -740,6 +740,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co + VHT_CAP_CHECK(VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB); + VHT_CAP_CHECK(VHT_CAP_RX_ANTENNA_PATTERN); + VHT_CAP_CHECK(VHT_CAP_TX_ANTENNA_PATTERN); ++ VHT_CAP_CHECK(VHT_CAP_EXTENDED_NSS_BW_SUPPORT); + + #undef VHT_CAP_CHECK + #undef VHT_CAP_CHECK_MAX +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -1304,6 +1304,8 @@ struct ieee80211_ampe_ie { + #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27)) + #define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28)) + #define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29)) ++#define VHT_CAP_EXTENDED_NSS_BW_SUPPORT ((u32) BIT(30)) ++#define VHT_CAP_EXTENDED_NSS_BW_SUPPORT_MASK ((u32) BIT(30) | BIT(31)) + + #define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1)) + #define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \ diff --git a/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch index 262dd55f6..eca545977 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch @@ -57,7 +57,7 @@ Signed-off-by: John Crispin } -@@ -3698,6 +3703,119 @@ hostapd_switch_channel_fallback(struct h +@@ -3713,6 +3718,119 @@ hostapd_switch_channel_fallback(struct h hostapd_enable_iface(iface); } @@ -211,7 +211,7 @@ Signed-off-by: John Crispin int (*cb)(void *ctx, const u8 *sa, --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2275,6 +2275,7 @@ struct ieee80211_spatial_reuse { +@@ -2280,6 +2280,7 @@ struct ieee80211_spatial_reuse { #define HE_OPERATION_BSS_COLOR_PARTIAL ((u32) BIT(30)) #define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(31)) #define HE_OPERATION_BSS_COLOR_OFFSET 24 @@ -219,9 +219,9 @@ Signed-off-by: John Crispin /* Spatial Reuse defines */ #define SPATIAL_REUSE_SRP_DISALLOWED BIT(0) -@@ -2402,4 +2403,9 @@ enum edmg_bw_config { - #define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) - #define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) +@@ -2430,4 +2431,9 @@ enum mscs_description_subelem { + #define TBTT_BSS_PARAM_CO_LOCATED BIT(6) + #define TBTT_PSD_MAX_TXPOWER 255 /* dBm */ +/* IEEE802.11/D6.0 - 26.17.3.5.1 + * the minimum default timeout between color collision and color change is defined as 50s @@ -231,7 +231,7 @@ Signed-off-by: John Crispin #endif /* IEEE802_11_DEFS_H */ --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -2400,6 +2400,26 @@ struct csa_settings { +@@ -2417,6 +2417,26 @@ struct csa_settings { u16 counter_offset_presp[2]; }; @@ -258,7 +258,7 @@ Signed-off-by: John Crispin /* TDLS peer capabilities for send_tdls_mgmt() */ enum tdls_peer_capability { TDLS_PEER_HT = BIT(0), -@@ -3972,6 +3992,17 @@ struct wpa_driver_ops { +@@ -3989,6 +4009,17 @@ struct wpa_driver_ops { int (*switch_channel)(void *priv, struct csa_settings *settings); /** diff --git a/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch b/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch deleted file mode 100644 index 6cbce368d..000000000 --- a/feeds/wifi-ax/hostapd/patches/f00-001-hostapd-Fix-calling-hostapd_disassoc_accept_mac-in-CLI.patch +++ /dev/null @@ -1,46 +0,0 @@ -From aa394e37a56eaed0a575b8a1a34ebc31ca06af42 Mon Sep 17 00:00:00 2001 -From: Nishant Pandey -Date: Tue, 22 Sep 2020 14:07:05 +0530 -Subject: [PATCH] hostapd: Fix calling hostapd_disassoc_accept_mac in CLI - command - -Calling hostapd_disassoc_accept_mac is not needed when we add mac -address to accept list and it is required to be called when any of -the mac address is deleted from accept mac list - -Signed-off-by: Nishant Pandey ---- - hostapd/ctrl_iface.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index 584aee2..66c63a0 100644 ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -3709,16 +3709,16 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, - eloop_terminate(); - } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) { - if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { -- if (!hostapd_ctrl_iface_acl_add_mac( -- &hapd->conf->accept_mac, -- &hapd->conf->num_accept_mac, buf + 19)) -+ hostapd_ctrl_iface_acl_add_mac( -+ &hapd->conf->accept_mac, -+ &hapd->conf->num_accept_mac, buf + 19); -+ } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { -+ if (!hostapd_ctrl_iface_acl_del_mac( -+ &hapd->conf->accept_mac, -+ &hapd->conf->num_accept_mac, buf + 19)) - hostapd_disassoc_accept_mac(hapd); - else - reply_len = -1; -- } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { -- hostapd_ctrl_iface_acl_del_mac( -- &hapd->conf->accept_mac, -- &hapd->conf->num_accept_mac, buf + 19); - } else if (os_strcmp(buf + 11, "SHOW") == 0) { - reply_len = hostapd_ctrl_iface_acl_show_mac( - hapd->conf->accept_mac, --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch index ba73fa28a..1075b9141 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch @@ -15,14 +15,14 @@ Signed-off-by: John Crispin src/common/ieee802_11_defs.h | 1 + 4 files changed, 28 insertions(+) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index c59842edc..b59e34623 100644 ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c -@@ -580,11 +580,17 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +Index: hostapd-2021-02-08/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-08.orig/src/ap/beacon.c ++++ hostapd-2021-02-08/src/ap/beacon.c +@@ -592,11 +592,17 @@ static u8 * hostapd_gen_probe_resp(struc #ifdef CONFIG_IEEE80211AX - if (hapd->iconf->ieee80211ax) { + if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax) { + u8 *cca_pos; + pos = hostapd_eid_he_capab(hapd, pos, IEEE80211_MODE_AP); @@ -37,10 +37,10 @@ index c59842edc..b59e34623 100644 } #endif /* CONFIG_IEEE80211AX */ -@@ -1308,12 +1314,18 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1646,12 +1652,18 @@ int ieee802_11_build_ap_params(struct ho #ifdef CONFIG_IEEE80211AX - if (hapd->iconf->ieee80211ax) { + if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax) { + u8 *cca_pos; + tailpos = hostapd_eid_he_capab(hapd, tailpos, @@ -56,11 +56,11 @@ index c59842edc..b59e34623 100644 } #endif /* CONFIG_IEEE80211AX */ -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 11fd1245c..17b4cfe39 100644 ---- a/src/ap/ieee802_11.h -+++ b/src/ap/ieee802_11.h -@@ -100,6 +100,7 @@ u16 copy_sta_he_6ghz_capab(struct hostapd_data *hapd, struct sta_info *sta, +Index: hostapd-2021-02-08/src/ap/ieee802_11.h +=================================================================== +--- hostapd-2021-02-08.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-08/src/ap/ieee802_11.h +@@ -100,6 +100,7 @@ u16 copy_sta_he_6ghz_capab(struct hostap const u8 *he_6ghz_capab); int hostapd_get_he_twt_responder(struct hostapd_data *hapd, enum ieee80211_op_mode mode); @@ -68,11 +68,11 @@ index 11fd1245c..17b4cfe39 100644 void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr, const u8 *buf, size_t len, int ack); void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst, -diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c -index 85b714090..049ac7f0e 100644 ---- a/src/ap/ieee802_11_he.c -+++ b/src/ap/ieee802_11_he.c -@@ -483,3 +483,17 @@ int hostapd_get_he_twt_responder(struct hostapd_data *hapd, +Index: hostapd-2021-02-08/src/ap/ieee802_11_he.c +=================================================================== +--- hostapd-2021-02-08.orig/src/ap/ieee802_11_he.c ++++ hostapd-2021-02-08/src/ap/ieee802_11_he.c +@@ -521,3 +521,17 @@ int hostapd_get_he_twt_responder(struct return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER); } @@ -90,11 +90,11 @@ index 85b714090..049ac7f0e 100644 + + return eid; +} -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 5b834c5c8..16f517ac6 100644 ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -475,6 +475,7 @@ +Index: hostapd-2021-02-08/src/common/ieee802_11_defs.h +=================================================================== +--- hostapd-2021-02-08.orig/src/common/ieee802_11_defs.h ++++ hostapd-2021-02-08/src/common/ieee802_11_defs.h +@@ -480,6 +480,7 @@ #define WLAN_EID_EXT_HE_OPERATION 36 #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 #define WLAN_EID_EXT_SPATIAL_REUSE 39 diff --git a/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch index 6d1645155..ed085e5e8 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch @@ -18,8 +18,6 @@ Signed-off-by: Nishant Pandey src/ap/ieee802_11.h | 9 +++ 7 files changed, 260 insertions(+), 234 deletions(-) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 3fe1792..a81553b 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -23,6 +23,7 @@ @@ -30,7 +28,7 @@ index 3fe1792..a81553b 100644 #include "config_file.h" -@@ -118,124 +119,6 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, +@@ -118,124 +119,6 @@ static int hostapd_config_read_vlan_file #endif /* CONFIG_NO_VLAN */ @@ -155,11 +153,9 @@ index 3fe1792..a81553b 100644 #ifdef EAP_SERVER -diff --git a/hostapd/config_file.h b/hostapd/config_file.h -index 9830f5a..c98bdb6 100644 --- a/hostapd/config_file.h +++ b/hostapd/config_file.h -@@ -13,10 +13,5 @@ struct hostapd_config * hostapd_config_read(const char *fname); +@@ -13,10 +13,5 @@ struct hostapd_config * hostapd_config_r int hostapd_set_iface(struct hostapd_config *conf, struct hostapd_bss_config *bss, const char *field, char *value); @@ -170,11 +166,9 @@ index 9830f5a..c98bdb6 100644 - const u8 *addr); #endif /* CONFIG_FILE_H */ -diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index 66c63a0..60e549f 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -1309,42 +1309,6 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd, +@@ -1310,42 +1310,6 @@ static int hostapd_ctrl_iface_get_config } @@ -217,7 +211,7 @@ index 66c63a0..60e549f 100644 static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, const char *band) -@@ -3287,81 +3251,6 @@ static int hostapd_ctrl_driver_flags2(struct hostapd_iface *iface, char *buf, +@@ -3301,81 +3265,6 @@ static int hostapd_ctrl_driver_flags2(st return pos - buf; } @@ -299,8 +293,6 @@ index 66c63a0..60e549f 100644 static int hostapd_ctrl_iface_get_capability(struct hostapd_data *hapd, const char *field, char *buf, size_t buflen) -diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c -index c9f5c1a..4a03ec4 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -24,6 +24,7 @@ @@ -311,7 +303,7 @@ index c9f5c1a..4a03ec4 100644 #ifdef CONFIG_CTRL_IFACE_MIB -@@ -637,6 +638,164 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, +@@ -637,6 +638,164 @@ static int p2p_manager_disconnect(struct #endif /* CONFIG_P2P_MANAGER */ @@ -476,11 +468,9 @@ index c9f5c1a..4a03ec4 100644 int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, const char *txtaddr) { -diff --git a/src/ap/ctrl_iface_ap.h b/src/ap/ctrl_iface_ap.h -index d1dcebf..55f1c63 100644 --- a/src/ap/ctrl_iface_ap.h +++ b/src/ap/ctrl_iface_ap.h -@@ -36,5 +36,15 @@ int hostapd_ctrl_iface_pmksa_add(struct hostapd_data *hapd, char *cmd); +@@ -36,5 +36,15 @@ int hostapd_ctrl_iface_pmksa_add(struct int hostapd_ctrl_iface_pmksa_list_mesh(struct hostapd_data *hapd, const u8 *addr, char *buf, size_t len); void * hostapd_ctrl_iface_pmksa_create_entry(const u8 *aa, char *cmd); @@ -496,11 +486,9 @@ index d1dcebf..55f1c63 100644 +int hostapd_disassoc_deny_mac(struct hostapd_data *hapd); #endif /* CTRL_IFACE_AP_H */ -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 65a556e..0963b48 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5650,6 +5650,87 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid) +@@ -5672,6 +5672,87 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct } @@ -586,10 +574,8 @@ index 65a556e..0963b48 100644 + + static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, - int *count) - { -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 9ccfe6c..c02beae 100644 + struct hostapd_data *hidden, + int *count, --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -18,6 +18,7 @@ struct ieee80211_vht_capabilities; @@ -600,7 +586,7 @@ index 9ccfe6c..c02beae 100644 int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, struct hostapd_frame_info *fi); -@@ -25,6 +26,14 @@ void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len, +@@ -25,6 +26,14 @@ void ieee802_11_mgmt_cb(struct hostapd_d u16 stype, int ok); void hostapd_2040_coex_action(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len); @@ -615,6 +601,3 @@ index 9ccfe6c..c02beae 100644 #ifdef NEED_AP_MLME int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen); int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch index 8c93a5a08..567e0d7a6 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch @@ -18,10 +18,10 @@ Signed-off-by: Nishant Pandey wpa_supplicant/wpa_supplicant.conf | 14 ++++++++++++++ 6 files changed, 82 insertions(+), 1 deletion(-) -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index aa9953b..aa6c493 100644 ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c +Index: hostapd-2021-02-08/wpa_supplicant/config.c +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/config.c ++++ hostapd-2021-02-08/wpa_supplicant/config.c @@ -20,7 +20,9 @@ #include "drivers/nl80211_copy.h" #include "fst/fst.h" @@ -33,7 +33,7 @@ index aa9953b..aa6c493 100644 #if !defined(CONFIG_CTRL_IFACE) && defined(CONFIG_NO_CONFIG_WRITE) #define NO_CONFIG_WRITE -@@ -2656,6 +2658,9 @@ static const struct parse_data ssid_fields[] = { +@@ -2710,6 +2712,9 @@ static const struct parse_data ssid_fiel { INT(dot11MeshRetryTimeout) }, { INT(dot11MeshConfirmTimeout) }, { INT(dot11MeshHoldingTimeout) }, @@ -43,16 +43,16 @@ index aa9953b..aa6c493 100644 #endif /* CONFIG_MESH */ { INT(wpa_ptk_rekey) }, { INT_RANGE(wpa_deny_ptk0_rekey, 0, 2) }, -@@ -2928,6 +2933,8 @@ void wpa_config_free_ssid(struct wpa_ssid *ssid) +@@ -2980,6 +2985,8 @@ void wpa_config_free_ssid(struct wpa_ssi os_free(ssid->p2p_client_list); - os_free(ssid->bssid_blacklist); - os_free(ssid->bssid_whitelist); + os_free(ssid->bssid_ignore); + os_free(ssid->bssid_accept); + os_free(ssid->accept_mac_file); + os_free(ssid->deny_mac_file); #ifdef CONFIG_HT_OVERRIDES os_free(ssid->ht_mcs); #endif /* CONFIG_HT_OVERRIDES */ -@@ -3288,6 +3295,18 @@ int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value, +@@ -3344,6 +3351,18 @@ int wpa_config_set(struct wpa_ssid *ssid } ret = -1; } @@ -71,10 +71,10 @@ index aa9953b..aa6c493 100644 #ifdef CONFIG_SAE if (os_strcmp(var, "ssid") == 0 || os_strcmp(var, "psk") == 0 || -diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c -index 21e77f8..b185fd5 100644 ---- a/wpa_supplicant/config_file.c -+++ b/wpa_supplicant/config_file.c +Index: hostapd-2021-02-08/wpa_supplicant/config_file.c +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/config_file.c ++++ hostapd-2021-02-08/wpa_supplicant/config_file.c @@ -18,6 +18,9 @@ #include "common.h" #include "config.h" @@ -85,7 +85,7 @@ index 21e77f8..b185fd5 100644 #include "uuid.h" #include "common/ieee802_1x_defs.h" #include "p2p/p2p.h" -@@ -913,6 +916,9 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) +@@ -914,6 +917,9 @@ static void wpa_config_write_network(FIL write_int(f, "mac_addr", ssid->mac_addr, -1); #ifdef CONFIG_MESH STR(mesh_basic_rates); @@ -95,10 +95,10 @@ index 21e77f8..b185fd5 100644 INT_DEF(dot11MeshMaxRetries, DEFAULT_MESH_MAX_RETRIES); INT_DEF(dot11MeshRetryTimeout, DEFAULT_MESH_RETRY_TIMEOUT); INT_DEF(dot11MeshConfirmTimeout, DEFAULT_MESH_CONFIRM_TIMEOUT); -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 1fd94d8..1d9137e 100644 ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h +Index: hostapd-2021-02-08/wpa_supplicant/config_ssid.h +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/config_ssid.h ++++ hostapd-2021-02-08/wpa_supplicant/config_ssid.h @@ -546,6 +546,11 @@ struct wpa_ssid { int dot11MeshConfirmTimeout; /* msec */ int dot11MeshHoldingTimeout; /* msec */ @@ -111,19 +111,19 @@ index 1fd94d8..1d9137e 100644 int ht; int ht40; -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index c1630d0..176e922 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -15,6 +15,7 @@ - #include "common/wpa_ctrl.h" +Index: hostapd-2021-02-08/wpa_supplicant/mesh.c +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/mesh.c ++++ hostapd-2021-02-08/wpa_supplicant/mesh.c +@@ -16,6 +16,7 @@ + #include "common/hw_features_common.h" #include "ap/sta_info.h" #include "ap/hostapd.h" +#include "ap/ieee802_11_auth.h" #include "ap/ieee802_11.h" #include "config_ssid.h" #include "config.h" -@@ -320,6 +321,17 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, +@@ -459,6 +460,17 @@ static int wpa_supplicant_mesh_init(stru ifmsh->bss[0]->dot11RSNASAERetransPeriod = wpa_s->conf->dot11RSNASAERetransPeriod; os_strlcpy(bss->conf->iface, wpa_s->ifname, sizeof(bss->conf->iface)); @@ -141,7 +141,7 @@ index c1630d0..176e922 100644 mconf = mesh_config_create(wpa_s, ssid); if (!mconf) -@@ -417,6 +429,16 @@ void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s, const u8 *addr, +@@ -555,6 +567,16 @@ void wpa_mesh_notify_peer(struct wpa_sup const u8 *ies, size_t ie_len) { struct ieee802_11_elems elems; @@ -158,10 +158,10 @@ index c1630d0..176e922 100644 wpa_msg(wpa_s, MSG_INFO, "new peer notification for " MACSTR, MAC2STR(addr)); -diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c -index ea62abf..65bfa3a 100644 ---- a/wpa_supplicant/mesh_mpm.c -+++ b/wpa_supplicant/mesh_mpm.c +Index: hostapd-2021-02-08/wpa_supplicant/mesh_mpm.c +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/mesh_mpm.c ++++ hostapd-2021-02-08/wpa_supplicant/mesh_mpm.c @@ -16,6 +16,7 @@ #include "ap/hostapd.h" #include "ap/sta_info.h" @@ -170,7 +170,7 @@ index ea62abf..65bfa3a 100644 #include "ap/wpa_auth.h" #include "wpa_supplicant_i.h" #include "driver_i.h" -@@ -1119,10 +1120,12 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s, +@@ -1128,10 +1129,12 @@ void mesh_mpm_action_rx(struct wpa_suppl enum plink_event event; struct ieee802_11_elems elems; struct mesh_peer_mgmt_ie peer_mgmt_ie; @@ -183,7 +183,7 @@ index ea62abf..65bfa3a 100644 if (mgmt->u.action.category != WLAN_ACTION_SELF_PROTECTED) return; -@@ -1170,6 +1173,18 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s, +@@ -1179,6 +1182,18 @@ void mesh_mpm_action_rx(struct wpa_suppl return; } if (action_field != PLINK_CLOSE) { @@ -202,10 +202,10 @@ index ea62abf..65bfa3a 100644 if (!elems.mesh_id || !elems.mesh_config) { wpa_printf(MSG_DEBUG, "MPM: No Mesh ID or Mesh Configuration element"); -diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf -index 4291244..674978a 100644 ---- a/wpa_supplicant/wpa_supplicant.conf -+++ b/wpa_supplicant/wpa_supplicant.conf +Index: hostapd-2021-02-08/wpa_supplicant/wpa_supplicant.conf +=================================================================== +--- hostapd-2021-02-08.orig/wpa_supplicant/wpa_supplicant.conf ++++ hostapd-2021-02-08/wpa_supplicant/wpa_supplicant.conf @@ -150,6 +150,20 @@ ap_scan=1 # This timeout value is used in mesh STA to clean up inactive stations. #mesh_max_inactivity=300 @@ -227,6 +227,3 @@ index 4291244..674978a 100644 # cert_in_cb - Whether to include a peer certificate dump in events # This controls whether peer certificates for authentication server and # its certificate chain are included in EAP peer certificate events. This is --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch index ebc320f5b..d0b401f36 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch @@ -11,11 +11,9 @@ Signed-off-by: John Crispin src/ap/ieee802_11_he.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c -index 049ac7f0e..157f9e99a 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -192,7 +192,7 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) +@@ -198,7 +198,7 @@ u8 * hostapd_eid_he_operation(struct hos params |= (hapd->iface->conf->he_op.he_rts_threshold << HE_OPERATION_RTS_THRESHOLD_OFFSET); diff --git a/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch index ba27f1b91..570b6d867 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch @@ -1,8 +1,8 @@ +From 2113291e2fb20d82ac9f9740fed13abea2193a35 Mon Sep 17 00:00:00 2001 From: John Crispin +Date: Tue, 3 Nov 2020 20:15:08 -0800 Subject: [PATCH V4 4/6] bss coloring: add the switch_color handler to the nl80211 driver -Date: Wed, 26 Aug 2020 08:22:14 +0200 - In order to start the CCA process we need to send NL80211_CMD_COLOR_CHANGE to the kernel. This patch adds the required code. @@ -10,11 +10,12 @@ to the kernel. This patch adds the required code. Signed-off-by: John Crispin --- src/drivers/driver_nl80211.c | 79 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 79 insertions(+) + src/drivers/nl80211_copy.h | 18 +++++++- + 2 files changed, 95 insertions(+), 2 deletions(-) --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9873,6 +9873,82 @@ error: +@@ -10031,6 +10031,82 @@ error: } @@ -97,7 +98,7 @@ Signed-off-by: John Crispin static int nl80211_add_ts(void *priv, u8 tsid, const u8 *addr, u8 user_priority, u16 admitted_time) { -@@ -11992,6 +12068,9 @@ const struct wpa_driver_ops wpa_driver_n +@@ -12204,6 +12280,9 @@ const struct wpa_driver_ops wpa_driver_n .get_survey = wpa_driver_nl80211_get_survey, .status = wpa_driver_nl80211_status, .switch_channel = nl80211_switch_channel, @@ -109,32 +110,22 @@ Signed-off-by: John Crispin .get_noa = wpa_driver_get_p2p_noa, --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h -@@ -1406,6 +1406,13 @@ enum nl80211_commands { - NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, +@@ -1429,6 +1429,14 @@ enum nl80211_commands { + NL80211_CMD_SET_FILS_DISCOVERY, + NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, - NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, -+ + NL80211_CMD_OBSS_COLOR_COLLISION, + + NL80211_CMD_COLOR_CHANGE, + NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_STARTED, + NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_ABORTED, + NL80211_CMD_COLOR_CHANGE_ANNOUNCEMENT_COMPLETED, ++ ++ /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -2842,8 +2849,8 @@ enum nl80211_attrs { - NL80211_ATTR_CH_SWITCH_COUNT, - NL80211_ATTR_CH_SWITCH_BLOCK_TX, - NL80211_ATTR_CSA_IES, -- NL80211_ATTR_CSA_C_OFF_BEACON, -- NL80211_ATTR_CSA_C_OFF_PRESP, -+ NL80211_ATTR_CNTDWN_OFFS_BEACON, -+ NL80211_ATTR_CNTDWN_OFFS_PRESP, - - NL80211_ATTR_RXMGMT_FLAGS, - -@@ -3030,6 +3037,11 @@ enum nl80211_attrs { +@@ -3094,6 +3102,12 @@ enum nl80211_attrs { NL80211_ATTR_MULTIPLE_BSSID_COUNT, NL80211_ATTR_MULTIPLE_BSSID_IES, @@ -143,15 +134,7 @@ Signed-off-by: John Crispin + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT, + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, ++ /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -3042,6 +3054,8 @@ enum nl80211_attrs { - #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG - #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER - #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA -+#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON -+#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP - - /* - * Allow user space programs to use #ifdef on new attributes by defining them diff --git a/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch index a7b72a475..976a23a87 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch @@ -24,8 +24,6 @@ Signed-off-by: Nishant Pandey wpa_supplicant/wps_supplicant.c | 2 ++ 8 files changed, 143 insertions(+), 1 deletion(-) -diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 0a0bc22..4756a28 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -6,6 +6,7 @@ @@ -36,7 +34,7 @@ index 0a0bc22..4756a28 100644 #include "utils/includes.h" -@@ -1609,6 +1610,73 @@ void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s) +@@ -1616,6 +1617,73 @@ void wpas_ap_pmksa_cache_flush(struct wp hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); } @@ -110,11 +108,9 @@ index 0a0bc22..4756a28 100644 #ifdef CONFIG_PMKSA_CACHE_EXTERNAL #ifdef CONFIG_MESH -diff --git a/wpa_supplicant/ap.h b/wpa_supplicant/ap.h -index 6c6e94c..340eb29 100644 --- a/wpa_supplicant/ap.h +++ b/wpa_supplicant/ap.h -@@ -99,6 +99,11 @@ void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, +@@ -99,6 +99,11 @@ void wpas_ap_event_dfs_cac_aborted(struc struct dfs_event *radar); void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, struct dfs_event *radar); @@ -126,8 +122,6 @@ index 6c6e94c..340eb29 100644 void ap_periodic(struct wpa_supplicant *wpa_s); -diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c -index d769796..7e89bbc 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -5,6 +5,7 @@ @@ -138,7 +132,15 @@ index d769796..7e89bbc 100644 #include "utils/includes.h" #ifdef CONFIG_TESTING_OPTIONS -@@ -3268,6 +3269,18 @@ static int wpa_supplicant_ctrl_iface_mesh_peer_remove( +@@ -56,6 +57,7 @@ + #include "mesh.h" + #include "dpp_supplicant.h" + #include "sme.h" ++#include "ap/ieee802_11.h" + + #ifdef __NetBSD__ + #include +@@ -3284,6 +3286,18 @@ static int wpa_supplicant_ctrl_iface_mes return wpas_mesh_peer_remove(wpa_s, addr); } @@ -157,7 +159,7 @@ index d769796..7e89bbc 100644 static int wpa_supplicant_ctrl_iface_mesh_peer_add( struct wpa_supplicant *wpa_s, char *cmd) -@@ -10564,6 +10577,38 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, +@@ -10655,6 +10669,38 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; #endif /* CONFIG_IBSS_RSN */ #ifdef CONFIG_MESH @@ -196,8 +198,6 @@ index d769796..7e89bbc 100644 } else if (os_strncmp(buf, "MESH_INTERFACE_ADD ", 19) == 0) { reply_len = wpa_supplicant_ctrl_iface_mesh_interface_add( wpa_s, buf + 19, reply, reply_size); -diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index 3041b81..505c92c 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -5,6 +5,7 @@ @@ -208,8 +208,6 @@ index 3041b81..505c92c 100644 #include "includes.h" -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 176e922..e101b42 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -5,6 +5,7 @@ @@ -220,11 +218,9 @@ index 176e922..e101b42 100644 #include "utils/includes.h" -diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c -index 26d7df1..b32ebd8 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c -@@ -2113,6 +2113,19 @@ static int wpa_cli_cmd_mesh_link_probe(struct wpa_ctrl *ctrl, int argc, +@@ -2113,6 +2113,19 @@ static int wpa_cli_cmd_mesh_link_probe(s return wpa_cli_cmd(ctrl, "MESH_LINK_PROBE", 1, argc, argv); } @@ -244,7 +240,7 @@ index 26d7df1..b32ebd8 100644 #endif /* CONFIG_MESH */ -@@ -3508,6 +3521,12 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = { +@@ -3532,6 +3545,12 @@ static const struct wpa_cli_cmd wpa_cli_ { "mesh_link_probe", wpa_cli_cmd_mesh_link_probe, NULL, cli_cmd_flag_none, " [payload=] = Probe a mesh link for a given peer by injecting a frame." }, @@ -257,8 +253,6 @@ index 26d7df1..b32ebd8 100644 #endif /* CONFIG_MESH */ #ifdef CONFIG_P2P { "p2p_find", wpa_cli_cmd_p2p_find, wpa_cli_complete_p2p_find, -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 5cf0a51..e0df6c2 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -9,6 +9,7 @@ @@ -285,8 +279,6 @@ index 5cf0a51..e0df6c2 100644 const char *const wpa_supplicant_version = "wpa_supplicant v" VERSION_STR "\n" -diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c -index b7680f0..df765e5 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -5,6 +5,7 @@ @@ -305,6 +297,3 @@ index b7680f0..df765e5 100644 #include "wps/wps_attr_parse.h" #include "config.h" #include "wpa_supplicant_i.h" --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch index 9f9551e51..3a1c5a75e 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch @@ -25,7 +25,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_FILS void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd, struct sta_info *sta) -@@ -1781,6 +1780,39 @@ static void hostapd_event_update_muedca_ +@@ -1790,6 +1789,39 @@ static void hostapd_event_update_muedca_ "Failed to update beacons with MU-EDCA parameters"); } @@ -65,7 +65,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_OWE static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, const u8 *peer, const u8 *ie, -@@ -2091,6 +2123,17 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2100,6 +2132,17 @@ void hostapd_wpa_event(void *ctx, enum w case EVENT_UPDATE_MUEDCA_PARAMS: hostapd_event_update_muedca_params(hapd, &data->update_muedca); break; @@ -85,7 +85,7 @@ Signed-off-by: John Crispin break; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5165,6 +5165,26 @@ enum wpa_event_type { +@@ -5182,6 +5182,26 @@ enum wpa_event_type { * beacon. */ EVENT_UPDATE_MUEDCA_PARAMS, @@ -112,7 +112,7 @@ Signed-off-by: John Crispin }; -@@ -6034,6 +6054,13 @@ union wpa_event_data { +@@ -6051,6 +6071,13 @@ union wpa_event_data { u8 he_mu_ac_vi_param[3]; u8 he_mu_ac_vo_param[3]; } update_muedca; @@ -169,8 +169,8 @@ Signed-off-by: John Crispin + os_memset(&data, 0, sizeof(data)); + data.bss_color_collision.bitmap = nla_get_u64(tb[NL80211_ATTR_OBSS_COLOR_BITMAP]); + -+ wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08lx", -+ data.bss_color_collision.bitmap); ++ wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx", ++ (long long unsigned int)data.bss_color_collision.bitmap); + + wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data); +} diff --git a/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch index a93fc2bf7..685aa6aae 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch @@ -12,13 +12,11 @@ Signed-off-by: John Crispin hostapd/hostapd.conf | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 97ded78aa..6c1f629cf 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3439,8 +3439,11 @@ static int hostapd_config_fill(struct hostapd_config *conf, - } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { - conf->he_phy_capab.he_mu_beamformer = atoi(pos); +@@ -3367,8 +3367,11 @@ static int hostapd_config_fill(struct ho + } else if (os_strcmp(buf, "he_ul_mumimo") == 0) { + conf->he_phy_capab.he_ul_mumimo = atoi(pos); } else if (os_strcmp(buf, "he_bss_color") == 0) { - conf->he_op.he_bss_color = atoi(pos) & 0x3f; - conf->he_op.he_bss_color_disabled = 0; @@ -30,11 +28,9 @@ index 97ded78aa..6c1f629cf 100644 } else if (os_strcmp(buf, "he_bss_color_partial") == 0) { conf->he_op.he_bss_color_partial = atoi(pos); } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 91ac96785..5fc4d5f86 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -801,7 +801,10 @@ wmm_ac_vo_acm=0 +@@ -810,7 +810,10 @@ wmm_ac_vo_acm=0 # 1 = supported #he_mu_beamformer=1 diff --git a/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch index 6866191fc..4bfdb3817 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch @@ -95,7 +95,7 @@ Signed-off-by: Karthikeyan Periyasamy #endif /* AP_LIST_H */ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3757,6 +3757,7 @@ hostapd_switch_color_timeout_handler(voi +@@ -3769,6 +3769,7 @@ hostapd_switch_color_timeout_handler(voi struct cca_settings settings; struct os_time now; int i, r, b, ret; @@ -103,8 +103,8 @@ Signed-off-by: Karthikeyan Periyasamy if (os_get_time(&now)) return; -@@ -3765,11 +3766,16 @@ hostapd_switch_color_timeout_handler(voi - if (now.sec - hapd->last_color_collision.sec >= 10) +@@ -3777,11 +3778,16 @@ hostapd_switch_color_timeout_handler(voi + if (now.sec - hapd->last_color_collision.sec > 50) return; - r = os_random() % HE_OPERATION_BSS_COLOR_MAX; diff --git a/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch b/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch index 487fe861a..3d9080ab8 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch @@ -1,29 +1,8 @@ -From baf3a982caee59ec08602a9e981d6742abc4fc7b Mon Sep 17 00:00:00 2001 -From: Lavanya Suresh -Date: Mon, 28 Sep 2020 23:21:43 +0530 -Subject: [PATCH] hostapd: Add support to change bss color by user - - -hostpad_cli command is added to change bss color in runtime, -for testing purpose. hostapd_cli status can be used to check -updated color. - -Usage: hostapd_cli color_change - -Signed-off-by: Lavanya Suresh ---- - hostapd/ctrl_iface.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ - hostapd/hostapd_cli.c | 23 +++++++++++++++++++++++ - src/ap/ctrl_iface_ap.c | 6 ++++-- - src/ap/hostapd.c | 4 ++-- - src/ap/hostapd.h | 3 ++- - 5 files changed, 76 insertions(+), 5 deletions(-) - -Index: hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c +Index: hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/ctrl_iface.c -+++ hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c -@@ -2604,6 +2604,59 @@ static int hostapd_ctrl_check_freq_param +--- hostapd-2021-02-20-59e9794c.orig/hostapd/ctrl_iface.c ++++ hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c +@@ -2673,6 +2673,59 @@ static int hostapd_ctrl_check_freq_param } #endif /* NEED_AP_MLME */ @@ -83,7 +62,7 @@ Index: hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, char *pos) -@@ -3602,6 +3655,9 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3682,6 +3735,9 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12)) reply_len = -1; @@ -93,10 +72,10 @@ Index: hostapd-2020-07-02-58b384f4/hostapd/ctrl_iface.c } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); -Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd_cli.c +Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd_cli.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/hostapd/hostapd_cli.c -+++ hostapd-2020-07-02-58b384f4/hostapd/hostapd_cli.c +--- hostapd-2021-02-20-59e9794c.orig/hostapd/hostapd_cli.c ++++ hostapd-2021-02-20-59e9794c/hostapd/hostapd_cli.c @@ -1150,6 +1150,27 @@ static int hostapd_cli_cmd_fst(struct wp } #endif /* CONFIG_FST */ @@ -125,7 +104,7 @@ Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd_cli.c static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, int argc, char *argv[]) -@@ -1599,6 +1620,8 @@ static const struct hostapd_cli_cmd host +@@ -1638,6 +1659,8 @@ static const struct hostapd_cli_cmd host " [sec_channel_offset=] [center_freq1=]\n" " [center_freq2=] [bandwidth=] [blocktx] [ht|vht]\n" " = initiate channel switch announcement" }, @@ -134,11 +113,11 @@ Index: hostapd-2020-07-02-58b384f4/hostapd/hostapd_cli.c { "hs20_wnm_notif", hostapd_cli_cmd_hs20_wnm_notif, NULL, " \n" " = send WNM-Notification Subscription Remediation Request" }, -Index: hostapd-2020-07-02-58b384f4/src/ap/ctrl_iface_ap.c +Index: hostapd-2021-02-20-59e9794c/src/ap/ctrl_iface_ap.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/ctrl_iface_ap.c -+++ hostapd-2020-07-02-58b384f4/src/ap/ctrl_iface_ap.c -@@ -1054,10 +1054,12 @@ int hostapd_ctrl_iface_status(struct hos +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ctrl_iface_ap.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ctrl_iface_ap.c +@@ -1055,10 +1055,12 @@ int hostapd_ctrl_iface_status(struct hos ret = os_snprintf(buf + len, buflen - len, "he_oper_chwidth=%d\n" "he_oper_centr_freq_seg0_idx=%d\n" @@ -153,11 +132,11 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/ctrl_iface_ap.c if (os_snprintf_error(buflen - len, ret)) return len; len += ret; -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c +Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.c -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.c -@@ -3431,7 +3431,7 @@ int hostapd_csa_in_progress(struct hosta +--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c ++++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c +@@ -3443,7 +3443,7 @@ int hostapd_csa_in_progress(struct hosta #ifdef NEED_AP_MLME @@ -166,7 +145,7 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c { os_free(beacon->head); beacon->head = NULL; -@@ -3817,7 +3817,7 @@ void hostapd_cleanup_cca_params(struct h +@@ -3833,7 +3833,7 @@ void hostapd_cleanup_cca_params(struct h } @@ -175,16 +154,21 @@ Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.c struct cca_settings *settings) { struct hostapd_iface *iface = hapd->iface; -Index: hostapd-2020-07-02-58b384f4/src/ap/hostapd.h +Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h =================================================================== ---- hostapd-2020-07-02-58b384f4.orig/src/ap/hostapd.h -+++ hostapd-2020-07-02-58b384f4/src/ap/hostapd.h -@@ -652,6 +652,8 @@ void hostapd_periodic_iface(struct hosta +--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h ++++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h +@@ -661,11 +661,13 @@ void hostapd_periodic_iface(struct hosta int hostapd_owe_trans_get_info(struct hostapd_data *hapd); void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); int hostapd_check_max_sta(struct hostapd_data *hapd); +void free_beacon_data(struct beacon_data *beacon); -+int hostapd_fill_cca_settings(struct hostapd_data *hapd, struct cca_settings *settings); #ifdef CONFIG_IEEE80211AX + void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap); + void hostapd_cleanup_cca_params(struct hostapd_data *hapd); ++int hostapd_fill_cca_settings(struct hostapd_data *hapd, struct cca_settings *settings); + #endif + + /* utils.c */ diff --git a/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch index 5f1e0253c..59cbc2d8b 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch @@ -18,7 +18,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1793,14 +1793,29 @@ static void hostapd_event_bss_color_coll +@@ -1802,14 +1802,29 @@ static void hostapd_event_bss_color_coll static void hostapd_event_cca(struct hostapd_data *hapd, enum wpa_event_type event) { @@ -52,7 +52,7 @@ Signed-off-by: Lavanya Suresh wpa_printf(MSG_DEBUG, "CCA aborted on %s for cca_color: %d", hapd->conf->iface, hapd->cca_color); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3727,12 +3727,18 @@ int hostapd_fill_cca_settings(struct hos +@@ -3742,12 +3742,18 @@ int hostapd_fill_cca_settings(struct hos old_color = iface->conf->he_op.he_bss_color; iface->conf->he_op.he_bss_color = hapd->cca_color; @@ -85,7 +85,7 @@ Signed-off-by: Lavanya Suresh unsigned int cca_c_off_beacon; --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -491,7 +491,7 @@ int hostapd_get_he_twt_responder(struct +@@ -496,7 +496,7 @@ int hostapd_get_he_twt_responder(struct u8 * hostapd_eid_cca(struct hostapd_data *hapd, u8 *eid) { diff --git a/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch index ff6f1e1b5..87b767a05 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch @@ -13,11 +13,9 @@ Signed-off-by: Lavanya Suresh src/ap/hostapd.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 097db83..101178b 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3766,11 +3766,12 @@ hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx) +@@ -3781,11 +3781,12 @@ hostapd_switch_color_timeout_handler(voi return; /* check if there has been a recent collision */ @@ -32,7 +30,7 @@ index 097db83..101178b 100644 r = os_random() % HE_OPERATION_BSS_COLOR_MAX - 1; r++; -@@ -3782,13 +3783,26 @@ hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx) +@@ -3797,13 +3798,26 @@ hostapd_switch_color_timeout_handler(voi } if (i == HE_OPERATION_BSS_COLOR_MAX) { /* there are no free colors so turn bss coloring off */ @@ -60,8 +58,6 @@ index 097db83..101178b 100644 for (b = 0; b < hapd->iface->num_bss; b++) { struct hostapd_data *bss = hapd->iface->bss[b]; -diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index a229f80..1b3a87f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -299,6 +299,7 @@ struct hostapd_data { @@ -72,6 +68,3 @@ index a229f80..1b3a87f 100644 u8 cca_count; u8 cca_color; unsigned int cca_c_off_beacon; --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch b/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch new file mode 100644 index 000000000..21aec4ebf --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch @@ -0,0 +1,256 @@ +From 897902953cd02174e49ea796307bb0b74526e84d Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Thu, 15 Oct 2020 21:35:08 -0700 +Subject: [PATCH] multiple_bssid: add support + +Add support for multiple bssid. In order to be able to do EMA HW +offloading inside the kernel, we need to send the multiple bssid elemets +inside a dedicated nl80211 arreibute. + +Signed-off-by: Aloka Dixit +Signed-off-by: John Crispin +--- + hostapd/config_file.c | 4 ++-- + hostapd/ctrl_iface.c | 3 +++ + src/ap/ap_config.c | 2 +- + src/ap/ap_config.h | 2 +- + src/ap/beacon.c | 5 ++++- + src/ap/ieee802_11.c | 17 ++++++++++++++--- + src/ap/ieee802_11_shared.c | 4 ++-- + src/common/ieee802_11_defs.h | 1 + + src/drivers/driver.h | 9 +++++++-- + src/drivers/driver_nl80211.c | 21 ++++++++++----------- + src/drivers/nl80211_copy.h | 12 ++++-------- + 11 files changed, 49 insertions(+), 31 deletions(-) + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4560,8 +4560,8 @@ static int hostapd_config_fill(struct ho + #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "multiple_bssid") == 0) { + conf->multiple_bssid = atoi(pos); +- } else if (os_strcmp(buf, "ema") == 0) { +- conf->ema = atoi(pos); ++ } else if (os_strcmp(buf, "ema_beacon") == 0) { ++ conf->ema_beacon = atoi(pos); + } else if (os_strcmp(buf, "rnr_beacon") == 0) { + bss->rnr_beacon = atoi(pos); + } else if (os_strcmp(buf, "disable_11n") == 0) { +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -2759,6 +2759,9 @@ static int hostapd_ctrl_iface_chan_switc + * submitting multi-BSS CSA requests? */ + return ret; + } ++ ++ if (iface->bss[i]->iconf->multiple_bssid) ++ break; + } + + return 0; +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -1486,7 +1486,7 @@ int hostapd_config_check(struct hostapd_ + return -1; + } + +- if (conf->ema && !conf->multiple_bssid) { ++ if (conf->ema_beacon && !conf->multiple_bssid) { + wpa_printf(MSG_ERROR, + "Cannot enable ema without enabling multiple_bssid"); + return -1; +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1017,7 +1017,7 @@ struct hostapd_config { + u8 ht40_plus_minus_allowed; + + u8 multiple_bssid; +- u8 ema; ++ u8 ema_beacon; + + /* Use driver-generated interface addresses when adding multiple BSSs */ + u8 use_driver_iface_addr; +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1808,6 +1808,9 @@ int ieee802_11_build_ap_params(struct ho + + params->multiple_bssid_index = hostapd_get_bss_index(hapd); + params->multiple_bssid_count = hapd->iface->num_bss; ++ params->ema_beacon = hapd->iconf->ema_beacon; ++ if (hapd != hapd->iface->bss[0]) ++ params->multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; + params->multiple_bssid_ies = os_zalloc(len); + if (params->multiple_bssid_ies == NULL) + return -1; +@@ -1817,7 +1820,7 @@ int ieee802_11_build_ap_params(struct ho + 1, params->multiple_bssid_ie_offsets, + ¶ms->multiple_bssid_ie_count, + MULTIPLE_BSSID_IE_MAX, +- hapd->iconf->ema); ++ hapd->iconf->ema_beacon); + params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; + if ((params->multiple_bssid_ie_count <= 1) && + (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7126,7 +7126,7 @@ static u8 * hostapd_eid_multiple_bssid_c + for (i = *count; i < hapd->iface->num_bss; i++) { + bss = hapd->iface->bss[i]; + conf = bss->conf; +- u8 *bss_size_offset, *index_size_offset, *pos = eid; ++ u8 *bss_size_offset, *index_size_offset, *pos = eid, *rsn; + u16 capab_info; + + *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; +@@ -7161,8 +7161,19 @@ static u8 * hostapd_eid_multiple_bssid_c + } + *index_size_offset = (eid - index_size_offset) - 1; + +- eid = hostapd_get_rsne(bss, eid, end - eid); +- eid = hostapd_get_rsnxe(bss, eid, end - eid); ++ rsn = hostapd_get_rsne(bss, eid, end - eid); ++ if (rsn == eid) { ++ /* add RSN non-inheritance IE */ ++ *eid++ = WLAN_EID_EXTENSION; ++ *eid++ = 3; ++ *eid++ = WLAN_EID_EXT_NON_INHERITANCE; ++ *eid++ = 1; ++ *eid++ = WLAN_EID_RSN; ++ } else { ++ eid = rsn; ++ eid = hostapd_get_rsnxe(bss, eid, end - eid); ++ } ++ + *bss_size_offset = (eid - bss_size_offset) - 1; + + if ((eid - size_offset) - 1 > 255) { +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c +@@ -428,7 +428,7 @@ static void hostapd_ext_capab_byte(struc + } + #endif /* CONFIG_SAE */ + /* Bit 83 - EMA AP Support */ +- if (hapd->iconf->ema) ++ if (hapd->iconf->ema_beacon) + *pos |= 0x08; + if (hapd->conf->beacon_prot && + (hapd->iface->drv_flags & +@@ -501,7 +501,7 @@ u8 * hostapd_eid_ext_capab(struct hostap + hostapd_sae_pw_id_in_use(hapd->conf)) + len = 11; + #endif /* CONFIG_SAE */ +- if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema) && ++ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema_beacon) && + (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION)) + len = 11; + #ifdef CONFIG_SAE_PK +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -482,6 +482,7 @@ + #define WLAN_EID_EXT_SPATIAL_REUSE 39 + #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 + #define WLAN_EID_EXT_OCV_OCI 54 ++#define WLAN_EID_EXT_NON_INHERITANCE 56 + #define WLAN_EID_EXT_SHORT_SSID_LIST 58 + #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 + #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1586,9 +1586,9 @@ struct wpa_driver_ap_params { + size_t unsol_bcast_probe_resp_tmpl_len; + + /** +- * multiple_bssid_non_transmitted - Is this a non transmitted BSS ++ * multiple_bssid_parent - The transmitting iface + */ +- int multiple_bssid_non_transmitted; ++ const char *multiple_bssid_parent; + + /** + * multiple_bssid_index - The index of this BSS in the group +@@ -1619,6 +1619,12 @@ struct wpa_driver_ap_params { + * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets + */ + int multiple_bssid_ie_count; ++ ++ /** ++ * ema_beacon - should the multiple_bssid beacons be sent out in EMA mode ++ */ ++ int ema_beacon; ++ + }; + + struct wpa_driver_mesh_bss_params { +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4872,6 +4872,16 @@ static int wpa_driver_nl80211_set_ap(voi + params->multiple_bssid_index); + nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_COUNT, + params->multiple_bssid_count); ++ if (params->ema_beacon) ++ nla_put_flag(msg, NL80211_ATTR_MULTIPLE_BSSID_EMA); ++ } ++ ++ if (params->multiple_bssid_parent) { ++ int ifidx = if_nametoindex(params->multiple_bssid_parent); ++ if (ifidx <= 0) ++ goto fail; ++ nla_put_u32(msg, NL80211_ATTR_MULTIPLE_BSSID_PARENT, ++ ifidx); + } + + if (params->multiple_bssid_ie_len) { +@@ -5528,17 +5538,6 @@ static int nl80211_create_iface_once(str + goto fail; + } + +- if (multiple_bssid_non_transmitted) { +- if (!multiple_bssid_parent) +- goto fail; +- ifidx = if_nametoindex(multiple_bssid_parent); +- if (ifidx <= 0) +- goto fail; +- nla_put_flag(msg, NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING); +- nla_put_u32(msg, NL80211_ATTR_MULTIPLE_BSSID_PARENT, +- ifidx); +- } +- + /* + * Tell cfg80211 that the interface belongs to the socket that created + * it, and the interface should be deleted when the socket is closed. +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -2583,9 +2583,6 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. + * +- * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this +- * BSSIDs beacon. +- * + * @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define + * the parent (transmitting) interface. + * +@@ -2595,7 +2592,9 @@ enum nl80211_commands { + * @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. + * + * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. +- * these get passed separately as the kernel might need to split them up for EMA VAP. ++ * these get passed separately as the kernel might need to split them up for EMA VAP. ++ * ++ * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. + * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined +@@ -3096,11 +3095,11 @@ enum nl80211_attrs { + + NL80211_ATTR_HE_MUEDCA_PARAMS, + +- NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING, + NL80211_ATTR_MULTIPLE_BSSID_PARENT, + NL80211_ATTR_MULTIPLE_BSSID_INDEX, + NL80211_ATTR_MULTIPLE_BSSID_COUNT, + NL80211_ATTR_MULTIPLE_BSSID_IES, ++ NL80211_ATTR_MULTIPLE_BSSID_EMA, + + NL80211_ATTR_OBSS_COLOR_BITMAP, + diff --git a/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch b/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch new file mode 100644 index 000000000..1b06a25bc --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch @@ -0,0 +1,253 @@ +From f3fa24d9bd04ed37674f896213d037ecca463507 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Fri, 23 Oct 2020 14:52:24 -0700 +Subject: [PATCH] hostapd: Fixes in EMA beacon transmission offload + +(1) CSA failure: Fixed by initiating CSA for all BSSes on a radio. + Each VAP has an assigned channel context in mac80211. + Initiating CSA on only one transmitted VAP results in unequal + number of assigned and reserved contexts. + +(2) This change adds non-inheritance element only if transmitted VAP is + secure but non-transmitted is open, and calculates the length of + multiple BSSID element accordingly. + +Signed-off-by: Aloka Dixit +--- + hostapd/ctrl_iface.c | 3 --- + src/ap/beacon.c | 9 +++------ + src/ap/ieee802_11.c | 19 +++++++++++++------ + src/ap/ieee802_11_shared.c | 28 +++++++++++++++++++++++----- + 4 files changed, 39 insertions(+), 20 deletions(-) + +Index: hostapd-2021-02-20/hostapd/ctrl_iface.c +=================================================================== +--- hostapd-2021-02-20.orig/hostapd/ctrl_iface.c ++++ hostapd-2021-02-20/hostapd/ctrl_iface.c +@@ -2759,9 +2759,6 @@ static int hostapd_ctrl_iface_chan_switc + * submitting multi-BSS CSA requests? */ + return ret; + } +- +- if (iface->bss[i]->iconf->multiple_bssid) +- break; + } + + return 0; +Index: hostapd-2021-02-20/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/beacon.c ++++ hostapd-2021-02-20/src/ap/beacon.c +@@ -434,7 +434,7 @@ static u8 * hostapd_gen_probe_resp(struc + { + struct hostapd_data *hidden = NULL; + struct ieee80211_mgmt *resp; +- u8 *pos, *epos, *csa_pos, *ext_cap_pos; ++ u8 *pos, *epos, *csa_pos; + size_t buflen; + + if (hapd->iconf->multiple_bssid && +@@ -566,10 +566,7 @@ static u8 * hostapd_gen_probe_resp(struc + pos = hostapd_eid_ht_capabilities(hapd, pos); + pos = hostapd_eid_ht_operation(hapd, pos); + +- ext_cap_pos = pos; + pos = hostapd_eid_ext_capab(hapd, pos); +- if ((pos - ext_cap_pos >= 13) && (ext_cap_pos[12] & 0x08)) +- ext_cap_pos[12] |= 0x01; + + pos = hostapd_eid_time_adv(hapd, pos); + pos = hostapd_eid_time_zone(hapd, pos); +@@ -1834,9 +1831,9 @@ int ieee802_11_build_ap_params(struct ho + MULTIPLE_BSSID_IE_MAX, + hapd->iconf->ema_beacon); + params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; +- if ((params->multiple_bssid_ie_count <= 1) && ++ if ((params->multiple_bssid_ie_count > 1) && + (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) +- ext_cap_pos[12] |= 0x01; ++ ext_cap_pos[12] &= ~0x01; /* Clear bit 80 */ + params->dtim_period = hapd->conf->dtim_period; + } + +Index: hostapd-2021-02-20/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-20/src/ap/ieee802_11.c +@@ -167,6 +167,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h + int i, num, count; + int h2e_required; + ++ hapd->conf->xrates_supported = 0; + if (hapd->iface->current_rates == NULL) + return eid; + +@@ -216,6 +217,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h + *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY; + } + ++ hapd->conf->xrates_supported = 1; + return pos; + } + +@@ -7081,6 +7083,13 @@ static int hostapd_eid_multiple_bssid_ch + + if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) + nontx_profile_len += ies_len; ++ else if (wpa_auth_get_wpa_ie(hapd->wpa_auth, &ies_len)) ++ nontx_profile_len += 8; /* Non-inheritance element */ ++ ++ if (bss->conf->xrates_supported) ++ nontx_profile_len += 8; /*ext supp rates*/ ++ else if (hapd->conf->xrates_supported) ++ nontx_profile_len += 3; /* Non-inheritance element for xrates */ + + if (len + nontx_profile_len > 255) { + goto multiple_bssid_too_big; +@@ -7117,7 +7126,8 @@ static u8 * hostapd_eid_multiple_bssid_c + struct hostapd_data *bss; + struct hostapd_bss_config *conf; + u8 *size_offset, *num_offset; +- int i; ++ int i, ie_count = 0; ++ u8 non_inherit_ie[3] = {0}; + + *eid++ = WLAN_EID_MULTIPLE_BSSID; + size_offset = eid++; +@@ -7126,8 +7136,9 @@ static u8 * hostapd_eid_multiple_bssid_c + for (i = *count; i < hapd->iface->num_bss; i++) { + bss = hapd->iface->bss[i]; + conf = bss->conf; +- u8 *bss_size_offset, *index_size_offset, *pos = eid, *rsn; ++ u8 *bss_size_offset, *index_size_offset, *pos = eid; + u16 capab_info; ++ ie_count = 0; + + *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; + bss_size_offset = eid++; +@@ -7161,17 +7172,38 @@ static u8 * hostapd_eid_multiple_bssid_c + } + *index_size_offset = (eid - index_size_offset) - 1; + +- rsn = hostapd_get_rsne(bss, eid, end - eid); +- if (rsn == eid) { +- /* add RSN non-inheritance IE */ ++ eid = hostapd_get_rsne(bss, eid, end - eid); ++ eid = hostapd_get_rsnxe(bss, eid, end - eid); ++ eid = hostapd_eid_ext_supp_rates(bss, eid); ++ ++ /* Add non inheritance ie for capabalities that ++ * are not inherited by non tx vap from tx vap ++ */ ++ ++ if (hostapd_wpa_ie(hapd, WLAN_EID_RSN) && ++ !hostapd_wpa_ie(bss, WLAN_EID_RSN)) { ++ non_inherit_ie[ie_count] = WLAN_EID_RSN; ++ ie_count++; ++ } ++ ++ if (hapd->conf->xrates_supported && ++ !bss->conf->xrates_supported) { ++ non_inherit_ie[ie_count] = WLAN_EID_EXT_SUPP_RATES; ++ ie_count++; ++ } ++ if (hostapd_wpa_ie(hapd, WLAN_EID_RSNX) && ++ !hostapd_wpa_ie(bss, WLAN_EID_RSNX)) { ++ non_inherit_ie[ie_count] = WLAN_EID_RSNX; ++ ie_count++; ++ } ++ ++ if (ie_count) { + *eid++ = WLAN_EID_EXTENSION; +- *eid++ = 3; ++ *eid++ = 2 + ie_count; + *eid++ = WLAN_EID_EXT_NON_INHERITANCE; +- *eid++ = 1; +- *eid++ = WLAN_EID_RSN; +- } else { +- eid = rsn; +- eid = hostapd_get_rsnxe(bss, eid, end - eid); ++ *eid++ = ie_count; ++ os_memcpy(eid, non_inherit_ie, ie_count); ++ eid += ie_count; + } + + *bss_size_offset = (eid - bss_size_offset) - 1; +Index: hostapd-2021-02-20/src/ap/ieee802_11_shared.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11_shared.c ++++ hostapd-2021-02-20/src/ap/ieee802_11_shared.c +@@ -427,9 +427,13 @@ static void hostapd_ext_capab_byte(struc + * Identifiers Used Exclusively */ + } + #endif /* CONFIG_SAE */ +- /* Bit 83 - EMA AP Support */ +- if (hapd->iconf->ema_beacon) +- *pos |= 0x08; ++ if (hapd->iconf->multiple_bssid) { ++ /* Bit 80 - Complete list of non-transmitted profiles */ ++ *pos |= 0x01; ++ /* Bit 83 - EMA AP Support */ ++ if (hapd->iconf->ema_beacon) ++ *pos |= 0x08; ++ } + if (hapd->conf->beacon_prot && + (hapd->iface->drv_flags & + WPA_DRIVER_FLAGS_BEACON_PROTECTION)) +@@ -447,6 +451,16 @@ static void hostapd_ext_capab_byte(struc + } + + ++void hostapd_eid_ext_capab_multiple_bssid(struct hostapd_data *hapd, u8 *eid, ++ u8 len) ++{ ++ if (!hapd->iconf->ema_beacon && (len >= 11)) ++ eid[10] &= 0xF7; ++ if (!hapd->iconf->multiple_bssid && (len >= 3)) ++ eid[2] &= 0xBF; ++} ++ ++ + u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) + { + u8 *pos = eid; +@@ -459,7 +473,8 @@ u8 * hostapd_eid_ext_capab(struct hostap + (hapd->conf->time_advertisement == 2 || hapd->conf->interworking)) + len = 4; + if (len < 3 && +- (hapd->conf->wnm_sleep_mode || hapd->conf->bss_transition)) ++ (hapd->conf->wnm_sleep_mode || hapd->conf->bss_transition || ++ hapd->iconf->multiple_bssid)) + len = 3; + if (len < 1 && + (hapd->iconf->obss_interval || +@@ -501,7 +516,7 @@ u8 * hostapd_eid_ext_capab(struct hostap + hostapd_sae_pw_id_in_use(hapd->conf)) + len = 11; + #endif /* CONFIG_SAE */ +- if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->ema_beacon) && ++ if (len < 11 && (hapd->conf->beacon_prot || hapd->iconf->multiple_bssid) && + (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION)) + len = 11; + #ifdef CONFIG_SAE_PK +@@ -526,6 +541,8 @@ u8 * hostapd_eid_ext_capab(struct hostap + } + } + ++ hostapd_eid_ext_capab_multiple_bssid(hapd, eid + 2, len); ++ + while (len > 0 && eid[1 + len] == 0) { + len--; + eid[1] = len; +Index: hostapd-2021-02-20/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ap_config.h ++++ hostapd-2021-02-20/src/ap/ap_config.h +@@ -534,6 +534,7 @@ struct hostapd_bss_config { + bool disable_11n; + bool disable_11ac; + bool disable_11ax; ++ bool xrates_supported; + + /* IEEE 802.11v */ + int time_advertisement; diff --git a/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch b/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch new file mode 100644 index 000000000..277cd1e15 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch @@ -0,0 +1,37 @@ +From 93f695bfe52dd725841fcca71ed4e14e9a90e1dc Mon Sep 17 00:00:00 2001 +From: Abinaya Kalaiselvan +Date: Wed, 25 Nov 2020 19:58:58 +0530 +Subject: [PATCH] hostapd: fix int-in-bool-context Werror + +Add changes to fix the below compilation error. + +./src/rsn_supp/wpa.c:621:35: error: ?: using integer constants +in boolean context, the expression will always evaluate +to 'true' [-Werror=int-in-bool-context] + +Signed-off-by: Abinaya Kalaiselvan +--- + src/rsn_supp/wpa.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c +index 3205527..88c1e3e 100644 +--- a/src/rsn_supp/wpa.c ++++ b/src/rsn_supp/wpa.c +@@ -615,10 +615,11 @@ static int wpa_handle_ext_key_id(struct wpa_sm *sm, + { + if (sm->ext_key_id) { + u16 key_id; ++ u8 use_ext_key_id; + + if (!kde->key_id) { +- wpa_msg(sm->ctx->msg_ctx, +- sm->use_ext_key_id ? MSG_INFO : MSG_DEBUG, ++ use_ext_key_id = sm->use_ext_key_id ? MSG_INFO : MSG_DEBUG; ++ wpa_msg(sm->ctx->msg_ctx, use_ext_key_id, + "RSN: No Key ID in Extended Key ID handshake"); + sm->keyidx_active = 0; + return sm->use_ext_key_id ? -1 : 0; +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch b/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch new file mode 100644 index 000000000..a8df94092 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch @@ -0,0 +1,33 @@ +From ed96951a0e08771570c950f42ebfd49ff0511756 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 3 Dec 2020 18:58:19 +0530 +Subject: [PATCH] wpa_supplicant: add mesh ID IE only for mesh mode + +Mesh ID IE is added in probe request frame irrespective +of mode. Added check to avoid adding this IE for non-mesh +modes. + +Signed-off-by: Lavanya Suresh +--- + wpa_supplicant/scan.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c +index b9e4162..9992e42 100644 +--- a/wpa_supplicant/scan.c ++++ b/wpa_supplicant/scan.c +@@ -611,7 +611,10 @@ static struct wpabuf * wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s) + } + #endif /* CONFIG_P2P */ + +- wpa_supplicant_mesh_add_scan_ie(wpa_s, &extra_ie); ++#ifdef CONFIG_MESH ++ if (wpa_s->conf->ssid && wpa_s->conf->ssid->mode == WPAS_MODE_MESH) ++ wpa_supplicant_mesh_add_scan_ie(wpa_s, &extra_ie); ++#endif /* CONFIG_MESH */ + + #endif /* CONFIG_WPS */ + +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch new file mode 100644 index 000000000..93a157c91 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch @@ -0,0 +1,189 @@ +From 42bd9677183c6a71c56c9f36d32e2fb626fdb535 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Tue, 8 Dec 2020 00:28:00 +0530 +Subject: [PATCH] hostapd: Enable HE40 support in 2G 11s mesh + +This patch adds support for HE40 in 2G 11s mesh if +the driver advertise HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G +support in HE capability. + +Signed-off-by: P Praneesh +--- + wpa_supplicant/wpa_supplicant.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c +@@ -2378,6 +2378,57 @@ static int drv_supports_vht(struct wpa_s + return mode->vht_capab != 0; + } + ++static void ibss_mesh_setup_2G_he40(struct hostapd_freq_params *freq, ++ struct hostapd_hw_modes *mode, ++ struct wpa_supplicant *wpa_s, ++ const struct wpa_ssid *ssid, ++ int ieee80211_mode) ++{ ++ struct wpa_scan_results *scan_res; ++ int he40plus2G[] = { 2412, 2417, 2422, 2427, 2432, 2437}; ++ int i, res; ++ u8 pri_chan, sec_chan; ++ ++ freq->vht_enabled = vht_supported(mode); ++ freq->sec_channel_offset = -1; ++ ++ if (mode->he_capab[ieee80211_mode].phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & ++ HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G) ++ freq->bandwidth = 40; ++ ++ /* Setting channel offset as 1 for channel 1 to 6 and -1 for ++ * channel 7 to 11 ++ */ ++ for (i = 0; i < ARRAY_SIZE(he40plus2G); i++) { ++ if (freq->freq == he40plus2G[i]) ++ freq->sec_channel_offset = 1; ++ } ++ ++ freq->center_freq1 = freq->freq + freq->sec_channel_offset * 10; ++ freq->center_freq2 = 0; ++ ++ if (ssid->disable_40mhz_scan) { ++ wpa_printf(MSG_DEBUG, "IBSSS: 40MHz Coex scan disabled"); ++ return; ++ } ++ ++ scan_res = wpa_supplicant_get_scan_results(wpa_s, NULL, 0); ++ if (scan_res == NULL) ++ goto HE20; ++ ++ pri_chan = freq->channel; ++ sec_chan = pri_chan + freq->sec_channel_offset * 4; ++ res = check_40mhz_2g4(mode, scan_res, pri_chan, sec_chan); ++ wpa_scan_results_free(scan_res); ++ if (!res) ++ goto HE20; ++ return; ++HE20: ++ freq->sec_channel_offset = 0; ++ freq->bandwidth = 20; ++ freq->center_freq1 = freq->freq + freq->sec_channel_offset * 10; ++} ++ + static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) + { + int i; +@@ -2498,6 +2549,11 @@ void ibss_mesh_setup_freq(struct wpa_sup + else + #endif /* CONFIG_HE_OVERRIDES */ + freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; ++ ++ if (freq->he_enabled) ++ ibss_mesh_setup_2G_he40(freq, mode, wpa_s, ++ ssid, ieee80211_mode); ++ return; + } + + for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { +Index: hostapd-2021-02-18/src/drivers/driver.h +=================================================================== +--- hostapd-2021-02-18.orig/src/drivers/driver.h ++++ hostapd-2021-02-18/src/drivers/driver.h +@@ -1203,6 +1203,11 @@ struct wpa_driver_associate_params { + * 2 = both hunting-and-pecking loop and hash-to-element enabled + */ + int sae_pwe; ++ ++ /** ++ * Disable HE40MHz coexistence scan ++ */ ++ int disable_40mhz_scan; + }; + + enum hide_ssid { +Index: hostapd-2021-02-18/wpa_supplicant/config.c +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/config.c ++++ hostapd-2021-02-18/wpa_supplicant/config.c +@@ -2804,6 +2804,7 @@ static const struct parse_data ssid_fiel + { INT_RANGE(beacon_prot, 0, 1) }, + { INT_RANGE(transition_disable, 0, 255) }, + { INT_RANGE(sae_pk, 0, 2) }, ++ { INT_RANGE(disable_40mhz_scan, 0, 1)}, + }; + + #undef OFFSET +Index: hostapd-2021-02-18/wpa_supplicant/config_file.c +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/config_file.c ++++ hostapd-2021-02-18/wpa_supplicant/config_file.c +@@ -885,7 +885,7 @@ static void wpa_config_write_network(FIL + #ifdef CONFIG_HE_OVERRIDES + INT(disable_he); + #endif /* CONFIG_HE_OVERRIDES */ +- ++ INT(disable_40mhz_scan); + #undef STR + #undef INT + #undef INT_DEF +Index: hostapd-2021-02-18/wpa_supplicant/config_ssid.h +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/config_ssid.h ++++ hostapd-2021-02-18/wpa_supplicant/config_ssid.h +@@ -1165,6 +1165,11 @@ struct wpa_ssid { + * configuration. + */ + bool was_recently_reconfigured; ++ ++ /** ++ * disable_40mhz_scan - Disable 40MHz coex scan ++ */ ++ int disable_40mhz_scan; + }; + + #endif /* CONFIG_SSID_H */ +Index: hostapd-2021-02-18/wpa_supplicant/wpa_cli.c +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/wpa_cli.c ++++ hostapd-2021-02-18/wpa_supplicant/wpa_cli.c +@@ -1482,7 +1482,8 @@ static const char *network_fields[] = { + #ifdef CONFIG_HS20 + "update_identifier", + #endif /* CONFIG_HS20 */ +- "mac_addr", "pbss", "wps_disabled" ++ "mac_addr", "pbss", "wps_disabled", ++ "disable_40mhz_scan", + }; + + +Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.conf +=================================================================== +--- hostapd-2021-02-18.orig/wpa_supplicant/wpa_supplicant.conf ++++ hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.conf +@@ -158,6 +158,9 @@ ap_scan=1 + # 1 = deny unless in accept list + macaddr_acl=0 + ++# Disable 40MHz co-existence scan in Mesh ++#disable_40mhz_scan=1 ++ + # Accept/deny lists are read from separate files (containing list of + # MAC addresses, one per line). Use absolute path name to make sure that the + # files can be read on SIGHUP configuration reloads. +@@ -1983,6 +1986,15 @@ network={ + psk="very secret passphrase" + } + ++# Disable 40MHz Co-existence scan in mesh ++network={ ++ ssid="OpenWrt" ++ key_mgmt=SAE ++ mode=5 ++ frequency=2437 ++ psk="1234567890" ++ disable_40mhz_scan=1 ++} + + # Catch all example that allows more or less all configuration modes + network={ diff --git a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch new file mode 100644 index 000000000..0ec7229ef --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch @@ -0,0 +1,57 @@ +From d8f5c924a1edb1f695f86e7cac71c8faae3770ca Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Fri, 11 Dec 2020 09:38:48 +0530 +Subject: [PATCH] hostapd: disable HE when wmm is not enabled + +When wmm is disabled, HE should be disabled in AP, to handle all +STA. Otherwise, third-party vendor STA will check HE caps of AP and +gets associated in HE mode. In this case, phymode will be set to HE +but peer flags won't have HE since it's set based on wmm config, in +peer assoc params. + +This causes q6 crash during association, since FW expects peer flags +to have HE, because of phymode indicating HE. + +ath11k STA handles this case by disabling HT/VHT/HE caps based on wmm +configuration. + +If wmm config is not set explicitly by user, it will be set based on +HT/HE config. + +Signed-off-by: Lavanya Suresh +--- + src/ap/ap_config.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -1184,6 +1184,9 @@ static int hostapd_config_check_bss(stru + } + #endif /* CONFIG_WEP */ + ++ if(!bss->wmm_enabled) ++ conf->ieee80211ax = 0; ++ + if (full_config && bss->wpa && + bss->wpa_psk_radius != PSK_RADIUS_IGNORED && + bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -128,7 +128,7 @@ static void hostapd_reload_bss(struct ho + return; + + if (hapd->conf->wmm_enabled < 0) +- hapd->conf->wmm_enabled = hapd->iconf->ieee80211n; ++ hapd->conf->wmm_enabled = hapd->iconf->ieee80211n | hapd->iconf->ieee80211ax; + + #ifndef CONFIG_NO_RADIUS + radius_client_reconfig(hapd->radius, hapd->conf->radius); +@@ -1241,7 +1241,7 @@ static int hostapd_setup_bss(struct host + } + + if (conf->wmm_enabled < 0) +- conf->wmm_enabled = hapd->iconf->ieee80211n; ++ conf->wmm_enabled = hapd->iconf->ieee80211n | hapd->iconf->ieee80211ax; + + #ifdef CONFIG_IEEE80211R_AP + if (is_zero_ether_addr(conf->r1_key_holder)) diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch new file mode 100644 index 000000000..eebc75b60 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch @@ -0,0 +1,370 @@ +From f99298047901a3c4e447149320a94a1f20b0848f Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Tue, 1 Dec 2020 16:22:55 -0800 +Subject: [PATCH 1/9] hostapd: Process known BSSID element + +The format of known BSSID element is given in IEEE P802.11ax/D6.0, +section 9.4.2.259. + +Non-AP stations may include this element in directed probe requests +to indicate which of the multiple BSSIDs they have already discovered. +AP should exclude these profiles from the probe response. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 34 ++++++++++++------- + src/ap/ieee802_11.c | 62 +++++++++++++++++++++++----------- + src/ap/ieee802_11.h | 9 ++--- + src/common/ieee802_11_common.c | 4 +++ + src/common/ieee802_11_common.h | 2 ++ + src/common/ieee802_11_defs.h | 1 + + 6 files changed, 76 insertions(+), 36 deletions(-) + +Index: hostapd-2021-02-20/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/beacon.c ++++ hostapd-2021-02-20/src/ap/beacon.c +@@ -8,6 +8,7 @@ + * See README for more details. + */ + ++#include + #include "utils/includes.h" + + #ifndef CONFIG_NATIVE_WINDOWS +@@ -430,16 +431,17 @@ static u8 * hostapd_eid_supported_op_cla + + static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + const struct ieee80211_mgmt *req, +- int is_p2p, size_t *resp_len) ++ int is_p2p, size_t *resp_len, ++ const u8 *known_bssids, u8 known_bssids_len) + { +- struct hostapd_data *hidden = NULL; ++ struct hostapd_data *req_bss = NULL; + struct ieee80211_mgmt *resp; + u8 *pos, *epos, *csa_pos; + size_t buflen; + + if (hapd->iconf->multiple_bssid && + hapd != hostapd_get_primary_bss(hapd)) { +- hidden = hapd; ++ req_bss = hapd; + hapd = hostapd_get_primary_bss(hapd); + } + +@@ -480,7 +482,9 @@ static u8 * hostapd_gen_probe_resp(struc + buflen += hostapd_eid_owe_trans_len(hapd); + buflen += hostapd_eid_dpp_cc_len(hapd); + if (hapd->iconf->multiple_bssid) +- buflen += hostapd_eid_multiple_bssid_len(hapd, hidden, 0); ++ buflen += hostapd_eid_multiple_bssid_len(hapd, req_bss, 0, ++ known_bssids, ++ known_bssids_len); + if (hapd->conf->rnr_beacon) + buflen += hostapd_eid_reduced_neighbor_report_len(hapd, 1); + +@@ -508,13 +512,13 @@ static u8 * hostapd_gen_probe_resp(struc + + pos = resp->u.probe_resp.variable; + *pos++ = WLAN_EID_SSID; +- if (hapd->iconf->multiple_bssid && hidden && ++ if (hapd->iconf->multiple_bssid && req_bss && + hapd->conf->ignore_broadcast_ssid == 2) { + /* clear the data, but keep the correct length of the SSID */ + *pos++ = hapd->conf->ssid.ssid_len; + os_memset(pos, 0, hapd->conf->ssid.ssid_len); + pos += hapd->conf->ssid.ssid_len; +- } else if (hapd->iconf->multiple_bssid && hidden && ++ } else if (hapd->iconf->multiple_bssid && req_bss && + hapd->conf->ignore_broadcast_ssid) { + *pos++ = 0; /* empty SSID */ + } else { +@@ -553,8 +557,9 @@ static u8 * hostapd_gen_probe_resp(struc + pos = hostapd_get_mde(hapd, pos, epos - pos); + + if (hapd->iconf->multiple_bssid) +- pos = hostapd_eid_multiple_bssid(hapd, hidden, pos, epos, 0, +- NULL, 0, 0, 0); ++ pos = hostapd_eid_multiple_bssid(hapd, req_bss, pos, epos, 0, ++ NULL, 0, 0, 0, known_bssids, ++ known_bssids_len); + + /* eCSA IE */ + csa_pos = hostapd_eid_ecsa(hapd, pos); +@@ -1119,12 +1124,13 @@ void handle_probe_req(struct hostapd_dat + " signal=%d", MAC2STR(mgmt->sa), ssi_signal); + + if (hapd->iconf->multiple_bssid && +- hapd != hostapd_get_primary_bss(hapd) && ++ (hapd != hostapd_get_primary_bss(hapd)) && + (res != EXACT_SSID_MATCH && res != CO_LOCATED_SSID_MATCH)) + return; + + resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, +- &resp_len); ++ &resp_len, elems.known_bssids, ++ elems.known_bssids_len); + if (resp == NULL) + return; + +@@ -1193,7 +1199,7 @@ static u8 * hostapd_probe_resp_offloads( + "this"); + + /* Generate a Probe Response template for the non-P2P case */ +- return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len); ++ return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, NULL, 0); + } + + #endif /* NEED_AP_MLME */ +@@ -1211,7 +1217,8 @@ static u8 * hostapd_unsol_bcast_probe_re + hapd->conf->unsol_bcast_probe_resp_interval; + + return hostapd_gen_probe_resp(hapd, NULL, 0, +- ¶ms->unsol_bcast_probe_resp_tmpl_len); ++ ¶ms->unsol_bcast_probe_resp_tmpl_len, ++ NULL, 0); + } + #endif /* CONFIG_IEEE80211AX */ + +@@ -1812,7 +1819,7 @@ int ieee802_11_build_ap_params(struct ho + } + + if (hapd->iconf->multiple_bssid) { +- int len = hostapd_eid_multiple_bssid_len(hapd, NULL, 1); ++ int len; + u8 *end; + + params->multiple_bssid_index = hostapd_get_bss_index(hapd); +@@ -1820,6 +1827,8 @@ int ieee802_11_build_ap_params(struct ho + params->ema_beacon = hapd->iconf->ema_beacon; + if (hapd != hapd->iface->bss[0]) + params->multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; ++ ++ len = hostapd_eid_multiple_bssid_len(hapd, NULL, 1, NULL, 0); + params->multiple_bssid_ies = os_zalloc(len); + if (params->multiple_bssid_ies == NULL) + return -1; +@@ -1829,7 +1838,8 @@ int ieee802_11_build_ap_params(struct ho + 1, params->multiple_bssid_ie_offsets, + ¶ms->multiple_bssid_ie_count, + MULTIPLE_BSSID_IE_MAX, +- hapd->iconf->ema_beacon); ++ hapd->iconf->ema_beacon, NULL, ++ 0); + params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; + if ((params->multiple_bssid_ie_count > 1) && + (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) +Index: hostapd-2021-02-20/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-20/src/ap/ieee802_11.c +@@ -7051,13 +7051,15 @@ int hostapd_config_read_maclist(const ch + + + static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, +- struct hostapd_data *hidden, +- int *count, +- u8 is_beacon) ++ struct hostapd_data *req_bss, ++ int *count, u8 is_beacon, ++ const u8 *known_bssids, ++ u8 known_bssids_len) + { + /* ID + size + count */ +- int i, len = 3, nontx_profile_len; ++ int i, j, len = 3, nontx_profile_len; + size_t ies_len = 0; ++ u8 mask; + struct hostapd_data *bss; + struct hostapd_bss_config *conf; + +@@ -7065,6 +7067,12 @@ static int hostapd_eid_multiple_bssid_ch + bss = hapd->iface->bss[i]; + conf = bss->conf; + ++ j = i / 8; ++ mask = (u8)1 << (i % 8); ++ if ((j < known_bssids_len) && known_bssids && ++ (known_bssids[j] & mask)) ++ continue; ++ + /* + * Sublement ID: 1 byte + * Length: 1 byte +@@ -7075,7 +7083,7 @@ static int hostapd_eid_multiple_bssid_ch + nontx_profile_len = 11; + + if (!conf->ignore_broadcast_ssid || +- conf->ignore_broadcast_ssid == 2 || bss == hidden) ++ conf->ignore_broadcast_ssid == 2 || bss == req_bss) + nontx_profile_len += conf->ssid.ssid_len; + + if (is_beacon) +@@ -7105,28 +7113,32 @@ multiple_bssid_too_big: + + + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *hidden, +- u8 is_beacon) ++ struct hostapd_data *req_bss, ++ u8 is_beacon, const u8 *known_bssids, ++ u8 known_bssids_len) + { + int count = 1, len = 0; + + while (count < hapd->iface->num_bss) +- len += hostapd_eid_multiple_bssid_chunk_len(hapd, hidden, +- &count, is_beacon); +- ++ len += hostapd_eid_multiple_bssid_chunk_len(hapd, req_bss, ++ &count, is_beacon, ++ known_bssids, ++ known_bssids_len); + return len; + } + + + static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, +- struct hostapd_data *hidden, ++ struct hostapd_data *req_bss, + u8 *eid, u8 *end, int *count, +- u8 is_beacon, u8 *dtim_offset[]) ++ u8 is_beacon, u8 *dtim_offset[], ++ const u8 *known_bssids, ++ u8 known_bssids_len) + { + struct hostapd_data *bss; + struct hostapd_bss_config *conf; +- u8 *size_offset, *num_offset; +- int i, ie_count = 0; ++ u8 *size_offset, *num_offset, mask; ++ int i, j, ie_count = 0; + u8 non_inherit_ie[3] = {0}; + + *eid++ = WLAN_EID_MULTIPLE_BSSID; +@@ -7134,11 +7146,17 @@ static u8 * hostapd_eid_multiple_bssid_c + num_offset = eid++; + + for (i = *count; i < hapd->iface->num_bss; i++) { +- bss = hapd->iface->bss[i]; +- conf = bss->conf; + u8 *bss_size_offset, *index_size_offset, *pos = eid; + u16 capab_info; + ie_count = 0; ++ bss = hapd->iface->bss[i]; ++ conf = bss->conf; ++ ++ j = i / 8; ++ mask = (u8)1 << (i % 8); ++ if ((j < known_bssids_len) && known_bssids && ++ (known_bssids[j] & mask)) ++ continue; + + *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; + bss_size_offset = eid++; +@@ -7150,7 +7168,7 @@ static u8 * hostapd_eid_multiple_bssid_c + eid += sizeof(capab_info); + + *eid++ = WLAN_EID_SSID; +- if (!conf->ignore_broadcast_ssid || bss == hidden) { ++ if (!conf->ignore_broadcast_ssid || bss == req_bss) { + *eid++ = conf->ssid.ssid_len; + os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; +@@ -7226,9 +7244,10 @@ multiple_bssid_too_big: + + + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +- struct hostapd_data *hidden, u8 *eid, u8 *end, ++ struct hostapd_data *req_bss, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max, u8 ema_beacon) ++ int eid_max, u8 ema_beacon, ++ const u8 *known_bssids, u8 known_bssids_len) + { + int count = 1, dtim_period; + u8 remainder, **dtim_offset = NULL; +@@ -7245,9 +7264,11 @@ u8 * hostapd_eid_multiple_bssid(struct h + eid_offsets[*eid_count] = eid; + *eid_count = *eid_count + 1; + } +- eid = hostapd_eid_multiple_bssid_chunk(hapd, hidden, eid, end, ++ eid = hostapd_eid_multiple_bssid_chunk(hapd, req_bss, eid, end, + &count, is_beacon, +- dtim_offset); ++ dtim_offset, ++ known_bssids, ++ known_bssids_len); + } + + if (!eid_count || !(*eid_count)) { +Index: hostapd-2021-02-20/src/ap/ieee802_11.h +=================================================================== +--- hostapd-2021-02-20.orig/src/ap/ieee802_11.h ++++ hostapd-2021-02-20/src/ap/ieee802_11.h +@@ -130,12 +130,13 @@ int hostapd_update_time_adv(struct hosta + void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); + u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +- struct hostapd_data *hidden, u8 *eid, u8 *end, ++ struct hostapd_data *req_bss, u8 *eid, u8 *end, + u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max, u8 ema_beacon); ++ int eid_max, u8 ema_beacon, ++ const u8 *known_bssids, u8 known_bssids_len); + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *hidden, +- u8 is_beacon); ++ struct hostapd_data *req_bss, u8 is_beacon, ++ const u8 *known_bssids, u8 known_bssids_len); + u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp); + size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); +Index: hostapd-2021-02-20/src/common/ieee802_11_common.c +=================================================================== +--- hostapd-2021-02-20.orig/src/common/ieee802_11_common.c ++++ hostapd-2021-02-20/src/common/ieee802_11_common.c +@@ -307,6 +307,10 @@ static int ieee802_11_parse_extension(co + elems->pasn_params = pos; + elems->pasn_params_len = elen; + break; ++ case WLAN_EID_EXT_KNOWN_BSSID: ++ elems->known_bssids = pos; ++ elems->known_bssids_len = elen; ++ break; + default: + if (show_errors) { + wpa_printf(MSG_MSGDUMP, +Index: hostapd-2021-02-20/src/common/ieee802_11_common.h +=================================================================== +--- hostapd-2021-02-20.orig/src/common/ieee802_11_common.h ++++ hostapd-2021-02-20/src/common/ieee802_11_common.h +@@ -118,6 +118,7 @@ struct ieee802_11_elems { + const u8 *sae_pk; + const u8 *s1g_capab; + const u8 *pasn_params; ++ const u8 *known_bssids; + + u8 ssid_len; + u8 supp_rates_len; +@@ -172,6 +173,7 @@ struct ieee802_11_elems { + u8 short_ssid_list_len; + u8 sae_pk_len; + u8 pasn_params_len; ++ u8 known_bssids_len; + + struct mb_ies_info mb_ies; + struct frag_ies_info frag_ies; +Index: hostapd-2021-02-20/src/common/ieee802_11_defs.h +=================================================================== +--- hostapd-2021-02-20.orig/src/common/ieee802_11_defs.h ++++ hostapd-2021-02-20/src/common/ieee802_11_defs.h +@@ -483,6 +483,7 @@ + #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 + #define WLAN_EID_EXT_OCV_OCI 54 + #define WLAN_EID_EXT_NON_INHERITANCE 56 ++#define WLAN_EID_EXT_KNOWN_BSSID 57 + #define WLAN_EID_EXT_SHORT_SSID_LIST 58 + #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 + #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch b/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch new file mode 100644 index 000000000..837269f82 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch @@ -0,0 +1,187 @@ +From a0eb57f97ecf06c6244dc15ae9cbc4f14b793563 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 10 Dec 2020 10:55:55 -0800 +Subject: [PATCH 2/9] hostapd: Rename functions used for reduced neighbor + report + +This patch rename functions from *_reduced_neighbor_report_* to *_rnr_* +to make those shorter. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 12 ++++++------ + src/ap/ieee802_11.c | 34 +++++++++++++++------------------- + src/ap/ieee802_11.h | 4 ++-- + 3 files changed, 23 insertions(+), 27 deletions(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -486,7 +486,7 @@ static u8 * hostapd_gen_probe_resp(struc + known_bssids, + known_bssids_len); + if (hapd->conf->rnr_beacon) +- buflen += hostapd_eid_reduced_neighbor_report_len(hapd, 1); ++ buflen += hostapd_eid_rnr_len(hapd, 1); + + resp = os_zalloc(buflen); + if (resp == NULL) +@@ -656,7 +656,7 @@ static u8 * hostapd_gen_probe_resp(struc + pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); + if (hapd->conf->rnr_beacon) +- pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 1); ++ pos = hostapd_eid_rnr(hapd, pos, 1); + + if (hapd->conf->vendor_elements) { + os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), +@@ -1354,7 +1354,7 @@ static u8 * hostapd_gen_fils_discovery(s + total_len += 3; + } + +- total_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); ++ total_len += hostapd_eid_rnr_len(hapd, 0); + + pos = hostapd_eid_fils_indic(hapd, buf, 0); + buf_len = pos - buf; +@@ -1424,7 +1424,7 @@ static u8 * hostapd_gen_fils_discovery(s + /* Fill in the Length field value */ + *length_pos = pos - (length_pos + 1); + +- pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 0); ++ pos = hostapd_eid_rnr(hapd, pos, 0); + + /* FILS Indication element */ + if (buf_len) { +@@ -1516,7 +1516,7 @@ int ieee802_11_build_ap_params(struct ho + tail_len += hostapd_eid_owe_trans_len(hapd); + tail_len += hostapd_eid_dpp_cc_len(hapd); + if (hapd->conf->rnr_beacon) +- tail_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0); ++ tail_len += hostapd_eid_rnr_len(hapd, 0); + + tailpos = tail = os_malloc(tail_len); + if (head == NULL || tail == NULL) { +@@ -1702,7 +1702,7 @@ int ieee802_11_build_ap_params(struct ho + tail + tail_len - tailpos); + tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); + if (hapd->conf->rnr_beacon) +- tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos, 0); ++ tailpos = hostapd_eid_rnr(hapd, tailpos, 0); + + if (hapd->conf->vendor_elements) { + os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7279,8 +7279,8 @@ u8 * hostapd_eid_multiple_bssid(struct h + } + + +-size_t hostapd_eid_reduced_neighbor_report_iface_len(struct hostapd_data *hapd, +- struct hostapd_data *reporting_hapd) ++size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd) + { + size_t len = 0; + int i; +@@ -7294,15 +7294,14 @@ size_t hostapd_eid_reduced_neighbor_repo + } + + +-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp) ++size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp) + { + size_t len = 0; + int i; + + if (hapd->iface->num_bss > 1) + len += (TBTT_HEADER_LENGTH + +- hostapd_eid_reduced_neighbor_report_iface_len(hapd, +- hapd)); ++ hostapd_eid_rnr_iface_len(hapd, hapd)); + + for (i = 0; i < hapd->iface->interfaces->count; i++) { + struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; +@@ -7311,8 +7310,7 @@ size_t hostapd_eid_reduced_neighbor_repo + continue; + + len += (TBTT_HEADER_LENGTH + +- hostapd_eid_reduced_neighbor_report_iface_len(iface->bss[0], +- hapd)); ++ hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); + } + + if (!probe_resp && !dl_list_empty(&hapd->nr_db)) +@@ -7325,9 +7323,9 @@ size_t hostapd_eid_reduced_neighbor_repo + } + + +-static u8 *hostapd_eid_reduced_neighbor_report_iface(struct hostapd_data *hapd, +- struct hostapd_data *reporting_hapd, +- u8 *eid, int *count) ++static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd, ++ u8 *eid, int *count) + { + u8 *eid_start = eid, *tbtt_count_pos; + u8 tbtt_count = 0; +@@ -7391,7 +7389,8 @@ static u8 *hostapd_eid_reduced_neighbor_ + } + + +-static u8 *hostapd_eid_reduced_neighbor_report_nr_db(struct hostapd_data *hapd, u8 *eid, int *count) ++static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, ++ int *count) + { + struct hostapd_neighbor_entry *nr; + +@@ -7420,9 +7419,9 @@ static u8 *hostapd_eid_reduced_neighbor_ + } + + +-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp) ++u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp) + { +- size_t len = hostapd_eid_reduced_neighbor_report_len(hapd, probe_resp); ++ size_t len = hostapd_eid_rnr_len(hapd, probe_resp); + int i, count = 0; + u8 *size_offset; + +@@ -7433,8 +7432,7 @@ u8 * hostapd_eid_reduced_neighbor_report + size_offset = eid++; + + if (hapd->iface->num_bss > 1) +- eid = hostapd_eid_reduced_neighbor_report_iface(hapd, hapd, +- eid, &count); ++ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); + + for (i = 0; i < hapd->iface->interfaces->count; i++) { + struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; +@@ -7442,13 +7440,11 @@ u8 * hostapd_eid_reduced_neighbor_report + if (iface == hapd->iface || !iface->conf->he_co_locate) + continue; + +- eid = hostapd_eid_reduced_neighbor_report_iface(iface->bss[0], +- hapd, eid, +- &count); ++ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, &count); + } + + if (!probe_resp) +- hostapd_eid_reduced_neighbor_report_nr_db(hapd, eid, &count); ++ eid = hostapd_eid_neighbor_report_db(hapd, eid, &count); + + if (!count) + eid -= 2; +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -137,8 +137,8 @@ u8 * hostapd_eid_multiple_bssid(struct h + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, + struct hostapd_data *req_bss, u8 is_beacon, + const u8 *known_bssids, u8 known_bssids_len); +-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp); +-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp); ++u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp); ++size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); + #ifdef CONFIG_SAE + void sae_clear_retransmit_timer(struct hostapd_data *hapd, diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch b/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch new file mode 100644 index 000000000..e7caf8dd6 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch @@ -0,0 +1,167 @@ +From 60b184884f0105c57977d67eb92e8342337009af Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 10 Dec 2020 13:07:15 -0800 +Subject: [PATCH 3/9] hostapd: Type of frame instead of 'probe_resp' flag in + RNR functions + +Functions related to generation of reduced neighbor report element accept +flag 'probe_resp' as an input parameter to differentiate between beacons +and probe responses. + +This patch instead uses frame type as input as RNR can also be added in +FILS discovery frame. + +Frame type is used to decide whether to add data for co-located APs/APs from +same ESS in RNR. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 12 ++++++------ + src/ap/ieee802_11.c | 36 ++++++++++++++++++++---------------- + src/ap/ieee802_11.h | 4 ++-- + 3 files changed, 28 insertions(+), 24 deletions(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -486,7 +486,7 @@ static u8 * hostapd_gen_probe_resp(struc + known_bssids, + known_bssids_len); + if (hapd->conf->rnr_beacon) +- buflen += hostapd_eid_rnr_len(hapd, 1); ++ buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); + + resp = os_zalloc(buflen); + if (resp == NULL) +@@ -656,7 +656,7 @@ static u8 * hostapd_gen_probe_resp(struc + pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); + if (hapd->conf->rnr_beacon) +- pos = hostapd_eid_rnr(hapd, pos, 1); ++ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP); + + if (hapd->conf->vendor_elements) { + os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), +@@ -1354,7 +1354,7 @@ static u8 * hostapd_gen_fils_discovery(s + total_len += 3; + } + +- total_len += hostapd_eid_rnr_len(hapd, 0); ++ total_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_ACTION); + + pos = hostapd_eid_fils_indic(hapd, buf, 0); + buf_len = pos - buf; +@@ -1424,7 +1424,7 @@ static u8 * hostapd_gen_fils_discovery(s + /* Fill in the Length field value */ + *length_pos = pos - (length_pos + 1); + +- pos = hostapd_eid_rnr(hapd, pos, 0); ++ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_ACTION); + + /* FILS Indication element */ + if (buf_len) { +@@ -1516,7 +1516,7 @@ int ieee802_11_build_ap_params(struct ho + tail_len += hostapd_eid_owe_trans_len(hapd); + tail_len += hostapd_eid_dpp_cc_len(hapd); + if (hapd->conf->rnr_beacon) +- tail_len += hostapd_eid_rnr_len(hapd, 0); ++ tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON); + + tailpos = tail = os_malloc(tail_len); + if (head == NULL || tail == NULL) { +@@ -1702,7 +1702,7 @@ int ieee802_11_build_ap_params(struct ho + tail + tail_len - tailpos); + tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); + if (hapd->conf->rnr_beacon) +- tailpos = hostapd_eid_rnr(hapd, tailpos, 0); ++ tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON); + + if (hapd->conf->vendor_elements) { + os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7294,7 +7294,7 @@ size_t hostapd_eid_rnr_iface_len(struct + } + + +-size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp) ++size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) + { + size_t len = 0; + int i; +@@ -7303,17 +7303,19 @@ size_t hostapd_eid_rnr_len(struct hostap + len += (TBTT_HEADER_LENGTH + + hostapd_eid_rnr_iface_len(hapd, hapd)); + +- for (i = 0; i < hapd->iface->interfaces->count; i++) { +- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ if (type != WLAN_FC_STYPE_ACTION) { ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; + +- if (iface == hapd->iface || !iface->conf->he_co_locate) +- continue; ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; + +- len += (TBTT_HEADER_LENGTH + +- hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); ++ len += (TBTT_HEADER_LENGTH + ++ hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); ++ } + } + +- if (!probe_resp && !dl_list_empty(&hapd->nr_db)) ++ if ((type == WLAN_FC_STYPE_BEACON) && !dl_list_empty(&hapd->nr_db)) + len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); + + if (len) +@@ -7419,9 +7421,9 @@ static u8 *hostapd_eid_neighbor_report_d + } + + +-u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp) ++u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) + { +- size_t len = hostapd_eid_rnr_len(hapd, probe_resp); ++ size_t len = hostapd_eid_rnr_len(hapd, type); + int i, count = 0; + u8 *size_offset; + +@@ -7434,16 +7436,18 @@ u8 * hostapd_eid_rnr(struct hostapd_data + if (hapd->iface->num_bss > 1) + eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); + +- for (i = 0; i < hapd->iface->interfaces->count; i++) { +- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ if (type != WLAN_FC_STYPE_ACTION) { ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; + +- if (iface == hapd->iface || !iface->conf->he_co_locate) +- continue; ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; + +- eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, &count); ++ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, &count); ++ } + } + +- if (!probe_resp) ++ if (type == WLAN_FC_STYPE_BEACON) + eid = hostapd_eid_neighbor_report_db(hapd, eid, &count); + + if (!count) +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -137,8 +137,8 @@ u8 * hostapd_eid_multiple_bssid(struct h + int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, + struct hostapd_data *req_bss, u8 is_beacon, + const u8 *known_bssids, u8 known_bssids_len); +-u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp); +-size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp); ++u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type); ++size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); + #ifdef CONFIG_SAE + void sae_clear_retransmit_timer(struct hostapd_data *hapd, diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch b/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch new file mode 100644 index 000000000..ddc323055 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch @@ -0,0 +1,216 @@ +From 381cd16dea77e1966f4fff249dde5092663546da Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 10 Dec 2020 12:10:11 -0800 +Subject: [PATCH 4/9] hostapd: Limit addition of co-located APs to 6GHz band. + +(1) New function to decide if co-located 6GHz APs are present. +(2) Move the checks for option 'rnr_beacon' from beacon.c to RNR + function definitions and add check for 6GHz colocation. This way + co-located 6GHz APs are included in RNR even if 'rnr_beacon' is + not set. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 12 ++--- + src/ap/ieee802_11.c | 106 +++++++++++++++++++++++++++++++++----------- + 2 files changed, 85 insertions(+), 33 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index eda20fc0d9df..74ac8584ab5e 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -485,8 +485,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + buflen += hostapd_eid_multiple_bssid_len(hapd, req_bss, 0, + known_bssids, + known_bssids_len); +- if (hapd->conf->rnr_beacon) +- buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); ++ buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); + + resp = os_zalloc(buflen); + if (resp == NULL) +@@ -652,8 +651,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, + pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); + pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); +- if (hapd->conf->rnr_beacon) +- pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP); ++ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP); + + if (hapd->conf->vendor_elements) { + os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), +@@ -1532,8 +1530,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + tail_len += hostapd_mbo_ie_len(hapd); + tail_len += hostapd_eid_owe_trans_len(hapd); + tail_len += hostapd_eid_dpp_cc_len(hapd); +- if (hapd->conf->rnr_beacon) +- tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON); ++ tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON); + + tailpos = tail = os_malloc(tail_len); + if (head == NULL || tail == NULL) { +@@ -1711,8 +1708,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + tailpos = hostapd_eid_owe_trans(hapd, tailpos, + tail + tail_len - tailpos); + tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); +- if (hapd->conf->rnr_beacon) +- tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON); ++ tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON); + + if (hapd->conf->vendor_elements) { + os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 97c5b42a7528..488f02f58f63 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5989,6 +5989,7 @@ size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, + { + size_t len = 0; + int i; ++ + for (i = 0; i < hapd->iface->num_bss; i++) { + if (hapd->iface->bss[i] == reporting_hapd || + hapd->iface->bss[i]->conf->ignore_broadcast_ssid) +@@ -5999,29 +6000,69 @@ size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, + } + + +-size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) ++static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd) + { ++ struct hostapd_iface *iface; + size_t len = 0; + int i; + +- if (hapd->iface->num_bss > 1) ++ if ((hapd->iface == NULL) || (hapd->iface->interfaces == NULL)) ++ return 0; ++ ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ iface = hapd->iface->interfaces->iface[i]; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ + len += (TBTT_HEADER_LENGTH + +- hostapd_eid_rnr_iface_len(hapd, hapd)); ++ hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); ++ } ++ return len; ++} ++ ++ ++static bool is_6ghz_colocated(struct hostapd_data *hapd) ++{ ++ u8 i; ++ struct hostapd_iface *iface; ++ ++ if ((hapd->iface == NULL) || (hapd->iface->interfaces == NULL)) ++ return false; ++ ++ if (is_6ghz_op_class(hapd->iconf->op_class) || ++ hapd->iface->interfaces->count == 1) ++ return false; ++ ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ iface = hapd->iface->interfaces->iface[i]; ++ if (iface == hapd->iface) ++ continue; ++ ++ if (is_6ghz_op_class(iface->bss[0]->iconf->op_class) && ++ iface->conf->he_co_locate) ++ return true; ++ } ++ return false; ++} + +- if (type != WLAN_FC_STYPE_ACTION) { +- for (i = 0; i < hapd->iface->interfaces->count; i++) { +- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; + +- if (iface == hapd->iface || !iface->conf->he_co_locate) +- continue; ++size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) ++{ ++ size_t len = 0; + ++ if (hapd->conf->rnr_beacon) { ++ if (hapd->iface->num_bss > 1) + len += (TBTT_HEADER_LENGTH + +- hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); +- } ++ hostapd_eid_rnr_iface_len(hapd, hapd)); ++ ++ if ((type == WLAN_FC_STYPE_BEACON) && ++ !dl_list_empty(&hapd->nr_db)) ++ len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); + } + +- if ((type == WLAN_FC_STYPE_BEACON) && !dl_list_empty(&hapd->nr_db)) +- len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) ++ len += hostapd_eid_rnr_colocation_len(hapd); + + if (len) + len += 2; /* Element ID and length */ +@@ -6096,6 +6137,27 @@ static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, + } + + ++static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid, ++ int *count) ++{ ++ struct hostapd_iface *iface; ++ int i; ++ ++ if ((hapd->iface == NULL) || (hapd->iface->interfaces == NULL)) ++ return eid; ++ ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ iface = hapd->iface->interfaces->iface[i]; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ ++ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, count); ++ } ++ return eid; ++} ++ ++ + static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, + int *count) + { +@@ -6138,22 +6200,16 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) + *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; + size_offset = eid++; + +- if (hapd->iface->num_bss > 1) +- eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); +- +- if (type != WLAN_FC_STYPE_ACTION) { +- for (i = 0; i < hapd->iface->interfaces->count; i++) { +- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ if (hapd->conf->rnr_beacon) { ++ if (hapd->iface->num_bss > 1) ++ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); + +- if (iface == hapd->iface || !iface->conf->he_co_locate) +- continue; +- +- eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, &count); +- } ++ if (type == WLAN_FC_STYPE_BEACON) ++ eid = hostapd_eid_neighbor_report_db(hapd, eid, &count); + } + +- if (type == WLAN_FC_STYPE_BEACON) +- eid = hostapd_eid_neighbor_report_db(hapd, eid, &count); ++ if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) ++ eid = hostapd_eid_rnr_colocation(hapd, eid, &count); + + if (!count) + eid -= 2; +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch b/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch new file mode 100644 index 000000000..b43d5715b --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch @@ -0,0 +1,404 @@ +From f8217bb43d1157dbd83c1361dd44b66b81bd70b8 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 10 Dec 2020 14:12:33 -0800 +Subject: [PATCH 5/9] hostapd: Length checks for reduced neighbor report + +Maximum length of any RNR element can be 255 bytes. +This commit adds code to check the length in all RNR related functions +and creates a new element if required. + +Additionally, this change modifies some incorrect calculations used for +for total lengths. + +Signed-off-by: Aloka Dixit +--- + src/ap/ieee802_11.c | 247 +++++++++++++++++++++++------------ + src/common/ieee802_11_defs.h | 2 + + 2 files changed, 166 insertions(+), 83 deletions(-) + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 488f02f58f63..953a444a5cd4 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5985,22 +5985,48 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + + + size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, +- struct hostapd_data *reporting_hapd) ++ struct hostapd_data *reporting_hapd, ++ size_t *current_len) + { +- size_t len = 0; +- int i; ++ size_t total_len = 0; ++ int i, tbtt_count = 0, start = 0; ++ ++ while (start < hapd->iface->num_bss) { ++ if (!(*current_len) || ++ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > ++ 255)) { ++ *current_len = RNR_HEADER_LENGTH; ++ total_len += RNR_HEADER_LENGTH; ++ } + +- for (i = 0; i < hapd->iface->num_bss; i++) { +- if (hapd->iface->bss[i] == reporting_hapd || +- hapd->iface->bss[i]->conf->ignore_broadcast_ssid) +- continue; +- len += TBTT_INFO_LENGTH; ++ *current_len += TBTT_HEADER_LENGTH; ++ total_len += TBTT_HEADER_LENGTH; ++ ++ for (i = start; i < hapd->iface->num_bss; i++) { ++ if (hapd->iface->bss[i] == reporting_hapd || ++ hapd->conf->ignore_broadcast_ssid) ++ continue; ++ ++ if ((*current_len + TBTT_INFO_LENGTH > 255) || ++ (tbtt_count >= TBTT_INFO_COUNT_MAX)) ++ break; ++ ++ *current_len += TBTT_INFO_LENGTH; ++ total_len += TBTT_INFO_LENGTH; ++ tbtt_count++; ++ } ++ start = i; + } +- return len; ++ ++ if (!tbtt_count) ++ total_len = 0; ++ ++ return total_len; + } + + +-static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd) ++static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd, ++ size_t *current_len) + { + struct hostapd_iface *iface; + size_t len = 0; +@@ -6015,8 +6041,35 @@ static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd) + if (iface == hapd->iface || !iface->conf->he_co_locate) + continue; + +- len += (TBTT_HEADER_LENGTH + +- hostapd_eid_rnr_iface_len(iface->bss[0], hapd)); ++ len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd, ++ current_len); ++ } ++ return len; ++} ++ ++ ++static size_t hostapd_eid_neighbor_report_db_len(struct hostapd_data *hapd, ++ size_t *current_len) ++{ ++ struct hostapd_neighbor_entry *nr; ++ size_t len = 0; ++ ++ dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, ++ list) { ++ if (!nr->nr || wpabuf_len(nr->nr) < 12) ++ continue; ++ if (nr->short_ssid == hapd->conf->ssid.short_ssid) ++ continue; ++ ++ if (!*current_len || ++ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > ++ 255)) { ++ *current_len = RNR_HEADER_LENGTH; ++ len += RNR_HEADER_LENGTH; ++ } ++ ++ *current_len += (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ len += (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); + } + return len; + } +@@ -6049,23 +6102,21 @@ static bool is_6ghz_colocated(struct hostapd_data *hapd) + + size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) + { +- size_t len = 0; ++ size_t len = 0, current_len = 0; + + if (hapd->conf->rnr_beacon) { + if (hapd->iface->num_bss > 1) +- len += (TBTT_HEADER_LENGTH + +- hostapd_eid_rnr_iface_len(hapd, hapd)); ++ len += hostapd_eid_rnr_iface_len(hapd, hapd, ++ ¤t_len); + + if ((type == WLAN_FC_STYPE_BEACON) && +- !dl_list_empty(&hapd->nr_db)) +- len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); ++ !dl_list_empty(&hapd->nr_db)) ++ len += hostapd_eid_neighbor_report_db_len(hapd, ++ ¤t_len); + } + + if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) +- len += hostapd_eid_rnr_colocation_len(hapd); +- +- if (len) +- len += 2; /* Element ID and length */ ++ len += hostapd_eid_rnr_colocation_len(hapd, ¤t_len); + + return len; + } +@@ -6073,72 +6124,95 @@ size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) + + static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, + struct hostapd_data *reporting_hapd, +- u8 *eid, int *count) ++ u8 *eid, size_t *current_len) + { +- u8 *eid_start = eid, *tbtt_count_pos; +- u8 tbtt_count = 0; +- u8 op_class, channel; +- int i; ++ u8 *eid_start = eid, *tbtt_count_pos = NULL; ++ u8 tbtt_count = 0, op_class, channel, bss_param; ++ u8 *size_offset = (eid - *current_len) + 1; ++ int i, start = 0; ++ struct hostapd_data *bss; ++ struct hostapd_iface *iface = hapd->iface; + +- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || +- !hapd->iface->freq) ++ if (!(iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || !iface->freq) + return eid; + +- if (ieee80211_freq_to_channel_ext(hapd->iface->freq, ++ if (ieee80211_freq_to_channel_ext(iface->freq, + hapd->iconf->secondary_channel, + hostapd_get_oper_chwidth(hapd->iconf), + &op_class, &channel) == + NUM_HOSTAPD_MODES) + return eid; + +- tbtt_count_pos = eid++; +- *eid++ = TBTT_INFO_LENGTH; +- *eid++ = op_class; +- *eid++ = hapd->iconf->channel; +- for (i = 0; i < hapd->iface->num_bss; i++) { +- u8 bss_param = 0; ++ while (start < iface->num_bss) { ++ if (!(*current_len) || ++ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > ++ 255)) { ++ eid_start = eid; ++ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; ++ size_offset = eid++; ++ *current_len = RNR_HEADER_LENGTH; ++ tbtt_count = 0; ++ } + +- if (hapd->iface->bss[i] == reporting_hapd || +- hapd->iface->bss[i]->conf->ignore_broadcast_ssid) +- continue; ++ tbtt_count_pos = eid++; ++ *eid++ = TBTT_INFO_LENGTH; ++ *eid++ = op_class; ++ *eid++ = hapd->iconf->channel; ++ *current_len += TBTT_HEADER_LENGTH; + +- *eid++ = TBTT_AP_OFFSET_UNKNOWN; +- os_memcpy(eid, hapd->iface->bss[i]->conf->bssid, ETH_ALEN); +- eid += 6; +- os_memcpy(eid, &hapd->iface->bss[i]->conf->ssid.short_ssid, 4); +- eid += 4; +- if (hapd->iface->bss[i]->conf->ssid.short_ssid == +- reporting_hapd->conf->ssid.short_ssid) +- bss_param |= TBTT_BSS_PARAM_SAME_SSID; +- +- if (hapd->iconf->multiple_bssid && hapd->iface->num_bss > 1) { +- bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; +- if (hapd->iface->bss[i] == hostapd_get_primary_bss(hapd->iface->bss[i])) +- bss_param |= TBTT_BSS_PARAM_TRANSMITTED_BSSID; +- } +- if (hapd->iface->bss[i]->iconf->he_co_locate) +- bss_param |= TBTT_BSS_PARAM_CO_LOCATED; ++ for (i = start; i < iface->num_bss; i++) { ++ bss_param = 0; ++ bss = iface->bss[i]; + +- if (hapd->iface->bss[i]->conf->unsol_bcast_probe_resp_interval) +- bss_param |= TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE; ++ if (bss == reporting_hapd || ++ hapd->conf->ignore_broadcast_ssid) ++ continue; + +- *eid++ = bss_param; +- /* Setting 20 MHz PSD */ +- *eid++ = TBTT_PSD_MAX_TXPOWER - 1; +- *count += 1; +- tbtt_count++; ++ if ((*current_len + TBTT_INFO_LENGTH > 255) || ++ (tbtt_count >= TBTT_INFO_COUNT_MAX)) ++ break; ++ ++ *eid++ = TBTT_AP_OFFSET_UNKNOWN; ++ os_memcpy(eid, bss->conf->bssid, ETH_ALEN); ++ eid += ETH_ALEN; ++ os_memcpy(eid, &bss->conf->ssid.short_ssid, 4); ++ eid += 4; ++ if (bss->conf->ssid.short_ssid == ++ reporting_hapd->conf->ssid.short_ssid) ++ bss_param |= TBTT_BSS_PARAM_SAME_SSID; ++ ++ if (hapd->iconf->multiple_bssid && ++ (iface->num_bss > 1)) { ++ bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; ++ if (bss == hostapd_get_primary_bss(bss)) ++ bss_param |= TBTT_BSS_PARAM_TRANSMITTED_BSSID; ++ } ++ if (bss->iconf->he_co_locate) ++ bss_param |= TBTT_BSS_PARAM_CO_LOCATED; ++ ++ if (bss->conf->unsol_bcast_probe_resp_interval) ++ bss_param |= TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE; ++ ++ *eid++ = bss_param; ++ *eid++ = TBTT_PSD_MAX_TXPOWER - 1; ++ *current_len += TBTT_INFO_LENGTH; ++ tbtt_count += 1; ++ } ++ ++ start = i; ++ *tbtt_count_pos = TBTT_INFO_COUNT(tbtt_count - 1); ++ *size_offset = (eid - size_offset) - 1; + } + + if (tbtt_count == 0) + return eid_start; + +- *tbtt_count_pos = TBTT_INFO_COUNT(tbtt_count - 1); + return eid; + } + + + static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid, +- int *count) ++ size_t *current_len) + { + struct hostapd_iface *iface; + int i; +@@ -6152,36 +6226,50 @@ static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid, + if (iface == hapd->iface || !iface->conf->he_co_locate) + continue; + +- eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, count); ++ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, ++ current_len); + } + return eid; + } + + + static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, +- int *count) ++ size_t *current_len) + { + struct hostapd_neighbor_entry *nr; ++ u8 *size_offset = (eid - *current_len) + 1; + + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, + list) { + if (!nr->nr || wpabuf_len(nr->nr) < 12) + continue; ++ + if (nr->short_ssid == hapd->conf->ssid.short_ssid) + continue; ++ ++ if (!*current_len || ++ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > ++ 255)) { ++ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; ++ size_offset = eid++; ++ *current_len = RNR_HEADER_LENGTH; ++ } ++ + *eid++ = 0; + *eid++ = TBTT_INFO_LENGTH; + *eid++ = wpabuf_head_u8(nr->nr)[10]; + *eid++ = wpabuf_head_u8(nr->nr)[11]; ++ *current_len += TBTT_HEADER_LENGTH; + *eid++ = TBTT_AP_OFFSET_UNKNOWN; + os_memcpy(eid, nr->bssid, ETH_ALEN); +- eid += 6; ++ eid += ETH_ALEN; + os_memcpy(eid, &nr->short_ssid, 4); + eid += 4; + *eid++ = nr->bss_parameters; + /* setting 20 MHZ PSD */ + *eid++ = TBTT_PSD_MAX_TXPOWER - 1; +- *count += 1; ++ *current_len += TBTT_INFO_LENGTH; ++ *size_offset = (eid - size_offset) - 1; + } + + return eid; +@@ -6190,31 +6278,24 @@ static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, + + u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) + { +- size_t len = hostapd_eid_rnr_len(hapd, type); +- int i, count = 0; +- u8 *size_offset; +- +- if (!len) +- return eid; +- +- *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; +- size_offset = eid++; ++ u8 *eid_start = eid; ++ size_t current_len = 0; + + if (hapd->conf->rnr_beacon) { + if (hapd->iface->num_bss > 1) +- eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); ++ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, ++ ¤t_len); + + if (type == WLAN_FC_STYPE_BEACON) +- eid = hostapd_eid_neighbor_report_db(hapd, eid, &count); ++ eid = hostapd_eid_neighbor_report_db(hapd, eid, ++ ¤t_len); + } + + if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) +- eid = hostapd_eid_rnr_colocation(hapd, eid, &count); ++ eid = hostapd_eid_rnr_colocation(hapd, eid, ¤t_len); + +- if (!count) +- eid -= 2; +- else +- *size_offset = (eid - size_offset) - 1; ++ if (eid == (eid_start + 2)) ++ return eid_start; + + return eid; + } +diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h +index 52e2c868e723..ab7f36f39196 100644 +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -2420,10 +2420,12 @@ enum mscs_description_subelem { + #define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 + + /* TBTT Information field defines */ ++#define RNR_HEADER_LENGTH 2 + #define TBTT_HEADER_LENGTH 4 + #define TBTT_INFO_LENGTH 13 + #define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) + #define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) ++#define TBTT_INFO_COUNT_MAX 16 + #define TBTT_AP_OFFSET_UNKNOWN 255 + #define TBTT_BSS_PARAM_OCT_RECOMMENDED BIT(0) + #define TBTT_BSS_PARAM_SAME_SSID BIT(1) +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch b/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch new file mode 100644 index 000000000..ccab1f9f5 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch @@ -0,0 +1,94 @@ +From 56994b4ac2ad1966065f4a09977fcd5102b052ab Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Fri, 11 Dec 2020 11:49:08 -0800 +Subject: [PATCH 6/9] hostapd: Change storage class of multiple BSSID functions + +This patch changes the variables and input parameters used for length +from int to size_t. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 2 +- + src/ap/ieee802_11.c | 25 +++++++++++++------------ + src/ap/ieee802_11.h | 6 +++--- + 3 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 74ac8584ab5e..fcc3b7517bcb 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1815,7 +1815,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, + } + + if (hapd->iconf->multiple_bssid) { +- int len; ++ size_t len; + u8 *end; + + params->multiple_bssid_index = hostapd_get_bss_index(hapd); +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index 953a444a5cd4..b13f6ee47b8a 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -5753,15 +5753,15 @@ int hostapd_config_read_maclist(const char *fname, + } + + +-static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, +- struct hostapd_data *req_bss, +- int *count, u8 is_beacon, +- const u8 *known_bssids, +- u8 known_bssids_len) ++static size_t hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, ++ struct hostapd_data *req_bss, ++ int *count, u8 is_beacon, ++ const u8 *known_bssids, ++ u8 known_bssids_len) + { + /* ID + size + count */ +- int i, j, len = 3, nontx_profile_len; +- size_t ies_len = 0; ++ int i, j; ++ size_t ies_len = 0, len = 3, nontx_profile_len; + u8 mask; + struct hostapd_data *bss; + struct hostapd_bss_config *conf; +@@ -5810,12 +5810,13 @@ multiple_bssid_too_big: + } + + +-int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *req_bss, +- u8 is_beacon, const u8 *known_bssids, +- u8 known_bssids_len) ++size_t hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, ++ struct hostapd_data *req_bss, ++ u8 is_beacon, const u8 *known_bssids, ++ u8 known_bssids_len) + { +- int count = 1, len = 0; ++ int count = 1; ++ size_t len = 0; + + while (count < hapd->iface->num_bss) + len += hostapd_eid_multiple_bssid_chunk_len(hapd, req_bss, +diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h +index 74e426bc99f0..8e70bc3aa84a 100644 +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -134,9 +134,9 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + u8 is_beacon, u8 **eid_offsets, int *eid_count, + int eid_max, u8 ema_beacon, + const u8 *known_bssids, u8 known_bssids_len); +-int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *req_bss, u8 is_beacon, +- const u8 *known_bssids, u8 known_bssids_len); ++size_t hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, ++ struct hostapd_data *req_bss, u8 is_beacon, ++ const u8 *known_bssids, u8 known_bssids_len); + u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type); + size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); +-- +2.25.0 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch b/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch new file mode 100644 index 000000000..8a615a057 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch @@ -0,0 +1,712 @@ +From 78bf22c80ae49d8721283b683fce8e86a75ec03d Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Thu, 10 Dec 2020 15:13:11 -0800 +Subject: [PATCH] hostad: RNR for EMA AP + +(1) Enable RNR by default for EMA AP. +(2) Only for EMA AP, split reduced neighbor report in as many groups as + number of multiple BSSID offset groups. + Each RNR group skips the profiles already include in the corresponding + MBSSID groups. + The last additional group will have data common for all EMA beacons. +(3) Enable reduced neighbor report by default in 5GHz/2.4GHz beacons + and probe responses if one or more 6GHz APs are co-located. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 38 ++++++-- + src/ap/ieee802_11.c | 222 +++++++++++++++++++++++++++++++++---------- + src/ap/ieee802_11.h | 14 +-- + src/drivers/driver.h | 23 +++++ + 4 files changed, 230 insertions(+), 67 deletions(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -482,9 +482,11 @@ static u8 * hostapd_gen_probe_resp(struc + buflen += hostapd_eid_owe_trans_len(hapd); + buflen += hostapd_eid_dpp_cc_len(hapd); + if (hapd->iconf->multiple_bssid) +- buflen += hostapd_eid_multiple_bssid_len(hapd, req_bss, 0, ++ buflen += hostapd_eid_multiple_bssid_len(hapd, req_bss, ++ WLAN_FC_STYPE_PROBE_RESP, + known_bssids, +- known_bssids_len); ++ known_bssids_len, ++ NULL); + buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); + + resp = os_zalloc(buflen); +@@ -556,9 +558,11 @@ static u8 * hostapd_gen_probe_resp(struc + pos = hostapd_get_mde(hapd, pos, epos - pos); + + if (hapd->iconf->multiple_bssid) +- pos = hostapd_eid_multiple_bssid(hapd, req_bss, pos, epos, 0, +- NULL, 0, 0, 0, known_bssids, +- known_bssids_len); ++ pos = hostapd_eid_multiple_bssid(hapd, req_bss, pos, epos, ++ NULL, NULL, NULL, NULL, NULL, ++ 0, known_bssids, ++ known_bssids_len, 0, ++ WLAN_FC_STYPE_PROBE_RESP); + + /* eCSA IE */ + csa_pos = hostapd_eid_ecsa(hapd, pos); +@@ -1824,18 +1828,32 @@ int ieee802_11_build_ap_params(struct ho + if (hapd != hapd->iface->bss[0]) + params->multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; + +- len = hostapd_eid_multiple_bssid_len(hapd, NULL, 1, NULL, 0); ++ len = hostapd_eid_multiple_bssid_len(hapd, NULL, ++ WLAN_FC_STYPE_BEACON, ++ NULL, 0, ++ ¶ms->rnr_ie_len); + params->multiple_bssid_ies = os_zalloc(len); + if (params->multiple_bssid_ies == NULL) + return -1; ++ if (params->rnr_ie_len) { ++ params->rnr_ies = os_zalloc(params->rnr_ie_len); ++ if (params->rnr_ies == NULL) { ++ os_free(params->multiple_bssid_ies); ++ params->multiple_bssid_ies = NULL; ++ return -1; ++ } ++ } + end = hostapd_eid_multiple_bssid(hapd, NULL, + params->multiple_bssid_ies, + params->multiple_bssid_ies + len, +- 1, params->multiple_bssid_ie_offsets, ++ params->multiple_bssid_ie_offsets, + ¶ms->multiple_bssid_ie_count, ++ params->rnr_ies, ++ params->rnr_ie_offsets, ++ ¶ms->rnr_ie_count, ++ params->rnr_ie_len, NULL, 0, + MULTIPLE_BSSID_IE_MAX, +- hapd->iconf->ema_beacon, NULL, +- 0); ++ WLAN_FC_STYPE_BEACON); + params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; + if ((params->multiple_bssid_ie_count > 1) && + (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) +@@ -1857,6 +1875,8 @@ void ieee802_11_free_ap_params(struct wp + params->proberesp = NULL; + os_free(params->multiple_bssid_ies); + params->multiple_bssid_ies = NULL; ++ os_free(params->rnr_ies); ++ params->rnr_ies = NULL; + #ifdef CONFIG_FILS + os_free(params->fd_frame_tmpl); + params->fd_frame_tmpl = NULL; +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -89,6 +89,26 @@ static void handle_auth(struct hostapd_d + int rssi, int from_queue, + struct hostapd_frame_info *fi); + ++enum colocation_mode { ++ NO_COLOCATED_6GHZ, ++ STANDALONE_6GHZ, ++ COLOCATED_6GHZ, ++ COLOCATED_LOWER_BAND, ++}; ++ ++static size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd, ++ size_t *current_len, ++ int skip_ssid_start, int skip_ssid_end); ++static u8 * hostapd_eid_rnr_iface(struct hostapd_data *hapd, ++ struct hostapd_data *reporting_hapd, ++ u8 *eid, size_t *current_len, ++ int skip_ssid_start, int skip_ssid_end); ++static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid, ++ size_t *current_len); ++static u8 * hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, ++ size_t *current_len); ++static enum colocation_mode get_colocation_mode(struct hostapd_data *hapd); + + u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid) + { +@@ -161,6 +181,33 @@ u8 * hostapd_eid_supp_rates(struct hosta + } + + ++size_t hostapd_eid_ext_supp_rates_len(struct hostapd_data *hapd) ++{ ++ int num, h2e_required; ++ ++ if (hapd->iface->current_rates == NULL) ++ return 0; ++ ++ num = hapd->iface->num_rates; ++ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht) ++ num++; ++ ++ if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) ++ num++; ++ ++ h2e_required = (hapd->conf->sae_pwe == 1 || ++ hostapd_sae_pw_id_in_use(hapd->conf) == 2) && ++ hapd->conf->sae_pwe != 3 && ++ wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt); ++ if (h2e_required) ++ num++; ++ ++ if (num <= 8) ++ return 0; ++ return (2 + num - 8); ++} ++ ++ + u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) + { + u8 *pos = eid; +@@ -7052,20 +7099,27 @@ int hostapd_config_read_maclist(const ch + + static size_t hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, + struct hostapd_data *req_bss, +- int *count, u8 is_beacon, ++ int *count, u32 type, + const u8 *known_bssids, + u8 known_bssids_len) + { + /* ID + size + count */ + int i, j; + size_t ies_len = 0, len = 3, nontx_profile_len; +- u8 mask; +- struct hostapd_data *bss; ++ u8 mask, ie_count; ++ struct hostapd_data *bss, *primary = hostapd_get_primary_bss(hapd); + struct hostapd_bss_config *conf; + ++ if (!primary || !primary->conf) ++ return 0; ++ + for (i = *count; i < hapd->iface->num_bss; i++) { + bss = hapd->iface->bss[i]; ++ if (!bss || !bss->conf || !bss->started) ++ continue; ++ + conf = bss->conf; ++ ie_count = 0; + + j = i / 8; + mask = (u8)1 << (i % 8); +@@ -7086,18 +7140,25 @@ static size_t hostapd_eid_multiple_bssid + conf->ignore_broadcast_ssid == 2 || bss == req_bss) + nontx_profile_len += conf->ssid.ssid_len; + +- if (is_beacon) ++ if (type == WLAN_FC_STYPE_BEACON) + nontx_profile_len += 2; + + if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) + nontx_profile_len += ies_len; +- else if (wpa_auth_get_wpa_ie(hapd->wpa_auth, &ies_len)) +- nontx_profile_len += 8; /* Non-inheritance element */ ++ if (hostapd_wpa_ie(primary, WLAN_EID_RSN) && ++ !hostapd_wpa_ie(bss, WLAN_EID_RSN)) ++ ie_count++; ++ if (hostapd_wpa_ie(primary, WLAN_EID_RSNX) && ++ !hostapd_wpa_ie(bss, WLAN_EID_RSNX)) ++ ie_count++; ++ ++ if (bss->iface->current_rates && bss->iface->num_rates > 8) ++ nontx_profile_len += hostapd_eid_ext_supp_rates_len(bss); ++ else if (primary->conf->xrates_supported) ++ ie_count++; + +- if (bss->conf->xrates_supported) +- nontx_profile_len += 8; /*ext supp rates*/ +- else if (hapd->conf->xrates_supported) +- nontx_profile_len += 3; /* Non-inheritance element for xrates */ ++ if (ie_count) ++ nontx_profile_len += (4 + ie_count); + + if (len + nontx_profile_len > 255) { + goto multiple_bssid_too_big; +@@ -7113,18 +7174,33 @@ multiple_bssid_too_big: + + + size_t hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *req_bss, +- u8 is_beacon, const u8 *known_bssids, +- u8 known_bssids_len) ++ struct hostapd_data *req_bss, u32 type, ++ const u8 *known_bssids, u8 known_bssids_len, ++ size_t *rnr_len) + { +- int count = 1; +- size_t len = 0; ++ int count = 1, rnr_count; ++ size_t len = 0, rnr_current_len = 0; ++ ++ while (count < hapd->iface->num_bss) { ++ rnr_count = count; + +- while (count < hapd->iface->num_bss) + len += hostapd_eid_multiple_bssid_chunk_len(hapd, req_bss, +- &count, is_beacon, ++ &count, type, + known_bssids, + known_bssids_len); ++ if (hapd->iconf->ema_beacon && rnr_len) { ++ rnr_current_len = 0; ++ (*rnr_len) += hostapd_eid_rnr_iface_len(hapd, ++ hostapd_get_primary_bss(hapd), ++ &rnr_current_len, ++ rnr_count, ++ count); ++ } ++ } ++ ++ if (hapd->iconf->ema_beacon && rnr_len) ++ (*rnr_len) += hostapd_eid_rnr_len(hapd, type); ++ + return len; + } + +@@ -7132,16 +7208,19 @@ size_t hostapd_eid_multiple_bssid_len(st + static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, + struct hostapd_data *req_bss, + u8 *eid, u8 *end, int *count, +- u8 is_beacon, u8 *dtim_offset[], ++ u32 type, u8 *dtim_offset[], + const u8 *known_bssids, + u8 known_bssids_len) + { +- struct hostapd_data *bss; ++ struct hostapd_data *bss, *primary = hostapd_get_primary_bss(hapd); + struct hostapd_bss_config *conf; + u8 *size_offset, *num_offset, mask; + int i, j, ie_count = 0; + u8 non_inherit_ie[3] = {0}; + ++ if (!primary || !primary->conf) ++ return eid; ++ + *eid++ = WLAN_EID_MULTIPLE_BSSID; + size_offset = eid++; + num_offset = eid++; +@@ -7149,9 +7228,13 @@ static u8 * hostapd_eid_multiple_bssid_c + for (i = *count; i < hapd->iface->num_bss; i++) { + u8 *bss_size_offset, *index_size_offset, *pos = eid; + u16 capab_info; +- ie_count = 0; ++ + bss = hapd->iface->bss[i]; ++ if (!bss || !bss->conf || !bss->started) ++ continue; ++ + conf = bss->conf; ++ ie_count = 0; + + j = i / 8; + mask = (u8)1 << (i % 8); +@@ -7184,7 +7267,7 @@ static u8 * hostapd_eid_multiple_bssid_c + *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; + index_size_offset = eid++; + *eid++ = i; +- if (is_beacon) { ++ if (type == WLAN_FC_STYPE_BEACON) { + dtim_offset[i] = eid; + *eid++ = conf->dtim_period; + *eid++ = 0xFF; +@@ -7198,19 +7281,19 @@ static u8 * hostapd_eid_multiple_bssid_c + /* Add non inheritance ie for capabalities that + * are not inherited by non tx vap from tx vap + */ +- +- if (hostapd_wpa_ie(hapd, WLAN_EID_RSN) && ++ if (hostapd_wpa_ie(primary, WLAN_EID_RSN) && + !hostapd_wpa_ie(bss, WLAN_EID_RSN)) { + non_inherit_ie[ie_count] = WLAN_EID_RSN; + ie_count++; + } + +- if (hapd->conf->xrates_supported && ++ if (primary->conf->xrates_supported && + !bss->conf->xrates_supported) { + non_inherit_ie[ie_count] = WLAN_EID_EXT_SUPP_RATES; + ie_count++; + } +- if (hostapd_wpa_ie(hapd, WLAN_EID_RSNX) && ++ ++ if (hostapd_wpa_ie(primary, WLAN_EID_RSNX) && + !hostapd_wpa_ie(bss, WLAN_EID_RSNX)) { + non_inherit_ie[ie_count] = WLAN_EID_RSNX; + ie_count++; +@@ -7246,30 +7329,62 @@ multiple_bssid_too_big: + + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + struct hostapd_data *req_bss, u8 *eid, u8 *end, +- u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max, u8 ema_beacon, +- const u8 *known_bssids, u8 known_bssids_len) ++ u8 **eid_offsets, int *eid_count, u8 *rnr_eid, ++ u8 **rnr_offsets, int *rnr_count, int rnr_len, ++ const u8 *known_bssids, u8 known_bssids_len, ++ int eid_max, u32 type) + { + int count = 1, dtim_period; ++ size_t current_len = 0; + u8 remainder, **dtim_offset = NULL; +- struct hostapd_bss_config *conf; + struct hostapd_iface *iface = hapd->iface; ++ u8 *rnr_start_eid = rnr_eid; ++ bool add_rnr = false; + + if (eid_count && + !(dtim_offset = os_zalloc(iface->num_bss * sizeof(eid)))) + return eid; + ++ if (hapd->iconf->ema_beacon && type == WLAN_FC_STYPE_BEACON && rnr_len) ++ add_rnr = true; ++ + while (count < iface->num_bss) { ++ int rnr_start_count = count; ++ + if (eid_offsets && eid_count && (*eid_count < eid_max) && +- (ema_beacon || count == 1)) { ++ (hapd->iconf->ema_beacon || count == 1)) { + eid_offsets[*eid_count] = eid; + *eid_count = *eid_count + 1; + } + eid = hostapd_eid_multiple_bssid_chunk(hapd, req_bss, eid, end, +- &count, is_beacon, ++ &count, type, + dtim_offset, + known_bssids, + known_bssids_len); ++ ++ if (add_rnr == true) { ++ rnr_offsets[*rnr_count] = rnr_eid; ++ *rnr_count = *rnr_count + 1; ++ current_len = 0; ++ ++ rnr_eid = hostapd_eid_rnr_iface(hapd, ++ hostapd_get_primary_bss(hapd), ++ rnr_eid, ¤t_len, ++ rnr_start_count, count); ++ } ++ } ++ ++ if ((add_rnr == true) && ((rnr_eid - rnr_start_eid) < rnr_len)) { ++ rnr_offsets[*rnr_count] = rnr_eid; ++ *rnr_count = *rnr_count + 1; ++ current_len = 0; ++ ++ if (hapd->conf->rnr_beacon) ++ rnr_eid = hostapd_eid_neighbor_report_db(hapd, rnr_eid, ++ ¤t_len); ++ if (get_colocation_mode(hapd) == COLOCATED_LOWER_BAND) ++ rnr_eid = hostapd_eid_rnr_colocation(hapd, rnr_eid, ++ ¤t_len); + } + + if (!eid_count || !(*eid_count)) { +@@ -7283,7 +7398,14 @@ u8 * hostapd_eid_multiple_bssid(struct h + break; + + for (count = 0; count < iface->num_bss; count++) { +- conf = iface->bss[count]->conf; ++ struct hostapd_data *bss; ++ struct hostapd_bss_config *conf; ++ ++ bss = iface->bss[count]; ++ if (!bss || !bss->conf || !bss->started) ++ continue; ++ ++ conf = bss->conf; + dtim_period = conf->dtim_period; + remainder = dtim_period % (*eid_count); + if (remainder) { +@@ -7304,9 +7426,10 @@ u8 * hostapd_eid_multiple_bssid(struct h + } + + +-size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, ++static size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, + struct hostapd_data *reporting_hapd, +- size_t *current_len) ++ size_t *current_len, ++ int skip_ssid_start, int skip_ssid_end) + { + size_t total_len = 0; + int i, tbtt_count = 0, start = 0; +@@ -7323,8 +7446,17 @@ size_t hostapd_eid_rnr_iface_len(struct + total_len += TBTT_HEADER_LENGTH; + + for (i = start; i < hapd->iface->num_bss; i++) { +- if (hapd->iface->bss[i] == reporting_hapd || +- hapd->conf->ignore_broadcast_ssid) ++ struct hostapd_data *bss = hapd->iface->bss[i]; ++ ++ if (!bss || !bss->conf || !bss->started) ++ continue; ++ ++ if (bss == reporting_hapd || ++ bss->conf->ignore_broadcast_ssid) ++ continue; ++ ++ if ((skip_ssid_start != -1) && (skip_ssid_end != -1) && ++ (i >= skip_ssid_start) && (i < skip_ssid_end)) + continue; + + if ((*current_len + TBTT_INFO_LENGTH > 255) || +@@ -7362,7 +7494,7 @@ static size_t hostapd_eid_rnr_colocation + continue; + + len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd, +- current_len); ++ current_len, -1, -1); + } + return len; + } +@@ -7395,48 +7527,71 @@ static size_t hostapd_eid_neighbor_repor + } + + +-static bool is_6ghz_colocated(struct hostapd_data *hapd) ++static enum colocation_mode get_colocation_mode(struct hostapd_data *hapd) + { + u8 i; +- struct hostapd_iface *iface; ++ bool is_6ghz = is_6ghz_op_class(hapd->iconf->op_class); + + if ((hapd->iface == NULL) || (hapd->iface->interfaces == NULL)) +- return false; ++ return NO_COLOCATED_6GHZ; + +- if (is_6ghz_op_class(hapd->iconf->op_class) || +- hapd->iface->interfaces->count == 1) +- return false; ++ if (is_6ghz && (hapd->iface->interfaces->count == 1)) ++ return STANDALONE_6GHZ; + + for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface; ++ bool is_colocated_6ghz; ++ + iface = hapd->iface->interfaces->iface[i]; +- if (iface == hapd->iface) ++ if (iface == hapd->iface || !iface || !iface->conf) + continue; + +- if (is_6ghz_op_class(iface->bss[0]->iconf->op_class) && +- iface->conf->he_co_locate) +- return true; ++ is_colocated_6ghz = is_6ghz_op_class(iface->conf->op_class); ++ if (!is_6ghz && is_colocated_6ghz) ++ return COLOCATED_LOWER_BAND; ++ else if (is_6ghz && !is_colocated_6ghz) ++ return COLOCATED_6GHZ; + } +- return false; ++ ++ if (is_6ghz) ++ return STANDALONE_6GHZ; ++ ++ return NO_COLOCATED_6GHZ; + } + + + size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) + { + size_t len = 0, current_len = 0; ++ enum colocation_mode mode = get_colocation_mode(hapd); + +- if (hapd->conf->rnr_beacon) { +- if (hapd->iface->num_bss > 1) +- len += hostapd_eid_rnr_iface_len(hapd, hapd, +- ¤t_len); +- +- if ((type == WLAN_FC_STYPE_BEACON) && +- !dl_list_empty(&hapd->nr_db)) ++ switch (type) { ++ case WLAN_FC_STYPE_BEACON: ++ if (hapd->conf->rnr_beacon && !dl_list_empty(&hapd->nr_db)) + len += hostapd_eid_neighbor_report_db_len(hapd, + ¤t_len); +- } ++ /* fallthrough */ ++ ++ case WLAN_FC_STYPE_PROBE_RESP: ++ if (mode == COLOCATED_LOWER_BAND) ++ len += hostapd_eid_rnr_colocation_len(hapd, ++ ¤t_len); ++ ++ if (hapd->conf->rnr_beacon && hapd->iface->num_bss > 1 && ++ !hapd->iconf->multiple_bssid) ++ len += hostapd_eid_rnr_iface_len(hapd, hapd, ++ ¤t_len, -1, -1); ++ break; + +- if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) +- len += hostapd_eid_rnr_colocation_len(hapd, ¤t_len); ++ case WLAN_FC_STYPE_ACTION: ++ if (hapd->iface->num_bss > 1 && mode == STANDALONE_6GHZ) ++ len += hostapd_eid_rnr_iface_len(hapd, hapd, ++ ¤t_len, -1, -1); ++ break; ++ ++ default: ++ return 0; ++ } + + return len; + } +@@ -7444,7 +7599,8 @@ size_t hostapd_eid_rnr_len(struct hostap + + static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, + struct hostapd_data *reporting_hapd, +- u8 *eid, size_t *current_len) ++ u8 *eid, size_t *current_len, ++ int skip_ssid_start, int skip_ssid_end) + { + u8 *eid_start = eid, *tbtt_count_pos = NULL; + u8 tbtt_count = 0, op_class, channel, bss_param; +@@ -7483,9 +7639,15 @@ static u8 *hostapd_eid_rnr_iface(struct + for (i = start; i < iface->num_bss; i++) { + bss_param = 0; + bss = iface->bss[i]; ++ if (!bss || !bss->conf || !bss->started) ++ continue; + + if (bss == reporting_hapd || +- hapd->conf->ignore_broadcast_ssid) ++ bss->conf->ignore_broadcast_ssid) ++ continue; ++ ++ if ((skip_ssid_start != -1) && (skip_ssid_end != -1) && ++ (i >= skip_ssid_start) && (i < skip_ssid_end)) + continue; + + if ((*current_len + TBTT_INFO_LENGTH > 255) || +@@ -7547,7 +7709,7 @@ static u8 * hostapd_eid_rnr_colocation(s + continue; + + eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, +- current_len); ++ current_len, -1, -1); + } + return eid; + } +@@ -7600,19 +7762,38 @@ u8 * hostapd_eid_rnr(struct hostapd_data + { + u8 *eid_start = eid; + size_t current_len = 0; ++ enum colocation_mode mode = get_colocation_mode(hapd); + +- if (hapd->conf->rnr_beacon) { +- if (hapd->iface->num_bss > 1) +- eid = hostapd_eid_rnr_iface(hapd, hapd, eid, +- ¤t_len); ++ switch (type) { ++ case WLAN_FC_STYPE_BEACON: ++ if (hapd->iconf->ema_beacon) ++ return eid_start; + +- if (type == WLAN_FC_STYPE_BEACON) ++ if (hapd->conf->rnr_beacon) + eid = hostapd_eid_neighbor_report_db(hapd, eid, + ¤t_len); +- } ++ /* fallthrough */ ++ ++ case WLAN_FC_STYPE_PROBE_RESP: ++ if (mode == COLOCATED_LOWER_BAND) ++ eid = hostapd_eid_rnr_colocation(hapd, eid, ++ ¤t_len); ++ ++ if (hapd->conf->rnr_beacon && hapd->iface->num_bss > 1 && ++ !hapd->iconf->multiple_bssid) ++ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, ++ ¤t_len, -1, -1); ++ break; + +- if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) +- eid = hostapd_eid_rnr_colocation(hapd, eid, ¤t_len); ++ case WLAN_FC_STYPE_ACTION: ++ if (hapd->iface->num_bss > 1 && mode == STANDALONE_6GHZ) ++ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, ++ ¤t_len, -1, -1); ++ break; ++ ++ default: ++ return eid_start; ++ } + + if (eid == (eid_start + 2)) + return eid_start; +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h +@@ -129,15 +129,17 @@ u8 * hostapd_eid_time_zone(struct hostap + int hostapd_update_time_adv(struct hostapd_data *hapd); + void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); + u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); ++u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type); + u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, + struct hostapd_data *req_bss, u8 *eid, u8 *end, +- u8 is_beacon, u8 **eid_offsets, int *eid_count, +- int eid_max, u8 ema_beacon, +- const u8 *known_bssids, u8 known_bssids_len); ++ u8 **eid_offsets, int *eid_count, u8 *rnr_eid, ++ u8 **rnr_offsets, int *rnr_count, int rnr_len, ++ const u8 *known_bssids, u8 known_bssids_len, ++ int eid_max, u32 type); + size_t hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, +- struct hostapd_data *req_bss, u8 is_beacon, +- const u8 *known_bssids, u8 known_bssids_len); +-u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type); ++ struct hostapd_data *req_bss, u32 type, ++ const u8 *known_bssids, ++ u8 known_bssids_len, size_t *rnr_len); + size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type); + int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); + #ifdef CONFIG_SAE +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1232,6 +1232,7 @@ struct wowlan_triggers { + }; + + #define MULTIPLE_BSSID_IE_MAX 8 ++#define RNR_BSSID_IE_MAX (MULTIPLE_BSSID_IE_MAX + 1) + + struct wpa_driver_ap_params { + /** +@@ -1630,6 +1631,27 @@ struct wpa_driver_ap_params { + */ + int ema_beacon; + ++ /** ++ * rnr_ies - This buffer contains all of RNR elements ++ */ ++ u8 *rnr_ies; ++ ++ /** ++ * rnr_ie_len - Length of RNR IE buffer ++ */ ++ size_t rnr_ie_len; ++ ++ /** ++ * rnr_ie_offsets - The offsets to the elements inside rnr_ies. ++ * Each MBSSID IE has corresponding RNR IE offset. ++ * The extra offset is for the common part of RNR ++ */ ++ u8 *rnr_ie_offsets[MULTIPLE_BSSID_IE_MAX+1]; ++ ++ /** ++ * rnr_ie_count - Number of offsets in rnr_ie_offsets ++ */ ++ int rnr_ie_count; + }; + + struct wpa_driver_mesh_bss_params { +@@ -2291,6 +2313,7 @@ struct wpa_bss_params { + int wpa_key_mgmt; + int rsn_preauth; + enum mfp_options ieee80211w; ++ + }; + + #define WPA_STA_AUTHORIZED BIT(0) diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch b/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch new file mode 100644 index 000000000..234ad21fd --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch @@ -0,0 +1,79 @@ +From a23c193cda2fbdfbcb6027fec06318bb7721f896 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Mon, 14 Dec 2020 10:57:55 -0800 +Subject: [PATCH 8/9] hostapd: Update 2.4/5GHz beacons during 6GHz beacon setup + +Update 2.4/5GHz beacons every time beacons for co-located 6GHz AP(s) +are set. + +This is required for 6GHz out-of-band discovery so that lower band beacons +will include RNR element with 6GHz AP information irrespective of the AP +bring-up order. + +Additionally, changes in 6GHz AP configuration such as new channel/bandwidth +also get reflected in the lower bands beacons. + +Signed-off-by: Aloka Dixit +--- + src/ap/beacon.c | 33 ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1888,7 +1888,7 @@ void ieee802_11_free_ap_params(struct wp + } + + +-int ieee802_11_set_beacon(struct hostapd_data *hapd) ++static int __ieee802_11_set_beacon(struct hostapd_data *hapd) + { + struct wpa_driver_ap_params params; + struct hostapd_freq_params freq; +@@ -1966,12 +1966,47 @@ int ieee802_11_set_beacon(struct hostapd + wpa_printf(MSG_ERROR, "Failed to set beacon parameters"); + else + ret = 0; ++ + fail: + ieee802_11_free_ap_params(¶ms); + return ret; + } + + ++int ieee802_11_set_beacon(struct hostapd_data *hapd) ++{ ++ struct hostapd_iface *iface = hapd->iface, *colocated = NULL; ++ int ret = 0; ++ size_t i, j; ++ bool is_6g; ++ ++ ret = __ieee802_11_set_beacon(hapd); ++ if (ret != 0) ++ return ret; ++ ++ if ((iface->interfaces == NULL) || (iface->interfaces->count <= 1)) ++ return 0; ++ ++ /* Update beacons in case of 6GHz colocation */ ++ is_6g = is_6ghz_op_class(iface->conf->op_class); ++ for (j = 0; j < iface->interfaces->count; j++) { ++ colocated = iface->interfaces->iface[j]; ++ if (colocated == iface || !colocated || !colocated->conf) ++ continue; ++ ++ if (is_6g == is_6ghz_op_class(colocated->conf->op_class)) ++ continue; ++ ++ for (i = 0; i < colocated->num_bss; i++) { ++ if (colocated->bss[i] && colocated->bss[i]->started) ++ __ieee802_11_set_beacon(colocated->bss[i]); ++ } ++ } ++ ++ return 0; ++} ++ ++ + int ieee802_11_set_beacons(struct hostapd_iface *iface) + { + size_t i; diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch b/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch new file mode 100644 index 000000000..a29ce6a1f --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch @@ -0,0 +1,119 @@ +From a7b2036e9547088a52e8fa4da8efc6141702515d Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Mon, 14 Dec 2020 11:41:59 -0800 +Subject: [PATCH 9/9] hostapd: Netlink changes for RNR offsets + +This patch adds new nested netlink attribute NL80211_ATTR_RNR_OFFSETS +used to send RNR groups to kernel when EMA is enabled. +This attribute includes the count of RNR groups and data at each index. +While generating EMA beacons, kernel will include RNR group at a given +index along with MBSSID group. +Last group, if present, has RNR data common for all EMA beacons. + +Signed-off-by: Aloka Dixit +--- + src/drivers/driver_nl80211.c | 31 +++++++++++++++++++++++++++++ + src/drivers/nl80211_copy.h | 38 ++++++++++++++++++++++++++++++++++++ + 2 files changed, 69 insertions(+) + +Index: hostapd-2021-02-18/src/drivers/driver_nl80211.c +=================================================================== +--- hostapd-2021-02-18.orig/src/drivers/driver_nl80211.c ++++ hostapd-2021-02-18/src/drivers/driver_nl80211.c +@@ -4867,6 +4867,37 @@ static int wpa_driver_nl80211_set_ap(voi + nla_nest_end(msg, ies); + } + ++ if (params->rnr_ie_len) { ++ struct nlattr *rnr, *ies; ++ u8 **off; ++ int i; ++ ++ rnr = nla_nest_start(msg, NL80211_ATTR_RNR_OFFSETS); ++ if (!rnr || nla_put_u8(msg, NL80211_RNR_IES_ATTR_COUNT, ++ params->rnr_ie_count)) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build reduced neighbor report msg for %s\n", ++ bss->ifname); ++ goto fail; ++ } ++ ++ ies = nla_nest_start(msg, NL80211_RNR_IES_ATTR_DATA); ++ if (!ies) ++ goto fail; ++ off = params->rnr_ie_offsets; ++ for (i = 0; i < params->rnr_ie_count - 1; i++) { ++ if (nla_put(msg, i + 1, off[i + 1] - off[i], off[i])) { ++ wpa_printf(MSG_ERROR, ++ "nl80211: Failed to build reduced neighbor report msg for %s\n", ++ bss->ifname); ++ goto fail; ++ } ++ } ++ nla_put(msg, i + 1, *off + params->rnr_ie_len - off[i], off[i]); ++ nla_nest_end(msg, ies); ++ nla_nest_end(msg, rnr); ++ } ++ + ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, + NULL, NULL, NULL, NULL); + if (ret) { +Index: hostapd-2021-02-18/src/drivers/nl80211_copy.h +=================================================================== +--- hostapd-2021-02-18.orig/src/drivers/nl80211_copy.h ++++ hostapd-2021-02-18/src/drivers/nl80211_copy.h +@@ -2587,6 +2587,17 @@ enum nl80211_commands { + * + * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. + * ++ * @NL80211_ATTR_RNR_OFFSETS: Offsets for Reduced neighbor element (RNR) of ++ * type &enum nl80211_rnr_ies_attributes. ++ * RNR is split into multiple groups when EMA (Enhanced multi-BSSID ++ * advertisements) feature is enabled. Each group excludes the profiles ++ * already included in MBSSID group (%NL80211_ATTR_MULTIPLE_BSSID_IES) at ++ * the same index. Each EMA beacon will be generated by adding MBSSID and ++ * RNR groups at the same index. ++ * The last additional RNR group, if present, points to information ++ * for co-located APs and neighbor APs in ESS to be added in all ++ * EMA beacons. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3098,6 +3109,8 @@ enum nl80211_attrs { + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, + ++ NL80211_ATTR_RNR_OFFSETS, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -7325,4 +7338,27 @@ enum nl80211_sar_specs_attrs { + NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, + }; + ++/** ++ * enum nl80211_rnr_ies_attributes - Reduced neighbor report (RNR) offsets. ++ * Used only when enhanced multi-BSSID advertisements (EMA) are enabled. ++ * ++ * @__NL80211_RNR_IES_ATTR_INVALID: Invalid ++ * ++ * @NL80211_RNR_IES_ATTR_COUNT: Count of RNR offsets ++ * ++ * @NL80211_RNR_IES_ATTR_COUNT: RNR offsets and length for each. ++ * ++ * @__NL80211_RNR_IES_ATTR_LAST: Internal ++ * @NL80211_RNR_IES_ATTR_MAX: highest attribute ++ */ ++enum nl80211_rnr_ies_attributes { ++ __NL80211_RNR_IES_ATTR_INVALID, ++ ++ NL80211_RNR_IES_ATTR_COUNT, ++ NL80211_RNR_IES_ATTR_DATA, ++ ++ /* keep last */ ++ __NL80211_RNR_IES_ATTR_LAST, ++ NL80211_RNR_IES_ATTR_MAX = __NL80211_RNR_IES_ATTR_LAST - 1 ++}; + #endif /* __LINUX_NL80211_H */ diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch b/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch new file mode 100644 index 000000000..293d39e93 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch @@ -0,0 +1,95 @@ +commit 120f4976cdb83e421459242db7a1b41c16b772f6 +Author: Sathishkumar Muruganandam +Date: Wed Jan 13 16:51:07 2021 +0530 + + hostapd: allow AP_VLAN creation with wpa_psk_file having vlan_id + + When WPA_DRIVER_FLAGS_VLAN_OFFLOAD is advertised from driver during + NSS offload enabled case, vlan_id is sent to mac80211 which is stored + in key_conf for dynamic VLAN support on NSS offload case. + + This flag blocks the AP_VLAN creation when using wpa_psk_file with + vlan_id which is needed for dynamic VLAN support on NSS offload case. + + Hence removing the check associated with _VLAN_OFFLOAD flag which is + advertised only when NSS offload is enabled to allow AP_VLAN creation. + + Signed-off-by: Sathishkumar Muruganandam + +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -1060,8 +1060,7 @@ int ap_sta_bind_vlan(struct hostapd_data + if (sta->vlan_id == old_vlanid) + goto skip_counting; + +- if (sta->vlan_id > 0 && !vlan && +- !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) { ++ if (sta->vlan_id > 0 && !vlan) { + hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, "could not find VLAN for " + "binding station to (vlan_id=%d)", +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -437,12 +437,8 @@ static int hostapd_wpa_auth_set_key(void + + if (vlan_id > 0) { + ifname = hostapd_get_vlan_id_ifname(hapd->conf->vlan, vlan_id); +- if (!ifname) { +- if (!(hapd->iface->drv_flags & +- WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) +- return -1; +- ifname = hapd->conf->iface; +- } ++ if (!ifname) ++ return -1; + } + + #ifdef CONFIG_TESTING_OPTIONS +@@ -917,32 +913,27 @@ static int hostapd_wpa_auth_update_vlan( + #ifndef CONFIG_NO_VLAN + struct hostapd_data *hapd = ctx; + struct sta_info *sta; ++ struct vlan_description vlan_desc; + + sta = ap_get_sta(hapd, addr); + if (!sta) + return -1; + +- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) { +- struct vlan_description vlan_desc; +- +- os_memset(&vlan_desc, 0, sizeof(vlan_desc)); +- vlan_desc.notempty = 1; +- vlan_desc.untagged = vlan_id; +- if (!hostapd_vlan_valid(hapd->conf->vlan, &vlan_desc)) { +- wpa_printf(MSG_INFO, +- "Invalid VLAN ID %d in wpa_psk_file", +- vlan_id); +- return -1; +- } ++ os_memset(&vlan_desc, 0, sizeof(vlan_desc)); ++ vlan_desc.notempty = 1; ++ vlan_desc.untagged = vlan_id; ++ if (!hostapd_vlan_valid(hapd->conf->vlan, &vlan_desc)) { ++ wpa_printf(MSG_INFO, ++ "Invalid VLAN ID %d in wpa_psk_file", ++ vlan_id); ++ return -1; ++ } + +- if (ap_sta_set_vlan(hapd, sta, &vlan_desc) < 0) { +- wpa_printf(MSG_INFO, +- "Failed to assign VLAN ID %d from wpa_psk_file to " +- MACSTR, vlan_id, MAC2STR(sta->addr)); +- return -1; +- } +- } else { +- sta->vlan_id = vlan_id; ++ if (ap_sta_set_vlan(hapd, sta, &vlan_desc) < 0) { ++ wpa_printf(MSG_INFO, ++ "Failed to assign VLAN ID %d from wpa_psk_file to " ++ MACSTR, vlan_id, MAC2STR(sta->addr)); ++ return -1; + } + + wpa_printf(MSG_INFO, diff --git a/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch b/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch new file mode 100644 index 000000000..5014e8ddc --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch @@ -0,0 +1,252 @@ +Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c ++++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c +@@ -4590,6 +4590,15 @@ static int hostapd_config_fill(struct ho + bss->disable_11ac = !!atoi(pos); + } else if (os_strcmp(buf, "disable_11ax") == 0) { + bss->disable_11ax = !!atoi(pos); ++ } else if (os_strcmp(buf, "beacon_tx_mode") == 0) { ++ int val = atoi(pos); ++ ++ if (val < 0 || val > 2) { ++ wpa_printf(MSG_ERROR, "Line %d: invalid beacon_tx_mode %d", ++ line, val); ++ return 1; ++ } ++ bss->beacon_tx_mode = val; + #ifdef CONFIG_PASN + #ifdef CONFIG_TESTING_OPTIONS + } else if (os_strcmp(buf, "force_kdk_derivation") == 0) { +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +@@ -894,6 +894,7 @@ struct hostapd_bss_config { + + unsigned int unsol_bcast_probe_resp_interval; + u8 rnr_beacon; ++ int beacon_tx_mode; + }; + + /** +Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/beacon.c ++++ hostapd-2021-02-20-59e9794c/src/ap/beacon.c +@@ -1861,6 +1861,8 @@ int ieee802_11_build_ap_params(struct ho + params->dtim_period = hapd->conf->dtim_period; + } + ++ params->beacon_tx_mode = hapd->conf->beacon_tx_mode; ++ + return 0; + } + +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver.h +@@ -1206,6 +1206,12 @@ struct wpa_driver_associate_params { + * Disable HE40MHz coexistence scan + */ + int disable_40mhz_scan; ++ /** ++ * Beacon Tx mode - To configure STAGGERED or BURST mode ++ * 1 = STAGGERED beacon tx mode ++ * 2 = BURST beacon tx mode ++ */ ++ int beacon_tx_mode; + }; + + enum hide_ssid { +@@ -1650,6 +1656,13 @@ struct wpa_driver_ap_params { + * rnr_ie_count - Number of offsets in rnr_ie_offsets + */ + int rnr_ie_count; ++ ++ /** ++ * Beacon Tx mode - To configure STAGGERED or BURST mode ++ * 1 = STAGGERED beacon tx mode ++ * 2 = BURST beacon tx mode ++ */ ++ int beacon_tx_mode; + }; + + struct wpa_driver_mesh_bss_params { +@@ -1689,6 +1702,7 @@ struct wpa_driver_mesh_join_params { + unsigned int flags; + bool handle_dfs; + int mcast_rate; ++ int beacon_tx_mode; + }; + + struct wpa_driver_set_key_params { +Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.c ++++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c +@@ -4543,6 +4543,7 @@ static int wpa_driver_nl80211_set_ap(voi + wpa_printf(MSG_DEBUG, "nl80211: beacon_rate=%u", params->beacon_rate); + wpa_printf(MSG_DEBUG, "nl80211: rate_type=%d", params->rate_type); + wpa_printf(MSG_DEBUG, "nl80211: dtim_period=%d", params->dtim_period); ++ wpa_printf(MSG_DEBUG, "nl80211: beacon_tx_mode=%d", params->beacon_tx_mode); + wpa_printf(MSG_DEBUG, "nl80211: ssid=%s", + wpa_ssid_txt(params->ssid, params->ssid_len)); + if (!(msg = nl80211_bss_msg(bss, 0, cmd)) || +@@ -4554,7 +4555,9 @@ static int wpa_driver_nl80211_set_ap(voi + nl80211_put_beacon_rate(msg, drv->capa.flags, drv->capa.flags2, + params) || + nl80211_put_dtim_period(msg, params->dtim_period) || +- nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid)) ++ nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid) || ++ (params->beacon_tx_mode && ++ nla_put_u32(msg, NL80211_ATTR_BEACON_TX_MODE, params->beacon_tx_mode))) + goto fail; + if (params->proberesp && params->proberesp_len) { + wpa_hexdump(MSG_DEBUG, "nl80211: proberesp (offload)", +@@ -10663,7 +10666,9 @@ static int nl80211_join_mesh(struct i802 + nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || + nl80211_put_beacon_int(msg, params->beacon_int) || + nl80211_put_mcast_rate(msg, params->mcast_rate) || +- nl80211_put_dtim_period(msg, params->dtim_period)) ++ nl80211_put_dtim_period(msg, params->dtim_period) || ++ (params->beacon_tx_mode && ++ nla_put_u32(msg, NL80211_ATTR_BEACON_TX_MODE, params->beacon_tx_mode))) + goto fail; + + wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); +Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/drivers/nl80211_copy.h ++++ hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h +@@ -2608,6 +2608,10 @@ enum nl80211_commands { + * for co-located APs and neighbor APs in ESS to be added in all + * EMA beacons. + * ++ * @NL80211_ATTR_BEACON_TX_MODE: used to configure the beacon tx mode as ++ * staggered mode or burst mode in %NL80211_CMD_START_AP from ++ * user-space. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3121,6 +3125,8 @@ enum nl80211_attrs { + + NL80211_ATTR_RNR_OFFSETS, + ++ NL80211_ATTR_BEACON_TX_MODE, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -7371,4 +7377,13 @@ enum nl80211_rnr_ies_attributes { + __NL80211_RNR_IES_ATTR_LAST, + NL80211_RNR_IES_ATTR_MAX = __NL80211_RNR_IES_ATTR_LAST - 1 + }; ++ ++/** ++ * enum nl80211_beacon_tx_mode - Beacon Tx Mode enum. ++ * Used to configure beacon staggered mode or beacon burst mode. ++ */ ++enum nl80211_beacon_tx_mode { ++ NL80211_BEACON_STAGGERED_MODE = 1, ++ NL80211_BEACON_BURST_MODE = 2, ++}; + #endif /* __LINUX_NL80211_H */ +Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd.conf +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/hostapd/hostapd.conf ++++ hostapd-2021-02-20-59e9794c/hostapd/hostapd.conf +@@ -250,6 +250,9 @@ rts_threshold=-1 + # it. + fragm_threshold=-1 + ++# Beacon Tx mode; 1 = STAGGERED beacon tx mode; 2 = BURST beacon tx mode. ++beacon_tx_mode=1 ++ + # Rate configuration + # Default is to enable all rates supported by the hardware. This configuration + # item allows this list be filtered so that only the listed rates will be left +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config.c +@@ -2740,6 +2740,7 @@ static const struct parse_data ssid_fiel + { INT_RANGE(transition_disable, 0, 255) }, + { INT_RANGE(sae_pk, 0, 2) }, + { INT_RANGE(disable_40mhz_scan, 0, 1)}, ++ { INT_RANGE(beacon_tx_mode, 1, 2)}, + }; + + #undef OFFSET +@@ -3249,6 +3250,7 @@ void wpa_config_set_network_defaults(str + #endif /* CONFIG_MACSEC */ + ssid->mac_addr = -1; + ssid->max_oper_chwidth = DEFAULT_MAX_OPER_CHWIDTH; ++ ssid->beacon_tx_mode = DEFAULT_BEACON_TX_MODE; + } + + +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_file.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_file.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_file.c +@@ -888,6 +888,7 @@ static void wpa_config_write_network(FIL + INT(disable_he); + #endif /* CONFIG_HE_OVERRIDES */ + INT(disable_40mhz_scan); ++ INT(beacon_tx_mode); + #undef STR + #undef INT + #undef INT_DEF +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_ssid.h ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h +@@ -47,6 +47,7 @@ + #define DEFAULT_AMPDU_DENSITY -1 /* no change */ + #define DEFAULT_USER_SELECTED_SIM 1 + #define DEFAULT_MAX_OPER_CHWIDTH -1 ++#define DEFAULT_BEACON_TX_MODE 0 + + struct psk_list_entry { + struct dl_list list; +@@ -1177,6 +1178,13 @@ struct wpa_ssid { + * disable_40mhz_scan - Disable 40MHz coex scan + */ + int disable_40mhz_scan; ++ ++ /** ++ * beacon_tx_mode - Beacon Tx mode ++ * 1 = STAGGERED MODE ++ * 2 = BURST MODE ++ */ ++ int beacon_tx_mode; + }; + + #endif /* CONFIG_SSID_H */ +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c +@@ -668,6 +668,7 @@ int wpa_supplicant_join_mesh(struct wpa_ + params->dtim_period = ssid->dtim_period; + else if (wpa_s->conf->dtim_period > 0) + params->dtim_period = wpa_s->conf->dtim_period; ++ params->beacon_tx_mode = ssid->beacon_tx_mode; + params->conf.max_peer_links = wpa_s->conf->max_peer_links; + if (ssid->mesh_rssi_threshold < DEFAULT_MESH_RSSI_THRESHOLD) { + params->conf.rssi_threshold = ssid->mesh_rssi_threshold; +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_cli.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_cli.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_cli.c +@@ -1489,6 +1489,7 @@ static const char *network_fields[] = { + #endif /* CONFIG_HS20 */ + "mac_addr", "pbss", "wps_disabled", + "disable_40mhz_scan", ++ "beacon_tx_mode", + }; + + diff --git a/feeds/wifi-ax/hostapd/patches/h00-007-b-hostapd-Fix-HE-chan-switch-command-to-use-proper-BW.patch b/feeds/wifi-ax/hostapd/patches/h00-007-b-hostapd-Fix-HE-chan-switch-command-to-use-proper-BW.patch new file mode 100644 index 000000000..3ca823f25 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-007-b-hostapd-Fix-HE-chan-switch-command-to-use-proper-BW.patch @@ -0,0 +1,68 @@ +From ebcd20553b63eb899b6983b5b205e374aba85e73 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Tue, 18 May 2021 12:56:15 +0530 +Subject: [PATCH] hostapd: Fix HE chan switch command to use proper BW + +VHT is not enabled when HE mode is indicated in channel +switch command, due to which VHT operation IE is missing +in beacon causing STA to connect in HT40 mode. + +HE support for channel switch command patch is modified in +upstream commit causing this issue. It is reverted to the +previous version for fixing the same. + +Fixes: I4bd28058adbc27 (hostap: upgrade hostapd to 59e9794c7d7e) + +Signed-off-by: Lavanya Suresh +--- + src/ap/drv_callbacks.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c +@@ -928,22 +928,30 @@ void hostapd_event_ch_switch(struct host + hapd->iconf->ieee80211n = ht; + if (!ht) { + hapd->iconf->ieee80211ac = 0; +- } else if (hapd->iconf->ch_switch_vht_config) { +- /* CHAN_SWITCH VHT config */ +- if (hapd->iconf->ch_switch_vht_config & +- CH_SWITCH_VHT_ENABLED) +- hapd->iconf->ieee80211ac = 1; +- else if (hapd->iconf->ch_switch_vht_config & +- CH_SWITCH_VHT_DISABLED) +- hapd->iconf->ieee80211ac = 0; +- } else if (hapd->iconf->ch_switch_he_config) { +- /* CHAN_SWITCH HE config */ +- if (hapd->iconf->ch_switch_he_config & +- CH_SWITCH_HE_ENABLED) +- hapd->iconf->ieee80211ax = 1; +- else if (hapd->iconf->ch_switch_he_config & +- CH_SWITCH_HE_DISABLED) ++ if (!is_6ghz_freq(hapd->iface->freq)) + hapd->iconf->ieee80211ax = 0; ++ } else { ++ if (hapd->iconf->ch_switch_vht_config) { ++ /* CHAN_SWITCH VHT config */ ++ if (hapd->iconf->ch_switch_vht_config & ++ CH_SWITCH_VHT_ENABLED) ++ hapd->iconf->ieee80211ac = 1; ++ else if (hapd->iconf->ch_switch_vht_config & ++ CH_SWITCH_VHT_DISABLED) ++ hapd->iconf->ieee80211ac = 0; ++ } ++ if (hapd->iconf->ch_switch_he_config) { ++ /* CHAN_SWITCH HE config */ ++ if (hapd->iconf->ch_switch_he_config & ++ CH_SWITCH_HE_ENABLED) { ++ hapd->iconf->ieee80211ax = 1; ++ if (!is_6ghz_freq(hapd->iface->freq)) ++ hapd->iconf->ieee80211ac = 1; ++ } ++ else if (hapd->iconf->ch_switch_he_config & ++ CH_SWITCH_HE_DISABLED) ++ hapd->iconf->ieee80211ax = 0; ++ } + } + hapd->iconf->ch_switch_vht_config = 0; + hapd->iconf->ch_switch_he_config = 0; diff --git a/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch b/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch new file mode 100644 index 000000000..c38e79127 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch @@ -0,0 +1,67 @@ +From d2b5a9ed668829c04a8c86e8712cc045a9aaac5f Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Mon, 11 Jan 2021 17:30:34 -0800 +Subject: [PATCH] hostapd: Setting Spectrum Management bit for chan switch + +When CSA IEs are adversied by AP when CSA is initiated, spectrum +management bit in capability information located in management frame's +fixed field shoud be set. Therfore when channel switch is supported, +the spectrum management bit is set. + +Signed-off-by: Muna Sinada +--- + src/ap/ap_config.c | 4 +++- + src/ap/ieee802_11.c | 15 +++++++++------ + 2 files changed, 12 insertions(+), 7 deletions(-) + +Index: hostapd-2021-02-18/src/ap/ap_config.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ap_config.c ++++ hostapd-2021-02-18/src/ap/ap_config.c +@@ -229,6 +229,8 @@ struct hostapd_config * hostapd_config_d + conf->fragm_threshold = -2; /* user driver default: 2346 */ + /* Set to invalid value means do not add Power Constraint IE */ + conf->local_pwr_constraint = -1; ++ /* Set to invalid value means that user did not set this value */ ++ conf->spectrum_mgmt_required = -1; + + conf->wmm_ac_params[0] = ac_be; + conf->wmm_ac_params[1] = ac_bk; +@@ -1471,7 +1473,7 @@ int hostapd_config_check(struct hostapd_ + return -1; + } + +- if (full_config && conf->spectrum_mgmt_required && ++ if (full_config && conf->spectrum_mgmt_required != -1 && + conf->local_pwr_constraint == -1) { + wpa_printf(MSG_ERROR, "Cannot set Spectrum Management bit without Country and Power Constraint elements"); + return -1; +Index: hostapd-2021-02-18/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2021-02-18.orig/src/ap/ieee802_11.c ++++ hostapd-2021-02-18/src/ap/ieee802_11.c +@@ -300,15 +300,18 @@ u16 hostapd_own_capab_info(struct hostap + capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME; + + /* +- * Currently, Spectrum Management capability bit is set when directly +- * requested in configuration by spectrum_mgmt_required or when AP is +- * running on DFS channel. ++ * Currently, Spectrum Management capability bit is set by default when ++ * channel switch is supported. When CSA is not supported, then Spectrum ++ * Management capability bit is set when directly requested in ++ * configuration by spectrum_mgmt_required or when AP is running on DFS ++ * channel. + * TODO: Also consider driver support for TPC to set Spectrum Mgmt bit + */ + if (hapd->iface->current_mode && +- hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A && +- (hapd->iconf->spectrum_mgmt_required || dfs)) +- capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; ++ hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A) ++ if (!(hapd->iconf->spectrum_mgmt_required == 0 && !dfs) && ++ (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA || dfs)) ++ capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; + + for (i = 0; i < RRM_CAPABILITIES_IE_LEN; i++) { + if (hapd->conf->radio_measurements[i]) { diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-a-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-a-add-support-for-6ghz-tpc.patch new file mode 100644 index 000000000..468051063 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-008-a-add-support-for-6ghz-tpc.patch @@ -0,0 +1,148 @@ +From 2974dde2aa3273451b6a51c33a30fc98cee10b25 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Sat, 30 Jan 2021 10:15:52 -0800 +Subject: [PATCH 1/4] hostapd: Add country Information element support for 6Ghz + +Signed-off-by: Pradeep Kumar Chitrapu +--- + src/ap/beacon.c | 66 +++++++++++++++++++++++++----------- + src/common/ieee802_11_defs.h | 10 ++++++ + 2 files changed, 56 insertions(+), 20 deletions(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -187,7 +187,8 @@ static u8 * hostapd_eid_pwr_constraint(s + } + + +-static u8 * hostapd_eid_country_add(u8 *pos, u8 *end, int chan_spacing, ++static u8 * hostapd_eid_country_add(struct hostapd_data *hapd, u8 *pos, ++ u8 *end, int chan_spacing, + struct hostapd_channel_data *start, + struct hostapd_channel_data *prev) + { +@@ -199,30 +200,20 @@ static u8 * hostapd_eid_country_add(u8 * + /* number of channels */ + *pos++ = (prev->chan - start->chan) / chan_spacing + 1; + /* maximum transmit power level */ +- *pos++ = start->max_tx_power; ++ if (!is_6ghz_op_class(hapd->iconf->op_class)) ++ *pos++ = start->max_tx_power; ++ else ++ *pos++ = 0; /* Reserved for 6GHz Band */ + + return pos; + } + +- +-static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid, +- int max_len) ++static u8 * hostapd_fill_triplets(struct hostapd_data *hapd, u8 *pos, ++ u8 *end) + { +- u8 *pos = eid; +- u8 *end = eid + max_len; +- int i; + struct hostapd_hw_modes *mode; + struct hostapd_channel_data *start, *prev; +- int chan_spacing = 1; +- +- if (!hapd->iconf->ieee80211d || max_len < 6 || +- hapd->iface->current_mode == NULL) +- return eid; +- +- *pos++ = WLAN_EID_COUNTRY; +- pos++; /* length will be set later */ +- os_memcpy(pos, hapd->iconf->country, 3); /* e.g., 'US ' */ +- pos += 3; ++ int i, chan_spacing = 1; + + mode = hapd->iface->current_mode; + if (mode->mode == HOSTAPD_MODE_IEEE80211A) +@@ -233,6 +224,7 @@ static u8 * hostapd_eid_country(struct h + struct hostapd_channel_data *chan = &mode->channels[i]; + if (chan->flag & HOSTAPD_CHAN_DISABLED) + continue; ++ + if (start && prev && + prev->chan + chan_spacing == chan->chan && + start->max_tx_power == chan->max_tx_power) { +@@ -241,7 +233,8 @@ static u8 * hostapd_eid_country(struct h + } + + if (start && prev) { +- pos = hostapd_eid_country_add(pos, end, chan_spacing, ++ pos = hostapd_eid_country_add(hapd, pos, end, ++ chan_spacing, + start, prev); + start = NULL; + } +@@ -251,10 +244,48 @@ static u8 * hostapd_eid_country(struct h + } + + if (start) { +- pos = hostapd_eid_country_add(pos, end, chan_spacing, ++ pos = hostapd_eid_country_add(hapd, pos, end, ++ chan_spacing, + start, prev); + } + ++ return pos; ++} ++ ++static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid, ++ int max_len) ++{ ++ u8 *pos = eid; ++ u8 *end = eid + max_len; ++ ++ if (!hapd->iconf->ieee80211d || max_len < 6 || ++ hapd->iface->current_mode == NULL) ++ return eid; ++ ++ *pos++ = WLAN_EID_COUNTRY; ++ pos++; /* length will be set later */ ++ os_memcpy(pos, hapd->iconf->country, 3); /* e.g., 'US ' */ ++ pos += 3; ++ ++ if (is_6ghz_op_class(hapd->iconf->op_class)) { ++ /* Third octet of the country string to indicate ++ * Global Operating Class ++ */ ++ eid[4] = 0x4; ++ ++ *pos++ = WLAN_EID_EXT_OPERATING_TRIPLET; ++ /* Operating class*/ ++ *pos++ = hapd->iconf->op_class; ++ /* Coverage Class */ ++ *pos++ = 0; ++ /* Subband Triplets are required only for 20MHz case */ ++ if (hapd->iconf->op_class == 131 || ++ hapd->iconf->op_class == 136) ++ pos = hostapd_fill_triplets(hapd, pos, end); ++ } else { ++ pos = hostapd_fill_triplets(hapd, pos, end); ++ } ++ + if ((pos - eid) & 1) { + if (end - pos < 1) + return eid; +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -494,6 +494,16 @@ + #define WLAN_EID_EXT_ANTI_CLOGGING_TOKEN 93 + #define WLAN_EID_EXT_PASN_PARAMS 100 + ++/* Operating Triplet can be any integer >= 201 ++ * From IEEE P802.11-REVmd/D4.0: The first octet in each Subband ++ * Triplet field or Operating Triplet field contains an unsigned ++ * integer and identifies the type of field. If the integer has ++ * a value less than or equal to 200, then the field is a ++ * Subband Triplet field. If the integer has a value of 201 or ++ * greater, then the field is an Operating Triplet field. ++ */ ++#define WLAN_EID_EXT_OPERATING_TRIPLET 201 ++ + /* Extended Capabilities field */ + #define WLAN_EXT_CAPAB_20_40_COEX 0 + #define WLAN_EXT_CAPAB_GLK 1 diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch new file mode 100644 index 000000000..5937579b5 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch @@ -0,0 +1,50 @@ +From 5b23a6f5fba606cb76fe50e2fc73285caf935b32 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Mon, 1 Feb 2021 11:16:07 -0800 +Subject: [PATCH 2/4] ieee80211: Regulatory info field definition for HE 6GHz + operation IE + +Regulatory info subfield is added per specification +IEEE P802.11ax/D7.0. + +Signed-off-by: Pradeep Kumar Chitrapu +--- + src/ap/ieee802_11_he.c | 9 ++++++++- + src/common/ieee802_11_defs.h | 1 + + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c +index 18436a6b336b..a78ed01a54b6 100644 +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -226,7 +226,14 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) + /* 6 GHz Operation Information field */ + *pos++ = hapd->iconf->channel; /* Primary Channel */ + +- /* Control: Channel Width */ ++ /* Control: ++ * bits 0-1: Channel Width ++ * bits 2-2: Duplicate Beacon ++ * bits 3-5: Regulatory Info ++ * - 0 (Indoor Access Point) ++ * - 1 (Standard Power Access Point) ++ * - Reserved in 5GHz and 2Ghz bands ++ */ + if (seg1) + *pos++ = 3; + else +diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h +index be37c9323ae2..3c065ab27f51 100644 +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -2188,6 +2188,7 @@ struct ieee80211_he_6ghz_oper_info { + + #define HE_6GHZ_OPER_INFO_CTRL_CHAN_WIDTH_MASK (BIT(0) | BIT(1)) + #define HE_6GHZ_OPER_INFO_CTRL_DUP_BEACON BIT(2) ++#define HE_6GHZ_OPER_INFO_CTRL_REG_INFO_MASK (BIT(3) | BIT(4) | BIT(5)) + + /* IEEE P802.11ax/D6.0, 9.4.2.261 HE 6 GHz Band Capabilities element */ + struct ieee80211_he_6ghz_band_cap { +-- +2.17.1 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch new file mode 100644 index 000000000..440a5321f --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch @@ -0,0 +1,82 @@ +From 6ab1c08908767246cf0550787adb75371ab00c96 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Tue, 2 Mar 2021 23:03:03 -0800 +Subject: [PATCH 3/4] hostapd: add config option to specify 6Ghz AP type + +IEEE P802.11ax/D7.0 introduces Regulatory info subfield which +is interpreted to 6Ghz ap type. + +When not specified, Indoor AP type is selected for 6GHz AP by +default. + +Signed-off-by: Pradeep Kumar Chitrapu +--- + hostapd/config_file.c | 2 ++ + hostapd/hostapd.conf | 7 +++++++ + src/ap/ap_config.h | 12 ++++++++++++ + 3 files changed, 21 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index d9c21a5780ba..e3be84c2ac63 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3502,6 +3502,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + line, pos); + return 1; + } ++ } else if (os_strcmp(buf, "he_6ghz_reg_pwr_type") == 0) { ++ conf->he_6ghz_reg_pwr_type = atoi(pos); + } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { + conf->he_oper_chwidth = atoi(pos); + } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { +diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf +index 976582312513..7b9f11a16f80 100644 +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -579,6 +579,13 @@ wmm_ac_vo_acm=0 + # Enable co-locate for a 6GHz radio + #co_locate=0 + ++# 6GHz regulatory AP type ++# This config is to set 6GHz access point type. Possible options ++# are 0 = Indoor AP, 1 = Standard Power AP ++# If not specified Indoor AP is selected by default. ++# option is no operation for non 6GHz band. ++#he_6ghz_reg_pwr_type=0 ++ + ##### IEEE 802.11n related configuration ###################################### + + # ieee80211n: Whether IEEE 802.11n (HT) is enabled +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 70cee055bbe6..6e5406f59887 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1049,6 +1049,9 @@ struct hostapd_config { + u8 he_oper_centr_freq_seg0_idx; + u8 he_oper_centr_freq_seg1_idx; + bool he_co_locate; ++#define AP_TYPE_6GHZ_INDOOR_AP 0 ++#define AP_TYPE_6GHZ_STANDARD_POWER_AP 1 ++ u8 he_6ghz_reg_pwr_type; + #endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_IEEE80211AX +@@ -1079,6 +1082,15 @@ struct hostapd_config { + #endif /* CONFIG_AIRTIME_POLICY */ + }; + ++static inline u8 hostapd_get_he_6ghz_reg_pwr_type(struct hostapd_config *conf) ++{ ++#ifdef CONFIG_IEEE80211AX ++ if (conf->ieee80211ax) ++ return conf->he_6ghz_reg_pwr_type; ++#endif /* CONFIG_IEEE80211AX */ ++ return 0; ++} ++ + + static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf) + { +-- +2.17.1 + diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch new file mode 100644 index 000000000..5287cc440 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch @@ -0,0 +1,229 @@ +From 7c79ef90001929dfa9f150135d672e7105a5ef44 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Tue, 9 Feb 2021 16:51:13 -0800 +Subject: [PATCH 4/4] 6G: add TX power envelope IE in 6GHz + +Add power envelope element for 6GHz Indoor AP as per the +spec IEEE P802.11ax/D7.0. + +Currently uses fixed values for maximum transmit power limits +which are applicable to 6GHz operation in United states, Japan +and Korea. Support to extract the AP operation type and country +or channel specific power contraints will be added later on. + +Signed-off-by: Pradeep Kumar Chitrapu +--- + src/ap/beacon.c | 26 +++++++++++- + src/ap/ieee802_11_vht.c | 81 ++++++++++++++++++++++++++++-------- + src/common/ieee802_11_defs.h | 32 ++++++++++++++ + 3 files changed, 119 insertions(+), 20 deletions(-) + +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -498,9 +498,14 @@ static u8 * hostapd_gen_probe_resp(struc + 3 + sizeof(struct ieee80211_he_operation) + + 3 + sizeof(struct ieee80211_he_mu_edca_parameter_set) + + 3 + sizeof(struct ieee80211_spatial_reuse); +- if (is_6ghz_op_class(hapd->iconf->op_class)) ++ if (is_6ghz_op_class(hapd->iconf->op_class)) { + buflen += sizeof(struct ieee80211_he_6ghz_oper_info) + + 3 + sizeof(struct ieee80211_he_6ghz_band_cap); ++ /* Additional TX Power envelope for subordinate client */ ++ if (hostapd_get_he_6ghz_reg_pwr_type(hapd->iconf) == ++ AP_TYPE_6GHZ_INDOOR_AP) ++ buflen += 4; ++ } + } + #endif /* CONFIG_IEEE80211AX */ + +@@ -1388,6 +1393,15 @@ static u8 * hostapd_gen_fils_discovery(s + buf_len = pos - buf; + total_len += buf_len; + ++ /* TX Power Envelopes */ ++ if (is_6ghz_op_class(hapd->iconf->op_class)) { ++ if (hostapd_get_he_6ghz_reg_pwr_type(hapd->iconf) == ++ AP_TYPE_6GHZ_INDOOR_AP) ++ total_len = total_len + 8; ++ else ++ total_len = total_len + 4; ++ } ++ + head = os_zalloc(total_len); + if (!head) + return NULL; +@@ -1460,6 +1474,9 @@ static u8 * hostapd_gen_fils_discovery(s + pos += buf_len; + } + ++ if (is_6ghz_op_class(hapd->iconf->op_class)) ++ pos = hostapd_eid_txpower_envelope(hapd, pos); ++ + *len = pos - (u8 *) head; + wpa_hexdump(MSG_DEBUG, "FILS Discovery frame template", + (u8 *) head, pos - (u8 *) head); +@@ -1534,9 +1551,14 @@ int ieee802_11_build_ap_params(struct ho + 3 + sizeof(struct ieee80211_he_operation) + + 3 + sizeof(struct ieee80211_he_mu_edca_parameter_set) + + 3 + sizeof(struct ieee80211_spatial_reuse); +- if (is_6ghz_op_class(hapd->iconf->op_class)) ++ if (is_6ghz_op_class(hapd->iconf->op_class)) { + tail_len += sizeof(struct ieee80211_he_6ghz_oper_info) + + 3 + sizeof(struct ieee80211_he_6ghz_band_cap); ++ /* Additional TX Power envelope for subordinate client */ ++ if (hostapd_get_he_6ghz_reg_pwr_type(hapd->iconf) == ++ AP_TYPE_6GHZ_INDOOR_AP) ++ tail_len += 4; ++ } + } + #endif /* CONFIG_IEEE80211AX */ + +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -1938,8 +1938,40 @@ struct tpc_report { + u8 link_margin; + } STRUCT_PACKED; + ++ ++/* ++ * IEEE P802.11ax/D7.0, Table 9-275a—Maximum Transmit Power Interpretation ++ * subfield encoding. ++ */ ++enum max_tx_pwr_interpretation { ++ LOCAL_EIRP = 0, ++ LOCAL_EIRP_PSD = 1, ++ REGULATORY_CLIENT_EIRP = 2, ++ REGULATORY_CLIENT_EIRP_PSD = 3, ++}; ++ ++/* ++ * IEEE P802.11ax/D7.0,Table E-13 — Maximum Transmit Power ++ * Category subfield encoding in the United States. ++ */ ++enum reg_6g_client_type { ++ REG_DEFAULT_CLIENT = 0, ++ REG_SUBORDINATE_CLIENT = 1, ++}; ++ ++/* same Max Tx Pwr for all 20MHz bands */ ++#define DEFAULT_MAX_TX_POWER_COUNT_6G 0 ++/* ++ * These tx-power macros are present till the 6G regdomains are defined to ++ * support tx-power values for various client types. ++ */ ++#define REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT (-1) /* dBm/MHz */ ++#define REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 5 /* dBm/MHz */ ++#define REG_EIRP_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 24 /* dBm */ ++ + #define RRM_CAPABILITIES_IE_LEN 5 + ++ + /* IEEE Std 802.11-2012, 8.5.7.4 - Link Measurement Request frame format */ + struct rrm_link_measurement_request { + u8 dialog_token; +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -6817,6 +6817,30 @@ void ieee802_11_rx_from_unknown(struct h + WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); + } + ++static u8 * hostapd_add_tpe_info(u8 *eid, u8 tx_pwr_count, ++ u8 tx_pwr_intrpn, u8 tx_pwr_cat, ++ u8 tx_pwr) ++{ ++ int i; ++ ++ *eid++ = WLAN_EID_TRANSMIT_POWER_ENVELOPE; ++ /* length */ ++ *eid++ = 2 + tx_pwr_count; ++ ++ /* ++ * Transmit Power Information ++ * bits 0-2 : Maximum Transmit Power Count ++ * bits 3-5 : Maximum Transmit Power Interpretation ++ * bits 6-7 : Maximum Transmit Power Category ++ */ ++ *eid++ = tx_pwr_count | ( tx_pwr_intrpn << 3) | (tx_pwr_cat << 6); ++ ++ /* Maximum transmit Power field */ ++ for (i = 0; i <= tx_pwr_count; i++) ++ *eid++ = tx_pwr; ++ ++ return eid; ++} + + u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid) + { +@@ -6826,8 +6850,8 @@ u8 * hostapd_eid_txpower_envelope(struct + struct hostapd_channel_data *chan; + int dfs, i; + u8 channel, tx_pwr_count, local_pwr_constraint; ++ u8 tx_pwr, tx_pwr_intrpn, tx_pwr_cat, ap_type; + int max_tx_power; +- u8 tx_pwr; + + if (!mode) + return eid; +@@ -6842,6 +6866,41 @@ u8 * hostapd_eid_txpower_envelope(struct + if (i == mode->num_channels) + return eid; + ++ /* For now, 6GHz has only support for Indoor AP type ++ * From IEEE P802.11ax/D7.0: An AP that is an ++ * Indoor Access Point per regulatory rules shall send at least ++ * two Transmit Power Envelope elements in Beacon and Probe ++ * Response frames as follows: ++ * - Maximum Transmit Power Category subfield = Default; ++ * Unit interpretation = Regulatory client EIRP PSD ++ * - Maximum Transmit Power Category subfield = Subordinate Device; ++ * Unit interpretation = Regulatory client EIRP PSD ++ */ ++ if (is_6ghz_op_class(iconf->op_class)) { ++ ap_type = hostapd_get_he_6ghz_reg_pwr_type(iconf); ++ ++ tx_pwr_count = DEFAULT_MAX_TX_POWER_COUNT_6G; ++ tx_pwr_intrpn = REGULATORY_CLIENT_EIRP_PSD; ++ ++ /* Indoor access point must include additional ++ * TPE for subordinate device ++ */ ++ if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) { ++ tx_pwr_cat = REG_SUBORDINATE_CLIENT; ++ /* TODO: extract psd limits from channel data */ ++ tx_pwr = REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT * 2; ++ eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn, ++ tx_pwr_cat, tx_pwr); ++ } ++ ++ /* Default Tx Power envelope for Global Operating class */ ++ tx_pwr_cat = REG_DEFAULT_CLIENT; ++ tx_pwr = REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT * 2; ++ eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn, tx_pwr_cat, tx_pwr); ++ ++ return eid; ++ } ++ + switch (hostapd_get_oper_chwidth(iconf)) { + case CHANWIDTH_USE_HT: + if (iconf->secondary_channel == 0) { +@@ -6914,17 +6973,9 @@ u8 * hostapd_eid_txpower_envelope(struct + else + tx_pwr = max_tx_power; + +- *eid++ = WLAN_EID_TRANSMIT_POWER_ENVELOPE; +- *eid++ = 2 + tx_pwr_count; +- +- /* +- * Max Transmit Power count and +- * Max Transmit Power units = 0 (EIRP) +- */ +- *eid++ = tx_pwr_count; +- +- for (i = 0; i <= tx_pwr_count; i++) +- *eid++ = tx_pwr; ++ tx_pwr_intrpn = LOCAL_EIRP; ++ tx_pwr_cat = 0; /* Reserved for non 6GHz */ ++ eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn, tx_pwr_cat, tx_pwr); + + return eid; + } diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch b/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch new file mode 100644 index 000000000..38c981604 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch @@ -0,0 +1,131 @@ +From 575b68536cb4e44a42de2d76b5702f13f8557d36 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Fri, 26 Mar 2021 12:59:10 +0530 +Subject: [PATCH] hostapd: Fill 6G TPE IE for non-US countries + +Currently PSD power limits for 6GHz Regular and subordinate +clients in 6G TPE IE are hardcoded with the values defined +for country US, by default. + +It is extended to hardcode proper PSD values for all 6G countries +and supported AP power modes. + +PSD values will be fetched from kernel data instead of hardcoded +values, after complete regulatory support is added for 6G. + +Signed-off-by: Lavanya Suresh +--- + src/ap/ap_config.h | 1 + + src/ap/ieee802_11.c | 43 +++++++++++++++++++++++++++++++++++++++++-- + src/common/ieee802_11_defs.h | 25 ++++++++++++++++++++++--- + 3 files changed, 64 insertions(+), 5 deletions(-) + +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1070,6 +1070,7 @@ struct hostapd_config { + bool he_co_locate; + #define AP_TYPE_6GHZ_INDOOR_AP 0 + #define AP_TYPE_6GHZ_STANDARD_POWER_AP 1 ++#define AP_TYPE_6GHZ_VERY_LOW_POWER_AP 2 + u8 he_6ghz_reg_pwr_type; + #endif /* CONFIG_IEEE80211AX */ + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -6817,6 +6817,47 @@ void ieee802_11_rx_from_unknown(struct h + WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); + } + ++u8 hostapd_get_6g_tx_power(struct hostapd_data *hapd, u8 ap_type, u8 tx_pwr_cat) ++{ ++ char country[3]; ++ ++ if (hapd->iconf->country[0] != '\0' && hapd->iconf->country[1] != '\0') ++ memcpy(country, hapd->iconf->country, 3); ++ else ++ hostapd_get_country(hapd, country); ++ ++ if ((memcmp(country, "US", 2) == 0) || (memcmp(country, "CL", 2) == 0)) { ++ /* FCC Regdomain */ ++ if (ap_type == AP_TYPE_6GHZ_INDOOR_AP && tx_pwr_cat == REG_DEFAULT_CLIENT) ++ return REG_FCC_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT_LPI; ++ else if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) ++ return REG_FCC_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT_LPI; ++ else if (ap_type == AP_TYPE_6GHZ_STANDARD_POWER_AP) ++ return REG_FCC_PSD_MAX_TXPOWER_SP; ++ ++ } else if (memcmp(country, "GB", 2) == 0) { ++ /* ETSI2 Regdomain */ ++ if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) ++ return REG_ETSI2_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_LPI; ++ else if (ap_type == AP_TYPE_6GHZ_VERY_LOW_POWER_AP) ++ return REG_ETSI2_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_VLP; ++ ++ } else if (memcmp(country, "KR", 2) == 0) { ++ /* APL1 Regdomain */ ++ if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) ++ return REG_APL1_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_LPI; ++ else if (ap_type == AP_TYPE_6GHZ_VERY_LOW_POWER_AP) ++ return REG_APL1_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_VLP; ++ } else { ++ wpa_printf(MSG_DEBUG, "Invalid 6g regdomain/country(%s)", country); ++ return 0; ++ } ++ ++ wpa_printf(MSG_DEBUG, "Configured AP type(%d) is not supported for the country(%s) currently set", ++ ap_type, country); ++ return 0; ++} ++ + static u8 * hostapd_add_tpe_info(u8 *eid, u8 tx_pwr_count, + u8 tx_pwr_intrpn, u8 tx_pwr_cat, + u8 tx_pwr) +@@ -6888,14 +6929,14 @@ u8 * hostapd_eid_txpower_envelope(struct + if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) { + tx_pwr_cat = REG_SUBORDINATE_CLIENT; + /* TODO: extract psd limits from channel data */ +- tx_pwr = REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT * 2; ++ tx_pwr = (hostapd_get_6g_tx_power(hapd, ap_type, tx_pwr_cat) * 2); + eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn, + tx_pwr_cat, tx_pwr); + } + + /* Default Tx Power envelope for Global Operating class */ + tx_pwr_cat = REG_DEFAULT_CLIENT; +- tx_pwr = REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT * 2; ++ tx_pwr = (hostapd_get_6g_tx_power(hapd, ap_type, tx_pwr_cat) * 2); + eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn, tx_pwr_cat, tx_pwr); + + return eid; +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h +@@ -1965,9 +1965,15 @@ enum reg_6g_client_type { + * These tx-power macros are present till the 6G regdomains are defined to + * support tx-power values for various client types. + */ +-#define REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT (-1) /* dBm/MHz */ +-#define REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 5 /* dBm/MHz */ +-#define REG_EIRP_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 24 /* dBm */ ++#define REG_FCC_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT_LPI (-1) /* dBm/MHz */ ++#define REG_FCC_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT_LPI 5 /* dBm/MHz */ ++#define REG_FCC_PSD_MAX_TXPOWER_SP 17 /* dBm/MHz */ ++ ++#define REG_ETSI2_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_LPI 11 /* dBm/MHz */ ++#define REG_ETSI2_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_VLP 11 /* dBm/MHz */ ++ ++#define REG_APL1_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_LPI 2 /* dBm/MHz */ ++#define REG_APL1_PSD_MAX_TXPOWER_DEFAULT_SUBORDINATE_CLIENT_VLP 1 /* dBm/MHz */ + + #define RRM_CAPABILITIES_IE_LEN 5 + +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -585,7 +585,7 @@ wmm_ac_vo_acm=0 + + # 6GHz regulatory AP type + # This config is to set 6GHz access point type. Possible options +-# are 0 = Indoor AP, 1 = Standard Power AP ++# are 0 = Indoor AP, 1 = Standard Power AP, 2 = Very Low Power AP + # If not specified Indoor AP is selected by default. + # option is no operation for non 6GHz band. + #he_6ghz_reg_pwr_type=0 diff --git a/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch b/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch new file mode 100644 index 000000000..c90b56a17 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch @@ -0,0 +1,22 @@ +From 7e91e58668d316dd7ea7bc69c0040b7d60214b57 Mon Sep 17 00:00:00 2001 +From: Tamizh Chelvam +Date: Tue, 9 Mar 2021 10:20:47 +0530 +Subject: [PATCH] hostap: Add changes to fix compilation errors + +Signed-off-by: Tamizh Chelvam +--- + src/ap/beacon.c | 2 +- + src/drivers/driver_nl80211.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -5170,7 +5170,7 @@ static int wpa_driver_nl80211_sta_add(vo + + if (params->he_6ghz_capab) { + wpa_hexdump(MSG_DEBUG, " * he_6ghz_capab", +- params->he_6ghz_capab, ++ (u8 *) params->he_6ghz_capab, + sizeof(*params->he_6ghz_capab)); + if (nla_put(msg, NL80211_ATTR_HE_6GHZ_CAPABILITY, + sizeof(*params->he_6ghz_capab), diff --git a/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch b/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch new file mode 100644 index 000000000..35f2a44c8 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch @@ -0,0 +1,28 @@ +Index: hostapd-2021-02-20-59e9794c/src/common/hw_features_common.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/common/hw_features_common.c ++++ hostapd-2021-02-20-59e9794c/src/common/hw_features_common.c +@@ -114,7 +114,7 @@ int allowed_ht40_channel_pair(enum hosta + { + int ok, first; + int allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 140, +- 149, 157, 165, 184, 192 }; ++ 149, 157, 165, 173, 184, 192 }; + size_t k; + int ht40_plus, pri_chan, sec_chan; + +Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c ++++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c +@@ -2507,8 +2507,8 @@ void ibss_mesh_setup_freq(struct wpa_sup + enum hostapd_hw_mode hw_mode; + struct hostapd_hw_modes *mode = NULL; + int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, +- 184, 192 }; +- unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, ++ 165, 173, 184, 192 }; ++ unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5825, 5955, + 6035, 6115, 6195, 6275, 6355, 6435, 6515, + 6595, 6675, 6755, 6835, 6915, 6995 }; + unsigned int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 }; diff --git a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch new file mode 100644 index 000000000..2731032d1 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch @@ -0,0 +1,329 @@ +From 6cbf57cd8899d8a531706c9f85393f602cd08219 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Tue, 4 May 2021 12:35:55 +0530 +Subject: [PATCH] hostapd cli cmd to display allowed bw on each channel + +Signed-off-by: Hari Chandrakanthan +--- + hostapd/ctrl_iface.c | 235 ++++++++++++++++++++++++++++++++++++++------------ + hostapd/hostapd_cli.c | 10 +-- + 2 files changed, 185 insertions(+), 60 deletions(-) + +diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c +index bbe49aa..ea1a156 100644 +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -3215,75 +3215,202 @@ set: + return ret; + } + +-static int hostapd_2ghz_ht40_allow_map(struct hostapd_hw_modes *mode, +- char *buf, size_t buflen) ++static int hostapd_2ghz_channel_bw(struct hostapd_hw_modes *mode, char *buf, ++ size_t buflen) + { +- int j, ret, len = 0; ++ int ch, ret, len = 0; ++ char temp_buf[30] = {0}; + +- for (j = 0; j < mode->num_channels; j++) { +- struct hostapd_channel_data *chan = &mode->channels[j]; +- if (!(chan->flag & HOSTAPD_CHAN_DISABLED)) { +- ret = os_snprintf(buf + len, buflen - len, +- "Channel: %d : %d HT40%c%c\n", +- chan->chan, chan->freq, +- (chan->flag & HOSTAPD_CHAN_HT40MINUS) ? +- '-' : ' ', +- (chan->flag & HOSTAPD_CHAN_HT40PLUS) ? +- '+' : ' '); +- if (os_snprintf_error(buflen - len, ret)) +- return len; +- len += ret; +- } ++ for (ch = 0; ch < mode->num_channels; ch++) { ++ struct hostapd_channel_data *chan = &mode->channels[ch]; ++ if (chan->flag & HOSTAPD_CHAN_DISABLED) ++ continue; ++ ret = os_snprintf(temp_buf, 30, "Channel[%d]", chan->chan); ++ if (os_snprintf_error(30, ret)) ++ return len; ++ ret = os_snprintf(buf + len, buflen - len, ++ "%-13s : %d - 20MHz HT40%c%c\n", ++ temp_buf, chan->freq, ++ (chan->flag & HOSTAPD_CHAN_HT40MINUS)?'-':' ', ++ (chan->flag & HOSTAPD_CHAN_HT40PLUS)?'+':' '); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; + } + return len; + } + +-static int hostapd_5ghz_ht40_allow_map(struct hostapd_hw_modes *mode, +- char *buf, size_t buflen) ++static int hostapd_get_channel_idx(struct hostapd_hw_modes *mode, ++ int channel_num) + { +- int j, k, ok, ret, len = 0, allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 140, +- 149, 157, 184, 192 }; ++ int j=0; + +- for (j = 0; j < mode->num_channels; j++) { ++ for(j = 0; j < mode->num_channels; j++) { + struct hostapd_channel_data *chan = &mode->channels[j]; ++ if(chan->chan == channel_num) ++ return j; ++ } ++ return -1; ++} + +- if ((chan->flag & HOSTAPD_CHAN_HT40MINUS) || +- (chan->flag & HOSTAPD_CHAN_HT40PLUS)) { +- ok = 0; +- for (k = 0; k < ARRAY_SIZE(allowed); k++) { +- if (chan->chan < allowed[k]) +- break; +- if (chan->chan == allowed[k]) { +- ok = 1; +- break; +- } ++static int hostapd_5ghz_vht_80_channel_bw(struct hostapd_hw_modes *mode, ++ int channel_idx) ++{ ++ int k, m, ok, allowed[][4] = {{36, 40, 44, 48}, {52, 56, 60, 64}, ++ {100, 104, 108, 112}, {116, 120, 124, 128}, ++ {132, 136, 140, 144}, {149, 153, 157, 161}}; ++ struct hostapd_channel_data *chan = &mode->channels[channel_idx]; ++ ++ ok = 0; ++ for (k = 0; k < ARRAY_SIZE(allowed); k++) { ++ for(m = 0; m < ARRAY_SIZE(allowed[0]); m++) { ++ if (chan->chan == allowed[k][m]) { ++ ok = 1; ++ break; + } ++ } ++ if(ok == 1) ++ break; ++ } + +- if (!ok && chan->chan != (allowed[k - 1] + 4)) +- ok = -1; +- +- if (ok == 1 && (mode->channels[j + 1].flag & +- HOSTAPD_CHAN_DISABLED)) +- ok = -1; ++ if (ok == 0) ++ return false; + +- if (ok != -1) { +- ret = os_snprintf(buf + len, buflen - len, +- "Channel: %d : %d HT40%s\n", +- chan->chan, chan->freq, +- ok == 1 ? "+" : "-"); ++ for(m = 0; m < ARRAY_SIZE(allowed[0]); m++) { ++ channel_idx = hostapd_get_channel_idx(mode, allowed[k][m]); ++ if((channel_idx == -1) || (mode->channels[channel_idx].flag & ++ HOSTAPD_CHAN_DISABLED)) ++ return false; ++ } + +- if (os_snprintf_error(buflen - len, ret)) +- return len; ++ return true; ++} + +- len += ret; ++static bool hostapd_5ghz_vht_160_channel_bw(struct hostapd_hw_modes *mode, ++ int channel_idx) ++{ ++ int k, m, ok, allowed[][8] = {{36, 40, 44, 48, 52, 56, 60, 64}, ++ {100, 104, 108, 112, 116, 120, 124, 128}}; ++ struct hostapd_channel_data *chan = &mode->channels[channel_idx]; ++ ++ ok = 0; ++ for (k = 0; k < ARRAY_SIZE(allowed); k++) { ++ for(m = 0; m < ARRAY_SIZE(allowed[0]); m++) { ++ if (chan->chan == allowed[k][m]) { ++ ok = 1; ++ break; + } + } ++ if(ok == 1) ++ break; ++ } ++ ++ if (ok == 0) ++ return false; ++ ++ for(m = 0; m < ARRAY_SIZE(allowed[0]); m++) { ++ channel_idx = hostapd_get_channel_idx(mode, allowed[k][m]); ++ if (channel_idx == -1 || (mode->channels[channel_idx].flag & ++ HOSTAPD_CHAN_DISABLED)) ++ return false; ++ } ++ return true; ++} ++ ++static int hostapd_5ghz_ht_40_channel_bw(struct hostapd_hw_modes *mode, ++ int channel_idx) ++{ ++ ++ int k, ok, allowed[] = {36, 44, 52, 60, 100, 108, 116, 124, 132, 140, ++ 149, 157, 184, 192}; ++ struct hostapd_channel_data *chan = &mode->channels[channel_idx]; ++ ++ if (!((chan->flag & HOSTAPD_CHAN_HT40MINUS) || ++ (chan->flag & HOSTAPD_CHAN_HT40PLUS))) ++ return 0; ++ ++ ok = 0; ++ for (k = 0; k < ARRAY_SIZE(allowed); k++) { ++ if (chan->chan < allowed[k]) ++ break; ++ if (chan->chan == allowed[k]) { ++ ok = 1; ++ break; ++ } ++ } ++ ++ if (!ok && chan->chan != (allowed[k - 1] + 4)) ++ ok = -1; ++ ++ if (ok == 1 && (mode->channels[channel_idx + 1].flag & ++ HOSTAPD_CHAN_DISABLED)) ++ ok = -1; ++ ++ if (ok != -1) { ++ if( ok == 1) ++ return HOSTAPD_CHAN_HT40PLUS; ++ else ++ return HOSTAPD_CHAN_HT40MINUS; ++ } ++ return 0; ++} ++ ++static int hostapd_5ghz_channel_bw(struct hostapd_hw_modes *mode, ++ char *buf, size_t buflen) ++{ ++ int j, ret, ret_val, len = 0; ++ char temp_buf[30] = {0}; ++ ++ for (j = 0; j < mode->num_channels; j++) { ++ struct hostapd_channel_data *chan = &mode->channels[j]; ++ if (chan->flag & HOSTAPD_CHAN_DISABLED) ++ continue; ++ ++ ret = os_snprintf(temp_buf, 30, "Channel[%d]", chan->chan); ++ if (os_snprintf_error(30, ret)) ++ return len; ++ ++ ret = os_snprintf(buf + len, buflen - len, "%-13s : %d - 20MHz ", ++ temp_buf, chan->freq); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; ++ ++ ret_val = hostapd_5ghz_ht_40_channel_bw(mode, j); ++ if(ret_val) { ++ ret = os_snprintf(buf + len, buflen - len, "HT40%s ", ++ ret_val == HOSTAPD_CHAN_HT40PLUS? "+":"-"); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; ++ } ++ ++ if(hostapd_5ghz_vht_80_channel_bw(mode, j)) { ++ ret = os_snprintf(buf + len, buflen - len, "80MHz "); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; ++ } ++ ++ if((mode->vht_capab & (VHT_CAP_SUPP_CHAN_WIDTH_160MHZ | ++ VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)) && ++ hostapd_5ghz_vht_160_channel_bw(mode, j)) { ++ ret = os_snprintf(buf + len, buflen - len, "160MHz "); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; ++ } ++ ++ ret = os_snprintf(buf + len, buflen - len,"\n"); ++ if (os_snprintf_error(buflen - len, ret)) ++ return len; ++ len += ret; + } + return len; + } + +-static int hostapd_ctrl_iface_ht40_allow_map(struct hostapd_iface *iface, +- char *buf, size_t buflen) ++static int hostapd_ctrl_iface_channel_bw(struct hostapd_iface *iface, ++ char *buf, size_t buflen) + { + struct hostapd_data *hapd = iface->bss[0]; + struct hostapd_hw_modes *mode; +@@ -3295,11 +3422,12 @@ static int hostapd_ctrl_iface_ht40_allow_map(struct hostapd_iface *iface, + &dfs_domain); + + if (mode->mode != HOSTAPD_MODE_IEEE80211A) +- len = hostapd_2ghz_ht40_allow_map(mode, buf, buflen); ++ len = hostapd_2ghz_channel_bw(mode, buf, buflen); + else +- len = hostapd_5ghz_ht40_allow_map(mode, buf, buflen); ++ len = hostapd_5ghz_channel_bw(mode, buf, buflen); + + return len; ++ + } + + static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, +@@ -3912,10 +4040,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, + if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) + reply_len = -1; + #endif /* RADIUS_SERVER */ +- } else if (os_strcmp(buf, "HT40_ALLOW_MAP") == 0) { +- reply_len = hostapd_ctrl_iface_ht40_allow_map(hapd->iface, +- reply, +- reply_size); ++ } else if(os_strcmp(buf, "CHANNEL_BW") == 0) { ++ reply_len = hostapd_ctrl_iface_channel_bw(hapd->iface, reply, ++ reply_size); + } else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) { + reply_len = hostapd_ctrl_iface_get_capability( + hapd, buf + 15, reply, reply_size); +diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c +index 6ee8d96..14317f5 100644 +--- a/hostapd/hostapd_cli.c ++++ b/hostapd/hostapd_cli.c +@@ -1384,13 +1384,11 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc, + return wpa_ctrl_command(ctrl, "DRIVER_FLAGS"); + } + +-static int hostapd_cli_cmd_ht40_allow_map(struct wpa_ctrl *ctrl, ++static int hostapd_cli_cmd_channel_bw(struct wpa_ctrl *ctrl, + int argc, char *argv[]) + { +- return wpa_ctrl_command(ctrl, "HT40_ALLOW_MAP"); ++ return wpa_ctrl_command(ctrl, "CHANNEL_BW"); + } +- +- + #ifdef CONFIG_DPP + + static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc, +@@ -1753,8 +1751,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { + "=Add/Delete/Show/Clear deny MAC ACL" }, + { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, + " = poll a STA to check connectivity with a QoS null frame" }, +- { "ht40_allow_map", hostapd_cli_cmd_ht40_allow_map, NULL, +- "= show ht40 allow map status" }, ++ { "channel_bw", hostapd_cli_cmd_channel_bw, NULL, ++ "= show allowed bandwidth on each channel"}, + { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, + " [req_mode=] = send a Beacon report request to a station" }, + { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch new file mode 100644 index 000000000..91fcbccc3 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch @@ -0,0 +1,195 @@ +From cd028d950808096de588d99ef5a082a33d4965db Mon Sep 17 00:00:00 2001 +From: leiwei +Date: Fri, 23 Apr 2021 19:54:24 +0800 +Subject: [PATCH] hostap:Support GCM-AES-256 cipher suite select when + participant act as key server + +Signed-off-by: leiwei +--- + hostapd/config_file.c | 10 ++++++++++ + src/ap/ap_config.h | 7 +++++++ + src/ap/wpa_auth_kay.c | 3 ++- + src/pae/ieee802_1x_cp.c | 6 +++--- + src/pae/ieee802_1x_kay.c | 13 ++++++++++--- + src/pae/ieee802_1x_kay.h | 2 +- + wpa_supplicant/config.c | 1 + + wpa_supplicant/config_ssid.h | 7 +++++++ + wpa_supplicant/wpas_kay.c | 4 ++-- + 9 files changed, 43 insertions(+), 10 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 08a5bcd..39ea156 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4530,6 +4530,16 @@ static int hostapd_config_fill(struct hostapd_config *conf, + return 1; + } + bss->mka_priority = mka_priority; ++ } else if (os_strcmp(buf, "macsec_csindex") == 0) { ++ int macsec_csindex = atoi(pos); ++ ++ if (macsec_csindex < 0 || macsec_csindex > 1) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: invalid macsec_csindex (%d): '%s'.", ++ line, macsec_csindex, pos); ++ return 1; ++ } ++ bss->macsec_csindex = macsec_csindex; + } else if (os_strcmp(buf, "mka_cak") == 0) { + size_t len = os_strlen(pos); + +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 05f3c7d..ad37222 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -850,6 +850,13 @@ struct hostapd_bss_config { + int mka_priority; + + /** ++ * macsec_csindex - chipher suite index of macsec ++ * ++ * Range: 0-1 (default: 0) ++ */ ++ int macsec_csindex; ++ ++ /** + * mka_ckn - MKA pre-shared CKN + */ + #define MACSEC_CKN_MAX_LEN 32 +diff --git a/src/ap/wpa_auth_kay.c b/src/ap/wpa_auth_kay.c +index 46d94b4..d5341e2 100644 +--- a/src/ap/wpa_auth_kay.c ++++ b/src/ap/wpa_auth_kay.c +@@ -329,7 +329,8 @@ int ieee802_1x_alloc_kay_sm_hapd(struct hostapd_data *hapd, + hapd->conf->macsec_replay_protect, + hapd->conf->macsec_replay_window, + hapd->conf->macsec_port, +- hapd->conf->mka_priority, hapd->conf->iface, ++ hapd->conf->mka_priority, ++ hapd->conf->macsec_csindex, hapd->conf->iface, + hapd->own_addr); + /* ieee802_1x_kay_init() frees kay_ctx on failure */ + if (!res) +diff --git a/src/pae/ieee802_1x_cp.c b/src/pae/ieee802_1x_cp.c +index cf41d8d..f0527fd 100644 +--- a/src/pae/ieee802_1x_cp.c ++++ b/src/pae/ieee802_1x_cp.c +@@ -20,7 +20,7 @@ + #define STATE_MACHINE_DATA struct ieee802_1x_cp_sm + #define STATE_MACHINE_DEBUG_PREFIX "CP" + +-static u64 default_cs_id = CS_ID_GCM_AES_128; ++static u64 cs_id[]={CS_ID_GCM_AES_128, CS_ID_GCM_AES_256}; + + /* The variable defined in clause 12 in IEEE Std 802.1X-2010 */ + enum connect_type { PENDING, UNAUTHENTICATED, AUTHENTICATED, SECURE }; +@@ -473,8 +473,8 @@ struct ieee802_1x_cp_sm * ieee802_1x_cp_sm_init(struct ieee802_1x_kay *kay) + sm->orx = false; + sm->otx = false; + +- sm->current_cipher_suite = default_cs_id; +- sm->cipher_suite = default_cs_id; ++ sm->current_cipher_suite = cs_id[kay->macsec_csindex]; ++ sm->cipher_suite = cs_id[kay->macsec_csindex]; + sm->cipher_offset = CONFIDENTIALITY_OFFSET_0; + sm->confidentiality_offset = sm->cipher_offset; + sm->transmit_delay = MKA_LIFE_TIME; +diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c +index ad5a34b..04a7e93 100644 +--- a/src/pae/ieee802_1x_kay.c ++++ b/src/pae/ieee802_1x_kay.c +@@ -222,7 +222,14 @@ ieee802_1x_mka_dump_dist_sak_body(struct ieee802_1x_mka_dist_sak_body *body) + wpa_printf(MSG_DEBUG, "\tKey Number............: %d", + be_to_host32(body->kn)); + /* TODO: Other than GCM-AES-128 case: MACsec Cipher Suite */ +- wpa_hexdump(MSG_DEBUG, "\tAES Key Wrap of SAK...:", body->sak, 24); ++ if(body_len == 28){ ++ wpa_hexdump(MSG_INFO, "\tAES Key Wrap of SAK...:", body->sak, 24); ++ } ++ else{ ++ wpa_hexdump(MSG_INFO, "\tMacsec Cipher Suite...:", body->sak, CS_ID_LEN); ++ wpa_hexdump(MSG_INFO, "\tAES Key Wrap of SAK...:", body->sak + CS_ID_LEN, ++ body_len - CS_ID_LEN - sizeof(body->kn)); ++ } + } + + +@@ -3458,7 +3465,7 @@ static void kay_l2_receive(void *ctx, const u8 *src_addr, const u8 *buf, + struct ieee802_1x_kay * + ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, + bool macsec_replay_protect, u32 macsec_replay_window, +- u16 port, u8 priority, const char *ifname, const u8 *addr) ++ u16 port, u8 priority, u32 macsec_csindex, const char *ifname, const u8 *addr) + { + struct ieee802_1x_kay *kay; + +@@ -3495,7 +3502,7 @@ ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, + kay->dist_time = 0; + + kay->pn_exhaustion = PENDING_PN_EXHAUSTION; +- kay->macsec_csindex = DEFAULT_CS_INDEX; ++ kay->macsec_csindex = macsec_csindex; + kay->mka_algindex = DEFAULT_MKA_ALG_INDEX; + kay->mka_version = MKA_VERSION_ID; + +diff --git a/src/pae/ieee802_1x_kay.h b/src/pae/ieee802_1x_kay.h +index 1d3c2ac..a3cf964 100644 +--- a/src/pae/ieee802_1x_kay.h ++++ b/src/pae/ieee802_1x_kay.h +@@ -240,7 +240,7 @@ u64 mka_sci_u64(struct ieee802_1x_mka_sci *sci); + struct ieee802_1x_kay * + ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, + bool macsec_replay_protect, u32 macsec_replay_window, +- u16 port, u8 priority, const char *ifname, const u8 *addr); ++ u16 port, u8 priority, u32 macsec_csindex, const char *ifname, const u8 *addr); + void ieee802_1x_kay_deinit(struct ieee802_1x_kay *kay); + + struct ieee802_1x_mka_participant * +diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c +index 7e7d9bb..f723b70 100644 +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c +@@ -2777,6 +2777,7 @@ static const struct parse_data ssid_fields[] = { + { INT(macsec_replay_window) }, + { INT_RANGE(macsec_port, 1, 65534) }, + { INT_RANGE(mka_priority, 0, 255) }, ++ { INT_RANGE(macsec_csindex, 0, 1) }, + { FUNC_KEY(mka_cak) }, + { FUNC_KEY(mka_ckn) }, + #endif /* CONFIG_MACSEC */ +diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h +index b655e39..747e4d0 100644 +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h +@@ -915,6 +915,13 @@ struct wpa_ssid { + int mka_priority; + + /** ++ * macsec_csindex - chipher suite index of macsec ++ * ++ * Range: 0-1 (default: 0) ++ */ ++ int macsec_csindex; ++ ++ /** + * mka_ckn - MKA pre-shared CKN + */ + #define MACSEC_CKN_MAX_LEN 32 +diff --git a/wpa_supplicant/wpas_kay.c b/wpa_supplicant/wpas_kay.c +index defd0f2..4d1ce02 100644 +--- a/wpa_supplicant/wpas_kay.c ++++ b/wpa_supplicant/wpas_kay.c +@@ -241,8 +241,8 @@ int ieee802_1x_alloc_kay_sm(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) + + res = ieee802_1x_kay_init(kay_ctx, policy, ssid->macsec_replay_protect, + ssid->macsec_replay_window, ssid->macsec_port, +- ssid->mka_priority, wpa_s->ifname, +- wpa_s->own_addr); ++ ssid->mka_priority, ssid->macsec_csindex, ++ wpa_s->ifname, wpa_s->own_addr); + /* ieee802_1x_kay_init() frees kay_ctx on failure */ + if (res == NULL) + return -1; +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch b/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch new file mode 100644 index 000000000..09518d95a --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch @@ -0,0 +1,42 @@ +From 6e1348ac1eaa8a4a62dccce588aa9306f876b068 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Mon, 24 May 2021 22:18:11 +0530 +Subject: [PATCH] hostapd: Fix channel switch on 6g + +Below cmd does not return fail, but fails to update beacon. +Center frequency used in command is not valid for 80M bandwidth. + + hostapd_cli -i wlan0 chan_switch 5 6315 sec_channel_offset=1 + center_freq1=6345 bandwidth=80 he + +This patch adds condition check to validate the center frequency. + +Signed-off-by: Anilkumar Kolli +--- + hostapd/ctrl_iface.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c +index ea1a1567278c..664711d5bd87 100644 +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -2528,6 +2528,16 @@ static int hostapd_ctrl_get_pmk(struct hostapd_data *hapd, const char *cmd, + #ifdef NEED_AP_MLME + static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) + { ++ int idx, bw, bw_idx[] = { 20, 40, 80, 160 }; ++ ++ if (is_6ghz_freq(params->freq) && params->center_freq1) { ++ idx = (params->center_freq1 - 5950) / 5; ++ bw = center_idx_to_bw_6ghz(idx); ++ ++ if (bw < 0 || (bw_idx[bw] != params->bandwidth)) ++ return -1; ++ } ++ + switch (params->bandwidth) { + case 0: + /* bandwidth not specified: use 20 MHz by default */ +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/l00-001-hostapd-avoid-filling-group-mgmt-cipher-type-in-FD-R.patch b/feeds/wifi-ax/hostapd/patches/l00-001-hostapd-avoid-filling-group-mgmt-cipher-type-in-FD-R.patch new file mode 100644 index 000000000..0afd86547 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/l00-001-hostapd-avoid-filling-group-mgmt-cipher-type-in-FD-R.patch @@ -0,0 +1,35 @@ +From 2149e44c4a1767645c889de3e1712465b7fe5137 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Wed, 12 May 2021 20:03:07 +0530 +Subject: [PATCH] hostapd: avoid filling group mgmt cipher type in FD RSN to + reflect beacon RSN IE + +Currently we don’t advertise Group Management cipher suite +in beacons if management frame protection is not enabled or +if the group management cipher is default (WPA_CIPHER_AES_128_CMAC) +but we advertise the suite type in FD RSN IE. + +Hence set it to 63, if management frame protection is disabled or when +default cipher is used. + +Signed-off-by: Sriram R +--- + src/ap/wpa_auth_ie.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/ap/wpa_auth_ie.c ++++ b/src/ap/wpa_auth_ie.c +@@ -1177,11 +1177,9 @@ bool wpa_auth_write_fd_rsn_info(struct w + + /* Group Management Cipher Suite Selector (B22..B27) */ + cipher = 63; /* Default to no cipher suite selected */ +- if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { ++ if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION && ++ conf->group_mgmt_cipher != WPA_CIPHER_AES_128_CMAC) { + switch (conf->group_mgmt_cipher) { +- case WPA_CIPHER_AES_128_CMAC: +- cipher = RSN_CIPHER_SUITE_AES_128_CMAC & 0xff; +- break; + case WPA_CIPHER_BIP_GMAC_128: + cipher = RSN_CIPHER_SUITE_BIP_GMAC_128 & 0xff; + break; diff --git a/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch b/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch new file mode 100644 index 000000000..2fbdebd3d --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch @@ -0,0 +1,32 @@ +From 994bff7d74eba00244b481a7d164a44412908ad6 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Kathirvel +Date: Fri, 4 Jun 2021 22:19:27 +0530 +Subject: [PATCH] hostapd: unable to set HE mode on 2.4Ghz + +Channel switch through hostapd_cli is not able to operate in HE mode in +2.4Ghz. This is because since the he mode is not enabled for 2ghz the +channel type is set to 20Mhz NO_HT. + +Enabled he for 2Ghz radio on 20Mhz bandwidth for channel switch. + +Signed-off-by: Karthikeyan Kathirvel +--- + src/drivers/driver_nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index cbf41c6..a0dd827 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4979,7 +4979,7 @@ static int nl80211_put_freq_params(struct nl_msg *msg, + nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, + freq->center_freq2))) + return -ENOBUFS; +- } else if (freq->ht_enabled) { ++ } else if (freq->ht_enabled || (freq->he_enabled && is_24ghz)) { + enum nl80211_channel_type ct; + + wpa_printf(MSG_DEBUG, " * sec_channel_offset=%d", +-- +2.7.4 + diff --git a/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch b/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch new file mode 100644 index 000000000..da048baab --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch @@ -0,0 +1,80 @@ +From 420852ff044c804a6487ccc060f85c12bbdaac31 Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Thu, 1 Jul 2021 10:15:29 +0530 +Subject: [PATCH] hostap: Avoid selecting UNII-1 channel after DFS switch + +Avoid UNII-1 band channel from getting selected after DFS when primary +channel is UNII-2 band with 80Mhz configuration. + +To enable this, 'skip_unii1_dfs_switch' config should be enabled +in hostapd config. + +Signed-off-by: Seevalamuthu Mariappan +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.h | 1 + + src/ap/dfs.c | 25 +++++++++++++++++++++++++ + 3 files changed, 28 insertions(+) + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3349,6 +3349,8 @@ static int hostapd_config_fill(struct ho + conf->require_ht = atoi(pos); + } else if (os_strcmp(buf, "obss_interval") == 0) { + conf->obss_interval = atoi(pos); ++ } else if (os_strcmp(buf, "skip_unii1_dfs_switch") == 0) { ++ conf->skip_unii1_dfs_switch = atoi(pos); + #ifdef CONFIG_IEEE80211AC + } else if (os_strcmp(buf, "ieee80211ac") == 0) { + conf->ieee80211ac = atoi(pos); +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1030,6 +1030,7 @@ struct hostapd_config { + + /* Use driver-generated interface addresses when adding multiple BSSs */ + u8 use_driver_iface_addr; ++ u8 skip_unii1_dfs_switch; + + #ifdef CONFIG_FST + struct fst_iface_cfg fst_cfg; +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -199,6 +199,24 @@ static int is_in_chanlist(struct hostapd + return freq_range_list_includes(&iface->conf->acs_ch_list, chan->chan); + } + ++static bool is_skip_unii1_dfs_switch_applicable(struct hostapd_iface *iface, ++ struct hostapd_channel_data *chan) ++{ ++ if (!iface->conf->skip_unii1_dfs_switch) ++ return false; ++ ++ /* Skip adjacent channel when below conditions are true ++ * i) The primary channel of the AP is 52/56/60/64 & 80MHz mode. ++ * ii) The AP moves to the adjacent channel 36/40/44/48 in 80MHz mode ++ */ ++ ++ if ((hostapd_get_oper_chwidth(iface->conf) == CHANWIDTH_80MHZ) && ++ ((iface->conf->channel >= 52) && (iface->conf->channel <= 64)) && ++ ((chan->chan >= 36) && (chan->chan <= 48))) ++ return true; ++ ++ return false; ++} + + /* + * The function assumes HT40+ operation. +@@ -247,6 +265,13 @@ static int dfs_find_channel(struct hosta + chan->freq, chan->chan); + continue; + } ++ ++ if (is_skip_unii1_dfs_switch_applicable(iface, chan)) { ++ wpa_printf(MSG_DEBUG, ++ "DFS: skip_unii1_dfs_switch enabled, skip adjacent channel: %d (%d)", ++ chan->freq, chan->chan); ++ continue; ++ } + + if (ret_chan && idx == channel_idx) { + wpa_printf(MSG_DEBUG, "Selected channel %d (%d)", diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c index 63fd6ae8d..3652ab063 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c +++ b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c @@ -1741,9 +1741,6 @@ void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequen struct hostapd_data *hapd; int i; - if (!hapd->ubus.obj.has_subscribers) - return; - blob_buf_init(&b, 0); blobmsg_add_u16(&b, "frequency", frequency); blobmsg_add_u16(&b, "width", chan_width); diff --git a/feeds/wifi-ax/hostapd/src/src/utils/build_features.h b/feeds/wifi-ax/hostapd/src/src/utils/build_features.h index 35356b232..3ab5246c7 100644 --- a/feeds/wifi-ax/hostapd/src/src/utils/build_features.h +++ b/feeds/wifi-ax/hostapd/src/src/utils/build_features.h @@ -23,10 +23,6 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "11r")) return 1; #endif -#ifdef CONFIG_IEEE80211W - if (!strcmp(feat, "11w")) - return 1; -#endif #ifdef CONFIG_ACS if (!strcmp(feat, "acs")) return 1; @@ -46,6 +42,14 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_WEP if (!strcmp(feat, "wep")) return 1; +#endif +#ifdef CONFIG_HS20 + if (!strcmp(feat, "hs20")) + return 1; +#endif +#ifdef CONFIG_WPS + if (!strcmp(feat, "wps")) + return 1; #endif return 0; } diff --git a/feeds/wifi-ax/iw/Makefile b/feeds/wifi-ax/iw/Makefile new file mode 100644 index 000000000..0782168bb --- /dev/null +++ b/feeds/wifi-ax/iw/Makefile @@ -0,0 +1,72 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=iw +PKG_VERSION:=5.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://www.kernel.org/pub/software/network/iw +PKG_MD5SUM:=7a47d6f749ec69afcaf351166fd12f6f + +PKG_MAINTAINER:=Felix Fietkau +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/iw + SECTION:=net + CATEGORY:=Network + TITLE:=cfg80211 interface configuration utility + URL:=http://wireless.kernel.org/en/users/Documentation/iw + DEPENDS:= +libnl-tiny +endef + +define Package/iw-full + $(Package/iw) + TITLE += (full version) + VARIANT:=full + PROVIDES:=iw +endef + +define Build/Configure + echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c + rm -f $(PKG_BUILD_DIR)/version.sh + touch $(PKG_BUILD_DIR)/version.sh + chmod +x $(PKG_BUILD_DIR)/version.sh +endef + +TARGET_CFLAGS += -fpie -Wall -Werror +TARGET_LDFLAGS += -pie + +TARGET_CPPFLAGS:= \ + -I$(STAGING_DIR)/usr/include/libnl-tiny \ + $(TARGET_CPPFLAGS) \ + -DCONFIG_LIBNL20 \ + -D_GNU_SOURCE + +ifeq ($(BUILD_VARIANT),full) + TARGET_CPPFLAGS += -DIW_FULL + MAKE_FLAGS += IW_FULL=1 +endif + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffunction-sections -fdata-sections" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ + NL1FOUND="" NL2FOUND=Y \ + NLLIBNAME="libnl-tiny" \ + LIBS="-lm -lnl-tiny" \ + V=1 + +define Package/iw/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,iw)) diff --git a/feeds/wifi-ax/iw/patches/001-nl80211_h_sync.patch b/feeds/wifi-ax/iw/patches/001-nl80211_h_sync.patch new file mode 100644 index 000000000..a0a79c498 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/001-nl80211_h_sync.patch @@ -0,0 +1,47 @@ +--- a/nl80211.h ++++ b/nl80211.h +@@ -2527,6 +2527,9 @@ enum nl80211_commands { + * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in + * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. + * ++ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce ++ * transmit power to stay within regulatory limits. u32, dBi. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3016,6 +3019,34 @@ enum nl80211_attrs { + NL80211_ATTR_S1G_CAPABILITY, + NL80211_ATTR_S1G_CAPABILITY_MASK, + ++ NL80211_ATTR_SAE_PWE, ++ ++ NL80211_ATTR_RECONNECT_REQUESTED, ++ ++ NL80211_ATTR_SAR_SPEC, ++ ++ NL80211_ATTR_DISABLE_HE, ++ ++ NL80211_ATTR_HE_MUEDCA_PARAMS, ++ ++ NL80211_ATTR_MULTIPLE_BSSID_PARENT, ++ NL80211_ATTR_MULTIPLE_BSSID_INDEX, ++ NL80211_ATTR_MULTIPLE_BSSID_COUNT, ++ NL80211_ATTR_MULTIPLE_BSSID_IES, ++ NL80211_ATTR_MULTIPLE_BSSID_EMA, ++ ++ NL80211_ATTR_OBSS_COLOR_BITMAP, ++ ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT, ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, ++ NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, ++ ++ NL80211_ATTR_RNR_OFFSETS, ++ ++ NL80211_ATTR_BEACON_TX_MODE, ++ ++ NL80211_ATTR_WIPHY_ANTENNA_GAIN, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, diff --git a/feeds/wifi-ax/iw/patches/120-antenna_gain.patch b/feeds/wifi-ax/iw/patches/120-antenna_gain.patch new file mode 100644 index 000000000..21768d33f --- /dev/null +++ b/feeds/wifi-ax/iw/patches/120-antenna_gain.patch @@ -0,0 +1,36 @@ +--- a/phy.c ++++ b/phy.c +@@ -740,6 +740,33 @@ COMMAND(set, antenna, " | all | + "Set a bitmap of allowed antennas to use for TX and RX.\n" + "The driver may reject antenna configurations it cannot support."); + ++static int handle_antenna_gain(struct nl80211_state *state, ++ struct nl_msg *msg, ++ int argc, char **argv, ++ enum id_input id) ++{ ++ char *endptr; ++ int dbm; ++ ++ /* get the required args */ ++ if (argc != 1) ++ return 1; ++ ++ dbm = strtol(argv[0], &endptr, 10); ++ if (*endptr) ++ return 2; ++ ++ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_GAIN, dbm); ++ ++ return 0; ++ ++ nla_put_failure: ++ return -ENOBUFS; ++} ++COMMAND(set, antenna_gain, "", ++ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna_gain, ++ "Specify antenna gain."); ++ + static int handle_set_txq(struct nl80211_state *state, + struct nl_msg *msg, + int argc, char **argv, diff --git a/feeds/wifi-ax/iw/patches/200-reduce_size.patch b/feeds/wifi-ax/iw/patches/200-reduce_size.patch new file mode 100644 index 000000000..ede489c5e --- /dev/null +++ b/feeds/wifi-ax/iw/patches/200-reduce_size.patch @@ -0,0 +1,457 @@ +--- a/event.c ++++ b/event.c +@@ -42,6 +42,7 @@ static int parse_beacon_hint_chan(struct + return 0; + } + ++#ifdef IW_FULL + static void print_frame(struct print_event_args *args, struct nlattr *attr) + { + uint8_t *frame; +@@ -340,7 +341,7 @@ static void parse_vendor_event(struct nl + out: + printf("\n"); + } +- ++#endif + static void parse_nan_term(struct nlattr **attrs) + { + struct nlattr *func[NL80211_NAN_FUNC_ATTR_MAX + 1]; +@@ -895,15 +896,18 @@ static void parse_ch_switch_notify(struc + static int print_event(struct nl_msg *msg, void *arg) + { + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); +- struct nlattr *tb[NL80211_ATTR_MAX + 1], *nst; ++ struct nlattr *tb[NL80211_ATTR_MAX + 1]; + struct print_event_args *args = arg; + char ifname[100]; + char macbuf[6*3]; + __u8 reg_type; + struct ieee80211_beacon_channel chan_before_beacon, chan_after_beacon; + __u32 wiphy_idx = 0; ++#ifdef IW_FULL ++ struct nlattr *nst; + int rem_nst; + __u16 status; ++#endif + + if (args->time || args->reltime) { + unsigned long long usecs, previous; +@@ -944,6 +948,7 @@ static int print_event(struct nl_msg *ms + } + + switch (gnlh->cmd) { ++#ifdef IW_FULL + case NL80211_CMD_NEW_WIPHY: + printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME])); + break; +@@ -979,6 +984,7 @@ static int print_event(struct nl_msg *ms + case NL80211_CMD_SCHED_SCAN_RESULTS: + printf("got scheduled scan results\n"); + break; ++#endif + case NL80211_CMD_WIPHY_REG_CHANGE: + case NL80211_CMD_REG_CHANGE: + if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE) +@@ -1061,6 +1067,7 @@ static int print_event(struct nl_msg *ms + mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); + printf("del station %s\n", macbuf); + break; ++#ifdef IW_FULL + case NL80211_CMD_JOIN_IBSS: + mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); + printf("IBSS %s joined\n", macbuf); +@@ -1224,6 +1231,7 @@ static int print_event(struct nl_msg *ms + case NL80211_CMD_DEL_WIPHY: + printf("delete wiphy\n"); + break; ++#endif + case NL80211_CMD_PEER_MEASUREMENT_RESULT: + parse_pmsr_result(tb, args); + break; +@@ -1255,8 +1263,7 @@ static int print_event(struct nl_msg *ms + parse_ch_switch_notify(tb, gnlh->cmd); + break; + default: +- printf("unknown event %d (%s)\n", +- gnlh->cmd, command_name(gnlh->cmd)); ++ printf("unknown event %d\n", gnlh->cmd); + break; + } + +--- a/info.c ++++ b/info.c +@@ -19,6 +19,7 @@ static void print_flag(const char *name, + *open = 1; + } + ++#ifdef IW_FULL + static char *cipher_name(__u32 c) + { + static char buf[20]; +@@ -56,6 +57,7 @@ static char *cipher_name(__u32 c) + return buf; + } + } ++#endif + + static int ext_feature_isset(const unsigned char *ext_features, int ext_features_len, + enum nl80211_ext_feature_index ftidx) +@@ -95,20 +97,21 @@ static int print_phy_handler(struct nl_m + [NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG }, + [NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 }, + }; +- ++#ifdef IW_FULL + struct nlattr *tb_rate[NL80211_BITRATE_ATTR_MAX + 1]; + static struct nla_policy rate_policy[NL80211_BITRATE_ATTR_MAX + 1] = { + [NL80211_BITRATE_ATTR_RATE] = { .type = NLA_U32 }, + [NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE] = { .type = NLA_FLAG }, + }; +- +- struct nlattr *nl_band; +- struct nlattr *nl_freq; + struct nlattr *nl_rate; +- struct nlattr *nl_mode; + struct nlattr *nl_cmd; + struct nlattr *nl_if, *nl_ftype; +- int rem_band, rem_freq, rem_rate, rem_mode, rem_cmd, rem_ftype, rem_if; ++ int rem_rate, rem_cmd, rem_ftype, rem_if; ++#endif ++ struct nlattr *nl_band; ++ struct nlattr *nl_freq; ++ struct nlattr *nl_mode; ++ int rem_band, rem_freq, rem_mode; + int open; + /* + * static variables only work here, other applications need to use the +@@ -216,6 +219,7 @@ next: + } + } + ++#ifdef IW_FULL + if (tb_band[NL80211_BAND_ATTR_RATES]) { + printf("\t\tBitrates (non-HT):\n"); + nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) { +@@ -232,6 +236,7 @@ next: + printf("\n"); + } + } ++#endif + } + } + +@@ -297,6 +302,7 @@ next: + printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) { + int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32); + int i; +@@ -308,6 +314,7 @@ next: + cipher_name(ciphers[i])); + } + } ++#endif + + if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] && + tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]) +@@ -327,11 +334,13 @@ next: + printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) { + printf("\tsoftware interface modes (can always be added):\n"); + nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode) + printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); + } ++#endif + + if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) { + struct nlattr *nl_combi; +@@ -428,6 +437,7 @@ broken_combination: + printf("\tinterface combinations are not supported\n"); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) { + printf("\tSupported commands:\n"); + nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd) +@@ -525,6 +535,7 @@ broken_combination: + printf("\t\t * wake up on TCP connection\n"); + } + } ++#endif + + if (tb_msg[NL80211_ATTR_ROAM_SUPPORT]) + printf("\tDevice supports roaming.\n"); +@@ -563,6 +574,7 @@ broken_combination: + } + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) { + unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]); + +@@ -630,6 +642,10 @@ broken_combination: + + if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) + printf("\tDevice supports T-DLS.\n"); ++ if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) ++ printf("\tDevice supports TDLS channel switching\n"); ++ } ++#endif + + if (tb_msg[NL80211_ATTR_EXT_FEATURES]) { + struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES]; +@@ -762,6 +778,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP + "List all wireless devices and their capabilities."); + TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL); + ++#ifdef IW_FULL + static int handle_commands(struct nl80211_state *state, struct nl_msg *msg, + int argc, char **argv, enum id_input id) + { +@@ -773,6 +790,7 @@ static int handle_commands(struct nl8021 + } + TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands, + "list all known commands and their decimal & hex value"); ++#endif + + static int print_feature_handler(struct nl_msg *msg, void *arg) + { +--- a/scan.c ++++ b/scan.c +@@ -559,6 +559,7 @@ static void print_ssid(const uint8_t typ + #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 + #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 + ++#ifdef IW_FULL + static void print_supprates(const uint8_t type, uint8_t len, + const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -746,6 +747,7 @@ static void print_ap_channel_report(cons + } + printf("\n"); + } ++#endif + + static void print_cipher(const uint8_t *data) + { +@@ -1065,12 +1067,14 @@ static void print_rsn_ie(const char *def + _print_rsn_ie(defcipher, defauth, len, data, 0); + } + ++#ifdef IW_FULL + static void print_osen_ie(const char *defcipher, const char *defauth, + uint8_t len, const uint8_t *data) + { + printf("\n\t"); + _print_rsn_ie(defcipher, defauth, len, data, 1); + } ++#endif + + static void print_rsn(const uint8_t type, uint8_t len, const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -1088,6 +1092,7 @@ static void print_ht_capa(const uint8_t + print_ht_mcs(data + 3); + } + ++#ifdef IW_FULL + static const char* ntype_11u(uint8_t t) + { + switch (t) { +@@ -1270,6 +1275,7 @@ static void print_tx_power_envelope(cons + printf("\t\t * %s: %i dBm\n", power_names[i], power_val); + } + } ++#endif + + static const char *ht_secondary_offset[4] = { + "no secondary", +@@ -1297,6 +1303,7 @@ static void print_ht_op(const uint8_t ty + printf("\t\t * secondary channel offset: %s\n", + ht_secondary_offset[data[1] & 0x3]); + printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]); ++ return; + printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3); + printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]); + printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2); +@@ -1309,6 +1316,7 @@ static void print_ht_op(const uint8_t ty + printf("\t\t * PCO phase: %d\n", (data[5] & 0x8) >> 3); + } + ++#ifdef IW_FULL + static void print_capabilities(const uint8_t type, uint8_t len, + const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -1486,6 +1494,7 @@ static void print_ibssatim(const uint8_t + { + printf(" %d TUs\n", (data[1] << 8) + data[0]); + } ++#endif + + static void print_vht_capa(const uint8_t type, uint8_t len, const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -1514,6 +1523,7 @@ static void print_vht_oper(const uint8_t + printf("\t\t * VHT basic MCS set: 0x%.2x%.2x\n", data[4], data[3]); + } + ++#ifdef IW_FULL + static void print_supp_op_classes(const uint8_t type, uint8_t len, + const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -1611,6 +1621,7 @@ static void print_obss_scan_params(const + printf("\t\t * OBSS Scan Activity Threshold: %d.%02d %%\n", + ((data[13] << 8) | data[12]) / 100, ((data[13] << 8) | data[12]) % 100); + } ++#endif + + static void print_secchan_offs(const uint8_t type, uint8_t len, + const uint8_t *data, +@@ -1622,6 +1633,7 @@ static void print_secchan_offs(const uin + printf(" %d\n", data[0]); + } + ++#ifdef IW_FULL + static void print_bss_load(const uint8_t type, uint8_t len, const uint8_t *data, + const struct print_ies_data *ie_buffer) + { +@@ -1663,6 +1675,7 @@ static void print_mesh_conf(const uint8_ + if (data[6] & 0x40) + printf("\t\t\t Mesh Power Save Level\n"); + } ++#endif + + struct ie_print { + const char *name; +@@ -1707,6 +1720,13 @@ static void print_ie(const struct ie_pri + + static const struct ie_print ieprinters[] = { + [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, ++ [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), }, ++ [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, ++ [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, ++ [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), }, ++ [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), }, ++ [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, ++#ifdef IW_FULL + [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, + [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), }, + [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), }, +@@ -1716,17 +1736,11 @@ static const struct ie_print ieprinters[ + [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), }, + [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), }, + [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), }, +- [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), }, + [47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), }, + [51] = { "AP Channel Report", print_ap_channel_report, 1, 255, BIT(PRINT_SCAN), }, + [59] = { "Supported operating classes", print_supp_op_classes, 1, 255, BIT(PRINT_SCAN), }, + [66] = { "Measurement Pilot Transmission", print_measurement_pilot_tx, 1, 255, BIT(PRINT_SCAN), }, + [74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), }, +- [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, +- [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), }, +- [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), }, +- [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, +- [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, + [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, + [70] = { "RM enabled capabilities", print_rm_enabled_capabilities, 5, 5, BIT(PRINT_SCAN), }, + [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), }, +@@ -1736,8 +1750,10 @@ static const struct ie_print ieprinters[ + [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), }, + [111] = { "802.11u Roaming Consortium", print_11u_rcon, 2, 255, BIT(PRINT_SCAN), }, + [195] = { "Transmit Power Envelope", print_tx_power_envelope, 2, 5, BIT(PRINT_SCAN), }, ++#endif + }; + ++#ifdef IW_FULL + static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, + const struct print_ies_data *ie_buffer) + { +@@ -2074,6 +2090,7 @@ static const struct ie_print wifiprinter + [2] = { "WMM", print_wifi_wmm, 1, 255, BIT(PRINT_SCAN), }, + [4] = { "WPS", print_wifi_wps, 0, 255, BIT(PRINT_SCAN), }, + }; ++#endif + + static inline void print_p2p(const uint8_t type, uint8_t len, + const uint8_t *data, +@@ -2169,6 +2186,7 @@ static inline void print_hs20_ind(const + printf("\t\tUnexpected length: %i\n", len); + } + ++#ifdef IW_FULL + static void print_wifi_owe_tarns(const uint8_t type, uint8_t len, + const uint8_t *data, + const struct print_ies_data *ie_buffer) +@@ -2262,6 +2280,7 @@ static void print_vendor(unsigned char l + printf(" %.2x", data[i]); + printf("\n"); + } ++#endif + + void print_ies(unsigned char *ie, int ielen, bool unknown, + enum print_ie_type ptype) +@@ -2279,6 +2298,7 @@ void print_ies(unsigned char *ie, int ie + ieprinters[ie[0]].flags & BIT(ptype)) { + print_ie(&ieprinters[ie[0]], + ie[0], ie[1], ie + 2, &ie_buffer); ++#ifdef IW_FULL + } else if (ie[0] == 221 /* vendor */) { + print_vendor(ie[1], ie + 2, unknown, ptype); + } else if (unknown) { +@@ -2288,6 +2308,7 @@ void print_ies(unsigned char *ie, int ie + for (i=0; i 45000) + is_dmg = true; ++#endif + } + if (bss[NL80211_BSS_BEACON_INTERVAL]) + printf("\tbeacon interval: %d TUs\n", +--- a/util.c ++++ b/util.c +@@ -147,6 +147,7 @@ const char *iftype_name(enum nl80211_ift + return modebuf; + } + ++#ifdef IW_FULL + static const char *commands[NL80211_CMD_MAX + 1] = { + #include "nl80211-commands.inc" + }; +@@ -160,6 +161,7 @@ const char *command_name(enum nl80211_co + sprintf(cmdbuf, "Unknown command (%d)", cmd); + return cmdbuf; + } ++#endif + + int ieee80211_channel_to_frequency(int chan, enum nl80211_band band) + { diff --git a/feeds/wifi-ax/iw/patches/502-Add-channel-attribure-support-for-nl80211-message.patch b/feeds/wifi-ax/iw/patches/502-Add-channel-attribure-support-for-nl80211-message.patch new file mode 100644 index 000000000..21dd5f4b9 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/502-Add-channel-attribure-support-for-nl80211-message.patch @@ -0,0 +1,40 @@ +Add channel attribure support for nl80211 message + +--- + info.c | 9 +++++++-- + nl80211.h | 1 + + 2 files changed, 8 insertions(+), 2 deletions(-) + +--- a/info.c ++++ b/info.c +@@ -183,13 +183,18 @@ static int print_phy_handler(struct nl_m + band_had_freq = true; + } + nla_for_each_nested(nl_freq, tb_band[NL80211_BAND_ATTR_FREQS], rem_freq) { +- uint32_t freq; ++ uint32_t freq,channel; + nla_parse(tb_freq, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_freq), + nla_len(nl_freq), freq_policy); + if (!tb_freq[NL80211_FREQUENCY_ATTR_FREQ]) + continue; + freq = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]); +- printf("\t\t\t* %d MHz [%d]", freq, ieee80211_frequency_to_channel(freq)); ++ if (tb_freq[NL80211_FREQUENCY_ATTR_CHANNEL]) ++ channel = nla_get_u16(tb_freq[NL80211_FREQUENCY_ATTR_CHANNEL]); ++ else ++ channel = ieee80211_frequency_to_channel(freq); ++ printf("\t\t\t* %d MHz [%d]", freq, channel); ++ + + if (tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] && + !tb_freq[NL80211_FREQUENCY_ATTR_DISABLED]) +--- a/nl80211.h ++++ b/nl80211.h +@@ -3802,6 +3802,7 @@ enum nl80211_frequency_attr { + NL80211_FREQUENCY_ATTR_NO_20MHZ, + NL80211_FREQUENCY_ATTR_NO_10MHZ, + NL80211_FREQUENCY_ATTR_WMM, ++ NL80211_FREQUENCY_ATTR_CHANNEL, + NL80211_FREQUENCY_ATTR_NO_HE, + NL80211_FREQUENCY_ATTR_OFFSET, + NL80211_FREQUENCY_ATTR_1MHZ, diff --git a/feeds/wifi-ax/iw/patches/505-Add-user-command-for-tid-specific-retry-count.patch b/feeds/wifi-ax/iw/patches/505-Add-user-command-for-tid-specific-retry-count.patch new file mode 100644 index 000000000..a289e7cc9 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/505-Add-user-command-for-tid-specific-retry-count.patch @@ -0,0 +1,147 @@ +diff --git a/interface.c b/interface.c +index 89c95a9ac4ab..506151002fae 100644 +--- a/interface.c ++++ b/interface.c +@@ -728,6 +728,81 @@ COMMAND(switch, freq, + COMMAND(switch, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", + NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); + ++static int handle_retry_count(struct nl80211_state *state, ++ struct nl_msg *msg, ++ int argc, char **argv, ++ enum id_input id) ++{ ++ struct nl_msg *tid = NULL; ++ unsigned char mac_addr[ETH_ALEN]; ++ uint8_t retry_short, retry_long, tid_no; ++ char *end; ++ int ret = -ENOSPC; ++ ++ if (argc < 4) ++ return 1; ++ ++ tid = nlmsg_alloc(); ++ if (!tid) ++ return -ENOMEM; ++ ++ while (argc) { ++ if (strcmp(argv[0], "tid") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ tid_no = strtoul(argv[1], &end, 8); ++ if (*end) ++ return 1; ++ ++ NLA_PUT_U8(tid, NL80211_ATTR_TID, tid_no); ++ } else if (strcmp(argv[0], "peer") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ if (mac_addr_a2n(mac_addr, argv[1])) { ++ fprintf(stderr, "invalid mac address\n"); ++ return 2; ++ } ++ ++ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr); ++ } else if (strcmp(argv[0], "short") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ retry_short = strtoul(argv[1], &end, 0); ++ if (*end) ++ return 1; ++ ++ NLA_PUT_U8(tid, NL80211_ATTR_TID_RETRY_SHORT, retry_short); ++ } else if (strcmp(argv[0], "long") == 0) { ++ if (argc < 2) ++ return 1; ++ retry_long = strtoul(argv[1], &end, 0); ++ if (*end) ++ return 1; ++ ++ NLA_PUT_U8(tid, NL80211_ATTR_TID_RETRY_LONG, retry_long); ++ } else { ++ return 1; ++ } ++ argc -= 2; ++ argv += 2; ++ } ++ ++ NLA_PUT_FLAG(tid, NL80211_ATTR_TID_RETRY_CONFIG); ++ nla_put_nested(msg, NL80211_ATTR_TID_CONFIG, tid); ++ ++ ret = 0; ++ ++nla_put_failure: ++ nlmsg_free(tid); ++ return ret; ++} ++COMMAND(set, tid_retry_count, "tid <[peer ] short long ]>", ++ NL80211_CMD_SET_TID_CONFIG, 0, CIB_NETDEV, handle_retry_count, ++ "Set the retry count for the TIDs "); ++ + + static int toggle_tid_param(const char *argv0, const char *argv1, + struct nl_msg *msg, uint32_t attr) +diff --git a/nl80211.h b/nl80211.h +index b0ce8767ea25..998851d8f9e1 100644 +--- a/nl80211.h ++++ b/nl80211.h +@@ -4886,7 +4886,55 @@ enum nl80211_ps_state { + NL80211_PS_DISABLED, + NL80211_PS_ENABLED, + }; +- ++/* ++ * @NL80211_ATTR_TID: a TID value (u8 attribute) ++ * @NL80211_ATTR_TID_RETRY_CONFIG: Data frame retry count should be ++ * applied with the value passed through %NL80211_ATTR_RETRY_LONG ++ * and/or %NL80211_ATTR_RETRY_SHORT. This configuration is per-TID, ++ * TID is specified with %NL80211_ATTR_TID. If the peer MAC address ++ * is passed in %NL80211_ATTR_MAC, the retry configuration is applied ++ * to the data frame for the tid to that connected station. ++ * This attribute will be useful to notfiy the driver to apply default ++ * retry values for the connected station (%NL80211_ATTR_MAC), when the ++ * command received without %NL80211_ATTR_RETRY_LONG and/or ++ * %NL80211_ATTR_RETRY_SHORT. ++ * Station specific retry configuration is valid only for STA's ++ * current connection. i.e. the configuration will be reset to default when ++ * the station connects back after disconnection/roaming. ++ * when user-space does not include %NL80211_ATTR_MAC, this configuration ++ * should be treated as per-netdev configuration. This configuration will ++ * be cleared when the interface goes down and on the disconnection from a ++ * BSS. When retry count has never been configured using this command, the ++ * other available radio level retry configuration ++ * (%NL80211_ATTR_WIPHY_RETRY_SHORT and %NL80211_ATTR_WIPHY_RETRY_LONG) ++ * should be used. Driver supporting this feature should advertise ++ * NL80211_EXT_FEATURE_PER_TID_RETRY_CONFIG and supporting per station ++ * retry count configuration should advertise ++ * NL80211_EXT_FEATURE_PER_STA_RETRY_CONFIG. ++ * @NL80211_ATTR_TID_RETRY_SHORT: Number of retries used with data frame ++ * transmission, user-space sets this configuration in ++ * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and ++ * the max value should be advertised by the driver through ++ * max_data_retry_count. when this attribute is not present, the driver ++ * would use the default configuration. ++ * @NL80211_ATTR_TID_RETRY_LONG: Number of retries used with data frame ++ * transmission, user-space sets this configuration in ++ * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and ++ * the max value should be advertised by the driver through ++ * max_data_retry_count. when this attribute is not present, the driver ++ * would use the default configuration. ++ */ ++enum nl80211_attr_tid_config { ++ __NL80211_ATTR_TID_INVALID, ++ NL80211_ATTR_TID, ++ NL80211_ATTR_TID_RETRY_CONFIG, ++ NL80211_ATTR_TID_RETRY_SHORT, ++ NL80211_ATTR_TID_RETRY_LONG, ++ ++ /* keep last */ ++ __NL80211_ATTR_TID_AFTER_LAST, ++ NL80211_ATTR_TID_MAX = __NL80211_ATTR_TID_AFTER_LAST - 1 ++}; + /** + * enum nl80211_attr_cqm - connection quality monitor attributes + * @__NL80211_ATTR_CQM_INVALID: invalid diff --git a/feeds/wifi-ax/iw/patches/506-Add-user-command-for-tid-specific-aggr-conf.patch b/feeds/wifi-ax/iw/patches/506-Add-user-command-for-tid-specific-aggr-conf.patch new file mode 100644 index 000000000..ee7b0a966 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/506-Add-user-command-for-tid-specific-aggr-conf.patch @@ -0,0 +1,117 @@ +--- a/interface.c ++++ b/interface.c +@@ -803,6 +803,71 @@ COMMAND(set, tid_retry_count, "tid + NL80211_CMD_SET_TID_CONFIG, 0, CIB_NETDEV, handle_retry_count, + "Set the retry count for the TIDs "); + ++static int handle_aggr_conf(struct nl80211_state *state, ++ struct nl_msg *msg, ++ int argc, char **argv, ++ enum id_input id) ++{ ++ struct nl_msg *tid = NULL; ++ unsigned char mac_addr[ETH_ALEN]; ++ uint8_t tid_no; ++ char *end; ++ int ret = -ENOSPC; ++ ++ if (argc < 4) ++ return 1; ++ ++ tid = nlmsg_alloc(); ++ if (!tid) ++ return -ENOMEM; ++ ++ while (argc) { ++ if (strcmp(argv[0], "tid") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ tid_no = strtoul(argv[1], &end, 8); ++ if (*end) ++ return 1; ++ ++ NLA_PUT_U8(tid, NL80211_ATTR_TID, tid_no); ++ } else if (strcmp(argv[0], "peer") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ if (mac_addr_a2n(mac_addr, argv[1])) { ++ fprintf(stderr, "invalid mac address\n"); ++ return 2; ++ } ++ ++ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr); ++ } else if (strcmp(argv[0], "aggr") == 0) { ++ if (argc < 2) ++ return 1; ++ if (strcmp(argv[1], "on") == 0) ++ NLA_PUT_U8(tid, NL80211_ATTR_TID_AMPDU_AGGR_CTRL, 1); ++ else if (strcmp(argv[1], "off") == 0) ++ NLA_PUT_U8(tid, NL80211_ATTR_TID_AMPDU_AGGR_CTRL, 0); ++ else ++ return 1; ++ } else { ++ return 1; ++ } ++ argc -= 2; ++ argv += 2; ++ } ++ ++ nla_put_nested(msg, NL80211_ATTR_TID_CONFIG, tid); ++ ret = 0; ++ ++nla_put_failure: ++ nlmsg_free(tid); ++ return ret; ++} ++COMMAND(set, tid_aggr_conf, "tid <[peer ] aggr on|off>", ++ NL80211_CMD_SET_TID_CONFIG, 0, CIB_NETDEV, handle_aggr_conf, ++ "Enable/disable aggregation for the TIDs "); ++ + + static int toggle_tid_param(const char *argv0, const char *argv1, + struct nl_msg *msg, uint32_t attr) +--- a/nl80211.h ++++ b/nl80211.h +@@ -4915,17 +4915,32 @@ enum nl80211_ps_state { + * the max value should be advertised by the driver through + * max_data_retry_count. when this attribute is not present, the driver + * would use the default configuration. ++ * @NL80211_ATTR_TID_AMPDU_AGGR_CTRL: Enable/Disable aggregation for the TID ++ * specified in %%NL80211_ATTR_TID. Its type is u8, if the peer MAC address ++ * is passed in %NL80211_ATTR_MAC, the aggregation configuration is applied ++ * to the data frame for the tid to that connected station. ++ * Station specific aggregation configuration is valid only for STA's ++ * current connection. i.e. the configuration will be reset to default when ++ * the station connects back after disconnection/roaming. ++ * when user-space does not include %NL80211_ATTR_MAC, this configuration ++ * should be treated as per-netdev configuration. This configuration will ++ * be cleared when the interface goes down and on the disconnection from a ++ * BSS. Driver supporting this feature should advertise ++ * NL80211_EXT_FEATURE_PER_STA_AMPDU_AGGR_CTRL and supporting per station ++ * aggregation configuration should advertise ++ * NL80211_EXT_FEATURE_PER_STA_AMPDU_AGGR_CTRL. + */ + enum nl80211_attr_tid_config { +- __NL80211_ATTR_TID_INVALID, +- NL80211_ATTR_TID, +- NL80211_ATTR_TID_RETRY_CONFIG, +- NL80211_ATTR_TID_RETRY_SHORT, +- NL80211_ATTR_TID_RETRY_LONG, ++ __NL80211_ATTR_TID_INVALID, ++ NL80211_ATTR_TID, ++ NL80211_ATTR_TID_RETRY_CONFIG, ++ NL80211_ATTR_TID_RETRY_SHORT, ++ NL80211_ATTR_TID_RETRY_LONG, ++ NL80211_ATTR_TID_AMPDU_AGGR_CTRL, + +- /* keep last */ +- __NL80211_ATTR_TID_AFTER_LAST, +- NL80211_ATTR_TID_MAX = __NL80211_ATTR_TID_AFTER_LAST - 1 ++ /* keep last */ ++ __NL80211_ATTR_TID_AFTER_LAST, ++ NL80211_ATTR_TID_MAX = __NL80211_ATTR_TID_AFTER_LAST - 1 + }; + /** + * enum nl80211_attr_cqm - connection quality monitor attributes diff --git a/feeds/wifi-ax/iw/patches/507-Add-peer-address-in-noack-map-command b/feeds/wifi-ax/iw/patches/507-Add-peer-address-in-noack-map-command new file mode 100644 index 000000000..665cc21f5 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/507-Add-peer-address-in-noack-map-command @@ -0,0 +1,54 @@ +--- a/interface.c ++++ b/interface.c +@@ -579,23 +579,43 @@ static int handle_interface_noack_map(st + enum id_input id) + { + uint16_t noack_map; ++ unsigned char mac_addr[ETH_ALEN]; + char *end; + +- if (argc != 1) ++ if (argc < 1) + return 1; + +- noack_map = strtoul(argv[0], &end, 16); +- if (*end) +- return 1; +- +- NLA_PUT_U16(msg, NL80211_ATTR_NOACK_MAP, noack_map); ++ if (strcmp(argv[0], "peer") == 0) { ++ if (argc < 2) ++ return 1; ++ ++ if (mac_addr_a2n(mac_addr, argv[1])) { ++ fprintf(stderr, "Invalid MAC address\n"); ++ return 2; ++ } ++ ++ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr); ++ argc -= 2; ++ argv += 2; ++ } ++ ++ if (argc) { ++ if (argc > 1) ++ return 1; ++ ++ noack_map = strtoul(argv[0], &end, 16); ++ if (*end) ++ return 1; ++ NLA_PUT_U16(msg, NL80211_ATTR_NOACK_MAP, noack_map); ++ } + + return 0; +- nla_put_failure: ++ ++nla_put_failure: + return -ENOBUFS; + + } +-COMMAND(set, noack_map, "", ++COMMAND(set, noack_map, "<[peer ] [map]>", + NL80211_CMD_SET_NOACK_MAP, 0, CIB_NETDEV, handle_interface_noack_map, + "Set the NoAck map for the TIDs. (0x0009 = BE, 0x0006 = BK, 0x0030 = VI, 0x00C0 = VO)"); + diff --git a/feeds/wifi-ax/iw/patches/510-iw-wifi-config-vendor.patch b/feeds/wifi-ax/iw/patches/510-iw-wifi-config-vendor.patch new file mode 100644 index 000000000..00f78d532 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/510-iw-wifi-config-vendor.patch @@ -0,0 +1,71 @@ +--- a/iw.h ++++ b/iw.h +@@ -62,6 +62,19 @@ enum id_input { + II_WDEV, + }; + ++/* Attributes for data used by ++ * QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION and ++ * QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION subcommands. ++ */ ++enum qca_wlan_vendor_attr_config { ++ QCA_WLAN_VENDOR_ATTR_CONFIG_GTX = 57, ++ ++ /* keep last */ ++ QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST, ++ QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = ++ QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST - 1, ++}; ++ + #define HANDLER_RET_USAGE 1 + #define HANDLER_RET_DONE 3 + +--- a/vendor.c ++++ b/vendor.c +@@ -78,9 +78,12 @@ static int handle_vendor(struct nl80211_ + { + unsigned int oui; + unsigned int subcmd; ++ struct nlattr *params; + char buf[2048] = {}; + int res, count = 0; + FILE *file = NULL; ++ char *end; ++ unsigned int ap_ps; + + if (argc < 3) + return 1; +@@ -105,6 +108,33 @@ static int handle_vendor(struct nl80211_ + NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, oui); + NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd); + ++ if (subcmd == 0x4a) { ++ argc -= 2; ++ argv += 2; ++ ++ if (!argc) ++ return 1; ++ ++ params = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED); ++ ++ if (!strcmp(argv[0], "ap-ps")) { ++ if (argc < 2) ++ return 1; ++ ap_ps = strtol(argv[1], &end, 10); ++ if (*end) ++ return 2; ++ ++ if (ap_ps > 1) ++ return -EINVAL; ++ ++ if (ap_ps) ++ NLA_PUT_FLAG(msg, QCA_WLAN_VENDOR_ATTR_CONFIG_GTX); ++ } ++ ++ nla_nest_end(msg, params); ++ return 0; ++ } ++ + if (file) { + count = read_file(file, buf, sizeof(buf)); + if (file != stdin) diff --git a/feeds/wifi-ax/iw/patches/512-iw-add-wide-band-scan-support.patch b/feeds/wifi-ax/iw/patches/512-iw-add-wide-band-scan-support.patch new file mode 100644 index 000000000..1d4e3716c --- /dev/null +++ b/feeds/wifi-ax/iw/patches/512-iw-add-wide-band-scan-support.patch @@ -0,0 +1,137 @@ +--- a/scan.c ++++ b/scan.c +@@ -378,19 +378,23 @@ static int handle_scan(struct nl80211_st + enum { + NONE, + FREQ, ++ MODE, ++ CHECK_SCAN_FLAG_AP, + IES, + SSID, + MESHID, + DURATION, + DONE, + } parse = NONE; +- int freq; ++ int freq = 0; + unsigned int duration = 0; + bool passive = false, have_ssids = false, have_freqs = false; ++ bool have_chandef = false; + bool duration_mandatory = false; + size_t ies_len = 0, meshid_len = 0; + unsigned char *ies = NULL, *meshid = NULL, *tmpies = NULL; + unsigned int flags = 0; ++ struct chandef chandef; + + ssids = nlmsg_alloc(); + if (!ssids) +@@ -407,7 +411,6 @@ static int handle_scan(struct nl80211_st + case NONE: + if (strcmp(argv[i], "freq") == 0) { + parse = FREQ; +- have_freqs = true; + break; + } else if (strcmp(argv[i], "ies") == 0) { + parse = IES; +@@ -451,14 +454,33 @@ static int handle_scan(struct nl80211_st + err = 1; + goto nla_put_failure; + case FREQ: +- freq = strtoul(argv[i], &eptr, 10); +- if (eptr != argv[i] + strlen(argv[i])) { +- /* failed to parse as number -- maybe a tag? */ +- i--; +- parse = NONE; +- continue; ++ parse_freqchan(&chandef, false, argc - i, argv + i, NULL); ++ ++ if (!chandef.control_freq || have_freqs) { ++ freq = strtoul(argv[i], &eptr, 10); ++ if (eptr != argv[i] + strlen(argv[i])) { ++ /* failed to parse as number -- maybe a tag? */ ++ i--; ++ parse = NONE; ++ continue; ++ } ++ NLA_PUT_U32(freqs, i, freq); ++ } else { ++ if (chandef.width == NL80211_CHAN_WIDTH_20_NOHT){ ++ have_freqs = true; ++ NLA_PUT_U32(freqs, i, chandef.control_freq); ++ } else { ++ parse = MODE; ++ } + } +- NLA_PUT_U32(freqs, i, freq); ++ break; ++ case MODE: ++ have_chandef = true; ++ parse = CHECK_SCAN_FLAG_AP; ++ break; ++ case CHECK_SCAN_FLAG_AP: ++ if (strcmp(argv[i], "ap-force") == 0) ++ flags |= NL80211_SCAN_FLAG_AP; + break; + case IES: + if (ies) +@@ -506,8 +528,11 @@ static int handle_scan(struct nl80211_st + if (!passive) + nla_put_nested(msg, NL80211_ATTR_SCAN_SSIDS, ssids); + +- if (have_freqs) ++ if (have_chandef) ++ put_chandef(msg, &chandef); ++ else if (have_freqs) + nla_put_nested(msg, NL80211_ATTR_SCAN_FREQUENCIES, freqs); ++ + if (flags) + NLA_PUT_U32(msg, NL80211_ATTR_SCAN_FLAGS, flags); + if (duration) +@@ -2615,20 +2640,24 @@ static int handle_scan_combined(struct n + dump_argv[0] = argv[0]; + return handle_cmd(state, id, dump_argc, dump_argv); + } +-TOPLEVEL(scan, "[-u] [freq *] [duration ] [ies ] [meshid ] [lowpri,flush,ap-force,duration-mandatory] [randomise[=/]] [ssid *|passive]", 0, 0, ++TOPLEVEL(scan, "[-u] [freq *] [HT40+|HT40-|80MHz] [duration ] [ies ] [meshid ] [lowpri,flush,ap-force,duration-mandatory] [randomise[=/]] [ssid *|passive]", 0, 0, + CIB_NETDEV, handle_scan_combined, + "Scan on the given frequencies and probe for the given SSIDs\n" + "(or wildcard if not given) unless passive scanning is requested.\n" ++ "If channel mode/width is provided along with frequency, only \n" ++ "scanning on primary frequency of channel mode/width is done.\n" + "If -u is specified print unknown data in the scan results.\n" + "Specified (vendor) IEs must be well-formed."); + COMMAND(scan, dump, "[-u]", + NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump, + "Dump the current scan results. If -u is specified, print unknown\n" + "data in scan results."); +-COMMAND(scan, trigger, "[freq *] [duration ] [ies ] [meshid ] [lowpri,flush,ap-force,duration-mandatory] [randomise[=/]] [ssid *|passive]", ++COMMAND(scan, trigger, "[freq *] [HT40+|HT40-|80MHz] [duration ] [ies ] [meshid ] [lowpri,flush,ap-force,duration-mandatory] [randomise[=/]] [ssid *|passive]", + NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan, + "Trigger a scan on the given frequencies with probing for the given\n" + "SSIDs (or wildcard if not given) unless passive scanning is requested.\n" ++ "If channel mode/width is provided along with frequency, only \n" ++ "scanning on primary frequency of channel mode/width is done.\n" + "Duration(in TUs), if specified, will be used to set dwell times.\n"); + + +--- a/util.c ++++ b/util.c +@@ -633,6 +633,9 @@ int parse_freqchan(struct chandef *chand + + if (!argv[0]) + goto out; ++ ++ memset(chandef, 0, sizeof(struct chandef)); ++ + freq = strtoul(argv[0], &end, 10); + if (*end) { + res = 1; +@@ -641,8 +644,6 @@ int parse_freqchan(struct chandef *chand + + _parsed += 1; + +- memset(chandef, 0, sizeof(struct chandef)); +- + if (chan) { + enum nl80211_band band; + diff --git a/feeds/wifi-ax/iw/patches/516-iw-enable-80M-support-for-6GHz-11s-mesh.patch b/feeds/wifi-ax/iw/patches/516-iw-enable-80M-support-for-6GHz-11s-mesh.patch new file mode 100644 index 000000000..b626af79d --- /dev/null +++ b/feeds/wifi-ax/iw/patches/516-iw-enable-80M-support-for-6GHz-11s-mesh.patch @@ -0,0 +1,43 @@ +From 7bc4688806777e9f6131289c9befba141a8e0f6c Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Wed, 2 Sep 2020 17:56:04 -0700 +Subject: [PATCH] iw: enable 80M support for 6GHz 11s mesh + +without this 11s mesh could not be configured for 80MHz using iw. +example: +iw mesh join freq 6195 HT40+ ---> 40MHz +iw mesh join freq 6195 80MHz ---> 80MHz + +Signed-off-by: Pradeep Kumar Chitrapu +--- + util.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/util.c ++++ b/util.c +@@ -1235,20 +1235,20 @@ void iw_hexdump(const char *prefix, cons + int get_cf1(const struct chanmode *chanmode, unsigned long freq) + { + unsigned int cf1 = freq, j; +- unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 }; ++ unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035, 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, 6195, 6995}; + + switch (chanmode->width) { + case NL80211_CHAN_WIDTH_80: + /* setup center_freq1 */ +- for (j = 0; j < ARRAY_SIZE(vht80); j++) { +- if (freq >= vht80[j] && freq < vht80[j] + 80) ++ for (j = 0; j < ARRAY_SIZE(bw80); j++) { ++ if (freq >= bw80[j] && freq < bw80[j] + 80) + break; + } + +- if (j == ARRAY_SIZE(vht80)) ++ if (j == ARRAY_SIZE(bw80)) + break; + +- cf1 = vht80[j] + 30; ++ cf1 = bw80[j] + 30; + break; + default: + cf1 = freq + chanmode->freq1_diff; diff --git a/feeds/wifi-ax/iw/patches/517-iw-support-optional-argument-to-specify-6Ghz-channel.patch b/feeds/wifi-ax/iw/patches/517-iw-support-optional-argument-to-specify-6Ghz-channel.patch new file mode 100644 index 000000000..510fc659e --- /dev/null +++ b/feeds/wifi-ax/iw/patches/517-iw-support-optional-argument-to-specify-6Ghz-channel.patch @@ -0,0 +1,100 @@ +From 092d838b9660999c7e7212fe9430a5bd0eed8ef9 Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Thu, 3 Sep 2020 16:45:40 -0700 +Subject: [PATCH] iw: support optional argument to parse 6Ghz channel + +Channel numbers of 6GHz band overlaps with those of 2G or 5G bands. +Therefore additional argument "6G" is expected next to channel +number to map it to correct frequency. If not specified defaults to +matching 2G or 5G frequency. +example: iw wlanX set channel 1 6G 80MHz + +Signed-off-by: Pradeep Kumar Chitrapu +--- + interface.c | 6 ++++-- + phy.c | 8 ++++---- + util.c | 14 ++++++++++---- + 3 files changed, 18 insertions(+), 10 deletions(-) + +--- a/interface.c ++++ b/interface.c +@@ -745,8 +745,10 @@ COMMAND(switch, freq, + " [5|10|20|40|80|80+80|160] [ []] [beacons ] [block-tx]", + NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_freq, + "Switch the operating channel by sending a channel switch announcement (CSA)."); +-COMMAND(switch, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", +- NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); ++COMMAND(switch, channel, " [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", ++ NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, ++ "Switch the operating channel by sending a channel switch announcement (CSA)." ++ "6GHz channels expects '6G' in argument. Defaults to 5GHz or 2GHz channels"); + + static int handle_retry_count(struct nl80211_state *state, + struct nl_msg *msg, +--- a/phy.c ++++ b/phy.c +@@ -222,9 +222,9 @@ static int handle_chan(struct nl80211_st + + return put_chandef(msg, &chandef); + } +-COMMAND(set, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]", ++COMMAND(set, channel, " [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]", + NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan, NULL); +-COMMAND(set, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]", ++COMMAND(set, channel, " [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [6G]", + NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan, NULL); + + +@@ -369,12 +369,12 @@ err_out: + free(cac_trigger_argv); + return err; + } +-TOPLEVEL(cac, "channel [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" ++TOPLEVEL(cac, "channel [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [5|10|20|40|80|80+80|160] [ []]", + 0, 0, CIB_NETDEV, handle_cac, NULL); + COMMAND(cac, trigger, +- "channel [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" ++ "channel [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [5|10|20|40|80|80+80|160] [ []]", + NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger, +--- a/util.c ++++ b/util.c +@@ -578,7 +578,8 @@ static int parse_freqs(struct chandef *c + * user by giving "NOHT" instead. + * + * The working specifier if chan is set are: +- * [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] ++ * [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] ++ * channel number defaults to 5G or 2G band unless 6G is specified. + * + * And if frequency is set: + * [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] +@@ -647,7 +648,12 @@ int parse_freqchan(struct chandef *chand + if (chan) { + enum nl80211_band band; + +- band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; ++ if (argc > 1 && strcmp(argv[1], "6G") == 0) { ++ band = NL80211_BAND_6GHZ; ++ _parsed += 1; ++ } else { ++ band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; ++ } + freq = ieee80211_channel_to_frequency(freq, band); + } + chandef->control_freq = freq; +@@ -655,9 +661,9 @@ int parse_freqchan(struct chandef *chand + chandef->center_freq1 = freq; + + /* Try to parse HT mode definitions */ +- if (argc > 1) { ++ if ((argc - _parsed) > 0) { + for (i = 0; i < ARRAY_SIZE(chanmode); i++) { +- if (strcasecmp(chanmode[i].name, argv[1]) == 0) { ++ if (strcasecmp(chanmode[i].name, argv[_parsed]) == 0) { + chanmode_selected = &chanmode[i]; + _parsed += 1; + break; diff --git a/feeds/wifi-ax/iw/patches/519-iw-Add-HE-UL-MU-fixed-rate-setting.patch b/feeds/wifi-ax/iw/patches/519-iw-Add-HE-UL-MU-fixed-rate-setting.patch new file mode 100644 index 000000000..8283113ba --- /dev/null +++ b/feeds/wifi-ax/iw/patches/519-iw-Add-HE-UL-MU-fixed-rate-setting.patch @@ -0,0 +1,158 @@ +From c6e29601fc643c84ada00fc065e1d54353a4f6a3 Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Thu, 8 Oct 2020 04:59:37 -0700 +Subject: [PATCH] iw: Add HE UL MU fixed rate setting + +Adding mcs fixed rate settings for HE UL MU traffic, which +encompasses both UL-OFDMA and UL-MUMIO. + +Signed-off-by: Muna Sinada +--- + bitrate.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------ + nl80211.h | 1 + + 2 files changed, 46 insertions(+), 6 deletions(-) + +--- a/bitrate.c ++++ b/bitrate.c +@@ -155,6 +155,7 @@ int set_bitrates(struct nl_msg *msg, + bool have_ht_mcs_24 = false, have_ht_mcs_5 = false; + bool have_vht_mcs_24 = false, have_vht_mcs_5 = false; + bool have_he_mcs_24 = false, have_he_mcs_5 = false; ++ bool have_he_ul_mcs_24 = false, have_he_ul_mcs_5 = false; + bool have_he_mcs_6 = false; + uint8_t ht_mcs_24[77], ht_mcs_5[77]; + int n_ht_mcs_24 = 0, n_ht_mcs_5 = 0; +@@ -163,16 +164,20 @@ int set_bitrates(struct nl_msg *msg, + struct nl80211_txrate_he txrate_he_24 = {}; + struct nl80211_txrate_he txrate_he_5 = {}; + struct nl80211_txrate_he txrate_he_6 = {}; ++ struct nl80211_txrate_he txrate_he_ul_24 = {}; ++ struct nl80211_txrate_he txrate_he_ul_5 = {}; + uint8_t *mcs = NULL; + int *n_mcs = NULL; + char *vht_argv_5[VHT_ARGC_MAX] = {}; char *vht_argv_24[VHT_ARGC_MAX] = {}; + char *he_argv_5[VHT_ARGC_MAX] = {}; char *he_argv_24[VHT_ARGC_MAX] = {}; + char *he_argv_6[VHT_ARGC_MAX] = {}; +- char **vht_argv = NULL, **he_argv = NULL; ++ char *he_ul_argv_5[VHT_ARGC_MAX] = {}; char *he_ul_argv_24[VHT_ARGC_MAX] = {}; ++ char **vht_argv = NULL, **he_argv = NULL, **he_ul_argv = NULL; + int vht_argc_5 = 0; int vht_argc_24 = 0; + int he_argc_5 = 0; int he_argc_24 = 0; + int he_argc_6 = 0; +- int *vht_argc = NULL, *he_argc = NULL; ++ int he_ul_argc_5 = 0; int he_ul_argc_24 = 0; ++ int *vht_argc = NULL, *he_argc = NULL, *he_ul_argc = NULL; + int sgi_24 = 0, sgi_5 = 0, lgi_24 = 0, lgi_5 = 0; + int has_he_gi_24 = 0, has_he_gi_5 = 0, has_he_ltf_24 = 0, has_he_ltf_5 = 0; + int has_he_gi_6 = 0, has_he_ltf_6 = 0; +@@ -188,6 +193,7 @@ int set_bitrates(struct nl_msg *msg, + S_GI, + S_HE_GI, + S_HE_LTF, ++ S_HE_UL, + } parser_state = S_NONE; + + for (i = 0; i < argc; i++) { +@@ -289,6 +295,20 @@ int set_bitrates(struct nl_msg *msg, + } else if (strcmp(argv[i], "he-ltf-6") == 0) { + has_he_ltf_6 = 1; + parser_state = S_HE_LTF; ++ } else if (strcmp(argv[i], "he-ul-mcs-2.4") == 0) { ++ if (have_he_ul_mcs_24) ++ return 1; ++ parser_state = S_HE_UL; ++ he_ul_argv = he_ul_argv_24; ++ he_ul_argc = &he_ul_argc_24; ++ have_he_ul_mcs_24 = true; ++ } else if (strcmp(argv[i], "he-ul-mcs-5") == 0) { ++ if (have_he_ul_mcs_5) ++ return 1; ++ parser_state = S_HE_UL; ++ he_ul_argv = he_ul_argv_5; ++ he_ul_argc = &he_ul_argc_5; ++ have_he_ul_mcs_5 = true; + } else switch (parser_state) { + case S_LEGACY: + tmpd = strtod(argv[i], &end); +@@ -329,6 +349,11 @@ int set_bitrates(struct nl_msg *msg, + return 1; + he_ltf = he_ltf >> 1; + break; ++ case S_HE_UL: ++ if (*he_ul_argc >= VHT_ARGC_MAX) ++ return 1; ++ he_ul_argv[(*he_ul_argc)++] = argv [i]; ++ break; + default: + if (attr != NL80211_ATTR_TX_RATES) + goto next; +@@ -372,12 +397,20 @@ next: + return 1; + } + ++ if (have_he_ul_mcs_24) ++ if (!setup_he(&txrate_he_ul_24, he_ul_argc_24, he_ul_argv_24)) ++ return -EINVAL; ++ ++ if (have_he_ul_mcs_5) ++ if (!setup_he(&txrate_he_ul_5, he_ul_argc_5, he_ul_argv_5)) ++ return -EINVAL; ++ + nl_rates = nla_nest_start(msg, attr); + if (!nl_rates) + goto nla_put_failure; + + if (have_legacy_24 || have_ht_mcs_24 || have_vht_mcs_24 || have_he_mcs_24 || +- sgi_24 || lgi_24 || has_he_gi_24 || has_he_ltf_24) { ++ sgi_24 || lgi_24 || has_he_gi_24 || has_he_ltf_24 || have_he_ul_mcs_24) { + nl_band = nla_nest_start(msg, NL80211_BAND_2GHZ); + if (!nl_band) + goto nla_put_failure; +@@ -398,11 +431,14 @@ next: + nla_put_u8(msg, NL80211_TXRATE_HE_GI, he_gi); + if (has_he_ltf_24) + nla_put_u8(msg, NL80211_TXRATE_HE_LTF, he_ltf); ++ if (have_he_ul_mcs_24) ++ nla_put(msg, NL80211_TXRATE_HE_UL, sizeof(txrate_he_ul_24), ++ &txrate_he_ul_24); + nla_nest_end(msg, nl_band); + } + + if (have_legacy_5 || have_ht_mcs_5 || have_vht_mcs_5 || have_he_mcs_5 || +- sgi_5 || lgi_5 || has_he_gi_5 || has_he_ltf_5) { ++ sgi_5 || lgi_5 || has_he_gi_5 || has_he_ltf_5 || have_he_ul_mcs_5) { + nl_band = nla_nest_start(msg, NL80211_BAND_5GHZ); + if (!nl_band) + goto nla_put_failure; +@@ -423,6 +459,9 @@ next: + nla_put_u8(msg, NL80211_TXRATE_HE_GI, he_gi); + if (has_he_ltf_5) + nla_put_u8(msg, NL80211_TXRATE_HE_LTF, he_ltf); ++ if (have_he_ul_mcs_5) ++ nla_put(msg, NL80211_TXRATE_HE_UL, sizeof(txrate_he_ul_5), ++ &txrate_he_ul_5); + nla_nest_end(msg, nl_band); + } + +@@ -456,9 +495,9 @@ static int handle_bitrates(struct nl8021 + } + + #define DESCR_LEGACY "[legacy-<2.4|5> *]" +-#define DESCR DESCR_LEGACY " [ht-mcs-<2.4|5> *] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> *] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5]" ++#define DESCR DESCR_LEGACY " [ht-mcs-<2.4|5> *] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> *] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-ul-mcs-<2.4|5> ]" + +-COMMAND(set, bitrates, "[legacy-<2.4|5> *] [ht-mcs-<2.4|5> *] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> *] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-gi-<2.4|5|6> <0.8|1.6|3.2>] [he-ltf-<2.4|5|6> <1|2|4>]", ++COMMAND(set, bitrates, "[legacy-<2.4|5> *] [ht-mcs-<2.4|5> *] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> *] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-gi-<2.4|5|6> <0.8|1.6|3.2>] [he-ltf-<2.4|5|6> <1|2|4>] [he-ul-mcs-<2.4|5> ]", + NL80211_CMD_SET_TX_BITRATE_MASK, 0, CIB_NETDEV, handle_bitrates, + "Sets up the specified rate masks.\n" + "Not passing any arguments would clear the existing mask (if any)."); +--- a/nl80211.h ++++ b/nl80211.h +@@ -4817,6 +4817,7 @@ enum nl80211_tx_rate_attributes { + NL80211_TXRATE_HE, + NL80211_TXRATE_HE_GI, + NL80211_TXRATE_HE_LTF, ++ NL80211_TXRATE_HE_UL, + + /* keep last */ + __NL80211_TXRATE_AFTER_LAST, diff --git a/feeds/wifi-ax/iw/patches/520-iw-Fix-NLA-type-for-mesh-NL-attributes.patch b/feeds/wifi-ax/iw/patches/520-iw-Fix-NLA-type-for-mesh-NL-attributes.patch new file mode 100644 index 000000000..ae8f197e8 --- /dev/null +++ b/feeds/wifi-ax/iw/patches/520-iw-Fix-NLA-type-for-mesh-NL-attributes.patch @@ -0,0 +1,38 @@ +From 26ba35709392f1cc582dfb336d43eae04ab9589d Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 25 Nov 2020 11:46:56 +0530 +Subject: [PATCH] iw: Fix NLA type for mesh NL attributes + +type of mesh attributes NL80211_STA_INFO_CONNECTED_TO_AS and +NL80211_STA_INFO_CONNECTED_TO_GATE are given as NLA_FLAG. +Kernel provides these as a u8, not a flag. Due to this type +conflict, station dump command is failing with below error in mesh. + +$iw dev mesh0 station dump +Failed to parse nested attributes! + +Fix this by changing these attribute's type to NLA_U8. + +Signed-off-by: Seevalamuthu Mariappan +--- + station.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/station.c b/station.c +index 1f35e4a..9c02af6 100644 +--- a/station.c ++++ b/station.c +@@ -330,8 +330,8 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) + [NL80211_STA_INFO_TX_DURATION] = {.type = NLA_U64}, + [NL80211_STA_INFO_AIRTIME_WEIGHT] = {.type = NLA_U16}, + [NL80211_STA_INFO_AIRTIME_LINK_METRIC] = { .type = NLA_U32 }, +- [NL80211_STA_INFO_CONNECTED_TO_AS] = { .type = NLA_FLAG }, +- [NL80211_STA_INFO_CONNECTED_TO_GATE] = { .type = NLA_FLAG }, ++ [NL80211_STA_INFO_CONNECTED_TO_AS] = { .type = NLA_U8 }, ++ [NL80211_STA_INFO_CONNECTED_TO_GATE] = { .type = NLA_U8 }, + }; + char *chain; + struct timeval now; +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/Makefile b/feeds/wifi-ax/mac80211/Makefile index b2b2f2152..f5f7c9c50 100644 --- a/feeds/wifi-ax/mac80211/Makefile +++ b/feeds/wifi-ax/mac80211/Makefile @@ -2,10 +2,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=20200902_001-4.4.60-931c337125 +PKG_VERSION:=20210222_001-4.4.60-b157d2276 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://mirror2.openwrt.org/sources/ -PKG_HASH:=f8d99202d53d142570c8d7d184fbd72a3861aa20cfe9f79a37f79aee66d3e1fe +PKG_HASH:=a9edb1063cc9901c409e6eb79bed97ab88c664f06caa88c988e9b21731623f7a PKG_SOURCE:=backports-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 @@ -38,6 +38,7 @@ config-y:= \ WLAN \ NL80211_TESTMODE \ CFG80211_WEXT \ + CFG80211_INTERNAL_REGDB \ CFG80211_CERTIFICATION_ONUS \ MAC80211_RC_MINSTREL \ MAC80211_RC_MINSTREL_HT \ @@ -88,7 +89,7 @@ define KernelPackage/mac80211 $(call KernelPackage/mac80211/Default) TITLE:=Linux 802.11 Wireless Networking Stack # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c - DEPENDS+= +kmod-cfg80211 +hostapd-common +kmod-qca-nss-drv + DEPENDS+= +kmod-cfg80211 +hostapd-common +kmod-qca-nss-drv +kmod-qca-nss-drv-wifi-meshmgr KCONFIG:=\ CONFIG_AVERAGE=y FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko @@ -178,7 +179,7 @@ config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \ CROSS_COMPILE="$(KERNEL_CROSS)" \ ARCH="$(LINUX_KARCH)" \ - EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) -I$(STAGING_DIR)/usr/include/qca-nss-drv" \ + EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) -I$(STAGING_DIR)/usr/include/qca-nss-drv -I$(STAGING_DIR)/usr/include/qca-nss-clients" \ KLIB_BUILD="$(LINUX_DIR)" \ MODPROBE=true \ KLIB=$(TARGET_MODULES_DIR) \ diff --git a/feeds/wifi-ax/mac80211/ath.mk b/feeds/wifi-ax/mac80211/ath.mk index 2a0f365f6..0e9f4fa7c 100644 --- a/feeds/wifi-ax/mac80211/ath.mk +++ b/feeds/wifi-ax/mac80211/ath.mk @@ -45,7 +45,9 @@ config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB config-$(CONFIG_TARGET_ath79) += ATH9K_AHB config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB config-$(CONFIG_PCI) += ATH9K_PCI -#config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD +config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD \ + ATH_REG_DYNAMIC_USER_REG_HINTS \ + ATH_REG_DYNAMIC_USER_CERT_TESTING config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99 config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR @@ -54,11 +56,11 @@ config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL config-$(call config_package,ath9k-htc) += ATH9K_HTC config-$(call config_package,ath10k) += ATH10K ATH10K_PCI -config-$(call config_package,ath11k) += ATH11K ATH11K_AHB ATH11K_SPECTRAL +config-$(call config_package,ath11k) += ATH11K ATH11K_AHB ATH11K_SPECTRAL ATH11K_DEBUG config-$(call config_package,ath11k-pci) += ATH11K_PCI ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),512) -config-y += ATH11K_MEM_PROFILE_512M +#config-y += ATH11K_MEM_PROFILE_512M endif config-$(call config_package,ath5k) += ATH5K @@ -295,7 +297,7 @@ define KernelPackage/ath11k-ahb $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ax wireless cards support - AHB URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k - DEPENDS+= +kmod-ath11k + DEPENDS+= +kmod-ath11k +kmod-ath11k-pci FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k_ahb.ko AUTOLOAD:=$(call AutoProbe,ath11k_ahb) diff --git a/feeds/wifi-ax/mac80211/files/etc/init.d/ath11k b/feeds/wifi-ax/mac80211/files/etc/init.d/ath11k new file mode 100755 index 000000000..4a356a541 --- /dev/null +++ b/feeds/wifi-ax/mac80211/files/etc/init.d/ath11k @@ -0,0 +1,8 @@ +#!/bin/sh /etc/rc.common + +START=11 + +boot() { + sleep 5 + modprobe ath11k_ahb +} diff --git a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh index 30d6b9311..a58af1fef 100644 --- a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -148,6 +148,9 @@ mac80211_hostapd_setup_base() { [ "$noscan" -gt 0 ] && hostapd_noscan=1 [ "$tx_burst" = 0 ] && tx_burst= + chan_ofs=0 + [ "$band" = "6g" ] && chan_ofs=1 + ieee80211n=1 ht_capab= case "$htmode" in @@ -155,7 +158,7 @@ mac80211_hostapd_setup_base() { HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160) case "$hwmode" in a) - case "$(( ($channel / 4) % 2 ))" in + case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in 1) ht_capab="[HT40+]";; 0) ht_capab="[HT40-]";; esac @@ -224,8 +227,6 @@ mac80211_hostapd_setup_base() { enable_ac=0 vht_oper_chwidth=0 vht_center_seg0= - chan_ofs=0 - [ "$band" = "6g" ] && chan_ofs=1 idx="$channel" case "$htmode" in diff --git a/feeds/wifi-ax/mac80211/patches/pending/200-6g.patch b/feeds/wifi-ax/mac80211/patches/pending/200-6g.patch new file mode 100644 index 000000000..a7ac1951c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/pending/200-6g.patch @@ -0,0 +1,13 @@ +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +@@ -3047,7 +3047,7 @@ static int ath11k_qmi_request_target_cap + if (r) + ath11k_dbg(ab, ATH11K_DBG_QMI, "DT bdf variant name not set.\n"); + +- if (resp.eeprom_read_timeout_valid) { ++ if (0 && resp.eeprom_read_timeout_valid) { + ab->qmi.target.eeprom_read_timeout = + resp.eeprom_read_timeout; + ath11k_info(ab, "cal data supported from eeprom\n"); diff --git a/feeds/wifi-ax/mac80211/patches/pending/200-6ghz-fix.patch b/feeds/wifi-ax/mac80211/patches/pending/200-6ghz-fix.patch deleted file mode 100644 index 3e9477822..000000000 --- a/feeds/wifi-ax/mac80211/patches/pending/200-6ghz-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/core.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.h -@@ -420,7 +420,7 @@ struct ath11k_sta { - - #define ATH11K_MIN_5G_FREQ 4150 - #define ATH11K_MIN_6G_FREQ 5925 --#define ATH11K_MAX_6G_FREQ 7125 -+#define ATH11K_MAX_6G_FREQ 7105 - #define ATH11K_NUM_CHANS 101 - #define ATH11K_MAX_5G_CHAN 173 - diff --git a/feeds/wifi-ax/mac80211/patches/pending/201-log-spam.patch b/feeds/wifi-ax/mac80211/patches/pending/201-log-spam.patch index d930cb0f8..7341d34ac 100644 --- a/feeds/wifi-ax/mac80211/patches/pending/201-log-spam.patch +++ b/feeds/wifi-ax/mac80211/patches/pending/201-log-spam.patch @@ -1,9 +1,9 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c =================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/mac.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c -@@ -497,7 +497,7 @@ struct ath11k_vif *ath11k_mac_get_arvif( - ath11k_mac_get_arvif_iter, +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +@@ -493,7 +493,7 @@ struct ath11k_vif *ath11k_mac_get_arvif( + ath11k_get_arvif_iter, &arvif_iter); if (!arvif_iter.arvif) { - ath11k_warn(ar->ab, "No VIF found for vdev %d\n", vdev_id); @@ -11,16 +11,3 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ return NULL; } -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/wmi.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/wmi.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/wmi.c -@@ -8490,7 +8490,7 @@ static void ath11k_wmi_tlv_op_rx(struct - break; - /* TODO: Add remaining events */ - default: -- ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); -+ //ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); - break; - } - diff --git a/feeds/wifi-ax/mac80211/patches/pending/203-ath11k-mac.patch b/feeds/wifi-ax/mac80211/patches/pending/203-ath11k-mac.patch index 743ef07cd..972830c79 100644 --- a/feeds/wifi-ax/mac80211/patches/pending/203-ath11k-mac.patch +++ b/feeds/wifi-ax/mac80211/patches/pending/203-ath11k-mac.patch @@ -1,8 +1,8 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c =================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/qmi.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2689,6 +2689,12 @@ out_req: +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +@@ -3161,6 +3161,12 @@ out_req: return ret; } @@ -15,19 +15,19 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab) { char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE]; -@@ -2715,6 +2721,8 @@ static int ath11k_qmi_load_bdf_qmi(struc +@@ -3188,6 +3194,8 @@ static int ath11k_qmi_load_bdf_qmi(struc goto out; } + request_firmware(&fw_macs, "ath11k-macs", ab->dev); + - /* Load caldata */ - if(ab->bus_params.fixed_bdf_addr) { - snprintf(filename, sizeof(filename), -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/wmi.c + /* Load caldata */ + if(ab->bus_params.fixed_bdf_addr) { + snprintf(filename, sizeof(filename), +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c =================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/wmi.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/wmi.c +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c @@ -19,6 +19,7 @@ #include "hw.h" #include "peer.h" @@ -36,7 +36,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct wmi_tlv_policy { size_t min_len; -@@ -6606,6 +6607,8 @@ mem_free: +@@ -7278,11 +7279,14 @@ mem_free: return ret; } @@ -45,19 +45,19 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len, const void *ptr, void *data) { -@@ -6635,9 +6638,21 @@ static int ath11k_wmi_tlv_rdy_parse(stru + struct wmi_tlv_rdy_parse *rdy_parse = data; + struct wmi_ready_event fixed_param; ++ const struct firmware *fw_entry; + struct wmi_mac_addr *addr_list; + struct ath11k_pdev *pdev; + u32 num_mac_addr; +@@ -7307,6 +7311,19 @@ static int ath11k_wmi_tlv_rdy_parse(stru addr_list = (struct wmi_mac_addr *)ptr; num_mac_addr = rdy_parse->num_extra_mac_addr; -- if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) -- break; -- -+ if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) { -+ const struct firmware *fw_entry = ath11k_get_custom_macs(); -+ if (!fw_entry) { -+ printk("failed to request ath11k-macs\n"); -+ return 0; -+ } ++ fw_entry = ath11k_get_custom_macs(); ++ if (fw_entry) { ++ printk("applying ath11k-macs\n"); + if (fw_entry->size >= (ab->num_radios * 6)) { + for (i = 0; i < ab->num_radios; i++) { + pdev = &ab->pdevs[i]; @@ -67,6 +67,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + ab->pdevs_macaddr_valid = true; + return 0; + } - for (i = 0; i < ab->num_radios; i++) { - pdev = &ab->pdevs[i]; - ether_addr_copy(pdev->mac_addr, addr_list[i].addr); ++ + if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) + break; + diff --git a/feeds/wifi-ax/mac80211/patches/pending/210-memory-optimize.patch b/feeds/wifi-ax/mac80211/patches/pending/210-memory-optimize.patch deleted file mode 100644 index a2d2a4f79..000000000 --- a/feeds/wifi-ax/mac80211/patches/pending/210-memory-optimize.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.h -@@ -209,7 +209,7 @@ struct ath11k_pdev_dp { - - #define DP_WBM_RELEASE_RING_SIZE 64 - #define DP_TCL_DATA_RING_SIZE 512 --#define DP_TX_COMP_RING_SIZE 32768 -+#define DP_TX_COMP_RING_SIZE 4096 - #define DP_TX_IDR_SIZE DP_TX_COMP_RING_SIZE - #define DP_TCL_CMD_RING_SIZE 32 - #define DP_TCL_STATUS_RING_SIZE 32 -@@ -224,9 +224,9 @@ struct ath11k_pdev_dp { - #define DP_RXDMA_REFILL_RING_SIZE 2048 - #define DP_RXDMA_ERR_DST_RING_SIZE 1024 - #define DP_RXDMA_MON_STATUS_RING_SIZE 1024 --#define DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 --#define DP_RXDMA_MONITOR_DST_RING_SIZE 2048 --#define DP_RXDMA_MONITOR_DESC_RING_SIZE 4096 -+#define DP_RXDMA_MONITOR_BUF_RING_SIZE 512 -+#define DP_RXDMA_MONITOR_DST_RING_SIZE 128 -+#define DP_RXDMA_MONITOR_DESC_RING_SIZE 128 - - #define DP_RX_BUFFER_SIZE 2048 - #define DP_RX_BUFFER_SIZE_LITE 1024 diff --git a/feeds/wifi-ax/mac80211/patches/pending/211-coldboot.patch b/feeds/wifi-ax/mac80211/patches/pending/211-coldboot.patch deleted file mode 100644 index 7c162e1f9..000000000 --- a/feeds/wifi-ax/mac80211/patches/pending/211-coldboot.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/qmi.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c -@@ -16,7 +16,7 @@ - #define HOST_CSTATE_BIT 0x04 - - /* set the default max assoc sta to max supported by driver */ --bool enable_cold_boot_cal = 1; -+bool enable_cold_boot_cal = 0; - EXPORT_SYMBOL(enable_cold_boot_cal); - module_param(enable_cold_boot_cal, bool, 0644); - MODULE_PARM_DESC(enable_cold_boot_cal, "cold boot calibration enable:1 disable:0"); diff --git a/feeds/wifi-ax/mac80211/patches/pending/213-mac80211-frag.patch b/feeds/wifi-ax/mac80211/patches/pending/213-mac80211-frag.patch deleted file mode 100644 index 278a2519f..000000000 --- a/feeds/wifi-ax/mac80211/patches/pending/213-mac80211-frag.patch +++ /dev/null @@ -1,242 +0,0 @@ -From patchwork Tue May 11 18:02:44 2021 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Johannes Berg -X-Patchwork-Id: 12251641 -X-Patchwork-Delegate: johannes@sipsolutions.net -Return-Path: -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -X-Spam-Level: -X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, - HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, - MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT - autolearn=unavailable autolearn_force=no version=3.4.0 -Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) - by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0C4C43617 - for ; - Tue, 11 May 2021 18:03:20 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) - by mail.kernel.org (Postfix) with ESMTP id 2E1D461625 - for ; - Tue, 11 May 2021 18:03:20 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S231693AbhEKSEZ (ORCPT - ); - Tue, 11 May 2021 14:04:25 -0400 -Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41156 "EHLO - lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S231561AbhEKSEV (ORCPT - ); - Tue, 11 May 2021 14:04:21 -0400 -Received: from sipsolutions.net (s3.sipsolutions.net - [IPv6:2a01:4f8:191:4433::2]) - by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D055CC06175F; - Tue, 11 May 2021 11:03:10 -0700 (PDT) -Received: by sipsolutions.net with esmtpsa - (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) - (Exim 4.94.2) - (envelope-from ) - id 1lgWir-007aAS-9o; Tue, 11 May 2021 20:03:09 +0200 -From: Johannes Berg -To: linux-wireless@vger.kernel.org -Cc: Mathy Vanhoef , stable@vger.kernel.org -Subject: [PATCH 03/18] mac80211: properly handle A-MSDUs that start with an - RFC 1042 header -Date: Tue, 11 May 2021 20:02:44 +0200 -Message-Id: - <20210511200110.0b2b886492f0.I23dd5d685fe16d3b0ec8106e8f01b59f499dffed@changeid> -X-Mailer: git-send-email 2.30.2 -In-Reply-To: <20210511180259.159598-1-johannes@sipsolutions.net> -References: <20210511180259.159598-1-johannes@sipsolutions.net> -MIME-Version: 1.0 -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -From: Mathy Vanhoef - -Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042 -header. This can occur in practice when the destination MAC address -equals AA:AA:03:00:00:00. More importantly, this simplifies the next -patch to mitigate A-MSDU injection attacks. - -Cc: stable@vger.kernel.org -Signed-off-by: Mathy Vanhoef -Signed-off-by: Johannes Berg ---- - include/net/cfg80211.h | 4 ++-- - net/mac80211/rx.c | 2 +- - net/wireless/util.c | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) - -Index: backports-20200902_001-4.4.60-931c337125/include/net/cfg80211.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/include/net/cfg80211.h -+++ backports-20200902_001-4.4.60-931c337125/include/net/cfg80211.h -@@ -5631,7 +5631,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s - */ - int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, - const u8 *addr, enum nl80211_iftype iftype, -- u8 data_offset); -+ u8 data_offset, bool is_amsdu); - - /** - * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 -@@ -5643,7 +5643,7 @@ int ieee80211_data_to_8023_exthdr(struct - static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, - enum nl80211_iftype iftype) - { -- return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0); -+ return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false); - } - - /** -Index: backports-20200902_001-4.4.60-931c337125/net/mac80211/rx.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/net/mac80211/rx.c -+++ backports-20200902_001-4.4.60-931c337125/net/mac80211/rx.c -@@ -6,7 +6,7 @@ - * Copyright 2007-2010 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright(c) 2015 - 2017 Intel Deutschland GmbH -- * Copyright (C) 2018-2020 Intel Corporation -+ * Copyright (C) 2018-2021 Intel Corporation - */ - - #include -@@ -2555,13 +2555,13 @@ static bool ieee80211_frame_allowed(stru - struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; - - /* -- * Allow EAPOL frames to us/the PAE group address regardless -- * of whether the frame was encrypted or not. -- */ -- if (ehdr->h_proto == rx->sdata->control_port_protocol && -- (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || -- ether_addr_equal(ehdr->h_dest, pae_group_addr))) -- return true; -+ * Allow EAPOL frames to us/the PAE group address regardless of -+ * whether the frame was encrypted or not, and always disallow -+ * all other destination addresses for them. -+ */ -+ if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol)) -+ return ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || -+ ether_addr_equal(ehdr->h_dest, pae_group_addr); - - if (ieee80211_802_1x_port_control(rx) || - ieee80211_drop_unencrypted(rx, fc)) -@@ -2632,7 +2632,26 @@ static void ieee80211_deliver_skb_to_loc - cfg80211_rx_control_port(dev, skb, noencrypt); - dev_kfree_skb(skb); - } else { -+ struct ethhdr *ehdr = (void *)skb_mac_header(skb); - memset(skb->cb, 0, sizeof(skb->cb)); -+ /* -+ * 802.1X over 802.11 requires that the authenticator address -+ * be used for EAPOL frames. However, 802.1X allows the use of -+ * the PAE group address instead. If the interface is part of -+ * a bridge and we pass the frame with the PAE group address, -+ * then the bridge will forward it to the network (even if the -+ * client was not associated yet), which isn't supposed to -+ * happen. -+ * To avoid that, rewrite the destination address to our own -+ * address, so that the authenticator (e.g. hostapd) will see -+ * the frame, but bridge won't forward it anywhere else. Note -+ * that due to earlier filtering, the only other address can -+ * be the PAE group address. -+ */ -+ if (unlikely(skb->protocol == sdata->control_port_protocol && -+ !ether_addr_equal(ehdr->h_dest, sdata->vif.addr))) -+ ether_addr_copy(ehdr->h_dest, sdata->vif.addr); -+ - netif_rx_nss(rx, skb); - } - } -@@ -2672,6 +2691,7 @@ ieee80211_deliver_skb(struct ieee80211_r - if ((sdata->vif.type == NL80211_IFTYPE_AP || - sdata->vif.type == NL80211_IFTYPE_AP_VLAN) && - !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && -+ ehdr->h_proto != rx->sdata->control_port_protocol && - (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) { - if (is_multicast_ether_addr(ehdr->h_dest) && - ieee80211_vif_get_num_mcast_if(sdata) != 0) { -@@ -2781,7 +2801,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_ - if (ieee80211_data_to_8023_exthdr(skb, ðhdr, - rx->sdata->vif.addr, - rx->sdata->vif.type, -- data_offset)) -+ data_offset, true)) - return RX_DROP_UNUSABLE; - - ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, -@@ -2838,6 +2858,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx - if (is_multicast_ether_addr(hdr->addr1)) - return RX_DROP_UNUSABLE; - -+ if (rx->key) { -+ /* -+ * We should not receive A-MSDUs on pre-HT connections, -+ * and HT connections cannot use old ciphers. Thus drop -+ * them, as in those cases we couldn't even have SPP -+ * A-MSDUs or such. -+ */ -+ switch (rx->key->conf.cipher) { -+ case WLAN_CIPHER_SUITE_WEP40: -+ case WLAN_CIPHER_SUITE_WEP104: -+ case WLAN_CIPHER_SUITE_TKIP: -+ return RX_DROP_UNUSABLE; -+ default: -+ break; -+ } -+ } -+ - return __ieee80211_rx_h_amsdu(rx, 0); - } - -Index: backports-20200902_001-4.4.60-931c337125/net/wireless/util.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/net/wireless/util.c -+++ backports-20200902_001-4.4.60-931c337125/net/wireless/util.c -@@ -474,7 +474,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen) - - int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, - const u8 *addr, enum nl80211_iftype iftype, -- u8 data_offset) -+ u8 data_offset, bool is_amsdu) - { - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; - struct { -@@ -562,7 +562,7 @@ int ieee80211_data_to_8023_exthdr(struct - skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)); - tmp.h_proto = payload.proto; - -- if (likely((ether_addr_equal(payload.hdr, rfc1042_header) && -+ if (likely((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) && - tmp.h_proto != htons(ETH_P_AARP) && - tmp.h_proto != htons(ETH_P_IPX)) || - ether_addr_equal(payload.hdr, bridge_tunnel_header))) -@@ -708,6 +708,9 @@ void ieee80211_amsdu_to_8023s(struct sk_ - remaining = skb->len - offset; - if (subframe_len > remaining) - goto purge; -+ /* mitigate A-MSDU aggregation injection attacks */ -+ if (ether_addr_equal(eth.h_dest, rfc1042_header)) -+ goto purge; - - offset += sizeof(struct ethhdr); - last = remaining <= subframe_len + padding; -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/nss.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/nss.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/nss.c -@@ -477,7 +477,7 @@ static int ath11k_nss_deliver_rx(struct - } - - if (ieee80211_data_to_8023_exthdr(skb, NULL, vif->addr, vif->type, -- data_offs - hdr_len)) { -+ data_offs - hdr_len, false)) { - dev_kfree_skb_any(skb); - return -EINVAL; - } diff --git a/feeds/wifi-ax/mac80211/patches/pending/214-no-encap.patch b/feeds/wifi-ax/mac80211/patches/pending/214-no-encap.patch index ba30a77de..ae6073dfd 100644 --- a/feeds/wifi-ax/mac80211/patches/pending/214-no-encap.patch +++ b/feeds/wifi-ax/mac80211/patches/pending/214-no-encap.patch @@ -1,13 +1,13 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c =================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/mac.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c -@@ -5919,7 +5919,7 @@ static int ath11k_mac_op_add_interface(s - case NL80211_IFTYPE_STATION: - case NL80211_IFTYPE_AP_VLAN: - case NL80211_IFTYPE_AP: -- hw_encap = 1; -+ hw_encap = 0; - break; - default: - break; +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +@@ -6835,6 +6835,8 @@ static int ath11k_mac_op_add_interface(s + else + param_value = ATH11K_HW_TXRX_NATIVE_WIFI; + ++ param_value = ATH11K_HW_TXRX_NATIVE_WIFI; ++ + ret = ath11k_nss_vdev_set_cmd(arvif, NSS_WIFI_VDEV_ENCAP_TYPE_CMD, param_value); + + if(ret) { diff --git a/feeds/wifi-ax/mac80211/patches/pending/215-tpt-trigger.patch b/feeds/wifi-ax/mac80211/patches/pending/215-tpt-trigger.patch index d83185733..134db2913 100644 --- a/feeds/wifi-ax/mac80211/patches/pending/215-tpt-trigger.patch +++ b/feeds/wifi-ax/mac80211/patches/pending/215-tpt-trigger.patch @@ -1,8 +1,6 @@ -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/mac.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/mac.c -@@ -191,6 +191,20 @@ static struct ieee80211_rate ath11k_lega +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -187,6 +187,20 @@ static struct ieee80211_rate ath11k_lega { .bitrate = 540, .hw_value = ATH11K_HW_RATE_OFDM_54M }, }; @@ -23,9 +21,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static const int ath11k_phymodes[NUM_NL80211_BANDS][ATH11K_CHAN_WIDTH_NUM] = { [NL80211_BAND_2GHZ] = { -@@ -8240,6 +8254,10 @@ static int __ath11k_mac_register(struct - if (ab->nss.enabled) - ieee80211_hw_set(ar->hw, SUPPORTS_NSS_OFFLOAD); +@@ -9381,6 +9395,10 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, SUPPORTS_MESH_NSS_OFFLOAD); + } + ieee80211_create_tpt_led_trigger(ar->hw, IEEE80211_TPT_LEDTRIG_FL_RADIO, + ath11k_tpt_blink, @@ -62,29 +60,30 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ } --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -4767,6 +4767,7 @@ void ieee80211_rx_napi(struct ieee80211_ +@@ -4865,6 +4865,7 @@ void ieee80211_rx_list(struct ieee80211_ struct ieee80211_rate *rate = NULL; struct ieee80211_supported_band *sband; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct sta_info *sta = NULL; WARN_ON_ONCE(softirq_count() == 0); +@@ -4972,9 +4973,9 @@ void ieee80211_rx_list(struct ieee80211_ + if (!(status->flag & RX_FLAG_8023)) + skb = ieee80211_rx_monitor(local, skb, rate); + if (skb) { +- ieee80211_tpt_led_trig_rx(local, +- ((struct ieee80211_hdr *)skb->data)->frame_control, +- skb->len); ++ if ((status->flag & RX_FLAG_8023) || ++ ieee80211_is_data_present(hdr->frame_control)) ++ ieee80211_tpt_led_trig_rx(local, skb->len); -@@ -4871,9 +4872,8 @@ void ieee80211_rx_napi(struct ieee80211_ - return; - } - -- ieee80211_tpt_led_trig_rx(local, -- ((struct ieee80211_hdr *)skb->data)->frame_control, -- skb->len); -+ if (ieee80211_is_data_present(hdr->frame_control)) -+ ieee80211_tpt_led_trig_rx(local, skb->len); - - __ieee80211_rx_handle_packet(hw, pubsta, skb, napi); - + if (status->flag & RX_FLAG_8023) + __ieee80211_rx_handle_8023(hw, pubsta, skb, list); --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1716,8 +1716,8 @@ static bool ieee80211_tx_frags(struct ie +@@ -1702,8 +1702,8 @@ static bool ieee80211_tx_frags(struct ie * Returns false if the frame couldn't be transmitted but was queued instead. */ static bool __ieee80211_tx(struct ieee80211_local *local, @@ -95,7 +94,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ { struct ieee80211_tx_info *info; struct ieee80211_sub_if_data *sdata; -@@ -1764,8 +1764,6 @@ static bool __ieee80211_tx(struct ieee80 +@@ -1750,8 +1750,6 @@ static bool __ieee80211_tx(struct ieee80 result = ieee80211_tx_frags(local, vif, sta, skbs, txpending); @@ -104,7 +103,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ WARN_ON_ONCE(!skb_queue_empty(skbs)); return result; -@@ -1914,7 +1912,6 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1900,7 +1898,6 @@ static bool ieee80211_tx(struct ieee8021 ieee80211_tx_result res_prepare; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); bool result = true; @@ -112,7 +111,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ if (unlikely(skb->len < 10)) { dev_kfree_skb(skb); -@@ -1922,7 +1919,6 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1908,7 +1905,6 @@ static bool ieee80211_tx(struct ieee8021 } /* initialises tx */ @@ -120,7 +119,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); if (unlikely(res_prepare == TX_DROP)) { -@@ -1945,8 +1941,7 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1931,8 +1927,7 @@ static bool ieee80211_tx(struct ieee8021 return true; if (!invoke_tx_handlers_late(&tx)) @@ -130,15 +129,15 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ return result; } -@@ -3945,6 +3940,7 @@ void __ieee80211_subif_start_xmit(struct - struct sta_info *sta; +@@ -3956,6 +3951,7 @@ void __ieee80211_subif_start_xmit(struct struct sk_buff *next; + struct ieee80211_tx_info *info; struct ieee80211_sub_if_data *ap_sdata; + int len = skb->len; if (unlikely(skb->len < ETH_HLEN)) { kfree_skb(skb); -@@ -3999,10 +3995,8 @@ void __ieee80211_subif_start_xmit(struct +@@ -4021,10 +4017,8 @@ void __ieee80211_subif_start_xmit(struct } } else { /* we cannot process non-linear frames on this path */ @@ -151,7 +150,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ /* the frame could be fragmented, software-encrypted, and other * things so we cannot really handle checksum offload with it - -@@ -4036,7 +4030,10 @@ void __ieee80211_subif_start_xmit(struct +@@ -4064,7 +4058,10 @@ void __ieee80211_subif_start_xmit(struct goto out; out_free: kfree_skb(skb); @@ -162,7 +161,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ rcu_read_unlock(); } -@@ -4203,8 +4200,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s +@@ -4231,8 +4228,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s } static bool ieee80211_tx_8023(struct ieee80211_sub_if_data *sdata, @@ -172,7 +171,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ bool txpending) { struct ieee80211_local *local = sdata->local; -@@ -4214,6 +4210,8 @@ static bool ieee80211_tx_8023(struct iee +@@ -4242,6 +4238,8 @@ static bool ieee80211_tx_8023(struct iee unsigned long flags; int q = info->hw_queue; @@ -181,16 +180,16 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ if (ieee80211_queue_skb(local, sdata, sta, skb)) return true; -@@ -4314,7 +4312,7 @@ static void ieee80211_8023_xmit(struct i - info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP; - info->control.vif = &sdata->vif; +@@ -4345,7 +4343,7 @@ static void ieee80211_8023_xmit(struct i + if (key) + info->control.hw_key = &key->conf; - ieee80211_tx_8023(sdata, skb, skb->len, sta, false); + ieee80211_tx_8023(sdata, skb, sta, false); - return; - -@@ -4438,7 +4436,7 @@ static bool ieee80211_tx_pending_skb(str + if (sta) + atomic_inc(&sta->tx_netif_pkts); +@@ -4489,7 +4487,7 @@ static bool ieee80211_tx_pending_skb(str if (IS_ERR(sta) || (sta && !sta->uploaded)) sta = NULL; @@ -199,7 +198,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ } else { struct sk_buff_head skbs; -@@ -4448,7 +4446,7 @@ static bool ieee80211_tx_pending_skb(str +@@ -4499,7 +4497,7 @@ static bool ieee80211_tx_pending_skb(str hdr = (struct ieee80211_hdr *)skb->data; sta = sta_info_get(sdata, hdr->addr1); diff --git a/feeds/wifi-ax/mac80211/patches/pending/216-ahb_delay.patch b/feeds/wifi-ax/mac80211/patches/pending/216-ahb_delay.patch new file mode 100644 index 000000000..028211dca --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/pending/216-ahb_delay.patch @@ -0,0 +1,12 @@ +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/ahb.c +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/ahb.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/ahb.c +@@ -839,6 +839,7 @@ static int ath11k_ahb_probe(struct platf + int userpd_id; + u32 hw_mode_id; + ++ msleep(5000); + of_id = of_match_device(ath11k_ahb_of_match, &pdev->dev); + if (!of_id) { + dev_err(&pdev->dev, "failed to find matching device tree id\n"); diff --git a/feeds/wifi-ax/mac80211/patches/qca/002-disable_addr_notifier.patch b/feeds/wifi-ax/mac80211/patches/qca/002-disable_addr_notifier.patch index b7f77663f..2bcbd4a9a 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/002-disable_addr_notifier.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/002-disable_addr_notifier.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -321,7 +321,7 @@ void ieee80211_restart_hw(struct ieee802 +@@ -324,7 +324,7 @@ void ieee80211_restart_hw(struct ieee802 } EXPORT_SYMBOL(ieee80211_restart_hw); @@ -9,7 +9,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -380,7 +380,7 @@ static int ieee80211_ifa_changed(struct +@@ -383,7 +383,7 @@ static int ieee80211_ifa_changed(struct } #endif @@ -18,8 +18,8 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1297,14 +1297,14 @@ int ieee80211_register_hw(struct ieee802 - +@@ -1290,14 +1290,14 @@ int ieee80211_register_hw(struct ieee802 + wiphy_unlock(hw->wiphy); rtnl_unlock(); -#ifdef CONFIG_INET @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1313,13 +1313,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1306,13 +1306,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1347,10 +1347,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1340,10 +1340,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/feeds/wifi-ax/mac80211/patches/qca/003-ath_move_debug_code.patch b/feeds/wifi-ax/mac80211/patches/qca/003-ath_move_debug_code.patch index db10c4510..eacc72776 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/003-ath_move_debug_code.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/003-ath_move_debug_code.patch @@ -14,7 +14,7 @@ CFLAGS_trace.o := -I$(src) --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h -@@ -316,14 +316,7 @@ void _ath_dbg(struct ath_common *common, +@@ -317,14 +317,7 @@ void _ath_dbg(struct ath_common *common, #endif /* CPTCFG_ATH_DEBUG */ /** Returns string describing opmode, or NULL if unknown mode. */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/004-ath_regd_optional.patch b/feeds/wifi-ax/mac80211/patches/qca/004-ath_regd_optional.patch index f1948f39a..f1097fa83 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/004-ath_regd_optional.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/004-ath_regd_optional.patch @@ -23,7 +23,7 @@ for (band = 0; band < NUM_NL80211_BANDS; band++) { if (!wiphy->bands[band]) continue; -@@ -378,6 +382,10 @@ ath_reg_apply_ir_flags(struct wiphy *wip +@@ -379,6 +383,10 @@ ath_reg_apply_ir_flags(struct wiphy *wip { struct ieee80211_supported_band *sband; @@ -34,7 +34,7 @@ sband = wiphy->bands[NL80211_BAND_2GHZ]; if (!sband) return; -@@ -407,6 +415,10 @@ static void ath_reg_apply_radar_flags(st +@@ -408,6 +416,10 @@ static void ath_reg_apply_radar_flags(st struct ieee80211_channel *ch; unsigned int i; @@ -45,7 +45,7 @@ if (!wiphy->bands[NL80211_BAND_5GHZ]) return; -@@ -638,6 +650,10 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -639,6 +651,10 @@ ath_regd_init_wiphy(struct ath_regulator { const struct ieee80211_regdomain *regd; @@ -58,7 +58,7 @@ REGULATORY_CUSTOM_REG; --- a/local-symbols +++ b/local-symbols -@@ -83,6 +83,7 @@ VIRT_WIFI= +@@ -82,6 +82,7 @@ VIRT_WIFI= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/feeds/wifi-ax/mac80211/patches/qca/006-backport_skb_put_fix.patch b/feeds/wifi-ax/mac80211/patches/qca/006-backport_skb_put_fix.patch index 5386e4e2c..a116609ad 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/006-backport_skb_put_fix.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/006-backport_skb_put_fix.patch @@ -1,15 +1,15 @@ --- a/backport-include/linux/skbuff.h +++ b/backport-include/linux/skbuff.h -@@ -348,7 +348,7 @@ static inline void *backport___skb_push( +@@ -356,7 +356,7 @@ static inline void *__skb_put_zero(struc + return tmp; } - #define __skb_push LINUX_BACKPORT(__skb_push) -static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len) +static inline void *backport_skb_put_zero(struct sk_buff *skb, unsigned int len) { void *tmp = skb_put(skb, len); -@@ -356,9 +356,10 @@ static inline void *skb_put_zero(struct +@@ -364,9 +364,10 @@ static inline void *skb_put_zero(struct return tmp; } @@ -22,7 +22,7 @@ { void *tmp = skb_put(skb, len); -@@ -366,11 +367,14 @@ static inline void *skb_put_data(struct +@@ -374,11 +375,14 @@ static inline void *skb_put_data(struct return tmp; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/007-fix_compilation_issue.patch b/feeds/wifi-ax/mac80211/patches/qca/007-fix_compilation_issue.patch index b49a82214..8b46e63e6 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/007-fix_compilation_issue.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/007-fix_compilation_issue.patch @@ -69,16 +69,16 @@ #define WMI_MAX_MEM_REQS 32 --- a/include/linux/backport-refcount.h +++ b/include/linux/backport-refcount.h -@@ -180,30 +180,9 @@ static inline __must_check bool refcount +@@ -165,41 +165,11 @@ static inline __must_check bool __refcou return old; } -/** -- * refcount_add - add a value to a refcount +- * refcount_add_not_zero - add a value to a refcount unless it is 0 - * @i: the value to add to the refcount - * @r: the refcount - * -- * Similar to atomic_add(), but will saturate at REFCOUNT_SATURATED and WARN. +- * Will saturate at REFCOUNT_SATURATED and WARN. - * - * Provides no memory ordering, it is assumed the caller has guaranteed the - * object memory to be stable (RCU, etc.). It does provide a control dependency @@ -88,23 +88,60 @@ - * use case in which references are taken and released one at a time. In these - * cases, refcount_inc(), or one of its variants, should instead be used to - * increment a reference count. +- * +- * Return: false if the passed refcount is 0, true otherwise - */ - static inline void refcount_add(int i, refcount_t *r) + static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r) { + return __refcount_add_not_zero(i, r, NULL); + } + +-static inline void __refcount_add(int i, refcount_t *r, int *oldp) +-{ - int old = atomic_fetch_add_relaxed(i, &r->refs); - +- if (oldp) +- *oldp = old; +- - if (unlikely(!old)) - refcount_warn_saturate(r, REFCOUNT_ADD_UAF); - else if (unlikely(old < 0 || old + i < 0)) - refcount_warn_saturate(r, REFCOUNT_ADD_OVF); +-} + + /** + * refcount_add - add a value to a refcount +@@ -219,7 +189,7 @@ static inline void __refcount_add(int i, + */ + static inline void refcount_add(int i, refcount_t *r) + { +- __refcount_add(i, r, NULL); + atomic_add(i, &r->refs); } - /** -@@ -241,39 +220,9 @@ static inline void refcount_inc(refcount - refcount_add(1, r); + static inline __must_check bool __refcount_inc_not_zero(refcount_t *r, int *oldp) +@@ -267,52 +237,14 @@ static inline void refcount_inc(refcount + __refcount_inc(r, NULL); } +-static inline __must_check bool __refcount_sub_and_test(int i, refcount_t *r, int *oldp) +-{ +- int old = atomic_fetch_sub_release(i, &r->refs); +- +- if (oldp) +- *oldp = old; +- +- if (old == i) { +- smp_acquire__after_ctrl_dep(); +- return true; +- } +- +- if (unlikely(old < 0 || old - i < 0)) +- refcount_warn_saturate(r, REFCOUNT_SUB_UAF); +- +- return false; +-} +- -/** - * refcount_sub_and_test - subtract from a refcount and test if it is 0 - * @i: amount to subtract from the refcount @@ -127,25 +164,32 @@ - */ static inline __must_check bool refcount_sub_and_test(int i, refcount_t *r) { -- int old = atomic_fetch_sub_release(i, &r->refs); -- -- if (old == i) { -- smp_acquire__after_ctrl_dep(); -- return true; -- } -- -- if (unlikely(old < 0 || old - i < 0)) -- refcount_warn_saturate(r, REFCOUNT_SUB_UAF); -- -- return false; +- return __refcount_sub_and_test(i, r, NULL); ++ return atomic_sub_and_test(i, &r->refs); + } + + static inline __must_check bool __refcount_dec_and_test(refcount_t *r, int *oldp) + { +- return __refcount_sub_and_test(1, r, oldp); + return atomic_sub_and_test(i, &r->refs); } /** -@@ -294,20 +243,9 @@ static inline __must_check bool refcount - return refcount_sub_and_test(1, r); +@@ -333,30 +265,9 @@ static inline __must_check bool refcount + return __refcount_dec_and_test(r, NULL); } +-static inline void __refcount_dec(refcount_t *r, int *oldp) +-{ +- int old = atomic_fetch_sub_release(1, &r->refs); +- +- if (oldp) +- *oldp = old; +- +- if (unlikely(old <= 1)) +- refcount_warn_saturate(r, REFCOUNT_DEC_LEAK); +-} +- -/** - * refcount_dec - decrement a refcount - * @r: the refcount @@ -158,8 +202,7 @@ - */ static inline void refcount_dec(refcount_t *r) { -- if (unlikely(atomic_fetch_sub_release(1, &r->refs) <= 1)) -- refcount_warn_saturate(r, REFCOUNT_DEC_LEAK); +- __refcount_dec(r, NULL); + atomic_dec(&r->refs); } @@ -175,7 +218,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, struct genl_info *info, struct cfg80211_crypto_settings *settings, -@@ -13240,7 +13242,7 @@ static int nl80211_vendor_check_policy(c +@@ -13763,7 +13765,7 @@ static int nl80211_vendor_check_policy(c return -EINVAL; } @@ -194,7 +237,7 @@ #endif /* _COMPAT_LINUX_PM_QOS_H */ --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -3091,7 +3091,7 @@ u8 *ieee80211_ie_build_he_oper(u8 *pos, +@@ -3176,7 +3176,7 @@ u8 *ieee80211_ie_build_he_oper(u8 *pos, he_6ghz_op->ccfs0 -= 8; else he_6ghz_op->ccfs0 += 8; @@ -205,8 +248,8 @@ IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ; --- a/backport-include/linux/slab.h +++ b/backport-include/linux/slab.h -@@ -24,4 +24,6 @@ static inline void *kmalloc_array(size_t - } +@@ -28,4 +28,6 @@ static inline void *kmalloc_array(size_t + #define kfree_sensitive(x) kzfree(x) #endif +#define kfree_sensitive(x) kzfree(x) /* For backward compatibility */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/008-Enabling_vht_capability_for_2G.patch b/feeds/wifi-ax/mac80211/patches/qca/008-Enabling_vht_capability_for_2G.patch index a20abd8f5..429a151f2 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/008-Enabling_vht_capability_for_2G.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/008-Enabling_vht_capability_for_2G.patch @@ -1,7 +1,7 @@ --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -4863,8 +4863,6 @@ static int ieee80211_prep_channel(struct - bool is_6ghz = cbss->channel->band == NL80211_BAND_6GHZ; +@@ -4997,8 +4997,6 @@ static int ieee80211_prep_channel(struct + bool is_5ghz = cbss->channel->band == NL80211_BAND_5GHZ; struct ieee80211_bss *bss = (void *)cbss->priv; int ret; - u32 i; @@ -9,7 +9,7 @@ sband = local->hw.wiphy->bands[cbss->channel->band]; -@@ -4946,20 +4944,6 @@ static int ieee80211_prep_channel(struct +@@ -5080,20 +5078,6 @@ static int ieee80211_prep_channel(struct ifmgd->flags |= IEEE80211_STA_DISABLE_HE; } @@ -27,9 +27,9 @@ - if (!have_80mhz) - ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; - - ifmgd->flags |= ieee80211_determine_chantype(sdata, sband, - cbss->channel, - bss->vht_cap_info, + if (sband->band == NL80211_BAND_S1GHZ) { + const u8 *s1g_oper_ie; + --- a/net/mac80211/vht.c +++ b/net/mac80211/vht.c @@ -121,7 +121,6 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru @@ -61,7 +61,7 @@ /* * A VHT STA must support 40 MHz, but if we verify that here * then we break a few things - some APs (e.g. Netgear R6300v2 -@@ -365,6 +350,12 @@ enum ieee80211_sta_rx_bandwidth ieee8021 +@@ -361,6 +346,12 @@ enum ieee80211_sta_rx_bandwidth ieee8021 IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20; diff --git a/feeds/wifi-ax/mac80211/patches/qca/009-ath11k-Enable-VHT-for-2G.patch b/feeds/wifi-ax/mac80211/patches/qca/009-ath11k-Enable-VHT-for-2G.patch index 7916a85ad..a38ed14e9 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/009-ath11k-Enable-VHT-for-2G.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/009-ath11k-Enable-VHT-for-2G.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1582,9 +1582,9 @@ static void ath11k_peer_assoc_h_phymode( +@@ -1568,9 +1568,9 @@ static void ath11k_peer_assoc_h_phymode( } else if (sta->vht_cap.vht_supported && !ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) { if (sta->bandwidth == IEEE80211_STA_RX_BW_40) @@ -12,7 +12,7 @@ } else if (sta->ht_cap.ht_supported && !ath11k_peer_assoc_h_ht_masked(ht_mcs_mask)) { if (sta->bandwidth == IEEE80211_STA_RX_BW_40) -@@ -3522,6 +3522,9 @@ static void ath11k_mac_setup_ht_vht_cap( +@@ -3732,6 +3732,9 @@ static void ath11k_mac_setup_ht_vht_cap( *ht_cap_info = ht_cap; band->ht_cap = ath11k_create_ht_cap(ar, ht_cap, rate_cap_rx_chainmask); @@ -24,7 +24,7 @@ if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP && !ar->supports_6ghz) { --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -346,6 +346,8 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st +@@ -352,6 +352,8 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st * handled. */ if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/010-mac80211-disable-signed-regulatory.patch b/feeds/wifi-ax/mac80211/patches/qca/010-mac80211-disable-signed-regulatory.patch index e5ba946f3..0ef69258c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/010-mac80211-disable-signed-regulatory.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/010-mac80211-disable-signed-regulatory.patch @@ -1,6 +1,6 @@ --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig -@@ -74,7 +74,7 @@ config CFG80211_CERTIFICATION_ONUS +@@ -75,7 +75,7 @@ config CFG80211_CERTIFICATION_ONUS config CFG80211_REQUIRE_SIGNED_REGDB depends on !KERNEL_3_13 bool "require regdb signature" if CFG80211_CERTIFICATION_ONUS diff --git a/feeds/wifi-ax/mac80211/patches/qca/012-ath11k-add-pktlog-debugfs-support.patch b/feeds/wifi-ax/mac80211/patches/qca/012-ath11k-add-pktlog-debugfs-support.patch index 2f7c234d0..9cd8da743 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/012-ath11k-add-pktlog-debugfs-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/012-ath11k-add-pktlog-debugfs-support.patch @@ -15,7 +15,7 @@ + frame filters can be alterted by debugfs entries. --- a/drivers/net/wireless/ath/ath11k/Makefile +++ b/drivers/net/wireless/ath/ath11k/Makefile -@@ -23,6 +23,7 @@ ath11k-$(CPTCFG_NL80211_TESTMODE) += tes +@@ -24,6 +24,7 @@ ath11k-$(CPTCFG_NL80211_TESTMODE) += tes ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o ath11k-$(CONFIG_THERMAL) += thermal.o ath11k-$(CPTCFG_ATH11K_SPECTRAL) += spectral.o @@ -33,7 +33,7 @@ #include "wmi.h" #include "hal.h" #include "dp.h" -@@ -397,6 +398,11 @@ struct ath11k_debug { +@@ -420,6 +421,11 @@ struct ath11k_debug { u32 pktlog_mode; u32 pktlog_peer_valid; u8 pktlog_peer_addr[ETH_ALEN]; @@ -45,38 +45,36 @@ u32 rx_filter; }; ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -11,6 +11,7 @@ +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -12,6 +12,7 @@ #include "dp_tx.h" - #include "debug_htt_stats.h" + #include "debugfs_htt_stats.h" #include "peer.h" +#include "pktlog.h" static const char *htt_bp_umac_ring[HTT_SW_UMAC_RING_IDX_MAX] = { "REO2SW1_RING", -@@ -1181,6 +1182,7 @@ int ath11k_debug_register(struct ath11k - ath11k_debug_htt_stats_init(ar); +@@ -1070,6 +1071,7 @@ int ath11k_debugfs_register(struct ath11 + ath11k_debugfs_htt_stats_init(ar); - ath11k_debug_fw_stats_init(ar); + ath11k_debugfs_fw_stats_init(ar); + ath11k_init_pktlog(ar); debugfs_create_file("ext_tx_stats", 0644, ar->debug.debugfs_pdev, ar, -@@ -1206,5 +1208,6 @@ int ath11k_debug_register(struct ath11k +@@ -1095,4 +1097,5 @@ int ath11k_debugfs_register(struct ath11 - void ath11k_debug_unregister(struct ath11k *ar) + void ath11k_debugfs_unregister(struct ath11k *ar) { + ath11k_deinit_pktlog(ar); } - #endif /* CPTCFG_ATH11K_DEBUGFS */ ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -304,4 +304,39 @@ do { \ - __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \ - } while (0) +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -214,4 +214,38 @@ static inline int ath11k_debugfs_rx_filt + + #endif /* CPTCFG_MAC80211_DEBUGFS*/ -+ +#ifdef CPTCFG_ATH11K_PKTLOG +void ath11k_init_pktlog(struct ath11k *ar); +void ath11k_deinit_pktlog(struct ath11k *ar); @@ -111,22 +109,22 @@ +{ +} +#endif /* CONFIG_ATH11K_PKTLOG */ - #endif /* _ATH11K_DEBUG_H_ */ + #endif /* _ATH11K_DEBUGFS_H_ */ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1511,8 +1511,10 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1548,8 +1548,10 @@ static int ath11k_htt_pull_ppdu_stats(st goto exit; } -- if (ath11k_debug_is_pktlog_lite_mode_enabled(ar)) -+ if (ath11k_debug_is_pktlog_lite_mode_enabled(ar)) { +- if (ath11k_debugfs_is_pktlog_lite_mode_enabled(ar)) ++ if (ath11k_debugfs_is_pktlog_lite_mode_enabled(ar)) { trace_ath11k_htt_ppdu_stats(ar, skb->data, len); + ath11k_htt_ppdu_pktlog_process(ar, (u8 *)skb->data, DP_RX_BUFFER_SIZE); + } ppdu_info = ath11k_dp_htt_get_ppdu_desc(ar, ppdu_id); if (!ppdu_info) { -@@ -1551,6 +1553,7 @@ static void ath11k_htt_pktlog(struct ath +@@ -1588,6 +1590,7 @@ static void ath11k_htt_pktlog(struct ath trace_ath11k_htt_pktlog(ar, data->payload, hdr->size, ar->ab->pktlog_defs_checksum); @@ -134,12 +132,12 @@ } static void ath11k_htt_backpressure_event_handler(struct ath11k_base *ab, -@@ -2906,8 +2909,11 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -2958,8 +2961,11 @@ int ath11k_dp_rx_process_mon_status(stru memset(&ppdu_info, 0, sizeof(ppdu_info)); ppdu_info.peer_id = HAL_INVALID_PEERID; -- if (ath11k_debug_is_pktlog_rx_stats_enabled(ar)) -+ if (ath11k_debug_is_pktlog_rx_stats_enabled(ar)) { +- if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) ++ if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) { trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE); + ath11k_rx_stats_buf_pktlog_process(ar, skb->data, + DP_RX_BUFFER_SIZE); @@ -147,12 +145,12 @@ hal_status = ath11k_hal_rx_parse_mon_status(ab, &ppdu_info, skb); -@@ -2934,8 +2940,11 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -2986,8 +2992,11 @@ int ath11k_dp_rx_process_mon_status(stru arsta = (struct ath11k_sta *)peer->sta->drv_priv; ath11k_dp_rx_update_peer_stats(arsta, &ppdu_info); -- if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) -+ if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) { +- if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) ++ if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) { trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE); + ath11k_rx_stats_buf_pktlog_process(ar, skb->data, + DP_RX_BUFFER_SIZE); @@ -761,7 +759,7 @@ +#endif /* _PKTLOG_H_ */ --- a/local-symbols +++ b/local-symbols -@@ -138,3 +138,4 @@ ATH11K_DEBUG= +@@ -137,3 +137,4 @@ ATH11K_DEBUG= ATH11K_DEBUGFS= ATH11K_TRACING= ATH11K_SPECTRAL= diff --git a/feeds/wifi-ax/mac80211/patches/qca/015-add-raw-mode-support.patch b/feeds/wifi-ax/mac80211/patches/qca/015-add-raw-mode-support.patch deleted file mode 100644 index c37f69bd0..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/015-add-raw-mode-support.patch +++ /dev/null @@ -1,324 +0,0 @@ -From ac4ddc177cf0cfbb52678c7b5959a4985074e289 Mon Sep 17 00:00:00 2001 -From: Manikanta Pubbisetty -Date: Wed, 29 May 2019 21:09:28 +0530 -Subject: [PATCH] ath11k: add raw mode support - -Adding raw mode tx/rx support; also, adding support for -software crypto which depends on raw mode. - -To enable raw mode tx/rx: -insmod ath11k.ko rawmode=1 - -To enable software crypto: -insmod ath11k.ko cryptmode=1 - -Signed-off-by: Manikanta Pubbisetty ---- - drivers/net/wireless/ath/ath11k/core.c | 23 ++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/core.h | 7 +++++++ - drivers/net/wireless/ath/ath11k/dp_rx.c | 9 +++++---- - drivers/net/wireless/ath/ath11k/dp_tx.c | 34 +++++++++++++++++++++------------ - drivers/net/wireless/ath/ath11k/mac.c | 20 +++++++++++++++++-- - drivers/net/wireless/ath/ath11k/wmi.c | 4 ++++ - 6 files changed, 79 insertions(+), 18 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -14,9 +14,15 @@ - #include "hif.h" - - unsigned int ath11k_debug_mask; -+unsigned int rawmode; -+unsigned int cryptmode; - EXPORT_SYMBOL(ath11k_debug_mask); - module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); -+module_param_named(rawmode, rawmode, uint, 0644); -+module_param_named(cryptmode, cryptmode, uint, 0644); - MODULE_PARM_DESC(debug_mask, "Debugging mask"); -+MODULE_PARM_DESC(cryptmode, "crypto mode: 0-hardware, 1-software"); -+MODULE_PARM_DESC(rawmode, "RAW mode TX: 0-disable, 1-enable"); - - static const struct ath11k_hw_params ath11k_hw_params[] = { - { -@@ -580,6 +586,23 @@ int ath11k_core_qmi_firmware_ready(struc - return ret; - } - -+ switch (cryptmode) { -+ case ATH11K_CRYPT_MODE_SW: -+ set_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags); -+ set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); -+ break; -+ case ATH11K_CRYPT_MODE_HW: -+ clear_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags); -+ clear_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); -+ break; -+ default: -+ ath11k_info(ab, "invalid cryptmode: %d\n", cryptmode); -+ return -EINVAL; -+ } -+ -+ if (rawmode) -+ set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); -+ - mutex_lock(&ab->core_lock); - ret = ath11k_core_start(ab, ATH11K_FIRMWARE_MODE_NORMAL); - if (ret) { ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -55,6 +55,13 @@ enum wme_ac { - #define ATH11K_VHT_MCS_MAX 9 - #define ATH11K_HE_MCS_MAX 11 - -+enum ath11k_crypt_mode { -+ /* Only use hardware crypto engine */ -+ ATH11K_CRYPT_MODE_HW, -+ /* Only use software crypto */ -+ ATH11K_CRYPT_MODE_SW, -+}; -+ - static inline enum wme_ac ath11k_tid_to_ac(u32 tid) - { - return (((tid == 0) || (tid == 3)) ? WME_AC_BE : ---- a/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2136,8 +2136,6 @@ static void ath11k_dp_rx_h_mpdu(struct a - mcast = is_multicast_ether_addr(hdr->addr1); - fill_crypto_hdr = mcast; - -- is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -- - spin_lock_bh(&ar->ab->base_lock); - peer = ath11k_peer_find_by_addr(ar->ab, hdr->addr2); - if (peer) { -@@ -2152,6 +2150,10 @@ static void ath11k_dp_rx_h_mpdu(struct a - - err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); - -+ enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); -+ if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap) -+ is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -+ - /* Clear per-MPDU flags while leaving per-PPDU flags intact */ - rx_status->flag &= ~(RX_FLAG_FAILED_FCS_CRC | - RX_FLAG_MMIC_ERROR | -@@ -2353,6 +2355,8 @@ static void ath11k_dp_rx_deliver_msdu(st - !!(status->flag & RX_FLAG_MMIC_ERROR), - !!(status->flag & RX_FLAG_AMSDU_MORE)); - -+ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", -+ msdu->data, msdu->len); - /* TODO: trace rx packet */ - - ieee80211_rx_napi(ar->hw, NULL, msdu, napi); ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -13,6 +13,10 @@ static enum hal_tcl_encap_type - ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb) - { - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); -+ struct ath11k_base *ab = arvif->ar->ab; -+ -+ if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) -+ return HAL_TCL_ENCAP_TYPE_RAW; - - if (tx_info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) - return HAL_TCL_ENCAP_TYPE_ETHERNET; -@@ -142,11 +146,17 @@ tcl_ring_sel: - ti.encap_type = ath11k_dp_tx_get_encap_type(arvif, skb); - ti.meta_data_flags = arvif->tcl_metadata; - -- if (info->control.hw_key) -- ti.encrypt_type = -- ath11k_dp_tx_get_encrypt_type(info->control.hw_key->cipher); -- else -- ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN; -+ if (ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW) { -+ if (info->control.hw_key) { -+ ti.encrypt_type = -+ ath11k_dp_tx_get_encrypt_type(info->control.hw_key->cipher); -+ -+ if (ieee80211_has_protected(hdr->frame_control)) -+ skb_put(skb, IEEE80211_CCMP_MIC_LEN); -+ } else { -+ ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN; -+ } -+ } - - ti.addr_search_flags = arvif->hal_addr_search_flags; - ti.search_type = arvif->search_type; -@@ -156,7 +166,8 @@ tcl_ring_sel: - ti.bss_ast_hash = arvif->ast_hash; - ti.dscp_tid_tbl_idx = 0; - -- if (skb->ip_summed == CHECKSUM_PARTIAL) { -+ if (skb->ip_summed == CHECKSUM_PARTIAL && -+ ti.encap_type != HAL_TCL_ENCAP_TYPE_RAW) { - ti.flags0 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_IP4_CKSUM_EN, 1) | - FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_UDP4_CKSUM_EN, 1) | - FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_UDP6_CKSUM_EN, 1) | -@@ -176,10 +187,11 @@ tcl_ring_sel: - ath11k_dp_tx_encap_nwifi(skb); - break; - case HAL_TCL_ENCAP_TYPE_RAW: -- /* TODO: for CHECKSUM_PARTIAL case in raw mode, HW checksum offload -- * is not applicable, hence manual checksum calculation using -- * skb_checksum_help() is needed -- */ -+ if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) { -+ ret = -EINVAL; -+ goto fail_remove_idr; -+ } -+ break; - case HAL_TCL_ENCAP_TYPE_ETHERNET: - /* no need to encap */ - break; -@@ -235,6 +247,9 @@ tcl_ring_sel: - goto fail_unmap_dma; - } - -+ ath11k_dbg_dump(ab, ATH11K_DBG_DP_TX, NULL, "dp tx msdu: ", -+ skb->data, skb->len); -+ - ath11k_hal_tx_cmd_desc_setup(ab, hal_tcl_desc + - sizeof(struct hal_tlv_hdr), &ti); - -@@ -352,7 +367,6 @@ ath11k_dp_tx_process_htt_tx_complete(str - - wbm_status = FIELD_GET(HTT_TX_WBM_COMP_INFO0_STATUS, - status_desc->info0); -- - switch (wbm_status) { - case HAL_WBM_REL_HTT_TX_COMP_STATUS_OK: - case HAL_WBM_REL_HTT_TX_COMP_STATUS_DROP: ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2380,6 +2380,9 @@ static int ath11k_install_key(struct ath - - reinit_completion(&ar->install_key_done); - -+ if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) -+ return 0; -+ - if (cmd == DISABLE_KEY) { - /* TODO: Check if FW expects value other than NONE for del */ - /* arg.key_cipher = WMI_CIPHER_NONE; */ -@@ -2411,8 +2414,12 @@ static int ath11k_install_key(struct ath - return -EOPNOTSUPP; - } - -+ if (test_bit(ATH11K_FLAG_RAW_MODE, &ar->ab->dev_flags)) -+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; -+ - install: - ret = ath11k_wmi_vdev_install_key(arvif->ar, &arg); -+ - if (ret) - return ret; - -@@ -2484,6 +2491,9 @@ static int ath11k_mac_op_set_key(struct - key->cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) - return 1; - -+ if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) -+ return 1; -+ - if (key->keyidx > WMI_MAX_KEY_INDEX) - return -ENOSPC; - -@@ -4442,6 +4452,9 @@ static int ath11k_mac_op_add_interface(s - else - param_value = ATH11K_HW_TXRX_NATIVE_WIFI; - -+ if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) -+ param_value = ATH11K_HW_TXRX_RAW; -+ - ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, - param_id, param_value); - if (ret) { -@@ -6179,8 +6192,10 @@ static int __ath11k_mac_register(struct - - ath11k_reg_init(ar); - -- /* advertise HW checksum offload capabilities */ -- ar->hw->netdev_features = NETIF_F_HW_CSUM; -+ if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) { -+ ar->hw->netdev_features = NETIF_F_HW_CSUM; -+ ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL); -+ } - - ret = ieee80211_register_hw(ar->hw); - if (ret) { ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -864,6 +864,8 @@ int ath11k_wmi_vdev_start(struct ath11k - } - - cmd->flags |= WMI_VDEV_START_LDPC_RX_ENABLED; -+ if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) -+ cmd->flags |= WMI_VDEV_START_HW_ENCRYPTION_DISABLED; - - ptr = skb->data + sizeof(*cmd); - chan = ptr; -@@ -1684,7 +1686,8 @@ int ath11k_wmi_vdev_install_key(struct a - - static inline void - ath11k_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd, -- struct peer_assoc_params *param) -+ struct peer_assoc_params *param, -+ bool hw_crypto_disabled) - { - cmd->peer_flags = 0; - -@@ -1738,7 +1741,8 @@ ath11k_wmi_copy_peer_flags(struct wmi_pe - cmd->peer_flags |= WMI_PEER_AUTH; - if (param->need_ptk_4_way) { - cmd->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; -- cmd->peer_flags &= ~WMI_PEER_AUTH; -+ if (!hw_crypto_disabled) -+ cmd->peer_flags &= ~WMI_PEER_AUTH; - } - if (param->need_gtk_2_way) - cmd->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; -@@ -1805,7 +1809,8 @@ int ath11k_wmi_send_peer_assoc_cmd(struc - cmd->peer_new_assoc = param->peer_new_assoc; - cmd->peer_associd = param->peer_associd; - -- ath11k_wmi_copy_peer_flags(cmd, param); -+ ath11k_wmi_copy_peer_flags(cmd, param, -+ test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)); - - ether_addr_copy(cmd->peer_macaddr.addr, param->peer_mac); - -@@ -3368,6 +3373,10 @@ int ath11k_wmi_cmd_init(struct ath11k_ba - config.rx_timeout_pri[2] = TARGET_RX_TIMEOUT_LO_PRI; - config.rx_timeout_pri[3] = TARGET_RX_TIMEOUT_HI_PRI; - config.rx_decap_mode = TARGET_DECAP_MODE_NATIVE_WIFI; -+ -+ if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) -+ config.rx_decap_mode = TARGET_DECAP_MODE_RAW; -+ - config.scan_max_pending_req = TARGET_SCAN_MAX_PENDING_REQS; - config.bmiss_offload_max_vdev = TARGET_BMISS_OFFLOAD_MAX_VDEV; - config.roam_offload_max_vdev = TARGET_ROAM_OFFLOAD_MAX_VDEV; ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -26,6 +26,8 @@ enum ath11k_debug_mask { - ATH11K_DBG_TESTMODE = 0x00000400, - ATH11k_DBG_HAL = 0x00000800, - ATH11K_DBG_PCI = 0x00001000, -+ ATH11K_DBG_DP_TX = 0x00002000, -+ ATH11K_DBG_DP_RX = 0x00004000, - ATH11K_DBG_ANY = 0xffffffff, - }; - ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2502,6 +2502,7 @@ struct wmi_vdev_down_cmd { - #define WMI_VDEV_START_HIDDEN_SSID BIT(0) - #define WMI_VDEV_START_PMF_ENABLED BIT(1) - #define WMI_VDEV_START_LDPC_RX_ENABLED BIT(3) -+#define WMI_VDEV_START_HW_ENCRYPTION_DISABLED BIT(4) - - struct wmi_ssid { - u32 ssid_len; diff --git a/feeds/wifi-ax/mac80211/patches/qca/017-ath11k-factory-test-mode-support.patch b/feeds/wifi-ax/mac80211/patches/qca/017-ath11k-factory-test-mode-support.patch index b3b56335d..a73bf5424 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/017-ath11k-factory-test-mode-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/017-ath11k-factory-test-mode-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -878,6 +878,7 @@ static int ath11k_ahb_probe(struct platf +@@ -693,6 +693,7 @@ static int ath11k_ahb_probe(struct platf ab->hif.ops = &ath11k_ahb_hif_ops; ab->pdev = pdev; ab->hw_rev = (enum ath11k_hw_rev)of_id->data; @@ -10,7 +10,7 @@ platform_set_drvdata(pdev, ab); --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -604,7 +604,7 @@ int ath11k_core_qmi_firmware_ready(struc +@@ -837,7 +837,7 @@ int ath11k_core_qmi_firmware_ready(struc set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); mutex_lock(&ab->core_lock); @@ -19,7 +19,7 @@ if (ret) { ath11k_err(ab, "failed to start core: %d\n", ret); goto err_dp_free; -@@ -701,7 +701,8 @@ static void ath11k_core_restart(struct w +@@ -934,7 +934,8 @@ static void ath11k_core_restart(struct w for (i = 0; i < ab->num_radios; i++) { pdev = &ab->pdevs[i]; ar = pdev->ar; @@ -29,7 +29,7 @@ continue; ieee80211_stop_queues(ar->hw); -@@ -757,6 +758,12 @@ static void ath11k_core_restart(struct w +@@ -992,6 +993,12 @@ static void ath11k_core_restart(struct w ath11k_warn(ab, "device is wedged, will not restart radio %d\n", i); break; @@ -44,15 +44,15 @@ } --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -174,6 +174,7 @@ enum ath11k_dev_flags { - ATH11K_FLAG_RECOVERY, - ATH11K_FLAG_UNREGISTERING, +@@ -189,6 +189,7 @@ enum ath11k_dev_flags { ATH11K_FLAG_REGISTERED, + ATH11K_FLAG_QMI_FAIL, + ATH11K_FLAG_HTC_SUSPEND_COMPLETE, + ATH11K_FLAG_FW_RESTART_FOR_HOST, }; enum ath11k_monitor_flags { -@@ -370,12 +371,19 @@ enum ath11k_state { +@@ -386,12 +387,19 @@ enum ath11k_state { ATH11K_STATE_RESTARTING, ATH11K_STATE_RESTARTED, ATH11K_STATE_WEDGED, @@ -72,7 +72,7 @@ struct ath11k_fw_stats { struct dentry *debugfs_fwstats; u32 pdev_id; -@@ -556,6 +564,7 @@ struct ath11k { +@@ -570,6 +578,7 @@ struct ath11k { #endif bool dfs_block_radar_events; struct ath11k_thermal thermal; @@ -80,7 +80,7 @@ }; struct ath11k_band_cap { -@@ -646,6 +655,7 @@ struct ath11k_soc_dp_stats { +@@ -661,6 +670,7 @@ struct ath11k_soc_dp_stats { /* Master structure to hold the hw data which may be used in core module */ struct ath11k_base { enum ath11k_hw_rev hw_rev; @@ -88,17 +88,17 @@ struct platform_device *pdev; struct device *dev; struct ath11k_qmi qmi; -@@ -723,6 +733,7 @@ struct ath11k_base { +@@ -741,6 +751,7 @@ struct ath11k_base { /* protected by data_lock */ u32 fw_crash_counter; } stats; + struct ath11k_ftm_event_obj ftm_event_obj; u32 pktlog_defs_checksum; - /* Round robbin based TCL ring selector */ + struct ath11k_dbring_cap *db_caps; --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -533,7 +533,10 @@ struct ath11k *ath11k_mac_get_ar_by_pdev +@@ -528,7 +528,10 @@ struct ath11k *ath11k_mac_get_ar_by_pdev return NULL; for (i = 0; i < ab->num_radios; i++) { @@ -110,7 +110,7 @@ if (pdev && pdev->pdev_id == pdev_id) return (pdev->ar ? pdev->ar : NULL); -@@ -4119,6 +4122,7 @@ static int ath11k_mac_op_start(struct ie +@@ -4326,6 +4329,7 @@ static int ath11k_mac_op_start(struct ie case ATH11K_STATE_RESTARTED: case ATH11K_STATE_WEDGED: case ATH11K_STATE_ON: @@ -128,7 +128,7 @@ #include "testmode_i.h" static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = { -@@ -23,34 +24,88 @@ static const struct nla_policy ath11k_tm +@@ -23,34 +24,89 @@ static const struct nla_policy ath11k_tm /* Returns true if callee consumes the skb and the skb should be discarded. * Returns false if skb is not used. Does not sleep. */ @@ -162,11 +162,12 @@ + if (ar && ar->state == ATH11K_STATE_TM) + break; + } - ++ + if (i >= ab->num_radios) { + ath11k_dbg(ab, ATH11K_DBG_TESTMODE, "testmode event not handled\n"); + return false; + } + spin_lock_bh(&ar->data_lock); consumed = true; @@ -222,16 +223,16 @@ if (ret) { - ath11k_warn(ar->ab, + ath11k_warn(ab, - "failed to to put testmode wmi event cmd attribute: %d\n", + "failed to put testmode wmi event cmd attribute: %d\n", ret); kfree_skb(nl_skb); -@@ -59,16 +114,17 @@ bool ath11k_tm_event_wmi(struct ath11k * +@@ -59,16 +115,17 @@ bool ath11k_tm_event_wmi(struct ath11k * ret = nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id); if (ret) { - ath11k_warn(ar->ab, + ath11k_warn(ab, - "failed to to put testmode wmi even cmd_id: %d\n", + "failed to put testmode wmi even cmd_id: %d\n", ret); kfree_skb(nl_skb); goto out; @@ -246,7 +247,7 @@ "failed to copy skb to testmode wmi event: %d\n", ret); kfree_skb(nl_skb); -@@ -115,6 +171,107 @@ static int ath11k_tm_cmd_get_version(str +@@ -115,6 +172,107 @@ static int ath11k_tm_cmd_get_version(str return cfg80211_testmode_reply(skb); } @@ -354,7 +355,7 @@ static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[]) { struct ath11k_pdev_wmi *wmi = ar->wmi; -@@ -173,8 +330,95 @@ out: +@@ -173,8 +331,95 @@ out: return ret; } @@ -451,7 +452,7 @@ { struct ath11k *ar = hw->priv; struct nlattr *tb[ATH11K_TM_ATTR_MAX + 1]; -@@ -189,9 +433,15 @@ int ath11k_tm_cmd(struct ieee80211_hw *h +@@ -189,9 +434,15 @@ int ath11k_tm_cmd(struct ieee80211_hw *h return -EINVAL; switch (nla_get_u32(tb[ATH11K_TM_ATTR_CMD])) { @@ -559,24 +560,25 @@ struct wmi_tlv_policy { size_t min_len; -@@ -6571,6 +6572,9 @@ static void ath11k_wmi_tlv_op_rx(struct - case WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID: - ath11k_wmi_pdev_dma_ring_buf_release_event(ab, skb); +@@ -7077,6 +7078,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID: + ath11k_probe_resp_tx_status_event(ab, skb); break; + case WMI_PDEV_UTF_EVENTID: + ath11k_tm_event_wmi(ab, id, skb); + break; /* add Unsupported events here */ case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: - case WMI_VDEV_DELETE_RESP_EVENTID: ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -@@ -4501,7 +4501,7 @@ static int ath11k_open_htt_stats(struct + case WMI_PEER_OPER_MODE_CHANGE_EVENTID: +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c +@@ -4469,7 +4469,8 @@ static int ath11k_open_htt_stats(struct mutex_lock(&ar->conf_mutex); - if (ar->state != ATH11K_STATE_ON) { -+ if (ar->state != ATH11K_STATE_ON && ar->state != ATH11K_STATE_TM) { ++ if (ar->state != ATH11K_STATE_ON && ++ ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM) { ret = -ENETDOWN; goto err_unlock; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/018-ath11k-fix-invalid-msdu-len-print-info.patch b/feeds/wifi-ax/mac80211/patches/qca/018-ath11k-fix-invalid-msdu-len-print-info.patch deleted file mode 100644 index c05b58969..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/018-ath11k-fix-invalid-msdu-len-print-info.patch +++ /dev/null @@ -1,88 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -85,6 +85,12 @@ static bool ath11k_dp_rx_h_attn_msdu_don - __le32_to_cpu(desc->attention.info2)); - } - -+static bool ath11k_dp_rx_h_attn_first_mpdu(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_ATTENTION_INFO1_FIRST_MPDU, -+ __le32_to_cpu(desc->attention.info1)); -+} -+ - static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct hal_rx_desc *desc) - { - return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, -@@ -1780,6 +1786,50 @@ static struct sk_buff *ath11k_dp_rx_get_ - return NULL; - } - -+static void ath11k_dp_dump_msdu_info(struct ath11k *ar, struct hal_rx_desc *rx_desc, -+ struct ath11k_skb_rxcb *rxcb) -+{ -+ bool ip_csum_fail, l4_csum_fail, is_decrypted; -+ u32 decap_format, err_bitmap, l2_hdr_offset; -+ bool mpdu_len_err, msdu_done, first_mpdu; -+ enum hal_encrypt_type enctype; -+ u8 *hdr_status; -+ u16 msdu_len; -+ int i; -+ -+ hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); -+ rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(rx_desc); -+ rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(rx_desc); -+ -+ if (rxcb->is_first_msdu) { -+ decap_format = ath11k_dp_rxdesc_get_decap_format(rx_desc); -+ mpdu_len_err = !!ath11k_dp_rxdesc_get_mpdulen_err(rx_desc); -+ first_mpdu = ath11k_dp_rx_h_attn_first_mpdu(rx_desc); -+ } -+ -+ ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rx_desc); -+ l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rx_desc); -+ is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -+ enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); -+ err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); -+ -+ if (rxcb->is_last_msdu) { -+ msdu_done = ath11k_dp_rx_h_attn_msdu_done(rx_desc); -+ l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); -+ } -+ -+ ath11k_info(ar->ab, "first msdu %d last msdu %d msdu len %u decap format %u mpdu_len_err %d first_mpdu %d ip_csum_fail %d l4_csum_fail %d decrypte %d encryption type %u error bitmap %u msdu_done %d l2_hdr_offset %u\n", -+ rxcb->is_first_msdu, rxcb->is_last_msdu, msdu_len, decap_format, -+ mpdu_len_err, first_mpdu, ip_csum_fail, l4_csum_fail, -+ is_decrypted, enctype, err_bitmap, msdu_done, l2_hdr_offset); -+ ath11k_info(ar->ab, "hdr status : "); -+ for (i = 0; i < HAL_RX_DESC_HDR_STATUS_LEN; i++) -+ ath11k_info(ar->ab, "0x%x ", hdr_status[i]); -+ -+ ath11k_info(ar->ab, "\n"); -+} -+ - static void ath11k_dp_rx_h_csum_offload(struct sk_buff *msdu) - { - struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); -@@ -2397,6 +2447,13 @@ static int ath11k_dp_rx_process_msdu(str - rxcb->rx_desc = rx_desc; - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); - l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(lrx_desc); -+ if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { -+ ath11k_warn(ar->ab, "invalid msdu len %u\n", msdu_len); -+ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rxcb->rx_desc, -+ sizeof(struct hal_rx_desc)); -+ ath11k_dp_dump_msdu_info(ar, rxcb->rx_desc, rxcb); -+ goto free_out; -+ } - - if (rxcb->is_frag) { - skb_pull(msdu, HAL_RX_DESC_SIZE); -@@ -3562,6 +3619,7 @@ ath11k_dp_process_rx_err_buf(struct ath1 - sizeof(struct ieee80211_hdr)); - ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, - sizeof(struct hal_rx_desc)); -+ ath11k_dp_dump_msdu_info(ar, rx_desc, rxcb); - dev_kfree_skb_any(msdu); - goto exit; - } diff --git a/feeds/wifi-ax/mac80211/patches/qca/020-ath11k-add-btcoex-config.patch b/feeds/wifi-ax/mac80211/patches/qca/020-ath11k-add-btcoex-config.patch index afe29ad10..109865fe4 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/020-ath11k-add-btcoex-config.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/020-ath11k-add-btcoex-config.patch @@ -1,20 +1,20 @@ --- a/drivers/net/wireless/ath/ath11k/Makefile +++ b/drivers/net/wireless/ath/ath11k/Makefile -@@ -16,7 +16,8 @@ ath11k-y += core.o \ - ce.o \ +@@ -17,7 +17,8 @@ ath11k-y += core.o \ peer.o \ dbring.o \ -- hw.o -+ hw.o \ + hw.o \ +- wow.o ++ wow.o \ + vendor.o - ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o + ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -440,6 +440,16 @@ struct ath11k_vdev_stop_status { - u32 vdev_id; - }; +@@ -452,6 +452,16 @@ struct ath11k_per_peer_tx_stats { + #define ATH11K_FLUSH_TIMEOUT (5 * HZ) + #define ATH11K_VDEV_DELETE_TIMEOUT_HZ (5 * HZ) +struct ath11k_coex_info { + bool coex_support; @@ -29,7 +29,7 @@ struct ath11k { struct ath11k_base *ab; struct ath11k_pdev *pdev; -@@ -556,6 +566,8 @@ struct ath11k { +@@ -570,6 +580,8 @@ struct ath11k { struct ath11k_per_peer_tx_stats cached_stats; u32 last_ppdu_id; u32 cached_ppdu_id; @@ -48,15 +48,15 @@ #include "mac.h" #include "core.h" #include "debug.h" -@@ -14,6 +15,7 @@ - #include "dp_rx.h" +@@ -15,6 +16,7 @@ #include "testmode.h" #include "peer.h" + #include "debugfs_sta.h" +#include "vendor.h" #define CHAN2G(_channel, _freq, _flags) { \ .band = NL80211_BAND_2GHZ, \ -@@ -5821,6 +5823,91 @@ static void ath11k_mac_op_sta_statistics +@@ -6091,6 +6093,91 @@ static void ath11k_mac_op_sta_statistics sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; } @@ -148,7 +148,7 @@ static const struct ieee80211_ops ath11k_ops = { .tx = ath11k_mac_op_tx, .start = ath11k_mac_op_start, -@@ -6013,6 +6100,56 @@ static int ath11k_mac_setup_channels_rat +@@ -6301,6 +6388,56 @@ static int ath11k_mac_setup_iface_combin return 0; } @@ -205,15 +205,15 @@ static const u8 ath11k_if_types_ext_capa[] = { [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, -@@ -6195,6 +6332,7 @@ static int __ath11k_mac_register(struct - ARRAY_SIZE(ath11k_iftypes_ext_capa); +@@ -6494,6 +6631,7 @@ static int __ath11k_mac_register(struct + } ath11k_reg_init(ar); + ath11k_vendor_register(ar); if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) { ar->hw->netdev_features = NETIF_F_HW_CSUM; -@@ -6307,6 +6445,7 @@ int ath11k_mac_allocate(struct ath11k_ba +@@ -6624,6 +6762,7 @@ int ath11k_mac_allocate(struct ath11k_ba */ ath11k_wmi_pdev_attach(ab, i); @@ -223,7 +223,7 @@ ar->num_tx_chains = get_num_chains(pdev->cap.tx_chain_mask); --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -133,8 +133,9 @@ void __ath11k_mac_scan_finish(struct ath +@@ -139,8 +139,9 @@ void __ath11k_mac_scan_finish(struct ath void ath11k_mac_scan_finish(struct ath11k *ar); struct ath11k_vif *ath11k_mac_get_arvif(struct ath11k *ar, u32 vdev_id); @@ -234,7 +234,7 @@ + int coex, u32 wlan_prio_mask, u8 wlan_weight); struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base *ab, u32 vdev_id); struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id); - struct ath11k *ath11k_mac_get_ar_vdev_stop_status(struct ath11k_base *ab, + --- /dev/null +++ b/drivers/net/wireless/ath/ath11k/vendor.c @@ -0,0 +1,121 @@ @@ -447,7 +447,7 @@ +#endif /* QCA_VENDOR_H */ --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1485,6 +1485,71 @@ int ath11k_wmi_vdev_set_param_cmd(struct +@@ -1489,6 +1489,71 @@ int ath11k_wmi_vdev_set_param_cmd(struct return ret; } @@ -521,7 +521,7 @@ { --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -4697,6 +4697,79 @@ struct wmi_wmm_params_arg { +@@ -4735,6 +4735,79 @@ struct wmi_wmm_params_arg { u8 no_ack; }; @@ -601,10 +601,10 @@ struct wmi_vdev_set_wmm_params_cmd { u32 tlv_header; u32 vdev_id; -@@ -5110,6 +5183,8 @@ int ath11k_wmi_send_twt_enable_cmd(struc - int ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id); - int ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id, - struct ieee80211_he_obss_pd *he_obss_pd); +@@ -5351,6 +5424,8 @@ int ath11k_wmi_pdev_non_srg_obss_color_e + u32 *bitmap); + int ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(struct ath11k *ar, + u32 *bitmap); +int ath11k_send_coex_config_cmd(struct ath11k *ar, + struct coex_config_arg *coex_config); int ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id, diff --git a/feeds/wifi-ax/mac80211/patches/qca/021-ath11k-cold-boot-calibration-support.patch b/feeds/wifi-ax/mac80211/patches/qca/021-ath11k-cold-boot-calibration-support.patch deleted file mode 100644 index 2dc2f2002..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/021-ath11k-cold-boot-calibration-support.patch +++ /dev/null @@ -1,201 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -573,6 +573,29 @@ static void ath11k_ahb_power_down(struct - rproc_shutdown(ab->tgt_rproc); - } - -+int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab) -+{ -+ int timeout; -+ -+ if (enable_cold_boot_cal == 0 || ab->qmi.cal_done) -+ return 0; -+ -+ ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n"); -+ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, (ab->qmi.cal_done == 1), -+ ATH11K_COLD_BOOT_FW_RESET_DELAY); -+ if (timeout <= 0) { -+ ath11k_warn(ab, "Coldboot Calibration timed out\n"); -+ return -ETIMEDOUT; -+ } -+ -+ /* reset the firmware */ -+ ath11k_ahb_power_down(ab); -+ ath11k_ahb_power_up(ab); -+ ath11k_dbg(ab, ATH11K_DBG_AHB, "exit wait for cold boot done\n"); -+ -+ return 0; -+} -+ - static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) - { - struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; -@@ -911,6 +934,8 @@ static int ath11k_ahb_probe(struct platf - goto err_ce_free; - } - -+ ath11k_ahb_fwreset_from_cold_boot(ab); -+ - return 0; - - err_ce_free: ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -107,8 +107,12 @@ enum ath11k_firmware_mode { - - /* factory tests etc */ - ATH11K_FIRMWARE_MODE_FTM, -+ -+ /* Cold boot calibration */ -+ ATH11K_FIRMWARE_MODE_COLD_BOOT = 7, - }; - -+extern bool enable_cold_boot_cal; - #define ATH11K_IRQ_NUM_MAX 52 - #define ATH11K_EXT_IRQ_NUM_MAX 16 - ---- a/drivers/net/wireless/ath/ath11k/qmi.c -+++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -12,6 +12,12 @@ - #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 - #define HOST_CSTATE_BIT 0x04 - -+/* set the default max assoc sta to max supported by driver */ -+bool enable_cold_boot_cal = 1; -+EXPORT_SYMBOL(enable_cold_boot_cal); -+module_param(enable_cold_boot_cal, bool, 0644); -+MODULE_PARM_DESC(enable_cold_boot_cal, "cold boot calibration enable:1 disable:0"); -+ - static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = { - { - .data_type = QMI_OPT_FLAG, -@@ -1752,6 +1758,7 @@ static int ath11k_qmi_alloc_target_mem_c - static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) - { - int i, idx; -+ u32 caldb_location[2] = {0, 0}; - - for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { - switch (ab->qmi.target_mem[i].type) { -@@ -1767,9 +1774,20 @@ static int ath11k_qmi_assign_target_mem_ - ath11k_warn(ab, "qmi mem size is low to load caldata\n"); - return -EINVAL; - } -- /* TODO ath11k does not support cold boot calibration */ -- ab->qmi.target_mem[idx].paddr = 0; -- ab->qmi.target_mem[idx].vaddr = NULL; -+ -+ if (of_property_read_u32_array(ab->dev->of_node, "qcom,caldb-addr", -+ &caldb_location[0], -+ ARRAY_SIZE(caldb_location))) { -+ ath11k_warn(ab, "qmi no bdf_addr in device_tree\n"); -+ } -+ -+ if (enable_cold_boot_cal) { -+ ab->qmi.target_mem[idx].paddr = caldb_location[ab->qmi.target_mem_mode]; -+ ab->qmi.target_mem[idx].vaddr = caldb_location[ab->qmi.target_mem_mode]; -+ } else { -+ ab->qmi.target_mem[idx].paddr = 0; -+ ab->qmi.target_mem[idx].vaddr = 0; -+ } - ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; - ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; - idx++; -@@ -2331,6 +2349,30 @@ int ath11k_qmi_firmware_start(struct ath - return 0; - } - -+int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab) -+{ -+ int ret; -+ int timeout; -+ -+ ret = ath11k_qmi_wlanfw_mode_send(ab, ATH11K_FIRMWARE_MODE_COLD_BOOT); -+ if (ret < 0) { -+ ath11k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret); -+ return ret; -+ } -+ -+ ath11k_info(ab, "Coldboot calibration wait started\n"); -+ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, (ab->qmi.cal_done == 1), -+ ATH11K_COLD_BOOT_FW_RESET_DELAY); -+ if (timeout <= 0) { -+ ath11k_warn(ab, "Coldboot Calibration timed out\n"); -+ return -ETIMEDOUT; -+ } -+ -+ ath11k_info(ab, "Coldboot calibration wait ended\n"); -+ -+ return 0; -+} -+ - static int - ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, - enum ath11k_qmi_event_type type, -@@ -2480,11 +2522,17 @@ static void ath11k_qmi_msg_fw_ready_cb(s - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_READY, NULL); - } - --static void ath11k_qmi_msg_cold_boot_cal_done_cb(struct qmi_handle *qmi, -+static void ath11k_qmi_msg_cold_boot_cal_done_cb(struct qmi_handle *qmi_hdl, - struct sockaddr_qrtr *sq, - struct qmi_txn *txn, - const void *decoded) - { -+ struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); -+ struct ath11k_base *ab = qmi->ab; -+ -+ ab->qmi.cal_done = 1; -+ wake_up(&ab->qmi.cold_boot_waitq); -+ ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi cold boot calibration done\n"); - } - - static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { -@@ -2596,11 +2644,14 @@ static void ath11k_qmi_driver_event_work - queue_work(ab->workqueue, &ab->restart_work); - break; - } -- -- ath11k_core_qmi_firmware_ready(ab); -- ab->qmi.cal_done = 1; -- set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags); -- -+ if (enable_cold_boot_cal && ab->qmi.cal_done == 0) { -+ ath11k_qmi_process_coldboot_calibration(ab); -+ } else { -+ clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); -+ clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); -+ ath11k_core_qmi_firmware_ready(ab); -+ set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags); -+ } - break; - case ATH11K_QMI_EVENT_COLD_BOOT_CAL_DONE: - break; ---- a/drivers/net/wireless/ath/ath11k/qmi.h -+++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -33,6 +33,7 @@ - #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 - #define ATH11K_FIRMWARE_MODE_OFF 4 - #define ATH11K_QMI_TARGET_MEM_MODE_DEFAULT 0 -+#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ) - - struct ath11k_base; - -@@ -125,6 +126,7 @@ struct ath11k_qmi { - struct target_info target; - struct m3_mem_region m3_mem; - unsigned int service_ins_id; -+ wait_queue_head_t cold_boot_waitq; - }; - - #define QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN 189 ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -901,6 +901,7 @@ struct ath11k_base *ath11k_core_alloc(st - INIT_LIST_HEAD(&ab->peers); - init_waitqueue_head(&ab->peer_mapping_wq); - init_waitqueue_head(&ab->wmi_ab.tx_credits_wq); -+ init_waitqueue_head(&ab->qmi.cold_boot_waitq); - INIT_WORK(&ab->restart_work, ath11k_core_restart); - timer_setup(&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0); - ab->dev = dev; diff --git a/feeds/wifi-ax/mac80211/patches/qca/022-ath11k-add-ap-ps-support.patch b/feeds/wifi-ax/mac80211/patches/qca/022-ath11k-add-ap-ps-support.patch index 1523b8b37..85875283d 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/022-ath11k-add-ap-ps-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/022-ath11k-add-ap-ps-support.patch @@ -8,7 +8,7 @@ #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) -@@ -454,6 +455,11 @@ struct ath11k_coex_info { +@@ -462,6 +463,11 @@ struct ath11k_coex_info { u32 pta_priority; }; @@ -20,7 +20,7 @@ struct ath11k { struct ath11k_base *ab; struct ath11k_pdev *pdev; -@@ -581,6 +587,8 @@ struct ath11k { +@@ -591,6 +597,8 @@ struct ath11k { bool dfs_block_radar_events; struct ath11k_thermal thermal; struct completion fw_mode_reset; @@ -31,7 +31,7 @@ struct ath11k_band_cap { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2913,6 +2913,33 @@ static void ath11k_mac_dec_num_stations( +@@ -3111,6 +3111,33 @@ static void ath11k_mac_dec_num_stations( ar->num_stations--; } @@ -65,7 +65,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, struct ieee80211_vif *vif, struct ieee80211_sta *sta) -@@ -2952,6 +2979,12 @@ static int ath11k_mac_station_add(struct +@@ -3150,6 +3177,12 @@ static int ath11k_mac_station_add(struct ath11k_dbg(ab, ATH11K_DBG_MAC, "Added peer: %pM for VDEV: %d\n", sta->addr, arvif->vdev_id); @@ -75,10 +75,10 @@ + goto exit; + } + - if (ath11k_debug_is_extd_tx_stats_enabled(ar)) { + if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) { arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats), GFP_KERNEL); if (!arsta->tx_stats) { -@@ -3058,6 +3091,9 @@ static int ath11k_mac_op_sta_state(struc +@@ -3258,6 +3291,9 @@ static int ath11k_mac_op_sta_state(struc kfree(arsta->tx_stats); arsta->tx_stats = NULL; @@ -88,7 +88,7 @@ kfree(arsta->rx_stats); arsta->rx_stats = NULL; -@@ -4229,6 +4265,7 @@ static void ath11k_mac_op_stop(struct ie +@@ -4446,6 +4482,7 @@ static void ath11k_mac_op_stop(struct ie clear_bit(ATH11K_CAC_RUNNING, &ar->dev_flags); ar->state = ATH11K_STATE_OFF; @@ -96,7 +96,7 @@ mutex_unlock(&ar->conf_mutex); cancel_delayed_work_sync(&ar->scan.timeout); -@@ -4430,7 +4467,6 @@ static int ath11k_mac_op_add_interface(s +@@ -4677,7 +4714,6 @@ static int ath11k_mac_op_add_interface(s arvif->vdev_id, ret); goto err; } @@ -104,7 +104,7 @@ ar->num_created_vdevs++; ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM created, vdev_id %d\n", vif->addr, arvif->vdev_id); -@@ -4555,6 +4591,10 @@ static int ath11k_mac_op_add_interface(s +@@ -4776,6 +4812,10 @@ static int ath11k_mac_op_add_interface(s ath11k_dp_vdev_tx_attach(ar, arvif); @@ -115,7 +115,7 @@ mutex_unlock(&ar->conf_mutex); return 0; -@@ -4641,6 +4681,7 @@ static void ath11k_mac_op_remove_interfa +@@ -4890,6 +4930,7 @@ err_vdev_del: /* Recalc txpower for remaining vdev */ ath11k_mac_txpower_recalc(ar); @@ -125,7 +125,7 @@ /* TODO: recal traffic pause state based on the available vdevs */ --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -118,6 +118,7 @@ struct ath11k_generic_iter { +@@ -124,6 +124,7 @@ struct ath11k_generic_iter { extern const struct htt_rx_ring_tlv_filter ath11k_mac_mon_status_filter_default; @@ -260,7 +260,7 @@ * enum qca_wlan_vendor_attr_btcoex_config - Used by the vendor command --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1193,6 +1193,38 @@ ath11k_wmi_rx_reord_queue_remove(struct +@@ -1197,6 +1197,38 @@ ath11k_wmi_rx_reord_queue_remove(struct return ret; } @@ -301,7 +301,7 @@ { --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2902,6 +2902,12 @@ struct set_fwtest_params { +@@ -2926,6 +2926,12 @@ struct set_fwtest_params { u32 value; }; @@ -314,8 +314,8 @@ struct wmi_fwtest_set_param_cmd_param { u32 tlv_header; u32 param_id; -@@ -5185,6 +5191,7 @@ int ath11k_wmi_send_obss_spr_cmd(struct - struct ieee80211_he_obss_pd *he_obss_pd); +@@ -5426,6 +5432,7 @@ int ath11k_wmi_pdev_non_srg_obss_bssid_e + u32 *bitmap); int ath11k_send_coex_config_cmd(struct ath11k *ar, struct coex_config_arg *coex_config); +int ath11k_wmi_pdev_ap_ps_cmd_send(struct ath11k *ar, u8 pdev_id, u32 value); diff --git a/feeds/wifi-ax/mac80211/patches/qca/025-ath11k-add-vdev-delete-synchro-with-firmware.patch b/feeds/wifi-ax/mac80211/patches/qca/025-ath11k-add-vdev-delete-synchro-with-firmware.patch deleted file mode 100644 index cda7f19e1..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/025-ath11k-add-vdev-delete-synchro-with-firmware.patch +++ /dev/null @@ -1,333 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -712,6 +712,7 @@ static void ath11k_core_restart(struct w - complete(&ar->peer_assoc_done); - complete(&ar->install_key_done); - complete(&ar->vdev_setup_done); -+ complete(&ar->vdev_delete_done); - complete(&ar->bss_survey_done); - complete(&ar->thermal.wmi_sync); - ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -439,9 +439,11 @@ struct ath11k_per_peer_tx_stats { - }; - - #define ATH11K_FLUSH_TIMEOUT (5 * HZ) -+#define ATH11K_VDEV_DELETE_TIMEOUT_HZ (5 * HZ) - --struct ath11k_vdev_stop_status { -+struct ath11k_vdev_stop_delete_status { - bool stop_in_progress; -+ bool delete_in_progress; - u32 vdev_id; - }; - -@@ -534,8 +536,9 @@ struct ath11k { - struct completion install_key_done; - - int last_wmi_vdev_start_status; -- struct ath11k_vdev_stop_status vdev_stop_status; -+ struct ath11k_vdev_stop_delete_status vdev_stop_delete_status; - struct completion vdev_setup_done; -+ struct completion vdev_delete_done; - - int num_peers; - int max_num_peers; ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -547,8 +547,8 @@ struct ath11k *ath11k_mac_get_ar_by_pdev - return NULL; - } - --struct ath11k *ath11k_mac_get_ar_vdev_stop_status(struct ath11k_base *ab, -- u32 vdev_id) -+struct ath11k *ath11k_mac_get_ar_vdev_stop_delete_status(struct ath11k_base *ab, -+ u32 vdev_id) - { - int i; - struct ath11k_pdev *pdev; -@@ -560,9 +560,15 @@ struct ath11k *ath11k_mac_get_ar_vdev_st - ar = pdev->ar; - - spin_lock_bh(&ar->data_lock); -- if (ar->vdev_stop_status.stop_in_progress && -- ar->vdev_stop_status.vdev_id == vdev_id) { -- ar->vdev_stop_status.stop_in_progress = false; -+ if (ar->vdev_stop_delete_status.stop_in_progress && -+ ar->vdev_stop_delete_status.vdev_id == vdev_id) { -+ ar->vdev_stop_delete_status.stop_in_progress = false; -+ spin_unlock_bh(&ar->data_lock); -+ return ar; -+ } -+ if (ar->vdev_stop_delete_status.delete_in_progress && -+ ar->vdev_stop_delete_status.vdev_id == vdev_id) { -+ ar->vdev_stop_delete_status.delete_in_progress = false; - spin_unlock_bh(&ar->data_lock); - return ar; - } -@@ -4375,6 +4381,37 @@ static int ath11k_set_he_mu_sounding_mod - return ret; - } - -+static int ath11k_mac_vdev_delete(struct ath11k_vif *arvif) -+{ -+ struct ath11k *ar = arvif->ar; -+ unsigned long time_left; -+ int ret; -+ -+ lockdep_assert_held(&ar->conf_mutex); -+ -+ reinit_completion(&ar->vdev_delete_done); -+ -+ ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to delete WMI vdev %d\n", ret); -+ return ret; -+ } else { -+ time_left = wait_for_completion_timeout( -+ &ar->vdev_delete_done, -+ ATH11K_VDEV_DELETE_TIMEOUT_HZ); -+ if (time_left == 0) { -+ ath11k_warn(ar->ab, "timeout in receiving vdev delete response\n"); -+ return -ETIMEDOUT; -+ } else { -+ ar->num_created_vdevs--; -+ ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); -+ ar->ab->free_vdev_map |= 1LL << arvif->vdev_id; -+ } -+ } -+ -+ return 0; -+} -+ - static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, - struct ieee80211_vif *vif) - { -@@ -4387,7 +4424,7 @@ static int ath11k_mac_op_add_interface(s - int hw_encap = 0; - u16 nss; - int i; -- int ret; -+ int ret, free_err; - int bit; - - vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; -@@ -4606,10 +4643,8 @@ err_peer_del: - } - - err_vdev_del: -- ath11k_wmi_vdev_delete(ar, arvif->vdev_id); -- ar->num_created_vdevs--; -- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); -- ab->free_vdev_map |= 1LL << arvif->vdev_id; -+ ath11k_mac_vdev_delete(arvif); -+ - spin_lock_bh(&ar->data_lock); - list_del(&arvif->list); - spin_unlock_bh(&ar->data_lock); -@@ -4645,10 +4680,6 @@ static void ath11k_mac_op_remove_interfa - ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n", - arvif->vdev_id); - -- spin_lock_bh(&ar->data_lock); -- list_del(&arvif->list); -- spin_unlock_bh(&ar->data_lock); -- - if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { - ret = ath11k_peer_delete(ar, arvif->vdev_id, vif->addr); - if (ret) -@@ -4656,16 +4687,17 @@ static void ath11k_mac_op_remove_interfa - arvif->vdev_id, ret); - } - -- ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); -+ ret = ath11k_mac_vdev_delete(arvif); - if (ret) -- ath11k_warn(ab, "failed to delete WMI vdev %d: %d\n", -- arvif->vdev_id, ret); -+ goto err_vdev_del; - -- ar->num_created_vdevs--; - ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", - vif->addr, arvif->vdev_id); -- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); -- ab->free_vdev_map |= 1LL << (arvif->vdev_id); -+ -+err_vdev_del: -+ spin_lock_bh(&ar->data_lock); -+ list_del(&arvif->list); -+ spin_unlock_bh(&ar->data_lock); - - ath11k_peer_cleanup(ar, arvif->vdev_id); - -@@ -4863,6 +4895,7 @@ ath11k_mac_vdev_start_restart(struct ath - lockdep_assert_held(&ar->conf_mutex); - - reinit_completion(&ar->vdev_setup_done); -+ reinit_completion(&ar->vdev_delete_done); - - arg.vdev_id = arvif->vdev_id; - arg.dtim_period = arvif->dtim_period; -@@ -4965,11 +4998,12 @@ static int ath11k_mac_vdev_stop(struct a - lockdep_assert_held(&ar->conf_mutex); - - reinit_completion(&ar->vdev_setup_done); -+ reinit_completion(&ar->vdev_delete_done); - - spin_lock_bh(&ar->data_lock); - -- ar->vdev_stop_status.stop_in_progress = true; -- ar->vdev_stop_status.vdev_id = arvif->vdev_id; -+ ar->vdev_stop_delete_status.stop_in_progress = true; -+ ar->vdev_stop_delete_status.vdev_id = arvif->vdev_id; - - spin_unlock_bh(&ar->data_lock); - -@@ -5002,7 +5036,7 @@ static int ath11k_mac_vdev_stop(struct a - return 0; - err: - spin_lock_bh(&ar->data_lock); -- ar->vdev_stop_status.stop_in_progress = false; -+ ar->vdev_stop_delete_status.stop_in_progress = false; - spin_unlock_bh(&ar->data_lock); - - return ret; -@@ -6498,6 +6532,7 @@ int ath11k_mac_allocate(struct ath11k_ba - INIT_LIST_HEAD(&ar->ppdu_stats_info); - mutex_init(&ar->conf_mutex); - init_completion(&ar->vdev_setup_done); -+ init_completion(&ar->vdev_delete_done); - init_completion(&ar->peer_assoc_done); - init_completion(&ar->install_key_done); - init_completion(&ar->bss_survey_done); ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -123,6 +123,8 @@ static const struct wmi_tlv_policy wmi_t - = { .min_len = sizeof(struct wmi_stats_event) }, - [WMI_TAG_PDEV_CTL_FAILSAFE_CHECK_EVENT] - = { .min_len = sizeof(struct wmi_pdev_ctl_failsafe_chk_event) }, -+ [WMI_TAG_VDEV_DELETE_RESP_EVENT] -+ = { .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, - }; - - #define PRIMAP(_hw_mode_) \ -@@ -4396,6 +4398,33 @@ static int ath11k_pull_peer_del_resp_ev( - return 0; - } - -+static int ath11k_pull_vdev_del_resp_ev(struct ath11k_base *ab, struct sk_buff *skb, -+ u32 *vdev_id) -+{ -+ const void **tb; -+ const struct wmi_vdev_delete_resp_event *ev; -+ int ret; -+ -+ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); -+ if (IS_ERR(tb)) { -+ ret = PTR_ERR(tb); -+ ath11k_warn(ab, "failed to parse tlv: %d\n", ret); -+ return ret; -+ } -+ -+ ev = tb[WMI_TAG_VDEV_DELETE_RESP_EVENT]; -+ if (!ev) { -+ ath11k_warn(ab, "failed to fetch vdev delete resp ev"); -+ kfree(tb); -+ return -EPROTO; -+ } -+ -+ *vdev_id = ev->vdev_id; -+ -+ kfree(tb); -+ return 0; -+} -+ - static int ath11k_pull_bcn_tx_status_ev(struct ath11k_base *ab, void *evt_buf, - u32 len, u32 *vdev_id, - u32 *tx_status) -@@ -5728,6 +5757,32 @@ static void ath11k_peer_delete_resp_even - */ - } - -+static void ath11k_vdev_delete_resp_event(struct ath11k_base *ab, struct sk_buff *skb) -+{ -+ struct ath11k *ar; -+ u32 vdev_id = 0; -+ -+ if (ath11k_pull_vdev_del_resp_ev(ab, skb, &vdev_id) != 0) { -+ ath11k_warn(ab, "failed to extract vdev delete resp"); -+ return; -+ } -+ -+ rcu_read_lock(); -+ ar = ath11k_mac_get_ar_vdev_stop_delete_status(ab, vdev_id); -+ if (!ar) { -+ ath11k_warn(ab, "invalid vdev id in vdev delete resp ev %d", -+ vdev_id); -+ rcu_read_unlock(); -+ return; -+ } -+ -+ complete(&ar->vdev_delete_done); -+ -+ rcu_read_unlock(); -+ -+ ath11k_dbg(ab, ATH11K_DBG_WMI, "vdev delete resp for vdev id %d", vdev_id); -+} -+ - static inline const char *ath11k_wmi_vdev_resp_print(u32 vdev_resp_status) - { - switch (vdev_resp_status) { -@@ -5804,7 +5859,7 @@ static void ath11k_vdev_stopped_event(st - } - - rcu_read_lock(); -- ar = ath11k_mac_get_ar_vdev_stop_status(ab, vdev_id); -+ ar = ath11k_mac_get_ar_vdev_stop_delete_status(ab, vdev_id); - if (!ar) { - ath11k_warn(ab, "invalid vdev id in vdev stopped ev %d", - vdev_id); -@@ -6674,7 +6729,6 @@ static void ath11k_wmi_tlv_op_rx(struct - break; - /* add Unsupported events here */ - case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: -- case WMI_VDEV_DELETE_RESP_EVENTID: - case WMI_PEER_OPER_MODE_CHANGE_EVENTID: - case WMI_TWT_ENABLE_EVENTID: - case WMI_TWT_DISABLE_EVENTID: -@@ -6685,6 +6739,9 @@ static void ath11k_wmi_tlv_op_rx(struct - case WMI_PDEV_DFS_RADAR_DETECTION_EVENTID: - ath11k_wmi_pdev_dfs_radar_detected_event(ab, skb); - break; -+ case WMI_VDEV_DELETE_RESP_EVENTID: -+ ath11k_vdev_delete_resp_event(ab, skb); -+ break; - /* TODO: Add remaining events */ - default: - ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -4025,6 +4025,10 @@ struct wmi_peer_delete_resp_event { - struct wmi_mac_addr peer_macaddr; - } __packed; - -+struct wmi_vdev_delete_resp_event { -+ u32 vdev_id; -+} __packed; -+ - struct wmi_bcn_tx_status_event { - u32 vdev_id; - u32 tx_status; ---- a/drivers/net/wireless/ath/ath11k/mac.h -+++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -141,7 +141,8 @@ struct ath11k *ath11k_mac_get_ar_by_vdev - struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id); - struct ath11k *ath11k_mac_get_ar_vdev_stop_status(struct ath11k_base *ab, - u32 vdev_id); -- -+struct ath11k *ath11k_mac_get_ar_vdev_stop_delete_status(struct ath11k_base *ab, -+ u32 vdev_id); - void ath11k_mac_drain_tx(struct ath11k *ar); - void ath11k_mac_peer_cleanup_all(struct ath11k *ar); - int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); diff --git a/feeds/wifi-ax/mac80211/patches/qca/026-ath11k-add-peer-delete-synchro-with-firmware.patch b/feeds/wifi-ax/mac80211/patches/qca/026-ath11k-add-peer-delete-synchro-with-firmware.patch deleted file mode 100644 index dc9b03ea5..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/026-ath11k-add-peer-delete-synchro-with-firmware.patch +++ /dev/null @@ -1,273 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -531,6 +531,7 @@ struct ath11k { - u8 lmac_id; - - struct completion peer_assoc_done; -+ struct completion peer_delete_done; - - int install_key_status; - struct completion install_key_done; ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -455,7 +455,7 @@ static u8 ath11k_mac_bitrate_to_rate(int - (ath11k_mac_bitrate_is_cck(bitrate) ? BIT(7) : 0); - } - --static void ath11k_get_arvif_iter(void *data, u8 *mac, -+static void ath11k_mac_get_arvif_iter(void *data, u8 *mac, - struct ieee80211_vif *vif) - { - struct ath11k_vif_iter *arvif_iter = data; -@@ -476,7 +476,7 @@ struct ath11k_vif *ath11k_mac_get_arvif( - flags = IEEE80211_IFACE_ITER_RESUME_ALL; - ieee80211_iterate_active_interfaces_atomic(ar->hw, - flags, -- ath11k_get_arvif_iter, -+ ath11k_mac_get_arvif_iter, - &arvif_iter); - if (!arvif_iter.arvif) { - ath11k_warn(ar->ab, "No VIF found for vdev %d\n", vdev_id); -@@ -578,6 +578,36 @@ struct ath11k *ath11k_mac_get_ar_vdev_st - return NULL; - } - -+struct ath11k *ath11k_mac_get_ar_peer_delete_status(struct ath11k_base *ab, u8 *peer_addr, -+ u32 vdev_id) -+{ -+ int i; -+ struct ath11k_pdev *pdev; -+ struct ath11k *ar; -+ struct ath11k_vif *arvif; -+ -+ for (i = 0; i < ab->num_radios; i++) { -+ pdev = rcu_dereference(ab->pdevs_active[i]); -+ if (pdev && pdev->ar) { -+ ar = pdev->ar; -+ -+ spin_lock_bh(&ar->data_lock); -+ if (ether_addr_equal(ar->mac_addr, peer_addr)) { -+ spin_unlock_bh(&ar->data_lock); -+ return ar; -+ } else { -+ arvif = ath11k_mac_get_arvif(pdev->ar, vdev_id); -+ if (arvif) { -+ spin_unlock_bh(&ar->data_lock); -+ return arvif->ar; -+ } -+ } -+ spin_unlock_bh(&ar->data_lock); -+ } -+ } -+ return NULL; -+} -+ - static void ath11k_pdev_caps_update(struct ath11k *ar) - { - struct ath11k_base *ab = ar->ab; -@@ -772,6 +802,28 @@ static int ath11k_monitor_vdev_up(struct - return 0; - } - -+int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, -+ const u8 *addr) -+{ -+ int ret; -+ unsigned long time_left; -+ -+ ret = ath11k_wait_for_peer_deleted(ar, vdev_id, addr); -+ if(ret) { -+ ath11k_warn(ar->ab, "failed wait for peer deleted"); -+ return ret; -+ } -+ -+ time_left = wait_for_completion_timeout(&ar->peer_delete_done, -+ 3 * HZ); -+ if(time_left == 0) { -+ ath11k_warn(ar->ab, "Timeout in receiving peer delete response\n"); -+ return -ETIMEDOUT; -+ } -+ -+ return 0; -+} -+ - static int ath11k_mac_op_config(struct ieee80211_hw *hw, u32 changed) - { - struct ath11k *ar = hw->priv; -@@ -4638,8 +4690,22 @@ static int ath11k_mac_op_add_interface(s - - err_peer_del: - if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { -+ reinit_completion(&ar->peer_delete_done); -+ -+ free_err = ath11k_wmi_send_peer_delete_cmd(ar, vif->addr, -+ arvif->vdev_id); -+ if (free_err) { -+ ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", -+ arvif->vdev_id, vif->addr); -+ goto err; -+ } -+ -+ free_err = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id, -+ vif->addr); -+ if (free_err) -+ goto err; -+ - ar->num_peers--; -- ath11k_wmi_send_peer_delete_cmd(ar, vif->addr, arvif->vdev_id); - } - - err_vdev_del: -@@ -6534,6 +6600,7 @@ int ath11k_mac_allocate(struct ath11k_ba - init_completion(&ar->vdev_setup_done); - init_completion(&ar->vdev_delete_done); - init_completion(&ar->peer_assoc_done); -+ init_completion(&ar->peer_delete_done); - init_completion(&ar->install_key_done); - init_completion(&ar->bss_survey_done); - init_completion(&ar->scan.started); ---- a/drivers/net/wireless/ath/ath11k/peer.c -+++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -172,17 +172,41 @@ void ath11k_peer_cleanup(struct ath11k * - spin_unlock_bh(&ab->base_lock); - } - --static int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr) -+int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr) - { - return ath11k_wait_for_peer_common(ar->ab, vdev_id, addr, false); - } - -+int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, -+ const u8 *addr) -+{ -+ int ret; -+ unsigned long time_left; -+ -+ ret = ath11k_wait_for_peer_deleted(ar, vdev_id, addr); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed wait for peer deleted"); -+ return ret; -+ } -+ -+ time_left = wait_for_completion_timeout(&ar->peer_delete_done, -+ 3 * HZ); -+ if (time_left == 0) { -+ ath11k_warn(ar->ab, "Timeout in receiving peer delete response\n"); -+ return -ETIMEDOUT; -+ } -+ -+ return 0; -+} -+ - int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr) - { - int ret; - - lockdep_assert_held(&ar->conf_mutex); - -+ reinit_completion(&ar->peer_delete_done); -+ - ret = ath11k_wmi_send_peer_delete_cmd(ar, addr, vdev_id); - if (ret) { - ath11k_warn(ar->ab, -@@ -191,7 +215,7 @@ int ath11k_peer_delete(struct ath11k *ar - return ret; - } - -- ret = ath11k_wait_for_peer_deleted(ar, vdev_id, addr); -+ ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr); - if (ret) - return ret; - -@@ -247,8 +271,22 @@ int ath11k_peer_create(struct ath11k *ar - spin_unlock_bh(&ar->ab->base_lock); - ath11k_warn(ar->ab, "failed to find peer %pM on vdev %i after creation\n", - param->peer_addr, param->vdev_id); -- ath11k_wmi_send_peer_delete_cmd(ar, param->peer_addr, -- param->vdev_id); -+ -+ reinit_completion(&ar->peer_delete_done); -+ -+ ret = ath11k_wmi_send_peer_delete_cmd(ar, param->peer_addr, -+ param->vdev_id); -+ if(ret) { -+ ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", -+ param->vdev_id, param->peer_addr); -+ return ret; -+ } -+ -+ ret = ath11k_wait_for_peer_delete_done(ar, param->vdev_id, -+ param->peer_addr); -+ if(ret) -+ return ret; -+ - return -ENOENT; - } - ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -5746,15 +5746,29 @@ static int ath11k_ready_event(struct ath - static void ath11k_peer_delete_resp_event(struct ath11k_base *ab, struct sk_buff *skb) - { - struct wmi_peer_delete_resp_event peer_del_resp; -+ struct ath11k *ar; - - if (ath11k_pull_peer_del_resp_ev(ab, skb, &peer_del_resp) != 0) { - ath11k_warn(ab, "failed to extract peer delete resp"); - return; - } - -- /* TODO: Do we need to validate whether ath11k_peer_find() return NULL -- * Why this is needed when there is HTT event for peer delete -- */ -+ rcu_read_lock(); -+ ar = ath11k_mac_get_ar_by_vdev_id(ab, peer_del_resp.vdev_id); -+ if (!ar) { -+ ath11k_warn(ab, "invalid vdev id in peer delete resp ev %d", -+ peer_del_resp.vdev_id); -+ rcu_read_unlock(); -+ return; -+ } -+ -+ complete(&ar->peer_delete_done); -+ -+ rcu_read_unlock(); -+ -+ ath11k_dbg(ab, ATH11K_DBG_WMI, "peer delete resp for vdev id %d addr %pM\n", -+ peer_del_resp.vdev_id, peer_del_resp.peer_macaddr.addr); -+ - } - - static void ath11k_vdev_delete_resp_event(struct ath11k_base *ab, struct sk_buff *skb) ---- a/drivers/net/wireless/ath/ath11k/mac.h -+++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -147,6 +147,8 @@ void ath11k_mac_drain_tx(struct ath11k * - void ath11k_mac_peer_cleanup_all(struct ath11k *ar); - int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); - u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); -+struct ath11k *ath11k_mac_get_ar_peer_delete_status(struct ath11k_base *ab, u8 *peer_addr, -+ u32 vdev_id); - enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); - enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); - #endif ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -710,6 +710,7 @@ static void ath11k_core_restart(struct w - complete(&ar->scan.started); - complete(&ar->scan.completed); - complete(&ar->peer_assoc_done); -+ complete(&ar->peer_delete_done); - complete(&ar->install_key_done); - complete(&ar->vdev_setup_done); - complete(&ar->vdev_delete_done); ---- a/drivers/net/wireless/ath/ath11k/peer.h -+++ b/drivers/net/wireless/ath/ath11k/peer.h -@@ -41,5 +41,7 @@ void ath11k_peer_cleanup(struct ath11k * - int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr); - int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, - struct ieee80211_sta *sta, struct peer_create_params *param); -+int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr); -+int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, const u8 *addr); - - #endif /* _PEER_H_ */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/030-ath11k-fix-co-exist-monitor-mode-can-t-capture-data-.patch b/feeds/wifi-ax/mac80211/patches/qca/030-ath11k-fix-co-exist-monitor-mode-can-t-capture-data-.patch index d9c015978..da96ca6aa 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/030-ath11k-fix-co-exist-monitor-mode-can-t-capture-data-.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/030-ath11k-fix-co-exist-monitor-mode-can-t-capture-data-.patch @@ -17,7 +17,7 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -183,7 +183,7 @@ enum ath11k_dev_flags { +@@ -194,7 +194,7 @@ enum ath11k_dev_flags { }; enum ath11k_monitor_flags { @@ -26,7 +26,7 @@ Signed-off-by: Miles Hu }; struct ath11k_vif { -@@ -580,6 +580,7 @@ struct ath11k { +@@ -586,6 +586,7 @@ struct ath11k { struct ath11k_per_peer_tx_stats cached_stats; u32 last_ppdu_id; u32 cached_ppdu_id; @@ -36,7 +36,7 @@ Signed-off-by: Miles Hu #ifdef CPTCFG_ATH11K_DEBUGFS --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -4969,7 +4969,7 @@ int ath11k_dp_rx_process_mon_rings(struc +@@ -5009,7 +5009,7 @@ int ath11k_dp_rx_process_mon_rings(struc struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); int ret = 0; @@ -47,37 +47,15 @@ Signed-off-by: Miles Hu ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -572,6 +572,10 @@ struct ath11k *ath11k_mac_get_ar_vdev_st - spin_unlock_bh(&ar->data_lock); - return ar; - } -+ if (pdev->ar->monitor_vdev_id == vdev_id) { -+ spin_unlock_bh(&ar->data_lock); -+ return pdev->ar; -+ } - spin_unlock_bh(&ar->data_lock); - } - } -@@ -601,6 +605,10 @@ struct ath11k *ath11k_mac_get_ar_peer_de - spin_unlock_bh(&ar->data_lock); - return arvif->ar; - } -+ if (pdev->ar->monitor_vdev_id == vdev_id) { -+ spin_unlock_bh(&ar->data_lock); -+ return pdev->ar; -+ } - } - spin_unlock_bh(&ar->data_lock); - } -@@ -786,22 +794,265 @@ void ath11k_mac_peer_cleanup_all(struct +@@ -720,28 +720,298 @@ void ath11k_mac_peer_cleanup_all(struct ar->num_stations = 0; } -static int ath11k_monitor_vdev_up(struct ath11k *ar, int vdev_id) +static void +ath11k_mac_get_any_chandef_iter(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *conf, -+ void *data) ++ struct ieee80211_chanctx_conf *conf, ++ void *data) +{ + struct cfg80211_chan_def **def = data; + @@ -85,95 +63,96 @@ Signed-off-by: Miles Hu +} + +static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) -+{ -+ struct cfg80211_chan_def *chandef = NULL; -+ struct ieee80211_channel *channel = NULL; -+ struct wmi_vdev_start_req_arg arg = {}; -+ int ret = 0; + { ++ struct cfg80211_chan_def *chandef = NULL; ++ struct ieee80211_channel *channel = NULL; ++ struct wmi_vdev_start_req_arg arg = {}; ++ int ret = 0; + -+ lockdep_assert_held(&ar->conf_mutex); ++ lockdep_assert_held(&ar->conf_mutex); + -+ ieee80211_iter_chan_contexts_atomic(ar->hw, -+ ath11k_mac_get_any_chandef_iter, -+ &chandef); -+ if (WARN_ON_ONCE(!chandef)) -+ return -ENOENT; -+ channel = chandef->chan; -+ arg.vdev_id = vdev_id; -+ arg.channel.freq = channel->center_freq; -+ arg.channel.band_center_freq1 = chandef->center_freq1; -+ arg.channel.band_center_freq2 = chandef->center_freq2; -+ arg.channel.mode = ath11k_phymodes[chandef->chan->band][chandef->width]; -+ arg.channel.chan_radar = -+ !!(channel->flags & IEEE80211_CHAN_RADAR); ++ ieee80211_iter_chan_contexts_atomic(ar->hw, ++ ath11k_mac_get_any_chandef_iter, ++ &chandef); + -+ arg.channel.min_power = 0; -+ arg.channel.max_power = channel->max_power * 2; -+ arg.channel.max_reg_power = channel->max_reg_power * 2; -+ arg.channel.max_antenna_gain = channel->max_antenna_gain * 2; ++ if (WARN_ON_ONCE(!chandef)) ++ return -ENOENT; ++ channel = chandef->chan; ++ arg.vdev_id = vdev_id; ++ arg.channel.freq = channel->center_freq; ++ arg.channel.band_center_freq1 = chandef->center_freq1; ++ arg.channel.band_center_freq2 = chandef->center_freq2; ++ arg.channel.mode = ath11k_phymodes[chandef->chan->band][chandef->width]; ++ arg.channel.chan_radar = ++ !!(channel->flags & IEEE80211_CHAN_RADAR); + -+ arg.pref_tx_streams = ar->num_tx_chains; -+ arg.pref_rx_streams = ar->num_rx_chains; ++ arg.channel.min_power = 0; ++ arg.channel.max_power = channel->max_power * 2; ++ arg.channel.max_reg_power = channel->max_reg_power * 2; ++ arg.channel.max_antenna_gain = channel->max_antenna_gain * 2; + -+ arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); ++ arg.pref_tx_streams = ar->num_tx_chains; ++ arg.pref_rx_streams = ar->num_rx_chains; + -+ reinit_completion(&ar->vdev_setup_done); -+ reinit_completion(&ar->vdev_delete_done); ++ arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); + -+ ret = ath11k_wmi_vdev_start(ar, &arg, false); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to request monitor vdev %i start: %d\n", -+ vdev_id, ret); -+ return ret; -+ } -+ ret = ath11k_mac_vdev_setup_sync(ar); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to synchronize setup for monitor vdev %i start: %d\n", -+ vdev_id, ret); -+ return ret; -+ } -+ ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", -+ vdev_id, ret); -+ goto vdev_stop; -+ } -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %i started\n", -+ vdev_id); -+ return 0; ++ reinit_completion(&ar->vdev_setup_done); ++ reinit_completion(&ar->vdev_delete_done); ++ ++ ret = ath11k_wmi_vdev_start(ar, &arg, false); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to request monitor vdev %i start: %d\n", ++ vdev_id, ret); ++ return ret; ++ } ++ ++ ret = ath11k_mac_vdev_setup_sync(ar); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to synchronize setup for monitor vdev %i start: %d\n", ++ vdev_id, ret); ++ return ret; ++ } ++ ++ + int ret = 0; + + ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); + if (ret) { + ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", + vdev_id, ret); +- return ret; ++ goto vdev_stop; + } + + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %i started\n", + vdev_id); + return 0; + +vdev_stop: -+ ret = ath11k_wmi_vdev_stop(ar, vdev_id); -+ if (ret) -+ ath11k_warn(ar->ab, "failed to stop monitor vdev %i after start failure: %d\n", -+ vdev_id, ret); -+ return ret; ++ ret = ath11k_wmi_vdev_stop(ar, vdev_id); ++ if (ret) ++ ath11k_warn(ar->ab, "failed to stop monitor vdev %i after start failure: %d\n", ++ vdev_id, ret); ++ return ret; +} + +static int ath11k_mac_monitor_vdev_stop(struct ath11k *ar) - { - int ret = 0; - -- ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); -- if (ret) { -- ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", -- vdev_id, ret); -- return ret; -- } ++{ ++ int ret = 0; ++ + lockdep_assert_held(&ar->conf_mutex); + reinit_completion(&ar->vdev_setup_done); - -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %i started\n", -- vdev_id); -- return 0; ++ + ret = ath11k_wmi_vdev_stop(ar, ar->monitor_vdev_id); + if (ret) + ath11k_warn(ar->ab, "failed to to request monitor vdev %i stop: %d\n", + ar->monitor_vdev_id, ret); ++ + ret = ath11k_mac_vdev_setup_sync(ar); + if (ret) + ath11k_warn(ar->ab, "failed to synchronize monitor vdev %i stop: %d\n", + ar->monitor_vdev_id, ret); ++ + ret = ath11k_wmi_vdev_down(ar, ar->monitor_vdev_id); + if (ret) + ath11k_warn(ar->ab, "failed to put down monitor vdev %i: %d\n", @@ -186,184 +165,190 @@ Signed-off-by: Miles Hu + +static int ath11k_mac_monitor_vdev_create(struct ath11k *ar) +{ -+ struct ath11k_pdev *pdev = ar->pdev; -+ struct vdev_create_params param; -+ int bit, ret = 0; -+ u8 tmp_addr[6] = {0}; -+ u16 nss = 0; -+ lockdep_assert_held(&ar->conf_mutex); -+ memset(¶m, 0, sizeof(param)); -+ if (ar->ab->free_vdev_map == 0) { -+ ath11k_warn(ar->ab, "failed to find free vdev id for monitor vdev\n"); -+ return -ENOMEM; -+ } ++ struct ath11k_pdev *pdev = ar->pdev; ++ struct vdev_create_params param; ++ int bit, ret = 0; ++ u8 tmp_addr[6] = {0}; ++ u16 nss = 0; + -+ bit = __ffs64(ar->ab->free_vdev_map); ++ lockdep_assert_held(&ar->conf_mutex); ++ memset(¶m, 0, sizeof(param)); + -+ ar->monitor_vdev_id = bit; ++ if (ar->ab->free_vdev_map == 0) { ++ ath11k_warn(ar->ab, "failed to find free vdev id for monitor vdev\n"); ++ return -ENOMEM; ++ } + -+ param.if_id = ar->monitor_vdev_id; -+ param.type = WMI_VDEV_TYPE_MONITOR; -+ param.subtype = WMI_VDEV_SUBTYPE_NONE; -+ param.pdev_id = pdev->pdev_id; ++ bit = __ffs64(ar->ab->free_vdev_map); + -+ if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { -+ param.chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; -+ param.chains[NL80211_BAND_2GHZ].rx = ar->num_rx_chains; -+ } -+ if (pdev->cap.supported_bands & WMI_HOST_WLAN_5G_CAP) { -+ param.chains[NL80211_BAND_5GHZ].tx = ar->num_tx_chains; -+ param.chains[NL80211_BAND_5GHZ].rx = ar->num_rx_chains; -+ } -+ ret = ath11k_wmi_vdev_create(ar, tmp_addr, ¶m); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to request monitor vdev %i creation: %d\n", -+ ar->monitor_vdev_id, ret); -+ ar->monitor_vdev_id = -1; -+ return ret; -+ } ++ ar->monitor_vdev_id = bit; + -+ nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1; -+ ret = ath11k_wmi_vdev_set_param_cmd(ar, ar->monitor_vdev_id, -+ WMI_VDEV_PARAM_NSS, nss); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to set vdev %d chainmask 0x%x, nss %d :%d\n", -+ ar->monitor_vdev_id, ar->cfg_tx_chainmask, nss, ret); -+ return ret; -+ } ++ param.if_id = ar->monitor_vdev_id; ++ param.type = WMI_VDEV_TYPE_MONITOR; ++ param.subtype = WMI_VDEV_SUBTYPE_NONE; ++ param.pdev_id = pdev->pdev_id; + -+ ret = ath11k_mac_txpower_recalc(ar); -+ if (ret) -+ return ret; ++ if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { ++ param.chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; ++ param.chains[NL80211_BAND_2GHZ].rx = ar->num_rx_chains; ++ } + -+ ar->ab->free_vdev_map &= ~(1LL << ar->monitor_vdev_id); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d created\n", -+ ar->monitor_vdev_id); ++ if (pdev->cap.supported_bands & WMI_HOST_WLAN_5G_CAP) { ++ param.chains[NL80211_BAND_5GHZ].tx = ar->num_tx_chains; ++ param.chains[NL80211_BAND_5GHZ].rx = ar->num_rx_chains; ++ } ++ ++ ret = ath11k_wmi_vdev_create(ar, tmp_addr, ¶m); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to request monitor vdev %i creation: %d\n", ++ ar->monitor_vdev_id, ret); ++ ar->monitor_vdev_id = -1; ++ return ret; ++ } ++ ++ nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1; ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, ar->monitor_vdev_id, ++ WMI_VDEV_PARAM_NSS, nss); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to set vdev %d chainmask 0x%x, nss %d :%d\n", ++ ar->monitor_vdev_id, ar->cfg_tx_chainmask, nss, ret); ++ return ret; ++ } ++ ++ ret = ath11k_mac_txpower_recalc(ar); ++ if (ret) ++ return ret; ++ ++ ar->ab->free_vdev_map &= ~(1LL << ar->monitor_vdev_id); ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d created\n", ++ ar->monitor_vdev_id); ++ ++ return 0; ++} + -+ return 0; - } - +static int ath11k_mac_monitor_vdev_delete(struct ath11k *ar) +{ -+ int ret = 0; -+ unsigned long time_left = 0; ++ int ret = 0; ++ unsigned long time_left = 0; + lockdep_assert_held(&ar->conf_mutex); + -+ reinit_completion(&ar->vdev_delete_done); ++ reinit_completion(&ar->vdev_delete_done); + -+ ret = ath11k_wmi_vdev_delete(ar, ar->monitor_vdev_id); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to request wmi monitor vdev %i removal: %d\n", -+ ar->monitor_vdev_id, ret); -+ return ret; -+ } -+ time_left = wait_for_completion_timeout(&ar->vdev_delete_done, -+ ATH11K_VDEV_DELETE_TIMEOUT_HZ); -+ if (time_left == 0) { -+ ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); -+ ar->vdev_stop_delete_status.delete_in_progress = false; -+ } else { -+ ar->ab->free_vdev_map |= 1LL << (ar->monitor_vdev_id); -+ ar->num_created_vdevs--; -+ ar->monitor_vdev_id = -1; -+ } ++ ret = ath11k_wmi_vdev_delete(ar, ar->monitor_vdev_id); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to request wmi monitor vdev %i removal: %d\n", ++ ar->monitor_vdev_id, ret); ++ return ret; ++ } + -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d deleted\n", -+ ar->monitor_vdev_id); -+ return ret; ++ time_left = wait_for_completion_timeout(&ar->vdev_delete_done, ++ ATH11K_VDEV_DELETE_TIMEOUT_HZ); ++ if (time_left == 0) { ++ ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); ++ } else { ++ ar->ab->free_vdev_map |= 1LL << (ar->monitor_vdev_id); ++ ar->num_created_vdevs--; ++ ar->monitor_vdev_id = -1; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d deleted\n", ++ ar->monitor_vdev_id); ++ ++ return ret; +} + +static int ath11k_mac_monitor_start(struct ath11k *ar) +{ -+ int ret; ++ int ret; + -+ lockdep_assert_held(&ar->conf_mutex); ++ lockdep_assert_held(&ar->conf_mutex); + -+ if (test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) -+ goto set_monitor_status; ++ if (test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) ++ goto set_monitor_status; + -+ ret = ath11k_mac_monitor_vdev_create(ar); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to create monitor vdev: %d\n", ret); -+ ar->monitor_vdev_id = -1; -+ return ret; -+ } -+ ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); -+ ath11k_mac_monitor_vdev_delete(ar); -+ return ret; -+ } ++ ret = ath11k_mac_monitor_vdev_create(ar); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to create monitor vdev: %d\n", ret); ++ ar->monitor_vdev_id = -1; ++ return ret; ++ } + -+ set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); ++ ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); ++ ath11k_mac_monitor_vdev_delete(ar); ++ return ret; ++ } ++ ++ set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); +set_monitor_status: -+ ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor started ret %d\n", ret); ++ ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor started ret %d\n", ret); + -+ return ret; ++ return ret; +} + +static int ath11k_mac_monitor_stop(struct ath11k *ar) +{ -+ int ret; ++ int ret; + -+ lockdep_assert_held(&ar->conf_mutex); ++ lockdep_assert_held(&ar->conf_mutex); + -+ if (!test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) -+ goto clear_monitor_status; ++ if (!test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) ++ goto clear_monitor_status; + -+ ret = ath11k_mac_monitor_vdev_stop(ar); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to stop monitor vdev: %d\n", ret); -+ return ret; -+ } -+ ret = ath11k_mac_monitor_vdev_delete(ar); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to delete monitor vdev: %d\n", ret); -+ return ret; -+ } -+ clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); ++ ret = ath11k_mac_monitor_vdev_stop(ar); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to stop monitor vdev: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ath11k_mac_monitor_vdev_delete(ar); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to delete monitor vdev: %d\n", ret); ++ return ret; ++ } ++ ++ clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); +clear_monitor_status: -+ ret = ath11k_mac_config_mon_status_default(ar, true); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); ++ ret = ath11k_mac_config_mon_status_default(ar, true); ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); + -+ return ret; ++ return ret; +} + +int ath11k_mac_monitor_recalc(struct ath11k *ar, bool needed) +{ -+ bool started = test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); ++ bool started = test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + -+ lockdep_assert_held(&ar->conf_mutex); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, -+ "mac monitor recalc started? %d needed? %d\n", started, needed); -+ if (needed) -+ return ath11k_mac_monitor_start(ar); -+ else -+ return ath11k_mac_monitor_stop(ar); -+} - int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, - const u8 *addr) - { -@@ -827,6 +1078,7 @@ int ath11k_wait_for_peer_delete_done(str ++ lockdep_assert_held(&ar->conf_mutex); ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, ++ "mac monitor recalc started? %d needed? %d\n", started, needed); ++ ++ if (needed) ++ return ath11k_mac_monitor_start(ar); ++ else ++ return ath11k_mac_monitor_stop(ar); + } + static int ath11k_mac_op_config(struct ieee80211_hw *hw, u32 changed) { - struct ath11k *ar = hw->priv; ++ struct ath11k *ar = hw->priv; + struct ieee80211_conf *conf = &hw->conf; - int ret = 0; - /* mac80211 requires this op to be present and that's why -@@ -836,7 +1088,8 @@ static int ath11k_mac_op_config(struct i - - mutex_lock(&ar->conf_mutex); - -- /* TODO: Handle configuration changes as appropriate */ + * there's an empty function, this can be extended when + * required. + */ ++ mutex_lock(&ar->conf_mutex); ++ + if (changed & IEEE80211_CONF_CHANGE_MONITOR) + ath11k_mac_monitor_recalc(ar, conf->flags & IEEE80211_CONF_MONITOR); ++ ++ mutex_unlock(&ar->conf_mutex); - mutex_unlock(&ar->conf_mutex); - -@@ -4660,6 +4913,9 @@ static int ath11k_mac_op_add_interface(s + return 0; + } +@@ -4792,6 +5062,9 @@ static int ath11k_mac_op_add_interface(s goto err_peer_del; } break; @@ -373,7 +358,7 @@ Signed-off-by: Miles Hu default: break; } -@@ -4760,6 +5016,9 @@ static void ath11k_mac_op_remove_interfa +@@ -4911,6 +5184,9 @@ static void ath11k_mac_op_remove_interfa ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", vif->addr, arvif->vdev_id); @@ -383,7 +368,7 @@ Signed-off-by: Miles Hu err_vdev_del: spin_lock_bh(&ar->data_lock); list_del(&arvif->list); -@@ -4780,7 +5039,6 @@ err_vdev_del: +@@ -4931,7 +5207,6 @@ err_vdev_del: /* Recalc txpower for remaining vdev */ ath11k_mac_txpower_recalc(ar); ath11k_mac_ap_ps_recalc(ar); @@ -391,7 +376,7 @@ Signed-off-by: Miles Hu /* TODO: recal traffic pause state based on the available vdevs */ -@@ -4803,8 +5061,6 @@ static void ath11k_mac_op_configure_filt +@@ -4954,8 +5229,6 @@ static void ath11k_mac_op_configure_filt u64 multicast) { struct ath11k *ar = hw->priv; @@ -400,7 +385,7 @@ Signed-off-by: Miles Hu mutex_lock(&ar->conf_mutex); -@@ -4812,19 +5068,6 @@ static void ath11k_mac_op_configure_filt +@@ -4963,22 +5236,9 @@ static void ath11k_mac_op_configure_filt *total_flags &= SUPPORTED_FILTERS; ar->filter_flags = *total_flags; @@ -417,10 +402,15 @@ Signed-off-by: Miles Hu - ath11k_warn(ar->ab, - "fail to set monitor filter: %d\n", ret); - } + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +- "changed_flags:0x%x, total_flags:0x%x, reset_flag:%d\n", +- changed_flags, *total_flags, reset_flag); ++ "changed_flags:0x%x, total_flags:0x%x\n", ++ changed_flags, *total_flags); + mutex_unlock(&ar->conf_mutex); } - -@@ -5310,7 +5553,7 @@ static int ath11k_start_vdev_delay(struc +@@ -5454,7 +5714,7 @@ static int ath11k_start_vdev_delay(struc } if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { @@ -429,28 +419,19 @@ Signed-off-by: Miles Hu if (ret) { ath11k_warn(ab, "failed put monitor up: %d\n", ret); return ret; -@@ -5331,7 +5574,7 @@ ath11k_mac_op_assign_vif_chanctx(struct - struct ath11k *ar = hw->priv; - struct ath11k_base *ab = ar->ab; - struct ath11k_vif *arvif = (void *)vif->drv_priv; -- int ret; -+ int ret = 0; - - mutex_lock(&ar->conf_mutex); - -@@ -5359,9 +5602,10 @@ ath11k_mac_op_assign_vif_chanctx(struct - goto err; +@@ -5522,9 +5782,10 @@ ath11k_mac_op_assign_vif_chanctx(struct + goto out; } if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { - ret = ath11k_monitor_vdev_up(ar, arvif->vdev_id); + ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr); if (ret) - goto err; + goto out; + set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); } arvif->is_started = true; -@@ -5386,7 +5630,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc +@@ -5547,7 +5808,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc struct ath11k *ar = hw->priv; struct ath11k_base *ab = ar->ab; struct ath11k_vif *arvif = (void *)vif->drv_priv; @@ -459,9 +440,9 @@ Signed-off-by: Miles Hu mutex_lock(&ar->conf_mutex); -@@ -5396,6 +5640,15 @@ ath11k_mac_op_unassign_vif_chanctx(struc - - WARN_ON(!arvif->is_started); +@@ -5562,6 +5823,15 @@ ath11k_mac_op_unassign_vif_chanctx(struc + ath11k_peer_find_by_addr(ab, ar->mac_addr)) + ath11k_peer_delete(ar, arvif->vdev_id, ar->mac_addr); + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { + ret = ath11k_wmi_vdev_down(ar, arvif->vdev_id); @@ -475,7 +456,7 @@ Signed-off-by: Miles Hu ret = ath11k_mac_vdev_stop(arvif); if (ret) ath11k_warn(ab, "failed to stop vdev %i: %d\n", -@@ -6612,7 +6865,8 @@ int ath11k_mac_allocate(struct ath11k_ba +@@ -6829,7 +7099,8 @@ int ath11k_mac_allocate(struct ath11k_ba INIT_WORK(&ar->wmi_mgmt_tx_work, ath11k_mgmt_over_wmi_tx_work); skb_queue_head_init(&ar->wmi_mgmt_tx_queue); diff --git a/feeds/wifi-ax/mac80211/patches/qca/031-ath11k-print-stats-on-crash.patch b/feeds/wifi-ax/mac80211/patches/qca/031-ath11k-print-stats-on-crash.patch index e0fc18eb9..c772017d4 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/031-ath11k-print-stats-on-crash.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/031-ath11k-print-stats-on-crash.patch @@ -1,11 +1,18 @@ --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -570,6 +570,51 @@ err_firmware_stop: +@@ -30,6 +30,8 @@ module_param_named(frame_mode, ath11k_fr + MODULE_PARM_DESC(frame_mode, + "Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)"); + ++struct ath11k_base *ath11k_soc; ++ + static const struct ath11k_hw_params ath11k_hw_params[] = { + { + .hw_rev = ATH11K_HW_IPQ8074, +@@ -803,6 +805,62 @@ err_firmware_stop: return ret; } -+#ifdef CONFIG_QCOM_QMI_HELPERS -+ +void ath11k_core_dump_bp_stats(struct ath11k_base *ab) +{ + int len = 0; @@ -16,7 +23,7 @@ + if (!buf) + return; + -+ len = ath11k_debug_dump_soc_ring_bp_stats(ab, buf, size - 1); ++ len = ath11k_debugfs_dump_soc_ring_bp_stats(ab, buf, size - 1); + + buf[len] = '\0'; + @@ -25,18 +32,31 @@ + kfree(buf); +} + ++#ifdef CONFIG_QCOM_QMI_HELPERS ++ +/* Print the driver stats and crash the system on receving this notification */ +int ath11k_core_ssr_notifier_cb(struct notifier_block *nb, unsigned long event, + void *data) +{ + struct ath11k_qmi *qmi = container_of(nb, struct ath11k_qmi, ssr_nb); ++ struct ath11k_base *ab = qmi->ab; ++ struct device *dev = ab->dev; ++ bool multi_pd_arch = false; ++ const char *name; + + if (test_bit(ATH11K_FLAG_FW_RESTART_FOR_HOST, &qmi->ab->dev_flags)) { + return 0; + } -+ /* TODO: currently wcss uses "rproc" as its name, but since this might be -+ * changed to correspondig name, the name is not compared now. Print the stats -+ * only if the notification is received for the expected rproc */ ++ ++ /* Print the stats only if notification is received for expected PD*/ ++ multi_pd_arch = of_property_read_bool(dev->of_node, "qcom,multipd_arch"); ++ if (multi_pd_arch) { ++ if (of_property_read_string(dev->of_node, "qcom,userpd-subsys-name", &name)) ++ return 0; ++ ++ if (strcmp((char*)data, name) != 0) ++ return 0; ++ } + + ath11k_core_dump_bp_stats(qmi->ab); + ath11k_hal_dump_srng_stats(qmi->ab); @@ -52,7 +72,7 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab) { int ret; -@@ -615,6 +660,16 @@ int ath11k_core_qmi_firmware_ready(struc +@@ -848,6 +906,16 @@ int ath11k_core_qmi_firmware_ready(struc ath11k_err(ab, "failed to create pdev core: %d\n", ret); goto err_core_stop; } @@ -69,7 +89,7 @@ ath11k_hif_irq_enable(ab); mutex_unlock(&ab->core_lock); -@@ -864,6 +919,13 @@ void ath11k_core_deinit(struct ath11k_ba +@@ -1061,6 +1129,13 @@ void ath11k_core_deinit(struct ath11k_ba { mutex_lock(&ab->core_lock); @@ -83,41 +103,51 @@ ath11k_core_pdev_destroy(ab); ath11k_core_stop(ab); ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -803,7 +803,7 @@ static int ath11k_fill_bp_stats(struct a +@@ -1109,6 +1184,7 @@ struct ath11k_base *ath11k_core_alloc(st + ab->dev = dev; + ab->bus_params = *bus_params; + ab->hif.bus = bus; ++ ath11k_soc = ab; + + return ab; + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -706,8 +706,8 @@ static int ath11k_fill_bp_stats(struct a return len; } --static ssize_t ath11k_debug_dump_soc_ring_bp_stats(struct ath11k_base *ab, -+ssize_t ath11k_debug_dump_soc_ring_bp_stats(struct ath11k_base *ab, - char *buf, int size) +-static ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, +- char *buf, int size) ++ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, ++ char *buf, int size) { struct ath11k_bp_stats *bp_stats; ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -166,7 +166,8 @@ void ath11k_debug_fw_stats_process(struc + bool stats_rxd = false; +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -113,6 +113,8 @@ void ath11k_debugfs_unregister(struct at + void ath11k_debugfs_fw_stats_process(struct ath11k_base *ab, struct sk_buff *skb); - void ath11k_debug_fw_stats_init(struct ath11k *ar); - int ath11k_dbg_htt_stats_req(struct ath11k *ar); -- -+ssize_t ath11k_debug_dump_soc_ring_bp_stats(struct ath11k_base *ab, + void ath11k_debugfs_fw_stats_init(struct ath11k *ar); ++ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, + char *buf, int size); - static inline bool ath11k_debug_is_pktlog_lite_mode_enabled(struct ath11k *ar) - { - return (ar->debug.pktlog_mode == ATH11K_PKTLOG_MODE_LITE); -@@ -297,6 +298,11 @@ ath11k_update_per_peer_stats_from_txcomp - struct hal_tx_status *ts) + + static inline bool ath11k_debugfs_is_pktlog_lite_mode_enabled(struct ath11k *ar) { +@@ -146,6 +148,12 @@ static inline int ath11k_debugfs_rx_filt } -+ssize_t ath11k_debug_dump_soc_ring_bp_stats(struct ath11k_base *ab, -+ char *buf, int size) + + #else ++ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, ++ char *buf, int size) +{ + return 0; +} - - #endif /* CPTCFG_MAC80211_DEBUGFS*/ - ++ + static inline int ath11k_debugfs_soc_create(struct ath11k_base *ab) + { + return 0; --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h @@ -7,7 +7,9 @@ @@ -130,7 +160,7 @@ #define ATH11K_HOST_VERSION_STRING "WIN" #define ATH11K_QMI_WLANFW_TIMEOUT_MS 5000 -@@ -118,6 +120,7 @@ struct ath11k_qmi { +@@ -123,6 +125,7 @@ struct ath11k_qmi { struct workqueue_struct *event_wq; struct list_head event_list; spinlock_t event_lock; /* spinlock for qmi event list */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/033-ath11k-fix-for-peer-memory-corruption.patch b/feeds/wifi-ax/mac80211/patches/qca/033-ath11k-fix-for-peer-memory-corruption.patch index bfcc7a8d0..1da83065b 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/033-ath11k-fix-for-peer-memory-corruption.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/033-ath11k-fix-for-peer-memory-corruption.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1463,11 +1463,9 @@ struct htt_ppdu_stats_info *ath11k_dp_ht +@@ -1494,11 +1494,9 @@ struct htt_ppdu_stats_info *ath11k_dp_ht { struct htt_ppdu_stats_info *ppdu_info; @@ -12,14 +12,13 @@ return ppdu_info; } } -@@ -1481,16 +1479,13 @@ struct htt_ppdu_stats_info *ath11k_dp_ht +@@ -1512,16 +1510,13 @@ struct htt_ppdu_stats_info *ath11k_dp_ht kfree(ppdu_info); } } - spin_unlock_bh(&ar->data_lock); -- ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_KERNEL); -+ ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_ATOMIC); + ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_ATOMIC); if (!ppdu_info) return NULL; @@ -30,7 +29,7 @@ return ppdu_info; } -@@ -1522,8 +1517,10 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1553,8 +1548,10 @@ static int ath11k_htt_pull_ppdu_stats(st ath11k_htt_ppdu_pktlog_process(ar, (u8 *)skb->data, DP_RX_BUFFER_SIZE); } @@ -41,7 +40,7 @@ ret = -EINVAL; goto exit; } -@@ -1533,10 +1530,12 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1564,10 +1561,12 @@ static int ath11k_htt_pull_ppdu_stats(st ath11k_htt_tlv_ppdu_stats_parse, (void *)ppdu_info); if (ret) { @@ -56,7 +55,7 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2755,22 +2755,28 @@ static int ath11k_clear_peer_keys(struct +@@ -2912,22 +2912,28 @@ static int ath11k_clear_peer_keys(struct int ret; int i; u32 flags = 0; @@ -91,7 +90,7 @@ DISABLE_KEY, addr, flags); if (ret < 0 && first_errno == 0) first_errno = ret; -@@ -2778,10 +2784,6 @@ static int ath11k_clear_peer_keys(struct +@@ -2935,10 +2941,6 @@ static int ath11k_clear_peer_keys(struct if (ret < 0) ath11k_warn(ab, "failed to remove peer key %d: %d\n", i, ret); diff --git a/feeds/wifi-ax/mac80211/patches/qca/034-ath11k-fix-len-warnings.patch b/feeds/wifi-ax/mac80211/patches/qca/034-ath11k-fix-len-warnings.patch deleted file mode 100644 index 4a08e3db7..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/034-ath11k-fix-len-warnings.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2446,25 +2446,19 @@ static int ath11k_dp_rx_process_msdu(str - rxcb->rx_desc = rx_desc; - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); - l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(lrx_desc); -- if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { -- ath11k_warn(ar->ab, "invalid msdu len %u\n", msdu_len); -- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rxcb->rx_desc, -- sizeof(struct hal_rx_desc)); -- ath11k_dp_dump_msdu_info(ar, rxcb->rx_desc, rxcb); -- goto free_out; -- } - - if (rxcb->is_frag) { - skb_pull(msdu, HAL_RX_DESC_SIZE); - } else if (!rxcb->is_continuation) { -- if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { -+ if ((msdu_len + l3_pad_bytes + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { - hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); -- ret = -EINVAL; - ath11k_warn(ar->ab, "invalid msdu len %u\n", msdu_len); - ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, - sizeof(struct ieee80211_hdr)); -- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, -+ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", -+ rxcb->rx_desc, - sizeof(struct hal_rx_desc)); -+ ath11k_dp_dump_msdu_info(ar, rxcb->rx_desc, rxcb); - goto free_out; - } - skb_put(msdu, HAL_RX_DESC_SIZE + l3_pad_bytes + msdu_len); diff --git a/feeds/wifi-ax/mac80211/patches/qca/035-ath11k-load-appropriate-board-data-from-board-id.patch b/feeds/wifi-ax/mac80211/patches/qca/035-ath11k-load-appropriate-board-data-from-board-id.patch index 425960143..21ab38852 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/035-ath11k-load-appropriate-board-data-from-board-id.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/035-ath11k-load-appropriate-board-data-from-board-id.patch @@ -17,7 +17,7 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -1805,10 +1805,12 @@ static int ath11k_qmi_assign_target_mem_ +@@ -1829,9 +1829,11 @@ static int ath11k_qmi_assign_target_mem_ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) { @@ -25,12 +25,11 @@ Signed-off-by: Lavanya Suresh struct qmi_wlanfw_cap_req_msg_v01 req; struct qmi_wlanfw_cap_resp_msg_v01 resp; struct qmi_txn txn = {}; - int ret = 0; + unsigned int board_id; + int ret = 0; + int r; - memset(&req, 0, sizeof(req)); - memset(&resp, 0, sizeof(resp)); -@@ -1846,10 +1848,13 @@ static int ath11k_qmi_request_target_cap +@@ -1871,10 +1873,13 @@ static int ath11k_qmi_request_target_cap ab->qmi.target.chip_family = resp.chip_info.chip_family; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/036-nl80211-add-wide-band-scan-support.patch b/feeds/wifi-ax/mac80211/patches/qca/036-nl80211-add-wide-band-scan-support.patch index 57ac27b6a..fb42095d4 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/036-nl80211-add-wide-band-scan-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/036-nl80211-add-wide-band-scan-support.patch @@ -1,6 +1,6 @@ --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -2047,6 +2047,7 @@ struct cfg80211_scan_info { +@@ -2191,6 +2191,7 @@ struct cfg80211_scan_6ghz_params { * @channels: channels to scan on. * @n_channels: total number of channels to scan * @scan_width: channel width for scanning @@ -8,7 +8,7 @@ * @ie: optional information element(s) to add into Probe Request or %NULL * @ie_len: length of ie in octets * @duration: how long to listen on each channel, in TUs. If -@@ -2073,6 +2074,7 @@ struct cfg80211_scan_request { +@@ -2221,6 +2222,7 @@ struct cfg80211_scan_request { int n_ssids; u32 n_channels; enum nl80211_bss_scan_width scan_width; @@ -18,9 +18,9 @@ u16 duration; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -5821,6 +5821,9 @@ enum nl80211_feature_flags { - * handshake with PSK in AP mode (PSK is passed as part of the start AP - * command). +@@ -5937,6 +5937,9 @@ enum nl80211_feature_flags { + * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate + * configuration (AP/mesh) with HE rates. * + * @NL80211_EXT_FEATURE_WIDE_BAND_SCAN: Driver/device supports wide band scan + * on a frequency along with its corresponding phymode (40Mhz, 80Mhz) @@ -28,34 +28,34 @@ * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ -@@ -5878,6 +5881,7 @@ enum nl80211_ext_feature_index { - NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS, - NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION, - NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK, +@@ -5998,6 +6001,7 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_FILS_DISCOVERY, + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, + NL80211_EXT_FEATURE_BEACON_RATE_HE, + NL80211_EXT_FEATURE_WIDE_BAND_SCAN, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -@@ -5992,6 +5996,8 @@ enum nl80211_timeout_reason { - * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with - * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means +@@ -6114,6 +6118,8 @@ enum nl80211_timeout_reason { * %NL80211_ATTR_SCAN_FREQUENCIES will not be included. + * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported by + * 2.4/5 GHz APs + * @NL80211_SCAN_FLAG_WIDE_BAND_SCAN: This flag intends the driver to perform + * wide band scan only if the driver supports it. */ enum nl80211_scan_flags { NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, -@@ -6008,6 +6014,7 @@ enum nl80211_scan_flags { - NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, +@@ -6131,6 +6137,7 @@ enum nl80211_scan_flags { NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13, -+ NL80211_SCAN_FLAG_WIDE_BAND_SCAN = 1<<14, + NL80211_SCAN_FLAG_COLOCATED_6GHZ = 1<<14, ++ NL80211_SCAN_FLAG_WIDE_BAND_SCAN = 1<<15, }; /** --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c -@@ -694,11 +694,13 @@ static int __ieee80211_start_scan(struct +@@ -703,11 +703,13 @@ static int __ieee80211_start_scan(struct local->hw_scan_req = kmalloc( sizeof(*local->hw_scan_req) + @@ -71,7 +71,7 @@ ies = (u8 *)local->hw_scan_req + --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -7756,7 +7756,10 @@ nl80211_check_scan_flags(struct wiphy *w +@@ -8234,7 +8234,10 @@ nl80211_check_scan_flags(struct wiphy *w NL80211_EXT_FEATURE_SCAN_RANDOM_SN) || !nl80211_check_scan_feat(wiphy, *flags, NL80211_SCAN_FLAG_MIN_PREQ_CONTENT, @@ -83,7 +83,7 @@ return -EOPNOTSUPP; if (*flags & NL80211_SCAN_FLAG_RANDOM_ADDR) { -@@ -7781,10 +7784,12 @@ static int nl80211_trigger_scan(struct s +@@ -8259,10 +8262,12 @@ static int nl80211_trigger_scan(struct s struct cfg80211_scan_request *request; struct nlattr *scan_freqs = NULL; bool scan_freqs_khz = false; @@ -97,7 +97,7 @@ wiphy = &rdev->wiphy; -@@ -7797,7 +7802,12 @@ static int nl80211_trigger_scan(struct s +@@ -8275,7 +8280,12 @@ static int nl80211_trigger_scan(struct s if (rdev->scan_req || rdev->scan_msg) return -EBUSY; @@ -111,7 +111,7 @@ if (!wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_SCAN_FREQ_KHZ)) return -EOPNOTSUPP; -@@ -7810,6 +7820,8 @@ static int nl80211_trigger_scan(struct s +@@ -8288,6 +8298,8 @@ static int nl80211_trigger_scan(struct s n_channels = validate_scan_freqs(scan_freqs); if (!n_channels) return -EINVAL; @@ -120,7 +120,7 @@ } else { n_channels = ieee80211_get_num_supported_channels(wiphy); } -@@ -7830,12 +7842,19 @@ static int nl80211_trigger_scan(struct s +@@ -8308,12 +8320,19 @@ static int nl80211_trigger_scan(struct s return -EINVAL; request = kzalloc(sizeof(*request) @@ -140,7 +140,7 @@ if (n_ssids) request->ssids = (void *)&request->channels[n_channels]; request->n_ssids = n_ssids; -@@ -7869,7 +7888,7 @@ static int nl80211_trigger_scan(struct s +@@ -8347,7 +8366,7 @@ static int nl80211_trigger_scan(struct s request->channels[i] = chan; i++; } @@ -149,7 +149,7 @@ enum nl80211_band band; /* all channels */ -@@ -7892,31 +7911,32 @@ static int nl80211_trigger_scan(struct s +@@ -8370,31 +8389,32 @@ static int nl80211_trigger_scan(struct s } } diff --git a/feeds/wifi-ax/mac80211/patches/qca/037-ath11k-add-wide-band-scan-support.patch b/feeds/wifi-ax/mac80211/patches/qca/037-ath11k-add-wide-band-scan-support.patch index fc4649389..84ff27a74 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/037-ath11k-add-wide-band-scan-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/037-ath11k-add-wide-band-scan-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2581,6 +2581,28 @@ static int ath11k_start_scan(struct ath1 +@@ -2737,6 +2737,28 @@ static int ath11k_start_scan(struct ath1 return 0; } @@ -29,7 +29,7 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *hw_req) -@@ -2637,10 +2659,16 @@ static int ath11k_mac_op_hw_scan(struct +@@ -2793,10 +2815,16 @@ static int ath11k_mac_op_hw_scan(struct arg.scan_flags |= WMI_SCAN_FLAG_PASSIVE; } @@ -44,13 +44,13 @@ + arg.scan_f_wide_band = true; + arg.scan_f_passive = true; + arg.chandef = req->chandef; -+ ret = ath11k_wmi_append_scan_chan_list(ar, &arg); ++ ret = ath11k_wmi_update_scan_chan_list(ar, &arg); + if (ret) + goto exit; } ret = ath11k_start_scan(ar, &arg); -@@ -6720,6 +6748,11 @@ static int __ath11k_mac_register(struct +@@ -6929,6 +6957,11 @@ static int __ath11k_mac_register(struct wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_STA_TX_PWR); @@ -64,54 +64,107 @@ --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -2028,6 +2028,57 @@ int ath11k_wmi_send_peer_assoc_cmd(struc +@@ -2031,6 +2031,110 @@ int ath11k_wmi_send_peer_assoc_cmd(struc return ret; } -+int ath11k_wmi_append_scan_chan_list(struct ath11k *ar, ++int ath11k_wmi_update_scan_chan_list(struct ath11k *ar, + struct scan_req_params *arg) +{ ++ struct ieee80211_supported_band **bands; + struct scan_chan_list_params *params; + struct channel_param *ch; + struct cfg80211_chan_def *chandef; -+ struct ieee80211_channel *channel; -+ int params_len; -+ int ret; ++ struct ieee80211_channel *channel, *req_channel; ++ enum nl80211_band band; ++ int num_channels = 0; ++ int params_len, i, ret; ++ bool found = false; ++ ++ bands = ar->hw->wiphy->bands; ++ for (band = 0; band < NUM_NL80211_BANDS; band++) { ++ if (!bands[band]) ++ continue; ++ for (i = 0; i < bands[band]->n_channels; i++) { ++ if (bands[band]->channels[i].flags & ++ IEEE80211_CHAN_DISABLED) ++ continue; ++ ++ num_channels++; ++ } ++ } ++ ++ if (WARN_ON(!num_channels)) ++ return -EINVAL; + + params_len = sizeof(struct scan_chan_list_params) + -+ arg->chan_list.num_chan * sizeof(struct channel_param); ++ num_channels * sizeof(struct channel_param); + params = kzalloc(params_len, GFP_KERNEL); + + if (!params) + return -ENOMEM; + + params->pdev_id = ar->pdev->pdev_id; -+ params->nallchans = arg->chan_list.num_chan; -+ params->append_chan_list = true; ++ params->nallchans = num_channels; + + ch = params->ch_param; -+ chandef = arg->chandef; -+ channel = chandef->chan; ++ chandef = arg ? arg->chandef : NULL; ++ req_channel = chandef ? chandef->chan : NULL; + -+ ch->mhz = arg->chan_list.chan[0].freq; -+ ch->cfreq1 = chandef->center_freq1; -+ ch->cfreq2 = chandef->center_freq2; -+ ch->phy_mode = arg->chan_list.chan[0].phymode; ++ for (band = 0; band < NUM_NL80211_BANDS; band++) { ++ if (!bands[band]) ++ continue; + -+ ch->dfs_set = -+ !!(channel->flags & IEEE80211_CHAN_RADAR); -+ ch->is_chan_passive = !!(channel->flags & ++ for (i = 0; i < bands[band]->n_channels; i++) { ++ channel = &bands[band]->channels[i]; ++ ++ if (channel->flags & IEEE80211_CHAN_DISABLED) ++ continue; ++ ++ if (req_channel && !found && ++ req_channel->center_freq == channel->center_freq) { ++ ch->mhz = arg->chan_list.chan[0].freq; ++ ch->cfreq1 = chandef->center_freq1; ++ ch->cfreq2 = chandef->center_freq2; ++ ++ ch->phy_mode = arg->chan_list.chan[0].phymode; ++ channel = req_channel; ++ found = true; ++ } else { ++ ch->mhz = channel->center_freq; ++ ch->cfreq1 = channel->center_freq; ++ ch->phy_mode = (channel->band == NL80211_BAND_2GHZ) ? ++ MODE_11G : MODE_11A; ++ } ++ ++ /* TODO: Set to true/false based on some condition? */ ++ ch->allow_ht = true; ++ ch->allow_vht = true; ++ ch->allow_he = true; ++ ++ ch->dfs_set = ++ !!(channel->flags & IEEE80211_CHAN_RADAR); ++ ch->is_chan_passive = !!(channel->flags & + IEEE80211_CHAN_NO_IR); -+ ch->is_chan_passive |= ch->dfs_set; -+ ch->minpower = 0; -+ ch->maxpower = channel->max_power * 2; -+ ch->maxregpower = channel->max_reg_power * 2; -+ ch->antennamax = channel->max_antenna_gain * 2; ++ ch->is_chan_passive |= ch->dfs_set; ++ ch->minpower = 0; ++ ch->maxpower = channel->max_power * 2; ++ ch->maxregpower = channel->max_reg_power * 2; ++ ch->antennamax = channel->max_antenna_gain * 2; + -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "scan chan list %d freq %d cfreq1 %d phymode %d is_dfs_ch %u is_chan_passive %u\n", -+ params->nallchans, ch->mhz, ch->cfreq1, ch->phy_mode, -+ ch->dfs_set, ch->is_chan_passive); ++ if (channel->band == NL80211_BAND_6GHZ && ++ cfg80211_channel_is_psc(channel)) ++ ch->psc_channel = true; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, ++ "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d flag 0x%x chandef: %pk\n", ++ i, params->nallchans, ++ ch->mhz, ch->maxpower, ch->maxregpower, ++ ch->antennamax, ch->phy_mode, channel->flags, ++ chandef); ++ ch++; ++ } ++ } + + ret = ath11k_wmi_send_scan_chan_list_cmd(ar, params); + kfree(params); @@ -122,7 +175,7 @@ void ath11k_wmi_start_scan_init(struct ath11k *ar, struct scan_req_params *arg) { -@@ -2142,15 +2193,17 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2150,15 +2254,17 @@ int ath11k_wmi_send_scan_start_cmd(struc void *ptr; int i, ret, len; u32 *tmp_ptr; @@ -142,7 +195,7 @@ len += TLV_HDR_SIZE; if (params->num_ssids) -@@ -2174,6 +2227,19 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2182,6 +2288,19 @@ int ath11k_wmi_send_scan_start_cmd(struc len += TLV_HDR_SIZE + params->num_hint_s_ssid * sizeof(struct hint_short_ssid); @@ -162,7 +215,7 @@ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); if (!skb) return -ENOMEM; -@@ -2205,7 +2271,7 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2213,7 +2332,7 @@ int ath11k_wmi_send_scan_start_cmd(struc cmd->max_scan_time = params->max_scan_time; cmd->probe_delay = params->probe_delay; cmd->burst_duration = params->burst_duration; @@ -171,7 +224,7 @@ cmd->num_bssid = params->num_bssid; cmd->num_ssids = params->num_ssids; cmd->ie_len = params->extraie.len; -@@ -2213,7 +2279,7 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2221,7 +2340,7 @@ int ath11k_wmi_send_scan_start_cmd(struc ptr += sizeof(*cmd); @@ -180,7 +233,7 @@ tlv = ptr; tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | -@@ -2221,8 +2287,8 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2229,8 +2348,8 @@ int ath11k_wmi_send_scan_start_cmd(struc ptr += TLV_HDR_SIZE; tmp_ptr = (u32 *)ptr; @@ -191,7 +244,7 @@ ptr += len; -@@ -2263,6 +2329,7 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2271,6 +2390,7 @@ int ath11k_wmi_send_scan_start_cmd(struc ptr += params->num_bssid * sizeof(*bssid); len = extraie_len_with_pad; @@ -199,7 +252,7 @@ tlv = ptr; tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | FIELD_PREP(WMI_TLV_LEN, len); -@@ -2336,6 +2403,38 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2313,6 +2433,38 @@ int ath11k_wmi_send_scan_start_cmd(struc } } @@ -238,7 +291,7 @@ ret = ath11k_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID); if (ret) { -@@ -2431,7 +2530,7 @@ int ath11k_wmi_send_scan_chan_list_cmd(s +@@ -2408,7 +2560,7 @@ int ath11k_wmi_send_scan_chan_list_cmd(s FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); cmd->pdev_id = chan_list->pdev_id; cmd->num_scan_chans = num_send_chans; @@ -258,7 +311,7 @@ #define WMI_BA_MODE_BUFFER_SIZE_256 3 /* * HW mode config type replicated from FW header -@@ -3021,6 +3019,12 @@ struct wlan_ssid { +@@ -3045,6 +3043,12 @@ struct wlan_ssid { }; #define WMI_IE_BITMAP_SIZE 8 @@ -271,7 +324,7 @@ #define WMI_SCAN_MAX_NUM_SSID 0x0A /* prefix used by scan requestor ids on the host */ -@@ -3155,6 +3159,22 @@ struct hint_bssid { +@@ -3179,6 +3183,22 @@ struct hint_bssid { struct wmi_mac_addr bssid; }; @@ -294,7 +347,7 @@ struct scan_req_params { u32 scan_id; u32 scan_req_id; -@@ -3217,17 +3237,17 @@ struct scan_req_params { +@@ -3241,17 +3261,17 @@ struct scan_req_params { scan_f_forced:1, scan_f_2ghz:1, scan_f_5ghz:1, @@ -315,7 +368,7 @@ u32 notify_scan_events; struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID]; struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID]; -@@ -3238,6 +3258,7 @@ struct scan_req_params { +@@ -3262,6 +3282,7 @@ struct scan_req_params { u32 num_hint_bssid; struct hint_short_ssid hint_s_ssid[WLAN_SCAN_MAX_HINT_S_SSID]; struct hint_bssid hint_bssid[WLAN_SCAN_MAX_HINT_BSSID]; @@ -323,7 +376,7 @@ }; struct wmi_ssid_arg { -@@ -3591,9 +3612,12 @@ struct wmi_stop_scan_cmd { +@@ -3614,9 +3635,12 @@ struct wmi_stop_scan_cmd { struct scan_chan_list_params { u32 pdev_id; u16 nallchans; @@ -336,12 +389,115 @@ struct wmi_scan_chan_list_cmd { u32 tlv_header; u32 num_scan_chans; -@@ -5131,6 +5155,8 @@ int ath11k_wmi_vdev_delete(struct ath11k +@@ -5358,6 +5382,8 @@ int ath11k_wmi_vdev_delete(struct ath11k void ath11k_wmi_start_scan_init(struct ath11k *ar, struct scan_req_params *arg); int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, struct scan_req_params *params); -+int ath11k_wmi_append_scan_chan_list(struct ath11k *ar, ++int ath11k_wmi_update_scan_chan_list(struct ath11k *ar, + struct scan_req_params *params); int ath11k_wmi_send_scan_stop_cmd(struct ath11k *ar, struct scan_cancel_param *param); int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id, +--- a/drivers/net/wireless/ath/ath11k/reg.c ++++ b/drivers/net/wireless/ath/ath11k/reg.c +@@ -90,99 +90,7 @@ ath11k_reg_notifier(struct wiphy *wiphy, + + int ath11k_reg_update_chan_list(struct ath11k *ar) + { +- struct ieee80211_supported_band **bands; +- struct scan_chan_list_params *params; +- struct ieee80211_channel *channel; +- struct ieee80211_hw *hw = ar->hw; +- struct channel_param *ch; +- enum nl80211_band band; +- int num_channels = 0; +- int params_len; +- int i, ret; +- +- bands = hw->wiphy->bands; +- for (band = 0; band < NUM_NL80211_BANDS; band++) { +- if (!bands[band]) +- continue; +- +- for (i = 0; i < bands[band]->n_channels; i++) { +- if (bands[band]->channels[i].flags & +- IEEE80211_CHAN_DISABLED) +- continue; +- +- num_channels++; +- } +- } +- +- if (WARN_ON(!num_channels)) +- return -EINVAL; +- +- params_len = sizeof(struct scan_chan_list_params) + +- num_channels * sizeof(struct channel_param); +- params = kzalloc(params_len, GFP_KERNEL); +- +- if (!params) +- return -ENOMEM; +- +- params->pdev_id = ar->pdev->pdev_id; +- params->nallchans = num_channels; +- +- ch = params->ch_param; +- +- for (band = 0; band < NUM_NL80211_BANDS; band++) { +- if (!bands[band]) +- continue; +- +- for (i = 0; i < bands[band]->n_channels; i++) { +- channel = &bands[band]->channels[i]; +- +- if (channel->flags & IEEE80211_CHAN_DISABLED) +- continue; +- +- /* TODO: Set to true/false based on some condition? */ +- ch->allow_ht = true; +- ch->allow_vht = true; +- ch->allow_he = true; +- +- ch->dfs_set = +- !!(channel->flags & IEEE80211_CHAN_RADAR); +- ch->is_chan_passive = !!(channel->flags & +- IEEE80211_CHAN_NO_IR); +- ch->is_chan_passive |= ch->dfs_set; +- ch->mhz = channel->center_freq; +- ch->cfreq1 = channel->center_freq; +- ch->minpower = 0; +- ch->maxpower = channel->max_power * 2; +- ch->maxregpower = channel->max_reg_power * 2; +- ch->antennamax = channel->max_antenna_gain * 2; +- +- /* TODO: Use appropriate phymodes */ +- if (channel->band == NL80211_BAND_2GHZ) +- ch->phy_mode = MODE_11G; +- else +- ch->phy_mode = MODE_11A; +- +- if (channel->band == NL80211_BAND_6GHZ && +- cfg80211_channel_is_psc(channel)) +- ch->psc_channel = true; +- +- ath11k_dbg(ar->ab, ATH11K_DBG_WMI, +- "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n", +- i, params->nallchans, +- ch->mhz, ch->maxpower, ch->maxregpower, +- ch->antennamax, ch->phy_mode); +- +- ch++; +- /* TODO: use quarrter/half rate, cfreq12, dfs_cfreq2 +- * set_agile, reg_class_idx +- */ +- } +- } +- +- ret = ath11k_wmi_send_scan_chan_list_cmd(ar, params); +- kfree(params); +- +- return ret; ++ return ath11k_wmi_update_scan_chan_list(ar, NULL); + } + + static void ath11k_copy_regd(struct ieee80211_regdomain *regd_orig, diff --git a/feeds/wifi-ax/mac80211/patches/qca/038-ath11k-Adding-support-for-QDSS.patch b/feeds/wifi-ax/mac80211/patches/qca/038-ath11k-Adding-support-for-QDSS.patch index 4adc599a9..8be6cef4d 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/038-ath11k-Adding-support-for-QDSS.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/038-ath11k-Adding-support-for-QDSS.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -671,6 +671,9 @@ int ath11k_core_qmi_firmware_ready(struc +@@ -915,6 +915,9 @@ int ath11k_core_qmi_firmware_ready(struc } #endif ath11k_hif_irq_enable(ab); @@ -12,19 +12,19 @@ return 0; --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -916,6 +916,7 @@ struct ath11k_base *ath11k_core_alloc(st +@@ -928,6 +928,7 @@ struct ath11k_base *ath11k_core_alloc(st void ath11k_core_free(struct ath11k_base *ath11k); int ath11k_core_fetch_bdf(struct ath11k_base *ath11k, struct ath11k_board_data *bd); +int ath11k_config_qdss(struct ath11k_base *ab); void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd); + int ath11k_core_check_dt(struct ath11k_base *ath11k); - void ath11k_core_halt(struct ath11k *ar); --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -18,6 +18,194 @@ EXPORT_SYMBOL(enable_cold_boot_cal); - module_param(enable_cold_boot_cal, bool, 0644); - MODULE_PARM_DESC(enable_cold_boot_cal, "cold boot calibration enable:1 disable:0"); +@@ -20,6 +20,194 @@ module_param_named(cold_boot_cal, ath11k + MODULE_PARM_DESC(cold_boot_cal, + "Decrease the channel switch time but increase the driver load time (Default: true)"); +unsigned int enable_qdss_trace = 1; +module_param(enable_qdss_trace, uint, 0644); @@ -217,7 +217,7 @@ static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = { { .data_type = QMI_OPT_FLAG, -@@ -1508,6 +1696,156 @@ static struct qmi_elem_info qmi_wlanfw_c +@@ -1510,6 +1698,156 @@ static struct qmi_elem_info qmi_wlanfw_c }, }; @@ -374,7 +374,7 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) { struct qmi_wlanfw_host_cap_req_msg_v01 req; -@@ -1611,7 +1949,12 @@ static int ath11k_qmi_fw_ind_register_se +@@ -1615,7 +1953,12 @@ static int ath11k_qmi_fw_ind_register_se req->cal_done_enable = 1; req->fw_init_done_enable_valid = 1; req->fw_init_done_enable = 1; @@ -388,7 +388,7 @@ req->pin_connect_result_enable_valid = 0; req->pin_connect_result_enable = 0; -@@ -2334,6 +2677,31 @@ void ath11k_qmi_firmware_stop(struct ath +@@ -2382,6 +2725,31 @@ void ath11k_qmi_firmware_stop(struct ath } } @@ -422,16 +422,16 @@ { --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -26,6 +26,8 @@ - #define ATH11K_QMI_RESP_LEN_MAX 8192 - #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 +@@ -30,6 +30,8 @@ #define ATH11K_QMI_CALDB_SIZE 0x480000 + #define ATH11K_QMI_BDF_EXT_STR_LENGTH 0x20 + #define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 3 +#define ATH11K_QMI_MAX_QDSS_CONFIG_FILE_NAME_SIZE 64 +#define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin" #define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035 #define QMI_WLFW_FW_MEM_READY_IND_V01 0x0037 -@@ -132,7 +134,51 @@ struct ath11k_qmi { +@@ -138,7 +140,51 @@ struct ath11k_qmi { wait_queue_head_t cold_boot_waitq; }; @@ -484,7 +484,7 @@ #define QMI_WLANFW_HOST_CAP_REQ_V01 0x0034 #define QMI_WLANFW_HOST_CAP_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLFW_HOST_CAP_RESP_V01 0x0034 -@@ -170,13 +216,15 @@ struct qmi_wlanfw_host_cap_req_msg_v01 { +@@ -177,13 +223,15 @@ struct qmi_wlanfw_host_cap_req_msg_v01 { u32 mem_bucket; u8 mem_cfg_mode_valid; u8 mem_cfg_mode; @@ -501,7 +501,7 @@ #define QMI_WLANFW_IND_REGISTER_REQ_V01 0x0020 #define QMI_WLANFW_IND_REGISTER_RESP_MSG_V01_MAX_LEN 18 #define QMI_WLANFW_IND_REGISTER_RESP_V01 0x0020 -@@ -207,6 +255,12 @@ struct qmi_wlanfw_ind_register_req_msg_v +@@ -214,6 +262,12 @@ struct qmi_wlanfw_ind_register_req_msg_v u8 xo_cal_enable; u8 cal_done_enable_valid; u8 cal_done_enable; @@ -514,7 +514,7 @@ }; struct qmi_wlanfw_ind_register_resp_msg_v01 { -@@ -467,5 +521,11 @@ void ath11k_qmi_event_work(struct work_s +@@ -474,5 +528,11 @@ void ath11k_qmi_event_work(struct work_s void ath11k_qmi_msg_recv_work(struct work_struct *work); void ath11k_qmi_deinit_service(struct ath11k_base *ab); int ath11k_qmi_init_service(struct ath11k_base *ab); diff --git a/feeds/wifi-ax/mac80211/patches/qca/039-mac80211-ath11k-add-HE-TX-rate-reporting-to-radiotap.patch b/feeds/wifi-ax/mac80211/patches/qca/039-mac80211-ath11k-add-HE-TX-rate-reporting-to-radiotap.patch index 03404c969..3f467eee0 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/039-mac80211-ath11k-add-HE-TX-rate-reporting-to-radiotap.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/039-mac80211-ath11k-add-HE-TX-rate-reporting-to-radiotap.patch @@ -12,9 +12,11 @@ Signed-off-by: John Crispin include/net/mac80211.h | 2 ++ 1 file changed, 2 insertions(+) ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -413,9 +413,12 @@ static void ath11k_dp_tx_complete_msdu(s +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/dp_tx.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -417,9 +417,12 @@ static void ath11k_dp_tx_complete_msdu(s struct sk_buff *msdu, struct hal_tx_status *ts) { @@ -27,7 +29,7 @@ Signed-off-by: John Crispin if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) { /* Must not happen */ -@@ -484,8 +487,24 @@ static void ath11k_dp_tx_complete_msdu(s +@@ -488,8 +491,25 @@ static void ath11k_dp_tx_complete_msdu(s * Might end up reporting it out-of-band from HTT stats. */ @@ -36,7 +38,8 @@ Signed-off-by: John Crispin + spin_lock_bh(&ab->base_lock); + peer = ath11k_peer_find_by_id(ab, ts->peer_id); + if (!peer || !peer->sta) { -+ ath11k_warn(ab, "failed to find the peer with peer_id %d\n", ++ ath11k_dbg(ab, ATH11K_DBG_DATA, ++ "dp_tx: failed to find the peer with peer_id %d\n", + ts->peer_id); + spin_unlock_bh(&ab->base_lock); + dev_kfree_skb_any(msdu); diff --git a/feeds/wifi-ax/mac80211/patches/qca/040-ath11k-add-new-api-to-get-ar-from-arvifs.patch b/feeds/wifi-ax/mac80211/patches/qca/040-ath11k-add-new-api-to-get-ar-from-arvifs.patch deleted file mode 100644 index 58700d50f..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/040-ath11k-add-new-api-to-get-ar-from-arvifs.patch +++ /dev/null @@ -1,229 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -441,12 +441,6 @@ struct ath11k_per_peer_tx_stats { - #define ATH11K_FLUSH_TIMEOUT (5 * HZ) - #define ATH11K_VDEV_DELETE_TIMEOUT_HZ (5 * HZ) - --struct ath11k_vdev_stop_delete_status { -- bool stop_in_progress; -- bool delete_in_progress; -- u32 vdev_id; --}; -- - struct ath11k_coex_info { - bool coex_support; - u32 pta_num; -@@ -537,7 +531,6 @@ struct ath11k { - struct completion install_key_done; - - int last_wmi_vdev_start_status; -- struct ath11k_vdev_stop_delete_status vdev_stop_delete_status; - struct completion vdev_setup_done; - struct completion vdev_delete_done; - ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -547,48 +547,12 @@ struct ath11k *ath11k_mac_get_ar_by_pdev - return NULL; - } - --struct ath11k *ath11k_mac_get_ar_vdev_stop_delete_status(struct ath11k_base *ab, -- u32 vdev_id) -+struct ath11k *ath11k_mac_get_ar_from_arvif_list(struct ath11k_base *ab, u32 vdev_id) - { - int i; - struct ath11k_pdev *pdev; -- struct ath11k *ar; -- -- for (i = 0; i < ab->num_radios; i++) { -- pdev = rcu_dereference(ab->pdevs_active[i]); -- if (pdev && pdev->ar) { -- ar = pdev->ar; -- -- spin_lock_bh(&ar->data_lock); -- if (ar->vdev_stop_delete_status.stop_in_progress && -- ar->vdev_stop_delete_status.vdev_id == vdev_id) { -- ar->vdev_stop_delete_status.stop_in_progress = false; -- spin_unlock_bh(&ar->data_lock); -- return ar; -- } -- if (ar->vdev_stop_delete_status.delete_in_progress && -- ar->vdev_stop_delete_status.vdev_id == vdev_id) { -- ar->vdev_stop_delete_status.delete_in_progress = false; -- spin_unlock_bh(&ar->data_lock); -- return ar; -- } -- if (pdev->ar->monitor_vdev_id == vdev_id) { -- spin_unlock_bh(&ar->data_lock); -- return pdev->ar; -- } -- spin_unlock_bh(&ar->data_lock); -- } -- } -- return NULL; --} -- --struct ath11k *ath11k_mac_get_ar_peer_delete_status(struct ath11k_base *ab, u8 *peer_addr, -- u32 vdev_id) --{ -- int i; -- struct ath11k_pdev *pdev; -- struct ath11k *ar; - struct ath11k_vif *arvif; -+ struct ath11k *ar; - - for (i = 0; i < ab->num_radios; i++) { - pdev = rcu_dereference(ab->pdevs_active[i]); -@@ -596,18 +560,10 @@ struct ath11k *ath11k_mac_get_ar_peer_de - ar = pdev->ar; - - spin_lock_bh(&ar->data_lock); -- if (ether_addr_equal(ar->mac_addr, peer_addr)) { -- spin_unlock_bh(&ar->data_lock); -- return ar; -- } else { -- arvif = ath11k_mac_get_arvif(pdev->ar, vdev_id); -- if (arvif) { -+ list_for_each_entry(arvif, &ar->arvifs, list) { -+ if (arvif->vdev_id == vdev_id) { - spin_unlock_bh(&ar->data_lock); -- return arvif->ar; -- } -- if (pdev->ar->monitor_vdev_id == vdev_id) { -- spin_unlock_bh(&ar->data_lock); -- return pdev->ar; -+ return arvif->ar; - } - } - spin_unlock_bh(&ar->data_lock); -@@ -972,7 +928,6 @@ static int ath11k_mac_monitor_vdev_delet - ATH11K_VDEV_DELETE_TIMEOUT_HZ); - if (time_left == 0) { - ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); -- ar->vdev_stop_delete_status.delete_in_progress = false; - } else { - ar->ab->free_vdev_map |= 1LL << (ar->monitor_vdev_id); - ar->num_created_vdevs--; -@@ -1053,27 +1008,6 @@ int ath11k_mac_monitor_recalc(struct ath - else - return ath11k_mac_monitor_stop(ar); - } --int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, -- const u8 *addr) --{ -- int ret; -- unsigned long time_left; -- -- ret = ath11k_wait_for_peer_deleted(ar, vdev_id, addr); -- if(ret) { -- ath11k_warn(ar->ab, "failed wait for peer deleted"); -- return ret; -- } -- -- time_left = wait_for_completion_timeout(&ar->peer_delete_done, -- 3 * HZ); -- if(time_left == 0) { -- ath11k_warn(ar->ab, "Timeout in receiving peer delete response\n"); -- return -ETIMEDOUT; -- } -- -- return 0; --} - - static int ath11k_mac_op_config(struct ieee80211_hw *hw, u32 changed) - { -@@ -5339,13 +5273,6 @@ static int ath11k_mac_vdev_stop(struct a - reinit_completion(&ar->vdev_setup_done); - reinit_completion(&ar->vdev_delete_done); - -- spin_lock_bh(&ar->data_lock); -- -- ar->vdev_stop_delete_status.stop_in_progress = true; -- ar->vdev_stop_delete_status.vdev_id = arvif->vdev_id; -- -- spin_unlock_bh(&ar->data_lock); -- - ret = ath11k_wmi_vdev_stop(ar, arvif->vdev_id); - if (ret) { - ath11k_warn(ar->ab, "failed to stop WMI vdev %i: %d\n", -@@ -5374,10 +5301,6 @@ static int ath11k_mac_vdev_stop(struct a - - return 0; - err: -- spin_lock_bh(&ar->data_lock); -- ar->vdev_stop_delete_status.stop_in_progress = false; -- spin_unlock_bh(&ar->data_lock); -- - return ret; - } - ---- a/drivers/net/wireless/ath/ath11k/mac.h -+++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -139,16 +139,11 @@ int ath11k_mac_coex_config(struct ath11k - int coex, u32 wlan_prio_mask, u8 wlan_weight); - struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base *ab, u32 vdev_id); - struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id); --struct ath11k *ath11k_mac_get_ar_vdev_stop_status(struct ath11k_base *ab, -- u32 vdev_id); --struct ath11k *ath11k_mac_get_ar_vdev_stop_delete_status(struct ath11k_base *ab, -- u32 vdev_id); -+struct ath11k *ath11k_mac_get_ar_from_arvif_list(struct ath11k_base *ab, u32 vdev_id); - void ath11k_mac_drain_tx(struct ath11k *ar); - void ath11k_mac_peer_cleanup_all(struct ath11k *ar); - int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); - u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); --struct ath11k *ath11k_mac_get_ar_peer_delete_status(struct ath11k_base *ab, u8 *peer_addr, -- u32 vdev_id); - enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); - enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); - #endif ---- a/drivers/net/wireless/ath/ath11k/peer.c -+++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -172,7 +172,7 @@ void ath11k_peer_cleanup(struct ath11k * - spin_unlock_bh(&ab->base_lock); - } - --int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr) -+static int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr) - { - return ath11k_wait_for_peer_common(ar->ab, vdev_id, addr, false); - } ---- a/drivers/net/wireless/ath/ath11k/peer.h -+++ b/drivers/net/wireless/ath/ath11k/peer.h -@@ -41,7 +41,6 @@ void ath11k_peer_cleanup(struct ath11k * - int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr); - int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, - struct ieee80211_sta *sta, struct peer_create_params *param); --int ath11k_wait_for_peer_deleted(struct ath11k *ar, int vdev_id, const u8 *addr); - int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, const u8 *addr); - - #endif /* _PEER_H_ */ ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -5853,7 +5853,7 @@ static void ath11k_peer_delete_resp_even - } - - rcu_read_lock(); -- ar = ath11k_mac_get_ar_by_vdev_id(ab, peer_del_resp.vdev_id); -+ ar = ath11k_mac_get_ar_from_arvif_list(ab, peer_del_resp.vdev_id); - if (!ar) { - ath11k_warn(ab, "invalid vdev id in peer delete resp ev %d", - peer_del_resp.vdev_id); -@@ -5881,7 +5881,7 @@ static void ath11k_vdev_delete_resp_even - } - - rcu_read_lock(); -- ar = ath11k_mac_get_ar_vdev_stop_delete_status(ab, vdev_id); -+ ar = ath11k_mac_get_ar_from_arvif_list(ab, vdev_id); - if (!ar) { - ath11k_warn(ab, "invalid vdev id in vdev delete resp ev %d", - vdev_id); -@@ -5972,7 +5972,7 @@ static void ath11k_vdev_stopped_event(st - } - - rcu_read_lock(); -- ar = ath11k_mac_get_ar_vdev_stop_delete_status(ab, vdev_id); -+ ar = ath11k_mac_get_ar_from_arvif_list(ab, vdev_id); - if (!ar) { - ath11k_warn(ab, "invalid vdev id in vdev stopped ev %d", - vdev_id); diff --git a/feeds/wifi-ax/mac80211/patches/qca/043-ath11k-use-regular-tx-path-for-raw-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/043-ath11k-use-regular-tx-path-for-raw-mode.patch deleted file mode 100644 index 9de386dbd..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/043-ath11k-use-regular-tx-path-for-raw-mode.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2693,7 +2693,8 @@ static int ath11k_install_key(struct ath - } - - if (test_bit(ATH11K_FLAG_RAW_MODE, &ar->ab->dev_flags)) -- key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; -+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV | -+ IEEE80211_KEY_FLAG_RESERVE_TAILROOM; - - install: - ret = ath11k_wmi_vdev_install_key(arvif->ar, &arg); -@@ -6613,7 +6614,13 @@ static int __ath11k_mac_register(struct - ieee80211_hw_set(ar->hw, HAS_RATE_CONTROL); - ieee80211_hw_set(ar->hw, AP_LINK_PS); - ieee80211_hw_set(ar->hw, SPECTRUM_MGMT); -- ieee80211_hw_set(ar->hw, SUPPORT_FAST_XMIT); -+ -+ /* Use normal tx path for raw mode as fast-tx path does not -+ * ensure tailroom availability for including MIC length. -+ */ -+ if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) -+ ieee80211_hw_set(ar->hw, SUPPORT_FAST_XMIT); -+ - ieee80211_hw_set(ar->hw, CONNECTION_MONITOR); - ieee80211_hw_set(ar->hw, SUPPORTS_PER_STA_GTK); - ieee80211_hw_set(ar->hw, WANT_MONITOR_VIF); diff --git a/feeds/wifi-ax/mac80211/patches/qca/047-ath11k-set-eapol-minrate-conf.patch b/feeds/wifi-ax/mac80211/patches/qca/047-ath11k-set-eapol-minrate-conf.patch deleted file mode 100644 index 3e995591e..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/047-ath11k-set-eapol-minrate-conf.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -3359,7 +3359,7 @@ ath11k_wmi_copy_resource_config(struct w - wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; - wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; - wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; -- wmi_cfg->flag1 = tg_cfg->atf_config; -+ wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE; - wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; - wmi_cfg->sched_params = tg_cfg->sched_params; - wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2217,6 +2217,8 @@ struct wmi_init_cmd { - u32 num_host_mem_chunks; - } __packed; - -+#define WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE BIT(14) -+ - struct wmi_resource_config { - u32 tlv_header; - u32 num_vdevs; diff --git a/feeds/wifi-ax/mac80211/patches/qca/056-ath11k-mac80211-twt-support.patch b/feeds/wifi-ax/mac80211/patches/qca/056-ath11k-mac80211-twt-support.patch index 6e87d1ad6..34e1ea822 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/056-ath11k-mac80211-twt-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/056-ath11k-mac80211-twt-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2319,6 +2319,8 @@ static void ath11k_mac_op_bss_info_chang +@@ -2538,6 +2538,8 @@ static void ath11k_mac_op_bss_info_chang ath11k_wmi_send_twt_enable_cmd(ar, ar->pdev->pdev_id); else ath11k_wmi_send_twt_disable_cmd(ar, ar->pdev->pdev_id); @@ -22,7 +22,7 @@ Signed-off-by: John Crispin } if (changed & BSS_CHANGED_HE_OBSS_PD) -@@ -5007,6 +5009,10 @@ err_vdev_del: +@@ -5240,6 +5242,10 @@ err_vdev_del: /* TODO: recal traffic pause state based on the available vdevs */ @@ -35,16 +35,16 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -123,6 +123,8 @@ static const struct wmi_tlv_policy wmi_t - = { .min_len = sizeof(struct wmi_stats_event) }, - [WMI_TAG_PDEV_CTL_FAILSAFE_CHECK_EVENT] - = { .min_len = sizeof(struct wmi_pdev_ctl_failsafe_chk_event) }, +@@ -129,6 +129,8 @@ static const struct wmi_tlv_policy wmi_t + .min_len = sizeof(struct wmi_probe_resp_tx_status_event) }, + [WMI_TAG_VDEV_DELETE_RESP_EVENT] = { + .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, + [WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT] + = { .min_len = sizeof(struct wmi_twt_add_dialog_event) }, - [WMI_TAG_VDEV_DELETE_RESP_EVENT] - = { .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, }; -@@ -2749,7 +2751,162 @@ int ath11k_wmi_delba_send(struct ath11k + + #define PRIMAP(_hw_mode_) \ +@@ -2726,7 +2728,162 @@ int ath11k_wmi_delba_send(struct ath11k return ret; } @@ -208,8 +208,8 @@ Signed-off-by: John Crispin u32 tid, u32 status) { struct ath11k_pdev_wmi *wmi = ar->wmi; -@@ -6751,6 +6908,37 @@ ath11k_wmi_pdev_temperature_event(struct - ath11k_thermal_event_temperature(ar, ev.temp); +@@ -7182,6 +7339,37 @@ static void ath11k_wmi_event_wow_wakeup_ + complete(&ab->wow.wakeup_completed); } +static void ath11k_wmi_twt_add_dialog_event(struct ath11k_base *ab, struct sk_buff *skb) @@ -246,7 +246,7 @@ Signed-off-by: John Crispin static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) { struct wmi_cmd_hdr *cmd_hdr; -@@ -6840,11 +7028,17 @@ static void ath11k_wmi_tlv_op_rx(struct +@@ -7277,11 +7465,17 @@ static void ath11k_wmi_tlv_op_rx(struct case WMI_PDEV_UTF_EVENTID: ath11k_tm_event_wmi(ab, id, skb); break; @@ -266,7 +266,7 @@ Signed-off-by: John Crispin "ignoring unsupported event 0x%x\n", id); --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -4862,6 +4862,112 @@ struct wmi_twt_disable_params_cmd { +@@ -4894,6 +4894,112 @@ struct wmi_twt_disable_params_cmd { u32 pdev_id; } __packed; @@ -379,7 +379,7 @@ Signed-off-by: John Crispin struct wmi_obss_spatial_reuse_params_cmd { u32 tlv_header; u32 pdev_id; -@@ -5219,6 +5325,14 @@ void ath11k_wmi_fw_stats_fill(struct ath +@@ -5444,6 +5550,14 @@ void ath11k_wmi_fw_stats_fill(struct ath int ath11k_wmi_simulate_radar(struct ath11k *ar); int ath11k_wmi_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id); int ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id); @@ -393,10 +393,10 @@ Signed-off-by: John Crispin + struct wmi_twt_resume_dialog_params *params); int ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id, struct ieee80211_he_obss_pd *he_obss_pd); - int ath11k_send_coex_config_cmd(struct ath11k *ar, + int ath11k_wmi_pdev_set_srg_bss_color_bitmap(struct ath11k *ar, u32 *bitmap); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -232,6 +232,7 @@ struct ath11k_vif { +@@ -244,6 +244,7 @@ struct ath11k_vif { bool rsnie_present; bool wpaie_present; struct ieee80211_chanctx_conf chanctx; @@ -404,11 +404,11 @@ Signed-off-by: John Crispin }; struct ath11k_vif_iter { ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -147,6 +147,203 @@ EXPORT_SYMBOL(ath11k_dbg_dump); - - #endif +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -51,6 +51,203 @@ static const char *htt_bp_lmac_ring[HTT_ + "MONITOR_DEST_RING", + }; +#ifdef CPTCFG_MAC80211_DEBUGFS +static ssize_t ath11k_write_twt_add_dialog(struct file *file, @@ -607,14 +607,14 @@ Signed-off-by: John Crispin +} +#endif + - #ifdef CPTCFG_ATH11K_DEBUGFS static void ath11k_fw_stats_pdevs_free(struct list_head *head) { ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -153,6 +153,15 @@ static inline void ath11k_dbg_dump(struc - } - #endif /* CPTCFG_ATH11K_DEBUG */ + struct ath11k_fw_stats_pdev *i, *tmp; +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -103,6 +103,15 @@ enum ath11k_dbg_aggr_mode { + ATH11K_DBG_AGGR_MODE_MAX, + }; +#ifdef CPTCFG_MAC80211_DEBUGFS +void ath11k_debugfs_twt(struct ath11k_vif *arvif, bool enable); @@ -626,11 +626,11 @@ Signed-off-by: John Crispin +#endif + #ifdef CPTCFG_ATH11K_DEBUGFS - int ath11k_debug_soc_create(struct ath11k_base *ab); - void ath11k_debug_soc_destroy(struct ath11k_base *ab); + int ath11k_debugfs_soc_create(struct ath11k_base *ab); + void ath11k_debugfs_soc_destroy(struct ath11k_base *ab); --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -5014,7 +5014,8 @@ static int nl80211_start_ap(struct sk_bu +@@ -5475,7 +5475,8 @@ static int nl80211_start_ap(struct sk_bu return PTR_ERR(params.acl); } diff --git a/feeds/wifi-ax/mac80211/patches/qca/058-enable-ipq6018.patch b/feeds/wifi-ax/mac80211/patches/qca/058-enable-ipq6018.patch deleted file mode 100644 index c90dc58d8..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/058-enable-ipq6018.patch +++ /dev/null @@ -1,1185 +0,0 @@ -From 22ed8e368785b07917ecd956a008177d3aa51616 Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Wed, 19 Aug 2020 16:11:31 +0530 -Subject: [PATCH 02/15] ath11k: move target ce configs to hw_params - -Move target CE config and target CE service config to hw_params. -No functional changes. - -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/ahb.c | 254 +------------------- - drivers/net/wireless/ath/ath11k/core.c | 8 + - drivers/net/wireless/ath/ath11k/core.h | 6 + - drivers/net/wireless/ath/ath11k/hw.c | 410 +++++++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/hw.h | 5 +- - drivers/net/wireless/ath/ath11k/pci.c | 193 +--------------- - 6 files changed, 442 insertions(+), 434 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -20,6 +20,9 @@ static const struct of_device_id ath11k_ - { .compatible = "qcom,ipq8074-wifi", - .data = (void *)ATH11K_HW_IPQ8074, - }, -+ { .compatible = "qcom,ipq6018-wifi", -+ .data = (void *)ATH11K_HW_IPQ6018, -+ }, - { } - }; - -@@ -32,244 +35,6 @@ static const struct ath11k_bus_params at - .fixed_mem_region = true, - }; - --/* Target firmware's Copy Engine configuration. */ --static const struct ce_pipe_config target_ce_config_wlan[] = { -- /* CE0: host->target HTC control and raw streams */ -- { -- .pipenum = __cpu_to_le32(0), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE1: target->host HTT + HTC control */ -- { -- .pipenum = __cpu_to_le32(1), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE2: target->host WMI */ -- { -- .pipenum = __cpu_to_le32(2), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE3: host->target WMI */ -- { -- .pipenum = __cpu_to_le32(3), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE4: host->target HTT */ -- { -- .pipenum = __cpu_to_le32(4), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(256), -- .nbytes_max = __cpu_to_le32(256), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE5: target->host Pktlog */ -- { -- .pipenum = __cpu_to_le32(5), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(0), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE6: Reserved for target autonomous hif_memcpy */ -- { -- .pipenum = __cpu_to_le32(6), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(65535), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE7 used only by Host */ -- { -- .pipenum = __cpu_to_le32(7), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE8 target->host used only by IPA */ -- { -- .pipenum = __cpu_to_le32(8), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(65535), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE9 host->target HTT */ -- { -- .pipenum = __cpu_to_le32(9), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE10 target->host HTT */ -- { -- .pipenum = __cpu_to_le32(10), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H), -- .nentries = __cpu_to_le32(0), -- .nbytes_max = __cpu_to_le32(0), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE11 Not used */ -- { -- .pipenum = __cpu_to_le32(0), -- .pipedir = __cpu_to_le32(0), -- .nentries = __cpu_to_le32(0), -- .nbytes_max = __cpu_to_le32(0), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, --}; -- --/* Map from service/endpoint to Copy Engine. -- * This table is derived from the CE_PCI TABLE, above. -- * It is passed to the Target at startup for use by firmware. -- */ --static const struct service_to_pipe target_service_to_ce_map_wlan[] = { -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(3), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(3), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(3), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(3), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(3), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(7), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(9), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(2), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(0), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(1), -- }, -- { /* not used */ -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(0), -- }, -- { /* not used */ -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(1), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- .pipenum = __cpu_to_le32(4), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(1), -- }, -- { -- .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- .pipenum = __cpu_to_le32(5), -- }, -- -- /* (Additions here) */ -- -- { /* terminator entry */ } --}; - - #define ATH11K_IRQ_CE0_OFFSET 4 - -@@ -444,7 +209,7 @@ static void ath11k_ahb_ce_irq_enable(str - { - const struct ce_pipe_config *ce_config; - -- ce_config = &target_ce_config_wlan[ce_id]; -+ ce_config = &ab->hw_params.target_ce_config[ce_id]; - if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT) - ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_ADDRESS); - -@@ -459,7 +224,7 @@ static void ath11k_ahb_ce_irq_disable(st - { - const struct ce_pipe_config *ce_config; - -- ce_config = &target_ce_config_wlan[ce_id]; -+ ce_config = &ab->hw_params.target_ce_config[ce_id]; - if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT) - ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_ADDRESS); - -@@ -600,10 +365,10 @@ static void ath11k_ahb_init_qmi_ce_confi - { - struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; - -- cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1; -- cfg->tgt_ce = target_ce_config_wlan; -- cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan); -- cfg->svc_to_ce_map = target_service_to_ce_map_wlan; -+ cfg->tgt_ce_len = ab->hw_params.target_ce_count; -+ cfg->tgt_ce = ab->hw_params.target_ce_config; -+ cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; -+ cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; - ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074; - } - -@@ -812,8 +577,8 @@ static int ath11k_ahb_map_service_to_pip - bool ul_set = false, dl_set = false; - int i; - -- for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) { -- entry = &target_service_to_ce_map_wlan[i]; -+ for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) { -+ entry = &ab->hw_params.svc_to_ce_map[i]; - - if (__le32_to_cpu(entry->service_id) != service_id) - continue; ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -41,6 +41,39 @@ static const struct ath11k_hw_params ath - .regs = &ipq8074_regs, - .host_ce_config = ath11k_host_ce_config_ipq8074, - .ce_count = 12, -+ .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, -+ .target_ce_count = 11, -+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074, -+ .svc_to_ce_map_len = 21, -+ .single_pdev_only = false, -+ .needs_band_to_mac = true, -+ .rxdma1_enable = true, -+ .num_rxmda_per_pdev = 1, -+ .rx_mac_buf_ring = false, -+ .vdev_start_delay = false, -+ .htt_peer_map_v2 = true, -+ .tcl_0_only = false, -+ }, -+ { -+ .hw_rev = ATH11K_HW_IPQ6018, -+ .name = "ipq6018 hw1.0", -+ .fw = { -+ .dir = "IPQ6018/hw1.0", -+ .board_size = 256 * 1024, -+ .cal_size = 256 * 1024, -+ }, -+ .max_radios = 2, -+ .bdf_addr = 0x4ABC0000, -+ .hw_ops = &ipq6018_ops, -+ .ring_mask = &ath11k_hw_ring_mask_ipq8074, -+ .internal_sleep_clock = false, -+ .regs = &ipq8074_regs, -+ .host_ce_config = ath11k_host_ce_config_ipq8074, -+ .ce_count = 12, -+ .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, -+ .target_ce_count = 11, -+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq6018, -+ .svc_to_ce_map_len = 19, - .single_pdev_only = false, - .needs_band_to_mac = true, - .rxdma1_enable = true, -@@ -66,6 +99,10 @@ static const struct ath11k_hw_params ath - .regs = &qca6390_regs, - .host_ce_config = ath11k_host_ce_config_qca6390, - .ce_count = 9, -+ .target_ce_config = ath11k_target_ce_config_wlan_qca6390, -+ .target_ce_count = 9, -+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390, -+ .svc_to_ce_map_len = 14, - .single_pdev_only = true, - .needs_band_to_mac = false, - .rxdma1_enable = false, -@@ -902,12 +939,6 @@ int ath11k_core_init(struct ath11k_base - return ret; - } - -- ret = ath11k_init_hw_params(ab); -- if (ret) { -- ath11k_err(ab, "failed to get hw params %d\n", ret); -- return ret; -- } -- - ret = ath11k_core_soc_create(ab); - if (ret) { - ath11k_err(ab, "failed to create soc core: %d\n", ret); ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -99,6 +99,7 @@ struct ath11k_skb_rxcb { - - enum ath11k_hw_rev { - ATH11K_HW_IPQ8074, -+ ATH11K_HW_IPQ6018, - ATH11K_HW_QCA6390_HW20, - }; - -@@ -892,6 +893,13 @@ struct ath11k_fw_stats_bcn { - u32 tx_bcn_outage_cnt; - }; - -+extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[]; -+extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[]; -+extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[]; -+ -+extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[]; -+extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; -+ - void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); - void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, - u8 *mac_addr, u16 ast_hash); ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -276,6 +276,518 @@ const struct ath11k_hw_ring_mask ath11k_ - }, - }; - -+/* Target firmware's Copy Engine configuration. */ -+const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[] = { -+ /* CE0: host->target HTC control and raw streams */ -+ { -+ .pipenum = __cpu_to_le32(0), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE1: target->host HTT + HTC control */ -+ { -+ .pipenum = __cpu_to_le32(1), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE2: target->host WMI */ -+ { -+ .pipenum = __cpu_to_le32(2), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE3: host->target WMI */ -+ { -+ .pipenum = __cpu_to_le32(3), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE4: host->target HTT */ -+ { -+ .pipenum = __cpu_to_le32(4), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(256), -+ .nbytes_max = __cpu_to_le32(256), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE5: target->host Pktlog */ -+ { -+ .pipenum = __cpu_to_le32(5), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(0), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE6: Reserved for target autonomous hif_memcpy */ -+ { -+ .pipenum = __cpu_to_le32(6), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(65535), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE7 used only by Host */ -+ { -+ .pipenum = __cpu_to_le32(7), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE8 target->host used only by IPA */ -+ { -+ .pipenum = __cpu_to_le32(8), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(65535), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE9 host->target HTT */ -+ { -+ .pipenum = __cpu_to_le32(9), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE10 target->host HTT */ -+ { -+ .pipenum = __cpu_to_le32(10), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H), -+ .nentries = __cpu_to_le32(0), -+ .nbytes_max = __cpu_to_le32(0), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE11 Not used */ -+}; -+ -+/* Map from service/endpoint to Copy Engine. -+ * This table is derived from the CE_PCI TABLE, above. -+ * It is passed to the Target at startup for use by firmware. -+ */ -+const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[] = { -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(7), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(9), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(0), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { /* not used */ -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(0), -+ }, -+ { /* not used */ -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(4), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(5), -+ }, -+ -+ /* (Additions here) */ -+ -+ { /* terminator entry */ } -+}; -+ -+const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[] = { -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(3), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(7), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(2), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(0), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { /* not used */ -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(0), -+ }, -+ { /* not used */ -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ .pipenum = __cpu_to_le32(4), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(1), -+ }, -+ { -+ .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ .pipenum = __cpu_to_le32(5), -+ }, -+ -+ /* (Additions here) */ -+ -+ { /* terminator entry */ } -+}; -+ -+/* Target firmware's Copy Engine configuration. */ -+const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[] = { -+ /* CE0: host->target HTC control and raw streams */ -+ { -+ .pipenum = __cpu_to_le32(0), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE1: target->host HTT + HTC control */ -+ { -+ .pipenum = __cpu_to_le32(1), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE2: target->host WMI */ -+ { -+ .pipenum = __cpu_to_le32(2), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE3: host->target WMI */ -+ { -+ .pipenum = __cpu_to_le32(3), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE4: host->target HTT */ -+ { -+ .pipenum = __cpu_to_le32(4), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(256), -+ .nbytes_max = __cpu_to_le32(256), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE5: target->host Pktlog */ -+ { -+ .pipenum = __cpu_to_le32(5), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE6: Reserved for target autonomous hif_memcpy */ -+ { -+ .pipenum = __cpu_to_le32(6), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(16384), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE7 used only by Host */ -+ { -+ .pipenum = __cpu_to_le32(7), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H), -+ .nentries = __cpu_to_le32(0), -+ .nbytes_max = __cpu_to_le32(0), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE8 target->host used only by IPA */ -+ { -+ .pipenum = __cpu_to_le32(8), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(16384), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ /* CE 9, 10, 11 are used by MHI driver */ -+}; -+ -+/* Map from service/endpoint to Copy Engine. -+ * This table is derived from the CE_PCI TABLE, above. -+ * It is passed to the Target at startup for use by firmware. -+ */ -+const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[] = { -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(0), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(4), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(1), -+ }, -+ -+ /* (Additions here) */ -+ -+ { /* must be last */ -+ __cpu_to_le32(0), -+ __cpu_to_le32(0), -+ __cpu_to_le32(0), -+ }, -+}; -+ - const struct ath11k_hw_regs ipq8074_regs = { - /* SW2TCL(x) R0 ring configuration address */ - .hal_tcl1_ring_base_lsb = 0x00000510, ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -129,7 +129,6 @@ struct ath11k_hw_params { - } fw; - - const struct ath11k_hw_ops *hw_ops; -- - const struct ath11k_hw_ring_mask *ring_mask; - - bool internal_sleep_clock; -@@ -137,6 +136,10 @@ struct ath11k_hw_params { - const struct ath11k_hw_regs *regs; - const struct ce_attr *host_ce_config; - u32 ce_count; -+ const struct ce_pipe_config *target_ce_config; -+ u32 target_ce_count; -+ const struct service_to_pipe *svc_to_ce_map; -+ u32 svc_to_ce_map_len; - - bool single_pdev_only; - ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -51,187 +51,6 @@ static const struct ath11k_msi_config ms - }, - }; - --/* Target firmware's Copy Engine configuration. */ --static const struct ce_pipe_config target_ce_config_wlan[] = { -- /* CE0: host->target HTC control and raw streams */ -- { -- .pipenum = __cpu_to_le32(0), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE1: target->host HTT + HTC control */ -- { -- .pipenum = __cpu_to_le32(1), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE2: target->host WMI */ -- { -- .pipenum = __cpu_to_le32(2), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE3: host->target WMI */ -- { -- .pipenum = __cpu_to_le32(3), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE4: host->target HTT */ -- { -- .pipenum = __cpu_to_le32(4), -- .pipedir = __cpu_to_le32(PIPEDIR_OUT), -- .nentries = __cpu_to_le32(256), -- .nbytes_max = __cpu_to_le32(256), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE5: target->host Pktlog */ -- { -- .pipenum = __cpu_to_le32(5), -- .pipedir = __cpu_to_le32(PIPEDIR_IN), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(2048), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE6: Reserved for target autonomous hif_memcpy */ -- { -- .pipenum = __cpu_to_le32(6), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(16384), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE7 used only by Host */ -- { -- .pipenum = __cpu_to_le32(7), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H), -- .nentries = __cpu_to_le32(0), -- .nbytes_max = __cpu_to_le32(0), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -- .reserved = __cpu_to_le32(0), -- }, -- -- /* CE8 target->host used only by IPA */ -- { -- .pipenum = __cpu_to_le32(8), -- .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -- .nentries = __cpu_to_le32(32), -- .nbytes_max = __cpu_to_le32(16384), -- .flags = __cpu_to_le32(CE_ATTR_FLAGS), -- .reserved = __cpu_to_le32(0), -- }, -- /* CE 9, 10, 11 are used by MHI driver */ --}; -- --/* Map from service/endpoint to Copy Engine. -- * This table is derived from the CE_PCI TABLE, above. -- * It is passed to the Target at startup for use by firmware. -- */ --static const struct service_to_pipe target_service_to_ce_map_wlan[] = { -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(3), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(3), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(3), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(3), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(3), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(0), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(2), -- }, -- -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -- __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -- __cpu_to_le32(4), -- }, -- { -- __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -- __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -- __cpu_to_le32(1), -- }, -- -- /* (Additions here) */ -- -- { /* must be last */ -- __cpu_to_le32(0), -- __cpu_to_le32(0), -- __cpu_to_le32(0), -- }, --}; -- - static const char *irq_name[ATH11K_IRQ_NUM_MAX] = { - "bhi", - "mhi-er0", -@@ -757,11 +576,11 @@ static void ath11k_pci_init_qmi_ce_confi - { - struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; - -- cfg->tgt_ce = target_ce_config_wlan; -- cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan); -+ cfg->tgt_ce = ab->hw_params.target_ce_config; -+ cfg->tgt_ce_len = ab->hw_params.target_ce_count; - -- cfg->svc_to_ce_map = target_service_to_ce_map_wlan; -- cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan); -+ cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; -+ cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; - ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390; - } - -@@ -965,8 +784,8 @@ static int ath11k_pci_map_service_to_pip - bool ul_set = false, dl_set = false; - int i; - -- for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) { -- entry = &target_service_to_ce_map_wlan[i]; -+ for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) { -+ entry = &ab->hw_params.svc_to_ce_map[i]; - - if (__le32_to_cpu(entry->service_id) != service_id) - continue; -@@ -1027,6 +846,16 @@ static int ath11k_pci_probe(struct pci_d - - switch (pci_dev->device) { - case QCA6390_DEVICE_ID: -+ hw_rev = ATH11K_HW_QCA6390_HW20; -+ break; -+ default: -+ dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -+ pci_dev->device); -+ return -ENOTSUPP; -+ } -+ -+ switch (pci_dev->device) { -+ case QCA6390_DEVICE_ID: - hw_rev = ATH11K_HW_QCA6390_HW20; - break; - default: diff --git a/feeds/wifi-ax/mac80211/patches/qca/059-ath11k-add-he-fields-into-radiotap-header.patch b/feeds/wifi-ax/mac80211/patches/qca/059-ath11k-add-he-fields-into-radiotap-header.patch index 7cb2ffae2..221421a36 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/059-ath11k-add-he-fields-into-radiotap-header.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/059-ath11k-add-he-fields-into-radiotap-header.patch @@ -20,16 +20,7 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -246,7 +246,7 @@ static u8 *ath11k_dp_rxdesc_get_80211hdr - { - u8 *rx_pkt_hdr; - -- rx_pkt_hdr = &rx_desc->msdu_payload[0]; -+ rx_pkt_hdr = &rx_desc->hdr_status[0]; - - return rx_pkt_hdr; - } -@@ -2373,7 +2373,7 @@ static void ath11k_dp_rx_deliver_msdu(st +@@ -2371,7 +2371,7 @@ static void ath11k_dp_rx_deliver_msdu(st char tid[32]; status = IEEE80211_SKB_RXCB(msdu); @@ -38,25 +29,23 @@ Signed-off-by: Miles Hu he = skb_push(msdu, sizeof(known)); memcpy(he, &known, sizeof(known)); status->flag |= RX_FLAG_RADIOTAP_HE; -@@ -4688,12 +4688,16 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - struct ieee80211_rx_status *rxs) +@@ -4720,13 +4720,14 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 { + struct ath11k_base *ab = ar->ab; struct sk_buff *msdu, *mpdu_buf, *prev_buf; -- u32 decap_format, wifi_hdr_len; -+ u32 decap_format; +- u32 wifi_hdr_len; struct hal_rx_desc *rx_desc; char *hdr_desc; - u8 *dest; + u8 *dest, decap_format; struct ieee80211_hdr_3addr *wh; - + struct rx_attention *rx_attention; + static u32 pkt_type = 0; -+ + + pkt_type++; -+ mpdu_buf = NULL; if (!head_msdu) -@@ -4725,38 +4729,27 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 +@@ -4759,38 +4760,28 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 skb_trim(prev_buf, prev_buf->len - HAL_RX_FCS_LEN); } else if (decap_format == DP_RX_DECAP_TYPE_NATIVE_WIFI) { @@ -64,7 +53,7 @@ Signed-off-by: Miles Hu u8 qos_pkt = 0; rx_desc = (struct hal_rx_desc *)head_msdu->data; - hdr_desc = ath11k_dp_rxdesc_get_80211hdr(rx_desc); + hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); /* Base size */ - wifi_hdr_len = sizeof(struct ieee80211_hdr_3addr); @@ -81,8 +70,8 @@ Signed-off-by: Miles Hu while (msdu) { - rx_desc = (struct hal_rx_desc *)msdu->data; -- hdr_desc = ath11k_dp_rxdesc_get_80211hdr(rx_desc); -- +- hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); + + ath11k_dp_rx_msdus_set_payload(msdu); if (qos_pkt) { dest = skb_push(msdu, sizeof(__le16)); @@ -93,11 +82,11 @@ Signed-off-by: Miles Hu - (u8 *)&qos_field, sizeof(__le16)); + memcpy(dest, hdr_desc, sizeof(struct ieee80211_qos_hdr)); } -- ath11k_dp_rx_msdus_set_payload(msdu); +- ath11k_dp_rx_msdus_set_payload(ar, msdu); prev_buf = msdu; msdu = msdu->next; } -@@ -4786,8 +4779,85 @@ err_merge_fail: +@@ -4820,8 +4811,85 @@ err_merge_fail: return NULL; } @@ -183,7 +172,7 @@ Signed-off-by: Miles Hu struct sk_buff *tail_msdu, struct napi_struct *napi) { -@@ -4818,10 +4888,9 @@ static int ath11k_dp_rx_mon_deliver(stru +@@ -4852,10 +4920,9 @@ static int ath11k_dp_rx_mon_deliver(stru rxs->flag |= RX_FLAG_ALLOW_SAME_PN; } rxs->flag |= RX_FLAG_ONLY_MONITOR; @@ -195,7 +184,7 @@ Signed-off-by: Miles Hu ath11k_dp_rx_deliver_msdu(ar, napi, mon_skb); mon_skb = skb_next; } while (mon_skb); -@@ -4888,6 +4957,7 @@ static void ath11k_dp_rx_mon_dest_proces +@@ -4928,6 +4995,7 @@ static void ath11k_dp_rx_mon_dest_proces } if (head_msdu && tail_msdu) { ath11k_dp_rx_mon_deliver(ar, dp->mac_id, head_msdu, @@ -203,7 +192,7 @@ Signed-off-by: Miles Hu tail_msdu, napi); rx_mon_stats->dest_mpdu_done++; } -@@ -4928,6 +4998,8 @@ static void ath11k_dp_rx_mon_status_proc +@@ -4974,6 +5042,8 @@ static void ath11k_dp_rx_mon_status_proc while (!skb_queue_empty(&pmon->rx_status_q)) { status_skb = skb_dequeue(&pmon->rx_status_q); @@ -224,7 +213,7 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -836,12 +836,75 @@ void ath11k_hal_reo_hw_setup(struct ath1 +@@ -838,12 +838,75 @@ void ath11k_hal_reo_hw_setup(struct ath1 ring_hash_map)); } @@ -302,7 +291,7 @@ Signed-off-by: Miles Hu switch (tlv_tag) { case HAL_RX_PPDU_START: { -@@ -862,6 +925,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -864,6 +927,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc info0 = __le32_to_cpu(eu_stats->info0); info1 = __le32_to_cpu(eu_stats->info1); @@ -312,7 +301,7 @@ Signed-off-by: Miles Hu ppdu_info->tid = ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP, __le32_to_cpu(eu_stats->info6))) - 1; -@@ -885,6 +951,42 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -887,6 +953,42 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ppdu_info->num_mpdu_fcs_err = FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR, info0); @@ -355,7 +344,7 @@ Signed-off-by: Miles Hu break; } case HAL_PHYRX_HT_SIG: { -@@ -951,7 +1053,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -953,7 +1055,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc info1 = __le32_to_cpu(vht_sig->info1); ppdu_info->ldpc = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO1_SU_MU_CODING, @@ -364,7 +353,7 @@ Signed-off-by: Miles Hu ppdu_info->mcs = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO1_MCS, info1); gi_setting = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO1_GI_SETTING, -@@ -983,23 +1085,153 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -985,23 +1087,153 @@ ath11k_hal_rx_parse_mon_status_tlv(struc else ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO; @@ -520,7 +509,7 @@ Signed-off-by: Miles Hu ppdu_info->is_stbc = info1 & HAL_RX_HE_SIG_A_SU_INFO_INFO1_STBC; ppdu_info->beamformed = info1 & -@@ -1009,22 +1241,6 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1011,22 +1243,6 @@ ath11k_hal_rx_parse_mon_status_tlv(struc info0); nsts = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS, info0); @@ -543,7 +532,7 @@ Signed-off-by: Miles Hu ppdu_info->nss = nsts + 1; ppdu_info->dcm = dcm; ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU; -@@ -1034,32 +1250,133 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1036,32 +1252,133 @@ ath11k_hal_rx_parse_mon_status_tlv(struc struct hal_rx_he_sig_a_mu_dl_info *he_sig_a_mu_dl = (struct hal_rx_he_sig_a_mu_dl_info *)tlv_data; @@ -689,7 +678,7 @@ Signed-off-by: Miles Hu ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO; break; } -@@ -1073,6 +1390,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1075,6 +1392,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ru_tones = FIELD_GET(HAL_RX_HE_SIG_B1_MU_INFO_INFO0_RU_ALLOCATION, info0); ppdu_info->ru_alloc = ath11k_he_ru_tones_to_nl80211_he_ru_alloc(ru_tones); @@ -697,7 +686,7 @@ Signed-off-by: Miles Hu ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO; break; } -@@ -1082,14 +1400,25 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1084,14 +1402,25 @@ ath11k_hal_rx_parse_mon_status_tlv(struc info0 = __le32_to_cpu(he_sig_b2_mu->info0); @@ -727,7 +716,7 @@ Signed-off-by: Miles Hu break; } case HAL_PHYRX_HE_SIG_B2_OFDMA: { -@@ -1098,17 +1427,38 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1100,17 +1429,38 @@ ath11k_hal_rx_parse_mon_status_tlv(struc info0 = __le32_to_cpu(he_sig_b2_ofdma->info0); @@ -770,7 +759,7 @@ Signed-off-by: Miles Hu ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_OFDMA; break; } -@@ -1121,7 +1471,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1123,7 +1473,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc * PHYRX_OTHER_RECEIVE_INFO TLV. */ ppdu_info->rssi_comb = @@ -779,7 +768,7 @@ Signed-off-by: Miles Hu __le32_to_cpu(rssi->info0)); break; } -@@ -1142,6 +1492,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1144,6 +1494,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ppdu_info->rx_duration = FIELD_GET(HAL_RX_PPDU_END_DURATION, __le32_to_cpu(ppdu_rx_duration->info0)); @@ -788,7 +777,7 @@ Signed-off-by: Miles Hu break; } case HAL_DUMMY: -@@ -1165,12 +1517,14 @@ ath11k_hal_rx_parse_mon_status(struct at +@@ -1167,12 +1519,14 @@ ath11k_hal_rx_parse_mon_status(struct at enum hal_rx_mon_status hal_status = HAL_RX_MON_STATUS_BUF_DONE; u16 tlv_tag; u16 tlv_len; @@ -803,7 +792,7 @@ Signed-off-by: Miles Hu ptr += sizeof(*tlv); /* The actual length of PPDU_END is the combined length of many PHY -@@ -1182,7 +1536,7 @@ ath11k_hal_rx_parse_mon_status(struct at +@@ -1184,7 +1538,7 @@ ath11k_hal_rx_parse_mon_status(struct at tlv_len = sizeof(struct hal_rx_rxpcu_classification_overview); hal_status = ath11k_hal_rx_parse_mon_status_tlv(ab, ppdu_info, @@ -1134,19 +1123,3 @@ Signed-off-by: Miles Hu +#define HE_STA_CODING_KNOWN 0x80 + #endif ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3567,6 +3567,13 @@ u64 ieee80211_calculate_rx_timestamp(str - if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) - ri.flags |= RATE_INFO_FLAGS_SHORT_GI; - break; -+ case RX_ENC_HE: -+ ri.flags |= RATE_INFO_FLAGS_HE_MCS; -+ ri.mcs = status->rate_idx; -+ ri.nss = status->nss; -+ if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) -+ ri.flags |= RATE_INFO_FLAGS_SHORT_GI; -+ break; - default: - WARN_ON(1); - fallthrough; diff --git a/feeds/wifi-ax/mac80211/patches/qca/063-mac80211-fix-low-tput-for-mesh-forwarding.patch b/feeds/wifi-ax/mac80211/patches/qca/063-mac80211-fix-low-tput-for-mesh-forwarding.patch index 13c05d7a1..6e1836e34 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/063-mac80211-fix-low-tput-for-mesh-forwarding.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/063-mac80211-fix-low-tput-for-mesh-forwarding.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -298,16 +298,16 @@ out: +@@ -350,16 +350,16 @@ out: local_bh_enable(); } @@ -21,7 +21,7 @@ if (local->hw.queues < IEEE80211_NUM_ACS) n_acs = 1; -@@ -316,7 +316,7 @@ _ieee80211_wake_txqs(struct ieee80211_lo +@@ -368,7 +368,7 @@ _ieee80211_wake_txqs(struct ieee80211_lo if (local->queue_stop_reasons[i]) continue; @@ -30,7 +30,7 @@ list_for_each_entry_rcu(sdata, &local->interfaces, list) { int ac; -@@ -328,20 +328,11 @@ _ieee80211_wake_txqs(struct ieee80211_lo +@@ -380,21 +380,11 @@ _ieee80211_wake_txqs(struct ieee80211_lo __ieee80211_wake_txqs(sdata, ac); } } @@ -41,9 +41,10 @@ - rcu_read_unlock(); -} - --void ieee80211_wake_txqs(unsigned long data) +-void ieee80211_wake_txqs(struct tasklet_struct *t) -{ -- struct ieee80211_local *local = (struct ieee80211_local *)data; +- struct ieee80211_local *local = from_tasklet(local, t, +- wake_txqs_tasklet); - unsigned long flags; - - spin_lock_irqsave(&local->queue_stop_reason_lock, flags); @@ -53,7 +54,7 @@ } void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue) -@@ -379,8 +370,7 @@ void ieee80211_propagate_queue_wake(stru +@@ -432,8 +422,7 @@ void ieee80211_propagate_queue_wake(stru static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, enum queue_stop_reason reason, @@ -63,7 +64,7 @@ { struct ieee80211_local *local = hw_to_local(hw); -@@ -414,19 +404,8 @@ static void __ieee80211_wake_queue(struc +@@ -467,19 +456,8 @@ static void __ieee80211_wake_queue(struc } else tasklet_schedule(&local->tx_pending_tasklet); @@ -85,7 +86,7 @@ } void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, -@@ -437,7 +416,7 @@ void ieee80211_wake_queue_by_reason(stru +@@ -490,7 +468,7 @@ void ieee80211_wake_queue_by_reason(stru unsigned long flags; spin_lock_irqsave(&local->queue_stop_reason_lock, flags); @@ -94,7 +95,7 @@ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); } -@@ -534,7 +513,7 @@ void ieee80211_add_pending_skb(struct ie +@@ -587,7 +565,7 @@ void ieee80211_add_pending_skb(struct ie false); __skb_queue_tail(&local->pending[queue], skb); __ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD, @@ -103,7 +104,7 @@ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); } -@@ -567,7 +546,7 @@ void ieee80211_add_pending_skbs(struct i +@@ -620,7 +598,7 @@ void ieee80211_add_pending_skbs(struct i for (i = 0; i < hw->queues; i++) __ieee80211_wake_queue(hw, i, IEEE80211_QUEUE_STOP_REASON_SKB_ADD, @@ -112,7 +113,7 @@ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); } -@@ -625,7 +604,7 @@ void ieee80211_wake_queues_by_reason(str +@@ -678,7 +656,7 @@ void ieee80211_wake_queues_by_reason(str spin_lock_irqsave(&local->queue_stop_reason_lock, flags); for_each_set_bit(i, &queues, hw->queues) diff --git a/feeds/wifi-ax/mac80211/patches/qca/065-ath11k-add-HE-fix-rate-support.patch b/feeds/wifi-ax/mac80211/patches/qca/065-ath11k-add-HE-fix-rate-support.patch index c1ea127ad..2abe07e78 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/065-ath11k-add-HE-fix-rate-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/065-ath11k-add-HE-fix-rate-support.patch @@ -18,7 +18,7 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -361,6 +361,18 @@ ath11k_mac_max_vht_nss(const u16 vht_mcs +@@ -356,6 +356,18 @@ ath11k_mac_max_vht_nss(const u16 vht_mcs return 1; } @@ -37,7 +37,7 @@ Signed-off-by: Miles Hu static u8 ath11k_parse_mpdudensity(u8 mpdudensity) { /* 802.11n D2.0 defined values for "Minimum MPDU Start Spacing": -@@ -1520,17 +1532,106 @@ static void ath11k_peer_assoc_h_vht(stru +@@ -1506,18 +1518,107 @@ static void ath11k_peer_assoc_h_vht(stru /* TODO: rxnss_override */ } @@ -123,6 +123,7 @@ Signed-off-by: Miles Hu + struct ath11k_vif *arvif = (void *)vif->drv_priv; + struct cfg80211_chan_def def; const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + u8 ampdu_factor; - u16 v; + enum nl80211_band band; + const u16 *he_mcs_mask; @@ -145,7 +146,7 @@ Signed-off-by: Miles Hu arg->he_flag = true; memcpy(&arg->peer_he_cap_macinfo, he_cap->he_cap_elem.mac_cap_info, -@@ -1586,17 +1687,22 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1597,17 +1698,22 @@ static void ath11k_peer_assoc_h_he(struc arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v; v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80p80); @@ -168,7 +169,7 @@ Signed-off-by: Miles Hu fallthrough; default: -@@ -1604,11 +1710,29 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1615,11 +1721,29 @@ static void ath11k_peer_assoc_h_he(struc arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = v; v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80); @@ -198,7 +199,7 @@ Signed-off-by: Miles Hu } static void ath11k_peer_assoc_h_smps(struct ieee80211_sta *sta, -@@ -1811,6 +1935,7 @@ static void ath11k_peer_assoc_h_phymode( +@@ -1822,6 +1946,7 @@ static void ath11k_peer_assoc_h_phymode( enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; @@ -206,7 +207,7 @@ Signed-off-by: Miles Hu enum wmi_phy_mode phymode = MODE_UNKNOWN; if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) -@@ -1819,10 +1944,12 @@ static void ath11k_peer_assoc_h_phymode( +@@ -1830,10 +1955,12 @@ static void ath11k_peer_assoc_h_phymode( band = def.chan->band; ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; @@ -220,7 +221,7 @@ Signed-off-by: Miles Hu if (sta->bandwidth == IEEE80211_STA_RX_BW_80) phymode = MODE_11AX_HE80_2G; else if (sta->bandwidth == IEEE80211_STA_RX_BW_40) -@@ -1850,7 +1977,8 @@ static void ath11k_peer_assoc_h_phymode( +@@ -1861,7 +1988,8 @@ static void ath11k_peer_assoc_h_phymode( case NL80211_BAND_5GHZ: case NL80211_BAND_6GHZ: /* Check HE first */ @@ -230,7 +231,7 @@ Signed-off-by: Miles Hu phymode = ath11k_mac_get_phymode_he(ar, sta); } else if (sta->vht_cap.vht_supported && !ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) { -@@ -2892,6 +3020,20 @@ ath11k_mac_bitrate_mask_num_vht_rates(st +@@ -3114,6 +3242,20 @@ ath11k_mac_bitrate_mask_num_vht_rates(st } static int @@ -251,7 +252,7 @@ Signed-off-by: Miles Hu ath11k_mac_set_peer_vht_fixed_rate(struct ath11k_vif *arvif, struct ieee80211_sta *sta, const struct cfg80211_bitrate_mask *mask, -@@ -2937,6 +3079,52 @@ ath11k_mac_set_peer_vht_fixed_rate(struc +@@ -3159,6 +3301,52 @@ ath11k_mac_set_peer_vht_fixed_rate(struc return ret; } @@ -304,7 +305,7 @@ Signed-off-by: Miles Hu static int ath11k_station_assoc(struct ath11k *ar, struct ieee80211_vif *vif, struct ieee80211_sta *sta, -@@ -3055,8 +3243,9 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3277,8 +3465,9 @@ static void ath11k_sta_rc_update_wk(stru enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; @@ -315,7 +316,7 @@ Signed-off-by: Miles Hu const struct cfg80211_bitrate_mask *mask; struct peer_assoc_params peer_arg; -@@ -3071,6 +3260,7 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3293,6 +3482,7 @@ static void ath11k_sta_rc_update_wk(stru band = def.chan->band; ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; @@ -323,7 +324,7 @@ Signed-off-by: Miles Hu spin_lock_bh(&ar->data_lock); -@@ -3086,8 +3276,9 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3308,8 +3498,9 @@ static void ath11k_sta_rc_update_wk(stru mutex_lock(&ar->conf_mutex); nss = max_t(u32, 1, nss); @@ -335,7 +336,7 @@ Signed-off-by: Miles Hu if (changed & IEEE80211_RC_BW_CHANGED) { err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, -@@ -3123,6 +3314,8 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3345,6 +3536,8 @@ static void ath11k_sta_rc_update_wk(stru mask = &arvif->bitrate_mask; num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask); @@ -344,7 +345,7 @@ Signed-off-by: Miles Hu /* Peer_assoc_prepare will reject vht rates in * bitrate_mask if its not available in range format and -@@ -3138,6 +3331,9 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3360,6 +3553,9 @@ static void ath11k_sta_rc_update_wk(stru if (sta->vht_cap.vht_supported && num_vht_rates == 1) { ath11k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, band); @@ -354,7 +355,7 @@ Signed-off-by: Miles Hu } else { /* If the peer is non-VHT or no fixed VHT rate * is provided in the new bitrate mask we set the -@@ -4734,6 +4930,8 @@ static int ath11k_mac_op_add_interface(s +@@ -4974,6 +5170,8 @@ static int ath11k_mac_op_add_interface(s sizeof(arvif->bitrate_mask.control[i].ht_mcs)); memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, sizeof(arvif->bitrate_mask.control[i].vht_mcs)); @@ -363,7 +364,7 @@ Signed-off-by: Miles Hu } bit = __ffs64(ab->free_vdev_map); -@@ -5733,9 +5931,25 @@ ath11k_mac_has_single_legacy_rate(struct +@@ -5996,9 +6194,25 @@ ath11k_mac_has_single_legacy_rate(struct if (ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask)) return false; @@ -389,7 +390,7 @@ Signed-off-by: Miles Hu static bool ath11k_mac_bitrate_mask_get_single_nss(struct ath11k *ar, enum nl80211_band band, -@@ -5744,8 +5958,10 @@ ath11k_mac_bitrate_mask_get_single_nss(s +@@ -6007,8 +6221,10 @@ ath11k_mac_bitrate_mask_get_single_nss(s { struct ieee80211_supported_band *sband = &ar->mac.sbands[band]; u16 vht_mcs_map = le16_to_cpu(sband->vht_cap.vht_mcs.tx_mcs_map); @@ -400,7 +401,7 @@ Signed-off-by: Miles Hu int i; /* No need to consider legacy here. Basic rates are always present -@@ -5772,7 +5988,19 @@ ath11k_mac_bitrate_mask_get_single_nss(s +@@ -6035,7 +6251,19 @@ ath11k_mac_bitrate_mask_get_single_nss(s return false; } @@ -421,7 +422,7 @@ Signed-off-by: Miles Hu return false; if (ht_nss_mask == 0) -@@ -5820,7 +6048,8 @@ ath11k_mac_get_single_legacy_rate(struct +@@ -6083,7 +6311,8 @@ ath11k_mac_get_single_legacy_rate(struct } static int ath11k_mac_set_fixed_rate_params(struct ath11k_vif *arvif, @@ -431,8 +432,8 @@ Signed-off-by: Miles Hu { struct ath11k *ar = arvif->ar; u32 vdev_param; -@@ -5831,15 +6060,16 @@ static int ath11k_mac_set_fixed_rate_par - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02hhx nss %hhu sgi %hhu\n", +@@ -6094,15 +6323,16 @@ static int ath11k_mac_set_fixed_rate_par + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02x nss %u sgi %u\n", arvif->vdev_id, rate, nss, sgi); - vdev_param = WMI_VDEV_PARAM_FIXED_RATE; @@ -456,7 +457,7 @@ Signed-off-by: Miles Hu vdev_param = WMI_VDEV_PARAM_NSS; ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, vdev_param, nss); -@@ -5849,24 +6079,52 @@ static int ath11k_mac_set_fixed_rate_par +@@ -6112,24 +6342,52 @@ static int ath11k_mac_set_fixed_rate_par return ret; } @@ -520,7 +521,7 @@ Signed-off-by: Miles Hu return 0; } -@@ -5895,6 +6153,31 @@ ath11k_mac_vht_mcs_range_present(struct +@@ -6158,6 +6416,31 @@ ath11k_mac_vht_mcs_range_present(struct return true; } @@ -552,7 +553,7 @@ Signed-off-by: Miles Hu static void ath11k_mac_set_bitrate_mask_iter(void *data, struct ieee80211_sta *sta) { -@@ -5937,10 +6220,12 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6200,10 +6483,12 @@ ath11k_mac_op_set_bitrate_mask(struct ie enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; @@ -565,7 +566,7 @@ Signed-off-by: Miles Hu int single_nss; int ret; int num_rates; -@@ -5951,12 +6236,16 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6214,12 +6499,16 @@ ath11k_mac_op_set_bitrate_mask(struct ie band = def.chan->band; ht_mcs_mask = mask->control[band].ht_mcs; vht_mcs_mask = mask->control[band].vht_mcs; @@ -582,7 +583,7 @@ Signed-off-by: Miles Hu /* mac80211 doesn't support sending a fixed HT/VHT MCS alone, rather it * requires passing atleast one of used basic rates along with them. * Fixed rate setting across different preambles(legacy, HT, VHT) is -@@ -5983,8 +6272,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6246,8 +6535,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie } else { rate = WMI_FIXED_RATE_NONE; nss = min_t(u32, ar->num_tx_chains, @@ -594,7 +595,7 @@ Signed-off-by: Miles Hu /* If multiple rates across different preambles are given * we can reconfigure this info with all peers using PEER_ASSOC -@@ -6019,6 +6309,16 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6282,6 +6572,16 @@ ath11k_mac_op_set_bitrate_mask(struct ie return -EINVAL; } @@ -611,7 +612,7 @@ Signed-off-by: Miles Hu ieee80211_iterate_stations_atomic(ar->hw, ath11k_mac_disable_peer_fixed_rate, arvif); -@@ -6035,7 +6335,8 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6298,7 +6598,8 @@ ath11k_mac_op_set_bitrate_mask(struct ie mutex_lock(&ar->conf_mutex); @@ -623,7 +624,7 @@ Signed-off-by: Miles Hu arvif->vdev_id, ret); --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -466,6 +466,7 @@ struct ieee80211_supported_band { +@@ -481,6 +481,7 @@ struct ieee80211_supported_band { struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_vht_cap vht_cap; struct ieee80211_sta_s1g_cap s1g_cap; @@ -631,78 +632,9 @@ Signed-off-by: Miles Hu struct ieee80211_edmg edmg_cap; u16 n_iftype_data; const struct ieee80211_sband_iftype_data *iftype_data; -@@ -679,7 +680,10 @@ struct cfg80211_bitrate_mask { - u32 legacy; - u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; - u16 vht_mcs[NL80211_VHT_NSS_MAX]; -+ u16 he_mcs[NL80211_HE_NSS_MAX]; - enum nl80211_txrate_gi gi; -+ enum nl80211_he_gi he_gi; -+ enum nl80211_he_ltf he_ltf; - } control[NUM_NL80211_BANDS]; - }; - ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -3187,6 +3187,18 @@ enum nl80211_he_gi { - }; - - /** -+ * enum nl80211_he_ltf - HE long training field -+ * @NL80211_RATE_INFO_HE_1xLTF: 3.2 usec -+ * @NL80211_RATE_INFO_HE_2xLTF: 6.4 usec -+ * @NL80211_RATE_INFO_HE_4xLTF: 12.8 usec -+ */ -+enum nl80211_he_ltf { -+ NL80211_RATE_INFO_HE_1XLTF, -+ NL80211_RATE_INFO_HE_2XLTF, -+ NL80211_RATE_INFO_HE_4XLTF, -+}; -+ -+/** - * enum nl80211_he_ru_alloc - HE RU allocation values - * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation - * @NL80211_RATE_INFO_HE_RU_ALLOC_52: 52-tone RU allocation -@@ -4741,6 +4753,10 @@ enum nl80211_key_attributes { - * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection, - * see &struct nl80211_txrate_vht - * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi -+ * @NL80211_TXRATE_HE: HE rates allowed for TX rate selection, -+ * see &struct nl80211_txrate_he -+ * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us. -+ * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF. - * @__NL80211_TXRATE_AFTER_LAST: internal - * @NL80211_TXRATE_MAX: highest TX rate attribute - */ -@@ -4750,6 +4766,9 @@ enum nl80211_tx_rate_attributes { - NL80211_TXRATE_HT, - NL80211_TXRATE_VHT, - NL80211_TXRATE_GI, -+ NL80211_TXRATE_HE, -+ NL80211_TXRATE_HE_GI, -+ NL80211_TXRATE_HE_LTF, - - /* keep last */ - __NL80211_TXRATE_AFTER_LAST, -@@ -4767,6 +4786,15 @@ struct nl80211_txrate_vht { - __u16 mcs[NL80211_VHT_NSS_MAX]; - }; - -+#define NL80211_HE_NSS_MAX 8 -+/** -+ * struct nl80211_txrate_he - HE MCS/NSS txrate bitmap -+ * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.) -+ */ -+struct nl80211_txrate_he { -+ __u16 mcs[NL80211_HE_NSS_MAX]; -+}; -+ - enum nl80211_txrate_gi { - NL80211_TXRATE_DEFAULT_GI, - NL80211_TXRATE_FORCE_SGI, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2843,7 +2843,6 @@ static int ieee80211_set_bitrate_mask(st +@@ -2922,7 +2922,6 @@ static int ieee80211_set_bitrate_mask(st sdata->vif.bss_conf.chandef.chan) { u32 basic_rates = sdata->vif.bss_conf.basic_rates; enum nl80211_band band = sdata->vif.bss_conf.chandef.chan->band; @@ -710,7 +642,7 @@ Signed-off-by: Miles Hu if (!(mask->control[band].legacy & basic_rates)) return -EINVAL; } -@@ -2864,9 +2863,13 @@ static int ieee80211_set_bitrate_mask(st +@@ -2943,9 +2942,13 @@ static int ieee80211_set_bitrate_mask(st memcpy(sdata->rc_rateidx_vht_mcs_mask[i], mask->control[i].vht_mcs, sizeof(mask->control[i].vht_mcs)); @@ -724,7 +656,7 @@ Signed-off-by: Miles Hu if (!sband) continue; -@@ -2883,6 +2886,13 @@ static int ieee80211_set_bitrate_mask(st +@@ -2962,6 +2965,13 @@ static int ieee80211_set_bitrate_mask(st break; } } @@ -740,7 +672,7 @@ Signed-off-by: Miles Hu return 0; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -967,6 +967,9 @@ struct ieee80211_sub_if_data { +@@ -983,6 +983,9 @@ struct ieee80211_sub_if_data { u32 beacon_rateidx_mask[NUM_NL80211_BANDS]; bool beacon_rate_set; @@ -749,175 +681,10 @@ Signed-off-by: Miles Hu + union { struct ieee80211_if_ap ap; - struct ieee80211_if_wds wds; ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -331,6 +331,80 @@ he_bss_color_policy[NL80211_HE_BSS_COLOR - [NL80211_HE_BSS_COLOR_ATTR_PARTIAL] = { .type = NLA_FLAG }, - }; - -+static u16 he_mcs_map_to_mcs_mask(u8 he_mcs_map) -+{ -+ switch (he_mcs_map) { -+ case IEEE80211_HE_MCS_NOT_SUPPORTED: -+ return 0; -+ case IEEE80211_HE_MCS_SUPPORT_0_7: -+ return 0x00FF; -+ case IEEE80211_HE_MCS_SUPPORT_0_9: -+ return 0x03FF; -+ case IEEE80211_HE_MCS_SUPPORT_0_11: -+ return 0xFFF; -+ default: -+ break; -+ } -+ return 0; -+} -+ -+static void he_build_mcs_mask(u16 he_mcs_map, -+ u16 he_mcs_mask[NL80211_HE_NSS_MAX]) -+{ -+ u8 nss; -+ -+ for (nss = 0; nss < NL80211_HE_NSS_MAX; nss++) { -+ he_mcs_mask[nss] = he_mcs_map_to_mcs_mask(he_mcs_map & 0x03); -+ he_mcs_map >>= 2; -+ } -+} -+ -+static u16 he_get_txmcsmap(struct genl_info *info, -+ const struct ieee80211_sta_he_cap *he_cap) -+{ -+ struct net_device *dev = info->user_ptr[1]; -+ struct wireless_dev *wdev = dev->ieee80211_ptr; -+ -+ switch (wdev->chandef.width) { -+ case NL80211_CHAN_WIDTH_80P80: -+ return he_cap->he_mcs_nss_supp.tx_mcs_80p80; -+ case NL80211_CHAN_WIDTH_160: -+ return he_cap->he_mcs_nss_supp.tx_mcs_160; -+ default: -+ break; -+ } -+ return he_cap->he_mcs_nss_supp.tx_mcs_80; -+} -+ -+static bool he_set_mcs_mask(struct genl_info *info, -+ struct ieee80211_supported_band *sband, -+ struct nl80211_txrate_he *txrate, -+ u16 mcs[NL80211_HE_NSS_MAX]) -+{ -+ u16 tx_mcs_map = 0; -+ u16 tx_mcs_mask[NL80211_HE_NSS_MAX] = {}; -+ u8 i; -+ -+ if (!sband->iftype_data->he_cap.has_he) -+ return false; -+ -+ memset(mcs, 0, sizeof(u16) * NL80211_HE_NSS_MAX); -+ -+ tx_mcs_map = le16_to_cpu(he_get_txmcsmap(info, &sband->iftype_data->he_cap)); -+ -+ /* Build he_mcs_mask from HE capabilities */ -+ he_build_mcs_mask(tx_mcs_map, tx_mcs_mask); -+ -+ for (i = 0; i < NL80211_HE_NSS_MAX; i++) { -+ if ((tx_mcs_mask[i] & txrate->mcs[i]) == txrate->mcs[i]) -+ mcs[i] = txrate->mcs[i]; -+ else -+ return false; -+ } -+ -+ return true; -+} -+ - static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = { - [NL80211_TXRATE_LEGACY] = { .type = NLA_BINARY, - .len = NL80211_MAX_SUPP_RATES }, -@@ -338,6 +412,11 @@ static const struct nla_policy nl80211_t - .len = NL80211_MAX_SUPP_HT_RATES }, - [NL80211_TXRATE_VHT] = NLA_POLICY_EXACT_LEN_WARN(sizeof(struct nl80211_txrate_vht)), - [NL80211_TXRATE_GI] = { .type = NLA_U8 }, -+ [NL80211_TXRATE_HE] = { -+ .type = NLA_EXACT_LEN_WARN, -+ .len = sizeof(struct nl80211_txrate_he), -+ }, -+ [NL80211_TXRATE_GI] = { .type = NLA_U8 }, - }; - - static const struct nla_policy -@@ -4434,7 +4513,7 @@ static int nl80211_parse_tx_bitrate_mask - int rem, i; - struct nlattr *tx_rates; - struct ieee80211_supported_band *sband; -- u16 vht_tx_mcs_map; -+ u16 vht_tx_mcs_map, he_tx_mcs_map; - - memset(mask, 0, sizeof(*mask)); - /* Default to all rates enabled */ -@@ -4454,6 +4533,13 @@ static int nl80211_parse_tx_bitrate_mask - - vht_tx_mcs_map = le16_to_cpu(sband->vht_cap.vht_mcs.tx_mcs_map); - vht_build_mcs_mask(vht_tx_mcs_map, mask->control[i].vht_mcs); -+ -+ he_tx_mcs_map = he_get_txmcsmap(info, &sband->iftype_data->he_cap); -+ he_tx_mcs_map = le16_to_cpu(he_tx_mcs_map); -+ he_build_mcs_mask(he_tx_mcs_map, mask->control[i].he_mcs); -+ -+ mask->control[i].he_gi = 0xFF; -+ mask->control[i].he_ltf = 0xFF; - } - - /* if no rates are given set it back to the defaults */ -@@ -4509,13 +4595,34 @@ static int nl80211_parse_tx_bitrate_mask - if (mask->control[band].gi > NL80211_TXRATE_FORCE_LGI) - return -EINVAL; - } -+ if (tb[NL80211_TXRATE_HE]) { -+ if (!he_set_mcs_mask( -+ info, -+ sband, -+ nla_data(tb[NL80211_TXRATE_HE]), -+ mask->control[band].he_mcs)) -+ return -EINVAL; -+ } -+ if (tb[NL80211_TXRATE_HE_GI]) { -+ mask->control[band].he_gi = -+ nla_get_u8(tb[NL80211_TXRATE_HE_GI]); -+ if (mask->control[band].he_gi > NL80211_RATE_INFO_HE_GI_3_2) -+ return -EINVAL; -+ } -+ if (tb[NL80211_TXRATE_HE_LTF]) { -+ mask->control[band].he_ltf = -+ nla_get_u8(tb[NL80211_TXRATE_HE_LTF]); -+ if (mask->control[band].he_ltf > NL80211_RATE_INFO_HE_4XLTF) -+ return -EINVAL; -+ } - - if (mask->control[band].legacy == 0) { - /* don't allow empty legacy rates if HT or VHT - * are not even supported. - */ - if (!(rdev->wiphy.bands[band]->ht_cap.ht_supported || -- rdev->wiphy.bands[band]->vht_cap.vht_supported)) -+ rdev->wiphy.bands[band]->vht_cap.vht_supported || -+ rdev->wiphy.bands[band]->he_cap.has_he)) - return -EINVAL; - - for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) -@@ -4526,6 +4633,10 @@ static int nl80211_parse_tx_bitrate_mask - if (mask->control[band].vht_mcs[i]) - goto out; - -+ for (i = 0; i < NL80211_HE_NSS_MAX; i++) -+ if (mask->control[band].he_mcs[i]) -+ goto out; -+ - /* legacy and mcs rates may not be both empty */ - return -EINVAL; - } + struct ieee80211_if_vlan vlan; --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -1024,6 +1024,7 @@ enum wmi_tlv_vdev_param { +@@ -1042,6 +1042,7 @@ enum wmi_tlv_vdev_param { WMI_VDEV_PARAM_HE_RANGE_EXT, WMI_VDEV_PARAM_ENABLE_BCAST_PROBE_RESPONSE, WMI_VDEV_PARAM_FILS_MAX_CHANNEL_GUARD_TIME, diff --git a/feeds/wifi-ax/mac80211/patches/qca/066-ath11k-add-support-spectral-ipq6018.patch b/feeds/wifi-ax/mac80211/patches/qca/066-ath11k-add-support-spectral-ipq6018.patch deleted file mode 100644 index 4772e5898..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/066-ath11k-add-support-spectral-ipq6018.patch +++ /dev/null @@ -1,87 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -33,6 +33,7 @@ static const struct ath11k_hw_params ath - .board_size = 256 * 1024, - .cal_size = 256 * 1024, - }, -+ .spectral_fft_sz = 2, - .max_radios = 3, - .bdf_addr = 0x4B0C0000, - .hw_ops = &ipq8074_ops, -@@ -62,6 +63,7 @@ static const struct ath11k_hw_params ath - .board_size = 256 * 1024, - .cal_size = 256 * 1024, - }, -+ .spectral_fft_sz = 4, - .max_radios = 2, - .bdf_addr = 0x4ABC0000, - .hw_ops = &ipq6018_ops, ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -127,6 +127,7 @@ struct ath11k_hw_params { - size_t board_size; - size_t cal_size; - } fw; -+ u8 spectral_fft_sz; - - const struct ath11k_hw_ops *hw_ops; - const struct ath11k_hw_ring_mask *ring_mask; ---- a/drivers/net/wireless/ath/ath11k/spectral.c -+++ b/drivers/net/wireless/ath/ath11k/spectral.c -@@ -570,6 +570,18 @@ static void ath11k_spectral_parse_16bit_ - } - } - -+static void ath11k_spectral_parse_32bit_fft(u8 *outbins, u8 *inbins, int num_bins) -+{ -+ int i; -+ __le32 *data = (__le32 *)inbins; -+ -+ i = 0; -+ while (i < num_bins) { -+ outbins[i] = (__le32_to_cpu(data[i])) & ATH11K_SPECTRAL_SAMPLE_FFT_BIN_MASK; -+ i++; -+ } -+} -+ - static - int ath11k_spectral_process_fft(struct ath11k *ar, - struct ath11k_spectral_summary_report *summary, -@@ -588,6 +600,12 @@ int ath11k_spectral_process_fft(struct a - - lockdep_assert_held(&ar->spectral.lock); - -+ if (!ab->hw_params.spectral_fft_sz) { -+ ath11k_warn(ab, "invalid bin size type for hw rev %d\n", -+ ab->hw_rev); -+ return -EINVAL; -+ } -+ - tlv = (struct spectral_tlv *)data; - tlv_len = FIELD_GET(SPECTRAL_TLV_HDR_LEN, __le32_to_cpu(tlv->header)); - /* convert Dword into bytes */ -@@ -649,9 +667,21 @@ int ath11k_spectral_process_fft(struct a - freq = summary->meta.freq2; - fft_sample->freq2 = __cpu_to_be16(freq); - -- ath11k_spectral_parse_16bit_fft(fft_sample->data, -- fft_report->bins, -- num_bins); -+ switch (ab->hw_params.spectral_fft_sz) { -+ case 4: -+ ath11k_spectral_parse_32bit_fft(fft_sample->data, -+ fft_report->bins, -+ num_bins); -+ break; -+ case 2: -+ ath11k_spectral_parse_16bit_fft(fft_sample->data, -+ fft_report->bins, -+ num_bins); -+ break; -+ default: -+ ath11k_warn(ab, "unsupported fft size %u\n", ab->hw_params.spectral_fft_sz); -+ return -EOPNOTSUPP; -+ } - - fft_sample->max_exp = ath11k_spectral_get_max_exp(fft_sample->max_index, - search.peak_mag, diff --git a/feeds/wifi-ax/mac80211/patches/qca/068-ath11k-add-rx-histogram-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/068-ath11k-add-rx-histogram-stats.patch index fd22347af..b28c4b814 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/068-ath11k-add-rx-histogram-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/068-ath11k-add-rx-histogram-stats.patch @@ -24,9 +24,9 @@ Signed-off-by: Manikanta Pubbisetty +#define ATH11K_RX_RATE_TABLE_NUM 320 +#define ATH11K_RX_RATE_TABLE_11AX_NUM 576 - enum ath11k_supported_bw { - ATH11K_BW_20 = 0, -@@ -241,6 +243,17 @@ struct ath11k_vif_iter { + extern unsigned int ath11k_frame_mode; + +@@ -252,6 +254,17 @@ struct ath11k_vif_iter { struct ath11k_vif *arvif; }; @@ -44,7 +44,7 @@ Signed-off-by: Manikanta Pubbisetty struct ath11k_rx_peer_stats { u64 num_msdu; u64 num_mpdu_fcs_ok; -@@ -252,10 +265,6 @@ struct ath11k_rx_peer_stats { +@@ -263,10 +276,6 @@ struct ath11k_rx_peer_stats { u64 non_ampdu_msdu_count; u64 stbc_count; u64 beamformed_count; @@ -55,7 +55,7 @@ Signed-off-by: Manikanta Pubbisetty u64 coding_count[HAL_RX_SU_MU_CODING_MAX]; u64 tid_count[IEEE80211_NUM_TIDS + 1]; u64 pream_cnt[HAL_RX_PREAMBLE_MAX]; -@@ -263,6 +272,8 @@ struct ath11k_rx_peer_stats { +@@ -274,6 +283,8 @@ struct ath11k_rx_peer_stats { u64 rx_duration; u64 dcm_count; u64 ru_alloc_cnt[HAL_RX_RU_ALLOC_TYPE_MAX]; @@ -66,15 +66,15 @@ Signed-off-by: Manikanta Pubbisetty #define ATH11K_HE_MCS_NUM 12 --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -9,6 +9,7 @@ +@@ -10,6 +10,7 @@ #include "peer.h" #include "debug.h" #include "dp_tx.h" +#include "dp_rx.h" - #include "debug_htt_stats.h" + #include "debugfs_htt_stats.h" - void -@@ -194,7 +195,11 @@ void ath11k_update_per_peer_stats_from_t + void ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta, +@@ -194,7 +195,11 @@ void ath11k_debugfs_sta_update_txcompl(s if (sgi) arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; } else if (pkt_type == HAL_TX_RATE_STATS_PKT_TYPE_11AX) { @@ -87,7 +87,7 @@ Signed-off-by: Manikanta Pubbisetty } arsta->txrate.nss = arsta->last_txrate.nss; -@@ -322,8 +327,14 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -323,8 +328,14 @@ static ssize_t ath11k_dbg_sta_dump_rx_st struct ath11k *ar = arsta->arvif->ar; struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; int len = 0, i, retval = 0; @@ -103,7 +103,7 @@ Signed-off-by: Manikanta Pubbisetty if (!rx_stats) return -ENOENT; -@@ -354,14 +365,6 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -355,14 +366,6 @@ static ssize_t ath11k_dbg_sta_dump_rx_st rx_stats->num_mpdu_fcs_ok); len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS error: %llu\n", rx_stats->num_mpdu_fcs_err); @@ -118,7 +118,7 @@ Signed-off-by: Manikanta Pubbisetty len += scnprintf(buf + len, size - len, "BCC %llu LDPC %llu\n", rx_stats->coding_count[0], rx_stats->coding_count[1]); len += scnprintf(buf + len, size - len, -@@ -376,14 +379,96 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -377,14 +380,96 @@ static ssize_t ath11k_dbg_sta_dump_rx_st len += scnprintf(buf + len, size - len, "TID(0-15) Legacy TID(16):"); for (i = 0; i <= IEEE80211_NUM_TIDS; i++) len += scnprintf(buf + len, size - len, "%llu ", rx_stats->tid_count[i]); @@ -222,7 +222,7 @@ Signed-off-by: Manikanta Pubbisetty len += scnprintf(buf + len, size - len, "\nDCM: %llu\nRU: 26 %llu 52: %llu 106: %llu 242: %llu 484: %llu 996: %llu\n", rx_stats->dcm_count, rx_stats->ru_alloc_cnt[0], -@@ -820,6 +905,40 @@ static const struct file_operations fops +@@ -821,6 +906,40 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -260,15 +260,15 @@ Signed-off-by: Manikanta Pubbisetty + .llseek = default_llseek, +}; + - void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_sta *sta, struct dentry *dir) + void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct dentry *dir) { -@@ -828,9 +947,12 @@ void ath11k_sta_add_debugfs(struct ieee8 - if (ath11k_debug_is_extd_tx_stats_enabled(ar)) +@@ -829,9 +948,12 @@ void ath11k_debugfs_sta_op_add(struct ie + if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) debugfs_create_file("tx_stats", 0400, dir, sta, &fops_tx_stats); -- if (ath11k_debug_is_extd_rx_stats_enabled(ar)) -+ if (ath11k_debug_is_extd_rx_stats_enabled(ar)) { +- if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) ++ if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) { debugfs_create_file("rx_stats", 0400, dir, sta, &fops_rx_stats); + debugfs_create_file("reset_rx_stats", 0600, dir, sta, @@ -279,7 +279,7 @@ Signed-off-by: Manikanta Pubbisetty &fops_htt_peer_stats); --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1272,25 +1272,6 @@ int ath11k_dp_htt_tlv_iter(struct ath11k +@@ -1304,25 +1304,6 @@ int ath11k_dp_htt_tlv_iter(struct ath11k return 0; } @@ -305,7 +305,7 @@ Signed-off-by: Manikanta Pubbisetty static void ath11k_update_per_peer_tx_stats(struct ath11k *ar, struct htt_ppdu_stats *ppdu_stats, u8 user) -@@ -2661,15 +2642,53 @@ exit: +@@ -2663,15 +2644,53 @@ exit: return budget - quota; } @@ -353,13 +353,13 @@ Signed-off-by: Manikanta Pubbisetty + arsta->rssi_comb = ppdu_info->rssi_comb; + -+ if (!ath11k_debug_is_extd_rx_stats_enabled(ar)) ++ if (!ath11k_debugfs_is_extd_rx_stats_enabled(ar)) + return; + num_msdu = ppdu_info->tcp_msdu_count + ppdu_info->tcp_ack_msdu_count + ppdu_info->udp_msdu_count + ppdu_info->other_msdu_count; -@@ -2686,18 +2705,6 @@ static void ath11k_dp_rx_update_peer_sta +@@ -2688,18 +2707,6 @@ static void ath11k_dp_rx_update_peer_sta ppdu_info->tid = IEEE80211_NUM_TIDS; } @@ -378,7 +378,7 @@ Signed-off-by: Manikanta Pubbisetty if (ppdu_info->ldpc < HAL_RX_SU_MU_CODING_MAX) rx_stats->coding_count[ppdu_info->ldpc] += num_msdu; -@@ -2726,9 +2733,53 @@ static void ath11k_dp_rx_update_peer_sta +@@ -2728,9 +2735,53 @@ static void ath11k_dp_rx_update_peer_sta rx_stats->dcm_count += ppdu_info->dcm; rx_stats->ru_alloc_cnt[ppdu_info->ru_alloc] += num_msdu; @@ -435,7 +435,7 @@ Signed-off-by: Manikanta Pubbisetty static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab, --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -1001,44 +1001,78 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1003,44 +1003,78 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ppdu_info->is_stbc = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_STBC, info1); ppdu_info->ldpc = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING, info1); @@ -538,7 +538,7 @@ Signed-off-by: Manikanta Pubbisetty ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU; break; } -@@ -1484,6 +1518,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1486,6 +1520,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc __le32_to_cpu(mpdu_info->info0)); if (peer_id) ppdu_info->peer_id = peer_id; diff --git a/feeds/wifi-ax/mac80211/patches/qca/069-ath11k-add-HE-stats-in-peer-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/069-ath11k-add-HE-stats-in-peer-stats.patch index 25c261a98..534dbd3d8 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/069-ath11k-add-HE-stats-in-peer-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/069-ath11k-add-HE-stats-in-peer-stats.patch @@ -23,7 +23,7 @@ Signed-off-by: Miles Hu #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) -@@ -334,6 +335,8 @@ struct ath11k_htt_data_stats { +@@ -345,6 +346,8 @@ struct ath11k_htt_data_stats { u64 bw[ATH11K_COUNTER_TYPE_MAX][ATH11K_BW_NUM]; u64 nss[ATH11K_COUNTER_TYPE_MAX][ATH11K_NSS_NUM]; u64 gi[ATH11K_COUNTER_TYPE_MAX][ATH11K_GI_NUM]; @@ -32,7 +32,7 @@ Signed-off-by: Miles Hu }; struct ath11k_htt_tx_stats { -@@ -341,6 +344,9 @@ struct ath11k_htt_tx_stats { +@@ -352,6 +355,9 @@ struct ath11k_htt_tx_stats { u64 tx_duration; u64 ba_fails; u64 ack_fails; @@ -42,7 +42,7 @@ Signed-off-by: Miles Hu }; struct ath11k_per_ppdu_tx_stats { -@@ -443,11 +449,16 @@ struct ath11k_per_peer_tx_stats { +@@ -454,11 +460,16 @@ struct ath11k_per_peer_tx_stats { u32 succ_bytes; u32 retry_bytes; u32 failed_bytes; @@ -62,9 +62,9 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -12,6 +12,32 @@ +@@ -13,13 +13,39 @@ #include "dp_rx.h" - #include "debug_htt_stats.h" + #include "debugfs_htt_stats.h" +static inline u32 ath11k_he_tones_in_ru_to_nl80211_he_ru_alloc(u16 ru_tones) +{ @@ -92,10 +92,9 @@ Signed-off-by: Miles Hu + return ret; +} + - void - ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta, - struct ath11k_per_peer_tx_stats *peer_stats, -@@ -19,7 +45,7 @@ ath11k_accumulate_per_peer_tx_stats(stru + void ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta, + struct ath11k_per_peer_tx_stats *peer_stats, + u8 legacy_rate_idx) { struct rate_info *txrate = &arsta->txrate; struct ath11k_htt_tx_stats *tx_stats; @@ -104,7 +103,7 @@ Signed-off-by: Miles Hu if (!arsta->tx_stats) return; -@@ -64,6 +90,43 @@ ath11k_accumulate_per_peer_tx_stats(stru +@@ -64,6 +90,43 @@ void ath11k_debugfs_sta_add_tx_stats(str STATS_OP_FMT(RETRY).legacy[1][mcs] += peer_stats->retry_pkts; } @@ -148,7 +147,7 @@ Signed-off-by: Miles Hu if (peer_stats->is_ampdu) { tx_stats->ba_fails += peer_stats->ba_fails; -@@ -124,6 +187,17 @@ ath11k_accumulate_per_peer_tx_stats(stru +@@ -124,6 +187,17 @@ void ath11k_debugfs_sta_add_tx_stats(str STATS_OP_FMT(RETRY).gi[1][gi] += peer_stats->retry_pkts; tx_stats->tx_duration += peer_stats->duration; @@ -165,8 +164,8 @@ Signed-off-by: Miles Hu + } - void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar, -@@ -138,6 +212,7 @@ void ath11k_update_per_peer_stats_from_t + void ath11k_debugfs_sta_update_txcompl(struct ath11k *ar, +@@ -138,6 +212,7 @@ void ath11k_debugfs_sta_update_txcompl(s struct ath11k_peer *peer; struct ath11k_sta *arsta; struct ieee80211_sta *sta; @@ -174,7 +173,7 @@ Signed-off-by: Miles Hu u16 rate; u8 rate_idx = 0; int ret; -@@ -164,6 +239,9 @@ void ath11k_update_per_peer_stats_from_t +@@ -164,6 +239,9 @@ void ath11k_debugfs_sta_update_txcompl(s sgi = FIELD_GET(HAL_TX_RATE_STATS_INFO0_SGI, ts->rate_stats); bw = FIELD_GET(HAL_TX_RATE_STATS_INFO0_BW, ts->rate_stats); @@ -184,7 +183,7 @@ Signed-off-by: Miles Hu if (pkt_type == HAL_TX_RATE_STATS_PKT_TYPE_11A || pkt_type == HAL_TX_RATE_STATS_PKT_TYPE_11B) { -@@ -195,16 +273,27 @@ void ath11k_update_per_peer_stats_from_t +@@ -195,16 +273,27 @@ void ath11k_debugfs_sta_update_txcompl(s if (sgi) arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; } else if (pkt_type == HAL_TX_RATE_STATS_PKT_TYPE_11AX) { @@ -192,10 +191,9 @@ Signed-off-by: Miles Hu + arsta->txrate.mcs = mcs; arsta->txrate.flags = RATE_INFO_FLAGS_HE_MCS; - arsta->txrate.he_gi = ath11k_he_gi_to_nl80211_he_gi(ts->sgi); -- arsta->txrate.he_ru_alloc = ath11k_he_ru_tones_to_nl80211_he_ru_alloc( -- ts->num_tones_in_ru); + arsta->txrate.he_gi = ath11k_he_gi_to_nl80211_he_gi(sgi); -+ arsta->txrate.he_ru_alloc = ath11k_he_tones_in_ru_to_nl80211_he_ru_alloc( + arsta->txrate.he_ru_alloc = ath11k_he_ru_tones_to_nl80211_he_ru_alloc( +- ts->num_tones_in_ru); + num_tones_in_ru); } @@ -203,20 +201,20 @@ Signed-off-by: Miles Hu arsta->txrate.bw = ath11k_mac_bw_to_mac80211_bw(bw); + /* Currently only OFDMA flag is available in tx complettion status -+ * to indicate MUOFDMA ppdu type. Use SU ppdu type as of now to ++ * to indicate MUOFDMA ppdu type. Use SU ppdu type as of now to + * indicate both SU/MU MIMO for failed/retry count. + */ -+ if (ts->flags & HAL_TX_STATUS_FLAGS_OFDMA) -+ peer_stats->ppdu_type = HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA; -+ else -+ peer_stats->ppdu_type = HTT_PPDU_STATS_PPDU_TYPE_SU; ++ if (ts->flags & HAL_TX_STATUS_FLAGS_OFDMA) ++ peer_stats->ppdu_type = HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA; ++ else ++ peer_stats->ppdu_type = HTT_PPDU_STATS_PPDU_TYPE_SU; + + peer_stats->ru_tones = arsta->txrate.he_ru_alloc; + - ath11k_accumulate_per_peer_tx_stats(arsta, peer_stats, rate_idx); + ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx); + err_out: - spin_unlock_bh(&ab->base_lock); -@@ -219,12 +308,13 @@ static ssize_t ath11k_dbg_sta_dump_tx_st +@@ -220,12 +309,13 @@ static ssize_t ath11k_dbg_sta_dump_tx_st struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; struct ath11k *ar = arsta->arvif->ar; struct ath11k_htt_data_stats *stats; @@ -232,7 +230,7 @@ Signed-off-by: Miles Hu if (!arsta->tx_stats) return -ENOENT; -@@ -242,45 +332,46 @@ static ssize_t ath11k_dbg_sta_dump_tx_st +@@ -243,45 +333,46 @@ static ssize_t ath11k_dbg_sta_dump_tx_st len += scnprintf(buf + len, size - len, "%s_%s\n", str_name[k], str[j]); @@ -288,7 +286,7 @@ Signed-off-by: Miles Hu stats->gi[j][0], stats->gi[j][1], stats->gi[j][2], stats->gi[j][3]); len += scnprintf(buf + len, size - len, -@@ -289,9 +380,67 @@ static ssize_t ath11k_dbg_sta_dump_tx_st +@@ -290,9 +381,67 @@ static ssize_t ath11k_dbg_sta_dump_tx_st for (i = 0; i < ATH11K_LEGACY_NUM; i++) len += scnprintf(buf + len, size - len, "%llu ", stats->legacy[j][i]); @@ -357,7 +355,7 @@ Signed-off-by: Miles Hu len += scnprintf(buf + len, size - len, "\nTX duration\n %llu usecs\n", -@@ -300,6 +449,7 @@ static ssize_t ath11k_dbg_sta_dump_tx_st +@@ -301,6 +450,7 @@ static ssize_t ath11k_dbg_sta_dump_tx_st "BA fails\n %llu\n", arsta->tx_stats->ba_fails); len += scnprintf(buf + len, size - len, "ack fails\n %llu\n", arsta->tx_stats->ack_fails); @@ -367,7 +365,7 @@ Signed-off-by: Miles Hu if (len > size) --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -537,6 +537,45 @@ enum htt_ppdu_stats_tag_type { +@@ -555,6 +555,45 @@ enum htt_ppdu_stats_tag_type { BIT(HTT_PPDU_STATS_TAG_TX_MGMTCTRL_PAYLOAD) | \ HTT_PPDU_STATS_TAG_DEFAULT) @@ -413,7 +411,7 @@ Signed-off-by: Miles Hu /* HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message * * details: -@@ -1150,6 +1189,19 @@ enum htt_ppdu_stats_gi { +@@ -1168,6 +1207,19 @@ enum htt_ppdu_stats_gi { #define HTT_PPDU_STATS_USER_RATE_INFO0_USER_POS_M GENMASK(3, 0) #define HTT_PPDU_STATS_USER_RATE_INFO0_MU_GROUP_ID_M GENMASK(11, 4) @@ -433,7 +431,7 @@ Signed-off-by: Miles Hu #define HTT_PPDU_STATS_USER_RATE_INFO1_RESP_TYPE_VALD_M BIT(0) #define HTT_PPDU_STATS_USER_RATE_INFO1_PPDU_TYPE_M GENMASK(5, 1) -@@ -1177,6 +1229,12 @@ enum htt_ppdu_stats_gi { +@@ -1195,6 +1247,12 @@ enum htt_ppdu_stats_gi { FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_GI_M, _val) #define HTT_USR_RATE_DCM(_val) \ FIELD_GET(HTT_PPDU_STATS_USER_RATE_FLAGS_DCM_M, _val) @@ -446,7 +444,7 @@ Signed-off-by: Miles Hu #define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_LTF_SIZE_M GENMASK(1, 0) #define HTT_PPDU_STATS_USER_RATE_RESP_FLAGS_STBC_M BIT(2) -@@ -1280,6 +1338,21 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_ +@@ -1298,6 +1356,21 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_ u32 success_bytes; } __packed; @@ -468,7 +466,7 @@ Signed-off-by: Miles Hu struct htt_ppdu_stats_usr_cmn_array { struct htt_tlv tlv_hdr; u32 num_ppdu_stats; -@@ -1293,14 +1366,16 @@ struct htt_ppdu_stats_usr_cmn_array { +@@ -1311,14 +1384,16 @@ struct htt_ppdu_stats_usr_cmn_array { struct htt_ppdu_user_stats { u16 peer_id; @@ -486,7 +484,7 @@ Signed-off-by: Miles Hu #define HTT_PPDU_DESC_MAX_DEPTH 16 struct htt_ppdu_stats { -@@ -1309,7 +1384,7 @@ struct htt_ppdu_stats { +@@ -1327,7 +1402,7 @@ struct htt_ppdu_stats { }; struct htt_ppdu_stats_info { @@ -497,7 +495,7 @@ Signed-off-by: Miles Hu }; --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1156,9 +1156,10 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1188,9 +1188,10 @@ static int ath11k_htt_tlv_ppdu_stats_par void *data) { struct htt_ppdu_stats_info *ppdu_info; @@ -509,7 +507,7 @@ Signed-off-by: Miles Hu ppdu_info = (struct htt_ppdu_stats_info *)data; -@@ -1171,6 +1172,26 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1203,6 +1204,26 @@ static int ath11k_htt_tlv_ppdu_stats_par } memcpy((void *)&ppdu_info->ppdu_stats.common, ptr, sizeof(struct htt_ppdu_stats_common)); @@ -536,7 +534,7 @@ Signed-off-by: Miles Hu break; case HTT_PPDU_STATS_TAG_USR_RATE: if (len < sizeof(struct htt_ppdu_stats_user_rate)) { -@@ -1203,6 +1224,7 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1235,6 +1256,7 @@ static int ath11k_htt_tlv_ppdu_stats_par peer_id); if (cur_user < 0) return -EINVAL; @@ -544,7 +542,7 @@ Signed-off-by: Miles Hu user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user]; user_stats->peer_id = peer_id; user_stats->is_valid_peer_id = true; -@@ -1231,44 +1253,30 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1263,44 +1285,30 @@ static int ath11k_htt_tlv_ppdu_stats_par sizeof(struct htt_ppdu_stats_usr_cmpltn_ack_ba_status)); user_stats->tlv_flags |= BIT(tag); break; @@ -579,7 +577,7 @@ Signed-off-by: Miles Hu - len -= sizeof(*tlv); - - if (tlv_len > len) { -- ath11k_err(ab, "htt tlv parse failure of tag %hhu at byte %zd (%zu bytes left, %hhu expected)\n", +- ath11k_err(ab, "htt tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n", - tlv_tag, ptr - begin, len, tlv_len); + peer_id = ((struct htt_ppdu_stats_user_common *)ptr)->sw_peer_id; + cur_user = ath11k_get_ppdu_user_index(&ppdu_info->ppdu_stats, @@ -609,7 +607,7 @@ Signed-off-by: Miles Hu return 0; } -@@ -1286,8 +1294,8 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1318,8 +1326,8 @@ ath11k_update_per_peer_tx_stats(struct a struct htt_ppdu_stats_common *common = &ppdu_stats->common; int ret; u8 flags, mcs, nss, bw, sgi, dcm, rate_idx = 0; @@ -620,7 +618,7 @@ Signed-off-by: Miles Hu u32 tx_duration = 0; u8 tid = HTT_PPDU_STATS_NON_QOS_TID; bool is_ampdu = false; -@@ -1321,6 +1329,11 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1353,6 +1361,11 @@ ath11k_update_per_peer_tx_stats(struct a mcs = HTT_USR_RATE_MCS(user_rate->rate_flags); sgi = HTT_USR_RATE_GI(user_rate->rate_flags); dcm = HTT_USR_RATE_DCM(user_rate->rate_flags); @@ -632,7 +630,7 @@ Signed-off-by: Miles Hu /* Note: If host configured fixed rates and in some other special * cases, the broadcast/management frames are sent in different rates. -@@ -1419,6 +1432,12 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1451,6 +1464,12 @@ ath11k_update_per_peer_tx_stats(struct a peer_stats->ba_fails = HTT_USR_CMPLTN_LONG_RETRY(usr_stats->cmpltn_cmn.flags) + HTT_USR_CMPLTN_SHORT_RETRY(usr_stats->cmpltn_cmn.flags); @@ -643,9 +641,9 @@ Signed-off-by: Miles Hu + peer_stats->mu_pos = mu_pos; + peer_stats->ru_tones = arsta->txrate.he_ru_alloc; - if (ath11k_debug_is_extd_tx_stats_enabled(ar)) - ath11k_accumulate_per_peer_tx_stats(arsta, -@@ -1471,13 +1490,87 @@ struct htt_ppdu_stats_info *ath11k_dp_ht + if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) + ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx); +@@ -1502,13 +1521,87 @@ struct htt_ppdu_stats_info *ath11k_dp_ht return ppdu_info; } @@ -734,7 +732,7 @@ Signed-off-by: Miles Hu u8 pdev_id; u32 ppdu_id, len; -@@ -1516,6 +1609,47 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1547,6 +1640,47 @@ static int ath11k_htt_pull_ppdu_stats(st goto exit; } @@ -784,8 +782,8 @@ Signed-off-by: Miles Hu rcu_read_unlock(); --- a/drivers/net/wireless/ath/ath11k/rx_desc.h +++ b/drivers/net/wireless/ath/ath11k/rx_desc.h -@@ -1209,6 +1209,11 @@ struct hal_rx_desc { - u8 msdu_payload[0]; +@@ -1407,6 +1407,11 @@ struct hal_rx_desc { + } u; } __packed; +#define MAX_USER_POS 8 @@ -816,7 +814,7 @@ Signed-off-by: Miles Hu struct ath11k_peer { struct list_head list; struct ieee80211_sta *sta; -@@ -27,6 +38,9 @@ struct ath11k_peer { +@@ -28,6 +39,9 @@ struct ath11k_peer { u8 ucast_keyidx; u16 sec_type; u16 sec_type_grp; diff --git a/feeds/wifi-ax/mac80211/patches/qca/072-ath11k-support-hostapd-config-to-enable-disable-he-m.patch b/feeds/wifi-ax/mac80211/patches/qca/072-ath11k-support-hostapd-config-to-enable-disable-he-m.patch index 25f6cea4a..5613d1f10 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/072-ath11k-support-hostapd-config-to-enable-disable-he-m.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/072-ath11k-support-hostapd-config-to-enable-disable-he-m.patch @@ -13,9 +13,11 @@ Signed-off-by: Miles Hu net/mac80211/cfg.c | 5 +- 4 files changed, 138 insertions(+), 11 deletions(-) ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2050,6 +2050,118 @@ static int ath11k_setup_peer_smps(struct +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +@@ -2061,6 +2061,131 @@ static int ath11k_setup_peer_smps(struct ath11k_smps_map[smps]); } @@ -24,8 +26,7 @@ Signed-off-by: Miles Hu + struct ath11k *ar = arvif->ar; + struct ieee80211_he_cap_elem he_cap_elem = {0}; + u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE; -+ u32 value = FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) | -+ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE); ++ u32 value = 0; + int ret = 0; + + if (!arvif->vif->bss_conf.he_support) @@ -33,22 +34,30 @@ Signed-off-by: Miles Hu + + memcpy(&he_cap_elem, &arvif->vif->bss_conf.he_cap_elem, sizeof(he_cap_elem)); + -+ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) { -+ value |= FIELD_PREP(HE_MODE_UL_MUMIMO, HE_UL_MUMIMO_ENABLE); -+ } -+ -+ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_4] & IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE) { -+ value |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE); -+ } -+ + if (he_cap_elem.phy_cap_info[3] & IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER) { + value |= FIELD_PREP(HE_MODE_SU_TX_BFER, HE_SU_BFER_ENABLE); -+ if ((he_cap_elem.phy_cap_info[HECAP_PHYDWORD_4] & IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER) && -+ (arvif->vdev_type == WMI_VDEV_TYPE_AP)) { ++ if ((he_cap_elem.phy_cap_info[HECAP_PHYDWORD_4] & ++ IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER) && ++ (arvif->vdev_type == WMI_VDEV_TYPE_AP)) { + value |= FIELD_PREP(HE_MODE_MU_TX_BFER, HE_MU_BFER_ENABLE); + } + } + ++ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) { ++ value |= FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) | ++ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE); ++ ++ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & ++ IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) { ++ value |= FIELD_PREP(HE_MODE_UL_MUMIMO, HE_UL_MUMIMO_ENABLE); ++ } ++ ++ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_4] & ++ IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE) { ++ value |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE); ++ } ++ } ++ + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value); + if (ret) { + ath11k_warn(ar->ab, "failed to set vdev %d HE MU mode: %d\n", @@ -80,8 +89,7 @@ Signed-off-by: Miles Hu + struct ath11k_pdev_cap *pdev_cap = NULL; + struct ieee80211_sta_he_cap *cap_band = NULL; + u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE; -+ u32 hemode = FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) | -+ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE); ++ u32 hemode = 0; + int ret; + + if (!vif->bss_conf.he_support) @@ -102,11 +110,6 @@ Signed-off-by: Miles Hu + + memcpy(&he_cap_elem, &cap_band->he_cap_elem, sizeof(he_cap_elem)); + -+ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) { -+ if(he_cap->he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) -+ hemode |= FIELD_PREP(HE_MODE_UL_MUMIMO, HE_UL_MUMIMO_ENABLE); -+ } -+ + if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_4] & IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE) { + if (he_cap->he_cap_elem.phy_cap_info[HECAP_PHYDWORD_3] & IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER) + hemode |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE); @@ -115,11 +118,23 @@ Signed-off-by: Miles Hu + } + } + -+ if (FIELD_GET(HE_MODE_MU_TX_BFEE, hemode)) -+ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE); ++ if (vif->type != NL80211_IFTYPE_MESH_POINT) { ++ hemode |= FIELD_PREP(HE_MODE_DL_OFDMA, HE_DL_MUOFDMA_ENABLE) | ++ FIELD_PREP(HE_MODE_UL_OFDMA, HE_UL_MUOFDMA_ENABLE); + -+ if (FIELD_GET(HE_MODE_MU_TX_BFER, hemode)) -+ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFER, HE_SU_BFER_ENABLE); ++ if (he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & ++ IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) { ++ if(he_cap->he_cap_elem.phy_cap_info[HECAP_PHYDWORD_2] & ++ IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO) ++ hemode |= FIELD_PREP(HE_MODE_UL_MUMIMO, HE_UL_MUMIMO_ENABLE); ++ } ++ ++ if (FIELD_GET(HE_MODE_MU_TX_BFEE, hemode)) ++ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFEE, HE_SU_BFEE_ENABLE); ++ ++ if (FIELD_GET(HE_MODE_MU_TX_BFER, hemode)) ++ hemode |= FIELD_PREP(HE_MODE_SU_TX_BFER, HE_SU_BFER_ENABLE); ++ } + + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, hemode); + if (ret) { @@ -134,7 +149,7 @@ Signed-off-by: Miles Hu static void ath11k_bss_assoc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf) -@@ -2058,6 +2170,7 @@ static void ath11k_bss_assoc(struct ieee +@@ -2069,6 +2194,7 @@ static void ath11k_bss_assoc(struct ieee struct ath11k_vif *arvif = (void *)vif->drv_priv; struct peer_assoc_params peer_arg; struct ieee80211_sta *ap_sta; @@ -142,7 +157,7 @@ Signed-off-by: Miles Hu int ret; lockdep_assert_held(&ar->conf_mutex); -@@ -2074,6 +2187,8 @@ static void ath11k_bss_assoc(struct ieee +@@ -2085,6 +2211,8 @@ static void ath11k_bss_assoc(struct ieee rcu_read_unlock(); return; } @@ -151,7 +166,7 @@ Signed-off-by: Miles Hu ath11k_peer_assoc_prepare(ar, vif, ap_sta, &peer_arg, false); -@@ -2100,6 +2215,12 @@ static void ath11k_bss_assoc(struct ieee +@@ -2111,6 +2239,12 @@ static void ath11k_bss_assoc(struct ieee return; } @@ -164,20 +179,16 @@ Signed-off-by: Miles Hu WARN_ON(arvif->is_up); arvif->aid = bss_conf->aid; -@@ -2315,8 +2436,11 @@ static void ath11k_mac_op_bss_info_chang - if (changed & BSS_CHANGED_BSSID && !is_zero_ether_addr(info->bssid)) +@@ -2511,6 +2645,8 @@ static void ath11k_mac_op_bss_info_chang ether_addr_copy(arvif->bssid, info->bssid); -- if (changed & BSS_CHANGED_BEACON_ENABLED) -+ if (changed & BSS_CHANGED_BEACON_ENABLED) { + if (changed & BSS_CHANGED_BEACON_ENABLED) { + if (info->enable_beacon) + ath11k_mac_set_he_txbf_conf(arvif); ath11k_control_beaconing(arvif, info); -+ } - if (changed & BSS_CHANGED_ERP_CTS_PROT) { - u32 cts_prot; -@@ -4202,6 +4326,39 @@ static __le16 ath11k_mac_setup_he_6ghz_c + if (arvif->is_up && vif->bss_conf.he_support && +@@ -4426,6 +4562,39 @@ static __le16 ath11k_mac_setup_he_6ghz_c return cpu_to_le16(bcap->he_6ghz_capa); } @@ -217,7 +228,7 @@ Signed-off-by: Miles Hu static int ath11k_mac_copy_he_cap(struct ath11k *ar, struct ath11k_pdev_cap *cap, struct ieee80211_sband_iftype_data *data, -@@ -4266,18 +4423,7 @@ static int ath11k_mac_copy_he_cap(struct +@@ -4483,18 +4652,7 @@ static int ath11k_mac_copy_he_cap(struct break; } @@ -237,7 +248,7 @@ Signed-off-by: Miles Hu memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); if (he_cap_elem->phy_cap_info[6] & -@@ -4786,69 +4932,6 @@ ath11k_mac_setup_vdev_create_params(stru +@@ -5027,69 +5185,6 @@ ath11k_mac_setup_vdev_create_params(stru } } @@ -304,10 +315,10 @@ Signed-off-by: Miles Hu - return ret; -} - - static int ath11k_mac_vdev_delete(struct ath11k_vif *arvif) + static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) { - struct ath11k *ar = arvif->ar; -@@ -5367,7 +5450,6 @@ ath11k_mac_vdev_start_restart(struct ath +@@ -5604,7 +5699,6 @@ ath11k_mac_vdev_start_restart(struct ath struct ath11k *ar = arvif->ar; struct ath11k_base *ab = ar->ab; struct wmi_vdev_start_req_arg arg = {}; @@ -315,10 +326,11 @@ Signed-off-by: Miles Hu int ret = 0; lockdep_assert_held(&ar->conf_mutex); -@@ -5409,14 +5491,6 @@ ath11k_mac_vdev_start_restart(struct ath +@@ -5646,15 +5740,6 @@ ath11k_mac_vdev_start_restart(struct ath + spin_lock_bh(&ab->base_lock); + arg.regdomain = ar->ab->dfs_region; spin_unlock_bh(&ab->base_lock); - - /* TODO: Notify if secondary 80Mhz also needs radar detection */ +- - if (he_support) { - ret = ath11k_set_he_mu_sounding_mode(ar, arvif); - if (ret) { @@ -330,9 +342,11 @@ Signed-off-by: Miles Hu } arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2757,6 +2757,8 @@ struct rx_reorder_queue_remove_params { +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2779,6 +2779,8 @@ struct rx_reorder_queue_remove_params { #define HECAP_PHYDWORD_0 0 #define HECAP_PHYDWORD_1 1 #define HECAP_PHYDWORD_2 2 @@ -341,7 +355,7 @@ Signed-off-by: Miles Hu #define HECAP_PHY_SU_BFER BIT(31) #define HECAP_PHY_SU_BFEE BIT(0) -@@ -2790,8 +2792,11 @@ struct rx_reorder_queue_remove_params { +@@ -2812,8 +2814,11 @@ struct rx_reorder_queue_remove_params { #define HE_DL_MUOFDMA_ENABLE 1 #define HE_UL_MUOFDMA_ENABLE 1 #define HE_DL_MUMIMO_ENABLE 1 @@ -353,19 +367,23 @@ Signed-off-by: Miles Hu #define HE_VHT_SOUNDING_MODE_ENABLE 1 #define HE_SU_MU_SOUNDING_MODE_ENABLE 1 ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -673,6 +673,7 @@ struct ieee80211_bss_conf { +Index: backports-20210222-4.4.60-b157d2276/include/net/mac80211.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/include/net/mac80211.h ++++ backports-20210222-4.4.60-b157d2276/include/net/mac80211.h +@@ -695,6 +695,7 @@ struct ieee80211_bss_conf { u16 nss_set; } he_oper; struct ieee80211_he_obss_pd he_obss_pd; + struct ieee80211_he_cap_elem he_cap_elem; struct cfg80211_he_bss_color he_bss_color; - }; - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1023,6 +1023,11 @@ static int ieee80211_start_ap(struct wip + struct ieee80211_fils_discovery fils_discovery; + u32 unsol_bcast_probe_resp_interval; +Index: backports-20210222-4.4.60-b157d2276/net/mac80211/cfg.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/net/mac80211/cfg.c ++++ backports-20210222-4.4.60-b157d2276/net/mac80211/cfg.c +@@ -1078,6 +1078,11 @@ static int ieee80211_start_ap(struct wip changed |= BSS_CHANGED_HE_BSS_COLOR; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/078-mac80211-ethernet-rx-decap-support.patch b/feeds/wifi-ax/mac80211/patches/qca/078-mac80211-ethernet-rx-decap-support.patch index 1359042f0..117d45904 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/078-mac80211-ethernet-rx-decap-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/078-mac80211-ethernet-rx-decap-support.patch @@ -1,49 +1,26 @@ --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -4448,6 +4448,22 @@ static inline void ieee80211_rx_ni(struc - } - - /** -+ * ieee80211_rx_decap_offl - Receive frames in 802.11 decapsulated format -+ * -+ * Low level driver capable of 802.11 header decap uses this function. The frame -+ * will be in ethernet format. -+ * This function may not be called in IRQ context. Calls to this function -+ * for a single hardware must be synchronized against each other. -+ * -+ * @hw: the hardware this frame came in on -+ * @sta : the station the frame was received from, must not be %NULL -+ * @skb: the buffer to receive, owned by mac80211 after this call -+ * @napi: the NAPI context -+ */ -+void ieee80211_rx_decap_offl(struct ieee80211_hw *hw, struct ieee80211_sta *sta, -+ struct sk_buff *skb, struct napi_struct *napi); -+ -+/** - * ieee80211_sta_ps_transition - PS transition for connected sta +@@ -2404,6 +2404,9 @@ struct ieee80211_txq { + * @IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD: Hardware supports rx decapsulation + * offload * - * When operating in AP mode with the %IEEE80211_HW_AP_LINK_PS ++ * @IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP: Hardware supports concurrent rx ++ * decapsulation offload and passing raw 802.11 frames for monitor iface. ++ * + * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays + */ + enum ieee80211_hw_flags { +@@ -2458,6 +2461,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, + IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, + IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD, ++ IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP, + + /* keep last, obviously */ + NUM_IEEE80211_HW_FLAGS --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2534,13 +2534,15 @@ __ieee80211_data_to_8023(struct ieee8021 - return 0; - } - -+static const u8 pae_group_addr[ETH_ALEN] __aligned(2) -+ = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; -+ -+ - /* - * requires that rx->skb is a frame with ethernet header - */ - static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc) - { -- static const u8 pae_group_addr[ETH_ALEN] __aligned(2) -- = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; - struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; - - /* -@@ -2596,6 +2598,7 @@ ieee80211_deliver_skb(struct ieee80211_r +@@ -2549,6 +2549,7 @@ ieee80211_deliver_skb(struct ieee80211_r struct sk_buff *skb, *xmit_skb; struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; struct sta_info *dsta; @@ -51,7 +28,7 @@ skb = rx->skb; xmit_skb = NULL; -@@ -2608,9 +2611,12 @@ ieee80211_deliver_skb(struct ieee80211_r +@@ -2561,9 +2562,12 @@ ieee80211_deliver_skb(struct ieee80211_r * for non-QoS-data frames. Here we know it's a data * frame, so count MSDUs. */ @@ -67,221 +44,9 @@ } if ((sdata->vif.type == NL80211_IFTYPE_AP || -@@ -4808,3 +4814,211 @@ void ieee80211_rx_irqsafe(struct ieee802 - tasklet_schedule(&local->tasklet); - } - EXPORT_SYMBOL(ieee80211_rx_irqsafe); -+ -+/* Receive path for decap offloaded data frames */ -+ -+static void -+ieee80211_rx_handle_decap_offl(struct ieee80211_sub_if_data *sdata, -+ struct sta_info *sta, struct sk_buff *skb, -+ struct napi_struct *napi) -+{ -+ struct ieee80211_local *local = sdata->local; -+ struct ieee80211_vif *vif = &sdata->vif; -+ struct net_device *dev = sdata->dev; -+ struct ieee80211_rx_status *status; -+ struct ieee80211_key *key = NULL; -+ struct ieee80211_rx_data rx; -+ int i; -+ struct ethhdr *ehdr; -+ struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; -+ struct ieee80211_supported_band *sband; -+ -+ ehdr = (struct ethhdr *)skb->data; -+ status = IEEE80211_SKB_RXCB(skb); -+ -+ if (WARN_ON(status->band >= NUM_NL80211_BANDS)) -+ goto drop; -+ -+ sband = local->hw.wiphy->bands[status->band]; -+ if (WARN_ON(!sband)) -+ goto drop; -+ -+ if (ieee80211_hw_check(&local->hw, USES_RSS)) -+ stats = this_cpu_ptr(sta->pcpu_rx_stats); -+ -+ /* TODO: Extend ieee80211_rx_decap_offl() with bssid so that Ethernet -+ * encap/decap can be supported in Adhoc interface type as well. -+ * Adhoc interface depends on bssid to udpate last_rx. -+ */ -+ if (vif->type != NL80211_IFTYPE_STATION && -+ vif->type != NL80211_IFTYPE_AP_VLAN && -+ vif->type != NL80211_IFTYPE_AP) -+ goto drop; -+ -+ I802_DEBUG_INC(local->dot11ReceivedFragmentCount); -+ -+ if (!is_multicast_ether_addr(ehdr->h_dest)) { -+ stats->last_rx = jiffies; -+ stats->last_rate = sta_stats_encode_rate(status); -+ } -+ -+ if (sdata->vif.type == NL80211_IFTYPE_STATION && -+ !is_multicast_ether_addr(ehdr->h_dest)) -+ ieee80211_sta_reset_conn_monitor(sdata); -+ -+ stats->fragments++; -+ -+ u64_stats_update_begin(&stats->syncp); -+ stats->bytes += skb->len; -+ u64_stats_update_end(&stats->syncp); -+ -+ if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) { -+ stats->last_signal = status->signal; -+ if (!ieee80211_hw_check(&local->hw, USES_RSS)) -+ ewma_signal_add(&sta->rx_stats_avg.signal, -+ -status->signal); -+ } -+ -+ if (status->chains) { -+ stats->chains = status->chains; -+ for (i = 0; i < ARRAY_SIZE(status->chain_signal); i++) { -+ int signal = status->chain_signal[i]; -+ -+ if (!(status->chains & BIT(i))) -+ continue; -+ -+ stats->chain_signal_last[i] = signal; -+ if (!ieee80211_hw_check(&local->hw, USES_RSS)) -+ ewma_signal_add(&sta->rx_stats_avg.chain_signal[i], -+ -signal); -+ } -+ } -+ -+ if (is_multicast_ether_addr(ehdr->h_dest)) { -+ for (i = 0; i < NUM_DEFAULT_KEYS; i++) { -+ key = rcu_dereference(sta->gtk[i]); -+ if (key) -+ break; -+ } -+ } else { -+ key = rcu_dereference(sta->ptk[sta->ptk_idx]); -+ } -+ -+ if (status->flag & RX_FLAG_MMIC_ERROR) { -+ if (key) -+ key->u.tkip.mic_failures++; -+ goto mic_fail; -+ } -+ -+ if (!(status->flag & RX_FLAG_DUP_VALIDATED)) -+ goto drop; -+ -+#define ETH_RX_CRYPT_FLAGS (RX_FLAG_PN_VALIDATED | RX_FLAG_DECRYPTED) -+ -+ if (key && (status->flag & ETH_RX_CRYPT_FLAGS) != ETH_RX_CRYPT_FLAGS) -+ goto drop; -+ -+ if (key && unlikely(key->flags & KEY_FLAG_TAINTED)) -+ goto drop; -+ -+ if (unlikely(!test_sta_flag(sta, WLAN_STA_AUTHORIZED))) { -+ if (ehdr->h_proto != sdata->control_port_protocol) -+ goto drop; -+ else if (!ether_addr_equal(ehdr->h_dest, vif->addr) && -+ !ether_addr_equal(ehdr->h_dest, pae_group_addr)) -+ goto drop; -+ } -+ -+ if (unlikely(ehdr->h_proto == cpu_to_be16(ETH_P_TDLS))) { -+ struct ieee80211_tdls_data *tf = (void *)skb->data; -+ -+ if (pskb_may_pull(skb, -+ offsetof(struct ieee80211_tdls_data, u)) && -+ tf->payload_type == WLAN_TDLS_SNAP_RFTYPE && -+ tf->category == WLAN_CATEGORY_TDLS && -+ (tf->action_code == WLAN_TDLS_CHANNEL_SWITCH_REQUEST || -+ tf->action_code == WLAN_TDLS_CHANNEL_SWITCH_RESPONSE)) { -+ skb_queue_tail(&local->skb_queue_tdls_chsw, skb); -+ schedule_work(&local->tdls_chsw_work); -+ stats->packets++; -+ return; -+ } -+ } -+ -+ memset(&rx, 0, sizeof(rx)); -+ rx.skb = skb; -+ rx.sdata = sdata; -+ rx.local = local; -+ rx.sta = sta; -+ rx.napi = napi; -+ -+ if (vif->type == NL80211_IFTYPE_AP_VLAN && sdata->bss && -+ unlikely(ehdr->h_proto == sdata->control_port_protocol)) { -+ sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, -+ u.ap); -+ dev = sdata->dev; -+ rx.sdata = sdata; -+ } -+ -+ rx.skb->dev = dev; -+ -+ /* XXX: Since rx.seqno_idx is not available for decap offloaded frames -+ * rx msdu stats update at the seqno_idx in ieee80211_deliver_skb() -+ * will always be updated at index 0 and will not be very useful. -+ */ -+ ieee80211_deliver_skb(&rx); -+ -+ return; -+ -+mic_fail: -+ -+ cfg80211_michael_mic_failure(sdata->dev, sta->addr, -+ is_multicast_ether_addr(ehdr->h_dest) ? -+ NL80211_KEYTYPE_GROUP : -+ NL80211_KEYTYPE_PAIRWISE, -+ key ? key->conf.keyidx : -1, -+ NULL, GFP_ATOMIC); -+ -+drop: -+ stats->dropped++; -+ dev_kfree_skb(skb); -+} -+ -+/* Receive path handler that a low level driver supporting 802.11 hdr decap -+ * offload can call. The frame is in ethernet format and the assumption is -+ * all necessary operations like decryption, defrag, deaggregation, etc. -+ * requiring 802.11 headers are already performed in the low level driver -+ * or hardware. -+ */ -+void ieee80211_rx_decap_offl(struct ieee80211_hw *hw, -+ struct ieee80211_sta *pubsta, struct sk_buff *skb, -+ struct napi_struct *napi) -+{ -+ struct ieee80211_local *local = hw_to_local(hw); -+ struct sta_info *sta; -+ -+ if (unlikely(local->quiescing || local->suspended)) -+ goto drop; -+ -+ if (unlikely(local->in_reconfig)) -+ goto drop; -+ -+ if (WARN_ON(!local->started)) -+ goto drop; -+ -+ if (!pubsta) -+ goto drop; -+ -+ sta = container_of(pubsta, struct sta_info, sta); -+ -+ /* TODO: Toggle Rx throughput LED */ -+ -+ rcu_read_lock(); -+ ieee80211_rx_handle_decap_offl(sta->sdata, sta, skb, napi); -+ rcu_read_unlock(); -+ -+ return; -+drop: -+ kfree_skb(skb); -+} -+EXPORT_SYMBOL(ieee80211_rx_decap_offl); --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2088,6 +2088,9 @@ sta_get_last_rx_stats(struct sta_info *s +@@ -2100,6 +2100,9 @@ sta_get_last_rx_stats(struct sta_info *s cpustats = per_cpu_ptr(sta->pcpu_rx_stats, cpu); @@ -291,3 +56,25 @@ if (time_after(cpustats->last_rx, stats->last_rx)) stats = cpustats; } +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -406,6 +406,7 @@ static const char *hw_flag_names[] = { + FLAG(AMPDU_KEYBORDER_SUPPORT), + FLAG(SUPPORTS_TX_ENCAP_OFFLOAD), + FLAG(SUPPORTS_RX_DECAP_OFFLOAD), ++ FLAG(SUPPORTS_CONC_MON_RX_DECAP), + #undef FLAG + }; + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -873,7 +873,8 @@ static bool ieee80211_set_sdata_offload_ + ieee80211_iftype_supports_hdr_offload(sdata->vif.type)) { + flags |= IEEE80211_OFFLOAD_DECAP_ENABLED; + +- if (local->monitors) ++ if(local->monitors && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_CONC_MON_RX_DECAP)) + flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED; + } else { + flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED; diff --git a/feeds/wifi-ax/mac80211/patches/qca/080-ath11k-ethernet-rx-decap-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/080-ath11k-ethernet-rx-decap-offload.patch index cf5287071..c68ba5fce 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/080-ath11k-ethernet-rx-decap-offload.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/080-ath11k-ethernet-rx-decap-offload.patch @@ -1,7 +1,7 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -266,6 +266,28 @@ static u32 ath11k_dp_rxdesc_get_ppduid(s - return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); +@@ -294,6 +294,28 @@ static int ath11k_dp_purge_mon_ring(stru + return -ETIMEDOUT; } +static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, @@ -29,13 +29,33 @@ /* Returns number of Rx buffers replenished */ int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, struct dp_rxdma_ring *rx_ring, -@@ -2271,9 +2293,12 @@ static void ath11k_dp_rx_h_undecap(struc +@@ -2250,6 +2272,7 @@ static void ath11k_dp_rx_h_undecap(struc + { + u8 *first_hdr; + u8 decap; ++ struct ethhdr *ehdr; + + first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); + decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); +@@ -2264,9 +2287,24 @@ static void ath11k_dp_rx_h_undecap(struc decrypted); break; case DP_RX_DECAP_TYPE_ETHERNET2_DIX: - /* TODO undecap support for middle/last msdu's of amsdu */ - ath11k_dp_rx_h_undecap_eth(ar, msdu, first_hdr, - enctype, status); ++ ehdr = (struct ethhdr *) msdu->data; ++ ++ /* mac80211 allows fast path only for authorized STA and ++ also not supported for TKIP */ ++ if (ehdr->h_proto == cpu_to_be16(ETH_P_PAE) || ++ enctype == HAL_ENCRYPT_TYPE_TKIP_MIC) { ++ ATH11K_SKB_RXCB(msdu)->is_eapol_tkip = true; ++ ath11k_dp_rx_h_undecap_eth(ar, msdu, first_hdr, ++ enctype, status); ++ break; ++ } ++ + /* PN for mcast packets will be validated in mac80211; + * remove eth header and add 802.11 header. + */ @@ -45,7 +65,7 @@ break; case DP_RX_DECAP_TYPE_8023: /* TODO: Handle undecap for these formats */ -@@ -2281,40 +2306,61 @@ static void ath11k_dp_rx_h_undecap(struc +@@ -2274,35 +2312,57 @@ static void ath11k_dp_rx_h_undecap(struc } } @@ -80,6 +100,7 @@ + struct ath11k_skb_rxcb *rxcb; struct ieee80211_hdr *hdr; struct ath11k_peer *peer; + struct rx_attention *rx_attention; u32 err_bitmap; - hdr = (struct ieee80211_hdr *)msdu->data; @@ -110,13 +131,7 @@ } spin_unlock_bh(&ar->ab->base_lock); - err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); - -- enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); - if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap) - is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); - -@@ -2348,8 +2394,11 @@ static void ath11k_dp_rx_h_mpdu(struct a +@@ -2341,8 +2401,11 @@ static void ath11k_dp_rx_h_mpdu(struct a if (!is_decrypted || fill_crypto_hdr) return; @@ -130,7 +145,7 @@ } static void ath11k_dp_rx_h_rate(struct ath11k *ar, struct hal_rx_desc *rx_desc, -@@ -2458,51 +2507,46 @@ static void ath11k_dp_rx_h_ppdu(struct a +@@ -2456,51 +2519,47 @@ static void ath11k_dp_rx_h_ppdu(struct a ath11k_dp_rx_h_rate(ar, rx_desc, rx_status); } @@ -170,6 +185,7 @@ + struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); + u8 decap = DP_RX_DECAP_TYPE_RAW; + bool is_mcbc = rxcb->is_mcbc; ++ bool is_eapol_tkip = rxcb->is_eapol_tkip; - status = IEEE80211_SKB_RXCB(msdu); - if ((status->encoding == RX_ENC_HE) && !(status->flag & RX_FLAG_RADIOTAP_HE)) { @@ -199,30 +215,31 @@ - (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4, + peer ? peer->addr : NULL, + rxcb->tid, -+ (rxcb->rx_desc->msdu_end.info2 & RX_MSDU_END_INFO2_DA_IS_MCBC) ? "mcast" : "ucast", ++ (is_mcbc) ? "mcast" : "ucast", + rxcb->seq_no, (status->encoding == RX_ENC_LEGACY) ? "legacy" : "", (status->encoding == RX_ENC_HT) ? "ht" : "", (status->encoding == RX_ENC_VHT) ? "vht" : "", -@@ -2521,20 +2565,29 @@ static void ath11k_dp_rx_deliver_msdu(st +@@ -2519,23 +2578,32 @@ static void ath11k_dp_rx_deliver_msdu(st ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", msdu->data, msdu->len); + rx_status = IEEE80211_SKB_RXCB(msdu); + *rx_status = *status; + /* TODO: trace rx packet */ - ieee80211_rx_napi(ar->hw, NULL, msdu, napi); -+ /* PN for multicast packets are validated in mac80211, -+ * so send them through ieee80211_rx_napi(). ++ /* PN for multicast packets are not validate in HW, ++ * so skip 802.3 rx path ++ * Also, fast_rx expectes the STA to be authorized, hence ++ * eapol packets are sent in slow path. + */ -+ if (decap != DP_RX_DECAP_TYPE_ETHERNET2_DIX || -+ (is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED)) -+ ieee80211_rx_napi(ar->hw, pubsta, msdu, napi); -+ else -+ ieee80211_rx_decap_offl(ar->hw, pubsta, msdu, napi); ++ if (decap == DP_RX_DECAP_TYPE_ETHERNET2_DIX && !is_eapol_tkip && ++ !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED)) ++ rx_status->flag |= RX_FLAG_8023; + -+ return; ++ ieee80211_rx_napi(ar->hw, pubsta, msdu, napi); } static int ath11k_dp_rx_process_msdu(struct ath11k *ar, @@ -231,7 +248,9 @@ + struct sk_buff_head *msdu_list, + struct ieee80211_rx_status *rx_status) { + struct ath11k_base *ab = ar->ab; struct hal_rx_desc *rx_desc, *lrx_desc; + struct rx_attention *rx_attention; - struct ieee80211_rx_status rx_status = {0}; - struct ieee80211_rx_status *status; struct ath11k_skb_rxcb *rxcb; @@ -239,7 +258,7 @@ struct sk_buff *last_buf; u8 l3_pad_bytes; u8 *hdr_status; -@@ -2589,19 +2642,11 @@ static int ath11k_dp_rx_process_msdu(str +@@ -2591,19 +2659,11 @@ static int ath11k_dp_rx_process_msdu(str } } @@ -262,7 +281,7 @@ return 0; free_out: -@@ -2616,6 +2661,7 @@ static void ath11k_dp_rx_process_receive +@@ -2618,6 +2678,7 @@ static void ath11k_dp_rx_process_receive struct ath11k_skb_rxcb *rxcb; struct sk_buff *msdu; struct ath11k *ar; @@ -270,7 +289,7 @@ u8 mac_id; int ret; -@@ -2638,7 +2684,7 @@ static void ath11k_dp_rx_process_receive +@@ -2640,7 +2701,7 @@ static void ath11k_dp_rx_process_receive continue; } @@ -279,7 +298,7 @@ if (ret) { ath11k_dbg(ab, ATH11K_DBG_DATA, "Unable to process msdu %d", ret); -@@ -2646,7 +2692,7 @@ static void ath11k_dp_rx_process_receive +@@ -2648,7 +2709,7 @@ static void ath11k_dp_rx_process_receive continue; } @@ -288,7 +307,7 @@ (*quota)--; } -@@ -2728,10 +2774,14 @@ try_again: +@@ -2730,10 +2791,14 @@ try_again: RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU); rxcb->is_continuation = !!(desc.rx_msdu_info.info0 & RX_MSDU_DESC_INFO0_MSDU_CONTINUATION); @@ -304,7 +323,7 @@ __skb_queue_tail(&msdu_list, msdu); if (total_msdu_reaped >= quota && !rxcb->is_continuation) { -@@ -4098,7 +4148,6 @@ static void ath11k_dp_rx_wbm_err(struct +@@ -4105,7 +4170,6 @@ static void ath11k_dp_rx_wbm_err(struct { struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); struct ieee80211_rx_status rxs = {0}; @@ -312,7 +331,7 @@ bool drop = true; switch (rxcb->err_rel_src) { -@@ -4118,10 +4167,7 @@ static void ath11k_dp_rx_wbm_err(struct +@@ -4125,10 +4189,7 @@ static void ath11k_dp_rx_wbm_err(struct return; } @@ -324,7 +343,7 @@ } int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, -@@ -5048,7 +5094,7 @@ static int ath11k_dp_rx_mon_deliver(stru +@@ -5080,7 +5141,7 @@ static int ath11k_dp_rx_mon_deliver(stru { struct ath11k_pdev_dp *dp = &ar->dp; struct sk_buff *mon_skb, *skb_next, *header; @@ -333,7 +352,7 @@ mon_skb = ath11k_dp_rx_mon_merg_msdus(ar, mac_id, head_msdu, tail_msdu, rxs); -@@ -5074,9 +5120,7 @@ static int ath11k_dp_rx_mon_deliver(stru +@@ -5106,9 +5167,7 @@ static int ath11k_dp_rx_mon_deliver(stru } rxs->flag |= RX_FLAG_ONLY_MONITOR; ath11k_update_radiotap(ppduinfo, mon_skb, rxs); @@ -346,53 +365,64 @@ rxs->flag = 0; --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -17,6 +17,8 @@ - #include "peer.h" - #include "vendor.h" +@@ -5198,7 +5198,8 @@ static void ath11k_mac_op_update_vif_off + if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET || + (vif->type != NL80211_IFTYPE_STATION && + vif->type != NL80211_IFTYPE_AP)) +- vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ vif->offload_flags &= ~(IEEE80211_OFFLOAD_ENCAP_ENABLED | ++ IEEE80211_OFFLOAD_DECAP_ENABLED); -+extern unsigned int ath11k_ethernet_mode; -+ - #define CHAN2G(_channel, _freq, _flags) { \ - .band = NL80211_BAND_2GHZ, \ - .hw_value = (_channel), \ -@@ -5095,6 +5097,26 @@ static int ath11k_mac_op_add_interface(s - goto err_vdev_del; + if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) + param_value = ATH11K_HW_TXRX_ETHERNET; +@@ -5214,6 +5215,22 @@ static void ath11k_mac_op_update_vif_off + arvif->vdev_id, ret); + vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; } - -+ /* Do not enable ethernet mode for mesh vifs, packets in mesh network -+ * can be forwarded to other mesh nodes and mac80211 expects the packet -+ * in 802.11 format. Also, please note that ethernet mode shall not be -+ * used on interface where 4addr mode is enabled as we might not have -+ * 4addr related config during add_interface(). -+ */ -+ if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags) && -+ ath11k_ethernet_mode && (vif->type != NL80211_IFTYPE_MESH_POINT)) { -+ param_id = WMI_VDEV_PARAM_RX_DECAP_TYPE; ++ ++ param_id = WMI_VDEV_PARAM_RX_DECAP_TYPE; ++ if (vif->offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED) + param_value = ATH11K_HW_TXRX_ETHERNET; ++ else if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) ++ param_value = ATH11K_HW_TXRX_RAW; ++ else ++ param_value = ATH11K_HW_TXRX_NATIVE_WIFI; + -+ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -+ param_id, param_value); -+ if (ret) { -+ ath11k_warn(ab, "failed to set vdev %d tx encap mode: %d\n", -+ arvif->vdev_id, ret); -+ goto err_vdev_del; -+ } ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, ++ param_id, param_value); ++ if (ret) { ++ ath11k_warn(ab, "failed to set vdev %d rx decap mode: %d\n", ++ arvif->vdev_id, ret); ++ vif->offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED; + } -+ - nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1; - ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, - WMI_VDEV_PARAM_NSS, nss); + } + + static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, +@@ -7301,7 +7318,11 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, QUEUE_CONTROL); + ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); + ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); +- ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD); ++ if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET) { ++ ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD); ++ ieee80211_hw_set(ar->hw, SUPPORTS_RX_DECAP_OFFLOAD); ++ ieee80211_hw_set(ar->hw, SUPPORTS_CONC_MON_RX_DECAP); ++ } + if (ht_cap & WMI_HT_CAP_ENABLED) { + ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION); + ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -91,6 +91,7 @@ struct ath11k_skb_rxcb { +@@ -97,6 +97,8 @@ struct ath11k_skb_rxcb { bool is_first_msdu; bool is_last_msdu; bool is_continuation; + bool is_mcbc; ++ bool is_eapol_tkip; struct hal_rx_desc *rx_desc; u8 err_rel_src; u8 err_code; -@@ -98,6 +99,8 @@ struct ath11k_skb_rxcb { +@@ -104,6 +106,8 @@ struct ath11k_skb_rxcb { u8 unmapped; u8 is_frag; u8 tid; @@ -414,38 +444,23 @@ u32 meta_data; --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -17,12 +17,15 @@ unsigned int ath11k_debug_mask; - unsigned int rawmode; - unsigned int cryptmode; - EXPORT_SYMBOL(ath11k_debug_mask); -+unsigned int ath11k_ethernet_mode = 1; - module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); - module_param_named(rawmode, rawmode, uint, 0644); - module_param_named(cryptmode, cryptmode, uint, 0644); -+module_param_named(ethernet_mode, ath11k_ethernet_mode, uint, 0644); - MODULE_PARM_DESC(debug_mask, "Debugging mask"); - MODULE_PARM_DESC(cryptmode, "crypto mode: 0-hardware, 1-software"); - MODULE_PARM_DESC(rawmode, "RAW mode TX: 0-disable, 1-enable"); -+MODULE_PARM_DESC(ethernet_mode, "Use ethernet frame datapath"); +@@ -25,10 +25,10 @@ module_param_named(crypto_mode, ath11k_c + MODULE_PARM_DESC(crypto_mode, "crypto mode: 0-hardware, 1-software"); - static const struct ath11k_hw_params ath11k_hw_params[] = { - { -@@ -897,6 +900,11 @@ int ath11k_core_pre_init(struct ath11k_b - { - int ret; + /* frame mode values are mapped as per enum ath11k_hw_txrx_mode */ +-unsigned int ath11k_frame_mode = ATH11K_HW_TXRX_NATIVE_WIFI; ++unsigned int ath11k_frame_mode = ATH11K_HW_TXRX_ETHERNET; + module_param_named(frame_mode, ath11k_frame_mode, uint, 0644); + MODULE_PARM_DESC(frame_mode, +- "Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)"); ++ "Datapath frame mode (0: raw, 1: native wifi, 2: ethernet(default))"); + + struct ath11k_base *ath11k_soc; -+ if (ath11k_ethernet_mode && rawmode) { -+ ath11k_err(ab, "ethernet and raw mode cannot co-exist\n"); -+ return -EINVAL; -+ } -+ - ret = ath11k_init_hw_params(ab); - if (ret) { - ath11k_err(ab, "failed to get hw params: %d\n", ret); --- a/drivers/net/wireless/ath/ath11k/hw.c +++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -151,11 +151,32 @@ static int ath11k_hw_mac_id_to_srng_id_q - return mac_id; +@@ -489,6 +489,24 @@ static u8 *ath11k_hw_qcn9074_rx_desc_get + return &desc->u.qcn9074.msdu_payload[0]; } +static bool ath11k_hw_ipq8074_rx_desc_get_da_mcbc(struct hal_rx_desc *desc) @@ -468,29 +483,31 @@ + const struct ath11k_hw_ops ipq8074_ops = { .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, - .wmi_init_config = ath11k_init_wmi_config_qca6390, - .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, - .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, + .wmi_init_config = ath11k_init_wmi_config_ipq8074, +@@ -521,6 +539,9 @@ const struct ath11k_hw_ops ipq8074_ops = + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, }; const struct ath11k_hw_ops ipq6018_ops = { -@@ -163,6 +184,9 @@ const struct ath11k_hw_ops ipq6018_ops = - .wmi_init_config = ath11k_init_wmi_config_ipq8074, - .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, - .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, +@@ -555,6 +576,9 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, }; const struct ath11k_hw_ops qca6390_ops = { -@@ -170,6 +194,11 @@ const struct ath11k_hw_ops qca6390_ops = - .wmi_init_config = ath11k_init_wmi_config_qca6390, - .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_qca6390, - .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_qca6390, +@@ -589,6 +613,11 @@ const struct ath11k_hw_ops qca6390_ops = + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, + //TODO + /* .rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid, @@ -498,13 +515,13 @@ + */ }; - #define ATH11K_TX_RING_MASK_0 0x1 + const struct ath11k_hw_ops qcn9074_ops = { --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -164,6 +164,9 @@ struct ath11k_hw_ops { - struct target_resource_config *config); - int (*mac_id_to_pdev_id)(struct ath11k_hw_params *hw, int mac_id); - int (*mac_id_to_srng_id)(struct ath11k_hw_params *hw, int mac_id); +@@ -199,6 +199,9 @@ struct ath11k_hw_ops { + void (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len); + struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc); + u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc); + bool (*rx_desc_get_da_mcbc)(struct hal_rx_desc *desc); + bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc); + u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); diff --git a/feeds/wifi-ax/mac80211/patches/qca/084-ath11k-fix-ul-ofdma-counter-always-zero-in-peer-stat.patch b/feeds/wifi-ax/mac80211/patches/qca/084-ath11k-fix-ul-ofdma-counter-always-zero-in-peer-stat.patch index ee7e41d56..b4fcf5193 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/084-ath11k-fix-ul-ofdma-counter-always-zero-in-peer-stat.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/084-ath11k-fix-ul-ofdma-counter-always-zero-in-peer-stat.patch @@ -15,7 +15,7 @@ Signed-off-by: Miles Hu --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -619,13 +619,6 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -620,13 +620,6 @@ static ssize_t ath11k_dbg_sta_dump_rx_st rx_stats->byte_stats.rx_rate[i], (i + 1) % (he_rates_avail ? 12 : 8) ? "\t" : "\n"); @@ -31,7 +31,7 @@ Signed-off-by: Miles Hu spin_unlock_bh(&ar->ab->base_lock); --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -1499,6 +1499,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1501,6 +1501,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc case HAL_PHYRX_RSSI_LEGACY: { struct hal_rx_phyrx_rssi_legacy_info *rssi = (struct hal_rx_phyrx_rssi_legacy_info *)tlv_data; @@ -39,7 +39,7 @@ Signed-off-by: Miles Hu /* TODO: Please note that the combined rssi will not be accurate * in MU case. Rssi in MU needs to be retrieved from -@@ -1507,6 +1508,22 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -1509,6 +1510,22 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ppdu_info->rssi_comb = FIELD_GET(HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB, __le32_to_cpu(rssi->info0)); diff --git a/feeds/wifi-ax/mac80211/patches/qca/085-ath11k-Fix-supported-capabilities-and-mcs-rates-in-he.patch b/feeds/wifi-ax/mac80211/patches/qca/085-ath11k-Fix-supported-capabilities-and-mcs-rates-in-he.patch index 4a7a3aa23..7ce7ac51b 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/085-ath11k-Fix-supported-capabilities-and-mcs-rates-in-he.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/085-ath11k-Fix-supported-capabilities-and-mcs-rates-in-he.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4329,6 +4329,7 @@ static __le16 ath11k_mac_setup_he_6ghz_c +@@ -4552,6 +4552,7 @@ static __le16 ath11k_mac_setup_he_6ghz_c } static void ath11k_mac_set_hemcsmap(struct ath11k *ar, @@ -8,7 +8,7 @@ struct ieee80211_sta_he_cap * he_cap) { u16 txmcs_map, rxmcs_map; -@@ -4337,12 +4338,14 @@ static void ath11k_mac_set_hemcsmap(stru +@@ -4560,12 +4561,14 @@ static void ath11k_mac_set_hemcsmap(stru rxmcs_map = 0; txmcs_map = 0; for (i = 0; i < 8; i++) { @@ -25,7 +25,7 @@ rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); else rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); -@@ -4352,13 +4355,13 @@ static void ath11k_mac_set_hemcsmap(stru +@@ -4575,13 +4578,13 @@ static void ath11k_mac_set_hemcsmap(stru he_cap->he_mcs_nss_supp.tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff); he_cap->he_mcs_nss_supp.rx_mcs_160 = @@ -43,7 +43,7 @@ } static int ath11k_mac_copy_he_cap(struct ath11k *ar, -@@ -4393,6 +4396,10 @@ static int ath11k_mac_copy_he_cap(struct +@@ -4616,6 +4619,10 @@ static int ath11k_mac_copy_he_cap(struct he_cap_elem->mac_cap_info[1] &= IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK; @@ -51,10 +51,10 @@ + ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; + he_cap_elem->phy_cap_info[0] &= + ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; - he_cap_elem->phy_cap_info[4] &= - ~IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK; - he_cap_elem->phy_cap_info[4] &= -@@ -4425,7 +4432,7 @@ static int ath11k_mac_copy_he_cap(struct + + he_cap_elem->phy_cap_info[5] &= + ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; +@@ -4641,7 +4648,7 @@ static int ath11k_mac_copy_he_cap(struct break; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/086-ath11k-add-support-for-channel-rx-tx-time-in-survey-dump.patch b/feeds/wifi-ax/mac80211/patches/qca/086-ath11k-add-support-for-channel-rx-tx-time-in-survey-dump.patch index fa246d880..4c7a0bfe6 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/086-ath11k-add-support-for-channel-rx-tx-time-in-survey-dump.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/086-ath11k-add-support-for-channel-rx-tx-time-in-survey-dump.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1374,6 +1374,7 @@ int ath11k_wmi_pdev_bss_chan_info_reques +@@ -1376,6 +1376,7 @@ int ath11k_wmi_pdev_bss_chan_info_reques WMI_TAG_PDEV_BSS_CHAN_INFO_REQUEST) | FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); cmd->req_type = type; @@ -8,27 +8,27 @@ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "WMI bss chan info req type %d\n", type); -@@ -3516,7 +3517,8 @@ ath11k_wmi_copy_resource_config(struct w +@@ -3851,7 +3852,7 @@ ath11k_wmi_copy_resource_config(struct w wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; -- wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE; -+ wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE | -+ WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64; +- wmi_cfg->flag1 = tg_cfg->atf_config; ++ wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64; wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; wmi_cfg->sched_params = tg_cfg->sched_params; wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2219,6 +2219,7 @@ struct wmi_init_cmd { +@@ -2243,6 +2243,8 @@ struct wmi_init_cmd { + u32 num_host_mem_chunks; } __packed; - #define WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE BIT(14) +#define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5) - ++ struct wmi_resource_config { u32 tlv_header; -@@ -2948,6 +2949,7 @@ struct wmi_pdev_bss_chan_info_req_cmd { + u32 num_vdevs; +@@ -2970,6 +2972,7 @@ struct wmi_pdev_bss_chan_info_req_cmd { u32 tlv_header; /* ref wmi_bss_chan_info_req_type */ u32 req_type; @@ -36,7 +36,7 @@ } __packed; struct wmi_ap_ps_peer_cmd { -@@ -4071,7 +4073,6 @@ struct wmi_vdev_stopped_event { +@@ -4092,7 +4095,6 @@ struct wmi_vdev_stopped_event { } __packed; struct wmi_pdev_bss_chan_info_event { @@ -44,7 +44,7 @@ u32 freq; /* Units in MHz */ u32 noise_floor; /* units are dBm */ /* rx clear - how often the channel was unused */ -@@ -4089,6 +4090,7 @@ struct wmi_pdev_bss_chan_info_event { +@@ -4110,6 +4112,7 @@ struct wmi_pdev_bss_chan_info_event { /*rx_cycle cnt for my bss in 64bits format */ u32 rx_bss_cycle_count_low; u32 rx_bss_cycle_count_high; diff --git a/feeds/wifi-ax/mac80211/patches/qca/087-ath11k-fix-ul-ofdma-counter-increamenting-improperly.patch b/feeds/wifi-ax/mac80211/patches/qca/087-ath11k-fix-ul-ofdma-counter-increamenting-improperly.patch index 17e8469dd..b837a919d 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/087-ath11k-fix-ul-ofdma-counter-increamenting-improperly.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/087-ath11k-fix-ul-ofdma-counter-increamenting-improperly.patch @@ -5,7 +5,7 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3226,8 +3226,11 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3224,8 +3224,11 @@ int ath11k_dp_rx_process_mon_status(stru continue; } @@ -17,11 +17,11 @@ + ath11k_dp_rx_update_peer_stats(arsta, &ppdu_info); + } - if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) { + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) { trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE); --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -928,6 +928,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -930,6 +930,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc ppdu_info->ast_index = FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX, __le32_to_cpu(eu_stats->info2)); diff --git a/feeds/wifi-ax/mac80211/patches/qca/088-ath11k-add-htt-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/088-ath11k-add-htt-stats.patch index 1fc523d04..146ffcf79 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/088-ath11k-add-htt-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/088-ath11k-add-htt-stats.patch @@ -1,11 +1,11 @@ - drivers/net/wireless/ath/ath11k/debug.h | 6 +- - drivers/net/wireless/ath/ath11k/debug_htt_stats.c | 463 ++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/debug_htt_stats.h | 108 +++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 6 +- + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c | 463 ++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h | 108 +++++ 3 files changed, 576 insertions(+), 1 deletion(-) ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -56,8 +56,12 @@ enum ath11k_dbg_htt_ext_stats_type { +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -36,8 +36,12 @@ enum ath11k_dbg_htt_ext_stats_type { ATH11K_DBG_HTT_EXT_STATS_TWT_SESSIONS = 20, ATH11K_DBG_HTT_EXT_STATS_REO_RESOURCE_STATS = 21, ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO = 22, @@ -19,9 +19,9 @@ /* keep this last */ ATH11K_DBG_HTT_NUM_EXT_STATS, ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -@@ -3895,6 +3895,445 @@ static inline void htt_print_backpressur +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c +@@ -3907,6 +3907,445 @@ static inline void htt_print_backpressur } } @@ -464,10 +464,10 @@ + } +} + - static inline void htt_htt_stats_debug_dump(const u32 *tag_buf, - struct debug_htt_stats_req *stats_req) - { -@@ -4290,6 +4729,30 @@ static int ath11k_dbg_htt_ext_stats_pars + static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab, + u16 tag, u16 len, const void *tag_buf, + void *user_data) +@@ -4258,6 +4697,30 @@ static int ath11k_dbg_htt_ext_stats_pars case HTT_STATS_RING_BACKPRESSURE_STATS_TAG: htt_print_backpressure_stats_tlv_v(tag_buf, user_data); break; @@ -498,8 +498,8 @@ default: break; } ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h @@ -102,6 +102,15 @@ enum htt_tlv_tag_t { HTT_STATS_PDEV_OBSS_PD_TAG = 88, HTT_STATS_HW_WAR_TAG = 89, @@ -535,9 +535,9 @@ struct htt_rx_pdev_rate_stats_tlv { u32 mac_id__word; -@@ -1687,4 +1701,98 @@ struct htt_ring_backpressure_stats_tlv { - u32 backpressure_hist[5]; - }; +@@ -1721,4 +1735,98 @@ static inline int ath11k_debugfs_htt_sta + + #endif /* CPTCFG_ATH11K_DEBUGFS */ +struct htt_rx_pdev_ul_mumimo_trig_stats_tlv { + u32 mac_id__word; diff --git a/feeds/wifi-ax/mac80211/patches/qca/090-ath11k-fix-fixrate-issue.patch b/feeds/wifi-ax/mac80211/patches/qca/090-ath11k-fix-fixrate-issue.patch index b99a44db8..5d8e0eb82 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/090-ath11k-fix-fixrate-issue.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/090-ath11k-fix-fixrate-issue.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1326,6 +1326,13 @@ static void ath11k_peer_assoc_h_ht(struc +@@ -1312,6 +1312,13 @@ static void ath11k_peer_assoc_h_ht(struc arg->bw_40 = true; arg->peer_rate_caps |= WMI_HOST_RC_CW40_FLAG; } @@ -14,7 +14,7 @@ if (arvif->bitrate_mask.control[band].gi != NL80211_TXRATE_FORCE_LGI) { if (ht_cap->cap & (IEEE80211_HT_CAP_SGI_20 | -@@ -1726,7 +1733,11 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1737,7 +1744,11 @@ static void ath11k_peer_assoc_h_he(struc for (i = 0, max_nss = 0, he_mcs = 0; i < NL80211_HE_NSS_MAX; i++) { he_mcs = __le16_to_cpu(he_tx_mcs) >> (2 * i) & 3; @@ -27,7 +27,7 @@ he_mcs_mask[i]) max_nss = i + 1; } -@@ -3187,6 +3198,10 @@ ath11k_mac_set_peer_vht_fixed_rate(struc +@@ -3408,6 +3419,10 @@ ath11k_mac_set_peer_vht_fixed_rate(struc return -EINVAL; } @@ -38,7 +38,7 @@ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Setting Fixed VHT Rate for peer %pM. Device will not switch to any other selected rates", sta->addr); -@@ -3233,6 +3248,11 @@ ath11k_mac_set_peer_he_fixed_rate(struct +@@ -3454,6 +3469,11 @@ ath11k_mac_set_peer_he_fixed_rate(struct return -EINVAL; } @@ -50,7 +50,7 @@ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Setting Fixed HE Rate for peer %pM. Device will not switch to any other selected rates", sta->addr); -@@ -3262,7 +3282,7 @@ static int ath11k_station_assoc(struct a +@@ -3483,7 +3503,7 @@ static int ath11k_station_assoc(struct a struct cfg80211_chan_def def; enum nl80211_band band; struct cfg80211_bitrate_mask *mask; @@ -59,7 +59,7 @@ lockdep_assert_held(&ar->conf_mutex); -@@ -3288,9 +3308,10 @@ static int ath11k_station_assoc(struct a +@@ -3509,9 +3529,10 @@ static int ath11k_station_assoc(struct a } num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask); @@ -72,7 +72,7 @@ * fixed param. * Note that all other rates and NSS will be disabled for this peer. */ -@@ -3299,6 +3320,11 @@ static int ath11k_station_assoc(struct a +@@ -3520,6 +3541,11 @@ static int ath11k_station_assoc(struct a band); if (ret) return ret; @@ -84,7 +84,7 @@ } /* Re-assoc is run only to update supported rates for given station. It -@@ -3461,10 +3487,21 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3682,10 +3708,21 @@ static void ath11k_sta_rc_update_wk(stru ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask, band); } else { @@ -108,7 +108,7 @@ ath11k_peer_assoc_prepare(ar, arvif->vif, sta, &peer_arg, true); -@@ -5018,6 +5055,7 @@ static int ath11k_mac_op_add_interface(s +@@ -5257,6 +5294,7 @@ static int ath11k_mac_op_add_interface(s for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { arvif->bitrate_mask.control[i].legacy = 0xffffffff; @@ -116,7 +116,7 @@ memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, sizeof(arvif->bitrate_mask.control[i].ht_mcs)); memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, -@@ -6312,6 +6350,53 @@ static void ath11k_mac_disable_peer_fixe +@@ -6573,6 +6611,53 @@ static void ath11k_mac_disable_peer_fixe sta->addr, ret); } @@ -170,7 +170,7 @@ static int ath11k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -@@ -6374,6 +6459,11 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6635,6 +6720,11 @@ ath11k_mac_op_set_bitrate_mask(struct ie nss = single_nss; } else { rate = WMI_FIXED_RATE_NONE; @@ -182,7 +182,7 @@ nss = min_t(u32, ar->num_tx_chains, max(max(ath11k_mac_max_ht_nss(ht_mcs_mask), ath11k_mac_max_vht_nss(vht_mcs_mask)), -@@ -6422,10 +6512,6 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6683,10 +6773,6 @@ ath11k_mac_op_set_bitrate_mask(struct ie return -EINVAL; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/097-ath11k-htt-stats-remove-fixed-size-array-usage.patch b/feeds/wifi-ax/mac80211/patches/qca/097-ath11k-htt-stats-remove-fixed-size-array-usage.patch index 893d6f37a..98ca948c4 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/097-ath11k-htt-stats-remove-fixed-size-array-usage.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/097-ath11k-htt-stats-remove-fixed-size-array-usage.patch @@ -1,7 +1,7 @@ ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c @@ -11,23 +11,22 @@ - #include "debug_htt_stats.h" + #include "debugfs_htt_stats.h" #define HTT_DBG_OUT(buf, len, fmt, ...) \ - scnprintf(buf, len, fmt "\n", ##__VA_ARGS__) @@ -856,13 +856,13 @@ - if (!rssi_chain[j]) - goto fail; - } - +- - for (j = 0; j < HTT_RX_PEER_STATS_NUM_GI_COUNTERS; j++) { - rx_gi[j] = kmalloc(HTT_MAX_STRING_LEN, GFP_ATOMIC); - if (!rx_gi[j]) - goto fail; - } -- + - len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_RX_PEER_RATE_STATS_TLV:"); - len += HTT_DBG_OUT(buf + len, buf_len - len, "nsts = %u", + len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_RX_PEER_RATE_STATS_TLV:\n"); @@ -1128,10 +1128,10 @@ len += HTT_DBG_OUT(buf + len, buf_len - len, - "HTT_TX_HWQ_CMD_RESULT_STATS_TLV_V:"); +- +- ARRAY_TO_STRING(cmd_result, htt_stats_buf->cmd_result, data_len); + "HTT_TX_HWQ_CMD_RESULT_STATS_TLV_V:\n"); -- ARRAY_TO_STRING(cmd_result, htt_stats_buf->cmd_result, data_len); -- - len += HTT_DBG_OUT(buf + len, buf_len - len, "cmd_result = %s\n", cmd_result); + len += HTT_DBG_OUT(buf + len, buf_len - len, "cmd_result = "); + ARRAY_TO_BUF(buf, len, htt_stats_buf->cmd_result, data_len); @@ -2943,11 +2943,11 @@ + + len += HTT_DBG_OUT(buf + len, buf_len - len, "\nrx_nss = "); + ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_nss, HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS); -+ -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "\nrx_dcm = "); -+ ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_dcm, HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS); - len += HTT_DBG_OUT(buf + len, buf_len - len, "rx_evm_pilot_count = %u", ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "\nrx_dcm = "); ++ ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_dcm, HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS); ++ + len += HTT_DBG_OUT(buf + len, buf_len - len, "\nrx_stbc = "); + ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_stbc, HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS); + @@ -2961,11 +2961,7 @@ for (j = 0; j < HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS; j++) { - index = 0; -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "\npilot_evm_dB[%u] = ",j); -+ ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_pilot_evm_db[j], -+ HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS); -+ } - +- - for (i = 0; i < HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS; i++) - index += scnprintf(&rx_pilot_evm_db[j][index], - HTT_MAX_STRING_LEN - index, @@ -2974,8 +2970,11 @@ - htt_stats_buf->rx_pilot_evm_db[j][i]); - len += HTT_DBG_OUT(buf + len, buf_len - len, "pilot_evm_dB[%u] = %s ", - j, rx_pilot_evm_db[j]); -- } -- ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "\npilot_evm_dB[%u] = ",j); ++ ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_pilot_evm_db[j], ++ HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS); + } + - index = 0; - memset(str_buf, 0x0, HTT_MAX_STRING_LEN); - for (i = 0; i < HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS; i++) @@ -3726,7 +3725,7 @@ htt_stats_buf->num_obss_tx_ppdu_success); len += HTT_DBG_OUT(buf + len, buf_len - len, "OBSS Tx failures PPDU = %u\n", htt_stats_buf->num_obss_tx_ppdu_failure); -@@ -3866,25 +3603,25 @@ static inline void htt_print_backpressur +@@ -3878,25 +3615,25 @@ static inline void htt_print_backpressur u32 len = stats_req->buf_len; u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; @@ -3759,7 +3758,7 @@ if (len >= buf_len) { buf[buf_len - 1] = 0; -@@ -3907,14 +3644,14 @@ static inline void htt_print_latency_pro +@@ -3919,14 +3656,14 @@ static inline void htt_print_latency_pro if (htt_stats_buf->print_header == 1) { len += HTT_DBG_OUT(buf + len, buf_len - len, @@ -3777,7 +3776,7 @@ htt_stats_buf->latency_prof_name, htt_stats_buf->cnt, htt_stats_buf->min, htt_stats_buf->max, htt_stats_buf->last, htt_stats_buf->tot, htt_stats_buf->avg, -@@ -3939,17 +3676,17 @@ static inline void htt_print_latency_pro +@@ -3951,17 +3688,17 @@ static inline void htt_print_latency_pro u32 len = stats_req->buf_len; u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; @@ -3801,7 +3800,7 @@ if (len >= buf_len) { buf[buf_len - 1] = 0; -@@ -3970,7 +3707,7 @@ static inline void htt_print_latency_pro +@@ -3982,7 +3719,7 @@ static inline void htt_print_latency_pro u32 len = stats_req->buf_len; u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; @@ -3810,7 +3809,7 @@ htt_stats_buf->prof_enable_cnt); if (len >= buf_len) { -@@ -3991,55 +3728,45 @@ static inline void htt_print_ul_mumimo_t +@@ -4003,55 +3740,45 @@ static inline void htt_print_ul_mumimo_t u8 *buf = stats_req->buf; u32 len = stats_req->buf_len; u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; @@ -3892,7 +3891,7 @@ if (len >= buf_len) { buf[buf_len - 1] = 0; -@@ -4063,26 +3790,26 @@ static inline void htt_print_ul_mimo_use +@@ -4075,26 +3802,26 @@ static inline void htt_print_ul_mimo_use if (htt_ul_user_stats_buf->user_index > HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER) { if (htt_ul_user_stats_buf->user_index == 0) { len += HTT_DBG_OUT(buf + len, buf_len - len, @@ -3924,7 +3923,7 @@ htt_ul_user_stats_buf->user_index, htt_ul_user_stats_buf->rx_ulmumimo_mpdu_fail); } -@@ -4108,31 +3835,31 @@ static inline void htt_print_ul_ofdma_us +@@ -4120,31 +3847,31 @@ static inline void htt_print_ul_ofdma_us if (htt_ul_user_stats_buf->user_index == 0) { len += HTT_DBG_OUT(buf + len, buf_len - len, @@ -3963,7 +3962,7 @@ htt_ul_user_stats_buf->user_index, htt_ul_user_stats_buf->rx_ulofdma_data_nusers); -@@ -4161,67 +3888,54 @@ static inline void htt_print_ul_ofdma_tr +@@ -4173,67 +3900,54 @@ static inline void htt_print_ul_ofdma_tr u8 *buf = stats_req->buf; u32 len = stats_req->buf_len; u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; @@ -4063,7 +4062,7 @@ len += HTT_DBG_OUT(buf + len, buf_len - len, "\n"); if (len >= buf_len) { -@@ -4246,7 +3960,7 @@ static inline void htt_print_rx_fse_stat +@@ -4258,7 +3972,7 @@ static inline void htt_print_rx_fse_stat len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_STATS_RX_FSE_STATS_TLV: \n"); len += HTT_DBG_OUT(buf + len, buf_len - len, "=== Software RX FSE STATS ===\n"); len += HTT_DBG_OUT(buf + len, buf_len - len, @@ -4072,40 +4071,3 @@ len += HTT_DBG_OUT(buf + len, buf_len - len, "Disable count = %u\n", htt_stats_buf->fse_disable_cnt); len += HTT_DBG_OUT(buf + len, buf_len - len, -@@ -4345,30 +4059,30 @@ static inline void htt_htt_stats_debug_d - tlv_len = FIELD_GET(HTT_TLV_LEN, *tag_buf) + HTT_TLV_HDR_LEN; - word_len = (tlv_len % 4) == 0 ? (tlv_len / 4) : ((tlv_len / 4) + 1); - len += HTT_DBG_OUT(buf + len, buf_len - len, -- "============================================"); -+ "============================================\n"); - len += HTT_DBG_OUT(buf + len, buf_len - len, - "HKDBG TLV DUMP: (tag_len=%u bytes, words=%u)", - tlv_len, word_len); - - for (i = 0; i + 3 < word_len; i += 4) { - len += HTT_DBG_OUT(buf + len, buf_len - len, -- "0x%08x 0x%08x 0x%08x 0x%08x", -+ "0x%08x 0x%08x 0x%08x 0x%08x\n", - tag_buf[i], tag_buf[i + 1], - tag_buf[i + 2], tag_buf[i + 3]); - } - - if (i + 3 == word_len) { -- len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x 0x%08x 0x%08x ", -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x 0x%08x 0x%08x \n", - tag_buf[i], tag_buf[i + 1], tag_buf[i + 2]); - } else if (i + 2 == word_len) { -- len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x 0x%08x ", -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x 0x%08x \n", - tag_buf[i], tag_buf[i + 1]); - } else if (i + 1 == word_len) { -- len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x ", -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "0x%08x \n", - tag_buf[i]); - } - len += HTT_DBG_OUT(buf + len, buf_len - len, -- "============================================"); -+ "============================================\n"); - - if (len >= buf_len) - buf[buf_len - 1] = 0; diff --git a/feeds/wifi-ax/mac80211/patches/qca/098-ath11k-fix-firmware-crash-due-to-invalid-vdev-id.patch b/feeds/wifi-ax/mac80211/patches/qca/098-ath11k-fix-firmware-crash-due-to-invalid-vdev-id.patch index 547b04703..210a470b5 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/098-ath11k-fix-firmware-crash-due-to-invalid-vdev-id.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/098-ath11k-fix-firmware-crash-due-to-invalid-vdev-id.patch @@ -11,7 +11,7 @@ Signed-off-by: Manikanta Pubbisetty --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -614,6 +614,8 @@ struct ath11k { +@@ -626,6 +626,8 @@ struct ath11k { struct completion fw_mode_reset; int ap_ps_enabled; enum ath11k_ap_ps_state ap_ps_state; @@ -22,58 +22,56 @@ Signed-off-by: Manikanta Pubbisetty struct ath11k_band_cap { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -959,7 +959,7 @@ static int ath11k_mac_monitor_start(stru +@@ -944,7 +944,7 @@ static int ath11k_mac_monitor_start(stru - lockdep_assert_held(&ar->conf_mutex); + lockdep_assert_held(&ar->conf_mutex); -- if (test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) +- if (test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) + if (ar->monitor_vdev_cnt > 0) - goto set_monitor_status; + goto set_monitor_status; - ret = ath11k_mac_monitor_vdev_create(ar); -@@ -975,6 +975,7 @@ static int ath11k_mac_monitor_start(stru - return ret; - } + ret = ath11k_mac_monitor_vdev_create(ar); +@@ -961,6 +961,7 @@ static int ath11k_mac_monitor_start(stru + return ret; + } + ar->monitor_vdev_cnt++; - set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); set_monitor_status: - ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); -@@ -989,8 +990,8 @@ static int ath11k_mac_monitor_stop(struc + ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); +@@ -975,7 +976,7 @@ static int ath11k_mac_monitor_stop(struc - lockdep_assert_held(&ar->conf_mutex); + lockdep_assert_held(&ar->conf_mutex); -- if (!test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) -- goto clear_monitor_status; -+ if (!ar->monitor_vdev_cnt) -+ goto clear_monitor_status; +- if (!test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags)) ++ if (!ar->monitor_vdev_cnt) + goto clear_monitor_status; - ret = ath11k_mac_monitor_vdev_stop(ar); - if (ret) { -@@ -1002,17 +1003,18 @@ static int ath11k_mac_monitor_stop(struc - ath11k_warn(ar->ab, "failed to delete monitor vdev: %d\n", ret); - return ret; - } -- clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + ret = ath11k_mac_monitor_vdev_stop(ar); +@@ -990,17 +991,18 @@ static int ath11k_mac_monitor_stop(struc + return ret; + } + +- clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + ar->monitor_vdev_cnt--; clear_monitor_status: -- ret = ath11k_mac_config_mon_status_default(ar, true); +- ret = ath11k_mac_config_mon_status_default(ar, true); + ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, true); - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); - + if(ar->monitor_vdev_cnt <= 0) + clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); - return ret; + return ret; } int ath11k_mac_monitor_recalc(struct ath11k *ar, bool needed) { -- bool started = test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); +- bool started = test_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + bool started = !!ar->monitor_vdev_cnt; - lockdep_assert_held(&ar->conf_mutex); - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, -@@ -5229,7 +5231,7 @@ static int ath11k_mac_op_add_interface(s + lockdep_assert_held(&ar->conf_mutex); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +@@ -5442,7 +5444,7 @@ static int ath11k_mac_op_add_interface(s } break; case WMI_VDEV_TYPE_MONITOR: @@ -82,7 +80,7 @@ Signed-off-by: Manikanta Pubbisetty break; default: break; -@@ -5332,7 +5334,7 @@ static void ath11k_mac_op_remove_interfa +@@ -5564,7 +5566,7 @@ static void ath11k_mac_op_remove_interfa vif->addr, arvif->vdev_id); if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) @@ -91,21 +89,16 @@ Signed-off-by: Manikanta Pubbisetty err_vdev_del: spin_lock_bh(&ar->data_lock); -@@ -5900,11 +5902,12 @@ ath11k_mac_op_assign_vif_chanctx(struct - ctx->def.chan->center_freq, ret); - goto err; - } -+ - if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { +@@ -6158,7 +6160,7 @@ ath11k_mac_op_assign_vif_chanctx(struct ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr); if (ret) - goto err; + goto out; - set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + ar->monitor_vdev_cnt++; } arvif->is_started = true; -@@ -5945,7 +5948,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc +@@ -6202,7 +6204,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc ath11k_warn(ar->ab, "failed to down monitor vdev %i: %d\n", arvif->vdev_id, ret); arvif->is_up = false; @@ -114,7 +107,7 @@ Signed-off-by: Manikanta Pubbisetty } ret = ath11k_mac_vdev_stop(arvif); -@@ -7328,6 +7331,7 @@ int ath11k_mac_allocate(struct ath11k_ba +@@ -7630,6 +7632,7 @@ int ath11k_mac_allocate(struct ath11k_ba skb_queue_head_init(&ar->wmi_mgmt_tx_queue); clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); ar->monitor_vdev_id = -1; @@ -124,16 +117,18 @@ Signed-off-by: Manikanta Pubbisetty return 0; --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -1057,8 +1057,11 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c +@@ -1090,9 +1090,13 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c if (!reset) tlv_filter.rx_filter = HTT_RX_MON_FILTER_TLV_FLAGS_MON_STATUS_RING; - else + else { tlv_filter = ath11k_mac_mon_status_filter_default; -+ if (ar->debug.extd_rx_stats) + ++ if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) + tlv_filter.rx_filter = ar->debug.rx_filter; + } - ++ ret = ath11k_dp_tx_htt_rx_filter_setup(ab, ring_id, dp->mac_id + i, + HAL_RXDMA_MONITOR_STATUS, diff --git a/feeds/wifi-ax/mac80211/patches/qca/103-ath11k-add-he-ampdu-factor.patch b/feeds/wifi-ax/mac80211/patches/qca/103-ath11k-add-he-ampdu-factor.patch deleted file mode 100644 index 53a411c10..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/103-ath11k-add-he-ampdu-factor.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1628,6 +1628,7 @@ static void ath11k_peer_assoc_h_he(struc - enum nl80211_band band; - const u16 *he_mcs_mask; - u8 max_nss, he_mcs; -+ u8 ampdu_factor; - __le16 he_tx_mcs = 0, v = 0; - int i; - -@@ -1654,6 +1655,30 @@ static void ath11k_peer_assoc_h_he(struc - /* the top most byte is used to indicate BSS color info */ - arg->peer_he_ops &= 0xffffff; - -+ /* As per section 26.6.1 11ax Draft4.0, if the Max AMPDU Exponent Extension -+ * in HE cap is zero, use the arg->peer_max_mpdu as calculated while parsing -+ * VHT caps(if VHT caps is present) or HT caps (if VHT caps is not present). -+ * -+ * For non-zero value of Max AMPDU Extponent Extension in HE MAC caps, -+ * if a HE STA sends VHT cap and HE cap IE in assoc request then, use -+ * MAX_AMPDU_LEN_FACTOR as 20 to calculate max_ampdu length. -+ * If a HE STA that does not send VHT cap, but HE and HT cap in assoc -+ * request, then use MAX_AMPDU_LEN_FACTOR as 16 to calculate max_ampdu -+ * length. -+ */ -+ ampdu_factor = (he_cap->he_cap_elem.mac_cap_info[3] & -+ IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) >> -+ IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_SHIFT; -+ -+ if (ampdu_factor) { -+ if (sta->vht_cap.vht_supported) -+ arg->peer_max_mpdu = (1 << (IEEE80211_HE_VHT_MAX_AMPDU_FACTOR + -+ ampdu_factor)) - 1; -+ else if (sta->ht_cap.ht_supported) -+ arg->peer_max_mpdu = (1 << (IEEE80211_HE_HT_MAX_AMPDU_FACTOR + -+ ampdu_factor)) - 1; -+ } -+ - if (he_cap->he_cap_elem.phy_cap_info[6] & - IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) { - int bit = 7; diff --git a/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-adding-validation-for-tx-stats-and-rx-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-adding-validation-for-tx-stats-and-rx-stats.patch index 2b3dad56f..4544c0f12 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-adding-validation-for-tx-stats-and-rx-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-adding-validation-for-tx-stats-and-rx-stats.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -479,13 +479,11 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -480,13 +480,11 @@ static ssize_t ath11k_dbg_sta_dump_rx_st int len = 0, i, retval = 0; const int size = 4 * 4096; char *buf; @@ -16,7 +16,7 @@ if (!rx_stats) return -ENOENT; -@@ -493,6 +491,9 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -494,6 +492,9 @@ static ssize_t ath11k_dbg_sta_dump_rx_st if (!buf) return -ENOMEM; diff --git a/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-fix-monitor-crash-if-tx-offload-is-enabled.patch b/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-fix-monitor-crash-if-tx-offload-is-enabled.patch index 0abdf2866..9b730a444 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-fix-monitor-crash-if-tx-offload-is-enabled.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/105-ath11k-fix-monitor-crash-if-tx-offload-is-enabled.patch @@ -3,7 +3,7 @@ --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -315,6 +315,8 @@ ath11k_dp_tx_htt_tx_complete_buf(struct +@@ -319,6 +319,8 @@ ath11k_dp_tx_htt_tx_complete_buf(struct struct ieee80211_tx_info *info; struct ath11k_skb_cb *skb_cb; struct ath11k *ar; @@ -12,16 +12,22 @@ spin_lock_bh(&tx_ring->tx_idr_lock); msdu = idr_find(&tx_ring->txbuf_idr, ts->msdu_id); -@@ -336,6 +338,8 @@ ath11k_dp_tx_htt_tx_complete_buf(struct - if (atomic_dec_and_test(&ar->dp.num_tx_pending)) - wake_up(&ar->dp.tx_empty_waitq); +@@ -342,6 +344,14 @@ ath11k_dp_tx_htt_tx_complete_buf(struct -+ flags = skb_cb->flags; -+ vif = skb_cb->vif; dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); ++ if (!skb_cb->vif) { ++ dev_kfree_skb_any(msdu); ++ return; ++ } ++ ++ flags = skb_cb->flags; ++ vif = skb_cb->vif; ++ memset(&info->status, 0, sizeof(info->status)); -@@ -350,8 +354,10 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + + if (ts->acked) { +@@ -354,8 +364,10 @@ ath11k_dp_tx_htt_tx_complete_buf(struct info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; } } @@ -34,7 +40,7 @@ } static void -@@ -419,6 +425,8 @@ static void ath11k_dp_tx_complete_msdu(s +@@ -423,6 +435,8 @@ static void ath11k_dp_tx_complete_msdu(s struct ath11k_skb_cb *skb_cb; struct ath11k_peer *peer; struct ath11k_sta *arsta; @@ -43,7 +49,7 @@ if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) { /* Must not happen */ -@@ -441,6 +449,9 @@ static void ath11k_dp_tx_complete_msdu(s +@@ -445,6 +459,9 @@ static void ath11k_dp_tx_complete_msdu(s goto exit; } @@ -53,7 +59,7 @@ info = IEEE80211_SKB_CB(msdu); memset(&info->status, 0, sizeof(info->status)); -@@ -502,7 +513,10 @@ static void ath11k_dp_tx_complete_msdu(s +@@ -506,7 +523,10 @@ static void ath11k_dp_tx_complete_msdu(s status.info = info; status.rate = &arsta->last_txrate; rcu_read_unlock(); diff --git a/feeds/wifi-ax/mac80211/patches/qca/106-mac80211-enable-rx_packet-counter-in-offload-rx-path.patch b/feeds/wifi-ax/mac80211/patches/qca/106-mac80211-enable-rx_packet-counter-in-offload-rx-path.patch deleted file mode 100644 index 0b33c9cfc..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/106-mac80211-enable-rx_packet-counter-in-offload-rx-path.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -4870,6 +4870,7 @@ ieee80211_rx_handle_decap_offl(struct ie - - u64_stats_update_begin(&stats->syncp); - stats->bytes += skb->len; -+ stats->packets++; - u64_stats_update_end(&stats->syncp); - - if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/107-ath11k-tid-counter-fix.patch b/feeds/wifi-ax/mac80211/patches/qca/107-ath11k-tid-counter-fix.patch index e3039d6b9..f22e43928 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/107-ath11k-tid-counter-fix.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/107-ath11k-tid-counter-fix.patch @@ -10,7 +10,7 @@ Subject: [PATCH] tid fix --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -933,7 +933,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -935,7 +935,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc __le32_to_cpu(eu_stats->info1)); ppdu_info->tid = ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP, diff --git a/feeds/wifi-ax/mac80211/patches/qca/108-ath11k-enable-ul-ofdma-ru-allocation-in-peer-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/108-ath11k-enable-ul-ofdma-ru-allocation-in-peer-stats.patch index aae1bf8bd..731a08b00 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/108-ath11k-enable-ul-ofdma-ru-allocation-in-peer-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/108-ath11k-enable-ul-ofdma-ru-allocation-in-peer-stats.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -619,6 +619,12 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -620,6 +620,12 @@ static ssize_t ath11k_dbg_sta_dump_rx_st len += scnprintf(buf + len, size - len, "%10llu%s", rx_stats->byte_stats.rx_rate[i], (i + 1) % (he_rates_avail ? 12 : 8) ? "\t" : "\n"); @@ -15,7 +15,7 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2829,11 +2829,12 @@ exit: +@@ -2832,11 +2832,12 @@ exit: static void ath11k_dp_rx_update_peer_rate_table_stats(struct ath11k_rx_peer_stats *rx_stats, struct hal_rx_mon_ppdu_info *ppdu_info, @@ -30,7 +30,7 @@ u32 bw_idx = ppdu_info->bw; u32 gi_idx = ppdu_info->gi; -@@ -2855,10 +2856,13 @@ ath11k_dp_rx_update_peer_rate_table_stat +@@ -2858,10 +2859,13 @@ ath11k_dp_rx_update_peer_rate_table_stat } rx_stats->pkt_stats.rx_rate[rate_idx] += num_msdu; @@ -46,7 +46,7 @@ struct hal_rx_mon_ppdu_info *ppdu_info) { struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; -@@ -2915,7 +2919,6 @@ static void ath11k_dp_rx_update_peer_sta +@@ -2918,7 +2922,6 @@ static void ath11k_dp_rx_update_peer_sta rx_stats->num_mpdu_fcs_ok += ppdu_info->num_mpdu_fcs_ok; rx_stats->num_mpdu_fcs_err += ppdu_info->num_mpdu_fcs_err; rx_stats->dcm_count += ppdu_info->dcm; @@ -54,7 +54,7 @@ rx_stats->rx_duration += ppdu_info->rx_duration; arsta->rx_duration = rx_stats->rx_duration; -@@ -2927,10 +2930,10 @@ static void ath11k_dp_rx_update_peer_sta +@@ -2930,10 +2933,10 @@ static void ath11k_dp_rx_update_peer_sta if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11N && ppdu_info->mcs <= HAL_RX_MAX_MCS_HT) { @@ -69,7 +69,7 @@ } if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AC && -@@ -2963,7 +2966,121 @@ static void ath11k_dp_rx_update_peer_sta +@@ -2966,7 +2969,121 @@ static void ath11k_dp_rx_update_peer_sta rx_stats->byte_stats.bw_count[ppdu_info->bw] += ppdu_info->mpdu_len; } @@ -178,7 +178,7 @@ +{ + u32 num_users, i; + -+ if (!ath11k_debug_is_extd_rx_stats_enabled(ar)) ++ if (!ath11k_debugfs_is_extd_rx_stats_enabled(ar)) + return; + + num_users = ppdu_info->num_users; @@ -192,7 +192,7 @@ } static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab, -@@ -3175,6 +3292,55 @@ move_next: +@@ -3173,6 +3290,55 @@ move_next: return num_buffs_reaped; } @@ -248,7 +248,7 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, struct napi_struct *napi, int budget) { -@@ -3228,8 +3394,13 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3226,8 +3392,13 @@ int ath11k_dp_rx_process_mon_status(stru if ((ppdu_info.fc_valid) && (ppdu_info.ast_index != HAL_AST_IDX_INVALID)) { @@ -263,10 +263,10 @@ + } } - if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) { + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) { --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -836,7 +836,6 @@ void ath11k_hal_reo_hw_setup(struct ath1 +@@ -838,7 +838,6 @@ void ath11k_hal_reo_hw_setup(struct ath1 ring_hash_map)); } @@ -274,7 +274,7 @@ static inline void ath11k_hal_rx_handle_ofdma_info(void *rx_tlv, struct hal_rx_user_status *rx_user_status) -@@ -870,6 +869,8 @@ ath11k_hal_rx_populate_mu_user_info(void +@@ -872,6 +871,8 @@ ath11k_hal_rx_populate_mu_user_info(void { rx_user_status->ast_index = ppdu_info->ast_index; rx_user_status->tid = ppdu_info->tid; @@ -283,7 +283,7 @@ rx_user_status->tcp_msdu_count = ppdu_info->tcp_msdu_count; rx_user_status->udp_msdu_count = -@@ -893,6 +894,9 @@ ath11k_hal_rx_populate_mu_user_info(void +@@ -895,6 +896,9 @@ ath11k_hal_rx_populate_mu_user_info(void ppdu_info->num_mpdu_fcs_ok; rx_user_status->mpdu_cnt_fcs_err = ppdu_info->num_mpdu_fcs_err; @@ -293,7 +293,7 @@ ath11k_hal_rx_populate_byte_count(rx_tlv, ppdu_info, rx_user_status); } -@@ -916,6 +920,14 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -918,6 +922,14 @@ ath11k_hal_rx_parse_mon_status_tlv(struc __le32_to_cpu(ppdu_start->info0)); ppdu_info->chan_num = __le32_to_cpu(ppdu_start->chan_num); ppdu_info->ppdu_ts = __le32_to_cpu(ppdu_start->ppdu_start_ts); @@ -308,7 +308,7 @@ break; } case HAL_RX_PPDU_END_USER_STATS: { -@@ -970,26 +982,26 @@ ath11k_hal_rx_parse_mon_status_tlv(struc +@@ -972,26 +984,26 @@ ath11k_hal_rx_parse_mon_status_tlv(struc if(userid < HAL_MAX_UL_MU_USERS) { struct hal_rx_user_status *rxuser_stats = @@ -417,7 +417,7 @@ struct hal_rx_ppdu_start { --- a/drivers/net/wireless/ath/ath11k/peer.c +++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -76,6 +76,20 @@ struct ath11k_peer *ath11k_peer_find_by_ +@@ -93,6 +93,20 @@ struct ath11k_peer *ath11k_peer_find_by_ return NULL; } @@ -440,7 +440,7 @@ struct ath11k_peer *peer; --- a/drivers/net/wireless/ath/ath11k/peer.h +++ b/drivers/net/wireless/ath/ath11k/peer.h -@@ -51,6 +51,7 @@ struct ath11k_peer *ath11k_peer_find(str +@@ -52,6 +52,7 @@ struct ath11k_peer *ath11k_peer_find(str struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, const u8 *addr); struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id); diff --git a/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-avoid-user-cc-setting-in-active-vdev.patch b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-avoid-user-cc-setting-in-active-vdev.patch new file mode 100644 index 000000000..00a4dfb17 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-avoid-user-cc-setting-in-active-vdev.patch @@ -0,0 +1,54 @@ +--- a/drivers/net/wireless/ath/ath11k/reg.c ++++ b/drivers/net/wireless/ath/ath11k/reg.c +@@ -41,6 +41,37 @@ static bool ath11k_regdom_changes(struct + return memcmp(regd->alpha2, alpha2, 2) != 0; + } + ++static bool ath11k_reg_validate_pdev_state(struct ath11k* ar) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct ath11k_pdev *pdev; ++ struct ath11k* tmp_ar; ++ int i; ++ ++ rcu_read_lock(); ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = rcu_dereference(ab->pdevs_active[i]); ++ if (!pdev) ++ continue; ++ ++ tmp_ar = pdev->ar; ++ if (tmp_ar) { ++ mutex_lock(&tmp_ar->conf_mutex); ++ if (tmp_ar->num_started_vdevs) { ++ if (tmp_ar == ar) ++ ath11k_warn(ab, "%s has active interface, please bring down to set country code", ++ wiphy_name(ar->hw->wiphy)); ++ mutex_unlock(&tmp_ar->conf_mutex); ++ rcu_read_unlock(); ++ return false; ++ } ++ mutex_unlock(&tmp_ar->conf_mutex); ++ } ++ } ++ rcu_read_unlock(); ++ return true; ++} ++ + static void + ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) + { +@@ -74,6 +105,13 @@ ath11k_reg_notifier(struct wiphy *wiphy, + return; + } + ++ /* The SET_INIT_COUNTRY command should not be sent to firmware while any vdev is active. ++ * Also it does not make sense to give the command for certain pdev's alone. ++ * Hence check all the pdev's if any have an active vdev before sending the command. ++ */ ++ if (!ath11k_reg_validate_pdev_state(ar)) ++ return; ++ + /* Set the country code to the firmware and wait for + * the WMI_REG_CHAN_LIST_CC EVENT for updating the + * reg info diff --git a/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-boot-without-caldata.patch b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-boot-without-caldata.patch index 00f928f34..2c3d2f9d7 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-boot-without-caldata.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-boot-without-caldata.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2254,9 +2254,9 @@ ath11k_qmi_prepare_bdf_download(struct a +@@ -2283,9 +2283,9 @@ ath11k_qmi_prepare_bdf_download(struct a fw_entry = ath11k_core_firmware_request(ab, ATH11K_DEFAULT_CAL_FILE); if (IS_ERR(fw_entry)) { ret = PTR_ERR(fw_entry); diff --git a/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-fix-setting-range-of-mcs-rates-in-he.patch b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-fix-setting-range-of-mcs-rates-in-he.patch index f6e23061a..fa77d3bde 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-fix-setting-range-of-mcs-rates-in-he.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/110-ath11k-fix-setting-range-of-mcs-rates-in-he.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1754,6 +1754,16 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1740,6 +1740,16 @@ static void ath11k_peer_assoc_h_he(struc he_tx_mcs = v; break; } @@ -17,7 +17,7 @@ /* Calculate peer NSS capability from HE capabilities if STA * supports HE. */ -@@ -6526,7 +6536,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6761,7 +6771,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie * RATEMASK CMD */ ath11k_warn(ar->ab, @@ -26,7 +26,7 @@ return -EINVAL; } -@@ -6536,7 +6546,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6771,7 +6781,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie if (!ath11k_mac_he_mcs_range_present(ar, band, mask) && num_rates > 1) { ath11k_warn(ar->ab, @@ -37,7 +37,7 @@ --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -2003,8 +2003,8 @@ int ath11k_wmi_send_peer_assoc_cmd(struc +@@ -2006,8 +2006,8 @@ int ath11k_wmi_send_peer_assoc_cmd(struc FIELD_PREP(WMI_TLV_LEN, sizeof(*he_mcs) - TLV_HDR_SIZE); @@ -50,7 +50,7 @@ --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -3934,8 +3934,8 @@ struct wmi_vht_rate_set { +@@ -3956,8 +3956,8 @@ struct wmi_vht_rate_set { struct wmi_he_rate_set { u32 tlv_header; @@ -63,9 +63,9 @@ #define MAX_REG_RULES 10 --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -116,6 +116,14 @@ struct ath11k_generic_iter { - - #define ATH11K_CHAN_WIDTH_NUM 8 +@@ -122,6 +122,14 @@ struct ath11k_generic_iter { + #define ATH11K_OBSS_PD_SRG_EN BIT(30) + #define ATH11K_OBSS_PD_NON_SRG_EN BIT(31) +/* HECAP info internal bits */ +#define IEEE80211_HE_DL_MUMIMO_SUPP_S 5 diff --git a/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-add-btcoex-debugfs-support.patch b/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-add-btcoex-debugfs-support.patch index bc463d05c..dcd7a5fe9 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-add-btcoex-debugfs-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-add-btcoex-debugfs-support.patch @@ -1,6 +1,6 @@ ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1355,6 +1355,186 @@ static const struct file_operations fops +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1249,6 +1249,247 @@ static const struct file_operations fops .open = simple_open }; @@ -184,10 +184,71 @@ + .open = simple_open +}; + - int ath11k_debug_register(struct ath11k *ar) ++static ssize_t ath11k_write_btcoex_algo(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif; ++ struct ath11k *ar = file->private_data; ++ unsigned int coex_algo; ++ struct coex_config_arg coex_config; ++ int ret; ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &coex_algo)) ++ return -EINVAL; ++ ++ if (coex_algo >= COEX_ALGO_MAX_SUPPORTED) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ arvif = list_first_entry(&ar->arvifs, typeof(*arvif), list); ++ if (!arvif->is_started) { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ ar->coex.coex_algo_type = coex_algo; ++ coex_config.vdev_id = arvif->vdev_id; ++ coex_config.config_type = WMI_COEX_CONFIG_FORCED_ALGO; ++ coex_config.coex_algo = coex_algo; ++ ++ ret = ath11k_send_coex_config_cmd(ar, &coex_config); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "failed to set coex algorithm vdev_id %d ret %d\n", ++ coex_config.vdev_id, ret); ++ goto exit; ++ } ++ ++ ret = count; ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_read_btcoex_algo(struct file *file, char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ char buf[32]; ++ int len = 0; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ ar->coex.coex_algo_type); ++ return simple_read_from_buffer(ubuf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_btcoex_algo = { ++ .read = ath11k_read_btcoex_algo, ++ .write = ath11k_write_btcoex_algo, ++ .open = simple_open ++}; ++ + int ath11k_debugfs_register(struct ath11k *ar) { struct ath11k_base *ab = ar->ab; -@@ -1390,6 +1570,12 @@ int ath11k_debug_register(struct ath11k +@@ -1279,6 +1520,15 @@ int ath11k_debugfs_register(struct ath11 debugfs_create_file("pktlog_filter", 0644, ar->debug.debugfs_pdev, ar, &fops_pktlog_filter); @@ -197,12 +258,15 @@ + debugfs_create_file("btcoex_duty_cycle", 0644, + ar->debug.debugfs_pdev, ar, + &fops__btcoex_duty_cycle); ++ debugfs_create_file("btcoex_algorithm", 0644, ++ ar->debug.debugfs_pdev, ar, ++ &fops_btcoex_algo); if (ar->hw->wiphy->bands[NL80211_BAND_5GHZ]) { debugfs_create_file("dfs_simulate_radar", 0200, --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1556,6 +1556,17 @@ static void ath11k_wmi_copy_coex_config( +@@ -1558,6 +1558,26 @@ static void ath11k_wmi_copy_coex_config( coex_config->bt_txrx_time, coex_config->bt_priority_time, coex_config->pta_algorithm, coex_config->pta_priority); } @@ -217,23 +281,47 @@ + coex_config->duty_cycle, + coex_config->wlan_duration); + } ++ ++ if (coex_config->config_type == WMI_COEX_CONFIG_FORCED_ALGO) { ++ cmd->coex_algo = coex_config->coex_algo; ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, ++ "WMI coex config type %u vdev id %d coex_algorithm %u\n", ++ coex_config->config_type, ++ coex_config->vdev_id, ++ coex_config->coex_algo); ++ } } int ath11k_send_coex_config_cmd(struct ath11k *ar, --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -4784,6 +4784,10 @@ struct coex_config_arg { +@@ -4792,6 +4792,11 @@ enum wmi_coex_config_type { + WMI_COEX_CONFIG_WLAN_SCAN_PRIORITY = 15, + WMI_COEX_CONFIG_WLAN_PKT_PRIORITY = 16, + WMI_COEX_CONFIG_PTA_INTERFACE = 17, ++ /* WMI_COEX_CONFIG_FORCED_ALGO ++ * config to select coex algorithm ++ * coex_algo: select fixed coex algorithm ++ */ ++ WMI_COEX_CONFIG_FORCED_ALGO = 47, + }; + + struct coex_config_arg { +@@ -4817,6 +4822,13 @@ struct coex_config_arg { u32 wlan_pkt_weight; u32 bt_pkt_weight; }; + struct { + u32 duty_cycle; + u32 wlan_duration; ++ }; ++ struct { ++ u32 coex_algo; + }; }; }; -@@ -4811,6 +4815,11 @@ struct wmi_coex_config_cmd { +@@ -4844,6 +4856,15 @@ struct wmi_coex_config_cmd { u32 wlan_pkt_weight; u32 bt_pkt_weight; } __packed; @@ -241,6 +329,10 @@ + struct { + u32 duty_cycle; + u32 wlan_duration; ++ } __packed; ++ ++ struct { ++ u32 coex_algo; + } __packed; } __packed; } __packed; @@ -368,7 +460,7 @@ WIPHY_VENDOR_CMD_NEED_RUNNING, --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -476,6 +476,10 @@ struct ath11k_coex_info { +@@ -487,6 +487,10 @@ struct ath11k_coex_info { u32 bt_priority_time_slot; u32 coex_algo_type; u32 pta_priority; @@ -379,7 +471,7 @@ }; enum ath11k_ap_ps_state { -@@ -483,6 +487,12 @@ enum ath11k_ap_ps_state { +@@ -494,6 +498,13 @@ enum ath11k_ap_ps_state { ATH11K_AP_PS_STATE_ON, }; @@ -387,8 +479,23 @@ + COEX_ALGO_UNCONS_FREERUN = 0, + COEX_ALGO_FREERUN, + COEX_ALGO_OCS, ++ COEX_ALGO_MAX_SUPPORTED, +}; + struct ath11k { struct ath11k_base *ab; struct ath11k_pdev *pdev; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -7276,6 +7276,11 @@ static void ath11k_mac_fetch_coex_info(s + ath11k_err(ab, "No qcom,pta-priority entry in dev-tree.\n"); + } + ++ if (ar->coex.coex_algo_type == COEX_ALGO_OCS) { ++ ar->coex.duty_cycle = 100000; ++ ar->coex.wlan_duration = 80000; ++ } ++ + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "coex pta_num %u coex_mode %u" + " bt_active_time_slot %u bt_priority_time_slot %u" + " coex_algorithm %u pta_priority %u\n", ar->coex.pta_num, diff --git a/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-fix-parsing-pktlog-lite.patch b/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-fix-parsing-pktlog-lite.patch index ed43871ed..c105ff346 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-fix-parsing-pktlog-lite.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/112-ath11k-fix-parsing-pktlog-lite.patch @@ -1,6 +1,6 @@ ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1206,7 +1206,7 @@ static ssize_t ath11k_write_pktlog_filte +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1100,7 +1100,7 @@ static ssize_t ath11k_write_pktlog_filte struct htt_rx_ring_tlv_filter tlv_filter = {0}; u32 rx_filter = 0, ring_id, filter, mode; u8 buf[128] = {0}; @@ -9,7 +9,7 @@ ssize_t rc; mutex_lock(&ar->conf_mutex); -@@ -1244,6 +1244,19 @@ static ssize_t ath11k_write_pktlog_filte +@@ -1138,6 +1138,19 @@ static ssize_t ath11k_write_pktlog_filte } } @@ -29,7 +29,7 @@ #define HTT_RX_FILTER_TLV_LITE_MODE \ (HTT_RX_FILTER_TLV_FLAGS_PPDU_START | \ HTT_RX_FILTER_TLV_FLAGS_PPDU_END | \ -@@ -1259,6 +1272,7 @@ static ssize_t ath11k_write_pktlog_filte +@@ -1153,6 +1166,7 @@ static ssize_t ath11k_write_pktlog_filte HTT_RX_FILTER_TLV_FLAGS_MPDU_END | HTT_RX_FILTER_TLV_FLAGS_PACKET_HEADER | HTT_RX_FILTER_TLV_FLAGS_ATTENTION; @@ -37,7 +37,7 @@ } else if (mode == ATH11K_PKTLOG_MODE_LITE) { ret = ath11k_dp_tx_htt_h2t_ppdu_stats_req(ar, HTT_PPDU_STATS_TAG_PKTLOG); -@@ -1268,7 +1282,12 @@ static ssize_t ath11k_write_pktlog_filte +@@ -1162,7 +1176,12 @@ static ssize_t ath11k_write_pktlog_filte } rx_filter = HTT_RX_FILTER_TLV_LITE_MODE; @@ -50,7 +50,7 @@ ret = ath11k_dp_tx_htt_h2t_ppdu_stats_req(ar, HTT_PPDU_STATS_TAG_DEFAULT); if (ret) { -@@ -1292,7 +1311,7 @@ static ssize_t ath11k_write_pktlog_filte +@@ -1186,7 +1205,7 @@ static ssize_t ath11k_write_pktlog_filte ret = ath11k_dp_tx_htt_rx_filter_setup(ab, ring_id, ar->dp.mac_id + i, HAL_RXDMA_MONITOR_STATUS, @@ -59,7 +59,7 @@ if (ret) { ath11k_warn(ab, "failed to set rx filter for monitor status ring\n"); -@@ -1300,8 +1319,8 @@ static ssize_t ath11k_write_pktlog_filte +@@ -1194,8 +1213,8 @@ static ssize_t ath11k_write_pktlog_filte } } @@ -72,7 +72,7 @@ ar->debug.pktlog_mode = mode; --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -193,6 +193,7 @@ struct ath11k_pdev_dp { +@@ -195,6 +195,7 @@ struct ath11k_pdev_dp { #define DP_RXDMA_MONITOR_DESC_RING_SIZE 4096 #define DP_RX_BUFFER_SIZE 2048 @@ -82,7 +82,7 @@ #define DP_RXDMA_BUF_COOKIE_BUF_ID GENMASK(17, 0) --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3352,6 +3352,8 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3350,6 +3350,8 @@ int ath11k_dp_rx_process_mon_status(stru struct ath11k_peer *peer; struct ath11k_sta *arsta; int num_buffs_reaped = 0; @@ -91,16 +91,14 @@ __skb_queue_head_init(&skb_list); -@@ -3364,10 +3366,18 @@ int ath11k_dp_rx_process_mon_status(stru - memset(&ppdu_info, 0, sizeof(ppdu_info)); +@@ -3363,9 +3365,17 @@ int ath11k_dp_rx_process_mon_status(stru ppdu_info.peer_id = HAL_INVALID_PEERID; -- if (ath11k_debug_is_pktlog_rx_stats_enabled(ar)) { + if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) { - trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE); -+ if (ath11k_debug_is_pktlog_lite_mode_enabled(ar)) { + log_type = ATH11K_PKTLOG_TYPE_LITE_RX; + rx_buf_sz = DP_RX_BUFFER_SIZE_LITE; -+ } else if (ath11k_debug_is_pktlog_rx_stats_enabled(ar)) { ++ } else if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) { + log_type = ATH11K_PKTLOG_TYPE_RX_STATBUF; + rx_buf_sz = DP_RX_BUFFER_SIZE; + } @@ -113,10 +111,10 @@ } hal_status = ath11k_hal_rx_parse_mon_status(ab, &ppdu_info, skb); -@@ -3404,9 +3414,8 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3402,9 +3412,8 @@ int ath11k_dp_rx_process_mon_status(stru } - if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) { + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) { - trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE); - ath11k_rx_stats_buf_pktlog_process(ar, skb->data, - DP_RX_BUFFER_SIZE); diff --git a/feeds/wifi-ax/mac80211/patches/qca/113-ath11k-add-8023-undecap-support.patch b/feeds/wifi-ax/mac80211/patches/qca/113-ath11k-add-8023-undecap-support.patch index 6096e69de..ba9113c10 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/113-ath11k-add-8023-undecap-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/113-ath11k-add-8023-undecap-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2271,6 +2271,42 @@ static void ath11k_dp_rx_h_undecap_eth(s +@@ -2264,6 +2264,42 @@ static void ath11k_dp_rx_h_undecap_eth(s ether_addr_copy(ieee80211_get_SA(hdr), sa); } @@ -43,7 +43,7 @@ static void ath11k_dp_rx_h_undecap(struct ath11k *ar, struct sk_buff *msdu, struct hal_rx_desc *rx_desc, enum hal_encrypt_type enctype, -@@ -2301,7 +2337,8 @@ static void ath11k_dp_rx_h_undecap(struc +@@ -2294,7 +2330,8 @@ static void ath11k_dp_rx_h_undecap(struc enctype, status); break; case DP_RX_DECAP_TYPE_8023: diff --git a/feeds/wifi-ax/mac80211/patches/qca/116-ath11k-clean-up-monitor-vdev-del.patch b/feeds/wifi-ax/mac80211/patches/qca/116-ath11k-clean-up-monitor-vdev-del.patch index 870ed64d4..8d97a55b3 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/116-ath11k-clean-up-monitor-vdev-del.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/116-ath11k-clean-up-monitor-vdev-del.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -189,10 +189,6 @@ enum ath11k_dev_flags { +@@ -200,10 +200,6 @@ enum ath11k_dev_flags { ATH11K_FLAG_FW_RESTART_FOR_HOST, }; @@ -11,15 +11,15 @@ struct ath11k_vif { u32 vdev_id; enum wmi_vdev_type vdev_type; -@@ -525,7 +521,6 @@ struct ath11k { - } mac; +@@ -539,7 +535,6 @@ struct ath11k { + unsigned long dev_flags; unsigned int filter_flags; - unsigned long monitor_flags; u32 min_tx_power; u32 max_tx_power; u32 txpower_limit_2g; -@@ -535,7 +530,8 @@ struct ath11k { +@@ -549,7 +544,8 @@ struct ath11k { u32 chan_tx_pwr; u32 num_stations; u32 max_num_stations; @@ -29,7 +29,7 @@ /* To synchronize concurrent synchronous mac80211 callback operations, * concurrent debugfs configuration and concurrent FW statistics events. */ -@@ -625,7 +621,7 @@ struct ath11k { +@@ -639,7 +635,7 @@ struct ath11k { int ap_ps_enabled; enum ath11k_ap_ps_state ap_ps_state; @@ -40,7 +40,7 @@ struct ath11k_band_cap { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -774,6 +774,20 @@ ath11k_mac_get_any_chandef_iter(struct i +@@ -742,6 +742,20 @@ ath11k_mac_get_any_chandef_iter(struct i *def = &conf->def; } @@ -60,8 +60,8 @@ + static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) { - struct cfg80211_chan_def *chandef = NULL; -@@ -845,16 +859,19 @@ static int ath11k_mac_monitor_vdev_stop( + struct cfg80211_chan_def *chandef = NULL; +@@ -820,6 +834,7 @@ static int ath11k_mac_monitor_vdev_stop( int ret = 0; lockdep_assert_held(&ar->conf_mutex); @@ -69,194 +69,145 @@ reinit_completion(&ar->vdev_setup_done); ret = ath11k_wmi_vdev_stop(ar, ar->monitor_vdev_id); - if (ret) - ath11k_warn(ar->ab, "failed to to request monitor vdev %i stop: %d\n", - ar->monitor_vdev_id, ret); -+ - ret = ath11k_mac_vdev_setup_sync(ar); - if (ret) - ath11k_warn(ar->ab, "failed to synchronize monitor vdev %i stop: %d\n", - ar->monitor_vdev_id, ret); -+ - ret = ath11k_wmi_vdev_down(ar, ar->monitor_vdev_id); - if (ret) - ath11k_warn(ar->ab, "failed to put down monitor vdev %i: %d\n", -@@ -872,8 +889,14 @@ static int ath11k_mac_monitor_vdev_creat - int bit, ret = 0; - u8 tmp_addr[6] = {0}; - u16 nss = 0; -+ - lockdep_assert_held(&ar->conf_mutex); +@@ -851,6 +866,10 @@ static int ath11k_mac_monitor_vdev_creat + u16 nss = 0; + + lockdep_assert_held(&ar->conf_mutex); + + if (ar->monitor_vdev_created) + return 0; + - memset(¶m, 0, sizeof(param)); -+ - if (ar->ab->free_vdev_map == 0) { - ath11k_warn(ar->ab, "failed to find free vdev id for monitor vdev\n"); - return -ENOMEM; -@@ -896,6 +919,7 @@ static int ath11k_mac_monitor_vdev_creat - param.chains[NL80211_BAND_5GHZ].tx = ar->num_tx_chains; - param.chains[NL80211_BAND_5GHZ].rx = ar->num_rx_chains; - } -+ - ret = ath11k_wmi_vdev_create(ar, tmp_addr, ¶m); - if (ret) { - ath11k_warn(ar->ab, "failed to request monitor vdev %i creation: %d\n", -@@ -917,7 +941,10 @@ static int ath11k_mac_monitor_vdev_creat - if (ret) - return ret; + memset(¶m, 0, sizeof(param)); + + if (ar->ab->free_vdev_map == 0) { +@@ -898,7 +917,10 @@ static int ath11k_mac_monitor_vdev_creat + if (ret) + return ret; + ar->allocated_vdev_map |= 1LL << ar->monitor_vdev_id; - ar->ab->free_vdev_map &= ~(1LL << ar->monitor_vdev_id); + ar->ab->free_vdev_map &= ~(1LL << ar->monitor_vdev_id); + ar->num_created_vdevs++; + ar->monitor_vdev_created = true; - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d created\n", - ar->monitor_vdev_id); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d created\n", + ar->monitor_vdev_id); -@@ -928,8 +955,12 @@ static int ath11k_mac_monitor_vdev_delet +@@ -909,8 +931,12 @@ static int ath11k_mac_monitor_vdev_delet { - int ret = 0; - unsigned long time_left = 0; + int ret = 0; + unsigned long time_left = 0; + lockdep_assert_held(&ar->conf_mutex); + if (!ar->monitor_vdev_created) + return 0; + - reinit_completion(&ar->vdev_delete_done); + reinit_completion(&ar->vdev_delete_done); - ret = ath11k_wmi_vdev_delete(ar, ar->monitor_vdev_id); -@@ -943,86 +974,62 @@ static int ath11k_mac_monitor_vdev_delet - if (time_left == 0) { - ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); - } else { + ret = ath11k_wmi_vdev_delete(ar, ar->monitor_vdev_id); +@@ -925,14 +951,15 @@ static int ath11k_mac_monitor_vdev_delet + if (time_left == 0) { + ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); + } else { + ar->allocated_vdev_map &= ~(1LL << ar->monitor_vdev_id); - ar->ab->free_vdev_map |= 1LL << (ar->monitor_vdev_id); + ar->ab->free_vdev_map |= 1LL << (ar->monitor_vdev_id); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d deleted\n", + ar->monitor_vdev_id); - ar->num_created_vdevs--; - ar->monitor_vdev_id = -1; + ar->num_created_vdevs--; + ar->monitor_vdev_id = -1; + ar->monitor_vdev_created = false; - } + } -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d deleted\n", -- ar->monitor_vdev_id); - return ret; +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %d deleted\n", +- ar->monitor_vdev_id); +- + return ret; } - static int ath11k_mac_monitor_start(struct ath11k *ar) - { -- int ret; -+ int ret; +@@ -942,15 +969,8 @@ static int ath11k_mac_monitor_start(stru -- lockdep_assert_held(&ar->conf_mutex); -+ lockdep_assert_held(&ar->conf_mutex); + lockdep_assert_held(&ar->conf_mutex); - if (ar->monitor_vdev_cnt > 0) -- goto set_monitor_status; +- goto set_monitor_status; +- +- ret = ath11k_mac_monitor_vdev_create(ar); +- if (ret) { +- ath11k_warn(ar->ab, "failed to create monitor vdev: %d\n", ret); +- ar->monitor_vdev_id = -1; +- return ret; +- } + if (ar->monitor_started) + return 0; -- ret = ath11k_mac_monitor_vdev_create(ar); -- if (ret) { -- ath11k_warn(ar->ab, "failed to create monitor vdev: %d\n", ret); -- ar->monitor_vdev_id = -1; -- return ret; -- } -- ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); -- if (ret) { -- ath11k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); -- ath11k_mac_monitor_vdev_delete(ar); -- return ret; -- } -+ ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); -+ ath11k_mac_monitor_vdev_delete(ar); -+ return ret; -+ } + ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); + if (ret) { +@@ -959,9 +979,8 @@ static int ath11k_mac_monitor_start(stru + return ret; + } - ar->monitor_vdev_cnt++; -- set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); +- set_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); -set_monitor_status: -- ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor started ret %d\n", ret); + ar->monitor_started = true; + ar->num_started_vdevs++; -+ ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor started ret %d\n", ret); + ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, false); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor started ret %d\n", ret); -- return ret; -+ return ret; - } +@@ -974,8 +993,8 @@ static int ath11k_mac_monitor_stop(struc - static int ath11k_mac_monitor_stop(struct ath11k *ar) - { -- int ret; -- -- lockdep_assert_held(&ar->conf_mutex); -+ int ret; + lockdep_assert_held(&ar->conf_mutex); -- if (!ar->monitor_vdev_cnt) -- goto clear_monitor_status; -+ lockdep_assert_held(&ar->conf_mutex); - -- ret = ath11k_mac_monitor_vdev_stop(ar); -- if (ret) { -- ath11k_warn(ar->ab, "failed to stop monitor vdev: %d\n", ret); -- return ret; -- } -- ret = ath11k_mac_monitor_vdev_delete(ar); -- if (ret) { -- ath11k_warn(ar->ab, "failed to delete monitor vdev: %d\n", ret); -- return ret; -- } -- ar->monitor_vdev_cnt--; --clear_monitor_status: -- ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, true); -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); -- if(ar->monitor_vdev_cnt <= 0) -- clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); -- return ret; --} +- if (!ar->monitor_vdev_cnt) +- goto clear_monitor_status; + if (!ar->monitor_started) + return 0; + ret = ath11k_mac_monitor_vdev_stop(ar); + if (ret) { +@@ -983,47 +1002,47 @@ static int ath11k_mac_monitor_stop(struc + return ret; + } + +- ret = ath11k_mac_monitor_vdev_delete(ar); +- if (ret) { +- ath11k_warn(ar->ab, "failed to delete monitor vdev: %d\n", ret); +- return ret; +- } +- +- ar->monitor_vdev_cnt--; +-clear_monitor_status: ++ ar->monitor_started = false; ++ ar->num_started_vdevs--; + ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, true); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); +- if(ar->monitor_vdev_cnt <= 0) +- clear_bit(ATH11K_MONITOR_FLAG_STARTED, &ar->monitor_flags); + return ret; + } + -int ath11k_mac_monitor_recalc(struct ath11k *ar, bool needed) -{ - bool started = !!ar->monitor_vdev_cnt; -+ ret = ath11k_mac_monitor_vdev_stop(ar); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to stop monitor vdev: %d\n", ret); -+ return ret; -+ } - -- lockdep_assert_held(&ar->conf_mutex); -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, -- "mac monitor recalc started? %d needed? %d\n", started, needed); -- if (needed) -- return ath11k_mac_monitor_start(ar); -- else -- return ath11k_mac_monitor_stop(ar); -+ ar->monitor_started = false; -+ ar->num_started_vdevs--; -+ ret = ath11k_dp_tx_htt_monitor_mode_ring_config(ar, true); -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor stopped ret %d\n", ret); -+ return ret; - } - +- +- lockdep_assert_held(&ar->conf_mutex); +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +- "mac monitor recalc started? %d needed? %d\n", started, needed); +- +- if (needed) +- return ath11k_mac_monitor_start(ar); +- else +- return ath11k_mac_monitor_stop(ar); +-} +- static int ath11k_mac_op_config(struct ieee80211_hw *hw, u32 changed) -@@ -1031,16 +1038,35 @@ static int ath11k_mac_op_config(struct i + { + struct ath11k *ar = hw->priv; struct ieee80211_conf *conf = &hw->conf; - int ret = 0; - - /* mac80211 requires this op to be present and that's why - * there's an empty function, this can be extended when - * required. - */ -- ++ mutex_lock(&ar->conf_mutex); - if (changed & IEEE80211_CONF_CHANGE_MONITOR) @@ -285,13 +236,13 @@ +exit: + mutex_unlock(&ar->conf_mutex); + return ret; - ++ +err_mon_del: + ath11k_mac_monitor_vdev_delete(ar); + mutex_unlock(&ar->conf_mutex); - return ret; -@@ -4961,6 +4987,8 @@ static void ath11k_mac_op_stop(struct ie +@@ -5187,6 +5206,8 @@ static void ath11k_mac_op_stop(struct ie ath11k_mac_drain_tx(ar); mutex_lock(&ar->conf_mutex); @@ -300,7 +251,7 @@ ret = ath11k_mac_config_mon_status_default(ar, false); if (ret) ath11k_err(ar->ab, "failed to clear rx_filter for monitor status ring: (%d)\n", -@@ -5073,8 +5101,8 @@ static int ath11k_mac_op_add_interface(s +@@ -5315,8 +5336,8 @@ static int ath11k_mac_op_add_interface(s } if (ar->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) { @@ -311,7 +262,7 @@ ret = -EBUSY; goto err; } -@@ -5119,6 +5147,7 @@ static int ath11k_mac_op_add_interface(s +@@ -5361,6 +5382,7 @@ static int ath11k_mac_op_add_interface(s break; case NL80211_IFTYPE_MONITOR: arvif->vdev_type = WMI_VDEV_TYPE_MONITOR; @@ -319,7 +270,7 @@ break; default: WARN_ON(1); -@@ -5266,7 +5295,7 @@ static int ath11k_mac_op_add_interface(s +@@ -5462,7 +5484,7 @@ static int ath11k_mac_op_add_interface(s } break; case WMI_VDEV_TYPE_MONITOR: @@ -328,7 +279,7 @@ break; default: break; -@@ -5289,12 +5318,20 @@ static int ath11k_mac_op_add_interface(s +@@ -5485,12 +5507,17 @@ static int ath11k_mac_op_add_interface(s ath11k_dp_vdev_tx_attach(ar, arvif); ret = ath11k_mac_ap_ps_recalc(ar); @@ -338,11 +289,8 @@ + ret = 0; + } + -+ if (vif->type != NL80211_IFTYPE_MONITOR && ar->monitor_conf_enabled) { -+ ret = ath11k_mac_monitor_vdev_create(ar); -+ if (ret) -+ goto err_peer_del; -+ } ++ if (vif->type != NL80211_IFTYPE_MONITOR && ar->monitor_conf_enabled) ++ ath11k_mac_monitor_vdev_create(ar); mutex_unlock(&ar->conf_mutex); @@ -351,13 +299,14 @@ err_peer_del: if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { -@@ -5368,8 +5405,11 @@ static void ath11k_mac_op_remove_interfa +@@ -5583,8 +5610,12 @@ static void ath11k_mac_op_remove_interfa ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", vif->addr, arvif->vdev_id); - if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) - ar->monitor_vdev_cnt--; + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { ++ ar->monitor_vdev_id = -1; + ar->monitor_vdev_created = false; + } + else if (ar->monitor_vdev_created && !ar->monitor_started) @@ -365,7 +314,7 @@ err_vdev_del: spin_lock_bh(&ar->data_lock); -@@ -5532,20 +5572,6 @@ static void ath11k_mac_op_remove_chanctx +@@ -5751,20 +5782,6 @@ static void ath11k_mac_op_remove_chanctx mutex_unlock(&ar->conf_mutex); } @@ -386,7 +335,7 @@ static int ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, const struct cfg80211_chan_def *chandef, -@@ -5747,12 +5773,16 @@ ath11k_mac_update_vif_chan(struct ath11k +@@ -5965,12 +5982,16 @@ ath11k_mac_update_vif_chan(struct ath11k struct ath11k_vif *arvif; int ret; int i; @@ -401,9 +350,9 @@ + monitor_vif = true; + ath11k_dbg(ab, ATH11K_DBG_MAC, - "mac chanctx switch vdev_id %i freq %hu->%hu width %d->%d\n", + "mac chanctx switch vdev_id %i freq %u->%u width %d->%d\n", arvif->vdev_id, -@@ -5810,6 +5840,12 @@ ath11k_mac_update_vif_chan(struct ath11k +@@ -6028,6 +6049,12 @@ ath11k_mac_update_vif_chan(struct ath11k continue; } } @@ -416,8 +365,8 @@ } static void -@@ -5930,6 +5966,15 @@ ath11k_mac_op_assign_vif_chanctx(struct - return -EBUSY; +@@ -6167,6 +6194,15 @@ ath11k_mac_op_assign_vif_chanctx(struct + } } + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { @@ -432,30 +381,30 @@ ret = ath11k_mac_vdev_start(arvif, &ctx->def); if (ret) { ath11k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n", -@@ -5938,17 +5983,14 @@ ath11k_mac_op_assign_vif_chanctx(struct - goto err; +@@ -6174,17 +6210,14 @@ ath11k_mac_op_assign_vif_chanctx(struct + ctx->def.chan->center_freq, ret); + goto out; } - - if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { - ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr); - if (ret) -- goto err; +- goto out; - ar->monitor_vdev_cnt++; - } -- - arvif->is_started = true; - ++ + if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && ar->monitor_vdev_created) + ath11k_mac_monitor_start(ar); -+ + + arvif->is_started = true; + /* TODO: Setup ps and cts/rts protection */ - +- +exit: - mutex_unlock(&ar->conf_mutex); + ret = 0; - return 0; -@@ -5978,12 +6020,15 @@ ath11k_mac_op_unassign_vif_chanctx(struc - WARN_ON(!arvif->is_started); + out: +@@ -6217,12 +6250,15 @@ ath11k_mac_op_unassign_vif_chanctx(struc + ath11k_peer_delete(ar, arvif->vdev_id, ar->mac_addr); if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { - ret = ath11k_wmi_vdev_down(ar, arvif->vdev_id); @@ -476,9 +425,9 @@ } ret = ath11k_mac_vdev_stop(arvif); -@@ -5993,6 +6038,10 @@ ath11k_mac_op_unassign_vif_chanctx(struc - - arvif->is_started = false; +@@ -6236,6 +6272,10 @@ ath11k_mac_op_unassign_vif_chanctx(struc + arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) + ath11k_wmi_vdev_down(ar, arvif->vdev_id); + if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && + ar->num_started_vdevs == 1 && ar->monitor_vdev_created) @@ -487,7 +436,7 @@ mutex_unlock(&ar->conf_mutex); } -@@ -7364,9 +7413,9 @@ int ath11k_mac_allocate(struct ath11k_ba +@@ -7657,9 +7697,9 @@ int ath11k_mac_allocate(struct ath11k_ba INIT_WORK(&ar->wmi_mgmt_tx_work, ath11k_mgmt_over_wmi_tx_work); skb_queue_head_init(&ar->wmi_mgmt_tx_queue); @@ -501,7 +450,7 @@ return 0; --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -5483,7 +5483,7 @@ int ath11k_dp_rx_process_mon_rings(struc +@@ -5542,7 +5542,7 @@ int ath11k_dp_rx_process_mon_rings(struc struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); int ret = 0; diff --git a/feeds/wifi-ax/mac80211/patches/qca/117-ath11k-fixed-gi-ltf-support.patch b/feeds/wifi-ax/mac80211/patches/qca/117-ath11k-fixed-gi-ltf-support.patch index 63dcaaab6..169382b58 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/117-ath11k-fixed-gi-ltf-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/117-ath11k-fixed-gi-ltf-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -6275,9 +6275,94 @@ ath11k_mac_get_single_legacy_rate(struct +@@ -6503,9 +6503,94 @@ ath11k_mac_get_single_legacy_rate(struct return 0; } @@ -98,11 +98,11 @@ { struct ath11k *ar = arvif->ar; u32 vdev_param; -@@ -6285,8 +6370,13 @@ static int ath11k_mac_set_fixed_rate_par +@@ -6513,8 +6598,13 @@ static int ath11k_mac_set_fixed_rate_par lockdep_assert_held(&ar->conf_mutex); -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02hhx nss %hhu sgi %hhu\n", +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02x nss %u sgi %u\n", - arvif->vdev_id, rate, nss, sgi); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, + "mac set rate params vdev %i, rate:0x%02x, nss:0x%02x, sgi:0x%02x, ldpc:0x%02x\n", @@ -114,7 +114,7 @@ if (!arvif->vif->bss_conf.he_support) { vdev_param = WMI_VDEV_PARAM_FIXED_RATE; -@@ -6309,39 +6399,23 @@ static int ath11k_mac_set_fixed_rate_par +@@ -6537,39 +6627,23 @@ static int ath11k_mac_set_fixed_rate_par vdev_param = WMI_VDEV_PARAM_LDPC; ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, @@ -164,7 +164,7 @@ } else { vdev_param = WMI_VDEV_PARAM_SGI; ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -@@ -6504,6 +6578,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6732,6 +6806,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie int single_nss; int ret; int num_rates; @@ -172,7 +172,7 @@ if (ath11k_mac_vif_chan(vif, &def)) return -EPERM; -@@ -6544,6 +6619,12 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6772,6 +6847,12 @@ ath11k_mac_op_set_bitrate_mask(struct ie &single_nss)) { rate = WMI_FIXED_RATE_NONE; nss = single_nss; @@ -185,7 +185,7 @@ } else { rate = WMI_FIXED_RATE_NONE; -@@ -6591,6 +6672,8 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6819,6 +6900,8 @@ ath11k_mac_op_set_bitrate_mask(struct ie num_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, mask); @@ -194,7 +194,7 @@ if (!ath11k_mac_he_mcs_range_present(ar, band, mask) && num_rates > 1) { -@@ -6600,6 +6683,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6828,6 +6911,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie } mutex_lock(&ar->conf_mutex); @@ -204,7 +204,7 @@ arvif->bitrate_mask = *mask; ieee80211_iterate_stations_atomic(ar->hw, -@@ -6611,10 +6697,10 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -6839,10 +6925,10 @@ ath11k_mac_op_set_bitrate_mask(struct ie mutex_lock(&ar->conf_mutex); @@ -243,7 +243,7 @@ /* * wmi command groups. */ -@@ -1026,6 +1042,7 @@ enum wmi_tlv_vdev_param { +@@ -1044,6 +1060,7 @@ enum wmi_tlv_vdev_param { WMI_VDEV_PARAM_FILS_MAX_CHANNEL_GUARD_TIME, WMI_VDEV_PARAM_HE_LTF = 0x74, WMI_VDEV_PARAM_BA_MODE = 0x7e, diff --git a/feeds/wifi-ax/mac80211/patches/qca/118-ath11k-reset-bcc-counter.patch b/feeds/wifi-ax/mac80211/patches/qca/118-ath11k-reset-bcc-counter.patch index 0a95c7fc8..8d3d82e38 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/118-ath11k-reset-bcc-counter.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/118-ath11k-reset-bcc-counter.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3338,7 +3338,8 @@ void ath11k_dp_rx_mon_process_ulofdma(st +@@ -3336,7 +3336,8 @@ void ath11k_dp_rx_mon_process_ulofdma(st uint32_t mu_ul_user_v0_word1; uint32_t ru_size; @@ -10,7 +10,7 @@ ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_MU_OFDMA_MIMO)) return; -@@ -3374,7 +3375,10 @@ void ath11k_dp_rx_mon_process_ulofdma(st +@@ -3372,7 +3373,10 @@ void ath11k_dp_rx_mon_process_ulofdma(st rx_user_status->ul_ofdma_ru_width = ru_size; rx_user_status->ul_ofdma_ru_size = ru_size; } @@ -33,7 +33,7 @@ u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP]; --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -516,8 +516,8 @@ static ssize_t ath11k_dbg_sta_dump_rx_st +@@ -517,8 +517,8 @@ static ssize_t ath11k_dbg_sta_dump_rx_st rx_stats->num_mpdu_fcs_ok); len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS error: %llu\n", rx_stats->num_mpdu_fcs_err); diff --git a/feeds/wifi-ax/mac80211/patches/qca/120-ath11k-enable-ppdu-stats-in-coexist-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/120-ath11k-enable-ppdu-stats-in-coexist-mode.patch index 6f3105f3c..24d162c1a 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/120-ath11k-enable-ppdu-stats-in-coexist-mode.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/120-ath11k-enable-ppdu-stats-in-coexist-mode.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3389,12 +3389,17 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3387,12 +3387,17 @@ int ath11k_dp_rx_process_mon_status(stru enum hal_rx_mon_status hal_status; struct sk_buff *skb; struct sk_buff_head skb_list; @@ -19,7 +19,7 @@ __skb_queue_head_init(&skb_list); -@@ -3404,8 +3409,8 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3402,8 +3407,8 @@ int ath11k_dp_rx_process_mon_status(stru goto exit; while ((skb = __skb_dequeue(&skb_list))) { @@ -28,9 +28,9 @@ + memset(ppdu_info, 0, sizeof(*ppdu_info)); + ppdu_info->peer_id = HAL_INVALID_PEERID; - if (ath11k_debug_is_pktlog_lite_mode_enabled(ar)) { + if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) { log_type = ATH11K_PKTLOG_TYPE_LITE_RX; -@@ -3421,9 +3426,18 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3419,9 +3424,18 @@ int ath11k_dp_rx_process_mon_status(stru log_type, rx_buf_sz); } @@ -42,7 +42,7 @@ + (pmon->mon_ppdu_status == DP_PPDU_STATUS_START)) { + rx_mon_stats->status_ppdu_done++; + pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; -+ ath11k_dp_rx_mon_dest_process(ar, budget, napi); ++ ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi); + pmon->mon_ppdu_status = DP_PPDU_STATUS_START; + } @@ -51,7 +51,7 @@ hal_status != HAL_RX_MON_STATUS_PPDU_DONE) { dev_kfree_skb_any(skb); continue; -@@ -3431,26 +3445,26 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3429,26 +3443,26 @@ int ath11k_dp_rx_process_mon_status(stru rcu_read_lock(); spin_lock_bh(&ab->base_lock); @@ -86,92 +86,24 @@ } } -@@ -5361,8 +5375,8 @@ mon_deliver_fail: +@@ -5394,8 +5408,8 @@ mon_deliver_fail: return -EINVAL; } --static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, u32 quota, -- struct napi_struct *napi) -+void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, u32 quota, -+ struct napi_struct *napi) +-static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id, +- u32 quota, struct napi_struct *napi) ++void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id, ++ u32 quota, struct napi_struct *napi) { struct ath11k_pdev_dp *dp = &ar->dp; struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; -@@ -5431,66 +5445,12 @@ static void ath11k_dp_rx_mon_dest_proces - } - } - --static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar, -- u32 quota, -- struct napi_struct *napi) --{ -- struct ath11k_pdev_dp *dp = &ar->dp; -- struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; -- struct hal_rx_mon_ppdu_info *ppdu_info; -- struct sk_buff *status_skb; -- u32 tlv_status = HAL_TLV_STATUS_BUF_DONE; -- struct ath11k_pdev_mon_stats *rx_mon_stats; -- -- ppdu_info = &pmon->mon_ppdu_info; -- rx_mon_stats = &pmon->rx_mon_stats; -- -- if (pmon->mon_ppdu_status != DP_PPDU_STATUS_START) -- return; -- -- while (!skb_queue_empty(&pmon->rx_status_q)) { -- status_skb = skb_dequeue(&pmon->rx_status_q); -- -- memset(ppdu_info, 0, sizeof(struct hal_rx_mon_ppdu_info)); -- -- tlv_status = ath11k_hal_rx_parse_mon_status(ar->ab, ppdu_info, -- status_skb); -- if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) { -- rx_mon_stats->status_ppdu_done++; -- pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; -- ath11k_dp_rx_mon_dest_process(ar, quota, napi); -- pmon->mon_ppdu_status = DP_PPDU_STATUS_START; -- } -- dev_kfree_skb_any(status_skb); -- } --} -- --static int ath11k_dp_mon_process_rx(struct ath11k_base *ab, int mac_id, -- struct napi_struct *napi, int budget) --{ -- struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); -- struct ath11k_pdev_dp *dp = &ar->dp; -- struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; -- int num_buffs_reaped = 0; -- -- num_buffs_reaped = ath11k_dp_rx_reap_mon_status_ring(ar->ab, dp->mac_id, &budget, -- &pmon->rx_status_q); -- if (num_buffs_reaped) -- ath11k_dp_rx_mon_status_process_tlv(ar, budget, napi); -- -- return num_buffs_reaped; --} -- - int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, - struct napi_struct *napi, int budget) - { -- struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); - int ret = 0; - -- if (ar->monitor_started) -- ret = ath11k_dp_mon_process_rx(ab, mac_id, napi, budget); -- else -- ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); -+ ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); - return ret; - } - --- a/drivers/net/wireless/ath/ath11k/dp_rx.h +++ b/drivers/net/wireless/ath/ath11k/dp_rx.h -@@ -108,6 +108,8 @@ int ath11k_dp_rx_mon_status_bufs_repleni +@@ -106,6 +106,8 @@ int ath11k_dp_rx_mon_status_bufs_repleni + struct dp_rxdma_ring *rx_ring, int req_entries, - enum hal_rx_buf_return_buf_manager mgr, - gfp_t gfp); -+void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, u32 quota, + enum hal_rx_buf_return_buf_manager mgr); ++void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id, u32 quota, + struct napi_struct *napi); int ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar); int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar); @@ -200,9 +132,9 @@ struct hal_rx_user_status { u32 mcs:4, nss:3, ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -922,6 +922,12 @@ static ssize_t ath11k_write_extd_rx_stat +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -825,6 +825,12 @@ static ssize_t ath11k_write_extd_rx_stat goto exit; } diff --git a/feeds/wifi-ax/mac80211/patches/qca/138-ath11k-fill-vdev-pdev-id-for-fwtest-cmd.patch b/feeds/wifi-ax/mac80211/patches/qca/138-ath11k-fill-vdev-pdev-id-for-fwtest-cmd.patch index a21dfbfe8..e7a093197 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/138-ath11k-fill-vdev-pdev-id-for-fwtest-cmd.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/138-ath11k-fill-vdev-pdev-id-for-fwtest-cmd.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/testmode.c +++ b/drivers/net/wireless/ath/ath11k/testmode.c -@@ -272,13 +272,16 @@ out: +@@ -273,13 +273,16 @@ out: return ret; } @@ -19,7 +19,7 @@ mutex_lock(&ar->conf_mutex); -@@ -301,6 +304,18 @@ static int ath11k_tm_cmd_wmi(struct ath1 +@@ -302,6 +305,18 @@ static int ath11k_tm_cmd_wmi(struct ath1 buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]); cmd_id = nla_get_u32(tb[ATH11K_TM_ATTR_WMI_CMDID]); @@ -38,7 +38,7 @@ ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n", cmd_id, buf, buf_len); -@@ -442,7 +457,7 @@ int ath11k_tm_cmd(struct ieee80211_hw *h +@@ -443,7 +458,7 @@ int ath11k_tm_cmd(struct ieee80211_hw *h case ATH11K_TM_CMD_GET_VERSION: return ath11k_tm_cmd_get_version(ar, tb); case ATH11K_TM_CMD_WMI_FW_TEST: diff --git a/feeds/wifi-ax/mac80211/patches/qca/139-ath11k-add-debugfs-to-set-ratemask.patch b/feeds/wifi-ax/mac80211/patches/qca/139-ath11k-add-debugfs-to-set-ratemask.patch deleted file mode 100644 index eab7663df..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/139-ath11k-add-debugfs-to-set-ratemask.patch +++ /dev/null @@ -1,168 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -622,6 +622,8 @@ struct ath11k { - enum ath11k_ap_ps_state ap_ps_state; - - bool monitor_vdev_created; -+ bool rate_mask_params_valid; -+ u32 rate_mask_params[4]; - }; - - struct ath11k_band_cap { ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1361,6 +1361,57 @@ static const struct file_operations fops - .open = simple_open - }; - -+static ssize_t ath11k_write_rate_mask(struct file *file, -+ const char __user *ubuf, -+ size_t count, loff_t *ppos) -+{ -+ struct ath11k *ar = file->private_data; -+ struct ath11k_vif *arvif = NULL; -+ u32 params[4]; -+ u8 buf[128] = {0}; -+ int ret, vdev_count= 0; -+ -+ mutex_lock(&ar->conf_mutex); -+ list_for_each_entry(arvif, &ar->arvifs, list) -+ if (arvif->vdev_type == WMI_VDEV_TYPE_AP) -+ vdev_count++; -+ -+ if (vdev_count){ -+ ath11k_warn(ar->ab, "can't set rate mask if any ap vdev up\n"); -+ ret = -EINVAL; -+ goto exit; -+ } -+ -+ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); -+ if (ret < 0) -+ goto exit; -+ -+ buf[ret] = '\0'; -+ ret = sscanf(buf, "%x %x %x %x", -+ ¶ms[0], ¶ms[1], ¶ms[2], ¶ms[3]); -+ if (ret != 4) { -+ ret = -EINVAL; -+ goto exit; -+ } -+ -+ if (!params[0] && !params[1] && !params[2] && !params[3]) -+ ar->rate_mask_params_valid = false; -+ else { -+ memcpy(ar->rate_mask_params, params, sizeof(params)); -+ ar->rate_mask_params_valid = true; -+ } -+ -+ ret = count; -+exit: -+ mutex_unlock(&ar->conf_mutex); -+ return ret; -+} -+ -+static const struct file_operations fops_rate_mask = { -+ .write = ath11k_write_rate_mask, -+ .open = simple_open, -+}; -+ - static ssize_t ath11k_write_simulate_radar(struct file *file, - const char __user *user_buf, - size_t count, loff_t *ppos) -@@ -1595,6 +1646,9 @@ int ath11k_debug_register(struct ath11k - debugfs_create_file("pktlog_filter", 0644, - ar->debug.debugfs_pdev, ar, - &fops_pktlog_filter); -+ debugfs_create_file("rate_mask", 0644, -+ ar->debug.debugfs_pdev, ar, -+ &fops_rate_mask); - debugfs_create_file("btcoex", 0644, - ar->debug.debugfs_pdev, ar, - &fops__btcoex); ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1141,6 +1141,15 @@ static void ath11k_control_beaconing(str - return; - } - -+ if (ar->rate_mask_params_valid && arvif->vdev_type == WMI_VDEV_TYPE_AP) { -+ ret = ath11k_wmi_vdev_set_ratemask(ar, arvif->vdev_id, ar->rate_mask_params); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to send rate mask cmd\n"); -+ return; -+ } -+ ar->rate_mask_params_valid = false; -+ } -+ - arvif->tx_seq_no = 0x1000; - - arvif->aid = 0; ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -911,6 +911,40 @@ int ath11k_wmi_vdev_start(struct ath11k - return ret; - } - -+int ath11k_wmi_vdev_set_ratemask(struct ath11k *ar, u32 vdev_id, u32 *params) -+{ -+ struct wmi_vdev_config_ratemask_cmd *cmd; -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct sk_buff *skb; -+ int ret; -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); -+ if(!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_vdev_config_ratemask_cmd *)skb->data; -+ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_CONFIG_RATEMASK) | -+ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); -+ -+ cmd->vdev_id = vdev_id; -+ cmd->type = params[0]; -+ cmd->mask_l = params[1]; -+ cmd->mask_h = params[2]; -+ cmd->mask_l2 = params[3]; -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_RATEMASK_CMDID); -+ if (ret) { -+ ath11k_warn(ar->ab, "failed to send vdev ratemask cmd\n"); -+ dev_kfree_skb(skb); -+ } -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "ratemask vdev %d type %d mskl 0x%x, mskh 0x%x mskl2 0x%x\n", -+ vdev_id, params[0], params[1], params[2], params[3]); -+ -+ return ret; -+} -+ - int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) - { - struct ath11k_pdev_wmi *wmi = ar->wmi; ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2498,6 +2498,15 @@ struct wmi_vdev_delete_cmd { - u32 vdev_id; - } __packed; - -+struct wmi_vdev_config_ratemask_cmd { -+ u32 tlv_header; -+ u32 vdev_id; -+ u32 type; -+ u32 mask_l; -+ u32 mask_h; -+ u32 mask_l2; -+} __packed; -+ - struct wmi_vdev_up_cmd { - u32 tlv_header; - u32 vdev_id; -@@ -5372,6 +5381,7 @@ int ath11k_wmi_send_obss_spr_cmd(struct - int ath11k_send_coex_config_cmd(struct ath11k *ar, - struct coex_config_arg *coex_config); - int ath11k_wmi_pdev_ap_ps_cmd_send(struct ath11k *ar, u8 pdev_id, u32 value); -+int ath11k_wmi_vdev_set_ratemask(struct ath11k *ar, u32 vdev_id, u32 *rate_mask_params); - int ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id, - u8 bss_color, u32 period, - bool enable); diff --git a/feeds/wifi-ax/mac80211/patches/qca/141-ath11k-fixing-flooding-console-with-ath11k_warn-prints.patch b/feeds/wifi-ax/mac80211/patches/qca/141-ath11k-fixing-flooding-console-with-ath11k_warn-prints.patch deleted file mode 100644 index 391511387..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/141-ath11k-fixing-flooding-console-with-ath11k_warn-prints.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4796,9 +4796,9 @@ static int ath11k_mac_mgmt_tx(struct ath - */ - if (is_prb_rsp && - atomic_read(&ar->num_pending_mgmt_tx) > ATH11K_PRB_RSP_DROP_THRESHOLD) { -- ath11k_warn(ar->ab, -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, - "dropping probe response as pending queue is almost full\n"); -- return -ENOSPC; -+ return -EBUSY; - } - - if (skb_queue_len(q) == ATH11K_TX_MGMT_NUM_PENDING_MAX) { -@@ -4831,8 +4831,10 @@ static void ath11k_mac_op_tx(struct ieee - is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control); - ret = ath11k_mac_mgmt_tx(ar, skb, is_prb_rsp); - if (ret) { -- ath11k_warn(ar->ab, "failed to queue management frame %d\n", -- ret); -+ if (ret != -EBUSY) { -+ ath11k_warn(ar->ab, "failed to queue management frame %d\n", -+ ret); -+ } - ieee80211_free_txskb(ar->hw, skb); - } - return; diff --git a/feeds/wifi-ax/mac80211/patches/qca/142-ath11k-adding-support-for-mgmt-frame-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/142-ath11k-adding-support-for-mgmt-frame-stats.patch index c06f3fb7f..827fd13b9 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/142-ath11k-adding-support-for-mgmt-frame-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/142-ath11k-adding-support-for-mgmt-frame-stats.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -189,6 +189,16 @@ enum ath11k_dev_flags { +@@ -199,6 +199,16 @@ enum ath11k_dev_flags { ATH11K_FLAG_FW_RESTART_FOR_HOST, }; @@ -17,7 +17,7 @@ struct ath11k_vif { u32 vdev_id; enum wmi_vdev_type vdev_type; -@@ -236,6 +246,7 @@ struct ath11k_vif { +@@ -247,6 +257,7 @@ struct ath11k_vif { bool wpaie_present; struct ieee80211_chanctx_conf chanctx; struct dentry *debugfs_twt; @@ -25,9 +25,9 @@ }; struct ath11k_vif_iter { ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1611,6 +1611,87 @@ static const struct file_operations fops +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1566,6 +1566,87 @@ static const struct file_operations fops .open = simple_open }; @@ -112,61 +112,71 @@ + .open = simple_open +}; + - int ath11k_debug_register(struct ath11k *ar) + int ath11k_debugfs_register(struct ath11k *ar) { struct ath11k_base *ab = ar->ab; -@@ -1655,6 +1736,8 @@ int ath11k_debug_register(struct ath11k - debugfs_create_file("btcoex_duty_cycle", 0644, - ar->debug.debugfs_pdev, ar, - &fops__btcoex_duty_cycle); -+ debugfs_create_file("dump_mgmt_stats", 0644, ar->debug.debugfs_pdev, -+ ar, &fops_dump_mgmt_stats); +@@ -1608,6 +1689,9 @@ int ath11k_debugfs_register(struct ath11 + debugfs_create_file("btcoex_algorithm", 0644, + ar->debug.debugfs_pdev, ar, + &fops_btcoex_algo); ++ debugfs_create_file("dump_mgmt_stats", 0644, ++ ar->debug.debugfs_pdev, ar, ++ &fops_dump_mgmt_stats); if (ar->hw->wiphy->bands[NL80211_BAND_5GHZ]) { debugfs_create_file("dfs_simulate_radar", 0200, --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4822,20 +4822,35 @@ static void ath11k_mac_op_tx(struct ieee - struct ieee80211_vif *vif = info->control.vif; +@@ -4992,9 +4992,9 @@ static int ath11k_mac_mgmt_tx(struct ath + */ + if (is_prb_rsp && + atomic_read(&ar->num_pending_mgmt_tx) > ATH11K_PRB_RSP_DROP_THRESHOLD) { +- ath11k_warn(ar->ab, ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, + "dropping probe response as pending queue is almost full\n"); +- return -ENOSPC; ++ return -EBUSY; + } + + if (skb_queue_len(q) == ATH11K_TX_MGMT_NUM_PENDING_MAX) { +@@ -5019,8 +5019,10 @@ static void ath11k_mac_op_tx(struct ieee struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_key_conf *key = info->control.hw_key; + struct ath11k_mgmt_frame_stats *mgmt_stats = &arvif->mgmt_stats; + u32 info_flags = info->flags; bool is_prb_rsp; - int ret; + u16 frm_type = 0; + int ret; - if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) { + memset(skb_cb, 0, sizeof(*skb_cb)); +@@ -5034,12 +5036,21 @@ static void ath11k_mac_op_tx(struct ieee + if (info_flags & IEEE80211_TX_CTL_HW_80211_ENCAP) { skb_cb->flags |= ATH11K_SKB_HW_80211_ENCAP; } else if (ieee80211_is_mgmt(hdr->frame_control)) { + frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control); ret = ath11k_mac_mgmt_tx(ar, skb, is_prb_rsp); if (ret) { -- if (ret != -EBUSY) { +- ath11k_warn(ar->ab, "failed to queue management frame %d\n", +- ret); + if (ret != -EBUSY) - ath11k_warn(ar->ab, "failed to queue management frame %d\n", - ret); -- } ++ ath11k_warn(ar->ab, "failed to queue management frame %d\n", ++ ret); ieee80211_free_txskb(ar->hw, skb); + spin_lock_bh(&ar->data_lock); -+ + mgmt_stats->tx_fail_cnt[frm_type]++; -+ + spin_unlock_bh(&ar->data_lock); -+ + } else { -+ + spin_lock_bh(&ar->data_lock); -+ + mgmt_stats->tx_succ_cnt[frm_type]++; -+ + spin_unlock_bh(&ar->data_lock); } return; } --- a/drivers/net/wireless/ath/ath11k/peer.c +++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -310,6 +310,7 @@ int ath11k_peer_create(struct ath11k *ar +@@ -332,6 +332,7 @@ int ath11k_peer_create(struct ath11k *ar peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; @@ -186,7 +196,7 @@ int peer_id; --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -4846,6 +4846,12 @@ static int wmi_process_mgmt_tx_comp(stru +@@ -5224,6 +5224,12 @@ static int wmi_process_mgmt_tx_comp(stru struct sk_buff *msdu; struct ieee80211_tx_info *info; struct ath11k_skb_cb *skb_cb; @@ -199,7 +209,7 @@ spin_lock_bh(&ar->txmgmt_idr_lock); msdu = idr_find(&ar->txmgmt_idr, desc_id); -@@ -4867,6 +4873,31 @@ static int wmi_process_mgmt_tx_comp(stru +@@ -5245,6 +5251,31 @@ static int wmi_process_mgmt_tx_comp(stru if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !status) info->flags |= IEEE80211_TX_STAT_ACK; @@ -231,7 +241,7 @@ ieee80211_tx_status_irqsafe(ar->hw, msdu); /* WARN when we received this event without doing any mgmt tx */ -@@ -6199,6 +6230,11 @@ static void ath11k_mgmt_rx_event(struct +@@ -6576,6 +6607,11 @@ static void ath11k_mgmt_rx_event(struct struct ieee80211_hdr *hdr; u16 fc; struct ieee80211_supported_band *sband; @@ -243,7 +253,7 @@ if (ath11k_pull_mgmt_rx_params_tlv(ab, skb, &rx_ev) != 0) { ath11k_warn(ab, "failed to extract mgmt rx event"); -@@ -6260,7 +6296,30 @@ static void ath11k_mgmt_rx_event(struct +@@ -6637,7 +6673,30 @@ static void ath11k_mgmt_rx_event(struct hdr = (struct ieee80211_hdr *)skb->data; fc = le16_to_cpu(hdr->frame_control); diff --git a/feeds/wifi-ax/mac80211/patches/qca/143-ath11k-disabling-credit-flow-for-ath11k.patch b/feeds/wifi-ax/mac80211/patches/qca/143-ath11k-disabling-credit-flow-for-ath11k.patch index 8aeedb74a..94892facf 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/143-ath11k-disabling-credit-flow-for-ath11k.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/143-ath11k-disabling-credit-flow-for-ath11k.patch @@ -1,6 +1,37 @@ +From 929e141221444868ee98f253717479e5dd333102 Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Fri, 19 Mar 2021 14:45:37 +0530 +Subject: [PATCH] ath11k: register copy engine send completion callback + +Register send completion callback for copy engine-0 (CE0) +for the function ath11k_htc_tx_completion_handler(). +This callback will be used for freeing the skbs allocated +by the ath11k_htc_send() from the below functions: +ath11k_htc_connect_service() & ath11k_htc_start(). + +Signed-off-by: Maharaja Kennadyrajan +--- + drivers/net/wireless/ath/ath11k/ce.c | 33 +++++++++++---- + drivers/net/wireless/ath/ath11k/ce.h | 3 +- + drivers/net/wireless/ath/ath11k/core.c | 2 + + drivers/net/wireless/ath/ath11k/htc.c | 75 ++++++++++++++++++++++++---------- + drivers/net/wireless/ath/ath11k/htc.h | 4 ++ + drivers/net/wireless/ath/ath11k/hw.h | 1 + + drivers/net/wireless/ath/ath11k/wmi.c | 54 +++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/wmi.h | 1 + + 8 files changed, 138 insertions(+), 35 deletions(-) + --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c -@@ -40,6 +40,7 @@ const struct ce_attr ath11k_host_ce_conf +@@ -14,6 +14,7 @@ const struct ce_attr ath11k_host_ce_conf + .src_nentries = 16, + .src_sz_max = 2048, + .dest_nentries = 0, ++ .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE1: target->host HTT + HTC control */ +@@ -40,6 +41,7 @@ const struct ce_attr ath11k_host_ce_conf .src_nentries = 32, .src_sz_max = 2048, .dest_nentries = 0, @@ -8,7 +39,7 @@ }, /* CE4: host->target HTT */ -@@ -73,6 +74,7 @@ const struct ce_attr ath11k_host_ce_conf +@@ -73,6 +75,7 @@ const struct ce_attr ath11k_host_ce_conf .src_nentries = 32, .src_sz_max = 2048, .dest_nentries = 0, @@ -16,7 +47,7 @@ }, /* CE8: target autonomous hif_memcpy */ -@@ -89,6 +91,7 @@ const struct ce_attr ath11k_host_ce_conf +@@ -89,6 +92,7 @@ const struct ce_attr ath11k_host_ce_conf .src_nentries = 32, .src_sz_max = 2048, .dest_nentries = 0, @@ -24,7 +55,23 @@ }, /* CE10: target->host HTT */ -@@ -416,19 +419,33 @@ err_unlock: +@@ -194,6 +198,7 @@ const struct ce_attr ath11k_host_ce_conf + .src_nentries = 16, + .src_sz_max = 2048, + .dest_nentries = 0, ++ .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE1: target->host HTT + HTC control */ +@@ -220,6 +225,7 @@ const struct ce_attr ath11k_host_ce_conf + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, ++ .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE4: host->target HTT */ +@@ -489,19 +495,33 @@ err_unlock: return skb; } @@ -60,7 +107,7 @@ } static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_id, -@@ -556,7 +573,7 @@ static int ath11k_ce_alloc_pipe(struct a +@@ -636,7 +656,7 @@ static int ath11k_ce_alloc_pipe(struct a pipe->attr_flags = attr->flags; if (attr->src_nentries) { @@ -69,7 +116,7 @@ nentries = roundup_pow_of_two(attr->src_nentries); desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_SRC); ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); -@@ -587,9 +604,10 @@ static int ath11k_ce_alloc_pipe(struct a +@@ -667,9 +687,10 @@ static int ath11k_ce_alloc_pipe(struct a void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id) { struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; @@ -82,7 +129,7 @@ if (pipe->recv_cb) ath11k_ce_recv_process_cb(pipe); -@@ -598,9 +616,10 @@ void ath11k_ce_per_engine_service(struct +@@ -678,9 +699,10 @@ void ath11k_ce_per_engine_service(struct void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id) { struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; @@ -116,7 +163,7 @@ struct tasklet_struct intr_tq; --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -40,6 +40,7 @@ static const struct ath11k_hw_params ath +@@ -44,6 +44,7 @@ static const struct ath11k_hw_params ath .max_radios = 3, .bdf_addr = 0x4B0C0000, .hw_ops = &ipq8074_ops, @@ -124,7 +171,7 @@ .ring_mask = &ath11k_hw_ring_mask_ipq8074, .internal_sleep_clock = false, .regs = &ipq8074_regs, -@@ -70,6 +71,7 @@ static const struct ath11k_hw_params ath +@@ -84,6 +85,7 @@ static const struct ath11k_hw_params ath .max_radios = 2, .bdf_addr = 0x4ABC0000, .hw_ops = &ipq6018_ops, @@ -134,19 +181,7 @@ .regs = &ipq8074_regs, --- a/drivers/net/wireless/ath/ath11k/htc.c +++ b/drivers/net/wireless/ath/ath11k/htc.c -@@ -69,8 +69,9 @@ static void ath11k_htc_prepare_tx_skb(st - memset(hdr, 0, sizeof(*hdr)); - hdr->htc_info = FIELD_PREP(HTC_HDR_ENDPOINTID, ep->eid) | - FIELD_PREP(HTC_HDR_PAYLOADLEN, -- (skb->len - sizeof(*hdr))) | -- FIELD_PREP(HTC_HDR_FLAGS, -+ (skb->len - sizeof(*hdr))); -+ if (ep->tx_credit_flow_enabled) -+ hdr->htc_info |= FIELD_PREP(HTC_HDR_FLAGS, - ATH11K_HTC_FLAG_NEED_CREDIT_UPDATE); - - spin_lock_bh(&ep->htc->tx_lock); -@@ -95,8 +96,7 @@ int ath11k_htc_send(struct ath11k_htc *h +@@ -88,8 +88,7 @@ int ath11k_htc_send(struct ath11k_htc *h } skb_push(skb, sizeof(struct ath11k_htc_hdr)); @@ -156,7 +191,7 @@ credits = DIV_ROUND_UP(skb->len, htc->target_credit_size); spin_lock_bh(&htc->tx_lock); if (ep->tx_credits < credits) { -@@ -121,7 +121,11 @@ int ath11k_htc_send(struct ath11k_htc *h +@@ -114,7 +113,11 @@ int ath11k_htc_send(struct ath11k_htc *h ret = dma_mapping_error(dev, skb_cb->paddr); if (ret) { ret = -EIO; @@ -169,7 +204,7 @@ } ret = ath11k_ce_send(htc->ab, skb, ep->ul_pipe_id, ep->eid); -@@ -133,14 +137,13 @@ int ath11k_htc_send(struct ath11k_htc *h +@@ -126,14 +129,13 @@ int ath11k_htc_send(struct ath11k_htc *h err_unmap: dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); err_credits: @@ -185,7 +220,7 @@ if (ep->ep_ops.ep_tx_credits) ep->ep_ops.ep_tx_credits(htc->ab); } -@@ -209,24 +212,25 @@ static int ath11k_htc_process_trailer(st +@@ -202,24 +204,25 @@ static int ath11k_htc_process_trailer(st status = -EINVAL; break; } @@ -227,8 +262,8 @@ } if (status) -@@ -240,6 +244,29 @@ static int ath11k_htc_process_trailer(st - return status; +@@ -245,6 +248,29 @@ static void ath11k_htc_suspend_complete( + complete(&ab->htc_suspend); } +void ath11k_htc_tx_completion_handler(struct ath11k_base *ab, @@ -257,7 +292,7 @@ void ath11k_htc_rx_completion_handler(struct ath11k_base *ab, struct sk_buff *skb) { -@@ -587,6 +614,11 @@ int ath11k_htc_connect_service(struct at +@@ -607,6 +633,11 @@ int ath11k_htc_connect_service(struct at disable_credit_flow_ctrl = true; } @@ -269,7 +304,7 @@ req_msg->flags_len = FIELD_PREP(HTC_SVC_MSG_CONNECTIONFLAGS, flags); req_msg->msg_svc_id |= FIELD_PREP(HTC_SVC_MSG_SERVICE_ID, conn_req->service_id); -@@ -711,6 +743,8 @@ int ath11k_htc_start(struct ath11k_htc * +@@ -731,6 +762,8 @@ int ath11k_htc_start(struct ath11k_htc * msg = (struct ath11k_htc_setup_complete_extended *)skb->data; msg->msg_id = FIELD_PREP(HTC_MSG_MESSAGEID, ATH11K_HTC_MSG_SETUP_COMPLETE_EX_ID); @@ -280,7 +315,7 @@ --- a/drivers/net/wireless/ath/ath11k/htc.h +++ b/drivers/net/wireless/ath/ath11k/htc.h -@@ -114,6 +114,8 @@ struct ath11k_htc_conn_svc_resp { +@@ -116,6 +116,8 @@ struct ath11k_htc_conn_svc_resp { u32 svc_meta_pad; } __packed; @@ -289,7 +324,7 @@ struct ath11k_htc_setup_complete_extended { u32 msg_id; u32 flags; -@@ -309,5 +311,7 @@ int ath11k_htc_send(struct ath11k_htc *h +@@ -305,5 +307,7 @@ int ath11k_htc_send(struct ath11k_htc *h struct sk_buff *ath11k_htc_alloc_skb(struct ath11k_base *ar, int size); void ath11k_htc_rx_completion_handler(struct ath11k_base *ar, struct sk_buff *skb); @@ -299,17 +334,17 @@ #endif --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -128,6 +128,7 @@ struct ath11k_hw_params { - size_t cal_size; - } fw; +@@ -154,6 +154,7 @@ struct ath11k_hw_params { + bool htt_peer_map_v2; + bool tcl_0_only; u8 spectral_fft_sz; + bool credit_flow; - const struct ath11k_hw_ops *hw_ops; - const struct ath11k_hw_ring_mask *ring_mask; + u16 interface_modes; + bool supports_monitor; --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -266,20 +266,35 @@ int ath11k_wmi_cmd_send(struct ath11k_pd +@@ -270,20 +270,35 @@ int ath11k_wmi_cmd_send(struct ath11k_pd { struct ath11k_wmi_base *wmi_sc = wmi->wmi_ab; int ret = -EOPNOTSUPP; @@ -351,7 +386,7 @@ return ret; } -@@ -5895,6 +5910,32 @@ static void ath11k_wmi_op_ep_tx_credits( +@@ -6239,6 +6254,32 @@ static void ath11k_wmi_op_ep_tx_credits( static void ath11k_wmi_htc_tx_complete(struct ath11k_base *ab, struct sk_buff *skb) { @@ -384,7 +419,7 @@ dev_kfree_skb(skb); } -@@ -7197,6 +7238,7 @@ static int ath11k_connect_pdev_htc_servi +@@ -7664,6 +7705,7 @@ static int ath11k_connect_pdev_htc_servi ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; @@ -394,7 +429,7 @@ } --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2463,6 +2463,7 @@ struct ath11k_pdev_wmi { +@@ -2487,6 +2487,7 @@ struct ath11k_pdev_wmi { enum ath11k_htc_ep_id eid; const struct wmi_peer_flags_map *peer_flags; u32 rx_decap_mode; diff --git a/feeds/wifi-ax/mac80211/patches/qca/146-ath11k-fix-htt-stats-10-rx-rssi-chain.patch b/feeds/wifi-ax/mac80211/patches/qca/146-ath11k-fix-htt-stats-10-rx-rssi-chain.patch index e3c650b7c..117aad792 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/146-ath11k-fix-htt-stats-10-rx-rssi-chain.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/146-ath11k-fix-htt-stats-10-rx-rssi-chain.patch @@ -1,5 +1,5 @@ ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c @@ -28,6 +28,17 @@ buflen += index; \ } while (0) diff --git a/feeds/wifi-ax/mac80211/patches/qca/146-mac80211-enable-TKIP-when-using-encapsulation-offloading b/feeds/wifi-ax/mac80211/patches/qca/146-mac80211-enable-TKIP-when-using-encapsulation-offloading index be738e37e..ae440e062 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/146-mac80211-enable-TKIP-when-using-encapsulation-offloading +++ b/feeds/wifi-ax/mac80211/patches/qca/146-mac80211-enable-TKIP-when-using-encapsulation-offloading @@ -1,40 +1,12 @@ ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1306,7 +1306,6 @@ bool ieee80211_set_hw_80211_encap(struct - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct ieee80211_local *local = sdata->local; - struct ieee80211_sub_if_data *iter; -- struct ieee80211_key *key; +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -4268,8 +4268,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + if (!key) + key = rcu_dereference(sdata->default_unicast_key); - mutex_lock(&local->iflist_mtx); - list_for_each_entry(iter, &local->interfaces, list) { -@@ -1335,13 +1334,6 @@ bool ieee80211_set_hw_80211_encap(struct - (local->hw.wiphy->frag_threshold != (u32)-1)) - enable = false; - -- mutex_lock(&sdata->local->key_mtx); -- list_for_each_entry(key, &sdata->key_list, list) { -- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) -- enable = false; -- } -- mutex_unlock(&sdata->local->key_mtx); -- - __ieee80211_set_hw_80211_encap(sdata, enable); - - return enable; ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -178,13 +178,6 @@ static int ieee80211_key_enable_hw_accel - } - } - -- /* TKIP countermeasures don't work in encap offload mode */ -- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP && -- sdata->hw_80211_encap) { -- sdata_dbg(sdata, "TKIP is not allowed in hw 80211 encap mode\n"); -- return -EINVAL; -- } -- - ret = drv_set_key(key->local, SET_KEY, sdata, - sta ? &sta->sta : NULL, &key->conf); +- if (key && (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) || +- key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)) ++ if (key && (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))) + goto skip_offload; + ieee80211_8023_xmit(sdata, dev, sta, key, skb); diff --git a/feeds/wifi-ax/mac80211/patches/qca/147-fix-signal-station-dump.patch b/feeds/wifi-ax/mac80211/patches/qca/147-fix-signal-station-dump.patch index da9dc375c..bdf19785c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/147-fix-signal-station-dump.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/147-fix-signal-station-dump.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3457,15 +3457,13 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3455,15 +3455,13 @@ int ath11k_dp_rx_process_mon_status(stru continue; } @@ -22,20 +22,10 @@ + ath11k_dp_rx_update_peer_mu_stats(ar, ppdu_info); } - if (ath11k_debug_is_pktlog_peer_valid(ar, peer->addr)) { + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4880,7 +4880,8 @@ static int ath11k_mac_config_mon_status_ - - if (enable) { - tlv_filter = ath11k_mac_mon_status_filter_default; -- tlv_filter.rx_filter = ath11k_debug_rx_filter(ar); -+ if (ath11k_debug_rx_filter(ar)) -+ tlv_filter.rx_filter = ath11k_debug_rx_filter(ar); - } - - for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { -@@ -6864,6 +6865,7 @@ static void ath11k_mac_op_sta_statistics +@@ -7092,6 +7092,7 @@ static void ath11k_mac_op_sta_statistics /* TODO: Use real NF instead of default one. */ sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; diff --git a/feeds/wifi-ax/mac80211/patches/qca/148-cfg80211-notify-4addr-capability-event-to-driver.patch b/feeds/wifi-ax/mac80211/patches/qca/148-cfg80211-notify-4addr-capability-event-to-driver.patch deleted file mode 100644 index 2059cb1c9..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/148-cfg80211-notify-4addr-capability-event-to-driver.patch +++ /dev/null @@ -1,180 +0,0 @@ ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1619,6 +1619,7 @@ enum ieee80211_vif_flags { - * @addr: address of this interface - * @p2p: indicates whether this AP or STA interface is a p2p - * interface, i.e. a GO or p2p-sta respectively -+ * @use_4addr: indicates whether this STA interface uses 4-address frames - * @csa_active: marks whether a channel switch is going on. Internally it is - * write-protected by sdata_lock and local->mtx so holding either is fine - * for read access. -@@ -1652,6 +1653,7 @@ struct ieee80211_vif { - struct ieee80211_bss_conf bss_conf; - u8 addr[ETH_ALEN] __aligned(2); - bool p2p; -+ bool use_4addr; - bool csa_active; - bool mu_mimo_owner; - -@@ -3909,6 +3911,9 @@ struct ieee80211_ops { - struct ieee80211_sta *sta, - enum ieee80211_sta_state old_state, - enum ieee80211_sta_state new_state); -+ void (*sta_use_4addr)(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_sta *sta); - void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta); ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -163,6 +163,7 @@ static int ieee80211_change_iface(struct - ieee80211_check_fast_rx_iface(sdata); - } else if (type == NL80211_IFTYPE_STATION && params->use_4addr >= 0) { - sdata->u.mgd.use_4addr = params->use_4addr; -+ sdata->vif.use_4addr = params->use_4addr; - } - - if (sdata->vif.type == NL80211_IFTYPE_MONITOR) { -@@ -1701,6 +1702,8 @@ static int ieee80211_change_station(stru - - rcu_assign_pointer(vlansdata->u.vlan.sta, sta); - __ieee80211_check_fast_rx_iface(vlansdata); -+ -+ drv_sta_use_4addr(local, sdata, sta); - } - - if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ---- a/net/mac80211/driver-ops.c -+++ b/net/mac80211/driver-ops.c -@@ -135,6 +135,21 @@ int drv_sta_state(struct ieee80211_local - return ret; - } - -+void drv_sta_use_4addr(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct sta_info *sta) -+{ -+ sdata = get_bss_sdata(sdata); -+ if (!check_sdata_in_driver(sdata)) -+ return; -+ -+ trace_drv_sta_use_4addr(local, sdata, &sta->sta); -+ if (local->ops->sta_use_4addr) -+ local->ops->sta_use_4addr(&local->hw, &sdata->vif, -+ &sta->sta); -+ trace_drv_return_void(local); -+} -+ - __must_check - int drv_sta_set_txpwr(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/driver-ops.h -+++ b/net/mac80211/driver-ops.h -@@ -528,6 +528,10 @@ int drv_sta_state(struct ieee80211_local - enum ieee80211_sta_state old_state, - enum ieee80211_sta_state new_state); - -+void drv_sta_use_4addr(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct sta_info *sta); -+ - __must_check - int drv_sta_set_txpwr(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1727,8 +1727,10 @@ int ieee80211_if_change_type(struct ieee - } - - /* reset some values that shouldn't be kept across type changes */ -- if (type == NL80211_IFTYPE_STATION) -+ if (type == NL80211_IFTYPE_STATION) { - sdata->u.mgd.use_4addr = false; -+ sdata->vif.use_4addr = false; -+ } - - return 0; - } -@@ -2018,8 +2020,10 @@ int ieee80211_if_add(struct ieee80211_lo - - if (ndev) { - ndev->ieee80211_ptr->use_4addr = params->use_4addr; -- if (type == NL80211_IFTYPE_STATION) -+ if (type == NL80211_IFTYPE_STATION) { - sdata->u.mgd.use_4addr = params->use_4addr; -+ sdata->vif.use_4addr = params->use_4addr; -+ } - - ndev->features |= local->hw.netdev_features; - ndev->hw_features |= ndev->features & ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -1105,10 +1105,6 @@ static void ieee80211_send_4addr_nullfun - if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION)) - return; - -- /* Don't send NDPs when connected HE */ -- if (!(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HE)) -- return; -- - skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30); - if (!skb) - return; ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -1882,6 +1882,7 @@ ieee80211_rx_h_sta_process(struct ieee80 - (rx->sdata->vif.type == NL80211_IFTYPE_AP || - (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && - !rx->sdata->u.vlan.sta))) { -+ drv_sta_use_4addr(sta->local, rx->sdata, sta); - if (!test_and_set_sta_flag(sta, WLAN_STA_4ADDR_EVENT)) - cfg80211_rx_unexpected_4addr_frame( - rx->sdata->dev, sta->sta.addr, -@@ -2960,9 +2961,11 @@ ieee80211_rx_h_data(struct ieee80211_rx_ - if (ieee80211_has_a4(hdr->frame_control) && - sdata->vif.type == NL80211_IFTYPE_AP) { - if (rx->sta && -- !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) -+ !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) { -+ drv_sta_use_4addr(local, sdata, rx->sta); - cfg80211_rx_unexpected_4addr_frame( - rx->sdata->dev, rx->sta->sta.addr, GFP_ATOMIC); -+ } - return RX_DROP_MONITOR; - } - ---- a/net/mac80211/trace.h -+++ b/net/mac80211/trace.h -@@ -841,6 +841,31 @@ TRACE_EVENT(drv_sta_state, - ) - ); - -+TRACE_EVENT(drv_sta_use_4addr, -+ TP_PROTO(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct ieee80211_sta *sta), -+ -+ TP_ARGS(local, sdata, sta), -+ -+ TP_STRUCT__entry( -+ LOCAL_ENTRY -+ VIF_ENTRY -+ STA_ENTRY -+ ), -+ -+ TP_fast_assign( -+ LOCAL_ASSIGN; -+ VIF_ASSIGN; -+ STA_ASSIGN; -+ ), -+ -+ TP_printk( -+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " use_4addr", -+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG -+ ) -+); -+ - TRACE_EVENT(drv_sta_set_txpwr, - TP_PROTO(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, diff --git a/feeds/wifi-ax/mac80211/patches/qca/149-ath11k-fix-4addr-tx-failure-AP-STA-modes.patch b/feeds/wifi-ax/mac80211/patches/qca/149-ath11k-fix-4addr-tx-failure-AP-STA-modes.patch index 804c34f0f..535dd75ea 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/149-ath11k-fix-4addr-tx-failure-AP-STA-modes.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/149-ath11k-fix-4addr-tx-failure-AP-STA-modes.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -379,6 +379,7 @@ struct ath11k_sta { +@@ -391,6 +391,7 @@ struct ath11k_sta { enum hal_pn_type pn_type; struct work_struct update_wk; @@ -8,7 +8,7 @@ struct rate_info txrate; struct rate_info last_txrate; u64 rx_duration; -@@ -391,6 +392,8 @@ struct ath11k_sta { +@@ -403,6 +404,8 @@ struct ath11k_sta { /* protected by conf_mutex */ bool aggr_mode; #endif @@ -19,7 +19,7 @@ #define ATH11K_MIN_5G_FREQ 4150 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3591,6 +3591,31 @@ static void ath11k_sta_rc_update_wk(stru +@@ -3782,6 +3782,31 @@ static void ath11k_sta_rc_update_wk(stru mutex_unlock(&ar->conf_mutex); } @@ -51,15 +51,12 @@ static int ath11k_mac_inc_num_stations(struct ath11k_vif *arvif, struct ieee80211_sta *sta) { -@@ -3702,12 +3727,15 @@ static int ath11k_mac_station_add(struct - } +@@ -3894,11 +3919,13 @@ static int ath11k_mac_station_add(struct } -- if (ieee80211_vif_is_mesh(vif)) { -+ if (ieee80211_vif_is_mesh(vif) || -+ (vif->type == NL80211_IFTYPE_STATION && vif->use_4addr)) { + if (ieee80211_vif_is_mesh(vif)) { + ath11k_dbg(ab, ATH11K_DBG_MAC, -+ "setting USE_4ADDR for peer %pM\n", sta->addr); ++ "setting USE_4ADDR for mesh peer %pM\n", sta->addr); ret = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, WMI_PEER_USE_4ADDR, 1); @@ -69,7 +66,7 @@ sta->addr, ret); goto free_tx_stats; } -@@ -3758,8 +3786,10 @@ static int ath11k_mac_op_sta_state(struc +@@ -3951,8 +3978,10 @@ static int ath11k_mac_op_sta_state(struc /* cancel must be done outside the mutex to avoid deadlock */ if ((old_state == IEEE80211_STA_NONE && @@ -81,7 +78,7 @@ mutex_lock(&ar->conf_mutex); -@@ -3768,6 +3798,7 @@ static int ath11k_mac_op_sta_state(struc +@@ -3961,6 +3990,7 @@ static int ath11k_mac_op_sta_state(struc memset(arsta, 0, sizeof(*arsta)); arsta->arvif = arvif; INIT_WORK(&arsta->update_wk, ath11k_sta_rc_update_wk); @@ -89,18 +86,19 @@ ret = ath11k_mac_station_add(ar, vif, sta); if (ret) -@@ -3865,6 +3896,19 @@ out: +@@ -4058,6 +4088,20 @@ out: return ret; } -+static void ath11k_mac_op_sta_use_4addr(struct ieee80211_hw *hw, ++static void ath11k_mac_op_sta_set_4addr(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, -+ struct ieee80211_sta *sta) ++ struct ieee80211_sta *sta, ++ bool enabled) +{ + struct ath11k *ar = hw->priv; + struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; + -+ if (!arsta->use_4addr_set) { ++ if (enabled && !arsta->use_4addr_set) { + ieee80211_queue_work(ar->hw, &arsta->use_4addr_wk); + arsta->use_4addr_set = true; + } @@ -109,39 +107,11 @@ static void ath11k_mac_op_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, -@@ -5115,6 +5159,7 @@ static int ath11k_mac_op_add_interface(s - int i; - int ret, free_err; - int bit; -+ bool use_4addr = false; - - vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; - -@@ -5165,6 +5210,7 @@ static int ath11k_mac_op_add_interface(s - case NL80211_IFTYPE_UNSPECIFIED: - case NL80211_IFTYPE_STATION: - arvif->vdev_type = WMI_VDEV_TYPE_STA; -+ use_4addr = vif->use_4addr; - break; - case NL80211_IFTYPE_MESH_POINT: - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH_11S; -@@ -5181,9 +5227,9 @@ static int ath11k_mac_op_add_interface(s - break; - } - -- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac add interface id %d type %d subtype %d map %llx\n", -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac add interface id %d type %d subtype %d map %llx %s\n", - arvif->vdev_id, arvif->vdev_type, arvif->vdev_subtype, -- ab->free_vdev_map); -+ ab->free_vdev_map, (use_4addr ? "4addr" : " ")); - - vif->cab_queue = arvif->vdev_id % (ATH11K_HW_MAX_QUEUES - 1); - for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) -@@ -6967,6 +7013,7 @@ static const struct ieee80211_ops ath11k +@@ -7195,6 +7239,7 @@ static const struct ieee80211_ops ath11k .cancel_hw_scan = ath11k_mac_op_cancel_hw_scan, .set_key = ath11k_mac_op_set_key, .sta_state = ath11k_mac_op_sta_state, -+ .sta_use_4addr = ath11k_mac_op_sta_use_4addr, ++ .sta_set_4addr = ath11k_mac_op_sta_set_4addr, .sta_set_txpwr = ath11k_mac_op_sta_set_txpwr, .sta_rc_update = ath11k_mac_op_sta_rc_update, .conf_tx = ath11k_mac_op_conf_tx, diff --git a/feeds/wifi-ax/mac80211/patches/qca/164-ath11k-add-qcn9000-support.patch b/feeds/wifi-ax/mac80211/patches/qca/164-ath11k-add-qcn9000-support.patch index fc3b0b797..e1c3f3a96 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/164-ath11k-add-qcn9000-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/164-ath11k-add-qcn9000-support.patch @@ -22,74 +22,16 @@ Signed-off-by: Anilkumar Kolli #define ATH11K_PCI_BAR_NUM 0 #define ATH11K_PCI_DMA_MASK 32 -@@ -24,10 +25,9 @@ - #define WINDOW_START 0x80000 - #define WINDOW_RANGE_MASK GENMASK(18, 0) +@@ -39,7 +40,7 @@ --#define QCA6390_DEVICE_ID 0x1101 -- static const struct pci_device_id ath11k_pci_id_table[] = { { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) }, -+ { PCI_VDEVICE(QCOM, QCN9000_DEVICE_ID) }, +- /* TODO: add QCN9074_DEVICE_ID) once firmware issues are resolved */ ++ { PCI_VDEVICE(QCOM, QCN9074_DEVICE_ID) }, {0} }; -@@ -40,14 +40,25 @@ static const struct ath11k_bus_params at - .fixed_mem_region = false, - }; - --static const struct ath11k_msi_config msi_config = { -- .total_vectors = 32, -- .total_users = 4, -- .users = (struct ath11k_msi_user[]) { -- { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, -- { .name = "CE", .num_vectors = 10, .base_vector = 3 }, -- { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, -- { .name = "DP", .num_vectors = 18, .base_vector = 14 }, -+static const struct ath11k_msi_config ath11k_msi_config[] = { -+ { -+ .total_vectors = 32, -+ .total_users = 4, -+ .users = (struct ath11k_msi_user[]) { -+ { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, -+ { .name = "CE", .num_vectors = 10, .base_vector = 3 }, -+ { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, -+ { .name = "DP", .num_vectors = 18, .base_vector = 14 }, -+ }, -+ }, -+ { -+ .total_vectors = 16, -+ .total_users = 3, -+ .users = (struct ath11k_msi_user[]) { -+ { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, -+ { .name = "CE", .num_vectors = 5, .base_vector = 3 }, -+ { .name = "DP", .num_vectors = 8, .base_vector = 8 }, -+ }, - }, - }; - -@@ -246,14 +257,15 @@ int ath11k_pci_get_user_msi_assignment(s - u32 *base_vector) - { - struct ath11k_base *ab = ab_pci->ab; -+ const struct ath11k_msi_config *msi_config = ab_pci->msi_config; - int idx; - -- for (idx = 0; idx < msi_config.total_users; idx++) { -- if (strcmp(user_name, msi_config.users[idx].name) == 0) { -- *num_vectors = msi_config.users[idx].num_vectors; -- *user_base_data = msi_config.users[idx].base_vector -+ for (idx = 0; idx < msi_config->total_users; idx++) { -+ if (strcmp(user_name, msi_config->users[idx].name) == 0) { -+ *num_vectors = msi_config->users[idx].num_vectors; -+ *user_base_data = msi_config->users[idx].base_vector - + ab_pci->msi_ep_base_data; -- *base_vector = msi_config.users[idx].base_vector; -+ *base_vector = msi_config->users[idx].base_vector; - - ath11k_dbg(ab, ATH11K_DBG_PCI, "Assign MSI to user: %s, num_vectors: %d, user_base_data: %u, base_vector: %u\n", - user_name, *num_vectors, *user_base_data, -@@ -575,13 +587,18 @@ static int ath11k_pci_config_irq(struct +@@ -827,6 +828,7 @@ static int ath11k_pci_config_irq(struct static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab) { struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; @@ -97,85 +39,37 @@ Signed-off-by: Anilkumar Kolli cfg->tgt_ce = ab->hw_params.target_ce_config; cfg->tgt_ce_len = ab->hw_params.target_ce_count; - - cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; +@@ -835,6 +837,9 @@ static void ath11k_pci_init_qmi_ce_confi cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; -- ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390; -+ ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; -+ -+ ret = of_property_read_u32(ab->dev->of_node, "qrtr_node_id", &node_id); + ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; + ++ ret = of_property_read_u32(ab->dev->of_node, "qrtr_instance_id", &node_id); + if (!ret) + ab->qmi.service_ins_id += node_id; + ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2, + &cfg->shadow_reg_v2_len); } - - static void ath11k_pci_ce_irqs_enable(struct ath11k_base *ab) -@@ -598,17 +615,18 @@ static void ath11k_pci_ce_irqs_enable(st - static int ath11k_pci_enable_msi(struct ath11k_pci *ab_pci) - { - struct ath11k_base *ab = ab_pci->ab; -+ const struct ath11k_msi_config *msi_config = ab_pci->msi_config; - struct msi_desc *msi_desc; - int num_vectors; - int ret; - +@@ -861,7 +866,7 @@ static int ath11k_pci_enable_msi(struct num_vectors = pci_alloc_irq_vectors(ab_pci->pdev, -- msi_config.total_vectors, -- msi_config.total_vectors, + msi_config->total_vectors, + msi_config->total_vectors, - PCI_IRQ_MSI); -- if (num_vectors != msi_config.total_vectors) { -+ msi_config->total_vectors, -+ msi_config->total_vectors, + PCI_IRQ_NOMSIX); -+ if (num_vectors != msi_config->total_vectors) { + if (num_vectors != msi_config->total_vectors) { ath11k_err(ab, "failed to get %d MSI vectors, only %d available", -- msi_config.total_vectors, num_vectors); -+ msi_config->total_vectors, num_vectors); - - if (num_vectors >= 0) - return -EINVAL; -@@ -841,6 +859,7 @@ static int ath11k_pci_probe(struct pci_d - struct ath11k_pci *ab_pci; - enum ath11k_hw_rev hw_rev; + msi_config->total_vectors, num_vectors); +@@ -1010,6 +1015,7 @@ static int ath11k_pci_power_up(struct at + { + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); int ret; + u32 addr; - dev_warn(&pdev->dev, "WARNING: ath11k PCI support is experimental!\n"); - -@@ -848,15 +867,8 @@ static int ath11k_pci_probe(struct pci_d - case QCA6390_DEVICE_ID: - hw_rev = ATH11K_HW_QCA6390_HW20; - break; -- default: -- dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -- pci_dev->device); -- return -ENOTSUPP; -- } -- -- switch (pci_dev->device) { -- case QCA6390_DEVICE_ID: -- hw_rev = ATH11K_HW_QCA6390_HW20; -+ case QCN9000_DEVICE_ID: -+ hw_rev = ATH11K_HW_QCN9000; - break; - default: - dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -@@ -882,6 +894,27 @@ static int ath11k_pci_probe(struct pci_d + ab_pci->register_window = 0; + clear_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags); +@@ -1201,6 +1207,14 @@ static int ath11k_pci_probe(struct pci_d pci_set_drvdata(pdev, ab); spin_lock_init(&ab_pci->window_lock); -+ switch (pci_dev->device) { -+ case QCA6390_DEVICE_ID: -+ ab_pci->msi_config = &ath11k_msi_config[0]; -+ break; -+ case QCN9000_DEVICE_ID: -+ ab_pci->msi_config = &ath11k_msi_config[1]; -+ break; -+ default: -+ dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -+ pci_dev->device); -+ return -ENOTSUPP; -+ } -+ + /* IPQ8074 reserves memory for FW, ath11k does not need to + * allocate memory for FW in DDR, set fixed_mem_region to true for + * these pltforms supports reserved memory. @@ -187,119 +81,9 @@ Signed-off-by: Anilkumar Kolli ret = ath11k_pci_claim(ab_pci, pdev); if (ret) { ath11k_err(ab, "failed to claim device: %d\n", ret); ---- a/drivers/net/wireless/ath/ath11k/pci.h -+++ b/drivers/net/wireless/ath/ath11k/pci.h -@@ -9,6 +9,9 @@ - - #include "core.h" - -+#define QCA6390_DEVICE_ID 0x1101 -+#define QCN9000_DEVICE_ID 0x1104 -+ - #define PCIE_SOC_GLOBAL_RESET 0x3008 - #define PCIE_SOC_GLOBAL_RESET_V 1 - -@@ -43,6 +46,7 @@ struct ath11k_pci { - char amss_path[100]; - u32 msi_ep_base_data; - struct mhi_controller *mhi_ctrl; -+ const struct ath11k_msi_config *msi_config; - unsigned long mhi_state; - u32 register_window; - ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -369,7 +369,7 @@ static void ath11k_ahb_init_qmi_ce_confi - cfg->tgt_ce = ab->hw_params.target_ce_config; - cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; - cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; -- ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074; -+ ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; - } - - static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -44,6 +44,7 @@ static const struct ath11k_hw_params ath - .ring_mask = &ath11k_hw_ring_mask_ipq8074, - .internal_sleep_clock = false, - .regs = &ipq8074_regs, -+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, - .host_ce_config = ath11k_host_ce_config_ipq8074, - .ce_count = 12, - .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, -@@ -75,6 +76,7 @@ static const struct ath11k_hw_params ath - .ring_mask = &ath11k_hw_ring_mask_ipq8074, - .internal_sleep_clock = false, - .regs = &ipq8074_regs, -+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, - .host_ce_config = ath11k_host_ce_config_ipq8074, - .ce_count = 12, - .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, -@@ -104,6 +106,7 @@ static const struct ath11k_hw_params ath - .ring_mask = &ath11k_hw_ring_mask_qca6390, - .internal_sleep_clock = true, - .regs = &qca6390_regs, -+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390, - .host_ce_config = ath11k_host_ce_config_qca6390, - .ce_count = 9, - .target_ce_config = ath11k_target_ce_config_wlan_qca6390, -@@ -119,6 +122,18 @@ static const struct ath11k_hw_params ath - .htt_peer_map_v2 = false, - .tcl_0_only = true, - }, -+ { -+ .name = "qcn9000 hw1.0", -+ .hw_rev = ATH11K_HW_QCN9000, -+ .fw = { -+ .dir = "qcn9000/hw1.0", -+ .board_size = 256 * 1024, -+ .cal_size = 256 * 1024, -+ }, -+ .max_radios = 1, -+ .single_pdev_only = false, -+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000, -+ }, - }; - - static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name, ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -136,6 +136,7 @@ struct ath11k_hw_params { - bool internal_sleep_clock; - - const struct ath11k_hw_regs *regs; -+ u32 qmi_service_ins_id; - const struct ce_attr *host_ce_config; - u32 ce_count; - const struct ce_pipe_config *target_ce_config; ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -107,6 +107,7 @@ enum ath11k_hw_rev { - ATH11K_HW_IPQ8074, - ATH11K_HW_IPQ6018, - ATH11K_HW_QCA6390_HW20, -+ ATH11K_HW_QCN9000, - }; - - enum ath11k_firmware_mode { ---- a/drivers/net/wireless/ath/ath11k/qmi.h -+++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -22,10 +22,10 @@ - #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02 - #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01 - #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02 -+#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000 0x07 - #define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 - #define ATH11K_QMI_RESP_LEN_MAX 8192 - #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 --#define ATH11K_QMI_CALDB_SIZE 0x480000 - #define ATH11K_QMI_MAX_QDSS_CONFIG_FILE_NAME_SIZE 64 - #define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin" - --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c -@@ -3,14 +3,16 @@ +@@ -3,6 +3,7 @@ #include #include @@ -307,147 +91,74 @@ Signed-off-by: Anilkumar Kolli #include "core.h" #include "debug.h" - #include "mhi.h" -+#include "pci.h" - - #define MHI_TIMEOUT_DEFAULT_MS 90000 - --static struct mhi_channel_config ath11k_mhi_channels[] = { -+static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = { +@@ -25,6 +26,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = false, + }, { - .num = 0, - .name = "LOOPBACK", -@@ -73,7 +75,7 @@ static struct mhi_channel_config ath11k_ + .num = 1, +@@ -39,6 +41,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = false, + }, + { + .num = 20, +@@ -53,6 +56,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = true, + }, + { + .num = 21, +@@ -67,6 +71,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = true, ++ .auto_start = true, }, }; --static struct mhi_event_config ath11k_mhi_events[] = { -+static struct mhi_event_config ath11k_mhi_events_qca6390[] = { +@@ -118,6 +123,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = false, + }, { - .num_elements = 32, - .irq_moderation_ms = 0, -@@ -96,15 +98,112 @@ static struct mhi_event_config ath11k_mh + .num = 1, +@@ -132,6 +138,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = false, + }, + { + .num = 20, +@@ -146,6 +153,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = false, ++ .auto_start = true, + }, + { + .num = 21, +@@ -160,6 +168,7 @@ static struct mhi_channel_config ath11k_ + .offload_channel = false, + .doorbell_mode_switch = false, + .auto_queue = true, ++ .auto_start = true, }, }; --static struct mhi_controller_config ath11k_mhi_config = { -+static struct mhi_controller_config ath11k_mhi_config_qca6390 = { - .max_channels = 128, - .timeout_ms = 2000, - .use_bounce_buf = false, - .buf_len = 0, -- .num_channels = ARRAY_SIZE(ath11k_mhi_channels), -- .ch_cfg = ath11k_mhi_channels, -- .num_events = ARRAY_SIZE(ath11k_mhi_events), -- .event_cfg = ath11k_mhi_events, -+ .num_channels = ARRAY_SIZE(ath11k_mhi_channels_qca6390), -+ .ch_cfg = ath11k_mhi_channels_qca6390, -+ .num_events = ARRAY_SIZE(ath11k_mhi_events_qca6390), -+ .event_cfg = ath11k_mhi_events_qca6390, -+}; -+ -+static struct mhi_channel_config ath11k_mhi_channels_qcn9000[] = { -+ { -+ .num = 0, -+ .name = "LOOPBACK", -+ .num_elements = 32, -+ .event_ring = 1, -+ .dir = DMA_TO_DEVICE, -+ .ee_mask = 0x14, -+ .pollcfg = 0, -+ .doorbell = MHI_DB_BRST_DISABLE, -+ .lpm_notify = false, -+ .offload_channel = false, -+ .doorbell_mode_switch = false, -+ .auto_queue = false, -+ .auto_start = false, -+ }, -+ { -+ .num = 1, -+ .name = "LOOPBACK", -+ .num_elements = 32, -+ .event_ring = 1, -+ .dir = DMA_FROM_DEVICE, -+ .ee_mask = 0x14, -+ .pollcfg = 0, -+ .doorbell = MHI_DB_BRST_DISABLE, -+ .lpm_notify = false, -+ .offload_channel = false, -+ .doorbell_mode_switch = false, -+ .auto_queue = false, -+ .auto_start = false, -+ }, -+ { -+ .num = 20, -+ .name = "IPCR", -+ .num_elements = 32, -+ .event_ring = 1, -+ .dir = DMA_TO_DEVICE, -+ .ee_mask = 0x14, -+ .pollcfg = 0, -+ .doorbell = MHI_DB_BRST_DISABLE, -+ .lpm_notify = false, -+ .offload_channel = false, -+ .doorbell_mode_switch = false, -+ .auto_queue = false, -+ .auto_start = true, -+ }, -+ { -+ .num = 21, -+ .name = "IPCR", -+ .num_elements = 32, -+ .event_ring = 1, -+ .dir = DMA_FROM_DEVICE, -+ .ee_mask = 0x14, -+ .pollcfg = 0, -+ .doorbell = MHI_DB_BRST_DISABLE, -+ .lpm_notify = false, -+ .offload_channel = false, -+ .doorbell_mode_switch = false, -+ .auto_queue = true, -+ .auto_start = true, -+ }, -+}; -+ -+static struct mhi_event_config ath11k_mhi_events_qcn9000[] = { -+ { -+ .num_elements = 32, -+ .irq_moderation_ms = 0, -+ .irq = 1, -+ .data_type = MHI_ER_CTRL, -+ .mode = MHI_DB_BRST_DISABLE, -+ .hardware_event = false, -+ .client_managed = false, -+ .offload_channel = false, -+ }, -+ { -+ .num_elements = 256, -+ .irq_moderation_ms = 1, -+ .irq = 2, -+ .mode = MHI_DB_BRST_DISABLE, -+ .priority = 1, -+ .hardware_event = false, -+ .client_managed = false, -+ .offload_channel = false, -+ }, -+}; -+ -+static struct mhi_controller_config ath11k_mhi_config_qcn9000 = { -+ .max_channels = 30, -+ .timeout_ms = 10000, -+ .use_bounce_buf = false, -+ .buf_len = 0, -+ .num_channels = ARRAY_SIZE(ath11k_mhi_channels_qcn9000), -+ .ch_cfg = ath11k_mhi_channels_qcn9000, -+ .num_events = ARRAY_SIZE(ath11k_mhi_events_qcn9000), -+ .event_cfg = ath11k_mhi_events_qcn9000, - }; - - void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab) -@@ -216,7 +315,12 @@ int ath11k_mhi_register(struct ath11k_pc - { +@@ -316,7 +325,12 @@ int ath11k_mhi_register(struct ath11k_pc struct ath11k_base *ab = ab_pci->ab; struct mhi_controller *mhi_ctrl; + struct mhi_controller_config *ath11k_mhi_config; - int ret; + struct mhi_controller_config *ath11k_mhi_config; + struct device_node *np; @@ -456,9 +167,9 @@ Signed-off-by: Anilkumar Kolli + unsigned long start, size; + bool no_dt_entry = 0; - mhi_ctrl = kzalloc(sizeof(*mhi_ctrl), GFP_KERNEL); + mhi_ctrl = mhi_alloc_controller(); if (!mhi_ctrl) -@@ -238,8 +342,41 @@ int ath11k_mhi_register(struct ath11k_pc +@@ -338,8 +352,41 @@ int ath11k_mhi_register(struct ath11k_pc return ret; } @@ -502,27 +213,9 @@ Signed-off-by: Anilkumar Kolli mhi_ctrl->sbl_size = SZ_512K; mhi_ctrl->seg_len = SZ_512K; mhi_ctrl->fbc_download = true; -@@ -249,7 +386,16 @@ int ath11k_mhi_register(struct ath11k_pc - mhi_ctrl->read_reg = ath11k_mhi_op_read_reg; - mhi_ctrl->write_reg = ath11k_mhi_op_write_reg; - -- ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config); -+ switch (ab_pci->dev_id) { -+ case QCA6390_DEVICE_ID: -+ ath11k_mhi_config = &ath11k_mhi_config_qca6390; -+ break; -+ case QCN9000_DEVICE_ID: -+ ath11k_mhi_config = &ath11k_mhi_config_qcn9000; -+ break; -+ } -+ -+ ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config); - if (ret) { - ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret); - kfree(mhi_ctrl); --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2061,17 +2061,18 @@ static void ath11k_qmi_free_target_mem_c +@@ -2079,17 +2079,18 @@ static void ath11k_qmi_free_target_mem_c { int i; @@ -548,13 +241,12 @@ Signed-off-by: Anilkumar Kolli ab->qmi.target_mem[i].vaddr = NULL; } } -@@ -2100,11 +2101,27 @@ static int ath11k_qmi_alloc_target_mem_c +@@ -2129,10 +2130,26 @@ static int ath11k_qmi_alloc_target_mem_c static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) { + struct device *dev = ab->dev; int i, idx; - u32 caldb_location[2] = {0, 0}; + u32 addr = 0; for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { @@ -576,34 +268,56 @@ Signed-off-by: Anilkumar Kolli case BDF_MEM_REGION_TYPE: ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr; ab->qmi.target_mem[idx].vaddr = NULL; -@@ -2113,23 +2130,18 @@ static int ath11k_qmi_assign_target_mem_ - idx++; - break; - case CALDB_MEM_REGION_TYPE: -- if (ab->qmi.target_mem[i].size > ATH11K_QMI_CALDB_SIZE) { -+ if (ab->qmi.target_mem[i].size > ab->hw_params.fw.cal_size) - ath11k_warn(ab, "qmi mem size is low to load caldata\n"); -- return -EINVAL; -- } +@@ -2146,14 +2163,17 @@ static int ath11k_qmi_assign_target_mem_ + return -EINVAL; + } -- if (of_property_read_u32_array(ab->dev->of_node, "qcom,caldb-addr", -- &caldb_location[0], -- ARRAY_SIZE(caldb_location))) { -- ath11k_warn(ab, "qmi no bdf_addr in device_tree\n"); -- } +- if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) { +- ab->qmi.target_mem[idx].paddr = +- ATH11K_QMI_CALDB_ADDRESS; + if (of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr)) + ath11k_warn(ab, "qmi fail to get caldb-addr in dt\n"); - - if (enable_cold_boot_cal) { -- ab->qmi.target_mem[idx].paddr = caldb_location[ab->qmi.target_mem_mode]; -- ab->qmi.target_mem[idx].vaddr = caldb_location[ab->qmi.target_mem_mode]; ++ ++ if (ab->enable_cold_boot_cal && ab->hw_params.cold_boot_calib) { + ab->qmi.target_mem[idx].paddr = (u32)addr; -+ ab->qmi.target_mem[idx].vaddr = (u32)addr; + ab->qmi.target_mem[idx].vaddr = +- (void *)ATH11K_QMI_CALDB_ADDRESS; ++ ioremap(ab->qmi.target_mem[idx].paddr, ++ ab->qmi.target_mem[i].size); } else { - ab->qmi.target_mem[idx].paddr = 0; -- ab->qmi.target_mem[idx].vaddr = 0; +- ab->qmi.target_mem[idx].vaddr = NULL; + ab->qmi.target_mem[idx].paddr = 0UL; + ab->qmi.target_mem[idx].vaddr = 0UL; } ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; +@@ -2915,7 +2935,7 @@ static void ath11k_qmi_msg_mem_request_c + ret); + return; + } +- } else { ++ } else if (msg->mem_seg_len > 3) { + ret = ath11k_qmi_alloc_target_mem_chunk(ab); + if (ret) { + ath11k_warn(ab, "qmi failed to alloc target memory: %d\n", +@@ -3083,7 +3103,7 @@ static void ath11k_qmi_driver_event_work + break; + } + +- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 && ++ if (ab->enable_cold_boot_cal && ab->qmi.cal_done == 0 && + ab->hw_params.cold_boot_calib) { + ath11k_qmi_process_coldboot_calibration(ab); + } else { +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -185,7 +185,7 @@ static const struct ath11k_hw_params ath + .supports_monitor = true, + .supports_shadow_regs = false, + .idle_ps = false, +- .cold_boot_calib = false, ++ .cold_boot_calib = true, + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), + }, diff --git a/feeds/wifi-ax/mac80211/patches/qca/171-ath11k-use-static-window-for-register-access.patch b/feeds/wifi-ax/mac80211/patches/qca/171-ath11k-use-static-window-for-register-access.patch deleted file mode 100644 index 2be351953..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/171-ath11k-use-static-window-for-register-access.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 32c27c4c09bc696894c26c10a7f58916192893b5 Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 11:28:57 +0530 -Subject: [PATCH 1/9] ath11k: add static window support for register access - -Three window slots can be configured. First window slot -dedicated for dynamic selection and remaining two slots -dedicated for static selection. To optimise the window -selection, frequent registers (UMAC, CE) are configured -in static window slot. so that we minimise the window -selection. Other registers are configured in dynamic window -slot. Get the window start address from the respective -offset and access the read/write register. - -Note: This patch depends on below patchset - 1. Add pci/mhi support for qcn9000 - -Tested-on: QCN9000 hw1.0 WLAN.HK.2.4.0.1-00097-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/core.h | 1 + - drivers/net/wireless/ath/ath11k/hal.h | 4 ++ - drivers/net/wireless/ath/ath11k/pci.c | 73 +++++++++++++++++++++++++++++----- - 3 files changed, 69 insertions(+), 9 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -683,6 +683,7 @@ struct ath11k_bus_params { - bool m3_fw_support; - bool fixed_bdf_addr; - bool fixed_mem_region; -+ bool static_window_map; - }; - - /* IPQ8074 HW channel counters frequency value in hertz */ ---- a/drivers/net/wireless/ath/ath11k/hal.h -+++ b/drivers/net/wireless/ath/ath11k/hal.h -@@ -35,6 +35,7 @@ struct ath11k_base; - #define SHADOW_NUM_REGISTERS 36 - - /* WCSS Relative address */ -+#define HAL_SEQ_WCSS_UMAC_OFFSET 0x00a00000 - #define HAL_SEQ_WCSS_UMAC_REO_REG 0x00a38000 - #define HAL_SEQ_WCSS_UMAC_TCL_REG 0x00a44000 - #define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG 0x00a00000 -@@ -43,6 +44,9 @@ struct ath11k_base; - #define HAL_SEQ_WCSS_UMAC_CE1_DST_REG 0x00a03000 - #define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000 - -+#define HAL_CE_WFSS_CE_REG_BASE 0x01b80000 -+#define HAL_WLAON_REG_BASE 0x01f80000 -+ - /* SW2TCL(x) R0 ring configuration address */ - #define HAL_TCL1_RING_CMN_CTRL_REG 0x00000014 - #define HAL_TCL1_RING_DSCP_TID_MAP 0x0000002c ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -131,32 +131,83 @@ static inline void ath11k_pci_select_win - } - } - -+static inline void ath11k_pci_select_static_window(struct ath11k_pci *ab_pci) -+{ -+ u32 umac_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_OFFSET); -+ u32 ce_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_CE_WFSS_CE_REG_BASE); -+ u32 window; -+ -+ window = (umac_window << 12) | (ce_window << 6); -+ -+ iowrite32(WINDOW_ENABLE_BIT | window, ab_pci->ab->mem + WINDOW_REG_ADDRESS); -+} -+ -+static inline u32 ath11k_pci_get_window_start(struct ath11k_base *ab, -+ u32 offset) -+{ -+ u32 window_start; -+ -+ /* If offset lies within DP register range, use 3rd window */ -+ if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < WINDOW_RANGE_MASK) -+ window_start = 3 * WINDOW_START; -+ /* If offset lies within CE register range, use 2nd window */ -+ else if ((offset ^ HAL_CE_WFSS_CE_REG_BASE) < WINDOW_RANGE_MASK) -+ window_start = 2 * WINDOW_START; -+ else -+ window_start = WINDOW_START; -+ -+ return window_start; -+} -+ - void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) - { - struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); -+ u32 window_start; - - if (offset < WINDOW_START) { - iowrite32(value, ab->mem + offset); - } else { -- spin_lock_bh(&ab_pci->window_lock); -- ath11k_pci_select_window(ab_pci, offset); -- iowrite32(value, ab->mem + WINDOW_START + (offset & WINDOW_RANGE_MASK)); -- spin_unlock_bh(&ab_pci->window_lock); -+ if (ab->bus_params.static_window_map) -+ window_start = ath11k_pci_get_window_start(ab, offset); -+ else -+ window_start = WINDOW_START; -+ -+ if (window_start == WINDOW_START) { -+ spin_lock_bh(&ab_pci->window_lock); -+ ath11k_pci_select_window(ab_pci, offset); -+ iowrite32(value, ab->mem + window_start + -+ (offset & WINDOW_RANGE_MASK)); -+ spin_unlock_bh(&ab_pci->window_lock); -+ } else { -+ iowrite32(value, ab->mem + window_start + -+ (offset & WINDOW_RANGE_MASK)); -+ } - } - } - - u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) - { - struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); -- u32 val; -+ u32 val, window_start; - - if (offset < WINDOW_START) { - val = ioread32(ab->mem + offset); - } else { -- spin_lock_bh(&ab_pci->window_lock); -- ath11k_pci_select_window(ab_pci, offset); -- val = ioread32(ab->mem + WINDOW_START + (offset & WINDOW_RANGE_MASK)); -- spin_unlock_bh(&ab_pci->window_lock); -+ if (ab->bus_params.static_window_map) -+ window_start = ath11k_pci_get_window_start(ab, offset); -+ else -+ window_start = WINDOW_START; -+ -+ if (window_start == WINDOW_START) { -+ spin_lock_bh(&ab_pci->window_lock); -+ ath11k_pci_select_window(ab_pci, offset); -+ val = ioread32(ab->mem + window_start + -+ (offset & WINDOW_RANGE_MASK)); -+ spin_unlock_bh(&ab_pci->window_lock); -+ } else { -+ val = ioread32(ab->mem + window_start + -+ (offset & WINDOW_RANGE_MASK)); -+ } - } - - return val; -@@ -753,6 +804,9 @@ static int ath11k_pci_power_up(struct at - return ret; - } - -+ if (ab->bus_params.static_window_map) -+ ath11k_pci_select_static_window(ab_pci); -+ - return 0; - } - -@@ -900,6 +954,7 @@ static int ath11k_pci_probe(struct pci_d - break; - case QCN9000_DEVICE_ID: - ab_pci->msi_config = &ath11k_msi_config[1]; -+ ab->bus_params.static_window_map = true; - break; - default: - dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", ---- a/drivers/net/wireless/ath/ath11k/hif.h -+++ b/drivers/net/wireless/ath/ath11k/hif.h -@@ -92,4 +92,5 @@ static inline void ath11k_get_msi_addres - - ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi); - } -+ - #endif /* _HIF_H_ */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/173-ath11k-add-qcn9000-hal-support.patch b/feeds/wifi-ax/mac80211/patches/qca/173-ath11k-add-qcn9000-hal-support.patch deleted file mode 100644 index ba13d5273..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/173-ath11k-add-qcn9000-hal-support.patch +++ /dev/null @@ -1,745 +0,0 @@ -From 4fb880ea9c65d5b26a2f3ac4ce7d8c5ba51f2b3d Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 12:09:13 +0530 -Subject: [PATCH 2/9] ath11k: add hal support for qcn9000 - -defined the hal ring address and ring meta descriptor mask for -qcn9000. Moved the platform specific address to the ath11k_hw_regs. -defined tx_mesh_enable ops in ath11k_hw_ops since its accessing -platform specific TCL descriptor. - -Note: This patch depends on below patchset - 1. Add pci/mhi support for qcn9000 - -Tested-on: QCN9000 hw1.0 WLAN.HK.2.4.0.1-00097-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/core.c | 11 ++- - drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- - drivers/net/wireless/ath/ath11k/hal.c | 88 ++++++++------------ - drivers/net/wireless/ath/ath11k/hal.h | 18 ++--- - drivers/net/wireless/ath/ath11k/hal_desc.h | 13 +-- - drivers/net/wireless/ath/ath11k/hal_tx.c | 3 + - drivers/net/wireless/ath/ath11k/hal_tx.h | 1 + - drivers/net/wireless/ath/ath11k/hw.c | 125 +++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/hw.h | 19 +++++ - 9 files changed, 208 insertions(+), 72 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -133,6 +133,22 @@ static const struct ath11k_hw_params ath - .max_radios = 1, - .single_pdev_only = false, - .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000, -+ .regs = &qcn9000_regs, -+ .hw_ops = &qcn9000_ops, -+ .credit_flow = false, -+ .internal_sleep_clock = false, -+ .target_ce_config = ath11k_target_ce_config_wlan_qcn9000, -+ .target_ce_count = 9, -+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9000, -+ .svc_to_ce_map_len = 18, -+ .spectral_fft_sz = 2, -+ .needs_band_to_mac = true, -+ .rxdma1_enable = true, -+ .num_rxmda_per_pdev = 1, -+ .rx_mac_buf_ring = false, -+ .vdev_start_delay = false, -+ .htt_peer_map_v2 = true, -+ .tcl_0_only = false, - }, - }; - ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -176,7 +176,7 @@ tcl_ring_sel: - } - - if (ieee80211_vif_is_mesh(arvif->vif)) -- ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE, 1); -+ ti.enable_mesh = true; - - ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE, 1); - ---- a/drivers/net/wireless/ath/ath11k/hal.c -+++ b/drivers/net/wireless/ath/ath11k/hal.c -@@ -89,17 +89,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_ce_srng_src_desc) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_SRC, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_CE0_SRC_REG + -- HAL_CE_DST_RING_BASE_LSB), -- HAL_SEQ_WCSS_UMAC_CE0_SRC_REG + HAL_CE_DST_RING_HP, -- }, -- .reg_size = { -- (HAL_SEQ_WCSS_UMAC_CE1_SRC_REG - -- HAL_SEQ_WCSS_UMAC_CE0_SRC_REG), -- (HAL_SEQ_WCSS_UMAC_CE1_SRC_REG - -- HAL_SEQ_WCSS_UMAC_CE0_SRC_REG), -- }, - .max_size = HAL_CE_SRC_RING_BASE_MSB_RING_SIZE, - }, - { /* CE_DST */ -@@ -108,17 +97,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_ce_srng_dest_desc) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_SRC, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + -- HAL_CE_DST_RING_BASE_LSB), -- HAL_SEQ_WCSS_UMAC_CE0_DST_REG + HAL_CE_DST_RING_HP, -- }, -- .reg_size = { -- (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - -- HAL_SEQ_WCSS_UMAC_CE0_DST_REG), -- (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - -- HAL_SEQ_WCSS_UMAC_CE0_DST_REG), -- }, - .max_size = HAL_CE_DST_RING_BASE_MSB_RING_SIZE, - }, - { /* CE_DST_STATUS */ -@@ -127,18 +105,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_ce_srng_dst_status_desc) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_DST, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + -- HAL_CE_DST_STATUS_RING_BASE_LSB), -- (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + -- HAL_CE_DST_STATUS_RING_HP), -- }, -- .reg_size = { -- (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - -- HAL_SEQ_WCSS_UMAC_CE0_DST_REG), -- (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - -- HAL_SEQ_WCSS_UMAC_CE0_DST_REG), -- }, - .max_size = HAL_CE_DST_STATUS_RING_BASE_MSB_RING_SIZE, - }, - { /* WBM_IDLE_LINK */ -@@ -147,11 +113,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_wbm_link_desc) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_SRC, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_WBM_REG + -- HAL_WBM_IDLE_LINK_RING_BASE_LSB), -- (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP), -- }, - .max_size = HAL_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE, - }, - { /* SW2WBM_RELEASE */ -@@ -160,11 +121,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_wbm_release_ring) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_SRC, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_WBM_REG + -- HAL_WBM_RELEASE_RING_BASE_LSB), -- (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP), -- }, - .max_size = HAL_SW2WBM_RELEASE_RING_BASE_MSB_RING_SIZE, - }, - { /* WBM2SW_RELEASE */ -@@ -173,16 +129,6 @@ static const struct hal_srng_config hw_s - .entry_size = sizeof(struct hal_wbm_release_ring) >> 2, - .lmac_ring = false, - .ring_dir = HAL_SRNG_DIR_DST, -- .reg_start = { -- (HAL_SEQ_WCSS_UMAC_WBM_REG + -- HAL_WBM0_RELEASE_RING_BASE_LSB), -- (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP), -- }, -- .reg_size = { -- (HAL_WBM1_RELEASE_RING_BASE_LSB - -- HAL_WBM0_RELEASE_RING_BASE_LSB), -- (HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP), -- }, - .max_size = HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE, - }, - { /* RXDMA_BUF */ -@@ -953,7 +899,7 @@ void ath11k_hal_setup_link_idle_list(str - /* Enable the SRNG */ - ath11k_hif_write32(ab, - HAL_SEQ_WCSS_UMAC_WBM_REG + -- HAL_WBM_IDLE_LINK_RING_MISC_ADDR, 0x40); -+ HAL_WBM_IDLE_LINK_RING_MISC_ADDR(ab), 0x40); - } - - int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type, -@@ -1109,6 +1055,38 @@ static int ath11k_hal_srng_create_config - s->reg_start[0] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_BASE_LSB(ab); - s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP; - -+ s = &hal->srng_config[HAL_CE_SRC]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_BASE_LSB; -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_HP; -+ s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab); -+ s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab); -+ -+ s = &hal->srng_config[HAL_CE_DST]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_BASE_LSB; -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_HP; -+ s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); -+ s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); -+ -+ s = &hal->srng_config[HAL_CE_DST_STATUS]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_BASE_LSB; -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_HP; -+ s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); -+ s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); -+ -+ s = &hal->srng_config[HAL_WBM_IDLE_LINK]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_BASE_LSB(ab); -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP; -+ -+ s = &hal->srng_config[HAL_SW2WBM_RELEASE]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_BASE_LSB(ab); -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP; -+ -+ s = &hal->srng_config[HAL_WBM2SW_RELEASE]; -+ s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_BASE_LSB(ab); -+ s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP; -+ s->reg_size[0] = HAL_WBM1_RELEASE_RING_BASE_LSB(ab) - HAL_WBM0_RELEASE_RING_BASE_LSB(ab); -+ s->reg_size[1] = HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP; -+ - return 0; - } - ---- a/drivers/net/wireless/ath/ath11k/hal.h -+++ b/drivers/net/wireless/ath/ath11k/hal.h -@@ -38,10 +38,10 @@ struct ath11k_base; - #define HAL_SEQ_WCSS_UMAC_OFFSET 0x00a00000 - #define HAL_SEQ_WCSS_UMAC_REO_REG 0x00a38000 - #define HAL_SEQ_WCSS_UMAC_TCL_REG 0x00a44000 --#define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG 0x00a00000 --#define HAL_SEQ_WCSS_UMAC_CE0_DST_REG 0x00a01000 --#define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG 0x00a02000 --#define HAL_SEQ_WCSS_UMAC_CE1_DST_REG 0x00a03000 -+#define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) ab->hw_params.regs->hal_seq_wcss_umac_ce0_src_reg -+#define HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) ab->hw_params.regs->hal_seq_wcss_umac_ce0_dst_reg -+#define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) ab->hw_params.regs->hal_seq_wcss_umac_ce1_src_reg -+#define HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) ab->hw_params.regs->hal_seq_wcss_umac_ce1_dst_reg - #define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000 - - #define HAL_CE_WFSS_CE_REG_BASE 0x01b80000 -@@ -197,8 +197,8 @@ struct ath11k_base; - #define HAL_REO_STATUS_HP(ab) ab->hw_params.regs->hal_reo_status_hp - - /* WBM Idle R0 address */ --#define HAL_WBM_IDLE_LINK_RING_BASE_LSB 0x00000860 --#define HAL_WBM_IDLE_LINK_RING_MISC_ADDR 0x00000870 -+#define HAL_WBM_IDLE_LINK_RING_BASE_LSB(ab) ab->hw_params.regs->hal_wbm_idle_link_ring_base_lsb -+#define HAL_WBM_IDLE_LINK_RING_MISC_ADDR(ab) ab->hw_params.regs->hal_wbm_idle_link_ring_misc - #define HAL_WBM_R0_IDLE_LIST_CONTROL_ADDR 0x00000048 - #define HAL_WBM_R0_IDLE_LIST_SIZE_ADDR 0x0000004c - #define HAL_WBM_SCATTERED_RING_BASE_LSB 0x00000058 -@@ -213,14 +213,14 @@ struct ath11k_base; - #define HAL_WBM_IDLE_LINK_RING_HP 0x000030b0 - - /* SW2WBM R0 release address */ --#define HAL_WBM_RELEASE_RING_BASE_LSB 0x000001d8 -+#define HAL_WBM_RELEASE_RING_BASE_LSB(ab) ab->hw_params.regs->hal_wbm_release_ring_base_lsb - - /* SW2WBM R2 release address */ - #define HAL_WBM_RELEASE_RING_HP 0x00003018 - - /* WBM2SW R0 release address */ --#define HAL_WBM0_RELEASE_RING_BASE_LSB 0x00000910 --#define HAL_WBM1_RELEASE_RING_BASE_LSB 0x00000968 -+#define HAL_WBM0_RELEASE_RING_BASE_LSB(ab) ab->hw_params.regs->hal_wbm0_release_ring_base_lsb -+#define HAL_WBM1_RELEASE_RING_BASE_LSB(ab) ab->hw_params.regs->hal_wbm1_release_ring_base_lsb - - /* WBM2SW R2 release address */ - #define HAL_WBM0_RELEASE_RING_HP 0x000030c0 ---- a/drivers/net/wireless/ath/ath11k/hal_desc.h -+++ b/drivers/net/wireless/ath/ath11k/hal_desc.h -@@ -952,16 +952,17 @@ struct hal_reo_flush_cache { - #define HAL_TCL_DATA_CMD_INFO1_TO_FW BIT(21) - #define HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET GENMASK(31, 23) - --#define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0) --#define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19) --#define HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20) --#define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21) --#define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22) --#define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26) -+#define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0) -+#define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19) -+#define HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20) -+#define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21) -+#define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22) -+#define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26) - - #define HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX GENMASK(5, 0) - #define HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX GENMASK(25, 6) - #define HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM GENMASK(29, 26) -+#define HAL_QCN9000_TCL_DATA_CMD_INFO3_MESH_ENABLE GENMASK(31, 30) - - #define HAL_TCL_DATA_CMD_INFO4_RING_ID GENMASK(27, 20) - #define HAL_TCL_DATA_CMD_INFO4_LOOPING_COUNT GENMASK(31, 28) ---- a/drivers/net/wireless/ath/ath11k/hal_tx.c -+++ b/drivers/net/wireless/ath/ath11k/hal_tx.c -@@ -73,6 +73,9 @@ void ath11k_hal_tx_cmd_desc_setup(struct - FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX, - ti->bss_ast_hash); - tcl_cmd->info4 = 0; -+ -+ if (ti->enable_mesh && ab->hw_params.hw_ops->tx_mesh_enable) -+ ab->hw_params.hw_ops->tx_mesh_enable(ab, tcl_cmd); - } - - void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id) ---- a/drivers/net/wireless/ath/ath11k/hal_tx.h -+++ b/drivers/net/wireless/ath/ath11k/hal_tx.h -@@ -33,6 +33,7 @@ struct hal_tx_info { - u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ - u8 lmac_id; - u8 dscp_tid_tbl_idx; -+ bool enable_mesh; - }; - - /* TODO: Check if the actual desc macros can be used instead */ ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -31,6 +31,20 @@ static u8 ath11k_hw_ipq6018_mac_from_pde - return pdev_idx; - } - -+static void ath11k_hw_ipq8074_tx_mesh_enable(struct ath11k_base *ab, -+ struct hal_tcl_data_cmd *tcl_cmd) -+{ -+ tcl_cmd->info2 |= FIELD_PREP(HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE, -+ true); -+} -+ -+static void ath11k_hw_qcn9000_tx_mesh_enable(struct ath11k_base *ab, -+ struct hal_tcl_data_cmd *tcl_cmd) -+{ -+ tcl_cmd->info3 |= FIELD_PREP(HAL_QCN9000_TCL_DATA_CMD_INFO3_MESH_ENABLE, -+ true); -+} -+ - static void ath11k_init_wmi_config_qca6390(struct ath11k_base *ab, - struct target_resource_config *config) - { -@@ -177,6 +191,7 @@ const struct ath11k_hw_ops ipq8074_ops = - .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, - .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, -+ .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, - }; - - const struct ath11k_hw_ops ipq6018_ops = { -@@ -187,6 +202,7 @@ const struct ath11k_hw_ops ipq6018_ops = - .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, - .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, -+ .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, - }; - - const struct ath11k_hw_ops qca6390_ops = { -@@ -199,6 +215,18 @@ const struct ath11k_hw_ops qca6390_ops = - .rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2, - */ -+ .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, -+}; -+ -+const struct ath11k_hw_ops qcn9000_ops = { -+ .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id, -+ .wmi_init_config = ath11k_init_wmi_config_ipq8074, -+ .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, -+ .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, -+ .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, -+ .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, -+ .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, -+ .tx_mesh_enable = ath11k_hw_qcn9000_tx_mesh_enable, - }; - - #define ATH11K_TX_RING_MASK_0 0x1 -@@ -817,6 +845,206 @@ const struct service_to_pipe ath11k_targ - }, - }; - -+/* Target firmware's Copy Engine configuration. */ -+const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9000[] = { -+ /* CE0: host->target HTC control and raw streams */ -+ { -+ .pipenum = __cpu_to_le32(0), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE1: target->host HTT + HTC control */ -+ { -+ .pipenum = __cpu_to_le32(1), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE2: target->host WMI */ -+ { -+ .pipenum = __cpu_to_le32(2), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE3: host->target WMI */ -+ { -+ .pipenum = __cpu_to_le32(3), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE4: host->target HTT */ -+ { -+ .pipenum = __cpu_to_le32(4), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(256), -+ .nbytes_max = __cpu_to_le32(256), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE5: target->host Pktlog */ -+ { -+ .pipenum = __cpu_to_le32(5), -+ .pipedir = __cpu_to_le32(PIPEDIR_IN), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE6: Reserved for target autonomous hif_memcpy */ -+ { -+ .pipenum = __cpu_to_le32(6), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(16384), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE7 used only by Host */ -+ { -+ .pipenum = __cpu_to_le32(7), -+ .pipedir = __cpu_to_le32(PIPEDIR_OUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(2048), -+ .flags = __cpu_to_le32(0x2000), -+ .reserved = __cpu_to_le32(0), -+ }, -+ -+ /* CE8 target->host used only by IPA */ -+ { -+ .pipenum = __cpu_to_le32(8), -+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT), -+ .nentries = __cpu_to_le32(32), -+ .nbytes_max = __cpu_to_le32(16384), -+ .flags = __cpu_to_le32(CE_ATTR_FLAGS), -+ .reserved = __cpu_to_le32(0), -+ }, -+ /* CE 9, 10, 11 are used by MHI driver */ -+}; -+ -+/* Map from service/endpoint to Copy Engine. -+ * This table is derived from the CE_PCI TABLE, above. -+ * It is passed to the Target at startup for use by firmware. -+ */ -+const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9000[] = { -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(3), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(2), -+ }, -+ -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(0), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(1), -+ }, -+ -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(0), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(1), -+ }, -+ -+ -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ -+ __cpu_to_le32(4), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(1), -+ }, -+ { -+ __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG), -+ __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ -+ __cpu_to_le32(5), -+ }, -+ -+ /* (Additions here) */ -+ -+ { /* must be last */ -+ __cpu_to_le32(0), -+ __cpu_to_le32(0), -+ __cpu_to_le32(0), -+ }, -+ -+ -+}; -+ - const struct ath11k_hw_regs ipq8074_regs = { - /* SW2TCL(x) R0 ring configuration address */ - .hal_tcl1_ring_base_lsb = 0x00000510, -@@ -866,6 +1094,22 @@ const struct ath11k_hw_regs ipq8074_regs - .hal_reo_status_ring_base_lsb = 0x00000504, - .hal_reo_status_hp = 0x00003070, - -+ /* WCSS relative address */ -+ .hal_seq_wcss_umac_ce0_src_reg = 0x00a00000, -+ .hal_seq_wcss_umac_ce0_dst_reg = 0x00a01000, -+ .hal_seq_wcss_umac_ce1_src_reg = 0x00a02000, -+ .hal_seq_wcss_umac_ce1_dst_reg = 0x00a03000, -+ -+ /* WBM Idle address */ -+ .hal_wbm_idle_link_ring_base_lsb = 0x00000860, -+ .hal_wbm_idle_link_ring_misc = 0x00000870, -+ -+ /* SW2WBM release address */ -+ .hal_wbm_release_ring_base_lsb = 0x000001d8, -+ -+ /* WBM2SW release address */ -+ .hal_wbm0_release_ring_base_lsb = 0x00000910, -+ .hal_wbm1_release_ring_base_lsb = 0x00000968, - }; - - const struct ath11k_hw_regs qca6390_regs = { -@@ -916,4 +1160,88 @@ const struct ath11k_hw_regs qca6390_regs - /* REO status address */ - .hal_reo_status_ring_base_lsb = 0x000004ac, - .hal_reo_status_hp = 0x00003068, -+ -+ /* WCSS relative address */ -+ .hal_seq_wcss_umac_ce0_src_reg = 0x00a00000, -+ .hal_seq_wcss_umac_ce0_dst_reg = 0x00a01000, -+ .hal_seq_wcss_umac_ce1_src_reg = 0x00a02000, -+ .hal_seq_wcss_umac_ce1_dst_reg = 0x00a03000, -+ -+ /* WBM Idle address */ -+ .hal_wbm_idle_link_ring_base_lsb = 0x00000860, -+ .hal_wbm_idle_link_ring_misc = 0x00000870, -+ -+ /* SW2WBM release address */ -+ .hal_wbm_release_ring_base_lsb = 0x000001d8, -+ -+ /* WBM2SW release address */ -+ .hal_wbm0_release_ring_base_lsb = 0x00000910, -+ .hal_wbm1_release_ring_base_lsb = 0x00000968, -+}; -+ -+const struct ath11k_hw_regs qcn9000_regs = { -+ /* SW2TCL(x) R0 ring configuration address */ -+ .hal_tcl1_ring_base_lsb = 0x000004f0, -+ .hal_tcl1_ring_base_msb = 0x000004f4, -+ .hal_tcl1_ring_id = 0x000004f8, -+ .hal_tcl1_ring_misc = 0x00000500, -+ .hal_tcl1_ring_tp_addr_lsb = 0x0000050c, -+ .hal_tcl1_ring_tp_addr_msb = 0x00000510, -+ .hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000520, -+ .hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000524, -+ .hal_tcl1_ring_msi1_base_lsb = 0x00000538, -+ .hal_tcl1_ring_msi1_base_msb = 0x0000053c, -+ .hal_tcl1_ring_msi1_data = 0x00000540, -+ .hal_tcl2_ring_base_lsb = 0x00000548, -+ .hal_tcl_ring_base_lsb = 0x000005f8, -+ -+ /* TCL STATUS ring address */ -+ .hal_tcl_status_ring_base_lsb = 0x00000700, -+ -+ /* REO2SW(x) R0 ring configuration address */ -+ .hal_reo1_ring_base_lsb = 0x0000029c, -+ .hal_reo1_ring_base_msb = 0x000002a0, -+ .hal_reo1_ring_id = 0x000002a4, -+ .hal_reo1_ring_misc = 0x000002ac, -+ .hal_reo1_ring_hp_addr_lsb = 0x000002b0, -+ .hal_reo1_ring_hp_addr_msb = 0x000002b4, -+ .hal_reo1_ring_producer_int_setup = 0x000002c0, -+ .hal_reo1_ring_msi1_base_lsb = 0x000002e4, -+ .hal_reo1_ring_msi1_base_msb = 0x000002e8, -+ .hal_reo1_ring_msi1_data = 0x000002ec, -+ .hal_reo2_ring_base_lsb = 0x000002f4, -+ .hal_reo1_aging_thresh_ix_0 = 0x00000564, -+ .hal_reo1_aging_thresh_ix_1 = 0x00000568, -+ .hal_reo1_aging_thresh_ix_2 = 0x0000056c, -+ .hal_reo1_aging_thresh_ix_3 = 0x00000570, -+ -+ /* REO2SW(x) R2 ring pointers (head/tail) address */ -+ .hal_reo1_ring_hp = 0x00003038, -+ .hal_reo1_ring_tp = 0x0000303c, -+ .hal_reo2_ring_hp = 0x00003040, -+ -+ /* REO2TCL R0 ring configuration address */ -+ .hal_reo_tcl_ring_base_lsb = 0x000003fc, -+ .hal_reo_tcl_ring_hp = 0x00003058, -+ -+ /* REO status address */ -+ .hal_reo_status_ring_base_lsb = 0x00000504, -+ .hal_reo_status_hp = 0x00003070, -+ -+ /* WCSS relative address */ -+ .hal_seq_wcss_umac_ce0_src_reg = 0x01b80000, -+ .hal_seq_wcss_umac_ce0_dst_reg = 0x01b81000, -+ .hal_seq_wcss_umac_ce1_src_reg = 0x01b82000, -+ .hal_seq_wcss_umac_ce1_dst_reg = 0x01b83000, -+ -+ /* WBM Idle address */ -+ .hal_wbm_idle_link_ring_base_lsb = 0x00000874, -+ .hal_wbm_idle_link_ring_misc = 0x00000884, -+ -+ /* SW2WBM release address */ -+ .hal_wbm_release_ring_base_lsb = 0x000001ec, -+ -+ /* WBM2SW release address */ -+ .hal_wbm0_release_ring_base_lsb = 0x00000924, -+ .hal_wbm1_release_ring_base_lsb = 0x0000097c, - }; ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -105,6 +105,8 @@ enum ath11k_bus { - - #define ATH11K_EXT_IRQ_GRP_NUM_MAX 11 - -+struct hal_tcl_data_cmd; -+ - struct ath11k_hw_ring_mask { - u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; - u8 rx_mon_status[ATH11K_EXT_IRQ_GRP_NUM_MAX]; -@@ -169,11 +171,14 @@ struct ath11k_hw_ops { - bool (*rx_desc_get_da_mcbc)(struct hal_rx_desc *desc); - bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc); - u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); -+ void (*tx_mesh_enable)(struct ath11k_base *ab, -+ struct hal_tcl_data_cmd *tcl_cmd); - }; - - extern const struct ath11k_hw_ops ipq8074_ops; - extern const struct ath11k_hw_ops ipq6018_ops; - extern const struct ath11k_hw_ops qca6390_ops; -+extern const struct ath11k_hw_ops qcn9000_ops; - - extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; - extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; -@@ -265,9 +270,23 @@ struct ath11k_hw_regs { - - u32 hal_reo_status_ring_base_lsb; - u32 hal_reo_status_hp; -+ -+ u32 hal_seq_wcss_umac_ce0_src_reg; -+ u32 hal_seq_wcss_umac_ce0_dst_reg; -+ u32 hal_seq_wcss_umac_ce1_src_reg; -+ u32 hal_seq_wcss_umac_ce1_dst_reg; -+ -+ u32 hal_wbm_idle_link_ring_base_lsb; -+ u32 hal_wbm_idle_link_ring_misc; -+ -+ u32 hal_wbm_release_ring_base_lsb; -+ -+ u32 hal_wbm0_release_ring_base_lsb; -+ u32 hal_wbm1_release_ring_base_lsb; - }; - - extern const struct ath11k_hw_regs ipq8074_regs; - extern const struct ath11k_hw_regs qca6390_regs; -+extern const struct ath11k_hw_regs qcn9000_regs; - - #endif ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -947,8 +947,10 @@ struct ath11k_fw_stats_bcn { - extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[]; - extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[]; - extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[]; -+extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9000[]; - - extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[]; -+extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9000[]; - extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; - - void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); diff --git a/feeds/wifi-ax/mac80211/patches/qca/174-ath11k-add-qcn9000-dp-rx-support.patch b/feeds/wifi-ax/mac80211/patches/qca/174-ath11k-add-qcn9000-dp-rx-support.patch deleted file mode 100644 index 62ab38132..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/174-ath11k-add-qcn9000-dp-rx-support.patch +++ /dev/null @@ -1,2048 +0,0 @@ -From df25d1f117fd368ea44d4aa5c4d6172dbb1a761c Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 12:11:26 +0530 -Subject: [PATCH 3/9] ath11k: add dp support for qcn9000 - -hal rx descriptor is different for qcn9000 target type. since -rx_msdu_end, rx_msdu_start, rx_mpdu_start elements are in -different placement/alignment. In order to have generic data path, -introduce platform specific hal rx descriptor access ops in -ath11k_hw_ops. Also added one time WARN_ON check for mandatory -hw_ops in bootup scenario to optimize the null check validation -across the data path. - -Note: This patch is depends on below patchset, - 1. Add pci/mhi support for qcn9000 - -Tested-on: QCN9000 hw1.0 WLAN.HK.2.4.0.1-00097-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/core.c | 58 +++- - drivers/net/wireless/ath/ath11k/dp_rx.c | 474 ++++++++++++++++-------------- - drivers/net/wireless/ath/ath11k/hal.h | 2 - - drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +- - drivers/net/wireless/ath/ath11k/hw.c | 423 ++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/hw.h | 29 ++ - drivers/net/wireless/ath/ath11k/rx_desc.h | 212 ++++++++++++- - 7 files changed, 962 insertions(+), 238 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -18,101 +18,108 @@ - - #define ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS (2 * HZ) - --static u8 *ath11k_dp_rx_h_80211_hdr(struct hal_rx_desc *desc) -+static u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) - { -- return desc->hdr_status; -+ return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); - } - --static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct hal_rx_desc *desc) -+static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- if (!(__le32_to_cpu(desc->mpdu_start.info1) & -- RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID)) -+ if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) - return HAL_ENCRYPT_TYPE_OPEN; - -- return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, -- __le32_to_cpu(desc->mpdu_start.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_decap_type(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_decap_type(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, -- __le32_to_cpu(desc->msdu_start.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, -- __le32_to_cpu(desc->msdu_start.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); - } - --static bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, -- __le32_to_cpu(desc->mpdu_start.info1)); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); - } - --static bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_FCTRL_VALID, -- __le32_to_cpu(desc->mpdu_start.info1)); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); - } - --static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct sk_buff *skb) -+static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, -+ struct sk_buff *skb) - { - struct ieee80211_hdr *hdr; - -- hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); - return ieee80211_has_morefrags(hdr->frame_control); - } - --static u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct sk_buff *skb) -+static u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct ath11k_base *ab, -+ struct sk_buff *skb) - { - struct ieee80211_hdr *hdr; - -- hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); - return le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; - } - --static u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct hal_rx_desc *desc) -+static u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_NUM, -- __le32_to_cpu(desc->mpdu_start.info1)); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); - } - --static bool ath11k_dp_rx_h_attn_msdu_done(struct hal_rx_desc *desc) -+static void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) -+{ -+ return ab->hw_params.hw_ops->rx_desc_get_attention(desc); -+} -+ -+static bool ath11k_dp_rx_h_attn_msdu_done(struct rx_attention *attn) - { - return !!FIELD_GET(RX_ATTENTION_INFO2_MSDU_DONE, -- __le32_to_cpu(desc->attention.info2)); -+ __le32_to_cpu(attn->info2)); - } - --static bool ath11k_dp_rx_h_attn_first_mpdu(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_attn_first_mpdu(struct rx_attention *attn) - { - return !!FIELD_GET(RX_ATTENTION_INFO1_FIRST_MPDU, -- __le32_to_cpu(desc->attention.info1)); -+ __le32_to_cpu(attn->info1)); - } - --static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct rx_attention *attn) - { - return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, -- __le32_to_cpu(desc->attention.info1)); -+ __le32_to_cpu(attn->info1)); - } - --static bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct rx_attention *attn) - { - return !!FIELD_GET(RX_ATTENTION_INFO1_IP_CKSUM_FAIL, -- __le32_to_cpu(desc->attention.info1)); -+ __le32_to_cpu(attn->info1)); - } - --static bool ath11k_dp_rx_h_attn_is_decrypted(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_attn_is_decrypted(struct rx_attention *attn) - { - return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE, -- __le32_to_cpu(desc->attention.info2)) == -+ __le32_to_cpu(attn->info2)) == - RX_DESC_DECRYPT_STATUS_CODE_OK); - } - --static u32 ath11k_dp_rx_h_attn_mpdu_err(struct hal_rx_desc *desc) -+static u32 ath11k_dp_rx_h_attn_mpdu_err(struct rx_attention *attn) - { -- u32 info = __le32_to_cpu(desc->attention.info1); -+ u32 info = __le32_to_cpu(attn->info1); - u32 errmap = 0; - - if (info & RX_ATTENTION_INFO1_FCS_ERR) -@@ -139,131 +146,121 @@ static u32 ath11k_dp_rx_h_attn_mpdu_err( - return errmap; - } - --static u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct hal_rx_desc *desc) -+static u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, -- __le32_to_cpu(desc->msdu_start.info1)); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_sgi(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO3_SGI, -- __le32_to_cpu(desc->msdu_start.info3)); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, -- __le32_to_cpu(desc->msdu_start.info3)); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, -- __le32_to_cpu(desc->msdu_start.info3)); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); - } - --static u32 ath11k_dp_rx_h_msdu_start_freq(struct hal_rx_desc *desc) -+static u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return __le32_to_cpu(desc->msdu_start.phy_meta_data); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, -- __le32_to_cpu(desc->msdu_start.info3)); -+ return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); - } - --static u8 ath11k_dp_rx_h_msdu_start_nss(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- u8 mimo_ss_bitmap = FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, -- __le32_to_cpu(desc->msdu_start.info3)); -- -- return hweight8(mimo_ss_bitmap); -+ return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); - } - --static u8 ath11k_dp_rx_h_mpdu_start_tid(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MPDU_START_INFO2_TID, -- __le32_to_cpu(desc->mpdu_start.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); - } - --static u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct hal_rx_desc *desc) -+static u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return __le16_to_cpu(desc->mpdu_start.sw_peer_id); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); - } - --static u8 ath11k_dp_rx_h_msdu_end_l3pad(struct hal_rx_desc *desc) -+static u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, -- __le32_to_cpu(desc->msdu_end.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); - } - --static bool ath11k_dp_rx_h_msdu_end_first_msdu(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_msdu_end_first_msdu(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, -- __le32_to_cpu(desc->msdu_end.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); - } - --static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct hal_rx_desc *desc) -+static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct ath11k_base *ab, -+ struct hal_rx_desc *desc) - { -- return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, -- __le32_to_cpu(desc->msdu_end.info2)); -+ return ab->hw_params.hw_ops->rx_desc_get_last_msdu(desc); - } - --static void ath11k_dp_rx_desc_end_tlv_copy(struct hal_rx_desc *fdesc, -+static void ath11k_dp_rx_desc_end_tlv_copy(struct ath11k_base *ab, -+ struct hal_rx_desc *fdesc, - struct hal_rx_desc *ldesc) - { -- memcpy((u8 *)&fdesc->msdu_end, (u8 *)&ldesc->msdu_end, -- sizeof(struct rx_msdu_end)); -- memcpy((u8 *)&fdesc->attention, (u8 *)&ldesc->attention, -- sizeof(struct rx_attention)); -- memcpy((u8 *)&fdesc->mpdu_end, (u8 *)&ldesc->mpdu_end, -- sizeof(struct rx_mpdu_end)); -+ ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); - } - --static u32 ath11k_dp_rxdesc_get_mpdulen_err(struct hal_rx_desc *rx_desc) -+static u32 ath11k_dp_rxdesc_get_mpdulen_err(struct rx_attention *attn) - { -- struct rx_attention *rx_attn; -- -- rx_attn = &rx_desc->attention; -- -- return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, -- __le32_to_cpu(rx_attn->info1)); -+ return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, __le32_to_cpu(attn->info1)); - } - --static u32 ath11k_dp_rxdesc_get_decap_format(struct hal_rx_desc *rx_desc) --{ -- struct rx_msdu_start *rx_msdu_start; -- -- rx_msdu_start = &rx_desc->msdu_start; -- -- return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, -- __le32_to_cpu(rx_msdu_start->info2)); --} -- --static u8 *ath11k_dp_rxdesc_get_80211hdr(struct hal_rx_desc *rx_desc) -+static u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, -+ struct hal_rx_desc *rx_desc) - { - u8 *rx_pkt_hdr; - -- rx_pkt_hdr = &rx_desc->hdr_status[0]; -+ rx_pkt_hdr = ab->hw_params.hw_ops->rx_desc_get_msdu_payload(rx_desc); - - return rx_pkt_hdr; - } - --static bool ath11k_dp_rxdesc_mpdu_valid(struct hal_rx_desc *rx_desc) -+static bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, -+ struct hal_rx_desc *rx_desc) - { - u32 tlv_tag; - -- tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, -- __le32_to_cpu(rx_desc->mpdu_start_tag)); -+ tlv_tag = ab->hw_params.hw_ops->rx_desc_get_mpdu_start_tag(rx_desc); - - return tlv_tag == HAL_RX_MPDU_START; - } - --static u32 ath11k_dp_rxdesc_get_ppduid(struct hal_rx_desc *rx_desc) -+static u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, -+ struct hal_rx_desc *rx_desc) - { -- return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); -+ return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); -+} -+ -+static void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, -+ struct hal_rx_desc *desc, -+ u16 len) -+{ -+ ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); - } - - static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, -@@ -1824,19 +1821,19 @@ static int ath11k_dp_rx_msdu_coalesce(st - struct sk_buff *first, struct sk_buff *last, - u8 l3pad_bytes, int msdu_len) - { -+ struct ath11k_base *ab = ar->ab; - struct sk_buff *skb; - struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(first); - int buf_first_hdr_len, buf_first_len; - struct hal_rx_desc *ldesc; -- int space_extra; -- int rem_len; -- int buf_len; -+ int space_extra, rem_len, buf_len; -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - - /* As the msdu is spread across multiple rx buffers, - * find the offset to the start of msdu for computing - * the length of the msdu in the first buffer. - */ -- buf_first_hdr_len = HAL_RX_DESC_SIZE + l3pad_bytes; -+ buf_first_hdr_len = hal_rx_desc_sz + l3pad_bytes; - buf_first_len = DP_RX_BUFFER_SIZE - buf_first_hdr_len; - - if (WARN_ON_ONCE(msdu_len <= buf_first_len)) { -@@ -1846,8 +1843,8 @@ static int ath11k_dp_rx_msdu_coalesce(st - } - - ldesc = (struct hal_rx_desc *)last->data; -- rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ldesc); -- rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ldesc); -+ rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); -+ rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); - - /* MSDU spans over multiple buffers because the length of the MSDU - * exceeds DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. So assume the data -@@ -1859,7 +1856,7 @@ static int ath11k_dp_rx_msdu_coalesce(st - /* When an MSDU spread over multiple buffers attention, MSDU_END and - * MPDU_END tlvs are valid only in the last buffer. Copy those tlvs. - */ -- ath11k_dp_rx_desc_end_tlv_copy(rxcb->rx_desc, ldesc); -+ ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); - - space_extra = msdu_len - (buf_first_len + skb_tailroom(first)); - if (space_extra > 0 && -@@ -1880,18 +1877,18 @@ static int ath11k_dp_rx_msdu_coalesce(st - while ((skb = __skb_dequeue(msdu_list)) != NULL && rem_len > 0) { - rxcb = ATH11K_SKB_RXCB(skb); - if (rxcb->is_continuation) -- buf_len = DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE; -+ buf_len = DP_RX_BUFFER_SIZE - hal_rx_desc_sz; - else - buf_len = rem_len; - -- if (buf_len > (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE)) { -+ if (buf_len > (DP_RX_BUFFER_SIZE - hal_rx_desc_sz)) { - WARN_ON_ONCE(1); - dev_kfree_skb_any(skb); - return -EINVAL; - } - -- skb_put(skb, buf_len + HAL_RX_DESC_SIZE); -- skb_pull(skb, HAL_RX_DESC_SIZE); -+ skb_put(skb, buf_len + hal_rx_desc_sz); -+ skb_pull(skb, hal_rx_desc_sz); - skb_copy_from_linear_data(skb, skb_put(first, buf_len), - buf_len); - dev_kfree_skb_any(skb); -@@ -1932,27 +1929,29 @@ static void ath11k_dp_dump_msdu_info(str - u8 *hdr_status; - u16 msdu_len; - int i; -+ struct rx_attention *rx_attention; - -- hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); -- msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); -- rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(rx_desc); -- rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(rx_desc); -+ hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); -+ rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, rx_desc); -+ rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, rx_desc); -+ rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); - - if (rxcb->is_first_msdu) { -- decap_format = ath11k_dp_rxdesc_get_decap_format(rx_desc); -- mpdu_len_err = !!ath11k_dp_rxdesc_get_mpdulen_err(rx_desc); -- first_mpdu = ath11k_dp_rx_h_attn_first_mpdu(rx_desc); -+ decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); -+ mpdu_len_err = !!ath11k_dp_rxdesc_get_mpdulen_err(rx_attention); -+ first_mpdu = ath11k_dp_rx_h_attn_first_mpdu(rx_attention); - } - -- ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rx_desc); -- l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rx_desc); -- is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -- enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); -- err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); -+ ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rx_attention); -+ l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rx_attention); -+ is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention); -+ enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); -+ err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention); - - if (rxcb->is_last_msdu) { -- msdu_done = ath11k_dp_rx_h_attn_msdu_done(rx_desc); -- l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); -+ msdu_done = ath11k_dp_rx_h_attn_msdu_done(rx_attention); -+ l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); - } - - ath11k_info(ar->ab, "first msdu %d last msdu %d msdu len %u decap format %u mpdu_len_err %d first_mpdu %d ip_csum_fail %d l4_csum_fail %d decrypte %d encryption type %u error bitmap %u msdu_done %d l2_hdr_offset %u\n", -@@ -1966,13 +1965,15 @@ static void ath11k_dp_dump_msdu_info(str - ath11k_info(ar->ab, "\n"); - } - --static void ath11k_dp_rx_h_csum_offload(struct sk_buff *msdu) -+static void ath11k_dp_rx_h_csum_offload(struct ath11k *ar, struct sk_buff *msdu) - { - struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); -+ struct rx_attention *rx_attention; - bool ip_csum_fail, l4_csum_fail; - -- ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rxcb->rx_desc); -- l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rxcb->rx_desc); -+ rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); -+ ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rx_attention); -+ l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rx_attention); - - msdu->ip_summed = (ip_csum_fail || l4_csum_fail) ? - CHECKSUM_NONE : CHECKSUM_UNNECESSARY; -@@ -2103,7 +2104,7 @@ static void ath11k_dp_rx_h_undecap_nwifi - - qos_ctl = rxcb->tid; - -- if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(rxcb->rx_desc)) -+ if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) - qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT; - - /* TODO Add other QoS ctl fields when required */ -@@ -2207,7 +2208,7 @@ static void *ath11k_dp_rx_h_find_rfc1042 - bool is_amsdu; - - is_amsdu = !(rxcb->is_first_msdu && rxcb->is_last_msdu); -- hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(rxcb->rx_desc); -+ hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); - rfc1042 = hdr; - - if (rxcb->is_first_msdu) { -@@ -2289,7 +2290,7 @@ static void ath11k_dp_rx_h_undecap_snap( - */ - - rx_desc = (void *)msdu->data - sizeof(*rx_desc); -- l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); -+ l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); - - skb_put(msdu, l3_pad_bytes); - skb_pull(msdu, sizeof(struct ath11k_dp_amsdu_subframe_hdr) + l3_pad_bytes); -@@ -2316,8 +2317,8 @@ static void ath11k_dp_rx_h_undecap(struc - u8 *first_hdr; - u8 decap; - -- first_hdr = ath11k_dp_rx_h_80211_hdr(rx_desc); -- decap = ath11k_dp_rx_h_msdu_start_decap_type(rx_desc); -+ first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); -+ decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); - - switch (decap) { - case DP_RX_DECAP_TYPE_NATIVE_WIFI: -@@ -2373,17 +2374,20 @@ static void ath11k_dp_rx_h_mpdu(struct a - struct ath11k_skb_rxcb *rxcb; - struct ieee80211_hdr *hdr; - struct ath11k_peer *peer; -+ struct rx_attention *rx_attention; - u32 err_bitmap; - - /* PN for multicast packets will be checked in mac80211 */ - rxcb = ATH11K_SKB_RXCB(msdu); -- rxcb->is_mcbc = fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(rx_desc); -+ rxcb->is_mcbc = fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); - - if (rxcb->is_mcbc) { -- rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(rx_desc); -- rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(rx_desc); -+ rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); -+ rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); - } - -+ rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); -+ - spin_lock_bh(&ar->ab->base_lock); - peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); - if (peer) { -@@ -2392,14 +2396,14 @@ static void ath11k_dp_rx_h_mpdu(struct a - else - enctype = peer->sec_type; - } else { -- enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); -+ enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); - } - spin_unlock_bh(&ar->ab->base_lock); - -- err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); -+ err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention); - - if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap) -- is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -+ is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention); - - /* Clear per-MPDU flags while leaving per-PPDU flags intact */ - rx_status->flag &= ~(RX_FLAG_FAILED_FCS_CRC | -@@ -2424,14 +2428,14 @@ static void ath11k_dp_rx_h_mpdu(struct a - RX_FLAG_PN_VALIDATED; - } - -- ath11k_dp_rx_h_csum_offload(msdu); -+ ath11k_dp_rx_h_csum_offload(ar, msdu); - ath11k_dp_rx_h_undecap(ar, msdu, rx_desc, - enctype, rx_status, is_decrypted); - - if (!is_decrypted || fill_crypto_hdr) - return; - -- if (ath11k_dp_rx_h_msdu_start_decap_type(rx_desc) != -+ if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != - DP_RX_DECAP_TYPE_ETHERNET2_DIX) { - hdr = (void *)msdu->data; - hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); -@@ -2448,11 +2452,11 @@ static void ath11k_dp_rx_h_rate(struct a - u8 sgi; - bool is_cck; - -- pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(rx_desc); -- bw = ath11k_dp_rx_h_msdu_start_rx_bw(rx_desc); -- rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(rx_desc); -- nss = ath11k_dp_rx_h_msdu_start_nss(rx_desc); -- sgi = ath11k_dp_rx_h_msdu_start_sgi(rx_desc); -+ pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); -+ bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); -+ rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); -+ nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); -+ sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); - - switch (pkt_type) { - case RX_MSDU_START_PKT_TYPE_11A: -@@ -2519,8 +2523,8 @@ static void ath11k_dp_rx_h_ppdu(struct a - - rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; - -- channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc); -- center_freq = ath11k_dp_rx_h_msdu_start_freq(rx_desc) >> 16; -+ channel_num = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); -+ center_freq = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc) >> 16; - - if (center_freq >= 5935 && center_freq <= 7105) { - rx_status->band = NL80211_BAND_6GHZ; -@@ -2569,7 +2573,7 @@ static void ath11k_dp_rx_deliver_msdu(st - } - - if (!(status->flag & RX_FLAG_ONLY_MONITOR)) -- decap = ath11k_dp_rx_h_msdu_start_decap_type(rxcb->rx_desc); -+ decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); - spin_lock_bh(&ar->ab->base_lock); - peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); - if (peer && peer->sta) -@@ -2577,12 +2581,12 @@ static void ath11k_dp_rx_deliver_msdu(st - spin_unlock_bh(&ar->ab->base_lock); - - ath11k_dbg(ar->ab, ATH11K_DBG_DATA, -- "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", -+ "rx skb %pK len %u peer %pM %hhu %s sn %u %s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", - msdu, - msdu->len, - peer ? peer->addr : NULL, - rxcb->tid, -- (rxcb->rx_desc->msdu_end.info2 & RX_MSDU_END_INFO2_DA_IS_MCBC) ? "mcast" : "ucast", -+ ar->ab->hw_params.hw_ops->rx_desc_get_da_mcbc(rxcb->rx_desc) ? "mcast" : "ucast", - rxcb->seq_no, - (status->encoding == RX_ENC_LEGACY) ? "legacy" : "", - (status->encoding == RX_ENC_HT) ? "ht" : "", -@@ -2623,17 +2627,20 @@ static int ath11k_dp_rx_process_msdu(str - struct sk_buff_head *msdu_list, - struct ieee80211_rx_status *rx_status) - { -+ struct ath11k_base *ab = ar->ab; - struct hal_rx_desc *rx_desc, *lrx_desc; -+ struct rx_attention *rx_attention; - struct ath11k_skb_rxcb *rxcb; - struct sk_buff *last_buf; - u8 l3_pad_bytes; - u8 *hdr_status; - u16 msdu_len; - int ret; -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - - last_buf = ath11k_dp_rx_get_msdu_last_buf(msdu_list, msdu); - if (!last_buf) { -- ath11k_warn(ar->ab, -+ ath11k_warn(ab, - "No valid Rx buffer to access Atten/MSDU_END/MPDU_END tlvs\n"); - ret = -EIO; - goto free_out; -@@ -2641,39 +2648,40 @@ static int ath11k_dp_rx_process_msdu(str - - rx_desc = (struct hal_rx_desc *)msdu->data; - lrx_desc = (struct hal_rx_desc *)last_buf->data; -- if (!ath11k_dp_rx_h_attn_msdu_done(lrx_desc)) { -- ath11k_warn(ar->ab, "msdu_done bit in attention is not set\n"); -+ rx_attention = ath11k_dp_rx_get_attention(ab, lrx_desc); -+ if (!ath11k_dp_rx_h_attn_msdu_done(rx_attention)) { -+ ath11k_warn(ab, "msdu_done bit in attention is not set\n"); - ret = -EIO; - goto free_out; - } - - rxcb = ATH11K_SKB_RXCB(msdu); - rxcb->rx_desc = rx_desc; -- msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); -- l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(lrx_desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); -+ l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ab, lrx_desc); - - if (rxcb->is_frag) { -- skb_pull(msdu, HAL_RX_DESC_SIZE); -+ skb_pull(msdu, hal_rx_desc_sz); - } else if (!rxcb->is_continuation) { -- if ((msdu_len + l3_pad_bytes + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { -- hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); -- ath11k_warn(ar->ab, "invalid msdu len %u\n", msdu_len); -- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, -+ if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { -+ hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); -+ ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); -+ ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, - sizeof(struct ieee80211_hdr)); -- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", -+ ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", - rxcb->rx_desc, - sizeof(struct hal_rx_desc)); - ath11k_dp_dump_msdu_info(ar, rxcb->rx_desc, rxcb); - goto free_out; - } -- skb_put(msdu, HAL_RX_DESC_SIZE + l3_pad_bytes + msdu_len); -- skb_pull(msdu, HAL_RX_DESC_SIZE + l3_pad_bytes); -+ skb_put(msdu, hal_rx_desc_sz + l3_pad_bytes + msdu_len); -+ skb_pull(msdu, hal_rx_desc_sz + l3_pad_bytes); - } else { - ret = ath11k_dp_rx_msdu_coalesce(ar, msdu_list, - msdu, last_buf, - l3_pad_bytes, msdu_len); - if (ret) { -- ath11k_warn(ar->ab, -+ ath11k_warn(ab, - "failed to coalesce msdu rx buffer%d\n", ret); - goto free_out; - } -@@ -3579,16 +3587,17 @@ static int ath11k_dp_rx_h_verify_tkip_mi - u8 mic[IEEE80211_CCMP_MIC_LEN]; - int head_len, tail_len, ret; - size_t data_len; -- u32 hdr_len; -+ u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - u8 *key, *data; - u8 key_idx; - -- if (ath11k_dp_rx_h_mpdu_start_enctype(rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) -+ if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != -+ HAL_ENCRYPT_TYPE_TKIP_MIC) - return 0; - -- hdr = (struct ieee80211_hdr *)(msdu->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); - hdr_len = ieee80211_hdrlen(hdr->frame_control); -- head_len = hdr_len + HAL_RX_DESC_SIZE + IEEE80211_TKIP_IV_LEN; -+ head_len = hdr_len + hal_rx_desc_sz + IEEE80211_TKIP_IV_LEN; - tail_len = IEEE80211_CCMP_MIC_LEN + IEEE80211_TKIP_ICV_LEN + FCS_LEN; - - if (!is_multicast_ether_addr(hdr->addr1)) -@@ -3614,7 +3623,7 @@ mic_fail: - - rxs->flag |= RX_FLAG_MMIC_ERROR | RX_FLAG_MMIC_STRIPPED | - RX_FLAG_IV_STRIPPED | RX_FLAG_DECRYPTED; -- skb_pull(msdu, HAL_RX_DESC_SIZE); -+ skb_pull(msdu, hal_rx_desc_sz); - - ath11k_dp_rx_h_ppdu(ar, rx_desc, rxs); - ath11k_dp_rx_h_undecap(ar, msdu, rx_desc, -@@ -3629,11 +3638,12 @@ static void ath11k_dp_rx_h_undecap_frag( - struct ieee80211_hdr *hdr; - size_t hdr_len; - size_t crypto_len; -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - - if (!flags) - return; - -- hdr = (struct ieee80211_hdr *)(msdu->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); - - if (flags & RX_FLAG_MIC_STRIPPED) - skb_trim(msdu, msdu->len - -@@ -3647,8 +3657,8 @@ static void ath11k_dp_rx_h_undecap_frag( - hdr_len = ieee80211_hdrlen(hdr->frame_control); - crypto_len = ath11k_dp_rx_crypto_param_len(ar, enctype); - -- memmove((void *)msdu->data + HAL_RX_DESC_SIZE + crypto_len, -- (void *)msdu->data + HAL_RX_DESC_SIZE, hdr_len); -+ memmove((void *)msdu->data + hal_rx_desc_sz + crypto_len, -+ (void *)msdu->data + hal_rx_desc_sz, hdr_len); - skb_pull(msdu, crypto_len); - } - } -@@ -3661,11 +3671,12 @@ static int ath11k_dp_rx_h_defrag(struct - struct hal_rx_desc *rx_desc; - struct sk_buff *skb, *first_frag, *last_frag; - struct ieee80211_hdr *hdr; -+ struct rx_attention *rx_attention; - enum hal_encrypt_type enctype; - bool is_decrypted = false; - int msdu_len = 0; - int extra_space; -- u32 flags; -+ u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - - first_frag = skb_peek(&rx_tid->rx_frags); - last_frag = skb_peek_tail(&rx_tid->rx_frags); -@@ -3673,11 +3684,13 @@ static int ath11k_dp_rx_h_defrag(struct - skb_queue_walk(&rx_tid->rx_frags, skb) { - flags = 0; - rx_desc = (struct hal_rx_desc *)skb->data; -- hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); - -- enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); -- if (enctype != HAL_ENCRYPT_TYPE_OPEN) -- is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); -+ enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); -+ if (enctype != HAL_ENCRYPT_TYPE_OPEN) { -+ rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); -+ is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention); -+ } - - if (is_decrypted) { - if (skb != first_frag) -@@ -3693,7 +3706,7 @@ static int ath11k_dp_rx_h_defrag(struct - ath11k_dp_rx_h_undecap_frag(ar, skb, enctype, flags); - - if (skb != first_frag) -- skb_pull(skb, HAL_RX_DESC_SIZE + -+ skb_pull(skb, hal_rx_desc_sz + - ieee80211_hdrlen(hdr->frame_control)); - msdu_len += skb->len; - } -@@ -3709,7 +3722,7 @@ static int ath11k_dp_rx_h_defrag(struct - dev_kfree_skb_any(skb); - } - -- hdr = (struct ieee80211_hdr *)(first_frag->data + HAL_RX_DESC_SIZE); -+ hdr = (struct ieee80211_hdr *)(first_frag->data + hal_rx_desc_sz); - hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); - ATH11K_SKB_RXCB(first_frag)->is_frag = 1; - -@@ -3735,10 +3748,10 @@ static int ath11k_dp_rx_h_defrag_reo_rei - struct hal_srng *srng; - dma_addr_t paddr; - u32 desc_bank, msdu_info, mpdu_info; -- u32 dst_idx, cookie; -- u32 *msdu_len_offset; -+ u32 dst_idx, cookie, hal_rx_desc_sz; - int ret, buf_id; - -+ hal_rx_desc_sz = ab->hw_params.hal_desc_sz; - link_desc_banks = ab->dp.link_desc_banks; - reo_dest_ring = rx_tid->dst_ring_desc; - -@@ -3753,16 +3766,14 @@ static int ath11k_dp_rx_h_defrag_reo_rei - FIELD_PREP(RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU, 1) | - FIELD_PREP(RX_MSDU_DESC_INFO0_MSDU_CONTINUATION, 0) | - FIELD_PREP(RX_MSDU_DESC_INFO0_MSDU_LENGTH, -- defrag_skb->len - HAL_RX_DESC_SIZE) | -+ defrag_skb->len - hal_rx_desc_sz) | - FIELD_PREP(RX_MSDU_DESC_INFO0_REO_DEST_IND, dst_idx) | - FIELD_PREP(RX_MSDU_DESC_INFO0_VALID_SA, 1) | - FIELD_PREP(RX_MSDU_DESC_INFO0_VALID_DA, 1); - msdu0->rx_msdu_info.info0 = msdu_info; - - /* change msdu len in hal rx desc */ -- msdu_len_offset = (u32 *)&rx_desc->msdu_start; -- *msdu_len_offset &= ~(RX_MSDU_START_INFO1_MSDU_LENGTH); -- *msdu_len_offset |= defrag_skb->len - HAL_RX_DESC_SIZE; -+ ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); - - paddr = dma_map_single(ab->dev, defrag_skb->data, - defrag_skb->len + skb_tailroom(defrag_skb), -@@ -3835,24 +3846,26 @@ err_unmap_dma: - return ret; - } - --static int ath11k_dp_rx_h_cmp_frags(struct sk_buff *a, struct sk_buff *b) -+static int ath11k_dp_rx_h_cmp_frags(struct ath11k *ar, -+ struct sk_buff *a, struct sk_buff *b) - { - int frag1, frag2; - -- frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(a); -- frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(b); -+ frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); -+ frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); - - return frag1 - frag2; - } - --static void ath11k_dp_rx_h_sort_frags(struct sk_buff_head *frag_list, -+static void ath11k_dp_rx_h_sort_frags(struct ath11k *ar, -+ struct sk_buff_head *frag_list, - struct sk_buff *cur_frag) - { - struct sk_buff *skb; - int cmp; - - skb_queue_walk(frag_list, skb) { -- cmp = ath11k_dp_rx_h_cmp_frags(skb, cur_frag); -+ cmp = ath11k_dp_rx_h_cmp_frags(ar, skb, cur_frag); - if (cmp < 0) - continue; - __skb_queue_before(frag_list, skb, cur_frag); -@@ -3861,14 +3874,15 @@ static void ath11k_dp_rx_h_sort_frags(st - __skb_queue_tail(frag_list, cur_frag); - } - --static u64 ath11k_dp_rx_h_get_pn(struct sk_buff *skb) -+static u64 ath11k_dp_rx_h_get_pn(struct ath11k *ar, struct sk_buff *skb) - { - struct ieee80211_hdr *hdr; - u64 pn = 0; - u8 *ehdr; -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - -- hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); -- ehdr = skb->data + HAL_RX_DESC_SIZE + ieee80211_hdrlen(hdr->frame_control); -+ hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); -+ ehdr = skb->data + hal_rx_desc_sz + ieee80211_hdrlen(hdr->frame_control); - - pn = ehdr[0]; - pn |= (u64)ehdr[1] << 8; -@@ -3892,19 +3906,19 @@ ath11k_dp_rx_h_defrag_validate_incr_pn(s - first_frag = skb_peek(&rx_tid->rx_frags); - desc = (struct hal_rx_desc *)first_frag->data; - -- encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(desc); -+ encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); - if (encrypt_type != HAL_ENCRYPT_TYPE_CCMP_128 && - encrypt_type != HAL_ENCRYPT_TYPE_CCMP_256 && - encrypt_type != HAL_ENCRYPT_TYPE_GCMP_128 && - encrypt_type != HAL_ENCRYPT_TYPE_AES_GCMP_256) - return true; - -- last_pn = ath11k_dp_rx_h_get_pn(first_frag); -+ last_pn = ath11k_dp_rx_h_get_pn(ar, first_frag); - skb_queue_walk(&rx_tid->rx_frags, skb) { - if (skb == first_frag) - continue; - -- cur_pn = ath11k_dp_rx_h_get_pn(skb); -+ cur_pn = ath11k_dp_rx_h_get_pn(ar, skb); - if (cur_pn != last_pn + 1) - return false; - last_pn = cur_pn; -@@ -3928,14 +3942,14 @@ static int ath11k_dp_rx_frag_h_mpdu(stru - bool more_frags; - - rx_desc = (struct hal_rx_desc *)msdu->data; -- peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(rx_desc); -- tid = ath11k_dp_rx_h_mpdu_start_tid(rx_desc); -- seqno = ath11k_dp_rx_h_mpdu_start_seq_no(rx_desc); -- frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(msdu); -- more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(msdu); -+ peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); -+ tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); -+ seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); -+ frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); -+ more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); - -- if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(rx_desc) || -- !ath11k_dp_rx_h_mpdu_start_fc_valid(rx_desc) || -+ if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || -+ !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || - tid > IEEE80211_NUM_TIDS) - return -EINVAL; - -@@ -3973,7 +3987,7 @@ static int ath11k_dp_rx_frag_h_mpdu(stru - if (frag_no > __fls(rx_tid->rx_frag_bitmap)) - __skb_queue_tail(&rx_tid->rx_frags, msdu); - else -- ath11k_dp_rx_h_sort_frags(&rx_tid->rx_frags, msdu); -+ ath11k_dp_rx_h_sort_frags(ar, &rx_tid->rx_frags, msdu); - - rx_tid->rx_frag_bitmap |= BIT(frag_no); - if (!more_frags) -@@ -4040,6 +4054,7 @@ ath11k_dp_process_rx_err_buf(struct ath1 - struct hal_rx_desc *rx_desc; - u8 *hdr_status; - u16 msdu_len; -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - - spin_lock_bh(&rx_ring->idr_lock); - msdu = idr_find(&rx_ring->bufs_idr, buf_id); -@@ -4075,9 +4090,9 @@ ath11k_dp_process_rx_err_buf(struct ath1 - } - - rx_desc = (struct hal_rx_desc *)msdu->data; -- msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); -- if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { -- hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); -+ if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { -+ hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); - ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); - ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, - sizeof(struct ieee80211_hdr)); -@@ -4088,7 +4103,7 @@ ath11k_dp_process_rx_err_buf(struct ath1 - goto exit; - } - -- skb_put(msdu, HAL_RX_DESC_SIZE + msdu_len); -+ skb_put(msdu, hal_rx_desc_sz + msdu_len); - - if (ath11k_dp_rx_frag_h_mpdu(ar, msdu, ring_desc)) { - dev_kfree_skb_any(msdu); -@@ -4222,7 +4237,7 @@ static void ath11k_dp_rx_null_q_desc_sg_ - int n_buffs; - - n_buffs = DIV_ROUND_UP(msdu_len, -- (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE)); -+ (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); - - skb_queue_walk_safe(msdu_list, skb, tmp) { - rxcb = ATH11K_SKB_RXCB(skb); -@@ -4243,19 +4258,22 @@ static int ath11k_dp_rx_h_null_q_desc(st - { - u16 msdu_len; - struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; -+ struct rx_attention *rx_attention; - u8 l3pad_bytes; - struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - -- msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); - -- if (!rxcb->is_frag && ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE)) { -+ if (!rxcb->is_frag && ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE)) { - /* First buffer will be freed by the caller, so deduct it's length */ -- msdu_len = msdu_len - (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE); -+ msdu_len = msdu_len - (DP_RX_BUFFER_SIZE - hal_rx_desc_sz); - ath11k_dp_rx_null_q_desc_sg_drop(ar, msdu_len, msdu_list); - return -EINVAL; - } - -- if (!ath11k_dp_rx_h_attn_msdu_done(desc)) { -+ rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); -+ if (!ath11k_dp_rx_h_attn_msdu_done(rx_attention)) { - ath11k_warn(ar->ab, - "msdu_done bit not set in null_q_des processing\n"); - __skb_queue_purge(msdu_list); -@@ -4271,25 +4289,25 @@ static int ath11k_dp_rx_h_null_q_desc(st - * This error can show up both in a REO destination or WBM release ring. - */ - -- rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(desc); -- rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(desc); -+ rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); -+ rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); - - if (rxcb->is_frag) { -- skb_pull(msdu, HAL_RX_DESC_SIZE); -+ skb_pull(msdu, hal_rx_desc_sz); - } else { -- l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(desc); -+ l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); - -- if ((HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len) > DP_RX_BUFFER_SIZE) -+ if ((hal_rx_desc_sz + l3pad_bytes + msdu_len) > DP_RX_BUFFER_SIZE) - return -EINVAL; - -- skb_put(msdu, HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); -- skb_pull(msdu, HAL_RX_DESC_SIZE + l3pad_bytes); -+ skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); -+ skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); - } - ath11k_dp_rx_h_ppdu(ar, desc, status); - - ath11k_dp_rx_h_mpdu(ar, msdu, desc, status); - -- rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(desc); -+ rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); - - /* Please note that caller will having the access to msdu and completing - * rx with mac80211. Need not worry about cleaning up amsdu_list. -@@ -4336,14 +4354,15 @@ static void ath11k_dp_rx_h_tkip_mic_err( - struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; - u8 l3pad_bytes; - struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); -+ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; - -- rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(desc); -- rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(desc); -+ rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); -+ rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); - -- l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(desc); -- msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(desc); -- skb_put(msdu, HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); -- skb_pull(msdu, HAL_RX_DESC_SIZE + l3pad_bytes); -+ l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); -+ msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); -+ skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); -+ skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); - - ath11k_dp_rx_h_ppdu(ar, desc, status); - -@@ -5065,10 +5084,10 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k - rx_desc = (struct hal_rx_desc *)msdu->data; - - rx_pkt_offset = sizeof(struct hal_rx_desc); -- l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); -+ l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); - - if (is_first_msdu) { -- if (!ath11k_dp_rxdesc_mpdu_valid(rx_desc)) { -+ if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { - drop_mpdu = true; - dev_kfree_skb_any(msdu); - msdu = NULL; -@@ -5077,7 +5096,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k - } - - msdu_ppdu_id = -- ath11k_dp_rxdesc_get_ppduid(rx_desc); -+ ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); - - if (ath11k_dp_rx_mon_comp_ppduid(msdu_ppdu_id, - ppdu_id, -@@ -5139,12 +5158,13 @@ next_msdu: - return rx_bufs_used; - } - --static void ath11k_dp_rx_msdus_set_payload(struct sk_buff *msdu) -+static void ath11k_dp_rx_msdus_set_payload(struct ath11k *ar, struct sk_buff *msdu) - { - u32 rx_pkt_offset, l2_hdr_offset; - -- rx_pkt_offset = sizeof(struct hal_rx_desc); -- l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad((struct hal_rx_desc *)msdu->data); -+ rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; -+ l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, -+ (struct hal_rx_desc *)msdu->data); - skb_pull(msdu, rx_pkt_offset + l2_hdr_offset); - } - -@@ -5154,12 +5174,13 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - struct sk_buff *last_msdu, - struct ieee80211_rx_status *rxs) - { -+ struct ath11k_base *ab = ar->ab; - struct sk_buff *msdu, *mpdu_buf, *prev_buf; -- u32 decap_format; - struct hal_rx_desc *rx_desc; - char *hdr_desc; -- u8 *dest; -+ u8 *dest, decap_format; - struct ieee80211_hdr_3addr *wh; -+ struct rx_attention *rx_attention; - - static u32 pkt_type = 0; - -@@ -5171,22 +5192,23 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - goto err_merge_fail; - - rx_desc = (struct hal_rx_desc *)head_msdu->data; -+ rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); - -- if (ath11k_dp_rxdesc_get_mpdulen_err(rx_desc)) -+ if (ath11k_dp_rxdesc_get_mpdulen_err(rx_attention)) - return NULL; - -- decap_format = ath11k_dp_rxdesc_get_decap_format(rx_desc); -+ decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ab, rx_desc); - - ath11k_dp_rx_h_ppdu(ar, rx_desc, rxs); - - if (decap_format == DP_RX_DECAP_TYPE_RAW) { -- ath11k_dp_rx_msdus_set_payload(head_msdu); -+ ath11k_dp_rx_msdus_set_payload(ar, head_msdu); - - prev_buf = head_msdu; - msdu = head_msdu->next; - - while (msdu) { -- ath11k_dp_rx_msdus_set_payload(msdu); -+ ath11k_dp_rx_msdus_set_payload(ar, msdu); - - prev_buf = msdu; - msdu = msdu->next; -@@ -5199,7 +5221,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - u8 qos_pkt = 0; - - rx_desc = (struct hal_rx_desc *)head_msdu->data; -- hdr_desc = ath11k_dp_rxdesc_get_80211hdr(rx_desc); -+ hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); - - /* Base size */ - wh = (struct ieee80211_hdr_3addr *)hdr_desc; -@@ -5210,7 +5232,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - msdu = head_msdu; - - while (msdu) { -- ath11k_dp_rx_msdus_set_payload(msdu); -+ ath11k_dp_rx_msdus_set_payload(ar, msdu); - if (qos_pkt) { - dest = skb_push(msdu, sizeof(__le16)); - if (!dest) -@@ -5224,11 +5246,11 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - if (!dest) - goto err_merge_fail; - -- ath11k_dbg(ar->ab, ATH11K_DBG_DATA, -+ ath11k_dbg(ab, ATH11K_DBG_DATA, - "mpdu_buf %pK mpdu_buf->len %u", - prev_buf, prev_buf->len); - } else { -- ath11k_dbg(ar->ab, ATH11K_DBG_DATA, -+ ath11k_dbg(ab, ATH11K_DBG_DATA, - "decap format %d is not supported!\n", - decap_format); - goto err_merge_fail; -@@ -5238,7 +5260,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 - - err_merge_fail: - if (mpdu_buf && decap_format != DP_RX_DECAP_TYPE_RAW) { -- ath11k_dbg(ar->ab, ATH11K_DBG_DATA, -+ ath11k_dbg(ab, ATH11K_DBG_DATA, - "err_merge_fail mpdu_buf %pK", mpdu_buf); - /* Free the head buffer */ - dev_kfree_skb_any(mpdu_buf); ---- a/drivers/net/wireless/ath/ath11k/hal.h -+++ b/drivers/net/wireless/ath/ath11k/hal.h -@@ -303,8 +303,6 @@ struct ath11k_base; - #define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff - #define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff - --#define HAL_RX_DESC_SIZE (sizeof(struct hal_rx_desc)) -- - /* Add any other errors here and return them in - * ath11k_hal_rx_desc_get_err(). - */ ---- a/drivers/net/wireless/ath/ath11k/hal_tx.c -+++ b/drivers/net/wireless/ath/ath11k/hal_tx.c -@@ -74,7 +74,7 @@ void ath11k_hal_tx_cmd_desc_setup(struct - ti->bss_ast_hash); - tcl_cmd->info4 = 0; - -- if (ti->enable_mesh && ab->hw_params.hw_ops->tx_mesh_enable) -+ if (ti->enable_mesh) - ab->hw_params.hw_ops->tx_mesh_enable(ab, tcl_cmd); - } - ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -183,6 +183,326 @@ static u8* ath11k_hw_ipq8074_rx_desc_mpd - return desc->u.ipq8074.mpdu_start.addr2; - } - -+static bool ath11k_hw_ipq8074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, -+ __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); -+} -+ -+static bool ath11k_hw_ipq8074_rx_desc_get_last_msdu(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, -+ __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, -+ __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); -+} -+ -+static u8 *ath11k_hw_ipq8074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) -+{ -+ return desc->u.ipq8074.hdr_status; -+} -+ -+static bool ath11k_hw_ipq8074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) -+{ -+ return __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & -+ RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID; -+} -+ -+static u32 ath11k_hw_ipq8074_rx_desc_get_encrypt_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info2)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_decap_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_mesh_ctl(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); -+} -+ -+static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); -+} -+ -+static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_FCTRL_VALID, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); -+} -+ -+static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_NUM, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); -+} -+ -+static u16 ath11k_hw_ipq8074_rx_desc_get_msdu_len(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info1)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_sgi(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_SGI, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); -+} -+ -+static u32 ath11k_hw_ipq8074_rx_desc_get_msdu_freq(struct hal_rx_desc *desc) -+{ -+ return __le32_to_cpu(desc->u.ipq8074.msdu_start.phy_meta_data); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_nss(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, -+ __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_ipq8074_rx_desc_get_mpdu_tid(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO2_TID, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info2)); -+} -+ -+static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id(struct hal_rx_desc *desc) -+{ -+ return __le16_to_cpu(desc->u.ipq8074.mpdu_start.sw_peer_id); -+} -+ -+static void ath11k_hw_ipq8074_rx_desc_copy_attn_end(struct hal_rx_desc *fdesc, -+ struct hal_rx_desc *ldesc) -+{ -+ memcpy((u8 *)&fdesc->u.ipq8074.msdu_end, (u8 *)&ldesc->u.ipq8074.msdu_end, -+ sizeof(struct rx_msdu_end_ipq8074)); -+ memcpy((u8 *)&fdesc->u.ipq8074.attention, (u8 *)&ldesc->u.ipq8074.attention, -+ sizeof(struct rx_attention)); -+ memcpy((u8 *)&fdesc->u.ipq8074.mpdu_end, (u8 *)&ldesc->u.ipq8074.mpdu_end, -+ sizeof(struct rx_mpdu_end)); -+} -+ -+static u32 ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(HAL_TLV_HDR_TAG, -+ __le32_to_cpu(desc->u.ipq8074.mpdu_start_tag)); -+} -+ -+static u32 ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id(struct hal_rx_desc *desc) -+{ -+ return __le16_to_cpu(desc->u.ipq8074.mpdu_start.phy_ppdu_id); -+} -+ -+static void ath11k_hw_ipq8074_rx_desc_set_msdu_len(struct hal_rx_desc *desc, u16 len) -+{ -+ u32 info = __le32_to_cpu(desc->u.ipq8074.msdu_start.info1); -+ -+ info &= ~RX_MSDU_START_INFO1_MSDU_LENGTH; -+ info |= FIELD_PREP(RX_MSDU_START_INFO1_MSDU_LENGTH, len); -+ -+ desc->u.ipq8074.msdu_start.info1 = __cpu_to_le32(info); -+} -+ -+static -+struct rx_attention *ath11k_hw_ipq8074_rx_desc_get_attention(struct hal_rx_desc *desc) -+{ -+ return &desc->u.ipq8074.attention; -+} -+ -+static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) -+{ -+ return &desc->u.ipq8074.msdu_payload[0]; -+} -+ -+static bool ath11k_hw_qcn9000_rx_desc_get_first_msdu(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MSDU_END_INFO4_FIRST_MSDU, -+ __le16_to_cpu(desc->u.qcn9000.msdu_end.info4)); -+} -+ -+static bool ath11k_hw_qcn9000_rx_desc_get_last_msdu(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MSDU_END_INFO4_LAST_MSDU, -+ __le16_to_cpu(desc->u.qcn9000.msdu_end.info4)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_l3_pad_bytes(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_END_INFO4_L3_HDR_PADDING, -+ __le16_to_cpu(desc->u.qcn9000.msdu_end.info4)); -+} -+ -+static u8 *ath11k_hw_qcn9000_rx_desc_get_hdr_status(struct hal_rx_desc *desc) -+{ -+ return desc->u.qcn9000.hdr_status; -+} -+ -+static bool ath11k_hw_qcn9000_rx_desc_encrypt_valid(struct hal_rx_desc *desc) -+{ -+ return __le32_to_cpu(desc->u.qcn9000.mpdu_start.info11) & -+ RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID; -+} -+ -+static u32 ath11k_hw_qcn9000_rx_desc_get_encrypt_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO9_ENC_TYPE, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start.info9)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_decap_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info2)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_mesh_ctl(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info2)); -+} -+ -+static bool ath11k_hw_qcn9000_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start.info11)); -+} -+ -+static bool ath11k_hw_qcn9000_rx_desc_get_mpdu_fc_valid(struct hal_rx_desc *desc) -+{ -+ return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_FCTRL_VALID, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start.info11)); -+} -+ -+static u16 ath11k_hw_qcn9000_rx_desc_get_mpdu_start_seq_no(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_NUM, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start.info11)); -+} -+ -+static u16 ath11k_hw_qcn9000_rx_desc_get_msdu_len(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info1)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_msdu_sgi(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_SGI, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_msdu_rate_mcs(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_msdu_rx_bw(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info3)); -+} -+ -+static u32 ath11k_hw_qcn9000_rx_desc_get_msdu_freq(struct hal_rx_desc *desc) -+{ -+ return __le32_to_cpu(desc->u.qcn9000.msdu_start.phy_meta_data); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_msdu_pkt_type(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_msdu_nss(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, -+ __le32_to_cpu(desc->u.qcn9000.msdu_start.info3)); -+} -+ -+static u8 ath11k_hw_qcn9000_rx_desc_get_mpdu_tid(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(RX_MPDU_START_INFO9_TID, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start.info9)); -+} -+ -+static u16 ath11k_hw_qcn9000_rx_desc_get_mpdu_peer_id(struct hal_rx_desc *desc) -+{ -+ return __le16_to_cpu(desc->u.qcn9000.mpdu_start.sw_peer_id); -+} -+ -+static void ath11k_hw_qcn9000_rx_desc_copy_attn_end(struct hal_rx_desc *fdesc, -+ struct hal_rx_desc *ldesc) -+{ -+ memcpy((u8 *)&fdesc->u.qcn9000.msdu_end, (u8 *)&ldesc->u.qcn9000.msdu_end, -+ sizeof(struct rx_msdu_end_qcn9000)); -+ memcpy((u8 *)&fdesc->u.qcn9000.attention, (u8 *)&ldesc->u.qcn9000.attention, -+ sizeof(struct rx_attention)); -+ memcpy((u8 *)&fdesc->u.qcn9000.mpdu_end, (u8 *)&ldesc->u.qcn9000.mpdu_end, -+ sizeof(struct rx_mpdu_end)); -+} -+ -+static u32 ath11k_hw_qcn9000_rx_desc_get_mpdu_start_tag(struct hal_rx_desc *desc) -+{ -+ return FIELD_GET(HAL_TLV_HDR_TAG, -+ __le32_to_cpu(desc->u.qcn9000.mpdu_start_tag)); -+} -+ -+static u32 ath11k_hw_qcn9000_rx_desc_get_mpdu_ppdu_id(struct hal_rx_desc *desc) -+{ -+ return __le16_to_cpu(desc->u.qcn9000.mpdu_start.phy_ppdu_id); -+} -+ -+static void ath11k_hw_qcn9000_rx_desc_set_msdu_len(struct hal_rx_desc *desc, u16 len) -+{ -+ u32 info = __le32_to_cpu(desc->u.qcn9000.msdu_start.info1); -+ -+ info &= ~RX_MSDU_START_INFO1_MSDU_LENGTH; -+ info |= FIELD_PREP(RX_MSDU_START_INFO1_MSDU_LENGTH, len); -+ -+ desc->u.qcn9000.msdu_start.info1 = __cpu_to_le32(info); -+} -+ -+static -+struct rx_attention *ath11k_hw_qcn9000_rx_desc_get_attention(struct hal_rx_desc *desc) -+{ -+ return &desc->u.qcn9000.attention; -+} -+ -+static u8 *ath11k_hw_qcn9000_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) -+{ -+ return &desc->u.qcn9000.msdu_payload[0]; -+} -+ - const struct ath11k_hw_ops ipq8074_ops = { - .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, - .wmi_init_config = ath11k_init_wmi_config_qca6390, -@@ -192,6 +512,31 @@ const struct ath11k_hw_ops ipq8074_ops = - .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, - .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, -+ .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, -+ .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, -+ .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, -+ .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, -+ .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, -+ .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, -+ .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, -+ .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, -+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, -+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, -+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, -+ .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, -+ .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, -+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, -+ .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, -+ .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, -+ .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, -+ .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, -+ .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, -+ .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, -+ .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, -+ .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, -+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, -+ .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, -+ .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - }; - - const struct ath11k_hw_ops ipq6018_ops = { -@@ -203,6 +548,32 @@ const struct ath11k_hw_ops ipq6018_ops = - .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, - .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, -+ .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, -+ .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, -+ .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, -+ .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, -+ .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, -+ .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, -+ .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, -+ .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, -+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, -+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, -+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, -+ .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, -+ .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, -+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, -+ .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, -+ .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, -+ .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, -+ .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, -+ .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, -+ .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, -+ .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, -+ .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, -+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, -+ .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, -+ .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, -+ .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - }; - - const struct ath11k_hw_ops qca6390_ops = { -@@ -216,6 +587,32 @@ const struct ath11k_hw_ops qca6390_ops = - .rx_desc_mpdu_start_addr2, - */ - .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, -+ .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, -+ .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, -+ .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, -+ .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, -+ .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, -+ .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, -+ .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, -+ .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, -+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, -+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, -+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, -+ .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, -+ .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, -+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, -+ .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, -+ .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, -+ .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, -+ .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, -+ .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, -+ .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, -+ .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, -+ .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, -+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, -+ .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, -+ .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, -+ .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - }; - - const struct ath11k_hw_ops qcn9000_ops = { -@@ -227,6 +624,32 @@ const struct ath11k_hw_ops qcn9000_ops = - .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, - .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, - .tx_mesh_enable = ath11k_hw_qcn9000_tx_mesh_enable, -+ .rx_desc_get_first_msdu = ath11k_hw_qcn9000_rx_desc_get_first_msdu, -+ .rx_desc_get_last_msdu = ath11k_hw_qcn9000_rx_desc_get_last_msdu, -+ .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9000_rx_desc_get_l3_pad_bytes, -+ .rx_desc_get_hdr_status = ath11k_hw_qcn9000_rx_desc_get_hdr_status, -+ .rx_desc_encrypt_valid = ath11k_hw_qcn9000_rx_desc_encrypt_valid, -+ .rx_desc_get_encrypt_type = ath11k_hw_qcn9000_rx_desc_get_encrypt_type, -+ .rx_desc_get_decap_type = ath11k_hw_qcn9000_rx_desc_get_decap_type, -+ .rx_desc_get_mesh_ctl = ath11k_hw_qcn9000_rx_desc_get_mesh_ctl, -+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9000_rx_desc_get_mpdu_seq_ctl_vld, -+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9000_rx_desc_get_mpdu_fc_valid, -+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9000_rx_desc_get_mpdu_start_seq_no, -+ .rx_desc_get_msdu_len = ath11k_hw_qcn9000_rx_desc_get_msdu_len, -+ .rx_desc_get_msdu_sgi = ath11k_hw_qcn9000_rx_desc_get_msdu_sgi, -+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9000_rx_desc_get_msdu_rate_mcs, -+ .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9000_rx_desc_get_msdu_rx_bw, -+ .rx_desc_get_msdu_freq = ath11k_hw_qcn9000_rx_desc_get_msdu_freq, -+ .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9000_rx_desc_get_msdu_pkt_type, -+ .rx_desc_get_msdu_nss = ath11k_hw_qcn9000_rx_desc_get_msdu_nss, -+ .rx_desc_get_mpdu_tid = ath11k_hw_qcn9000_rx_desc_get_mpdu_tid, -+ .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9000_rx_desc_get_mpdu_peer_id, -+ .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9000_rx_desc_copy_attn_end, -+ .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9000_rx_desc_get_mpdu_start_tag, -+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9000_rx_desc_get_mpdu_ppdu_id, -+ .rx_desc_set_msdu_len = ath11k_hw_qcn9000_rx_desc_set_msdu_len, -+ .rx_desc_get_attention = ath11k_hw_qcn9000_rx_desc_get_attention, -+ .rx_desc_get_msdu_payload = ath11k_hw_qcn9000_rx_desc_get_msdu_payload, - }; - - #define ATH11K_TX_RING_MASK_0 0x1 ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -105,6 +105,7 @@ enum ath11k_bus { - - #define ATH11K_EXT_IRQ_GRP_NUM_MAX 11 - -+struct hal_rx_desc; - struct hal_tcl_data_cmd; - - struct ath11k_hw_ring_mask { -@@ -160,6 +161,7 @@ struct ath11k_hw_params { - bool vdev_start_delay; - bool htt_peer_map_v2; - bool tcl_0_only; -+ u32 hal_desc_sz; - }; - - struct ath11k_hw_ops { -@@ -173,6 +175,33 @@ struct ath11k_hw_ops { - u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); - void (*tx_mesh_enable)(struct ath11k_base *ab, - struct hal_tcl_data_cmd *tcl_cmd); -+ bool (*rx_desc_get_first_msdu)(struct hal_rx_desc *desc); -+ bool (*rx_desc_get_last_msdu)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc); -+ u8 *(*rx_desc_get_hdr_status)(struct hal_rx_desc *desc); -+ bool (*rx_desc_encrypt_valid)(struct hal_rx_desc *desc); -+ u32 (*rx_desc_get_encrypt_type)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_decap_type)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_mesh_ctl)(struct hal_rx_desc *desc); -+ bool (*rx_desc_get_mpdu_seq_ctl_vld)(struct hal_rx_desc *desc); -+ bool (*rx_desc_get_mpdu_fc_valid)(struct hal_rx_desc *desc); -+ u16 (*rx_desc_get_mpdu_start_seq_no)(struct hal_rx_desc *desc); -+ u16 (*rx_desc_get_msdu_len)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_msdu_sgi)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_msdu_rate_mcs)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_msdu_rx_bw)(struct hal_rx_desc *desc); -+ u32 (*rx_desc_get_msdu_freq)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_msdu_pkt_type)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_msdu_nss)(struct hal_rx_desc *desc); -+ u8 (*rx_desc_get_mpdu_tid)(struct hal_rx_desc *desc); -+ u16 (*rx_desc_get_mpdu_peer_id)(struct hal_rx_desc *desc); -+ void (*rx_desc_copy_attn_end_tlv)(struct hal_rx_desc *fdesc, -+ struct hal_rx_desc *ldesc); -+ u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc); -+ u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc); -+ void (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len); -+ struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc); -+ u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc); - }; - - extern const struct ath11k_hw_ops ipq8074_ops; ---- a/drivers/net/wireless/ath/ath11k/rx_desc.h -+++ b/drivers/net/wireless/ath/ath11k/rx_desc.h -@@ -414,7 +414,7 @@ struct rx_attention { - - #define RX_MPDU_START_RAW_MPDU BIT(0) - --struct rx_mpdu_start { -+struct rx_mpdu_start_ipq8074 { - __le16 info0; - __le16 phy_ppdu_id; - __le16 ast_index; -@@ -440,6 +440,112 @@ struct rx_mpdu_start { - __le32 raw; - } __packed; - -+#define RX_MPDU_START_INFO7_REO_DEST_IND GENMASK(4, 0) -+#define RX_MPDU_START_INFO7_LMAC_PEER_ID_MSB GENMASK(6, 5) -+#define RX_MPDU_START_INFO7_FLOW_ID_TOEPLITZ BIT(7) -+#define RX_MPDU_START_INFO7_PKT_SEL_FP_UCAST_DATA BIT(8) -+#define RX_MPDU_START_INFO7_PKT_SEL_FP_MCAST_DATA BIT(9) -+#define RX_MPDU_START_INFO7_PKT_SEL_FP_CTRL_BAR BIT(10) -+#define RX_MPDU_START_INFO7_RXDMA0_SRC_RING_SEL GENMASK(12, 11) -+#define RX_MPDU_START_INFO7_RXDMA0_DST_RING_SEL GENMASK(14, 13) -+ -+#define RX_MPDU_START_INFO8_REO_QUEUE_DESC_HI GENMASK(7, 0) -+#define RX_MPDU_START_INFO8_RECV_QUEUE_NUM GENMASK(23, 8) -+#define RX_MPDU_START_INFO8_PRE_DELIM_ERR_WARN BIT(24) -+#define RX_MPDU_START_INFO8_FIRST_DELIM_ERR BIT(25) -+ -+#define RX_MPDU_START_INFO9_EPD_EN BIT(0) -+#define RX_MPDU_START_INFO9_ALL_FRAME_ENCPD BIT(1) -+#define RX_MPDU_START_INFO9_ENC_TYPE GENMASK(5, 2) -+#define RX_MPDU_START_INFO9_VAR_WEP_KEY_WIDTH GENMASK(7, 6) -+#define RX_MPDU_START_INFO9_MESH_STA GENMASK(9, 8) -+#define RX_MPDU_START_INFO9_BSSID_HIT BIT(10) -+#define RX_MPDU_START_INFO9_BSSID_NUM GENMASK(14, 11) -+#define RX_MPDU_START_INFO9_TID GENMASK(18, 15) -+ -+#define RX_MPDU_START_INFO10_RXPCU_MPDU_FLTR GENMASK(1, 0) -+#define RX_MPDU_START_INFO10_SW_FRAME_GRP_ID GENMASK(8, 2) -+#define RX_MPDU_START_INFO10_NDP_FRAME BIT(9) -+#define RX_MPDU_START_INFO10_PHY_ERR BIT(10) -+#define RX_MPDU_START_INFO10_PHY_ERR_MPDU_HDR BIT(11) -+#define RX_MPDU_START_INFO10_PROTO_VER_ERR BIT(12) -+#define RX_MPDU_START_INFO10_AST_LOOKUP_VALID BIT(13) -+ -+#define RX_MPDU_START_INFO11_MPDU_FCTRL_VALID BIT(0) -+#define RX_MPDU_START_INFO11_MPDU_DUR_VALID BIT(1) -+#define RX_MPDU_START_INFO11_MAC_ADDR1_VALID BIT(2) -+#define RX_MPDU_START_INFO11_MAC_ADDR2_VALID BIT(3) -+#define RX_MPDU_START_INFO11_MAC_ADDR3_VALID BIT(4) -+#define RX_MPDU_START_INFO11_MAC_ADDR4_VALID BIT(5) -+#define RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID BIT(6) -+#define RX_MPDU_START_INFO11_MPDU_QOS_CTRL_VALID BIT(7) -+#define RX_MPDU_START_INFO11_MPDU_HT_CTRL_VALID BIT(8) -+#define RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID BIT(9) -+#define RX_MPDU_START_INFO11_MPDU_FRAG_NUMBER GENMASK(13, 10) -+#define RX_MPDU_START_INFO11_MORE_FRAG_FLAG BIT(14) -+#define RX_MPDU_START_INFO11_FROM_DS BIT(16) -+#define RX_MPDU_START_INFO11_TO_DS BIT(17) -+#define RX_MPDU_START_INFO11_ENCRYPTED BIT(18) -+#define RX_MPDU_START_INFO11_MPDU_RETRY BIT(19) -+#define RX_MPDU_START_INFO11_MPDU_SEQ_NUM GENMASK(31, 20) -+ -+#define RX_MPDU_START_INFO12_KEY_ID GENMASK(7, 0) -+#define RX_MPDU_START_INFO12_NEW_PEER_ENTRY BIT(8) -+#define RX_MPDU_START_INFO12_DECRYPT_NEEDED BIT(9) -+#define RX_MPDU_START_INFO12_DECAP_TYPE GENMASK(11, 10) -+#define RX_MPDU_START_INFO12_VLAN_TAG_C_PADDING BIT(12) -+#define RX_MPDU_START_INFO12_VLAN_TAG_S_PADDING BIT(13) -+#define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_C BIT(14) -+#define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_S BIT(15) -+#define RX_MPDU_START_INFO12_PRE_DELIM_COUNT GENMASK(27, 16) -+#define RX_MPDU_START_INFO12_AMPDU_FLAG BIT(28) -+#define RX_MPDU_START_INFO12_BAR_FRAME BIT(29) -+#define RX_MPDU_START_INFO12_RAW_MPDU BIT(30) -+ -+#define RX_MPDU_START_INFO13_MPDU_LEN GENMASK(13, 0) -+#define RX_MPDU_START_INFO13_FIRST_MPDU BIT(14) -+#define RX_MPDU_START_INFO13_MCAST_BCAST BIT(15) -+#define RX_MPDU_START_INFO13_AST_IDX_NOT_FOUND BIT(16) -+#define RX_MPDU_START_INFO13_AST_IDX_TIMEOUT BIT(17) -+#define RX_MPDU_START_INFO13_POWER_MGMT BIT(18) -+#define RX_MPDU_START_INFO13_NON_QOS BIT(19) -+#define RX_MPDU_START_INFO13_NULL_DATA BIT(20) -+#define RX_MPDU_START_INFO13_MGMT_TYPE BIT(21) -+#define RX_MPDU_START_INFO13_CTRL_TYPE BIT(22) -+#define RX_MPDU_START_INFO13_MORE_DATA BIT(23) -+#define RX_MPDU_START_INFO13_EOSP BIT(24) -+#define RX_MPDU_START_INFO13_FRAGMENT BIT(25) -+#define RX_MPDU_START_INFO13_ORDER BIT(26) -+#define RX_MPDU_START_INFO13_UAPSD_TRIGGER BIT(27) -+#define RX_MPDU_START_INFO13_ENCRYPT_REQUIRED BIT(28) -+#define RX_MPDU_START_INFO13_DIRECTED BIT(29) -+#define RX_MPDU_START_INFO13_AMSDU_PRESENT BIT(30) -+ -+struct rx_mpdu_start_qcn9000 { -+ __le32 info7; -+ __le32 reo_queue_desc_lo; -+ __le32 info8; -+ __le32 pn[4]; -+ __le32 info9; -+ __le32 peer_meta_data; -+ __le16 info10; -+ __le16 phy_ppdu_id; -+ __le16 ast_index; -+ __le16 sw_peer_id; -+ __le32 info11; -+ __le32 info12; -+ __le32 info13; -+ __le16 frame_ctrl; -+ __le16 duration; -+ u8 addr1[ETH_ALEN]; -+ u8 addr2[ETH_ALEN]; -+ u8 addr3[ETH_ALEN]; -+ __le16 seq_ctrl; -+ u8 addr4[ETH_ALEN]; -+ __le16 qos_ctrl; -+ __le32 ht_ctrl; -+} __packed; -+ - /* rx_mpdu_start - * - * rxpcu_mpdu_filter_in_category -@@ -672,7 +778,7 @@ enum rx_msdu_start_reception_type { - #define RX_MSDU_START_INFO3_RECEPTION_TYPE GENMASK(23, 21) - #define RX_MSDU_START_INFO3_MIMO_SS_BITMAP GENMASK(31, 24) - --struct rx_msdu_start { -+struct rx_msdu_start_ipq8074 { - __le16 info0; - __le16 phy_ppdu_id; - __le32 info1; -@@ -684,6 +790,20 @@ struct rx_msdu_start { - __le32 phy_meta_data; - } __packed; - -+struct rx_msdu_start_qcn9000 { -+ __le16 info0; -+ __le16 phy_ppdu_id; -+ __le32 info1; -+ __le32 info2; -+ __le32 toeplitz_hash; -+ __le32 flow_id_toeplitz; -+ __le32 info3; -+ __le32 ppdu_start_timestamp; -+ __le32 phy_meta_data; -+ __le16 vlan_ctag_c1; -+ __le16 vlan_stag_c1; -+} __packed; -+ - /* rx_msdu_start - * - * rxpcu_mpdu_filter_in_category -@@ -894,7 +1014,7 @@ struct rx_msdu_start { - #define RX_MSDU_END_INFO5_REO_DEST_IND GENMASK(5, 1) - #define RX_MSDU_END_INFO5_FLOW_IDX GENMASK(25, 6) - --struct rx_msdu_end { -+struct rx_msdu_end_ipq8074 { - __le16 info0; - __le16 phy_ppdu_id; - __le16 ip_hdr_cksum; -@@ -917,6 +1037,58 @@ struct rx_msdu_end { - __le16 sa_sw_peer_id; - } __packed; - -+#define RX_MSDU_END_MPDU_LENGTH_INFO GENMASK(13, 0) -+ -+#define RX_MSDU_END_INFO2_DA_OFFSET GENMASK(5, 0) -+#define RX_MSDU_END_INFO2_SA_OFFSET GENMASK(11, 6) -+#define RX_MSDU_END_INFO2_DA_OFFSET_VALID BIT(12) -+#define RX_MSDU_END_INFO2_SA_OFFSET_VALID BIT(13) -+#define RX_MSDU_END_INFO2_L3_TYPE GENMASK(31, 16) -+ -+#define RX_MSDU_END_INFO4_SA_IDX_TIMEOUT BIT(0) -+#define RX_MSDU_END_INFO4_DA_IDX_TIMEOUT BIT(1) -+#define RX_MSDU_END_INFO4_MSDU_LIMIT_ERR BIT(2) -+#define RX_MSDU_END_INFO4_FLOW_IDX_TIMEOUT BIT(3) -+#define RX_MSDU_END_INFO4_FLOW_IDX_INVALID BIT(4) -+#define RX_MSDU_END_INFO4_WIFI_PARSER_ERR BIT(5) -+#define RX_MSDU_END_INFO4_AMSDU_PARSER_ERR BIT(6) -+#define RX_MSDU_END_INFO4_SA_IS_VALID BIT(7) -+#define RX_MSDU_END_INFO4_DA_IS_VALID BIT(8) -+#define RX_MSDU_END_INFO4_DA_IS_MCBC BIT(9) -+#define RX_MSDU_END_INFO4_L3_HDR_PADDING GENMASK(11, 10) -+#define RX_MSDU_END_INFO4_FIRST_MSDU BIT(12) -+#define RX_MSDU_END_INFO4_LAST_MSDU BIT(13) -+ -+#define RX_MSDU_END_INFO6_AGGR_COUNT GENMASK(7, 0) -+#define RX_MSDU_END_INFO6_FLOW_AGGR_CONTN BIT(8) -+#define RX_MSDU_END_INFO6_FISA_TIMEOUT BIT(9) -+ -+struct rx_msdu_end_qcn9000 { -+ __le16 info0; -+ __le16 phy_ppdu_id; -+ __le16 ip_hdr_cksum; -+ __le16 mpdu_length_info; -+ __le32 info1; -+ __le32 rule_indication[2]; -+ __le32 info2; -+ __le32 ipv6_options_crc; -+ __le32 tcp_seq_num; -+ __le32 tcp_ack_num; -+ __le16 info3; -+ __le16 window_size; -+ __le16 tcp_udp_cksum; -+ __le16 info4; -+ __le16 sa_idx; -+ __le16 da_idx; -+ __le32 info5; -+ __le32 fse_metadata; -+ __le16 cce_metadata; -+ __le16 sa_sw_peer_id; -+ __le32 info6; -+ __le16 cum_l4_cksum; -+ __le16 cum_ip_length; -+} __packed; -+ - /* rx_msdu_end - * - * rxpcu_mpdu_filter_in_category -@@ -1190,16 +1362,16 @@ struct rx_mpdu_end { - - #define HAL_RX_DESC_HDR_STATUS_LEN 120 - --struct hal_rx_desc { -+struct hal_rx_desc_ipq8074 { - __le32 msdu_end_tag; -- struct rx_msdu_end msdu_end; -+ struct rx_msdu_end_ipq8074 msdu_end; - __le32 rx_attn_tag; - struct rx_attention attention; - __le32 msdu_start_tag; -- struct rx_msdu_start msdu_start; -+ struct rx_msdu_start_ipq8074 msdu_start; - u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES]; - __le32 mpdu_start_tag; -- struct rx_mpdu_start mpdu_start; -+ struct rx_mpdu_start_ipq8074 mpdu_start; - __le32 mpdu_end_tag; - struct rx_mpdu_end mpdu_end; - u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; -@@ -1214,6 +1386,32 @@ struct hal_rx_desc { - #define MAX_MU_GROUP_SHOW 16 - #define MAX_MU_GROUP_LENGTH (6 * MAX_MU_GROUP_SHOW) - -+struct hal_rx_desc_qcn9000 { -+ __le32 msdu_end_tag; -+ struct rx_msdu_end_qcn9000 msdu_end; -+ __le32 rx_attn_tag; -+ struct rx_attention attention; -+ __le32 msdu_start_tag; -+ struct rx_msdu_start_qcn9000 msdu_start; -+ u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES]; -+ __le32 mpdu_start_tag; -+ struct rx_mpdu_start_qcn9000 mpdu_start; -+ __le32 mpdu_end_tag; -+ struct rx_mpdu_end mpdu_end; -+ u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; -+ __le32 hdr_status_tag; -+ __le32 phy_ppdu_id; -+ u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; -+ u8 msdu_payload[0]; -+} __packed; -+ -+struct hal_rx_desc { -+ union { -+ struct hal_rx_desc_ipq8074 ipq8074; -+ struct hal_rx_desc_qcn9000 qcn9000; -+ } u; -+} __packed; -+ - #define HAL_RX_RU_ALLOC_TYPE_MAX 6 - #define RU_26 1 - #define RU_52 2 ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -40,6 +40,7 @@ static const struct ath11k_hw_params ath - .max_radios = 3, - .bdf_addr = 0x4B0C0000, - .hw_ops = &ipq8074_ops, -+ .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), - .credit_flow = false, - .ring_mask = &ath11k_hw_ring_mask_ipq8074, - .internal_sleep_clock = false, -@@ -72,6 +73,7 @@ static const struct ath11k_hw_params ath - .max_radios = 2, - .bdf_addr = 0x4ABC0000, - .hw_ops = &ipq6018_ops, -+ .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), - .credit_flow = false, - .ring_mask = &ath11k_hw_ring_mask_ipq8074, - .internal_sleep_clock = false, -@@ -133,6 +135,7 @@ static const struct ath11k_hw_params ath - .max_radios = 1, - .single_pdev_only = false, - .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000, -+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9000), - .regs = &qcn9000_regs, - .hw_ops = &qcn9000_ops, - .credit_flow = false, diff --git a/feeds/wifi-ax/mac80211/patches/qca/175-ath11k-fix-ce-interrupts-for-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/175-ath11k-fix-ce-interrupts-for-qcn9000.patch deleted file mode 100644 index 637bbcf3c..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/175-ath11k-fix-ce-interrupts-for-qcn9000.patch +++ /dev/null @@ -1,240 +0,0 @@ -From 250b18a682e1a273ff1b137850fd27e5db6febeb Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 20:20:20 +0530 -Subject: [PATCH 4/9] ath11k: add CE interrupt support for qcn9000 - -define host CE configuration for qcn9000 since the max CE count is six. -Available MSI interrupt is five so cannot able to map the ce_id directly -for the msi_data_idx. Added get_ce_msi_idx ops in ath11k_hif_ops to get -the CE MSI idx which is used to initialize the CE ring. - -Note: This patch is depends on below patches, - 1. Add pci/mhi support for qcn9000 - -Tested-on: QCN9000 hw1.0 WLAN.HK.2.4.0.1-00097-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/ce.c | 82 +++++++++++++++++++++++++++++++++- - drivers/net/wireless/ath/ath11k/ce.h | 1 + - drivers/net/wireless/ath/ath11k/core.c | 2 + - drivers/net/wireless/ath/ath11k/hif.h | 10 +++++ - drivers/net/wireless/ath/ath11k/pci.c | 26 +++++++++-- - 5 files changed, 116 insertions(+), 5 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/ce.c -+++ b/drivers/net/wireless/ath/ath11k/ce.c -@@ -190,6 +190,83 @@ const struct ce_attr ath11k_host_ce_conf - - }; - -+const struct ce_attr ath11k_host_ce_config_qcn9000[] = { -+ /* CE0: host->target HTC control and raw streams */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 16, -+ .src_sz_max = 2048, -+ .dest_nentries = 0, -+ }, -+ -+ /* CE1: target->host HTT + HTC control */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 0, -+ .src_sz_max = 2048, -+ .dest_nentries = 512, -+ .recv_cb = ath11k_htc_rx_completion_handler, -+ }, -+ -+ /* CE2: target->host WMI */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 0, -+ .src_sz_max = 2048, -+ .dest_nentries = 32, -+ .recv_cb = ath11k_htc_rx_completion_handler, -+ }, -+ -+ /* CE3: host->target WMI (mac0) */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 32, -+ .src_sz_max = 2048, -+ .dest_nentries = 0, -+ }, -+ -+ /* CE4: host->target HTT */ -+ { -+ .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, -+ .src_nentries = 2048, -+ .src_sz_max = 256, -+ .dest_nentries = 0, -+ }, -+ -+ /* CE5: target->host pktlog */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 0, -+ .src_sz_max = 2048, -+ .dest_nentries = 512, -+ .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, -+ }, -+ -+ /* CE6: target autonomous hif_memcpy */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 0, -+ .src_sz_max = 0, -+ .dest_nentries = 0, -+ }, -+ -+ /* CE7: host->target WMI (mac1) */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 32, -+ .src_sz_max = 2048, -+ .dest_nentries = 0, -+ }, -+ -+ /* CE8: target autonomous hif_memcpy */ -+ { -+ .flags = CE_ATTR_FLAGS, -+ .src_nentries = 0, -+ .src_sz_max = 0, -+ .dest_nentries = 0, -+ }, -+}; -+ - static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe, - struct sk_buff *skb, dma_addr_t paddr) - { -@@ -452,7 +529,7 @@ static void ath11k_ce_srng_msi_ring_para - struct hal_srng_params *ring_params) - { - u32 msi_data_start; -- u32 msi_data_count; -+ u32 msi_data_count, msi_data_idx; - u32 msi_irq_start; - u32 addr_lo; - u32 addr_hi; -@@ -466,10 +543,11 @@ static void ath11k_ce_srng_msi_ring_para - return; - - ath11k_get_msi_address(ab, &addr_lo, &addr_hi); -+ ath11k_get_ce_msi_idx(ab, ce_id, &msi_data_idx); - - ring_params->msi_addr = addr_lo; - ring_params->msi_addr |= (dma_addr_t)(((uint64_t)addr_hi) << 32); -- ring_params->msi_data = (ce_id % msi_data_count) + msi_data_start; -+ ring_params->msi_data = (msi_data_idx % msi_data_count) + msi_data_start; - ring_params->flags |= HAL_SRNG_FLAGS_MSI_INTR; - } - ---- a/drivers/net/wireless/ath/ath11k/ce.h -+++ b/drivers/net/wireless/ath/ath11k/ce.h -@@ -173,6 +173,7 @@ struct ath11k_ce { - - extern const struct ce_attr ath11k_host_ce_config_ipq8074[]; - extern const struct ce_attr ath11k_host_ce_config_qca6390[]; -+extern const struct ce_attr ath11k_host_ce_config_qcn9000[]; - - void ath11k_ce_cleanup_pipes(struct ath11k_base *ab); - void ath11k_ce_rx_replenish_retry(struct timer_list *t); ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -140,6 +140,8 @@ static const struct ath11k_hw_params ath - .hw_ops = &qcn9000_ops, - .credit_flow = false, - .internal_sleep_clock = false, -+ .host_ce_config = ath11k_host_ce_config_qcn9000, -+ .ce_count = 6, - .target_ce_config = ath11k_target_ce_config_wlan_qcn9000, - .target_ce_count = 9, - .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9000, ---- a/drivers/net/wireless/ath/ath11k/hif.h -+++ b/drivers/net/wireless/ath/ath11k/hif.h -@@ -24,6 +24,7 @@ struct ath11k_hif_ops { - u32 *base_vector); - void (*get_msi_address)(struct ath11k_base *ab, u32 *msi_addr_lo, - u32 *msi_addr_hi); -+ void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx); - }; - - static inline int ath11k_hif_start(struct ath11k_base *sc) -@@ -93,4 +94,12 @@ static inline void ath11k_get_msi_addres - ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi); - } - -+static inline void ath11k_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, -+ u32 *msi_data_idx) -+{ -+ if (ab->hif.ops->get_ce_msi_idx) -+ ab->hif.ops->get_ce_msi_idx(ab, ce_id, msi_data_idx); -+ else -+ *msi_data_idx = ce_id; -+} - #endif /* _HIF_H_ */ ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -331,6 +331,23 @@ int ath11k_pci_get_user_msi_assignment(s - return -EINVAL; - } - -+static void ath11k_pci_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, -+ u32 *msi_idx) -+{ -+ u32 i, msi_data_idx; -+ -+ for (i = 0, msi_data_idx = 0; i < ab->hw_params.ce_count; i++) { -+ if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) -+ continue; -+ -+ if (ce_id == i) -+ break; -+ -+ msi_data_idx++; -+ } -+ *msi_idx = msi_data_idx; -+} -+ - static int ath11k_get_user_msi_assignment(struct ath11k_base *ab, char *user_name, - int *num_vectors, u32 *user_base_data, - u32 *base_vector) -@@ -590,7 +607,7 @@ static int ath11k_pci_config_irq(struct - { - struct ath11k_ce_pipe *ce_pipe; - u32 msi_data_start; -- u32 msi_data_count; -+ u32 msi_data_count, msi_data_idx; - u32 msi_irq_start; - unsigned int msi_data; - int irq, i, ret, irq_idx; -@@ -602,8 +619,8 @@ static int ath11k_pci_config_irq(struct - return ret; - - /* Configure CE irqs */ -- for (i = 0; i < ab->hw_params.ce_count; i++) { -- msi_data = (i % msi_data_count) + msi_irq_start; -+ for (i = 0, msi_data_idx = 0; i < ab->hw_params.ce_count; i++) { -+ msi_data = (msi_data_idx % msi_data_count) + msi_irq_start; - irq = ath11k_pci_get_msi_irq(ab->dev, msi_data); - ce_pipe = &ab->ce.ce_pipe[i]; - -@@ -625,6 +642,8 @@ static int ath11k_pci_config_irq(struct - } - - ab->irq_num[irq_idx] = irq; -+ msi_data_idx++; -+ - ath11k_pci_ce_irq_disable(ab, i); - } - -@@ -904,6 +923,7 @@ static const struct ath11k_hif_ops ath11 - .get_msi_address = ath11k_pci_get_msi_address, - .get_user_msi_vector = ath11k_get_user_msi_assignment, - .map_service_to_pipe = ath11k_pci_map_service_to_pipe, -+ .get_ce_msi_idx = ath11k_pci_get_ce_msi_idx, - }; - - static int ath11k_pci_probe(struct pci_dev *pdev, diff --git a/feeds/wifi-ax/mac80211/patches/qca/176-ath11k-fix-wmi-init-cmd-for-single-radio.patch b/feeds/wifi-ax/mac80211/patches/qca/176-ath11k-fix-wmi-init-cmd-for-single-radio.patch deleted file mode 100644 index 8feabd807..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/176-ath11k-fix-wmi-init-cmd-for-single-radio.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 326efed7953efa18f493f8cb4bb6b885aa37d5f5 Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 20:22:48 +0530 -Subject: [PATCH 6/9] ath11k: Fix single phy hw mode - -driver not able to bootup in the single radio configured board. -single phy hw mode is converted to invalid hw mode and sent to FW -through wmi init cmd. In that case driver is not receiving wmi -ready event which leads to driver bootup fail. single phy hw mode -is a valid for single radio configured board. so removed the -conversion logic. - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/wmi.c | 3 --- - 1 file changed, 3 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -3825,9 +3825,6 @@ int ath11k_wmi_cmd_init(struct ath11k_ba - init_param.hw_mode_id = wmi_sc->preferred_hw_mode; - init_param.mem_chunks = wmi_sc->mem_chunks; - -- if (wmi_sc->preferred_hw_mode == WMI_HOST_HW_MODE_SINGLE) -- init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX; -- - if (ab->hw_params.needs_band_to_mac) { - init_param.num_band_to_mac = ab->num_radios; - ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac); diff --git a/feeds/wifi-ax/mac80211/patches/qca/179-ath11k-abstract-ext-interrupts.patch b/feeds/wifi-ax/mac80211/patches/qca/179-ath11k-abstract-ext-interrupts.patch deleted file mode 100644 index ead00f1a4..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/179-ath11k-abstract-ext-interrupts.patch +++ /dev/null @@ -1,175 +0,0 @@ -From c62991534012b71651ccc909090d97c06e6a3c8d Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Tue, 24 Mar 2020 23:21:23 +0530 -Subject: [PATCH 5/9] ath11k: add extended interrupt support for qcn9000 - -update the specific hw ring mask for qcn9000. Update the timestamp -while processing DP and CE interrupts. - -Note: This patch is depends on below patches, - 1. Add pci/mhi support for qcn9000 - -Tested-on: QCN9000 hw1.0 WLAN.HK.2.4.0.1-00097-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Karthikeyan Periyasamy -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/core.c | 1 + - drivers/net/wireless/ath/ath11k/dp_tx.c | 6 ++--- - drivers/net/wireless/ath/ath11k/hal.c | 2 ++ - drivers/net/wireless/ath/ath11k/hw.c | 45 +++++++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/hw.h | 1 + - drivers/net/wireless/ath/ath11k/pci.c | 13 ++++++++-- - 6 files changed, 63 insertions(+), 5 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -136,6 +136,7 @@ static const struct ath11k_hw_params ath - .single_pdev_only = false, - .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000, - .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9000), -+ .ring_mask = &ath11k_hw_ring_mask_qcn9000, - .regs = &qcn9000_regs, - .hw_ops = &qcn9000_ops, - .credit_flow = false, ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -817,9 +817,9 @@ int ath11k_dp_tx_htt_srng_setup(struct a - cmd->ring_tail_off32_remote_addr_hi = (u64)tp_addr >> - HAL_ADDR_MSB_REG_SHIFT; - -- cmd->ring_msi_addr_lo = 0; -- cmd->ring_msi_addr_hi = 0; -- cmd->msi_data = 0; -+ cmd->ring_msi_addr_lo = lower_32_bits(params.msi_addr); -+ cmd->ring_msi_addr_hi = upper_32_bits(params.msi_addr); -+ cmd->msi_data = params.msi_data; - - cmd->intr_info = FIELD_PREP( - HTT_SRNG_SETUP_CMD_INTR_INFO_BATCH_COUNTER_THRESH, ---- a/drivers/net/wireless/ath/ath11k/hal.c -+++ b/drivers/net/wireless/ath/ath11k/hal.c -@@ -507,6 +507,8 @@ void ath11k_hal_srng_get_params(struct a - srng->intr_batch_cntr_thres_entries; - params->low_threshold = srng->u.src_ring.low_threshold; - params->flags = srng->flags; -+ params->msi_addr = srng->msi_addr; -+ params->msi_data = srng->msi_data; - } - - dma_addr_t ath11k_hal_srng_get_hp_addr(struct ath11k_base *ab, ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -1468,6 +1468,51 @@ const struct service_to_pipe ath11k_targ - - }; - -+const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9000 = { -+ .tx = { -+ ATH11K_TX_RING_MASK_0, -+ ATH11K_TX_RING_MASK_1, -+ ATH11K_TX_RING_MASK_2, -+ }, -+ .rx_mon_status = { -+ 0, 0, 0, -+ ATH11K_RX_MON_STATUS_RING_MASK_0, -+ ATH11K_RX_MON_STATUS_RING_MASK_1, -+ ATH11K_RX_MON_STATUS_RING_MASK_2, -+ }, -+ .rx = { -+ 0, 0, 0, 0, -+ ATH11K_RX_RING_MASK_0, -+ ATH11K_RX_RING_MASK_1, -+ ATH11K_RX_RING_MASK_2, -+ ATH11K_RX_RING_MASK_3, -+ }, -+ .rx_err = { -+ 0, 0, 0, -+ ATH11K_RX_ERR_RING_MASK_0, -+ }, -+ .rx_wbm_rel = { -+ 0, 0, 0, -+ ATH11K_RX_WBM_REL_RING_MASK_0, -+ }, -+ .reo_status = { -+ 0, 0, 0, -+ ATH11K_REO_STATUS_RING_MASK_0, -+ }, -+ .rxdma2host = { -+ 0, 0, 0, -+ ATH11K_RXDMA2HOST_RING_MASK_0, -+ ATH11K_RXDMA2HOST_RING_MASK_1, -+ ATH11K_RXDMA2HOST_RING_MASK_2, -+ }, -+ .host2rxdma = { -+ 0, 0, 0, -+ ATH11K_HOST2RXDMA_RING_MASK_0, -+ ATH11K_HOST2RXDMA_RING_MASK_1, -+ ATH11K_HOST2RXDMA_RING_MASK_2, -+ }, -+}; -+ - const struct ath11k_hw_regs ipq8074_regs = { - /* SW2TCL(x) R0 ring configuration address */ - .hal_tcl1_ring_base_lsb = 0x00000510, ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -211,6 +211,7 @@ extern const struct ath11k_hw_ops qcn900 - - extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; - extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; -+extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9000; - - static inline - int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw, ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -441,6 +441,9 @@ static irqreturn_t ath11k_pci_ce_interru - { - struct ath11k_ce_pipe *ce_pipe = arg; - -+ /* last interrupt received for this CE */ -+ ce_pipe->timestamp = jiffies; -+ - ath11k_pci_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num); - tasklet_schedule(&ce_pipe->intr_tq); - -@@ -535,6 +538,9 @@ static irqreturn_t ath11k_pci_ext_interr - - ath11k_dbg(irq_grp->ab, ATH11K_DBG_PCI, "ext irq:%d\n", irq); - -+ /* last interrupt received for this group */ -+ irq_grp->timestamp = jiffies; -+ - ath11k_pci_ext_grp_disable(irq_grp); - - napi_schedule(&irq_grp->napi); -@@ -545,8 +551,9 @@ static irqreturn_t ath11k_pci_ext_interr - static int ath11k_pci_ext_irq_config(struct ath11k_base *ab) - { - int i, j, ret, num_vectors = 0; -- u32 user_base_data = 0, base_vector = 0; -+ u32 user_base_data = 0, base_vector = 0, base_idx; - -+ base_idx = ATH11K_PCI_IRQ_CE0_OFFSET + CE_COUNT_MAX; - ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP", - &num_vectors, - &user_base_data, -@@ -576,7 +583,7 @@ static int ath11k_pci_ext_irq_config(str - } - - irq_grp->num_irq = num_irq; -- irq_grp->irqs[0] = base_vector + i; -+ irq_grp->irqs[0] = base_idx + i; - - for (j = 0; j < irq_grp->num_irq; j++) { - int irq_idx = irq_grp->irqs[j]; -@@ -587,6 +594,8 @@ static int ath11k_pci_ext_irq_config(str - - ath11k_dbg(ab, ATH11K_DBG_PCI, - "irq:%d group:%d\n", irq, i); -+ -+ irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); - ret = request_irq(irq, ath11k_pci_ext_interrupt_handler, - IRQF_SHARED, - "DP_EXT_IRQ", irq_grp); diff --git a/feeds/wifi-ax/mac80211/patches/qca/181-ath11k-remove-error-on-soc-debugfs-fail.patch b/feeds/wifi-ax/mac80211/patches/qca/181-ath11k-remove-error-on-soc-debugfs-fail.patch index 6bf08367e..e113f26cd 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/181-ath11k-remove-error-on-soc-debugfs-fail.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/181-ath11k-remove-error-on-soc-debugfs-fail.patch @@ -2,7 +2,7 @@ From 41363c3109235a96d90d5946bbc01d1cc8dad47e Mon Sep 17 00:00:00 2001 From: Anilkumar Kolli Date: Sun, 6 Sep 2020 11:01:38 +0530 Subject: [PATCH] ath11k: update debugfs support for mupltiple radios in PCI - bus +bus debugfs_ath11k struct is moved to ath11k_core, since its common for both pci and ahb. @@ -16,25 +16,25 @@ with this Debugfs entries looks like, ipq8074 hw2.0 qcn9000 hw1.0_0000:01:00.0 qcn9000 hw1.0_0001:01:00.0 # ls -l /sys/kernel/debug/ath11k/ipq8074 hw2.0/ - mac0 mac1 simulate_fw_crash soc_dp_stats + mac0 mac1 simulate_fw_crash soc_dp_stats # ls -l /sys/kernel/debug/ath11k/qcn9000 hw1.0_0000:01:00.0 - mac0 simulate_fw_crash soc_dp_stats + mac0 simulate_fw_crash soc_dp_stats # /sys/kernel/debug/ath11k/qcn9000 hw1.0_0001:01:00.0: mac0 simulate_fw_crash soc_dp_stats Signed-off-by: Anilkumar Kolli --- - drivers/net/wireless/ath/ath11k/core.c | 16 +++++++-- - drivers/net/wireless/ath/ath11k/core.h | 1 - - drivers/net/wireless/ath/ath11k/debug.c | 57 ++++++++++++++++++++++++--------- - drivers/net/wireless/ath/ath11k/debug.h | 11 +++++++ - 4 files changed, 67 insertions(+), 18 deletions(-) + drivers/net/wireless/ath/ath11k/core.c | 12 +++++++ + drivers/net/wireless/ath/ath11k/core.h | 1 - + drivers/net/wireless/ath/ath11k/debugfs.c | 57 ++++++++++++++++++++++++------ + drivers/net/wireless/ath/ath11k/debugfs.h | 11 ++++++ + 5 files changed, 72 insertions(+), 13 deletions(-) --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -1063,5 +1063,17 @@ err_sc_free: +@@ -1201,5 +1201,17 @@ err_sc_free: } EXPORT_SYMBOL(ath11k_core_alloc); @@ -54,7 +54,7 @@ Signed-off-by: Anilkumar Kolli MODULE_LICENSE("Dual BSD/GPL"); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -796,7 +796,6 @@ struct ath11k_base { +@@ -811,7 +811,6 @@ struct ath11k_base { enum ath11k_dfs_region dfs_region; #ifdef CPTCFG_ATH11K_DEBUGFS struct dentry *debugfs_soc; @@ -62,9 +62,9 @@ Signed-off-by: Anilkumar Kolli #endif struct ath11k_soc_dp_stats soc_stats; ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -13,6 +13,8 @@ +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -14,6 +14,8 @@ #include "peer.h" #include "pktlog.h" @@ -73,39 +73,31 @@ Signed-off-by: Anilkumar Kolli static const char *htt_bp_umac_ring[HTT_SW_UMAC_RING_IDX_MAX] = { "REO2SW1_RING", "REO2SW2_RING", -@@ -1137,14 +1139,6 @@ int ath11k_debug_pdev_create(struct ath1 +@@ -1040,10 +1042,6 @@ int ath11k_debugfs_pdev_create(struct at if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) return 0; - ab->debugfs_soc = debugfs_create_dir(ab->hw_params.name, ab->debugfs_ath11k); -- -- if (IS_ERR_OR_NULL(ab->debugfs_soc)) { -- if (IS_ERR(ab->debugfs_soc)) -- return PTR_ERR(ab->debugfs_soc); -- return -ENOMEM; -- } +- if (IS_ERR(ab->debugfs_soc)) +- return PTR_ERR(ab->debugfs_soc); - debugfs_create_file("simulate_fw_crash", 0600, ab->debugfs_soc, ab, &fops_simulate_fw_crash); -@@ -1156,20 +1150,30 @@ int ath11k_debug_pdev_create(struct ath1 +@@ -1055,24 +1053,58 @@ int ath11k_debugfs_pdev_create(struct at - void ath11k_debug_pdev_destroy(struct ath11k_base *ab) + void ath11k_debugfs_pdev_destroy(struct ath11k_base *ab) { -- debugfs_remove_recursive(ab->debugfs_ath11k); -- ab->debugfs_ath11k = NULL; +- debugfs_remove_recursive(ab->debugfs_soc); +- ab->debugfs_soc = NULL; } - int ath11k_debug_soc_create(struct ath11k_base *ab) + int ath11k_debugfs_soc_create(struct ath11k_base *ab) { - ab->debugfs_ath11k = debugfs_create_dir("ath11k", NULL); + struct device *dev = ab->dev; + char soc_name[64] = {0}; - -- if (IS_ERR_OR_NULL(ab->debugfs_ath11k)) { -- if (IS_ERR(ab->debugfs_ath11k)) -- return PTR_ERR(ab->debugfs_ath11k); -- return -ENOMEM; ++ + if (!(IS_ERR_OR_NULL(ab->debugfs_soc))) + return 0; + @@ -114,21 +106,27 @@ Signed-off-by: Anilkumar Kolli + } else { + snprintf(soc_name, sizeof(soc_name), "%s_%s", + ab->hw_params.name, dev_name(dev)); - } ++ } +- return PTR_ERR_OR_ZERO(ab->debugfs_ath11k); + ab->debugfs_soc = debugfs_create_dir(soc_name, debugfs_ath11k); + if (IS_ERR_OR_NULL(ab->debugfs_soc)) { + if (IS_ERR(ab->debugfs_soc)) + return PTR_ERR(ab->debugfs_soc); + return -ENOMEM; + } -+ - return 0; ++ ++ return 0; } -@@ -1179,6 +1183,24 @@ void ath11k_debug_soc_destroy(struct ath - ab->debugfs_soc = NULL; + void ath11k_debugfs_soc_destroy(struct ath11k_base *ab) + { +- debugfs_remove_recursive(ab->debugfs_ath11k); +- ab->debugfs_ath11k = NULL; ++ debugfs_remove_recursive(ab->debugfs_soc); ++ ab->debugfs_soc = NULL; } + EXPORT_SYMBOL(ath11k_debugfs_soc_destroy); +int ath11k_debugfs_create() +{ @@ -148,10 +146,10 @@ Signed-off-by: Anilkumar Kolli + debugfs_ath11k = NULL; +} + - void ath11k_debug_fw_stats_init(struct ath11k *ar) + void ath11k_debugfs_fw_stats_init(struct ath11k *ar) { struct dentry *fwstats_dir = debugfs_create_dir("fw_stats", -@@ -1698,6 +1720,9 @@ int ath11k_debug_register(struct ath11k +@@ -1653,6 +1685,9 @@ int ath11k_debugfs_register(struct ath11 char pdev_name[5]; char buf[100] = {0}; @@ -161,38 +159,39 @@ Signed-off-by: Anilkumar Kolli snprintf(pdev_name, sizeof(pdev_name), "%s%d", "mac", ar->pdev_idx); ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc); -@@ -1754,5 +1779,7 @@ int ath11k_debug_register(struct ath11k - void ath11k_debug_unregister(struct ath11k *ar) +@@ -1708,4 +1743,6 @@ int ath11k_debugfs_register(struct ath11 + void ath11k_debugfs_unregister(struct ath11k *ar) { ath11k_deinit_pktlog(ar); + debugfs_remove_recursive(ar->debug.debugfs_pdev); + ar->debug.debugfs_pdev = NULL; } - #endif /* CPTCFG_ATH11K_DEBUGFS */ ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -167,6 +167,8 @@ static inline void ath11k_debugfs_twt(st +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -117,6 +117,8 @@ static inline void ath11k_debugfs_twt(st #endif #ifdef CPTCFG_ATH11K_DEBUGFS +int ath11k_debugfs_create(void); +void ath11k_debugfs_destroy(void); - int ath11k_debug_soc_create(struct ath11k_base *ab); - void ath11k_debug_soc_destroy(struct ath11k_base *ab); - int ath11k_debug_pdev_create(struct ath11k_base *ab); -@@ -222,6 +224,15 @@ void ath11k_update_per_peer_stats_from_t - struct sk_buff *msdu, - struct hal_tx_status *ts); + int ath11k_debugfs_soc_create(struct ath11k_base *ab); + void ath11k_debugfs_soc_destroy(struct ath11k_base *ab); + int ath11k_debugfs_pdev_create(struct ath11k_base *ab); +@@ -161,7 +163,16 @@ static inline int ath11k_debugfs_rx_filt + } + #else -+int ath11k_debugfs_create(void) +-ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, ++static inline int ath11k_debugfs_create(void) +{ + return 0; +} + -+void ath11k_debugfs_destroy(void) ++static inline void ath11k_debugfs_destroy(void) +{ +} + - static inline int ath11k_debug_soc_create(struct ath11k_base *ab) ++static inline ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, + char *buf, int size) { return 0; diff --git a/feeds/wifi-ax/mac80211/patches/qca/184-ath11k-pci-reload.patch b/feeds/wifi-ax/mac80211/patches/qca/184-ath11k-pci-reload.patch deleted file mode 100644 index 8b5de6eaf..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/184-ath11k-pci-reload.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c6718705017a06d6f40fa8fed1c5922d52411e48 Mon Sep 17 00:00:00 2001 -From: Anilkumar Kolli -Date: Fri, 15 May 2020 14:57:31 +0530 -Subject: [PATCH 184/187] ath11k: fix ath11k reload - -Signed-off-by: Anilkumar Kolli ---- - drivers/net/wireless/ath/ath11k/mhi.c | 2 +- - drivers/net/wireless/ath/ath11k/pci.c | 33 ++++++++++++++++++++++++++++----- - 2 files changed, 29 insertions(+), 6 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -1076,10 +1076,15 @@ static void ath11k_pci_remove(struct pci - struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); - - set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); -+ ath11k_core_deinit(ab); - ath11k_mhi_unregister(ab_pci); -+ -+ ath11k_pci_free_irq(ab); - ath11k_pci_disable_msi(ab_pci); - ath11k_pci_free_region(ab_pci); -- ath11k_pci_free_irq(ab); -+ -+ ath11k_hal_srng_deinit(ab); -+ ath11k_ce_free_pipes(ab); - ath11k_core_free(ab); - } - diff --git a/feeds/wifi-ax/mac80211/patches/qca/186-ath11k-cleanup-bdf-download-sequence.patch b/feeds/wifi-ax/mac80211/patches/qca/186-ath11k-cleanup-bdf-download-sequence.patch index 310989160..20b62bf5e 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/186-ath11k-cleanup-bdf-download-sequence.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/186-ath11k-cleanup-bdf-download-sequence.patch @@ -13,7 +13,7 @@ Signed-off-by: Anilkumar Kolli --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -1137,6 +1137,79 @@ static struct qmi_elem_info qmi_wlanfw_c +@@ -1139,6 +1139,79 @@ static struct qmi_elem_info qmi_wlanfw_c num_macs), }, { @@ -93,9 +93,9 @@ Signed-off-by: Anilkumar Kolli .data_type = QMI_EOTI, .array_type = NO_ARRAY, .tlv_type = QMI_COMMON_TLV_TYPE, -@@ -2234,102 +2307,83 @@ static int ath11k_qmi_request_target_cap - ab->qmi.target.fw_build_timestamp, - ab->qmi.target.fw_build_id); +@@ -2271,102 +2344,83 @@ static int ath11k_qmi_request_target_cap + if (r) + ath11k_dbg(ab, ATH11K_DBG_QMI, "DT bdf variant name not set.\n"); -out: - return ret; @@ -244,7 +244,7 @@ Signed-off-by: Anilkumar Kolli ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, -@@ -2337,112 +2391,103 @@ static int ath11k_qmi_load_bdf_fixed_add +@@ -2374,120 +2428,113 @@ static int ath11k_qmi_load_bdf_fixed_add qmi_wlanfw_bdf_download_req_msg_v01_ei, req); if (ret < 0) { qmi_txn_cancel(&txn); @@ -263,19 +263,18 @@ Signed-off-by: Anilkumar Kolli ret = -EINVAL; - goto out_qmi_bdf; + goto out; - } -- } - --out_qmi_bdf: -- iounmap(bdf_addr); ++ } + if (ab->bus_params.fixed_bdf_addr || type == ATH11K_QMI_FILE_TYPE_EEPROM) { + remaining = 0; + } else { + remaining -= req->data_len; + temp += req->data_len; + req->seg_id++; -+ } -+ } + } + } + +-out_qmi_bdf: +- iounmap(bdf_addr); out: + if (ab->bus_params.fixed_bdf_addr) + iounmap(bdf_addr); @@ -295,16 +294,17 @@ Signed-off-by: Anilkumar Kolli - struct qmi_txn txn = {}; - int ret; - const u8 *temp; + int bdf_type; - - req = kzalloc(sizeof(*req), GFP_KERNEL); - if (!req) - return -ENOMEM; - memset(&resp, 0, sizeof(resp)); + u32 fw_size, file_type; ++ u8 *tmp; + int ret = 0; memset(&bd, 0, sizeof(bd)); -+ ret = ath11k_core_fetch_bdf(ab, &bd); if (ret) { - ath11k_warn(ab, "qmi failed to load bdf:\n"); @@ -315,9 +315,16 @@ Signed-off-by: Anilkumar Kolli - temp = bd.data; - remaining = bd.len; +- +- if (bd.len >= SELFMAG && memcmp(bd.data, ELFMAG, SELFMAG) == 0) +- bdf_type = ATH11K_QMI_BDF_TYPE_ELF; +- else +- bdf_type = ATH11K_QMI_BDF_TYPE_BIN; + fw_size = bd.len; + fw_size = min_t(u32, ab->hw_params.fw.board_size, bd.len); +- ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi bdf_type %d\n", bdf_type); + - while (remaining) { - req->valid = 1; - req->file_id_valid = 1; @@ -327,19 +334,10 @@ Signed-off-by: Anilkumar Kolli - req->seg_id_valid = 1; - req->data_valid = 1; - req->data_len = ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE; -- req->bdf_type = ATH11K_QMI_BDF_TYPE_BIN; +- req->bdf_type = bdf_type; - req->bdf_type_valid = 1; - req->end_valid = 1; - req->end = 0; -- -- if (remaining > QMI_WLANFW_MAX_DATA_SIZE_V01) { -- req->data_len = QMI_WLANFW_MAX_DATA_SIZE_V01; -- } else { -- req->data_len = remaining; -- req->end = 1; -- } -- -- memcpy(req->data, temp, req->data_len); + file_type = ATH11K_QMI_FILE_TYPE_BDF_GOLDEN; + ret = ath11k_qmi_load_file_target_mem(ab, bd.data, fw_size, file_type); + if (ret < 0) { @@ -347,31 +345,37 @@ Signed-off-by: Anilkumar Kolli + goto out; + } +- if (remaining > QMI_WLANFW_MAX_DATA_SIZE_V01) { +- req->data_len = QMI_WLANFW_MAX_DATA_SIZE_V01; +- } else { +- req->data_len = remaining; +- req->end = 1; +- } ++ /* Load caldata */ ++ if(ab->bus_params.fixed_bdf_addr) { ++ snprintf(filename, sizeof(filename), ++ "%s", ATH11K_DEFAULT_CAL_FILE); ++ } else { ++ snprintf(filename, sizeof(filename), ++ "%s%d%s", ++ ATH11K_QMI_DEF_CAL_FILE_PREFIX, ++ ab->qmi.service_ins_id - (NODE_ID_BASE - 1), ++ ATH11K_QMI_DEF_CAL_FILE_SUFFIX); ++ } + +- memcpy(req->data, temp, req->data_len); ++ if (ab->qmi.target.eeprom_read_timeout) { ++ file_type = ATH11K_QMI_FILE_TYPE_EEPROM; ++ tmp = filename; ++ fw_size = ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE; ++ goto send_qmi_req; ++ } + - ret = qmi_txn_init(&ab->qmi.handle, &txn, - qmi_wlanfw_bdf_download_resp_msg_v01_ei, - &resp); - if (ret < 0) - goto out_qmi_bdf; -+ /* Load caldata */ -+ if(ab->bus_params.fixed_bdf_addr) { -+ snprintf(filename, sizeof(filename), -+ "%s", ATH11K_DEFAULT_CAL_FILE); -+ } else { -+ snprintf(filename, sizeof(filename), -+ "%s%d%s", -+ ATH11K_QMI_DEF_CAL_FILE_PREFIX, -+ ab->qmi.service_ins_id - (NODE_ID_BASE - 1), -+ ATH11K_QMI_DEF_CAL_FILE_SUFFIX); -+ } - -- ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, -- QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, -- QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN, -- qmi_wlanfw_bdf_download_req_msg_v01_ei, req); -- if (ret < 0) { -- qmi_txn_cancel(&txn); -- goto out_qmi_bdf; -- } + file_type = ATH11K_QMI_FILE_TYPE_CALDATA; + fw_entry = ath11k_core_firmware_request(ab, filename); + if (IS_ERR(fw_entry)) { @@ -381,13 +385,28 @@ Signed-off-by: Anilkumar Kolli + filename); + goto out; + } ++ fw_size = min_t(u32, ab->hw_params.fw.board_size, fw_entry->size); ++ tmp = fw_entry->data; + +- ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, +- QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, +- QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN, +- qmi_wlanfw_bdf_download_req_msg_v01_ei, req); +- if (ret < 0) { +- qmi_txn_cancel(&txn); +- goto out_qmi_bdf; +- } ++send_qmi_req: ++ ret = ath11k_qmi_load_file_target_mem(ab, tmp, fw_size, file_type); ++ if (ret < 0) { ++ ath11k_warn(ab, "qmi failed to load caldata\n"); ++ goto out_qmi_cal; ++ } - ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); - if (ret < 0) - goto out_qmi_bdf; -+ fw_size = min_t(u32, ab->hw_params.fw.board_size, fw_entry->size); -+ if (ab->qmi.target.eeprom_read_timeout) -+ file_type = ATH11K_QMI_FILE_TYPE_EEPROM; ++ ath11k_info(ab, "qmi caldata downloaded: type: %u\n", file_type); - if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { - ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", @@ -398,30 +417,25 @@ Signed-off-by: Anilkumar Kolli - remaining -= req->data_len; - temp += req->data_len; - req->seg_id++; -+ ret = ath11k_qmi_load_file_target_mem(ab, fw_entry->data, fw_size, file_type); -+ if (ret < 0) { -+ ath11k_warn(ab, "qmi failed to load caldata\n"); -+ goto out_qmi_cal; - } +- } ++out_qmi_cal: ++ if (file_type == ATH11K_QMI_FILE_TYPE_CALDATA) ++ release_firmware(fw_entry); -out_qmi_bdf: -- ath11k_core_free_bdf(ab, &bd); -+ ath11k_info(ab, "qmi caldata downloaded: type: %u\n", file_type); ++out: + ath11k_core_free_bdf(ab, &bd); ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi BDF downloaded\n"); -+out_qmi_cal: -+ release_firmware(fw_entry); - out: +-out: - kfree(req); - return ret; -+ ath11k_core_free_bdf(ab, &bd); -+ ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi BDF downloaded\n"); -+ + return 0; } static int ath11k_qmi_m3_load(struct ath11k_base *ab) -@@ -2822,10 +2867,7 @@ static void ath11k_qmi_event_load_bdf(st - return; +@@ -2884,10 +2931,7 @@ static int ath11k_qmi_event_load_bdf(str + return ret; } - if (ab->bus_params.fixed_bdf_addr) @@ -431,7 +445,7 @@ Signed-off-by: Anilkumar Kolli + ret = ath11k_qmi_load_bdf_qmi(ab); if (ret < 0) { ath11k_warn(ab, "qmi failed to load board data file:%d\n", ret); - return; + return ret; --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h @@ -12,7 +12,7 @@ @@ -441,9 +455,9 @@ Signed-off-by: Anilkumar Kolli -#define ATH11K_QMI_WLANFW_TIMEOUT_MS 5000 +#define ATH11K_QMI_WLANFW_TIMEOUT_MS 10000 #define ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE 64 + #define ATH11K_QMI_CALDB_ADDRESS 0x4BA00000 #define ATH11K_QMI_BDF_MAX_SIZE (256 * 1024) - #define ATH11K_QMI_CALDATA_OFFSET (128 * 1024) -@@ -43,7 +43,8 @@ struct ath11k_base; +@@ -47,7 +47,8 @@ struct ath11k_base; enum ath11k_qmi_file_type { ATH11K_QMI_FILE_TYPE_BDF_GOLDEN, @@ -453,15 +467,15 @@ Signed-off-by: Anilkumar Kolli ATH11K_QMI_MAX_FILE_TYPE, }; -@@ -104,6 +105,7 @@ struct target_info { +@@ -108,6 +109,7 @@ struct target_info { u32 board_id; u32 soc_id; u32 fw_version; + u32 eeprom_read_timeout; char fw_build_timestamp[ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 + 1]; char fw_build_id[ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 + 1]; - }; -@@ -178,7 +180,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m + char bdf_ext[ATH11K_QMI_BDF_EXT_STR_LENGTH]; +@@ -184,7 +186,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m struct qmi_response_type_v01 resp; }; @@ -470,7 +484,7 @@ Signed-off-by: Anilkumar Kolli #define QMI_WLANFW_HOST_CAP_REQ_V01 0x0034 #define QMI_WLANFW_HOST_CAP_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLFW_HOST_CAP_RESP_V01 0x0034 -@@ -335,7 +337,7 @@ struct qmi_wlanfw_fw_cold_cal_done_ind_m +@@ -342,7 +344,7 @@ struct qmi_wlanfw_fw_cold_cal_done_ind_m }; #define QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN 0 @@ -479,7 +493,7 @@ Signed-off-by: Anilkumar Kolli #define QMI_WLANFW_CAP_REQ_V01 0x0024 #define QMI_WLANFW_CAP_RESP_V01 0x0024 -@@ -416,6 +418,14 @@ struct qmi_wlanfw_cap_resp_msg_v01 { +@@ -423,6 +425,14 @@ struct qmi_wlanfw_cap_resp_msg_v01 { char fw_build_id[ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 + 1]; u8 num_macs_valid; u8 num_macs; diff --git a/feeds/wifi-ax/mac80211/patches/qca/188-ath11k-m3-ssr-dump-collection.patch b/feeds/wifi-ax/mac80211/patches/qca/188-ath11k-m3-ssr-dump-collection.patch index 58e0e5ed6..fadee5339 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/188-ath11k-m3-ssr-dump-collection.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/188-ath11k-m3-ssr-dump-collection.patch @@ -1,6 +1,8 @@ ---- a/drivers/net/wireless/ath/ath11k/qmi.c -+++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -8,6 +8,7 @@ +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +@@ -10,6 +10,7 @@ #include "debug.h" #include #include @@ -8,7 +10,7 @@ #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define HOST_CSTATE_BIT 0x04 -@@ -468,6 +469,24 @@ static struct qmi_elem_info qmi_wlanfw_h +@@ -470,6 +471,24 @@ static struct qmi_elem_info qmi_wlanfw_h .ei_array = qmi_response_type_v01_ei, }, { @@ -33,7 +35,32 @@ .data_type = QMI_EOTI, .array_type = NO_ARRAY, .tlv_type = QMI_COMMON_TLV_TYPE, -@@ -1769,6 +1788,87 @@ static struct qmi_elem_info qmi_wlanfw_c +@@ -695,6 +714,24 @@ static struct qmi_elem_info qmi_wlanfw_i + cal_done_enable), + }, + { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x20, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ m3_dump_upload_req_enable_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x20, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ m3_dump_upload_req_enable), ++ }, ++ { + .data_type = QMI_EOTI, + .array_type = NO_ARRAY, + .tlv_type = QMI_COMMON_TLV_TYPE, +@@ -1771,6 +1808,87 @@ static struct qmi_elem_info qmi_wlanfw_c }, }; @@ -121,7 +148,7 @@ int wlfw_send_qdss_trace_config_download_req(struct ath11k_base *ab, const u8 *buffer, unsigned int file_len) { -@@ -2030,6 +2130,8 @@ static int ath11k_qmi_fw_ind_register_se +@@ -2034,6 +2152,8 @@ static int ath11k_qmi_fw_ind_register_se req->qdss_trace_free_enable = 1; req->pin_connect_result_enable_valid = 0; req->pin_connect_result_enable = 0; @@ -130,7 +157,7 @@ ret = qmi_txn_init(handle, &txn, qmi_wlanfw_ind_register_resp_msg_v01_ei, resp); -@@ -2220,6 +2322,24 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2252,6 +2372,24 @@ static int ath11k_qmi_assign_target_mem_ ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; idx++; break; @@ -155,7 +182,7 @@ default: ath11k_warn(ab, "qmi ignore invalid mem req type %d\n", ab->qmi.target_mem[i].type); -@@ -2803,6 +2923,123 @@ int ath11k_qmi_process_coldboot_calibrat +@@ -2854,6 +2992,114 @@ static int ath11k_qmi_process_coldboot_c return 0; } @@ -248,14 +275,7 @@ + goto send_resp; + } + -+ m3_dump_data->addr = ioremap(target_mem[i].paddr, target_mem[i].size); -+ if (!m3_dump_data->addr) { -+ ath11k_warn(ab, "qmi failed to ioremap M3 dump region\n"); -+ ret = -ENOMEM; -+ vfree(dump); -+ goto send_resp; -+ } -+ ++ m3_dump_data->addr = target_mem[i].vaddr; + m3_dump_data->size = event_data->size; + m3_dump_data->pdev_id = event_data->pdev_id; + m3_dump_data->timestamp = ktime_to_ms(ktime_get()); @@ -265,8 +285,6 @@ + dev_coredumpv(ab->dev, dump, le32_to_cpu(m3_dump_data->size), + GFP_KERNEL); + -+ iounmap(m3_dump_data->addr); -+ +send_resp: + ret = ath11k_qmi_m3_dump_upload_done_ind_send(ab, event_data->pdev_id, ret); + if (ret < 0) @@ -279,7 +297,7 @@ static int ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, enum ath11k_qmi_event_type type, -@@ -2962,6 +3199,30 @@ static void ath11k_qmi_msg_cold_boot_cal +@@ -3020,6 +3266,30 @@ static void ath11k_qmi_msg_cold_boot_cal ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi cold boot calibration done\n"); } @@ -310,7 +328,7 @@ static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { { .type = QMI_INDICATION, -@@ -2992,6 +3253,14 @@ static const struct qmi_msg_handler ath1 +@@ -3050,6 +3320,14 @@ static const struct qmi_msg_handler ath1 sizeof(struct qmi_wlanfw_fw_cold_cal_done_ind_msg_v01), .fn = ath11k_qmi_msg_cold_boot_cal_done_cb, }, @@ -325,7 +343,7 @@ }; static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl, -@@ -3082,6 +3351,9 @@ static void ath11k_qmi_driver_event_work +@@ -3152,6 +3430,9 @@ static void ath11k_qmi_driver_event_work break; case ATH11K_QMI_EVENT_COLD_BOOT_CAL_DONE: break; @@ -335,10 +353,12 @@ default: ath11k_warn(ab, "invalid event type: %d", event->type); break; ---- a/drivers/net/wireless/ath/ath11k/qmi.h -+++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -28,11 +28,16 @@ - #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.h +@@ -32,11 +32,16 @@ + #define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 3 #define ATH11K_QMI_MAX_QDSS_CONFIG_FILE_NAME_SIZE 64 #define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin" +#define ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS 0x51000000 @@ -354,7 +374,7 @@ #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 #define ATH11K_FIRMWARE_MODE_OFF 4 -@@ -67,6 +72,7 @@ enum ath11k_qmi_event_type { +@@ -71,6 +76,7 @@ enum ath11k_qmi_event_type { ATH11K_QMI_EVENT_FORCE_FW_ASSERT, ATH11K_QMI_EVENT_POWER_UP, ATH11K_QMI_EVENT_POWER_DOWN, @@ -362,7 +382,7 @@ ATH11K_QMI_EVENT_MAX, }; -@@ -76,6 +82,13 @@ struct ath11k_qmi_driver_event { +@@ -80,6 +86,13 @@ struct ath11k_qmi_driver_event { void *data; }; @@ -376,7 +396,7 @@ struct ath11k_qmi_ce_cfg { const struct ce_pipe_config *tgt_ce; int tgt_ce_len; -@@ -136,6 +149,12 @@ struct ath11k_qmi { +@@ -142,6 +155,12 @@ struct ath11k_qmi { wait_queue_head_t cold_boot_waitq; }; @@ -389,7 +409,7 @@ #define QMI_WLANFW_QDSS_TRACE_CONFIG_DOWNLOAD_REQ_MSG_V01_MAX_LEN 6167 #define QMI_WLANFW_QDSS_TRACE_CONFIG_DOWNLOAD_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLANFW_QDSS_TRACE_CONFIG_DOWNLOAD_REQ_V01 0x0044 -@@ -157,6 +176,15 @@ struct qmi_wlanfw_qdss_trace_config_down +@@ -163,6 +182,15 @@ struct qmi_wlanfw_qdss_trace_config_down struct qmi_response_type_v01 resp; }; @@ -405,15 +425,7 @@ #define QMI_WLANFW_QDSS_TRACE_MODE_REQ_V01 0x0045 #define QMI_WLANFW_QDSS_TRACE_MODE_REQ_MSG_V01_MAX_LEN 18 #define QMI_WLANFW_QDSS_TRACE_MODE_RESP_MSG_V01_MAX_LEN 7 -@@ -188,6 +216,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m - #define QMI_IPQ8074_FW_MEM_MODE 0xFF - #define HOST_DDR_REGION_TYPE 0x1 - #define BDF_MEM_REGION_TYPE 0x2 -+#define M3_DUMP_REGION_TYPE 0x3 - #define CALDB_MEM_REGION_TYPE 0x4 - - struct qmi_wlanfw_host_cap_req_msg_v01 { -@@ -263,6 +292,10 @@ struct qmi_wlanfw_ind_register_req_msg_v +@@ -270,6 +298,10 @@ struct qmi_wlanfw_ind_register_req_msg_v u8 qdss_trace_save_enable; u8 qdss_trace_free_enable_valid; u8 qdss_trace_free_enable; @@ -424,7 +436,7 @@ }; struct qmi_wlanfw_ind_register_resp_msg_v01 { -@@ -336,6 +369,12 @@ struct qmi_wlanfw_fw_cold_cal_done_ind_m +@@ -343,6 +375,12 @@ struct qmi_wlanfw_fw_cold_cal_done_ind_m char placeholder; }; @@ -437,7 +449,7 @@ #define QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN 0 #define QMI_WLANFW_CAP_RESP_MSG_V01_MAX_LEN 235 #define QMI_WLANFW_CAP_REQ_V01 0x0024 -@@ -466,6 +505,8 @@ struct qmi_wlanfw_bdf_download_resp_msg_ +@@ -473,6 +511,8 @@ struct qmi_wlanfw_bdf_download_resp_msg_ #define QMI_WLANFW_M3_INFO_RESP_V01 0x003C #define QMI_WLANFW_M3_INFO_REQ_V01 0x003C @@ -446,9 +458,11 @@ struct qmi_wlanfw_m3_info_req_msg_v01 { u64 addr; u32 size; ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -457,6 +457,7 @@ struct ath11k_debug { +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/core.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +@@ -467,6 +467,7 @@ struct ath11k_debug { bool is_pkt_logging; #endif u32 rx_filter; @@ -456,9 +470,11 @@ }; struct ath11k_per_peer_tx_stats { ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1714,6 +1714,68 @@ static const struct file_operations fops +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/debugfs.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1679,6 +1679,68 @@ static const struct file_operations fops .open = simple_open }; @@ -524,10 +540,10 @@ + .open = simple_open +}; + - int ath11k_debug_register(struct ath11k *ar) + int ath11k_debugfs_register(struct ath11k *ar) { struct ath11k_base *ab = ar->ab; -@@ -1773,6 +1835,10 @@ int ath11k_debug_register(struct ath11k +@@ -1737,6 +1799,10 @@ int ath11k_debugfs_register(struct ath11 &ar->dfs_block_radar_events); } @@ -538,9 +554,11 @@ return 0; } ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -7334,6 +7334,36 @@ int ath11k_wmi_simulate_radar(struct ath +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c +@@ -7838,6 +7838,36 @@ int ath11k_wmi_simulate_radar(struct ath return ath11k_wmi_send_unit_test_cmd(ar, wmi_ut, dfs_args); } @@ -577,9 +595,11 @@ int ath11k_wmi_connect(struct ath11k_base *ab) { u32 i; ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2053,6 +2053,11 @@ enum wmi_tlv_service { +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2078,6 +2078,11 @@ enum wmi_tlv_service { WMI_MAX_EXT_SERVICE }; @@ -591,7 +611,7 @@ enum { WMI_SMPS_FORCED_MODE_NONE = 0, WMI_SMPS_FORCED_MODE_DISABLED, -@@ -3899,6 +3904,15 @@ struct wmi_dfs_unit_test_arg { +@@ -3921,6 +3926,15 @@ struct wmi_dfs_unit_test_arg { u32 radar_param; }; @@ -607,35 +627,40 @@ struct wmi_unit_test_cmd { u32 tlv_header; u32 vdev_id; -@@ -5395,4 +5409,5 @@ int ath11k_wmi_vdev_spectral_enable(stru - u32 trigger, u32 enable); - int ath11k_wmi_vdev_spectral_conf(struct ath11k *ar, - struct ath11k_wmi_vdev_spectral_conf_param *param); +@@ -5653,5 +5667,6 @@ int ath11k_wmi_set_hw_mode(struct ath11k + enum wmi_host_hw_mode_config_type mode); + int ath11k_wmi_wow_host_wakeup_ind(struct ath11k *ar); + int ath11k_wmi_wow_enable(struct ath11k *ar); +int ath11k_wmi_pdev_m3_dump_enable(struct ath11k *ar, u32 enable); + #endif ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -42,6 +42,7 @@ static const struct ath11k_hw_params ath +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/core.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.c +@@ -43,6 +43,7 @@ static const struct ath11k_hw_params ath + .bdf_addr = 0x4B0C0000, .hw_ops = &ipq8074_ops, - .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .credit_flow = false, + .m3_addr = ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS, .ring_mask = &ath11k_hw_ring_mask_ipq8074, .internal_sleep_clock = false, .regs = &ipq8074_regs, -@@ -75,6 +76,7 @@ static const struct ath11k_hw_params ath +@@ -84,6 +85,7 @@ static const struct ath11k_hw_params ath + .bdf_addr = 0x4ABC0000, .hw_ops = &ipq6018_ops, - .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .credit_flow = false, + .m3_addr = ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS, .ring_mask = &ath11k_hw_ring_mask_ipq8074, .internal_sleep_clock = false, .regs = &ipq8074_regs, ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -165,6 +165,7 @@ struct ath11k_hw_params { - bool htt_peer_map_v2; - bool tcl_0_only; +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/hw.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/hw.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/hw.h +@@ -166,6 +166,7 @@ struct ath11k_hw_params { + bool cold_boot_calib; + bool supports_suspend; u32 hal_desc_sz; + u32 m3_addr; }; diff --git a/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-new-dfs-region-name-JP.patch b/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-new-dfs-region-name-JP.patch deleted file mode 100644 index 9da15603d..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-new-dfs-region-name-JP.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/reg.c -+++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -315,6 +315,7 @@ ath11k_map_fw_dfs_region(enum ath11k_dfs - case ATH11K_DFS_REG_KR: - return NL80211_DFS_ETSI; - case ATH11K_DFS_REG_MKK: -+ case ATH11K_DFS_REG_MKK_N: - return NL80211_DFS_JP; - default: - return NL80211_DFS_UNSET; ---- a/drivers/net/wireless/ath/ath11k/reg.h -+++ b/drivers/net/wireless/ath/ath11k/reg.h -@@ -20,6 +20,7 @@ enum ath11k_dfs_region { - ATH11K_DFS_REG_MKK, - ATH11K_DFS_REG_CN, - ATH11K_DFS_REG_KR, -+ ATH11K_DFS_REG_MKK_N, - ATH11K_DFS_REG_UNDEF, - }; - diff --git a/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-support-for-device-recovery.patch b/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-support-for-device-recovery.patch index 32011d30f..7bbc9668b 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-support-for-device-recovery.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/189-ath11k-add-support-for-device-recovery.patch @@ -28,7 +28,7 @@ Signed-off-by: Wen Gong --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -910,9 +910,49 @@ static void ath11k_core_restart(struct w +@@ -1075,9 +1075,49 @@ static void ath11k_core_restart(struct w } mutex_unlock(&ar->conf_mutex); } @@ -78,7 +78,7 @@ Signed-off-by: Wen Gong static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; -@@ -1044,14 +1084,20 @@ struct ath11k_base *ath11k_core_alloc(st +@@ -1179,14 +1219,20 @@ struct ath11k_base *ath11k_core_alloc(st if (!ab->workqueue) goto err_sc_free; @@ -97,9 +97,9 @@ Signed-off-by: Wen Gong INIT_WORK(&ab->restart_work, ath11k_core_restart); + INIT_WORK(&ab->reset_work, ath11k_core_reset); timer_setup(&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0); - ab->dev = dev; - ab->bus_params = *bus_params; -@@ -1059,6 +1105,8 @@ struct ath11k_base *ath11k_core_alloc(st + init_completion(&ab->htc_suspend); + init_completion(&ab->wow.wakeup_completed); +@@ -1197,6 +1243,8 @@ struct ath11k_base *ath11k_core_alloc(st return ab; @@ -118,7 +118,7 @@ Signed-off-by: Wen Gong #define ATH11K_INVALID_HW_MAC_ID 0xFF #define ATH11K_RX_RATE_TABLE_NUM 320 #define ATH11K_RX_RATE_TABLE_11AX_NUM 576 -@@ -804,6 +805,11 @@ struct ath11k_base { +@@ -819,6 +820,11 @@ struct ath11k_base { struct completion driver_recovery; struct workqueue_struct *workqueue; struct work_struct restart_work; @@ -162,28 +162,38 @@ Signed-off-by: Wen Gong static int ath11k_mhi_op_runtime_get(struct mhi_controller *mhi_cntrl) { return 0; -@@ -293,6 +316,14 @@ static void ath11k_mhi_op_runtime_put(st - static void ath11k_mhi_op_status_cb(struct mhi_controller *mhi_cntrl, - enum mhi_callback cb) +@@ -288,6 +311,7 @@ static int ath11k_mhi_op_runtime_get(str + + static void ath11k_mhi_op_runtime_put(struct mhi_controller *mhi_cntrl) { -+ struct ath11k_base *ab = dev_get_drvdata(mhi_cntrl->cntrl_dev); + + } + + static void ath11k_mhi_op_status_cb(struct mhi_controller *mhi_cntrl, +@@ -295,10 +319,16 @@ static void ath11k_mhi_op_status_cb(stru + { + struct ath11k_base *ab = dev_get_drvdata(mhi_cntrl->cntrl_dev); + + ath11k_info(ab, "mhi notify status reason %s\n", + ath11k_mhi_callback_to_str(cb)); + -+ if (cb == MHI_CB_EE_RDDM) + switch (cb) { + case MHI_CB_SYS_ERROR: + ath11k_warn(ab, "firmware crashed: MHI_CB_SYS_ERROR\n"); + break; ++ case MHI_CB_EE_RDDM: + queue_work(ab->workqueue_aux, &ab->reset_work); -+ - } - - static int ath11k_mhi_op_read_reg(struct mhi_controller *mhi_cntrl, ++ break; + default: + break; + } --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -1076,6 +1076,7 @@ static void ath11k_pci_remove(struct pci - struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); +@@ -1334,6 +1334,7 @@ static void ath11k_pci_remove(struct pci + } set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); + cancel_work_sync(&ab->reset_work); - ath11k_core_deinit(ab); - ath11k_mhi_unregister(ab_pci); + + ath11k_core_deinit(ab); diff --git a/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-add-mgmt-and-data-ack-rssi.patch b/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-add-mgmt-and-data-ack-rssi.patch index e1f358092..3dbbfb161 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-add-mgmt-and-data-ack-rssi.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-add-mgmt-and-data-ack-rssi.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7408,6 +7408,8 @@ static int __ath11k_mac_register(struct +@@ -7660,6 +7660,8 @@ static int __ath11k_mac_register(struct ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations; @@ -11,16 +11,17 @@ ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1; --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -3578,7 +3578,7 @@ ath11k_wmi_copy_resource_config(struct w +@@ -3921,7 +3921,8 @@ ath11k_wmi_copy_resource_config(struct w + wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; - wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE | -- WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64; -+ WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 | WMI_RSRC_CFG_FLAG1_ACK_RSSI; +- wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64; ++ wmi_cfg->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 | ++ WMI_RSRC_CFG_FLAG1_ACK_RSSI; wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; wmi_cfg->sched_params = tg_cfg->sched_params; wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; -@@ -4852,8 +4852,7 @@ static int ath11k_pull_mgmt_rx_params_tl +@@ -5180,8 +5181,7 @@ static int ath11k_pull_mgmt_rx_params_tl return 0; } @@ -30,7 +31,7 @@ { struct sk_buff *msdu; struct ieee80211_tx_info *info; -@@ -4866,24 +4865,28 @@ static int wmi_process_mgmt_tx_comp(stru +@@ -5194,24 +5194,28 @@ static int wmi_process_mgmt_tx_comp(stru u16 frm_type; spin_lock_bh(&ar->txmgmt_idr_lock); @@ -63,7 +64,7 @@ hdr = (struct ieee80211_hdr *)msdu->data; frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); -@@ -4903,7 +4906,7 @@ static int wmi_process_mgmt_tx_comp(stru +@@ -5231,7 +5235,7 @@ static int wmi_process_mgmt_tx_comp(stru arvif = ath11k_vif_to_arvif(vif); mgmt_stats = &arvif->mgmt_stats; @@ -72,7 +73,7 @@ mgmt_stats->tx_compl_succ[frm_type]++; else mgmt_stats->tx_compl_fail[frm_type]++; -@@ -4944,6 +4947,7 @@ static int ath11k_pull_mgmt_tx_compl_par +@@ -5272,6 +5276,7 @@ static int ath11k_pull_mgmt_tx_compl_par param->pdev_id = ev->pdev_id; param->desc_id = ev->desc_id; param->status = ev->status; @@ -80,7 +81,7 @@ kfree(tb); return 0; -@@ -6419,8 +6423,7 @@ static void ath11k_mgmt_tx_compl_event(s +@@ -6746,8 +6751,7 @@ static void ath11k_mgmt_tx_compl_event(s goto exit; } @@ -92,15 +93,15 @@ "mgmt tx compl ev pdev_id %d, desc_id %d, status %d", --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2242,6 +2242,7 @@ struct wmi_init_cmd { +@@ -2266,6 +2266,7 @@ struct wmi_init_cmd { + } __packed; - #define WMI_RSRC_CFG_FLAG1_EAPOL_REKEY_MINRATE BIT(14) #define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5) +#define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18) struct wmi_resource_config { u32 tlv_header; -@@ -4419,6 +4420,8 @@ struct wmi_mgmt_tx_compl_event { +@@ -4452,6 +4453,8 @@ struct wmi_mgmt_tx_compl_event { u32 desc_id; u32 status; u32 pdev_id; @@ -109,19 +110,3 @@ } __packed; struct wmi_scan_event { ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -1257,6 +1257,13 @@ void ieee80211_tx_status_8023(struct iee - ieee80211_sta_reset_conn_monitor(sdata); - - sta->status_stats.last_ack = jiffies; -+ if (info->status.is_valid_ack_signal) { -+ sta->status_stats.last_ack_signal = -+ (s8)info->status.ack_signal; -+ sta->status_stats.ack_signal_filled = true; -+ ewma_avg_signal_add(&sta->status_stats.avg_ack_signal, -+ -info->status.ack_signal); -+ } - if (info->flags & IEEE80211_TX_STAT_ACK) { - if (sta->status_stats.lost_packets) - sta->status_stats.lost_packets = 0; diff --git a/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-update-ulmumimo-ofdma-htt-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-update-ulmumimo-ofdma-htt-stats.patch index 6a7a92ac5..918017ab6 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-update-ulmumimo-ofdma-htt-stats.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/191-ath11k-update-ulmumimo-ofdma-htt-stats.patch @@ -1,5 +1,5 @@ ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c @@ -1417,6 +1417,8 @@ htt_print_tx_selfgen_ax_stats_tlv(const htt_stats_buf->ax_mu_mimo_brpoll_7); len += HTT_DBG_OUT(buf + len, buf_len - len, "ax_basic_trigger = %u\n", @@ -132,8 +132,8 @@ len += HTT_DBG_OUT(buf + len, buf_len - len, "\nper_chain_rssi_pkt_type = %#x", htt_stats_buf->per_chain_rssi_pkt_type); ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h @@ -657,6 +657,7 @@ struct htt_tx_selfgen_ax_stats_tlv { u32 ax_bsr_trigger; u32 ax_mu_bar_trigger; diff --git a/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-fix-rx-bytes-value-not-updated-on-mesh.patch b/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-fix-rx-bytes-value-not-updated-on-mesh.patch index af471b0f1..36ddb26d1 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-fix-rx-bytes-value-not-updated-on-mesh.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-fix-rx-bytes-value-not-updated-on-mesh.patch @@ -14,7 +14,7 @@ Signed-off-by: Thiraviyam Mariyappan --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -1775,11 +1775,18 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1720,11 +1720,18 @@ ieee80211_rx_h_sta_process(struct ieee80 struct sk_buff *skb = rx->skb; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -33,7 +33,7 @@ Signed-off-by: Thiraviyam Mariyappan /* * Update last_rx only for IBSS packets which are for the current * BSSID and for station already AUTHORIZED to avoid keeping the -@@ -1789,51 +1796,51 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1734,49 +1741,49 @@ ieee80211_rx_h_sta_process(struct ieee80 * something went wrong the first time. */ if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { @@ -46,14 +46,14 @@ Signed-off-by: Thiraviyam Mariyappan + stats->last_rx = jiffies; if (ieee80211_is_data(hdr->frame_control) && !is_multicast_ether_addr(hdr->addr1)) -- sta->rx_stats.last_rate = -+ stats->last_rate = + sta->rx_stats.last_rate = sta_stats_encode_rate(status); } } else if (rx->sdata->vif.type == NL80211_IFTYPE_OCB) { - sta->rx_stats.last_rx = jiffies; + stats->last_rx = jiffies; - } else if (!is_multicast_ether_addr(hdr->addr1)) { + } else if (!ieee80211_is_s1g_beacon(hdr->frame_control) && + !is_multicast_ether_addr(hdr->addr1)) { /* * Mesh beacons will update last_rx when if they are found to * match the current local configuration when processed. @@ -65,9 +65,6 @@ Signed-off-by: Thiraviyam Mariyappan + stats->last_rate = sta_stats_encode_rate(status); } - if (rx->sdata->vif.type == NL80211_IFTYPE_STATION) - ieee80211_sta_rx_notify(rx->sdata, hdr); - - sta->rx_stats.fragments++; + stats->fragments++; @@ -98,7 +95,7 @@ Signed-off-by: Thiraviyam Mariyappan ewma_signal_add(&sta->rx_stats_avg.chain_signal[i], -signal); } -@@ -1893,8 +1900,8 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1838,8 +1845,8 @@ ieee80211_rx_h_sta_process(struct ieee80 * Update counter and free packet here to avoid * counting this as a dropped packed. */ @@ -109,3 +106,131 @@ Signed-off-by: Thiraviyam Mariyappan return RX_QUEUED; } +@@ -2202,6 +2209,7 @@ ieee80211_rx_h_defragment(struct ieee802 + unsigned int frag, seq; + struct ieee80211_fragment_entry *entry; + struct sk_buff *skb; ++ struct ieee80211_sta_rx_stats *stats; + + hdr = (struct ieee80211_hdr *)rx->skb->data; + fc = hdr->frame_control; +@@ -2330,8 +2338,12 @@ ieee80211_rx_h_defragment(struct ieee802 + out: + ieee80211_led_rx(rx->local); + out_no_led: +- if (rx->sta) +- rx->sta->rx_stats.packets++; ++ if (rx->sta) { ++ stats = &rx->sta->rx_stats; ++ if (ieee80211_hw_check(&rx->sdata->local->hw, USES_RSS)) ++ stats = this_cpu_ptr(rx->sta->pcpu_rx_stats); ++ stats->packets++; ++ } + return RX_CONTINUE; + } + +@@ -3132,6 +3144,7 @@ ieee80211_rx_h_action(struct ieee80211_r + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); + int len = rx->skb->len; ++ struct ieee80211_sta_rx_stats *stats; + + if (!ieee80211_is_action(mgmt->frame_control)) + return RX_CONTINUE; +@@ -3413,16 +3426,24 @@ ieee80211_rx_h_action(struct ieee80211_r + return RX_CONTINUE; + + handled: +- if (rx->sta) +- rx->sta->rx_stats.packets++; ++ if (rx->sta) { ++ stats = &rx->sta->rx_stats; ++ if (ieee80211_hw_check(&local->hw, USES_RSS)) ++ stats = this_cpu_ptr(rx->sta->pcpu_rx_stats); ++ stats->packets++; ++ } + dev_kfree_skb(rx->skb); + return RX_QUEUED; + + queue: + skb_queue_tail(&sdata->skb_queue, rx->skb); + ieee80211_queue_work(&local->hw, &sdata->work); +- if (rx->sta) +- rx->sta->rx_stats.packets++; ++ if (rx->sta) { ++ stats = &rx->sta->rx_stats; ++ if (ieee80211_hw_check(&local->hw, USES_RSS)) ++ stats = this_cpu_ptr(rx->sta->pcpu_rx_stats); ++ stats->packets++; ++ } + return RX_QUEUED; + } + +@@ -3465,6 +3486,7 @@ ieee80211_rx_h_action_post_userspace(str + struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; + int len = rx->skb->len; ++ struct ieee80211_sta_rx_stats *stats; + + if (!ieee80211_is_action(mgmt->frame_control)) + return RX_CONTINUE; +@@ -3488,8 +3510,12 @@ ieee80211_rx_h_action_post_userspace(str + return RX_CONTINUE; + + handled: +- if (rx->sta) +- rx->sta->rx_stats.packets++; ++ if (rx->sta) { ++ stats = &rx->sta->rx_stats; ++ if (ieee80211_hw_check(&rx->sdata->local->hw, USES_RSS)) ++ stats = this_cpu_ptr(rx->sta->pcpu_rx_stats); ++ stats->packets++; ++ } + dev_kfree_skb(rx->skb); + return RX_QUEUED; + } +@@ -3583,6 +3609,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ + { + struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; ++ struct ieee80211_sta_rx_stats *stats; + __le16 stype; + + stype = mgmt->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE); +@@ -3633,8 +3660,12 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ + /* queue up frame and kick off work to process it */ + skb_queue_tail(&sdata->skb_queue, rx->skb); + ieee80211_queue_work(&rx->local->hw, &sdata->work); +- if (rx->sta) +- rx->sta->rx_stats.packets++; ++ if (rx->sta) { ++ stats = &rx->sta->rx_stats; ++ if (ieee80211_hw_check(&rx->sdata->local->hw, USES_RSS)) ++ stats = this_cpu_ptr(rx->sta->pcpu_rx_stats); ++ stats->packets++; ++ } + + return RX_QUEUED; + } +--- a/net/mac80211/mesh_plink.c ++++ b/net/mac80211/mesh_plink.c +@@ -416,6 +416,7 @@ static void mesh_sta_info_init(struct ie + struct ieee80211_supported_band *sband; + u32 rates, basic_rates = 0, changed = 0; + enum ieee80211_sta_rx_bandwidth bw = sta->sta.bandwidth; ++ struct ieee80211_sta_rx_stats *stats; + + sband = ieee80211_get_sband(sdata); + if (!sband) +@@ -425,7 +426,10 @@ static void mesh_sta_info_init(struct ie + &basic_rates); + + spin_lock_bh(&sta->mesh->plink_lock); +- sta->rx_stats.last_rx = jiffies; ++ stats = &sta->rx_stats; ++ if (ieee80211_hw_check(&local->hw, USES_RSS)) ++ stats = this_cpu_ptr(sta->pcpu_rx_stats); ++ stats->last_rx = jiffies; + + /* rates and capabilities don't change during peering */ + if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && diff --git a/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-support-for-2g-phyb-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-support-for-2g-phyb-mode.patch deleted file mode 100644 index ed8c1431a..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/192-ath11k-support-for-2g-phyb-mode.patch +++ /dev/null @@ -1,444 +0,0 @@ -From 855875eaff2282053d536e6774dfabaad4b937d9 Mon Sep 17 00:00:00 2001 -From: P Praneesh -Date: Tue, 16 Jun 2020 16:57:46 +0530 -Subject: [PATCH] ath11k: add support for 2G PHYB mode - -This mode is supported through hw_mode_id 7 and it is -special mode for IPQ8074 platform alone to bring up -single pdev alone on 2G mode. - -Signed-off-by: P Praneesh ---- - drivers/net/wireless/ath/ath11k/ahb.c | 5 +++ - drivers/net/wireless/ath/ath11k/core.h | 3 +- - drivers/net/wireless/ath/ath11k/dbring.c | 2 +- - drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- - drivers/net/wireless/ath/ath11k/dp_tx.c | 4 +- - drivers/net/wireless/ath/ath11k/hw.c | 5 ++- - drivers/net/wireless/ath/ath11k/mac.c | 45 +++++++++++++++++++- - drivers/net/wireless/ath/ath11k/wmi.c | 71 +++++++++++++++++++++++-------- - drivers/net/wireless/ath/ath11k/wmi.h | 10 ++++- - 9 files changed, 119 insertions(+), 28 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -494,6 +494,11 @@ static int ath11k_ahb_ext_irq_config(str - irq_grp->irqs[num_irq++] = reo2host_status; - - if (j < ab->hw_params.max_radios) { -+ /* for phyb_2g mode configure irq for only pdev_idx 0 */ -+ if (ab->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_2G_PHYB) -+ if (j != 0) -+ continue; -+ - if (ab->hw_params.ring_mask->rxdma2host[i] & BIT(j)) { - irq_grp->irqs[num_irq++] = - rxdma2host_destination_ring_mac1 - ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -822,7 +822,8 @@ struct ath11k_base { - - struct ath11k_dbring_cap *db_caps; - u32 num_db_cap; -- -+ u32 sw_pdev_id_map[MAX_RADIOS]; -+ u32 hw_pdev_id_map[MAX_RADIOS]; - /* must be last */ - u8 drv_priv[0] __aligned(sizeof(void *)); - }; ---- a/drivers/net/wireless/ath/ath11k/dbring.c -+++ b/drivers/net/wireless/ath/ath11k/dbring.c -@@ -121,7 +121,7 @@ int ath11k_dbring_wmi_cfg_setup(struct a - if (id >= WMI_DIRECT_BUF_MAX) - return -EINVAL; - -- param.pdev_id = DP_SW2HW_MACID(ring->pdev_id); -+ param.pdev_id = ar->ab->hw_pdev_id_map[ring->pdev_id]; - param.module_id = id; - param.base_paddr_lo = lower_32_bits(ring->refill_srng.paddr); - param.base_paddr_hi = upper_32_bits(ring->refill_srng.paddr); ---- a/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1724,7 +1724,7 @@ static void ath11k_htt_backpressure_even - - bp_stats = &ab->soc_stats.bp_stats.umac_ring_bp_stats[ring_id]; - } else if (ring_type == HTT_BACKPRESSURE_LMAC_RING_TYPE) { -- pdev_idx = DP_HW2SW_MACID(pdev_id); -+ pdev_idx = ab->sw_pdev_id_map[pdev_id - 1]; - - if (ring_id >= HTT_SW_LMAC_RING_IDX_MAX || pdev_idx >= MAX_RADIOS) - return; ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -773,7 +773,7 @@ int ath11k_dp_tx_htt_srng_setup(struct a - if (htt_ring_type == HTT_SW_TO_HW_RING || - htt_ring_type == HTT_HW_TO_SW_RING) - cmd->info0 |= FIELD_PREP(HTT_SRNG_SETUP_CMD_INFO0_PDEV_ID, -- DP_SW2HW_MACID(mac_id)); -+ ab->hw_pdev_id_map[mac_id]); - else - cmd->info0 |= FIELD_PREP(HTT_SRNG_SETUP_CMD_INFO0_PDEV_ID, - mac_id); -@@ -957,7 +957,7 @@ int ath11k_dp_tx_htt_rx_filter_setup(str - htt_ring_type == HTT_HW_TO_SW_RING) - cmd->info0 |= - FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PDEV_ID, -- DP_SW2HW_MACID(mac_id)); -+ ab->hw_pdev_id_map[mac_id]); - else - cmd->info0 |= - FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PDEV_ID, ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -12,11 +12,16 @@ - #include "ce.h" - - /* Map from pdev index to hw mac index */ --static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx) -+static u8 ath11k_hw_ipq8074_mac_from_pdev_id(struct ath11k_hw_params *hw, int pdev_idx) - { -+ struct ath11k_base *ab = container_of(hw, struct ath11k_base, hw_params); -+ - switch (pdev_idx) { - case 0: -- return 0; -+ if (ab->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_2G_PHYB) -+ return 2; -+ else -+ return 0; - case 1: - return 2; - case 2: -@@ -26,7 +31,7 @@ static u8 ath11k_hw_ipq8074_mac_from_pde - } - } - --static u8 ath11k_hw_ipq6018_mac_from_pdev_id(int pdev_idx) -+static u8 ath11k_hw_ipq6018_mac_from_pdev_id(struct ath11k_hw_params *hw, int pdev_idx) - { - return pdev_idx; - } ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -545,8 +545,9 @@ struct ath11k *ath11k_mac_get_ar_by_pdev - return pdev ? pdev->ar : NULL; - } - -- if (WARN_ON(pdev_id > ab->num_radios)) -- return NULL; -+ if (ab->wmi_ab.preferred_hw_mode != WMI_HOST_HW_MODE_2G_PHYB) -+ if (WARN_ON(pdev_id > ab->num_radios)) -+ return NULL; - - for (i = 0; i < ab->num_radios; i++) { - if (ab->fw_mode == ATH11K_FIRMWARE_MODE_FTM) -@@ -7517,6 +7518,44 @@ err_cleanup: - return ret; - } - -+void ath11k_mac_pdev_map(struct ath11k_base *ab) -+{ -+ /* sw_pdev_id_map is used by host*/ -+ u32 sw_pdev_id_map[MAX_RADIOS] = { WMI_HOST_PDEV_ID_0, -+ WMI_HOST_PDEV_ID_1, -+ WMI_HOST_PDEV_ID_2 }; -+ -+ /* hw_pdev_id_map is used by firmware */ -+ u32 hw_pdev_id_map[MAX_RADIOS] = { WMI_HOST_PDEV_ID_1, -+ WMI_HOST_PDEV_ID_2, -+ WMI_HOST_PDEV_ID_3 }; -+ -+ /* In PHYB-2G mode, host WMI_HOST_PDEV_ID_1 and -+ * WMI_HOST_PDEV_ID_2 are unused, only 2G radio is active */ -+ u32 sw_pdev_id_map_phyb2g[MAX_RADIOS] = { WMI_HOST_PDEV_ID_1, -+ WMI_HOST_PDEV_ID_0, -+ WMI_HOST_PDEV_ID_2 }; -+ -+ /* In PHYB-2G mode, firmware WMI_HOST_PDEV_ID_1 and -+ * WMI_HOST_PDEV_ID_3 are unused, only 2G radio is active */ -+ u32 hw_pdev_id_map_phyb2g[MAX_RADIOS] = { WMI_HOST_PDEV_ID_2, -+ WMI_HOST_PDEV_ID_1, -+ WMI_HOST_PDEV_ID_3 }; -+ -+ if (ab->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_2G_PHYB) { -+ /* Host and firmware pdev_map for PHYB2G hw mode */ -+ memcpy(ab->sw_pdev_id_map,sw_pdev_id_map_phyb2g, -+ MAX_RADIOS * sizeof(u32)); -+ memcpy(ab->hw_pdev_id_map,hw_pdev_id_map_phyb2g, -+ MAX_RADIOS * sizeof(u32)); -+ } else { -+ memcpy(ab->sw_pdev_id_map,sw_pdev_id_map, -+ MAX_RADIOS * sizeof(u32)); -+ memcpy(ab->hw_pdev_id_map,hw_pdev_id_map, -+ MAX_RADIOS * sizeof(u32)); -+ } -+} -+ - int ath11k_mac_allocate(struct ath11k_base *ab) - { - struct ieee80211_hw *hw; -@@ -7557,6 +7596,8 @@ int ath11k_mac_allocate(struct ath11k_ba - ar->num_rx_chains = get_num_chains(pdev->cap.rx_chain_mask); - - pdev->ar = ar; -+ ath11k_mac_pdev_map(ab); -+ - spin_lock_init(&ar->data_lock); - INIT_LIST_HEAD(&ar->arvifs); - INIT_LIST_HEAD(&ar->ppdu_stats_info); ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -139,6 +139,8 @@ static const int ath11k_hw_mode_pri_map[ - PRIMAP(WMI_HOST_HW_MODE_SBS), - PRIMAP(WMI_HOST_HW_MODE_DBS_SBS), - PRIMAP(WMI_HOST_HW_MODE_DBS_OR_SBS), -+ PRIMAP(WMI_HOST_HW_MODE_FW_INTERNAL), -+ PRIMAP(WMI_HOST_HW_MODE_2G_PHYB), - /* keep last */ - PRIMAP(WMI_HOST_HW_MODE_MAX), - }; -@@ -343,8 +345,8 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st - - phy_map = wmi_hw_mode_caps[hw_idx].phy_id_map; - while (phy_map) { -+ phy_idx += phy_map & 1; - phy_map >>= 1; -- phy_idx++; - } - } - -@@ -3091,7 +3093,7 @@ int ath11k_wmi_pdev_peer_pktlog_filter(s - cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD) | - FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); - -- cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); -+ cmd->pdev_id = ar->ab->sw_pdev_id_map[ar->pdev->pdev_id - 1]; - cmd->num_mac = 1; - cmd->enable = enable; - -@@ -3253,7 +3255,7 @@ int ath11k_wmi_pdev_pktlog_enable(struct - cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_ENABLE_CMD) | - FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); - -- cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); -+ cmd->pdev_id = ar->ab->sw_pdev_id_map[ar->pdev->pdev_id - 1]; - cmd->evlist = pktlog_filter; - cmd->enable = ATH11K_WMI_PKTLOG_ENABLE_FORCE; - -@@ -3283,7 +3285,7 @@ int ath11k_wmi_pdev_pktlog_disable(struc - cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_DISABLE_CMD) | - FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); - -- cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); -+ cmd->pdev_id = ar->ab->sw_pdev_id_map[ar->pdev->pdev_id - 1]; - - ret = ath11k_wmi_cmd_send(wmi, skb, - WMI_PDEV_PKTLOG_DISABLE_CMDID); -@@ -3996,7 +3998,8 @@ static int ath11k_wmi_tlv_dma_buf_parse( - case WMI_TAG_DMA_BUF_RELEASE: - memcpy(&parse->fixed, ptr, - sizeof(struct ath11k_wmi_dma_buf_release_fixed_param)); -- parse->fixed.pdev_id = DP_HW2SW_MACID(parse->fixed.pdev_id); -+ parse->fixed.pdev_id = -+ ab->sw_pdev_id_map[parse->fixed.pdev_id - 1]; - break; - case WMI_TAG_ARRAY_STRUCT: - if (!parse->buf_entry_done) { -@@ -4225,20 +4228,22 @@ static int ath11k_wmi_tlv_ext_soc_hal_re - phy_id_map = svc_rdy_ext->pref_hw_mode_caps.phy_id_map; - - while (phy_id_map && soc->num_radios < MAX_RADIOS) { -- ret = ath11k_pull_mac_phy_cap_svc_ready_ext(wmi_handle, -+ if(phy_id_map & 1) { -+ ret = ath11k_pull_mac_phy_cap_svc_ready_ext(wmi_handle, - svc_rdy_ext->hw_caps, - svc_rdy_ext->hw_mode_caps, - svc_rdy_ext->soc_hal_reg_caps, - svc_rdy_ext->mac_phy_caps, - hw_mode_id, soc->num_radios, - &soc->pdevs[pdev_index]); -- if (ret) { -- ath11k_warn(soc, "failed to extract mac caps, idx :%d\n", -- soc->num_radios); -+ if (ret) { -+ ath11k_warn(soc, "failed to extract mac caps, idx :%d\n", -+ soc->num_radios); - return ret; -- } -+ } - -- soc->num_radios++; -+ soc->num_radios++; -+ } - - /* For QCA6390, save mac_phy capability in the same pdev */ - if (soc->hw_params.single_pdev_only) -@@ -4337,8 +4342,9 @@ static int ath11k_wmi_tlv_dma_ring_caps( - goto free_dir_buff; - } - -+ dir_buff_caps[i].pdev_id = -+ ab->sw_pdev_id_map[dma_caps[i].pdev_id - 1]; - dir_buff_caps[i].id = dma_caps[i].module_id; -- dir_buff_caps[i].pdev_id = DP_HW2SW_MACID(dma_caps[i].pdev_id); - dir_buff_caps[i].min_elem = dma_caps[i].min_elem; - dir_buff_caps[i].min_buf_sz = dma_caps[i].min_buf_sz; - dir_buff_caps[i].min_buf_align = dma_caps[i].min_buf_align; -@@ -5974,18 +5980,25 @@ static int ath11k_reg_chan_list_event(st - goto mem_free; - } - -- pdev_idx = reg_info->phy_id; -- -- if (pdev_idx >= ab->num_radios) { -- /* Process the event for phy0 only if single_pdev_only -- * is true. If pdev_idx is valid but not 0, discard the -- * event. Otherwise, it goes to fallback. -- */ -- if (ab->hw_params.single_pdev_only && -- pdev_idx < ab->hw_params.num_rxmda_per_pdev) -- goto mem_free; -- else -+ if (ab->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_2G_PHYB) { -+ pdev_idx = WMI_PHYID2PDEVIDX_MAP(reg_info->phy_id); -+ if ((pdev_idx > ab->num_radios) && -+ (pdev_idx >= MAX_RADIOS)) - goto fallback; -+ } else { -+ pdev_idx = reg_info->phy_id; -+ -+ if (pdev_idx >= ab->num_radios) { -+ /* Process the event for phy0 only if single_pdev_only -+ * is true. If pdev_idx is valid but not 0, discard the -+ * event. Otherwise, it goes to fallback. -+ */ -+ if (ab->hw_params.single_pdev_only && -+ pdev_idx < ab->hw_params.num_rxmda_per_pdev) -+ goto mem_free; -+ else -+ goto fallback; -+ } - } - - /* Avoid multiple overwrites to default regd, during core -@@ -7206,16 +7219,32 @@ out: - dev_kfree_skb(skb); - } - -+static bool ath11k_wmi_check_phyb2g_mode(struct ath11k_base *ab) -+{ -+ struct device *dev = ab->dev; -+ u32 hw_mode_id = WMI_HOST_HW_MODE_MAX; -+ -+ if (!of_property_read_u32(dev->of_node , "wlan-hw-mode", -+ &hw_mode_id)) { -+ if (hw_mode_id == WMI_HOST_HW_MODE_2G_PHYB) -+ return true; -+ } -+ return false; -+} -+ - static int ath11k_connect_pdev_htc_service(struct ath11k_base *ab, - u32 pdev_idx) - { - int status; -- u32 svc_id[] = { ATH11K_HTC_SVC_ID_WMI_CONTROL, -- ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1, -- ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2 }; -+ u32 default_svc_id[] = { ATH11K_HTC_SVC_ID_WMI_CONTROL, -+ ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1, -+ ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2 }; - - struct ath11k_htc_svc_conn_req conn_req; - struct ath11k_htc_svc_conn_resp conn_resp; -+ u32 phyb2g_svc_id[] = { ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1, -+ ATH11K_HTC_SVC_ID_WMI_CONTROL, -+ ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2 }; - - memset(&conn_req, 0, sizeof(conn_req)); - memset(&conn_resp, 0, sizeof(conn_resp)); -@@ -7226,7 +7255,10 @@ static int ath11k_connect_pdev_htc_servi - conn_req.ep_ops.ep_tx_credits = ath11k_wmi_op_ep_tx_credits; - - /* connect to control service */ -- conn_req.service_id = svc_id[pdev_idx]; -+ if(ath11k_wmi_check_phyb2g_mode(ab)) -+ conn_req.service_id = phyb2g_svc_id[pdev_idx]; -+ else -+ conn_req.service_id = default_svc_id[pdev_idx]; - - status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); - if (status) { ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -34,6 +34,7 @@ struct ath11k_fw_stats; - #define WMI_TLV_CMD_UNSUPPORTED 0 - #define WMI_TLV_PDEV_PARAM_UNSUPPORTED 0 - #define WMI_TLV_VDEV_PARAM_UNSUPPORTED 0 -+#define WMI_PHYID2PDEVIDX_MAP(phy_id) ((phy_id) ? 0 : 1) - - struct wmi_cmd_hdr { - u32 cmd_id; -@@ -82,6 +83,8 @@ struct wmi_tlv { - * as in WMI_HW_MODE_SBS, and 3rd on the other band - * @WMI_HOST_HW_MODE_DBS_OR_SBS: Two PHY with one PHY capabale of both 2G and - * 5G. It can support SBS (5G + 5G) OR DBS (5G + 2G). -+ * @WMI_HOST_HW_MODE_FW_INTERNAL: FW specific internal mode. -+ * @WMI_HOST_HW_MODE_2G_PHYB: Only one phy is active. 2G mode on PhyB. - * @WMI_HOST_HW_MODE_MAX: Max hw_mode_id. Used to indicate invalid mode. - */ - enum wmi_host_hw_mode_config_type { -@@ -91,7 +94,8 @@ enum wmi_host_hw_mode_config_type { - WMI_HOST_HW_MODE_SBS = 3, - WMI_HOST_HW_MODE_DBS_SBS = 4, - WMI_HOST_HW_MODE_DBS_OR_SBS = 5, -- -+ WMI_HOST_HW_MODE_FW_INTERNAL = 6, -+ WMI_HOST_HW_MODE_2G_PHYB = 7, - /* keep last */ - WMI_HOST_HW_MODE_MAX - }; -@@ -100,13 +104,14 @@ enum wmi_host_hw_mode_config_type { - * on the available modes. - */ - enum wmi_host_hw_mode_priority { -+ WMI_HOST_HW_MODE_2G_PHYB_PRI, - WMI_HOST_HW_MODE_DBS_SBS_PRI, - WMI_HOST_HW_MODE_DBS_PRI, - WMI_HOST_HW_MODE_DBS_OR_SBS_PRI, - WMI_HOST_HW_MODE_SBS_PRI, - WMI_HOST_HW_MODE_SBS_PASSIVE_PRI, - WMI_HOST_HW_MODE_SINGLE_PRI, -- -+ WMI_HOST_HW_MODE_FW_INTERNAL_PRI, - /* keep last the lowest priority */ - WMI_HOST_HW_MODE_MAX_PRI - }; -@@ -2769,6 +2774,7 @@ struct rx_reorder_queue_remove_params { - #define WMI_HOST_PDEV_ID_0 0 - #define WMI_HOST_PDEV_ID_1 1 - #define WMI_HOST_PDEV_ID_2 2 -+#define WMI_HOST_PDEV_ID_3 3 - - #define WMI_PDEV_ID_SOC 0 - #define WMI_PDEV_ID_1ST 1 ---- a/drivers/net/wireless/ath/ath11k/hw.h -+++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -169,7 +169,7 @@ struct ath11k_hw_params { - }; - - struct ath11k_hw_ops { -- u8 (*get_hw_mac_from_pdev_id)(int pdev_id); -+ u8 (*get_hw_mac_from_pdev_id)(struct ath11k_hw_params *hw, int pdev_id); - void (*wmi_init_config)(struct ath11k_base *ab, - struct target_resource_config *config); - int (*mac_id_to_pdev_id)(struct ath11k_hw_params *hw, int mac_id); -@@ -222,7 +222,7 @@ int ath11k_hw_get_mac_from_pdev_id(struc - int pdev_idx) - { - if (hw->hw_ops->get_hw_mac_from_pdev_id) -- return hw->hw_ops->get_hw_mac_from_pdev_id(pdev_idx); -+ return hw->hw_ops->get_hw_mac_from_pdev_id(hw, pdev_idx); - - return 0; - } diff --git a/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-add-htt-stats-30-ext-rx-rate.patch b/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-add-htt-stats-30-ext-rx-rate.patch index b16de36d9..63e46d461 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-add-htt-stats-30-ext-rx-rate.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-add-htt-stats-30-ext-rx-rate.patch @@ -1,6 +1,6 @@ ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -62,6 +62,8 @@ enum ath11k_dbg_htt_ext_stats_type { +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -42,6 +42,8 @@ enum ath11k_dbg_htt_ext_stats_type { ATH11K_DBG_HTT_EXT_STATS_PDEV_UL_TRIG_STATS = 26, ATH11K_DBG_HTT_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27, ATH11K_DBG_HTT_EXT_STATS_FSE_RX = 28, @@ -9,9 +9,9 @@ /* keep this last */ ATH11K_DBG_HTT_NUM_EXT_STATS, ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -@@ -4144,6 +4144,79 @@ static inline void htt_print_rx_fse_stat +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c +@@ -4156,6 +4156,79 @@ static inline void htt_print_rx_fse_stat } } @@ -88,10 +88,10 @@ + stats_req->buf_len = len; +} + - static inline void htt_htt_stats_debug_dump(const u32 *tag_buf, - struct debug_htt_stats_req *stats_req) - { -@@ -4563,6 +4636,9 @@ static int ath11k_dbg_htt_ext_stats_pars + static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab, + u16 tag, u16 len, const void *tag_buf, + void *user_data) +@@ -4531,6 +4604,9 @@ static int ath11k_dbg_htt_ext_stats_pars case HTT_STATS_RX_FSE_STATS_TAG: htt_print_rx_fse_stats_tlv(tag_buf, stats_req); break; @@ -101,8 +101,8 @@ default: break; } ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h @@ -111,6 +111,10 @@ enum htt_tlv_tag_t { HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, HTT_STATS_RX_FSE_STATS_TAG = 98, @@ -127,7 +127,7 @@ #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4 #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8 #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT -@@ -1830,4 +1840,35 @@ struct htt_rx_fse_stats_tlv { +@@ -1864,4 +1874,35 @@ struct htt_rx_fse_stats_tlv { u32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX]; }; diff --git a/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-war-pdevid-for-phyb2g-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-war-pdevid-for-phyb2g-mode.patch deleted file mode 100644 index 556f2a1e9..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/193-ath11k-war-pdevid-for-phyb2g-mode.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 2c7950b7bdebbf986b18ad09e18a168bf5ddc3eb Mon Sep 17 00:00:00 2001 -From: P Praneesh -Date: Tue, 16 Jun 2020 17:20:43 +0530 -Subject: [PATCH] ath11k: war firmware pdevid for phyb2g hw mode - -For phyb2g mode firmware sends pdevid 1 instead of -pdevid 2. since firmware changes are not yet merged -add this WAR for fixed pdevid 2 if hardware mode is PHYB2G. - -Signed-off-by: P Praneesh ---- - drivers/net/wireless/ath/ath11k/wmi.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -359,7 +359,11 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st - - mac_phy_caps = wmi_mac_phy_caps + phy_idx; - -- pdev->pdev_id = mac_phy_caps->pdev_id; -+ if (hw_mode_id == WMI_HOST_HW_MODE_2G_PHYB) -+ pdev->pdev_id = WMI_HOST_PDEV_ID_2; -+ else -+ pdev->pdev_id = mac_phy_caps->pdev_id; -+ - pdev_cap->supported_bands |= mac_phy_caps->supported_bands; - pdev_cap->ampdu_density = mac_phy_caps->ampdu_density; - -@@ -4342,8 +4346,7 @@ static int ath11k_wmi_tlv_dma_ring_caps( - goto free_dir_buff; - } - -- dir_buff_caps[i].pdev_id = -- ab->sw_pdev_id_map[dma_caps[i].pdev_id - 1]; -+ dir_buff_caps[i].pdev_id = dma_caps[i].pdev_id; - dir_buff_caps[i].id = dma_caps[i].module_id; - dir_buff_caps[i].min_elem = dma_caps[i].min_elem; - dir_buff_caps[i].min_buf_sz = dma_caps[i].min_buf_sz; ---- a/drivers/net/wireless/ath/ath11k/dbring.c -+++ b/drivers/net/wireless/ath/ath11k/dbring.c -@@ -172,7 +172,7 @@ int ath11k_dbring_buf_setup(struct ath11 - - ring->buf_sz = db_cap->min_buf_sz; - ring->buf_align = db_cap->min_buf_align; -- ring->pdev_id = db_cap->pdev_id; -+ ring->pdev_id = ab->sw_pdev_id_map[db_cap->pdev_id - 1]; - ring->hp_addr = ath11k_hal_srng_get_hp_addr(ar->ab, srng); - ring->tp_addr = ath11k_hal_srng_get_tp_addr(ar->ab, srng); - -@@ -201,7 +201,7 @@ err: - } - - int ath11k_dbring_get_cap(struct ath11k_base *ab, -- u8 pdev_idx, -+ u32 pdev_id, - enum wmi_direct_buffer_module id, - struct ath11k_dbring_cap *db_cap) - { -@@ -214,7 +214,7 @@ int ath11k_dbring_get_cap(struct ath11k_ - return -EINVAL; - - for (i = 0; i < ab->num_db_cap; i++) { -- if (pdev_idx == ab->db_caps[i].pdev_id && -+ if (pdev_id == ab->db_caps[i].pdev_id && - id == ab->db_caps[i].id) { - *db_cap = ab->db_caps[i]; - ---- a/drivers/net/wireless/ath/ath11k/dbring.h -+++ b/drivers/net/wireless/ath/ath11k/dbring.h -@@ -71,7 +71,7 @@ int ath11k_dbring_srng_setup(struct ath1 - int ath11k_dbring_buffer_release_event(struct ath11k_base *ab, - struct ath11k_dbring_buf_release_event *ev); - int ath11k_dbring_get_cap(struct ath11k_base *ab, -- u8 pdev_idx, -+ u32 pdev_id, - enum wmi_direct_buffer_module id, - struct ath11k_dbring_cap *db_cap); - void ath11k_dbring_srng_cleanup(struct ath11k *ar, struct ath11k_dbring *ring); ---- a/drivers/net/wireless/ath/ath11k/spectral.c -+++ b/drivers/net/wireless/ath/ath11k/spectral.c -@@ -991,7 +991,7 @@ int ath11k_spectral_init(struct ath11k_b - ar = ab->pdevs[i].ar; - sp = &ar->spectral; - -- ret = ath11k_dbring_get_cap(ar->ab, ar->pdev_idx, -+ ret = ath11k_dbring_get_cap(ar->ab, ar->pdev->pdev_id, - WMI_DIRECT_BUF_SPECTRAL, - &db_cap); - if (ret) diff --git a/feeds/wifi-ax/mac80211/patches/qca/194-ath11k-use-dev_coredumpm-API-to-collect-rddm.patch b/feeds/wifi-ax/mac80211/patches/qca/194-ath11k-use-dev_coredumpm-API-to-collect-rddm.patch index 8a6779f8c..419cd71aa 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/194-ath11k-use-dev_coredumpm-API-to-collect-rddm.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/194-ath11k-use-dev_coredumpm-API-to-collect-rddm.patch @@ -23,7 +23,7 @@ Signed-off-by: Anilkumar Kolli --- a/drivers/net/wireless/ath/ath11k/Makefile +++ b/drivers/net/wireless/ath/ath11k/Makefile -@@ -23,6 +23,7 @@ ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debug +@@ -24,6 +24,7 @@ ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debug ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o ath11k-$(CONFIG_THERMAL) += thermal.o @@ -33,15 +33,15 @@ Signed-off-by: Anilkumar Kolli --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -8,6 +8,7 @@ - #include +@@ -9,6 +9,7 @@ #include + #include #include "core.h" +#include "coredump.h" #include "dp_tx.h" #include "dp_rx.h" #include "debug.h" -@@ -947,6 +948,9 @@ static void ath11k_core_reset(struct wor +@@ -1112,6 +1113,9 @@ static void ath11k_core_reset(struct wor ab->is_reset = true; @@ -53,7 +53,7 @@ Signed-off-by: Anilkumar Kolli --- /dev/null +++ b/drivers/net/wireless/ath/ath11k/coredump.c -@@ -0,0 +1,325 @@ +@@ -0,0 +1,326 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/** + * Copyright (c) 2020 The Linux Foundation. All rights reserved. @@ -180,6 +180,7 @@ Signed-off-by: Anilkumar Kolli + file_data->tv_sec = cpu_to_le64(timestamp.tv_sec); + file_data->tv_nsec = cpu_to_le64(timestamp.tv_nsec); + file_data->num_seg = num_seg; ++ file_data->seg_size = sizeof(*segments); + + /* copy segment details to file */ + buf += offsetof(struct ath11k_dump_file_data, seg); @@ -381,7 +382,7 @@ Signed-off-by: Anilkumar Kolli +} --- /dev/null +++ b/drivers/net/wireless/ath/ath11k/coredump.h -@@ -0,0 +1,71 @@ +@@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: BSD-3-Clause-Clear */ +/** + * Copyright (c) 2020 The Linux Foundation. All rights reserved. @@ -428,6 +429,8 @@ Signed-off-by: Anilkumar Kolli + u8 unused[8]; + /* number of segments */ + __le32 num_seg; ++ /* ath11k_dump_segment struct size */ ++ __le32 seg_size; + + struct ath11k_dump_segment *seg; + /* struct ath11k_dump_segment + more */ @@ -455,7 +458,7 @@ Signed-off-by: Anilkumar Kolli +#endif --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c -@@ -365,6 +365,7 @@ int ath11k_mhi_register(struct ath11k_pc +@@ -374,6 +374,7 @@ int ath11k_mhi_register(struct ath11k_pc mhi_ctrl->cntrl_dev = ab->dev; mhi_ctrl->fw_image = ab_pci->amss_path; mhi_ctrl->regs = ab->mem; @@ -476,11 +479,11 @@ Signed-off-by: Anilkumar Kolli ATH11K_MHI_DEINIT, --- a/drivers/net/wireless/ath/ath11k/pci.h +++ b/drivers/net/wireless/ath/ath11k/pci.h -@@ -26,6 +26,7 @@ +@@ -23,6 +23,7 @@ /* register used for handshake mechanism to validate UMAC is awake */ #define PCIE_SOC_WAKE_PCIE_LOCAL_REG 0x3004 +#define ATH11K_MAX_PCI_DOMAINS 2 - struct ath11k_msi_user { - char *name; + #define PCIE_PCIE_PARF_LTSSM 0x1e081b0 + #define PARM_LTSSM_VALUE 0x111 diff --git a/feeds/wifi-ax/mac80211/patches/qca/195-ath11k-add-coldboot-calibration-for-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/195-ath11k-add-coldboot-calibration-for-qcn9000.patch index 361a2155a..12e3e034e 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/195-ath11k-add-coldboot-calibration-for-qcn9000.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/195-ath11k-add-coldboot-calibration-for-qcn9000.patch @@ -15,8 +15,10 @@ Signed-off-by: Jaya Surya Mathavan drivers/net/wireless/ath/ath11k/qmi.h | 3 ++- 5 files changed, 48 insertions(+), 28 deletions(-) ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/ahb.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/ahb.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/ahb.c @@ -11,6 +11,7 @@ #include "ahb.h" #include "debug.h" @@ -25,37 +27,39 @@ Signed-off-by: Jaya Surya Mathavan #include static const struct of_device_id ath11k_ahb_of_match[] = { -@@ -338,29 +339,6 @@ static void ath11k_ahb_power_down(struct - rproc_shutdown(ab->tgt_rproc); +@@ -340,31 +341,6 @@ static void ath11k_ahb_power_down(struct + rproc_shutdown(ab_ahb->tgt_rproc); } --int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab) +-static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab) -{ - int timeout; - -- if (enable_cold_boot_cal == 0 || ab->qmi.cal_done) +- if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done || +- ab->hw_params.cold_boot_calib == 0) - return 0; - - ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n"); -- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, (ab->qmi.cal_done == 1), +- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, +- (ab->qmi.cal_done == 1), - ATH11K_COLD_BOOT_FW_RESET_DELAY); - if (timeout <= 0) { -- ath11k_warn(ab, "Coldboot Calibration timed out\n"); -- return -ETIMEDOUT; +- ath11k_cold_boot_cal = 0; +- ath11k_warn(ab, "Coldboot Calibration failed timed out\n"); - } - - /* reset the firmware */ - ath11k_ahb_power_down(ab); - ath11k_ahb_power_up(ab); -- ath11k_dbg(ab, ATH11K_DBG_AHB, "exit wait for cold boot done\n"); - +- ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n"); - return 0; -} - static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) { struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; -@@ -633,10 +611,12 @@ static const struct ath11k_hif_ops ath11 +@@ -653,10 +629,12 @@ static int ath11k_core_get_rproc(struct static int ath11k_ahb_probe(struct platform_device *pdev) { struct ath11k_base *ab; @@ -68,7 +72,7 @@ Signed-off-by: Jaya Surya Mathavan of_id = of_match_device(ath11k_ahb_of_match, &pdev->dev); if (!of_id) { -@@ -674,6 +654,7 @@ static int ath11k_ahb_probe(struct platf +@@ -696,6 +674,7 @@ static int ath11k_ahb_probe(struct platf ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; ab->mem = mem; ab->mem_len = resource_size(mem_res); @@ -76,7 +80,7 @@ Signed-off-by: Jaya Surya Mathavan platform_set_drvdata(pdev, ab); ret = ath11k_core_pre_init(ab); -@@ -704,7 +685,15 @@ static int ath11k_ahb_probe(struct platf +@@ -732,7 +711,13 @@ static int ath11k_ahb_probe(struct platf goto err_ce_free; } @@ -86,16 +90,16 @@ Signed-off-by: Jaya Surya Mathavan + */ + of_property_read_u32(dev->of_node, "wlan-hw-mode", + &hw_mode_id); -+ if (hw_mode_id == WMI_HOST_HW_MODE_2G_PHYB) -+ ab->enable_cold_boot_cal = 0; + + ath11k_qmi_fwreset_from_cold_boot(ab); return 0; ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -777,6 +777,7 @@ struct ath11k_base { +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/core.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +@@ -792,6 +792,7 @@ struct ath11k_base { struct ath11k_targ_cap target_caps; u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE]; bool pdevs_macaddr_valid; @@ -103,8 +107,10 @@ Signed-off-by: Jaya Surya Mathavan int bd_api; struct ath11k_hw_params hw_params; ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/pci.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/pci.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/pci.c @@ -12,6 +12,7 @@ #include "hif.h" #include "mhi.h" @@ -113,15 +119,15 @@ Signed-off-by: Jaya Surya Mathavan #include #define ATH11K_PCI_BAR_NUM 0 -@@ -984,6 +985,7 @@ static int ath11k_pci_probe(struct pci_d - case QCN9000_DEVICE_ID: +@@ -1248,6 +1249,7 @@ static int ath11k_pci_probe(struct pci_d ab_pci->msi_config = &ath11k_msi_config[1]; ab->bus_params.static_window_map = true; -+ ab->enable_cold_boot_cal = enable_cold_boot_cal; + ab->hw_rev = ATH11K_HW_QCN9074_HW10; ++ ab->enable_cold_boot_cal = ath11k_cold_boot_cal; break; default: dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -@@ -1044,6 +1046,7 @@ static int ath11k_pci_probe(struct pci_d +@@ -1295,6 +1297,7 @@ static int ath11k_pci_probe(struct pci_d ath11k_err(ab, "failed to init core: %d\n", ret); goto err_free_irq; } @@ -129,9 +135,11 @@ Signed-off-by: Jaya Surya Mathavan return 0; err_free_irq: ---- a/drivers/net/wireless/ath/ath11k/qmi.c -+++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -6,6 +6,7 @@ +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c +@@ -8,6 +8,7 @@ #include "qmi.h" #include "core.h" #include "debug.h" @@ -139,22 +147,46 @@ Signed-off-by: Jaya Surya Mathavan #include #include #include -@@ -2278,7 +2279,6 @@ static int ath11k_qmi_assign_target_mem_ - { - struct device *dev = ab->dev; - int i, idx; -- u32 caldb_location[2] = {0, 0}; - u32 addr = 0; +@@ -2297,6 +2298,25 @@ static int ath11k_qmi_alloc_target_mem_c - for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { -@@ -2311,12 +2311,17 @@ static int ath11k_qmi_assign_target_mem_ - if (of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr)) - ath11k_warn(ab, "qmi fail to get caldb-addr in dt\n"); + for (i = 0; i < ab->qmi.mem_seg_count; i++) { + chunk = &ab->qmi.target_mem[i]; ++ ++ /* ++ * FW reloads in coldboot/FWrecovery. ++ * in such case, no need to allocate memory for FW again. ++ */ ++ if (chunk->vaddr) { ++ if (chunk->prev_type != chunk->type || ++ chunk->prev_size != chunk->size) { ++ dma_free_coherent(ab->dev, ++ ab->qmi.target_mem[i].size, ++ ab->qmi.target_mem[i].vaddr, ++ ab->qmi.target_mem[i].paddr); ++ ++ ab->qmi.target_mem[i].vaddr = NULL; ++ } else { ++ continue; ++ } ++ } ++ + chunk->vaddr = dma_alloc_coherent(ab->dev, + chunk->size, + &chunk->paddr, +@@ -2316,6 +2336,9 @@ static int ath11k_qmi_alloc_target_mem_c + chunk->type); + return -EINVAL; + } ++ ++ chunk->prev_type = chunk->type; ++ chunk->prev_size = chunk->size; + } -- if (enable_cold_boot_cal) { -+ if (ab->bus_params.fixed_bdf_addr && ab->enable_cold_boot_cal) { - ab->qmi.target_mem[idx].paddr = (u32)addr; - ab->qmi.target_mem[idx].vaddr = (u32)addr; + return 0; +@@ -2364,9 +2387,14 @@ static int ath11k_qmi_assign_target_mem_ + ab->qmi.target_mem[idx].vaddr = + ioremap(ab->qmi.target_mem[idx].paddr, + ab->qmi.target_mem[i].size); - } else { + } else if (ab->bus_params.fixed_bdf_addr) { ab->qmi.target_mem[idx].paddr = 0UL; @@ -167,7 +199,7 @@ Signed-off-by: Jaya Surya Mathavan } ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; -@@ -2899,6 +2904,30 @@ int ath11k_qmi_firmware_start(struct ath +@@ -2966,6 +2994,30 @@ int ath11k_qmi_firmware_start(struct ath return 0; } @@ -195,30 +227,41 @@ Signed-off-by: Jaya Surya Mathavan +} +EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot); + - int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab) + static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab) { - int ret; -@@ -3340,7 +3369,7 @@ static void ath11k_qmi_driver_event_work - queue_work(ab->workqueue, &ab->restart_work); - break; - } -- if (enable_cold_boot_cal && ab->qmi.cal_done == 0) { -+ if (ab->enable_cold_boot_cal && ab->qmi.cal_done == 0) { - ath11k_qmi_process_coldboot_calibration(ab); - } else { - clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); ---- a/drivers/net/wireless/ath/ath11k/qmi.h -+++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -42,7 +42,7 @@ + int timeout; +@@ -3225,7 +3277,7 @@ static void ath11k_qmi_msg_mem_request_c + ret); + return; + } +- } else if (msg->mem_seg_len > 3) { ++ } else { + ret = ath11k_qmi_alloc_target_mem_chunk(ab); + if (ret) { + ath11k_warn(ab, "qmi failed to alloc target memory: %d\n", +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.h +@@ -46,7 +46,7 @@ #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 #define ATH11K_FIRMWARE_MODE_OFF 4 #define ATH11K_QMI_TARGET_MEM_MODE_DEFAULT 0 --#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ) -+#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) +-#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ) ++#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) struct ath11k_base; -@@ -577,6 +577,7 @@ int wlfw_send_qdss_trace_config_download +@@ -112,6 +112,8 @@ struct ath11k_qmi_event_msg { + struct target_mem_chunk { + u32 size; + u32 type; ++ u32 prev_size; ++ u32 prev_type; + dma_addr_t paddr; + u32 *vaddr; + }; +@@ -583,6 +585,7 @@ int wlfw_send_qdss_trace_config_download int ath11k_send_qdss_trace_mode_req(struct ath11k_base *ab, enum wlfw_qdss_trace_mode_enum_v01 mode); diff --git a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-Fix-pci-get-msi-address.patch b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-Fix-pci-get-msi-address.patch deleted file mode 100644 index 2ad5b47ad..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-Fix-pci-get-msi-address.patch +++ /dev/null @@ -1,57 +0,0 @@ -From f7cc8c318aaf15b8e2fc513d2b5106194ad6b1c8 Mon Sep 17 00:00:00 2001 -From: Karthikeyan Periyasamy -Date: Fri, 26 Jun 2020 15:29:08 +0530 -Subject: [PATCH 15/15] ath11k: add 64bit check before reading msi high addr - -Read msi high addr if 64-bit addresses allowed on MSI. - -Tested-On: QCN9000 hw1.0 PCI WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2 - -Signed-off-by: Anilkumar Kolli -Signed-off-by: Karthikeyan Periyasamy ---- - drivers/net/wireless/ath/ath11k/pci.c | 10 ++++++++-- - drivers/net/wireless/ath/ath11k/pci.h | 1 + - 2 files changed, 9 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -295,13 +295,18 @@ int ath11k_pci_get_msi_irq(struct device - static void ath11k_pci_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo, - u32 *msi_addr_hi) - { -+ struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); - struct pci_dev *pci_dev = to_pci_dev(ab->dev); - - pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO, - msi_addr_lo); - -- pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI, -- msi_addr_hi); -+ if (ar_pci->is_msi_64) { -+ pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI, -+ msi_addr_hi); -+ } else { -+ *msi_addr_hi = 0; -+ } - } - - int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ab_pci, char *user_name, -@@ -722,6 +727,7 @@ static int ath11k_pci_enable_msi(struct - } - - ab_pci->msi_ep_base_data = msi_desc->msg.data; -+ ab_pci->is_msi_64 = msi_desc->msi_attrib.is_64; - - ath11k_dbg(ab, ATH11K_DBG_PCI, "msi base data is %d\n", ab_pci->msi_ep_base_data); - ---- a/drivers/net/wireless/ath/ath11k/pci.h -+++ b/drivers/net/wireless/ath/ath11k/pci.h -@@ -46,6 +46,7 @@ struct ath11k_pci { - u16 dev_id; - char amss_path[100]; - u32 msi_ep_base_data; -+ bool is_msi_64; - struct mhi_controller *mhi_ctrl; - const struct ath11k_msi_config *msi_config; - unsigned long mhi_state; diff --git a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-add-qdss-support-for-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-add-qdss-support-for-qcn9000.patch index c8c4063b6..6e9b2cc05 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-add-qdss-support-for-qcn9000.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-add-qdss-support-for-qcn9000.patch @@ -35,16 +35,14 @@ Signed-off-by: Jaya Surya Mathavan --- drivers/net/wireless/ath/ath11k/core.c | 4 +- drivers/net/wireless/ath/ath11k/core.h | 1 + - drivers/net/wireless/ath/ath11k/debug.c | 78 ++++++ + drivers/net/wireless/ath/ath11k/debugfs.c | 78 ++++++ drivers/net/wireless/ath/ath11k/qmi.c | 469 ++++++++++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/qmi.h | 39 ++- 5 files changed, 560 insertions(+), 31 deletions(-) -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/core.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.h -@@ -782,6 +782,7 @@ struct ath11k_base { +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -797,6 +797,7 @@ struct ath11k_base { struct ath11k_hw_params hw_params; struct ath11k_bus_params bus_params; @@ -52,20 +50,18 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ const struct firmware *cal_file; -@@ -984,6 +985,8 @@ void ath11k_core_free_bdf(struct ath11k_ - - void ath11k_core_halt(struct ath11k *ar); +@@ -997,6 +998,8 @@ void ath11k_core_halt(struct ath11k *ar) + int ath11k_core_resume(struct ath11k_base *ab); + int ath11k_core_suspend(struct ath11k_base *ab); +void ath11k_coredump_qdss_dump(struct ath11k_base *ab, + struct ath11k_qmi_event_qdss_trace_save_data *event_data); const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, const char *filename); -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/debug.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/debug.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/debug.c -@@ -839,6 +839,79 @@ static const struct file_operations fops +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -742,6 +742,79 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -145,7 +141,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static ssize_t ath11k_write_enable_extd_tx_stats(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos) -@@ -1142,6 +1215,9 @@ int ath11k_debug_pdev_create(struct ath1 +@@ -1045,6 +1118,9 @@ int ath11k_debugfs_pdev_create(struct at debugfs_create_file("simulate_fw_crash", 0600, ab->debugfs_soc, ab, &fops_simulate_fw_crash); @@ -155,11 +151,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ debugfs_create_file("soc_dp_stats", 0600, ab->debugfs_soc, ab, &fops_soc_dp_stats); -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/qmi.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.c -@@ -10,6 +10,7 @@ +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -12,6 +12,7 @@ #include #include #include @@ -167,9 +161,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define HOST_CSTATE_BIT 0x04 -@@ -20,10 +21,6 @@ EXPORT_SYMBOL(enable_cold_boot_cal); - module_param(enable_cold_boot_cal, bool, 0644); - MODULE_PARM_DESC(enable_cold_boot_cal, "cold boot calibration enable:1 disable:0"); +@@ -22,10 +23,6 @@ module_param_named(cold_boot_cal, ath11k + MODULE_PARM_DESC(cold_boot_cal, + "Decrease the channel switch time but increase the driver load time (Default: true)"); -unsigned int enable_qdss_trace = 1; -module_param(enable_qdss_trace, uint, 0644); @@ -178,7 +172,129 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static struct qmi_elem_info qmi_wlanfw_qdss_trace_config_download_req_msg_v01_ei[] = { { .data_type = QMI_OPT_FLAG, -@@ -1870,6 +1867,85 @@ static struct qmi_elem_info qmi_wlanfw_m +@@ -455,6 +452,24 @@ static struct qmi_elem_info qmi_wlanfw_h + mem_cfg_mode), + }, + { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1D, ++ .offset = offsetof(struct qmi_wlanfw_host_cap_req_msg_v01, ++ cal_duration_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_2_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u16), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1D, ++ .offset = offsetof(struct qmi_wlanfw_host_cap_req_msg_v01, ++ cal_duration), ++ }, ++ { + .data_type = QMI_EOTI, + .array_type = NO_ARRAY, + .tlv_type = QMI_COMMON_TLV_TYPE, +@@ -719,20 +734,92 @@ static struct qmi_elem_info qmi_wlanfw_i + .elem_len = 1, + .elem_size = sizeof(u8), + .array_type = NO_ARRAY, +- .tlv_type = 0x20, ++ .tlv_type = 0x1C, + .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, +- m3_dump_upload_req_enable_valid), ++ qdss_trace_req_mem_enable_valid), + }, + { + .data_type = QMI_UNSIGNED_1_BYTE, + .elem_len = 1, + .elem_size = sizeof(u8), + .array_type = NO_ARRAY, +- .tlv_type = 0x20, ++ .tlv_type = 0x1C, + .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, +- m3_dump_upload_req_enable), ++ qdss_trace_req_mem_enable), ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1D, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ qdss_trace_save_enable_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1D, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ qdss_trace_save_enable), ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1E, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ qdss_trace_free_enable_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1E, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ qdss_trace_free_enable), ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1F, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ respond_get_info_enable_valid), + }, + { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x1F, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ respond_get_info_enable), ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x20, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ m3_dump_upload_req_enable_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x20, ++ .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, ++ m3_dump_upload_req_enable), ++ }, ++ { + .data_type = QMI_EOTI, + .array_type = NO_ARRAY, + .tlv_type = QMI_COMMON_TLV_TYPE, +@@ -1890,6 +1977,85 @@ static struct qmi_elem_info qmi_wlanfw_m }, }; @@ -264,7 +380,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ int wlfw_send_qdss_trace_config_download_req(struct ath11k_base *ab, const u8 *buffer, unsigned int file_len) { -@@ -1951,19 +2027,19 @@ int ath11k_send_qdss_trace_mode_req(stru +@@ -1971,19 +2137,19 @@ int ath11k_send_qdss_trace_mode_req(stru req.mode_valid = 1; req.mode = mode; req.option_valid = 1; @@ -288,7 +404,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ goto out; } -@@ -1981,12 +2057,6 @@ out: +@@ -2001,12 +2167,6 @@ out: return ret; } @@ -301,7 +417,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static int ath11k_qmi_send_qdss_config(struct ath11k_base *ab) { struct device *dev = ab->dev; -@@ -2251,6 +2321,11 @@ static void ath11k_qmi_free_target_mem_c +@@ -2287,6 +2447,11 @@ static void ath11k_qmi_free_target_mem_c } ab->qmi.target_mem[i].vaddr = NULL; } @@ -313,7 +429,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ } static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) -@@ -2867,21 +2942,12 @@ int ath11k_config_qdss(struct ath11k_bas +@@ -2935,21 +3100,12 @@ int ath11k_config_qdss(struct ath11k_bas if (ab->fw_mode == ATH11K_FIRMWARE_MODE_FTM) return 0; @@ -341,7 +457,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ } int ath11k_qmi_firmware_start(struct ath11k_base *ab, -@@ -3069,6 +3135,23 @@ send_resp: +@@ -3139,6 +3295,23 @@ send_resp: return; } @@ -365,8 +481,8 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static int ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, enum ath11k_qmi_event_type type, -@@ -3122,6 +3205,173 @@ static void ath11k_qmi_event_mem_request - } +@@ -3196,6 +3369,173 @@ static int ath11k_qmi_event_mem_request( + return ret; } +int ath11k_qmi_pci_alloc_qdss_mem(struct ath11k_qmi *qmi) @@ -385,7 +501,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + for (i = 0; i < ab->qmi.qdss_mem_seg_len; i++) { + switch (ab->qmi.qdss_mem[i].type) { + case QDSS_ETR_MEM_REGION_TYPE: -+ if (ab->qmi.qdss_mem[i].size > QMI_Q6_QDSS_ETR_SIZE_QCN9000) { ++ if (ab->qmi.qdss_mem[i].size > QMI_Q6_QDSS_ETR_SIZE_QCN9074) { + ath11k_warn(ab, "%s: FW requests more memory 0x%x\n", + __func__, ab->qmi.qdss_mem[i].size); + return -ENOMEM; @@ -536,10 +652,10 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + ath11k_dbg(ab, ATH11K_DBG_QMI, "QDSS configuration is completed and trace started\n"); +} + - static void ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi) + static int ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi) { struct ath11k_base *ab = qmi->ab; -@@ -3252,6 +3502,83 @@ static void ath11k_qmi_m3_dump_upload_re +@@ -3329,6 +3669,83 @@ static void ath11k_qmi_m3_dump_upload_re event_data); } @@ -623,7 +739,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { { .type = QMI_INDICATION, -@@ -3290,6 +3617,23 @@ static const struct qmi_msg_handler ath1 +@@ -3367,6 +3784,23 @@ static const struct qmi_msg_handler ath1 sizeof(struct qmi_wlanfw_m3_dump_upload_req_ind_msg_v01), .fn = ath11k_qmi_m3_dump_upload_req_ind_cb, }, @@ -647,7 +763,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ }; static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl, -@@ -3383,6 +3727,12 @@ static void ath11k_qmi_driver_event_work +@@ -3472,6 +3906,12 @@ static void ath11k_qmi_driver_event_work case ATH11K_QMI_EVENT_M3_DUMP_UPLOAD_REQ: ath11k_qmi_event_m3_dump_upload_req(qmi, event->data); break; @@ -660,21 +776,19 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ default: ath11k_warn(ab, "invalid event type: %d", event->type); break; -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/qmi.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/qmi.h -@@ -38,6 +38,9 @@ +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -42,6 +42,9 @@ #define QMI_WLFW_FW_READY_IND_V01 0x0038 #define QMI_WLFW_M3_DUMP_UPLOAD_DONE_REQ_V01 0x004E #define QMI_WLFW_M3_DUMP_UPLOAD_REQ_IND_V01 0x004D +#define QMI_WLFW_QDSS_TRACE_REQ_MEM_IND_V01 0x003F -+#define QMI_Q6_QDSS_ETR_SIZE_QCN9000 0x100000 ++#define QMI_Q6_QDSS_ETR_SIZE_QCN9074 0x100000 +#define QMI_WLFW_QDSS_TRACE_SAVE_IND_V01 0x0041 #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 #define ATH11K_FIRMWARE_MODE_OFF 4 -@@ -73,6 +76,8 @@ enum ath11k_qmi_event_type { +@@ -77,6 +80,8 @@ enum ath11k_qmi_event_type { ATH11K_QMI_EVENT_POWER_UP, ATH11K_QMI_EVENT_POWER_DOWN, ATH11K_QMI_EVENT_M3_DUMP_UPLOAD_REQ, @@ -683,16 +797,25 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ ATH11K_QMI_EVENT_MAX, }; -@@ -141,6 +146,8 @@ struct ath11k_qmi { +@@ -113,7 +118,7 @@ struct target_mem_chunk { + u32 size; + u32 type; + dma_addr_t paddr; +- u32 *vaddr; ++ void *vaddr; + }; + + struct target_info { +@@ -146,6 +151,8 @@ struct ath11k_qmi { struct ath11k_qmi_ce_cfg ce_cfg; struct target_mem_chunk target_mem[ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01]; u32 mem_seg_count; + struct target_mem_chunk qdss_mem[ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01]; + u32 qdss_mem_seg_len; u32 target_mem_mode; + bool target_mem_delayed; u8 cal_done; - struct target_info target; -@@ -189,6 +196,7 @@ struct qmi_wlanfw_m3_dump_upload_done_re +@@ -195,6 +202,7 @@ struct qmi_wlanfw_m3_dump_upload_done_re #define QMI_WLANFW_QDSS_TRACE_MODE_REQ_MSG_V01_MAX_LEN 18 #define QMI_WLANFW_QDSS_TRACE_MODE_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLANFW_QDSS_TRACE_MODE_RESP_V01 0x0045 @@ -700,7 +823,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ enum wlfw_qdss_trace_mode_enum_v01 { WLFW_QDSS_TRACE_MODE_ENUM_MIN_VAL_V01 = INT_MIN, -@@ -218,6 +226,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m +@@ -224,6 +232,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m #define BDF_MEM_REGION_TYPE 0x2 #define M3_DUMP_REGION_TYPE 0x3 #define CALDB_MEM_REGION_TYPE 0x4 @@ -708,7 +831,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct qmi_wlanfw_host_cap_req_msg_v01 { u8 num_clients_valid; -@@ -310,7 +319,9 @@ struct qmi_wlanfw_ind_register_resp_msg_ +@@ -316,7 +325,9 @@ struct qmi_wlanfw_ind_register_resp_msg_ #define QMI_WLANFW_REQUEST_MEM_IND_V01 0x0035 #define QMI_WLANFW_RESPOND_MEM_REQ_V01 0x0036 #define QMI_WLANFW_RESPOND_MEM_RESP_V01 0x0036 @@ -718,7 +841,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct qmi_wlanfw_mem_cfg_s_v01 { u64 offset; -@@ -375,6 +386,29 @@ struct qmi_wlanfw_m3_dump_upload_req_ind +@@ -381,6 +392,29 @@ struct qmi_wlanfw_m3_dump_upload_req_ind u64 size; }; @@ -748,7 +871,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ #define QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN 0 #define QMI_WLANFW_CAP_RESP_MSG_V01_MAX_LEN 235 #define QMI_WLANFW_CAP_REQ_V01 0x0024 -@@ -524,7 +558,6 @@ struct qmi_wlanfw_m3_info_resp_msg_v01 { +@@ -530,7 +564,6 @@ struct qmi_wlanfw_m3_info_resp_msg_v01 { #define QMI_WLANFW_WLAN_MODE_RESP_V01 0x0022 #define QMI_WLANFW_WLAN_CFG_REQ_V01 0x0023 #define QMI_WLANFW_WLAN_CFG_RESP_V01 0x0023 @@ -756,7 +879,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ #define QMI_WLANFW_MAX_NUM_CE_V01 12 #define QMI_WLANFW_MAX_NUM_SVC_V01 24 #define QMI_WLANFW_MAX_NUM_SHADOW_REG_V01 24 -@@ -576,7 +609,7 @@ int wlfw_send_qdss_trace_config_download +@@ -582,7 +615,7 @@ int wlfw_send_qdss_trace_config_download const u8 *buffer, unsigned int len); int ath11k_send_qdss_trace_mode_req(struct ath11k_base *ab, diff --git a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-fix-for-accepting-bcast-presp-in-GHz-scan.patch b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-fix-for-accepting-bcast-presp-in-GHz-scan.patch index 4f457f084..a4c2f8d38 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-fix-for-accepting-bcast-presp-in-GHz-scan.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-fix-for-accepting-bcast-presp-in-GHz-scan.patch @@ -20,7 +20,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -399,9 +399,9 @@ struct ath11k_sta { +@@ -409,9 +409,9 @@ struct ath11k_sta { }; #define ATH11K_MIN_5G_FREQ 4150 @@ -35,16 +35,16 @@ Signed-off-by: Pradeep Kumar Chitrapu enum ath11k_state { --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2526,7 +2526,7 @@ static void ath11k_dp_rx_h_ppdu(struct a - channel_num = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); - center_freq = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc) >> 16; +@@ -2518,7 +2518,7 @@ static void ath11k_dp_rx_h_ppdu(struct a + channel_num = meta_data; + center_freq = meta_data >> 16; - if (center_freq >= 5935 && center_freq <= 7105) { + if (center_freq >= ATH11K_MIN_6G_FREQ && center_freq <= ATH11K_MAX_6G_FREQ) { rx_status->band = NL80211_BAND_6GHZ; } else if (channel_num >= 1 && channel_num <= 14) { rx_status->band = NL80211_BAND_2GHZ; -@@ -2545,6 +2545,9 @@ static void ath11k_dp_rx_h_ppdu(struct a +@@ -2540,6 +2540,9 @@ static void ath11k_dp_rx_h_ppdu(struct a rx_status->freq = ieee80211_channel_to_frequency(channel_num, rx_status->band); @@ -56,7 +56,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -101,6 +101,7 @@ static const struct ieee80211_channel at +@@ -96,6 +96,7 @@ static const struct ieee80211_channel at static const struct ieee80211_channel ath11k_6ghz_channels[] = { CHAN6G(1, 5955, 0), @@ -64,7 +64,7 @@ Signed-off-by: Pradeep Kumar Chitrapu CHAN6G(5, 5975, 0), CHAN6G(9, 5995, 0), CHAN6G(13, 6015, 0), -@@ -6859,7 +6860,13 @@ static int ath11k_mac_op_get_survey(stru +@@ -7087,7 +7088,13 @@ static int ath11k_mac_op_get_survey(stru if (!sband) sband = hw->wiphy->bands[NL80211_BAND_5GHZ]; @@ -78,7 +78,7 @@ Signed-off-by: Pradeep Kumar Chitrapu if (!sband || idx >= sband->n_channels) { ret = -ENOENT; goto exit; -@@ -7140,7 +7147,8 @@ static int ath11k_mac_setup_channels_rat +@@ -7340,7 +7347,8 @@ static int ath11k_mac_setup_channels_rat } if (supported_bands & WMI_HOST_WLAN_5G_CAP) { @@ -88,7 +88,7 @@ Signed-off-by: Pradeep Kumar Chitrapu channels = kmemdup(ath11k_6ghz_channels, sizeof(ath11k_6ghz_channels), GFP_KERNEL); if (!channels) { -@@ -7161,7 +7169,8 @@ static int ath11k_mac_setup_channels_rat +@@ -7361,7 +7369,8 @@ static int ath11k_mac_setup_channels_rat reg_cap->high_5ghz_chan); } @@ -100,68 +100,69 @@ Signed-off-by: Pradeep Kumar Chitrapu GFP_KERNEL); --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -2410,6 +2410,36 @@ int ath11k_wmi_send_scan_start_cmd(struc +@@ -2307,25 +2307,23 @@ int ath11k_wmi_send_scan_start_cmd(struc + + if (params->num_hint_bssid) + len += TLV_HDR_SIZE + +- params->num_hint_bssid * sizeof(struct hint_bssid); ++ params->num_hint_bssid * sizeof(struct hint_bssid); + + if (params->num_hint_s_ssid) + len += TLV_HDR_SIZE + +- params->num_hint_s_ssid * sizeof(struct hint_short_ssid); ++ params->num_hint_s_ssid * sizeof(struct hint_short_ssid); + + len += TLV_HDR_SIZE; + if (params->scan_f_en_ie_whitelist_in_probe) + len += params->ie_whitelist.num_vendor_oui * +- sizeof(struct wmi_vendor_oui); +- ++ sizeof(struct wmi_vendor_oui); + len += TLV_HDR_SIZE; + if (params->scan_f_wide_band) + phymode_roundup = + roundup(params->chan_list.num_chan * sizeof(u8), +- sizeof(u32)); ++ sizeof(u32)); + + len += phymode_roundup; +- + skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); + if (!skb) + return -ENOMEM; +@@ -2362,6 +2360,7 @@ int ath11k_wmi_send_scan_start_cmd(struc + cmd->num_ssids = params->num_ssids; + cmd->ie_len = params->extraie.len; + cmd->n_probes = params->n_probes; ++ cmd->scan_ctrl_flags_ext = params->scan_ctrl_flags_ext; + + ptr += sizeof(*cmd); + +@@ -2427,39 +2426,6 @@ int ath11k_wmi_send_scan_start_cmd(struc ptr += extraie_len_with_pad; -+ len = params->ie_whitelist.num_vendor_oui * sizeof(struct wmi_vendor_oui); -+ tlv = ptr; -+ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | -+ FIELD_PREP(WMI_TLV_LEN, len); -+ ptr += TLV_HDR_SIZE; -+ -+ if (params->scan_f_en_ie_whitelist_in_probe) { -+ /* TODO: fill vendor OUIs for probe req ie whitelisting */ -+ /* currently added for FW TLV validation */ -+ } -+ -+ ptr += cmd->num_vendor_oui * sizeof(struct wmi_vendor_oui); -+ -+ len = phymode_roundup; -+ tlv = ptr; -+ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | -+ FIELD_PREP(WMI_TLV_LEN, len); -+ ptr += TLV_HDR_SIZE; -+ -+ /* Wide Band Scan */ -+ if (params->scan_f_wide_band) { -+ phy_ptr = ptr; -+ /* Add PHY mode TLV for wide band scan with phymode + 1 value -+ * so that phymode '0' is ignored by FW as default value. -+ */ -+ for (i = 0; i < params->chan_list.num_chan; ++i) -+ phy_ptr[i] = params->chan_list.chan[i].phymode + 1; -+ } -+ ptr += phymode_roundup; -+ - if (params->num_hint_s_ssid) { - len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); - tlv = ptr; -@@ -2441,69 +2471,6 @@ int ath11k_wmi_send_scan_start_cmd(struc - } - } - -- len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); -- tlv = ptr; -- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | -- FIELD_PREP(WMI_TLV_LEN, len); -- ptr += TLV_HDR_SIZE; - if (params->num_hint_s_ssid) { +- len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); +- tlv = ptr; +- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | +- FIELD_PREP(WMI_TLV_LEN, len); +- ptr += TLV_HDR_SIZE; - s_ssid = ptr; - for (i = 0; i < params->num_hint_s_ssid; ++i) { - s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; - s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; - s_ssid++; - } +- ptr += len; - } -- ptr += len; - -- len = params->num_hint_bssid * sizeof(struct hint_bssid); -- tlv = ptr; -- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | -- FIELD_PREP(WMI_TLV_LEN, len); -- ptr += TLV_HDR_SIZE; - if (params->num_hint_bssid) { +- len = params->num_hint_bssid * sizeof(struct hint_bssid); +- tlv = ptr; +- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | +- FIELD_PREP(WMI_TLV_LEN, len); +- ptr += TLV_HDR_SIZE; - hint_bssid = ptr; - for (i = 0; i < params->num_hint_bssid; ++i) { - hint_bssid->freq_flags = @@ -174,40 +175,47 @@ Signed-off-by: Pradeep Kumar Chitrapu - - ptr += extraie_len_with_pad; - -- len = params->ie_whitelist.num_vendor_oui * sizeof(struct wmi_vendor_oui); -- tlv = ptr; -- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | -- FIELD_PREP(WMI_TLV_LEN, len); -- ptr += TLV_HDR_SIZE; -- -- if (params->scan_f_en_ie_whitelist_in_probe) { -- /* TODO: fill vendor OUIs for probe req ie whitelisting */ -- /* currently added for FW TLV validation */ -- } -- -- ptr += cmd->num_vendor_oui * sizeof(struct wmi_vendor_oui); -- -- len = phymode_roundup; -- tlv = ptr; -- tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | -- FIELD_PREP(WMI_TLV_LEN, len); -- ptr += TLV_HDR_SIZE; -- -- /* Wide Band Scan */ -- if (params->scan_f_wide_band) { -- phy_ptr = ptr; -- /* Add PHY mode TLV for wide band scan with phymode + 1 value -- * so that phymode '0' is ignored by FW as default value. -- */ -- for (i = 0; i < params->chan_list.num_chan; ++i) -- phy_ptr[i] = params->chan_list.chan[i].phymode + 1; -- } -- ptr += phymode_roundup; -- + len = params->ie_whitelist.num_vendor_oui * sizeof(struct wmi_vendor_oui); + tlv = ptr; + tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | +@@ -2490,6 +2456,36 @@ int ath11k_wmi_send_scan_start_cmd(struc + } + ptr += phymode_roundup; + ++ if (params->num_hint_s_ssid) { ++ len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); ++ tlv = ptr; ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | ++ FIELD_PREP(WMI_TLV_LEN, len); ++ ptr += TLV_HDR_SIZE; ++ s_ssid = ptr; ++ for (i = 0; i < params->num_hint_s_ssid; ++i) { ++ s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; ++ s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; ++ s_ssid++; ++ } ++ ptr += len; ++ } ++ ++ if (params->num_hint_bssid) { ++ len = params->num_hint_bssid * sizeof(struct hint_bssid); ++ tlv = ptr; ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | ++ FIELD_PREP(WMI_TLV_LEN, len); ++ ptr += TLV_HDR_SIZE; ++ hint_bssid = ptr; ++ for (i = 0; i < params->num_hint_bssid; ++i) { ++ hint_bssid->freq_flags = ++ params->hint_bssid[i].freq_flags; ++ ether_addr_copy(¶ms->hint_bssid[i].bssid.addr[0], ++ &hint_bssid->bssid.addr[0]); ++ hint_bssid++; ++ } ++ } ret = ath11k_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID); if (ret) { -@@ -4831,7 +4798,7 @@ static int ath11k_pull_mgmt_rx_params_tl +@@ -5160,7 +5156,7 @@ static int ath11k_pull_mgmt_rx_params_tl } hdr->pdev_id = ev->pdev_id; @@ -216,7 +224,7 @@ Signed-off-by: Pradeep Kumar Chitrapu hdr->channel = ev->channel; hdr->snr = ev->snr; hdr->rate = ev->rate; -@@ -6325,7 +6292,8 @@ static void ath11k_mgmt_rx_event(struct +@@ -6653,7 +6649,8 @@ static void ath11k_mgmt_rx_event(struct if (rx_ev.status & WMI_RX_STATUS_ERR_MIC) status->flag |= RX_FLAG_MMIC_ERROR; @@ -226,7 +234,7 @@ Signed-off-by: Pradeep Kumar Chitrapu status->band = NL80211_BAND_6GHZ; } else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) { status->band = NL80211_BAND_2GHZ; -@@ -6349,6 +6317,10 @@ static void ath11k_mgmt_rx_event(struct +@@ -6677,6 +6674,10 @@ static void ath11k_mgmt_rx_event(struct status->freq = ieee80211_channel_to_frequency(rx_ev.channel, status->band); @@ -239,7 +247,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c -@@ -225,13 +225,14 @@ ieee80211_bss_info_update(struct ieee802 +@@ -231,13 +231,14 @@ ieee80211_bss_info_update(struct ieee802 } static bool ieee80211_scan_accept_presp(struct ieee80211_sub_if_data *sdata, @@ -257,7 +265,7 @@ Signed-off-by: Pradeep Kumar Chitrapu return true; if (scan_flags & NL80211_SCAN_FLAG_RANDOM_ADDR) return true; -@@ -257,6 +258,12 @@ void ieee80211_scan_rx(struct ieee80211_ +@@ -266,6 +267,12 @@ void ieee80211_scan_rx(struct ieee80211_ if (likely(!sdata1 && !sdata2)) return; @@ -270,7 +278,7 @@ Signed-off-by: Pradeep Kumar Chitrapu if (ieee80211_is_probe_resp(mgmt->frame_control)) { struct cfg80211_scan_request *scan_req; struct cfg80211_sched_scan_request *sched_scan_req; -@@ -275,18 +282,12 @@ void ieee80211_scan_rx(struct ieee80211_ +@@ -284,18 +291,12 @@ void ieee80211_scan_rx(struct ieee80211_ * unless scanning with randomised address */ if (!ieee80211_scan_accept_presp(sdata1, scan_req_flags, @@ -291,13 +299,3 @@ Signed-off-by: Pradeep Kumar Chitrapu bss = ieee80211_bss_info_update(local, rx_status, mgmt, skb->len, channel); ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -1054,6 +1054,7 @@ enum wmi_tlv_vdev_param { - WMI_VDEV_PARAM_BSS_COLOR, - WMI_VDEV_PARAM_SET_HEMU_MODE, - WMI_VDEV_PARAM_TX_OFDMA_CPLEN, -+ WMI_VDEV_PARAM_HEOPS_0_31 = 0x8003, - }; - - enum wmi_tlv_peer_flags { diff --git a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-tpc-stats-support.patch b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-tpc-stats-support.patch index 61278dcb9..84868741d 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-tpc-stats-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/196-ath11k-tpc-stats-support.patch @@ -36,15 +36,15 @@ Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Sriram R --- drivers/net/wireless/ath/ath11k/core.h | 5 + - drivers/net/wireless/ath/ath11k/debug.c | 557 ++++++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/debug.h | 36 +++ + drivers/net/wireless/ath/ath11k/debugfs.c | 557 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 36 +++ drivers/net/wireless/ath/ath11k/wmi.c | 448 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 199 ++++++++++++ 5 files changed, 1245 insertions(+) --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -626,6 +626,11 @@ struct ath11k { +@@ -638,6 +638,11 @@ struct ath11k { int monitor_vdev_id; struct ath11k_coex_info coex; @@ -56,9 +56,9 @@ Signed-off-by: Sriram R #ifdef CPTCFG_ATH11K_DEBUGFS struct ath11k_debug debug; #endif ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1852,6 +1852,588 @@ static const struct file_operations fops +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1817,6 +1817,588 @@ static const struct file_operations fops .open = simple_open }; @@ -644,18 +644,18 @@ Signed-off-by: Sriram R + .llseek = default_llseek, +}; + - int ath11k_debug_register(struct ath11k *ar) + int ath11k_debugfs_register(struct ath11k *ar) { struct ath11k_base *ab = ar->ab; -@@ -1880,6 +2462,7 @@ int ath11k_debug_register(struct ath11k +@@ -1840,6 +2422,7 @@ int ath11k_debugfs_register(struct ath11 - ath11k_debug_fw_stats_init(ar); + ath11k_debugfs_fw_stats_init(ar); ath11k_init_pktlog(ar); + init_completion(&ar->tpc_complete); debugfs_create_file("ext_tx_stats", 0644, ar->debug.debugfs_pdev, ar, -@@ -1914,6 +2497,10 @@ int ath11k_debug_register(struct ath11k +@@ -1878,6 +2461,10 @@ int ath11k_debugfs_register(struct ath11 debugfs_create_file("enable_m3_dump", 0644, ar->debug.debugfs_pdev, ar, &fops_enable_m3_dump); @@ -666,9 +666,9 @@ Signed-off-by: Sriram R return 0; } ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -69,6 +69,43 @@ enum ath11k_dbg_htt_ext_stats_type { +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -49,6 +49,43 @@ enum ath11k_dbg_htt_ext_stats_type { ATH11K_DBG_HTT_NUM_EXT_STATS, }; @@ -725,18 +725,18 @@ Signed-off-by: Sriram R [WMI_TAG_SERVICE_READY_EVENT] = { .min_len = sizeof(struct wmi_service_ready_event) }, [WMI_TAG_SERVICE_READY_EXT_EVENT] -@@ -127,6 +131,9 @@ static const struct wmi_tlv_policy wmi_t +@@ -131,6 +135,9 @@ static const struct wmi_tlv_policy wmi_t + .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, + [WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT] = { .min_len = sizeof(struct wmi_twt_add_dialog_event) }, - [WMI_TAG_VDEV_DELETE_RESP_EVENT] - = { .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, + [WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM] + = { .min_len = sizeof(struct wmi_tpc_stats_event_fixed_param) }, + }; #define PRIMAP(_hw_mode_) \ -@@ -7043,6 +7050,444 @@ ath11k_wmi_pdev_temperature_event(struct - ath11k_thermal_event_temperature(ar, ev.temp); +@@ -7515,6 +7522,444 @@ static void ath11k_wmi_event_wow_wakeup_ + complete(&ab->wow.wakeup_completed); } +static int ath11k_tpc_get_reg_pwr(struct ath11k_base *ab, @@ -1180,37 +1180,27 @@ Signed-off-by: Sriram R static void ath11k_wmi_twt_add_dialog_event(struct ath11k_base *ab, struct sk_buff *skb) { const char *status[] = { -@@ -7184,6 +7629,9 @@ static void ath11k_wmi_tlv_op_rx(struct - case WMI_VDEV_DELETE_RESP_EVENTID: - ath11k_vdev_delete_resp_event(ab, skb); +@@ -7665,6 +8110,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_WOW_WAKEUP_HOST_EVENTID: + ath11k_wmi_event_wow_wakeup_host(ab, skb); break; + case WMI_PDEV_GET_TPC_STATS_EVENTID: + ath11k_process_tpc_stats(ab, skb); + break; /* TODO: Add remaining events */ default: - ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -276,6 +276,17 @@ enum wmi_tlv_cmd_id { - WMI_PDEV_DMA_RING_CFG_REQ_CMDID, - WMI_PDEV_HE_TB_ACTION_FRM_CMDID, - WMI_PDEV_PKTLOG_FILTER_CMDID, -+ WMI_PDEV_SET_RAP_CONFIG_CMDID, -+ WMI_PDEV_DSM_FILTER_CMDID, -+ WMI_PDEV_FRAME_INJECT_CMDID, -+ WMI_PDEV_TBTT_OFFSET_SYNC_CMDID, -+ WMI_PDEV_SET_SRG_BSS_COLOR_BITMAP_CMDID, -+ WMI_PDEV_SET_SRG_PARTIAL_BSSID_BITMAP_CMDID, -+ WMI_PDEV_SET_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID, -+ WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID, -+ WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID, -+ WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID, +@@ -286,6 +286,7 @@ enum wmi_tlv_cmd_id { + WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID, + WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID, + WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID, + WMI_PDEV_GET_TPC_STATS_CMDID, WMI_VDEV_CREATE_CMDID = WMI_TLV_CMD(WMI_GRP_VDEV), WMI_VDEV_DELETE_CMDID, WMI_VDEV_START_REQUEST_CMDID, -@@ -622,6 +633,8 @@ enum wmi_tlv_event_id { +@@ -635,6 +636,8 @@ enum wmi_tlv_event_id { WMI_PDEV_RAP_INFO_EVENTID, WMI_CHAN_RF_CHARACTERIZATION_INFO_EVENTID, WMI_SERVICE_READY_EXT2_EVENTID, @@ -1219,7 +1209,7 @@ Signed-off-by: Sriram R WMI_VDEV_START_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_VDEV), WMI_VDEV_STOPPED_EVENTID, WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID, -@@ -1087,6 +1100,7 @@ enum wmi_tlv_tag { +@@ -1104,6 +1107,7 @@ enum wmi_tlv_tag { WMI_TAG_ARRAY_BYTE, WMI_TAG_ARRAY_STRUCT, WMI_TAG_ARRAY_FIXED_STRUCT, @@ -1227,10 +1217,10 @@ Signed-off-by: Sriram R WMI_TAG_LAST_ARRAY_ENUM = 31, WMI_TAG_SERVICE_READY_EVENT, WMI_TAG_HAL_REG_CAPABILITIES, -@@ -1832,6 +1846,13 @@ enum wmi_tlv_tag { - /* TODO add all the missing cmds */ - WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301, - WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, +@@ -1855,6 +1859,13 @@ enum wmi_tlv_tag { + WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, + WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD, + WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, + WMI_TAG_TPC_STATS_GET_CMD = 0x38B, + WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM, + WMI_TAG_TPC_STATS_CONFIG_EVENT, @@ -1241,7 +1231,7 @@ Signed-off-by: Sriram R WMI_TAG_MAX }; -@@ -5256,6 +5277,183 @@ struct target_resource_config { +@@ -5330,6 +5341,183 @@ struct target_resource_config { u32 twt_ap_sta_count; }; @@ -1425,10 +1415,11 @@ Signed-off-by: Sriram R #define WMI_MAX_MEM_REQS 32 #define MAX_RADIOS 3 -@@ -5420,4 +5618,6 @@ int ath11k_wmi_vdev_spectral_enable(stru - int ath11k_wmi_vdev_spectral_conf(struct ath11k *ar, - struct ath11k_wmi_vdev_spectral_conf_param *param); +@@ -5677,5 +5865,7 @@ int ath11k_wmi_set_hw_mode(struct ath11k + int ath11k_wmi_wow_host_wakeup_ind(struct ath11k *ar); + int ath11k_wmi_wow_enable(struct ath11k *ar); int ath11k_wmi_pdev_m3_dump_enable(struct ath11k *ar, u32 enable); +int ath11k_wmi_pdev_get_tpc_table_cmdid(struct ath11k *ar); +void ath11k_wmi_free_tpc_stats_mem(struct ath11k *ar); + #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/197-ath11k-add-support-to-collect-q6mem-dump.patch b/feeds/wifi-ax/mac80211/patches/qca/197-ath11k-add-support-to-collect-q6mem-dump.patch index f853f3858..44a135d6d 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/197-ath11k-add-support-to-collect-q6mem-dump.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/197-ath11k-add-support-to-collect-q6mem-dump.patch @@ -15,12 +15,12 @@ Signed-off-by: Ramya Gnanasekar --- drivers/net/wireless/ath/ath11k/core.c | 3 ++- drivers/net/wireless/ath/ath11k/core.h | 1 + - drivers/net/wireless/ath/ath11k/debug.c | 46 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.c | 46 +++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -693,7 +693,8 @@ int ath11k_core_ssr_notifier_cb(struct n +@@ -860,7 +860,8 @@ int ath11k_core_ssr_notifier_cb(struct n /* TODO Add more driver stats */ /* Crash the system once all the stats are dumped */ @@ -30,27 +30,57 @@ Signed-off-by: Ramya Gnanasekar return 0; } +@@ -943,6 +944,13 @@ static int ath11k_core_reconfigure_on_cr + int ret; + + mutex_lock(&ab->core_lock); ++#ifdef CONFIG_QCOM_QMI_HELPERS ++ /* Unregister the ssr notifier as we are not interested ++ * in receving these notifications after mac is unregistered. ++ */ ++ if (ab->hif.bus == ATH11K_BUS_AHB) ++ qcom_unregister_ssr_notifier(&ab->qmi.ssr_nb); ++#endif + ath11k_thermal_unregister(ab); + ath11k_hif_irq_disable(ab); + ath11k_dp_pdev_free(ab); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -831,6 +831,7 @@ struct ath11k_base { - u32 num_db_cap; - u32 sw_pdev_id_map[MAX_RADIOS]; - u32 hw_pdev_id_map[MAX_RADIOS]; +@@ -845,6 +845,8 @@ struct ath11k_base { + + struct completion htc_suspend; + + bool fw_recovery_support; ++ /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; -@@ -990,6 +991,7 @@ void ath11k_core_free_bdf(struct ath11k_ +@@ -972,6 +974,14 @@ struct ath11k_fw_stats_bcn { + u32 tx_bcn_outage_cnt; + }; - void ath11k_core_halt(struct ath11k *ar); ++enum ath11k_fw_recovery_option { ++ ATH11K_FW_RECOVERY_DISABLE = 0, ++ ATH11K_FW_RECOVERY_ENABLE_AUTO, /* Automatically recover after FW assert */ ++ /* Enable only recovery. Send MPD SSR WMI */ ++ /* command to unlink UserPD assert from RootPD */ ++ ATH11K_FW_RECOVERY_ENABLE_SSR_ONLY, ++}; ++ + extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[]; + extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[]; + extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[]; +@@ -999,6 +1009,7 @@ void ath11k_core_halt(struct ath11k *ar) + int ath11k_core_resume(struct ath11k_base *ab); + int ath11k_core_suspend(struct ath11k_base *ab); +void ath11k_core_dump_bp_stats(struct ath11k_base *ab); void ath11k_coredump_qdss_dump(struct ath11k_base *ab, struct ath11k_qmi_event_qdss_trace_save_data *event_data); const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1207,6 +1207,48 @@ static const struct file_operations fops +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1110,6 +1110,73 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -59,18 +89,43 @@ Signed-off-by: Ramya Gnanasekar + size_t count, loff_t *ppos) +{ + struct ath11k_base *ab = file->private_data; -+ bool enable; -+ int ret; ++ struct ath11k *ar; ++ struct ath11k_pdev *pdev; ++ struct device *dev = ab->dev; ++ bool multi_pd_arch = false; ++ unsigned int value; ++ int ret, i; + -+ if (kstrtobool_from_user(user_buf, count, &enable)) ++ if (kstrtouint_from_user(user_buf, count, 0, &value)) + return -EINVAL; + -+ if (enable == ab->fw_recovery_support) { -+ ret = count; -+ goto exit; ++ if (value < ATH11K_FW_RECOVERY_DISABLE || ++ value > ATH11K_FW_RECOVERY_ENABLE_SSR_ONLY) { ++ ath11k_warn(ab, "Please enter: 0 = Disable, 1 = Enable (auto recover)," ++ "2 = Enable SSR only"); ++ ret = -EINVAL; ++ goto exit; + } + -+ ab->fw_recovery_support = enable; ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ ar = pdev->ar; ++ if (ar && ar->state == ATH11K_STATE_ON) ++ break; ++ } ++ ++ multi_pd_arch = of_property_read_bool(dev->of_node, "qcom,multipd_arch"); ++ if (multi_pd_arch) { ++ if (value == ATH11K_FW_RECOVERY_DISABLE || ++ value == ATH11K_FW_RECOVERY_ENABLE_SSR_ONLY) { ++ ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_MPD_USERPD_SSR, ++ 0, ar->pdev->pdev_id); ++ } else if (value == ATH11K_FW_RECOVERY_ENABLE_AUTO) ++ ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_MPD_USERPD_SSR, ++ 1, ar->pdev->pdev_id); ++ } ++ ab->fw_recovery_support = value ? true : false; ++ + ret = count; + +exit: @@ -96,10 +151,10 @@ Signed-off-by: Ramya Gnanasekar + .open = simple_open, +}; + - int ath11k_debug_pdev_create(struct ath11k_base *ab) + int ath11k_debugfs_pdev_create(struct ath11k_base *ab) { if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) -@@ -1221,6 +1263,10 @@ int ath11k_debug_pdev_create(struct ath1 +@@ -1124,6 +1191,10 @@ int ath11k_debugfs_pdev_create(struct at debugfs_create_file("soc_dp_stats", 0600, ab->debugfs_soc, ab, &fops_soc_dp_stats); @@ -112,7 +167,7 @@ Signed-off-by: Ramya Gnanasekar --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -982,6 +982,8 @@ static int ath11k_pci_probe(struct pci_d +@@ -1206,6 +1206,8 @@ static int ath11k_pci_probe(struct pci_d ab_pci->pdev = pdev; ab->hif.ops = &ath11k_pci_hif_ops; pci_set_drvdata(pdev, ab); @@ -120,10 +175,10 @@ Signed-off-by: Ramya Gnanasekar + spin_lock_init(&ab_pci->window_lock); - switch (pci_dev->device) { + /* IPQ8074 reserves memory for FW, ath11k does not need to --- a/drivers/net/wireless/ath/ath11k/coredump.c +++ b/drivers/net/wireless/ath/ath11k/coredump.c -@@ -162,13 +162,16 @@ void ath11k_coredump_download_rddm(struc +@@ -163,13 +163,16 @@ void ath11k_coredump_download_rddm(struc fw_img = mhi_ctrl->fbc_image; for (i = 0; i < ab->qmi.mem_seg_count; i++) { @@ -141,7 +196,7 @@ Signed-off-by: Ramya Gnanasekar len = num_seg * sizeof(*segment); seg_info = segment = (struct ath11k_dump_segment *)vzalloc(len); -@@ -195,31 +198,46 @@ void ath11k_coredump_download_rddm(struc +@@ -196,31 +199,46 @@ void ath11k_coredump_download_rddm(struc ath11k_info(ab, "seg vaddr is %px len is 0x%x type %d\n", seg_info->vaddr, seg_info->len, seg_info->type); seg_info->type = ATH11K_FW_CRASH_RDDM_DATA; @@ -160,7 +215,7 @@ Signed-off-by: Ramya Gnanasekar - seg_info->vaddr, seg_info->len, seg_info->type); - seg_info->type = ATH11K_FW_REMOTE_MEM_DATA; - seg_info++; -+ if (ab->qmi.target_mem[i].type == HOST_DDR_REGION_TYPE || ++ if (ab->qmi.target_mem[i].type == HOST_DDR_REGION_TYPE || + ab->qmi.target_mem[i].type == M3_DUMP_REGION_TYPE) { + seg_info->len = ab->qmi.target_mem[i].size; + seg_info->addr = ab->qmi.target_mem[i].paddr; @@ -202,7 +257,7 @@ Signed-off-by: Ramya Gnanasekar ath11k_core_dump_bp_stats(ab); --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2413,6 +2413,10 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2581,6 +2581,10 @@ static int ath11k_qmi_assign_target_mem_ ab->qmi.target_mem[idx].paddr = ab->hw_params.m3_addr; else ab->qmi.target_mem[idx].paddr = (phys_addr_t)addr; @@ -213,3 +268,41 @@ Signed-off-by: Ramya Gnanasekar idx++; break; default: +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -949,6 +949,7 @@ enum wmi_tlv_pdev_param { + WMI_PDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD = 0xbc, + WMI_PDEV_PARAM_SET_CMD_OBSS_PD_PER_AC = 0xbe, + WMI_PDEV_PARAM_ENABLE_SR_PROHIBIT = 0xc6, ++ WMI_PDEV_PARAM_MPD_USERPD_SSR = 0xce, + }; + + enum wmi_tlv_vdev_param { +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5146,6 +5146,7 @@ static int ath11k_mac_op_start(struct ie + struct ath11k *ar = hw->priv; + struct ath11k_base *ab = ar->ab; + struct ath11k_pdev *pdev = ar->pdev; ++ struct device *dev = ab->dev; + int ret; + + ath11k_mac_drain_tx(ar); +@@ -5212,6 +5213,17 @@ static int ath11k_mac_op_start(struct ie + goto err; + } + ++ if (ab->fw_recovery_support && ++ of_property_read_bool(dev->of_node, "qcom,multipd_arch")) ++ { ++ ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_MPD_USERPD_SSR, ++ 1, pdev->pdev_id); ++ if (ret) { ++ ath11k_err(ab, "failed to enable firmware SSR" ++ "recovery:%d\n", ret); ++ } ++ } ++ + __ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask); + + /* TODO: Do we need to enable ANI? */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/198-ath11k-use-frame-mode-for-encap-decap.patch b/feeds/wifi-ax/mac80211/patches/qca/198-ath11k-use-frame-mode-for-encap-decap.patch deleted file mode 100644 index 18e9f9c33..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/198-ath11k-use-frame-mode-for-encap-decap.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -15,18 +15,14 @@ - #include "hif.h" - - unsigned int ath11k_debug_mask; --unsigned int rawmode; - unsigned int cryptmode; - EXPORT_SYMBOL(ath11k_debug_mask); --unsigned int ath11k_ethernet_mode = 1; - module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); --module_param_named(rawmode, rawmode, uint, 0644); - module_param_named(cryptmode, cryptmode, uint, 0644); --module_param_named(ethernet_mode, ath11k_ethernet_mode, uint, 0644); - MODULE_PARM_DESC(debug_mask, "Debugging mask"); - MODULE_PARM_DESC(cryptmode, "crypto mode: 0-hardware, 1-software"); --MODULE_PARM_DESC(rawmode, "RAW mode TX: 0-disable, 1-enable"); --MODULE_PARM_DESC(ethernet_mode, "Use ethernet frame datapath"); -+ -+extern unsigned int ath11k_frame_mode; - - static const struct ath11k_hw_params ath11k_hw_params[] = { - { -@@ -730,7 +726,7 @@ int ath11k_core_qmi_firmware_ready(struc - return -EINVAL; - } - -- if (rawmode) -+ if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW) - set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); - - mutex_lock(&ab->core_lock); -@@ -986,11 +982,6 @@ int ath11k_core_pre_init(struct ath11k_b - { - int ret; - -- if (ath11k_ethernet_mode && rawmode) { -- ath11k_err(ab, "ethernet and raw mode cannot co-exist\n"); -- return -EINVAL; -- } -- - ret = ath11k_init_hw_params(ab); - if (ret) { - ath11k_err(ab, "failed to get hw params: %d\n", ret); ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -17,8 +17,6 @@ - #include "peer.h" - #include "vendor.h" - --extern unsigned int ath11k_ethernet_mode; -- - #define CHAN2G(_channel, _freq, _flags) { \ - .band = NL80211_BAND_2GHZ, \ - .hw_value = (_channel), \ -@@ -47,7 +45,7 @@ extern unsigned int ath11k_ethernet_mode - } - - /* frame mode values are mapped as per enum ath11k_hw_txrx_mode */ --static unsigned int ath11k_frame_mode = ATH11K_HW_TXRX_NATIVE_WIFI; -+unsigned int ath11k_frame_mode = ATH11K_HW_TXRX_ETHERNET; - module_param_named(frame_mode, ath11k_frame_mode, uint, 0644); - MODULE_PARM_DESC(frame_mode, - "Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)"); -@@ -5290,7 +5288,8 @@ static int ath11k_mac_op_add_interface(s - * 4addr related config during add_interface(). - */ - if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags) && -- ath11k_ethernet_mode && (vif->type != NL80211_IFTYPE_MESH_POINT)) { -+ (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET) && -+ (vif->type != NL80211_IFTYPE_MESH_POINT)) { - param_id = WMI_VDEV_PARAM_RX_DECAP_TYPE; - param_value = ATH11K_HW_TXRX_ETHERNET; - diff --git a/feeds/wifi-ax/mac80211/patches/qca/199-001-mac80211-add-nss-support.patch b/feeds/wifi-ax/mac80211/patches/qca/199-001-mac80211-add-nss-support.patch index dbf594bbe..2cf4bf605 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/199-001-mac80211-add-nss-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/199-001-mac80211-add-nss-support.patch @@ -16,7 +16,7 @@ Signed-off-by: Sriram R --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -354,6 +354,20 @@ enum ieee80211_bss_change { +@@ -359,6 +359,20 @@ enum ieee80211_bss_change { /* when adding here, make sure to change ieee80211_reconfig */ }; @@ -37,23 +37,23 @@ Signed-off-by: Sriram R /* * The maximum number of IPv4 addresses listed for ARP filtering. If the number * of addresses for an interface increase beyond this value, hardware ARP -@@ -607,6 +621,7 @@ struct ieee80211_ftm_responder_params { - * @he_oper: HE operation information of the AP we are connected to - * @he_obss_pd: OBSS Packet Detection parameters. - * @he_bss_color: BSS coloring settings, if BSS supports HE +@@ -631,6 +645,7 @@ struct ieee80211_fils_discovery { + * @s1g: BSS is S1G BSS (affects Association Request format). + * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed + * to driver when rate control is offloaded to firmware. + * @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature */ struct ieee80211_bss_conf { const u8 *bssid; -@@ -675,6 +690,7 @@ struct ieee80211_bss_conf { - struct ieee80211_he_obss_pd he_obss_pd; - struct ieee80211_he_cap_elem he_cap_elem; - struct cfg80211_he_bss_color he_bss_color; +@@ -701,6 +716,7 @@ struct ieee80211_bss_conf { + u32 unsol_bcast_probe_resp_interval; + bool s1g; + struct cfg80211_bitrate_mask beacon_tx_rate; + bool nss_ap_isolate; }; /** -@@ -1714,6 +1730,16 @@ struct ieee80211_vif *wdev_to_ieee80211_ +@@ -1781,6 +1797,16 @@ struct ieee80211_vif *wdev_to_ieee80211_ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif); /** @@ -70,24 +70,24 @@ Signed-off-by: Sriram R * enum ieee80211_key_flags - key flags * * These flags are used for communication about keys between the driver -@@ -2331,6 +2357,8 @@ struct ieee80211_txq { - * aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx - * A-MPDU sessions active while rekeying with Extended Key ID. +@@ -2407,6 +2433,8 @@ struct ieee80211_txq { + * @IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP: Hardware supports concurrent rx + * decapsulation offload and passing raw 802.11 frames for monitor iface. * + * @IEEE80211_HW_SUPPORTS_NSS_OFFLOAD: Hardware/driver supports NSS offload + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { -@@ -2383,6 +2411,7 @@ enum ieee80211_hw_flags { - IEEE80211_HW_SUPPORTS_MULTI_BSSID, - IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, - IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, +@@ -2462,6 +2490,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, + IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD, + IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP, + IEEE80211_HW_SUPPORTS_NSS_OFFLOAD, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS -@@ -3361,6 +3390,10 @@ enum ieee80211_reconfig_type { +@@ -3440,6 +3469,10 @@ enum ieee80211_reconfig_type { * of the bss parameters has changed when a call is made. The callback * can sleep. * @@ -98,7 +98,7 @@ Signed-off-by: Sriram R * @prepare_multicast: Prepare for multicast filter configuration. * This callback is optional, and its return value is passed * to configure_filter(). This callback must be atomic. -@@ -3841,6 +3874,9 @@ struct ieee80211_ops { +@@ -3927,6 +3960,9 @@ struct ieee80211_ops { struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed); @@ -110,17 +110,17 @@ Signed-off-by: Sriram R void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c -@@ -408,6 +408,7 @@ static const char *hw_flag_names[] = { - FLAG(SUPPORTS_MULTI_BSSID), - FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), - FLAG(AMPDU_KEYBORDER_SUPPORT), +@@ -407,6 +407,7 @@ static const char *hw_flag_names[] = { + FLAG(SUPPORTS_TX_ENCAP_OFFLOAD), + FLAG(SUPPORTS_RX_DECAP_OFFLOAD), + FLAG(SUPPORTS_CONC_MON_RX_DECAP), + FLAG(SUPPORTS_NSS_OFFLOAD), #undef FLAG }; --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -826,6 +826,22 @@ struct wireless_dev *ieee80211_vif_to_wd +@@ -881,6 +881,22 @@ struct wireless_dev *ieee80211_vif_to_wd } EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev); @@ -163,7 +163,7 @@ Signed-off-by: Sriram R u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata) { sdata->vif.bss_conf.use_cts_prot = false; -@@ -595,12 +606,6 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -598,12 +609,6 @@ struct ieee80211_hw *ieee80211_alloc_hw_ wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_FILS_STA); #endif wiphy_ext_feature_set(wiphy, @@ -176,7 +176,7 @@ Signed-off-by: Sriram R NL80211_EXT_FEATURE_SCAN_FREQ_KHZ); if (!ops->hw_scan) { -@@ -922,6 +927,18 @@ int ieee80211_register_hw(struct ieee802 +@@ -921,6 +926,18 @@ int ieee80211_register_hw(struct ieee802 (!local->ops->start_nan || !local->ops->stop_nan))) return -EINVAL; @@ -197,7 +197,7 @@ Signed-off-by: Sriram R return -EINVAL; --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2080,7 +2080,10 @@ sta_get_last_rx_stats(struct sta_info *s +@@ -2092,7 +2092,10 @@ sta_get_last_rx_stats(struct sta_info *s struct ieee80211_local *local = sta->local; int cpu; @@ -211,7 +211,7 @@ Signed-off-by: Sriram R for_each_possible_cpu(cpu) { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1003,11 +1003,23 @@ ieee80211_tx_h_stats(struct ieee80211_tx +@@ -994,11 +994,23 @@ ieee80211_tx_h_stats(struct ieee80211_tx { struct sk_buff *skb; int ac = -1; @@ -235,18 +235,43 @@ Signed-off-by: Sriram R ac = skb_get_queue_mapping(skb); tx->sta->tx_stats.bytes[ac] += skb->len; } -@@ -4247,7 +4259,7 @@ static void ieee80211_8023_xmit(struct i +@@ -2751,7 +2763,9 @@ static struct sk_buff *ieee80211_build_h - ieee80211_tx_stats(dev, skb->len); + if (unlikely(!multicast && ((skb->sk && + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS) || +- ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS))) ++ ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS) && ++ !(ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD) && ++ ieee80211_is_data(fc) && !ieee80211_is_qos_nullfunc(fc)))) + info_id = ieee80211_store_ack_skb(local, skb, &info_flags, + cookie); -- if (sta) { -+ if (sta && !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { - sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; - sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; +@@ -4210,7 +4224,8 @@ static void ieee80211_8023_xmit(struct i } + + if (unlikely(skb->sk && +- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) ++ skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD))) + info->ack_frame_id = ieee80211_store_ack_skb(local, skb, + &info->flags, NULL); + +@@ -4218,8 +4233,10 @@ static void ieee80211_8023_xmit(struct i + + dev_sw_netstats_tx_add(dev, 1, skb->len); + +- sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; +- sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { ++ sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; ++ sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; ++ } + + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) + sdata = container_of(sdata->bss, --- a/net/wireless/util.c +++ b/net/wireless/util.c -@@ -1986,6 +1986,9 @@ bool cfg80211_does_bw_fit_range(const st +@@ -2084,6 +2084,9 @@ bool cfg80211_does_bw_fit_range(const st int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp) { @@ -258,7 +283,7 @@ Signed-off-by: Sriram R gfp); --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2194,7 +2194,7 @@ static int ieee80211_change_bss(struct w +@@ -2280,7 +2280,7 @@ static int ieee80211_change_bss(struct w { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_supported_band *sband; @@ -267,7 +292,7 @@ Signed-off-by: Sriram R if (!sdata_dereference(sdata->u.ap.beacon, sdata)) return -ENOENT; -@@ -2241,6 +2241,8 @@ static int ieee80211_change_bss(struct w +@@ -2327,6 +2327,8 @@ static int ieee80211_change_bss(struct w sdata->flags |= IEEE80211_SDATA_DONT_BRIDGE_PACKETS; else sdata->flags &= ~IEEE80211_SDATA_DONT_BRIDGE_PACKETS; @@ -276,7 +301,7 @@ Signed-off-by: Sriram R ieee80211_check_fast_rx_iface(sdata); } -@@ -2270,6 +2272,8 @@ static int ieee80211_change_bss(struct w +@@ -2356,6 +2358,8 @@ static int ieee80211_change_bss(struct w ieee80211_bss_info_change_notify(sdata, changed); @@ -313,7 +338,7 @@ Signed-off-by: Sriram R { --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1614,6 +1614,8 @@ int ieee80211_hw_config(struct ieee80211 +@@ -1626,6 +1626,8 @@ int ieee80211_hw_config(struct ieee80211 void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, u32 changed); @@ -365,24 +390,13 @@ Signed-off-by: Sriram R TP_PROTO(struct ieee80211_local *local, --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -1306,6 +1306,7 @@ bool ieee80211_set_hw_80211_encap(struct - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct ieee80211_local *local = sdata->local; - struct ieee80211_sub_if_data *iter; -+ bool nss_offload = ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD); +@@ -863,7 +863,8 @@ static bool ieee80211_set_sdata_offload_ + local->hw.wiphy->frag_threshold != (u32)-1) + flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; - mutex_lock(&local->iflist_mtx); - list_for_each_entry(iter, &local->interfaces, list) { -@@ -1313,10 +1314,10 @@ bool ieee80211_set_hw_80211_encap(struct - - if (vif->type == NL80211_IFTYPE_MONITOR) { - disable = iter; -- __ieee80211_set_hw_80211_encap(iter, false); -+ __ieee80211_set_hw_80211_encap(iter, nss_offload ? enable : false); - } else if (iter->vif.type == NL80211_IFTYPE_MONITOR) { - disable = sdata; -- enable = false; -+ enable = nss_offload ? enable : false; - } - if (disable) - sdata_dbg(disable, +- if (local->monitors) ++ if (local->monitors && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) + flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; + } else { + flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; diff --git a/feeds/wifi-ax/mac80211/patches/qca/199-002-ath11k_nss-add-nss-driver-interface.patch b/feeds/wifi-ax/mac80211/patches/qca/199-002-ath11k_nss-add-nss-driver-interface.patch index 8f3928e51..f8e31a366 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/199-002-ath11k_nss-add-nss-driver-interface.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/199-002-ath11k_nss-add-nss-driver-interface.patch @@ -37,7 +37,7 @@ Signed-off-by: Sriram R depends on m --- a/drivers/net/wireless/ath/ath11k/Makefile +++ b/drivers/net/wireless/ath/ath11k/Makefile -@@ -26,6 +26,7 @@ ath11k-$(CONFIG_THERMAL) += thermal.o +@@ -27,6 +27,7 @@ ath11k-$(CONFIG_THERMAL) += thermal.o ath11k-$(CONFIG_WANT_DEV_COREDUMP) += coredump.o ath11k-$(CPTCFG_ATH11K_SPECTRAL) += spectral.o ath11k-$(CPTCFG_ATH11K_PKTLOG) += pktlog.o @@ -47,7 +47,7 @@ Signed-off-by: Sriram R ath11k_ahb-y += ahb.o --- /dev/null +++ b/drivers/net/wireless/ath/ath11k/nss.c -@@ -0,0 +1,2339 @@ +@@ -0,0 +1,2388 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* + * Copyright (c) 2020 The Linux Foundation. All rights reserved. @@ -119,43 +119,16 @@ Signed-off-by: Sriram R + spin_unlock_bh(&ab->base_lock); +} + -+static void ath11k_nss_get_peer_tx_tid_stats(struct ath11k_base *ab, int npeers, struct nss_wifili_sojourn_peer_stats *stats) -+{ -+ struct ath11k_peer *peer; -+ int peer_idx, tid_idx; -+ -+ for (peer_idx = 0; peer_idx < npeers; peer_idx++) { -+ -+ rcu_read_lock(); -+ spin_lock_bh(&ab->base_lock); -+ -+ peer = ath11k_peer_find_by_id(ab, (&stats[peer_idx])->peer_id); -+ if (!peer || !peer->sta) { -+ ath11k_dbg(ab, ATH11K_DBG_NSS, "unable to find peer %d\n", (&stats[peer_idx])->peer_id); -+ spin_unlock_bh(&ab->base_lock); -+ rcu_read_unlock(); -+ continue; -+ } -+ -+ if (!peer->nss.nss_stats) { -+ spin_unlock_bh(&ab->base_lock); -+ rcu_read_unlock(); -+ return; -+ } -+ -+ for (tid_idx = 0; tid_idx < NSS_TX_TID_MAX; tid_idx++) -+ peer->nss.nss_stats->tx_tid_msdu[tid_idx] += (&stats[peer_idx])->stats[tid_idx].num_msdus; -+ -+ spin_unlock_bh(&ab->base_lock); -+ rcu_read_unlock(); -+ } -+} -+ +static void ath11k_nss_get_peer_stats(struct ath11k_base *ab, struct nss_wifili_peer_stats *stats) +{ + struct ath11k_peer *peer; + struct nss_wifili_peer_ctrl_stats *pstats = NULL; + int i, j; ++ u64 tx_packets, tx_bytes, tx_dropped = 0; ++ u64 rx_packets, rx_bytes, rx_dropped; ++ ++ if (!ab->nss.stats_enabled) ++ return; + + for (i = 0; i < stats->npeers; i++) { + pstats = &stats->wpcs[i]; @@ -165,7 +138,7 @@ Signed-off-by: Sriram R + + peer = ath11k_peer_find_by_id(ab, pstats->peer_id); + if (!peer || !peer->sta) { -+ ath11k_dbg(ab, ATH11K_DBG_NSS, "unable to find peer %d\n", pstats->peer_id); ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "nss wifili: unable to find peer %d\n", pstats->peer_id); + spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); + continue; @@ -184,21 +157,32 @@ Signed-off-by: Sriram R + peer->nss.nss_stats->last_rx = jiffies; + } + -+ peer->nss.nss_stats->tx_packets += pstats->tx.tx_mcast_cnt + ++ tx_packets = pstats->tx.tx_mcast_cnt + + pstats->tx.tx_ucast_cnt + + pstats->tx.tx_bcast_cnt; -+ peer->nss.nss_stats->tx_bytes += pstats->tx.tx_mcast_bytes + ++ peer->nss.nss_stats->tx_packets += tx_packets; ++ tx_bytes = pstats->tx.tx_mcast_bytes + + pstats->tx.tx_ucast_bytes + + pstats->tx.tx_bcast_bytes; ++ peer->nss.nss_stats->tx_bytes += tx_bytes; + peer->nss.nss_stats->tx_retries += pstats->tx.retries; + + for (j = 0; j < NSS_WIFILI_TQM_RR_MAX; j++) -+ peer->nss.nss_stats->tx_failed += pstats->tx.dropped.drop_stats[j]; ++ tx_dropped += pstats->tx.dropped.drop_stats[j]; + -+ peer->nss.nss_stats->rx_packets += pstats->rx.rx_recvd; -+ peer->nss.nss_stats->rx_bytes += pstats->rx.rx_recvd_bytes; -+ peer->nss.nss_stats->rx_dropped += pstats->rx.err.mic_err + ++ peer->nss.nss_stats->tx_failed += tx_dropped; ++ ++ ATH11K_NSS_TXRX_NETDEV_STATS(tx, peer->vif, tx_bytes, tx_packets); ++ ++ rx_packets = pstats->rx.rx_recvd; ++ peer->nss.nss_stats->rx_packets += rx_packets; ++ rx_bytes = pstats->rx.rx_recvd_bytes; ++ peer->nss.nss_stats->rx_bytes += rx_bytes; ++ rx_dropped = pstats->rx.err.mic_err + + pstats->rx.err.decrypt_err; ++ peer->nss.nss_stats->rx_dropped += rx_dropped; ++ ++ ATH11K_NSS_TXRX_NETDEV_STATS(rx, peer->vif, rx_bytes, rx_packets); + + spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); @@ -253,7 +237,7 @@ Signed-off-by: Sriram R + struct ieee80211_hdr *hdr = (void *)skb->data; + u32 cipher; + -+ if (!ieee80211_has_protected(hdr->frame_control)) ++ if (!ieee80211_has_protected(hdr->frame_control) || !info->control.hw_key) + return; + + /* Include length for MIC */ @@ -274,13 +258,13 @@ Signed-off-by: Sriram R + peer = ath11k_peer_find_by_id(ab, peer_id); + if (!peer) { + spin_unlock_bh(&ab->base_lock); -+ ath11k_warn(ab, "ath11k_nss: unable to free peer mem%d\n", ++ ath11k_warn(ab, "ath11k_nss: unable to free peer mem, peer_id:%d\n", + peer_id); + return; + } + + dma_unmap_single(ab->dev, peer->nss.paddr, -+ WIFILI_NSS_PEER_BYTE_SIZE, DMA_TO_DEVICE); ++ WIFILI_NSS_PEER_BYTE_SIZE, DMA_FROM_DEVICE); + + kfree(peer->nss.vaddr); + if (peer->nss.nss_stats) { @@ -288,6 +272,7 @@ Signed-off-by: Sriram R + peer->nss.nss_stats = NULL; + } + ++ complete(&peer->nss.complete); + spin_unlock_bh(&ab->base_lock); + + ath11k_dbg(ab, ATH11K_DBG_NSS, "nss peer %d mem freed\n", peer_id); @@ -302,7 +287,6 @@ Signed-off-by: Sriram R + u32 error = msg->cm.error; + u32 peer_id; + struct nss_wifili_peer_stats *peer_stats; -+ struct nss_wifili_sojourn_stats_msg *stats_msg; + + if (!ab) + return; @@ -347,6 +331,11 @@ Signed-off-by: Sriram R + ath11k_warn(ab, "peer securty config failed\n"); + + break; ++ case NSS_WIFILI_PEER_UPDATE_AUTH_FLAG: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab, "peer authorize config failed\n"); ++ ++ break; + case NSS_WIFILI_STATS_MSG: + if (response == NSS_CMN_RESPONSE_EMSG) { + ath11k_warn(ab, "soc_dp_stats failed to get updated\n"); @@ -362,14 +351,6 @@ Signed-off-by: Sriram R + } + ath11k_nss_get_peer_stats(ab, peer_stats); + break; -+ case NSS_WIFILI_SOJOURN_STATS_MSG: -+ stats_msg = &msg->msg.sj_stats_msg; -+ if (response == NSS_CMN_RESPONSE_EMSG) { -+ ath11k_warn(ab, "tid peer stats msg failed with error = %u\n", error); -+ break; -+ } -+ ath11k_nss_get_peer_tx_tid_stats(ab, stats_msg->npeers, &stats_msg->sj_peer_stats[0]); -+ break; + case NSS_WIFILI_TID_REOQ_SETUP_MSG: + /* TODO setup tidq */ + break; @@ -516,7 +497,7 @@ Signed-off-by: Sriram R + } + + if (ieee80211_data_to_8023_exthdr(skb, NULL, vif->addr, vif->type, -+ data_offs - hdr_len)) { ++ data_offs - hdr_len, false)) { + dev_kfree_skb_any(skb); + return -EINVAL; + } @@ -713,8 +694,11 @@ Signed-off-by: Sriram R + + status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, arvif->nss.if_num); + -+ if (status != NSS_TX_SUCCESS) -+ ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss tx failure\n"); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_dbg(ar->ab, (ATH11K_DBG_NSS | ATH11K_DBG_DP_TX), ++ "nss tx failure: %d\n", status); ++ atomic_inc(&soc_stats->tx_err.nss_tx_fail); ++ } + + return status; +drop: @@ -1157,6 +1141,45 @@ Signed-off-by: Sriram R + return status; +} + ++int ath11k_nss_set_peer_authorize(struct ath11k *ar, u16 peer_id) ++{ ++ struct nss_wifili_peer_update_auth_flag *auth_msg; ++ nss_wifili_msg_callback_t msg_cb; ++ struct nss_wifili_msg *wlmsg; ++ nss_tx_status_t status; ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); ++ if (!wlmsg) ++ return -ENOMEM; ++ ++ auth_msg = &wlmsg->msg.peer_auth; ++ auth_msg->peer_id = peer_id; ++ auth_msg->auth_flag = 1; ++ ++ msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; ++ ++ nss_cmn_msg_init(&wlmsg->cm, ar->ab->nss.if_num, ++ NSS_WIFILI_PEER_UPDATE_AUTH_FLAG, ++ sizeof(struct nss_wifili_peer_update_auth_flag), ++ msg_cb, NULL); ++ ++ status = nss_wifili_tx_msg(ar->nss.ctx, wlmsg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss peer %d auth cfg fail %d\n", ++ peer_id, status); ++ goto free; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss peer id %d auth cfg complete\n", ++ peer_id); ++free: ++ kfree(wlmsg); ++ return status; ++} ++ +void ath11k_nss_update_sta_stats(struct station_info *sinfo, + struct ieee80211_sta *sta, + struct ath11k_sta *arsta) @@ -1237,19 +1260,6 @@ Signed-off-by: Sriram R + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE); + } + -+ if (!sinfo->pertid && cfg80211_sinfo_alloc_tid_stats(sinfo, GFP_KERNEL)) -+ goto exit; -+ -+ for (tid_idx = 0; tid_idx < NSS_TX_TID_MAX; tid_idx++) { -+ sinfo->pertid[tid_idx].tx_msdu = peer->nss.nss_stats->tx_tid_msdu[tid_idx]; -+ sinfo->pertid[tid_idx].filled |= BIT_ULL(NL80211_TID_STATS_TX_MSDU); -+ } -+ -+ for (tid_idx = 0; tid_idx < IEEE80211_NUM_TIDS; tid_idx++) { -+ sinfo->pertid[tid_idx].rx_msdu = peer->nss.nss_stats->rx_tid_msdu[tid_idx]; -+ sinfo->pertid[tid_idx].filled |= BIT_ULL(NL80211_TID_STATS_RX_MSDU); -+ } -+ +exit: + spin_unlock_bh(&ab->base_lock); +} @@ -1287,18 +1297,36 @@ Signed-off-by: Sriram R + peer->nss.nss_stats->rxrate.legacy = rate; + break; + case WMI_RATE_PREAMBLE_HT: ++ if (ppdu_info->mcs > ATH11K_HT_MCS_MAX) { ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS, ++ "Received invalid mcs in HT mode %d\n", ++ ppdu_info->mcs); ++ return; ++ } + peer->nss.nss_stats->rxrate.mcs = ppdu_info->mcs + 8 * (ppdu_info->nss - 1); + peer->nss.nss_stats->rxrate.flags = RATE_INFO_FLAGS_MCS; + if (ppdu_info->gi) + peer->nss.nss_stats->rxrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + break; + case WMI_RATE_PREAMBLE_VHT: ++ if (ppdu_info->mcs > ATH11K_VHT_MCS_MAX) { ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS, ++ "Received invalid mcs in VHT mode %d\n", ++ ppdu_info->mcs); ++ return; ++ } + peer->nss.nss_stats->rxrate.mcs = ppdu_info->mcs; + peer->nss.nss_stats->rxrate.flags = RATE_INFO_FLAGS_VHT_MCS; + if (ppdu_info->gi) + peer->nss.nss_stats->rxrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + break; + case WMI_RATE_PREAMBLE_HE: ++ if (ppdu_info->mcs > ATH11K_HE_MCS_MAX) { ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS, ++ "Received invalid mcs in HE mode %d\n", ++ ppdu_info->mcs); ++ return; ++ } + peer->nss.nss_stats->rxrate.mcs = ppdu_info->mcs; + peer->nss.nss_stats->rxrate.flags = RATE_INFO_FLAGS_HE_MCS; + peer->nss.nss_stats->rxrate.he_dcm = ppdu_info->dcm; @@ -1312,8 +1340,6 @@ Signed-off-by: Sriram R + + num_msdu = ppdu_info->tcp_msdu_count + ppdu_info->tcp_ack_msdu_count + + ppdu_info->udp_msdu_count + ppdu_info->other_msdu_count; -+ if (ppdu_info->tid <= IEEE80211_NUM_TIDS) -+ peer->nss.nss_stats->rx_tid_msdu[ppdu_info->tid] += num_msdu; +} + +int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr) @@ -1337,6 +1363,13 @@ Signed-off-by: Sriram R + return -EINVAL; + } + ++ if (!peer->nss.vaddr) { ++ ath11k_warn(ab, "peer already deleted or peer create failed %pM\n", ++ addr); ++ spin_unlock_bh(&ab->base_lock); ++ return -EINVAL; ++ } ++ + wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); + if (!wlmsg) { + ath11k_warn(ab, "nss send peer delete msg alloc failure\n"); @@ -1356,9 +1389,12 @@ Signed-off-by: Sriram R + sizeof(struct nss_wifili_peer_msg), + msg_cb, NULL); + ++ reinit_completion(&peer->nss.complete); ++ + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { -+ ath11k_warn(ab, "nss send peer delete msg tx error %d\n", status); ++ ath11k_warn(ab, "nss send peer (%pM) delete msg tx error %d\n", ++ addr, status); + ret = -EINVAL; + kfree(wlmsg); + goto free_peer; @@ -1368,19 +1404,24 @@ Signed-off-by: Sriram R + ret = 0; + } + -+ kfree(wlmsg); -+ if (peer->nss.nss_stats) { -+ kfree(peer->nss.nss_stats); -+ peer->nss.nss_stats = NULL; -+ } -+ + spin_unlock_bh(&ab->base_lock); + -+ return ret; ++ kfree(wlmsg); ++ ++ /* No need to return failure or free up here, since the msg was tx succesfully ++ * the peer delete response would be received from NSS which will free up ++ * the allocated memory ++ */ ++ ret = wait_for_completion_timeout(&peer->nss.complete, ++ msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); ++ if (!ret) ++ ath11k_warn(ab, "timeout while waiting for nss peer delete msg response\n"); ++ ++ return 0; + +free_peer: + dma_unmap_single(ab->dev, peer->nss.paddr, -+ WIFILI_NSS_PEER_BYTE_SIZE, DMA_TO_DEVICE); ++ WIFILI_NSS_PEER_BYTE_SIZE, DMA_FROM_DEVICE); + kfree(peer->nss.vaddr); + if (peer->nss.nss_stats) { + kfree(peer->nss.nss_stats); @@ -1399,7 +1440,7 @@ Signed-off-by: Sriram R + int ret; + + if (!ab->nss.enabled) -+ return 0; ++ return -ENOTSUPP; + + wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); + if (!wlmsg) @@ -1415,6 +1456,9 @@ Signed-off-by: Sriram R + + peer->nss.vaddr = kzalloc(WIFILI_NSS_PEER_BYTE_SIZE, GFP_ATOMIC); + ++ /* Initialize completion for verifying Peer NSS message response */ ++ init_completion(&peer->nss.complete); ++ + if (!peer->nss.vaddr) { + ath11k_warn(ab, "failed to allocate memory for nss peer info\n"); + kfree(wlmsg); @@ -1445,7 +1489,8 @@ Signed-off-by: Sriram R + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; -+ ath11k_warn(ab, "nss send peer create msg tx error\n"); ++ ath11k_warn(ab, "nss send peer (%pM) create msg tx error\n", ++ peer->addr); + goto peer_mem_free; + } + @@ -1456,14 +1501,17 @@ Signed-off-by: Sriram R + peer_msg->hw_ast_idx, peer_msg->tx_ast_hash); + + peer->nss.nss_stats = kzalloc(sizeof(*peer->nss.nss_stats), GFP_ATOMIC); -+ if (!peer->nss.nss_stats) ++ if (!peer->nss.nss_stats) { ++ ret = -ENOMEM; + ath11k_warn(ab, "Unable to create nss stats memory\n"); ++ goto peer_mem_free; ++ } + + goto msg_free; + +peer_mem_free: + dma_unmap_single(ab->dev, peer->nss.paddr, -+ WIFILI_NSS_PEER_BYTE_SIZE, DMA_TO_DEVICE); ++ WIFILI_NSS_PEER_BYTE_SIZE, DMA_FROM_DEVICE); + kfree(peer->nss.vaddr); +msg_free: + kfree(wlmsg); @@ -1705,10 +1753,10 @@ Signed-off-by: Sriram R + switch (ab->hw_rev) { + case ATH11K_HW_IPQ8074: + return ATH11K_WIFILI_TARGET_TYPE_QCA8074V2; -+ case ATH11K_HW_IPQ6018: ++ case ATH11K_HW_IPQ6018_HW10: + return ATH11K_WIFILI_TARGET_TYPE_QCA6018; -+ case ATH11K_HW_QCN9000: -+ return ATH11K_WIFILI_TARGET_TYPE_QCN9000; ++ case ATH11K_HW_QCN9074_HW10: ++ return ATH11K_WIFILI_TARGET_TYPE_QCN9074; + case ATH11K_HW_IPQ5018: + return ATH11K_WIFILI_TARGET_TYPE_QCA5018; + default: @@ -1721,10 +1769,10 @@ Signed-off-by: Sriram R +{ + switch (ab->hw_rev) { + case ATH11K_HW_IPQ8074: -+ case ATH11K_HW_IPQ6018: ++ case ATH11K_HW_IPQ6018_HW10: + case ATH11K_HW_IPQ5018: + return NSS_WIFILI_INTERNAL_INTERFACE; -+ case ATH11K_HW_QCN9000: ++ case ATH11K_HW_QCN9074_HW10: + return nss_get_available_wifili_external_if(); + default: + /* This can't happen since we validated target type earlier */ @@ -1817,10 +1865,10 @@ Signed-off-by: Sriram R + ath11k_nss_fill_srng_info(ab, dp->reo_except_ring.ring_id, + &wim->reo_exception_ring); + -+ wim->flags |= WIFILI_NSS_CCE_DISABLED; -+ + ab->nss.if_num = ath11k_nss_get_interface_type(ab); + ++ ath11k_info(ab, "nss init soc nss if_num %d userpd_id %d\n", ab->nss.if_num, ab->userpd_id); ++ + if (ab->nss.if_num >= NSS_MAX_NET_INTERFACES) { + ath11k_warn(ab, "NSS invalid interface\n"); + goto free; @@ -1855,17 +1903,17 @@ Signed-off-by: Sriram R + sizeof(struct nss_wifili_init_msg), + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during init sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(nss_contex, wlmsg); + if (status != NSS_TX_SUCCESS) { + ath11k_warn(ab, "failure to send nss init msg\n"); + goto unregister; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during init sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -1928,23 +1976,21 @@ Signed-off-by: Sriram R + return ret; +} + -+static void ath11k_nss_stats_disable(struct ath11k *ar) ++static void ath11k_nss_sojourn_stats_disable(struct ath11k *ar) +{ -+ /*TODO Revisit if this required */ -+ ath11k_nss_stats_cfg(ar, NSS_WIFILI_STATS_CFG_MSG, -+ ATH11K_NSS_STATS_DISABLE); -+ + ath11k_nss_stats_cfg(ar, NSS_WIFILI_STATS_V2_CFG_MSG, + ATH11K_NSS_STATS_DISABLE); +} + -+static void ath11k_nss_stats_enable(struct ath11k *ar) ++void ath11k_nss_peer_stats_disable(struct ath11k *ar) +{ -+ /*TODO Revisit if we need to enable both these stats */ + ath11k_nss_stats_cfg(ar, NSS_WIFILI_STATS_CFG_MSG, -+ ATH11K_NSS_STATS_ENABLE); ++ ATH11K_NSS_STATS_DISABLE); ++} + -+ ath11k_nss_stats_cfg(ar, NSS_WIFILI_STATS_V2_CFG_MSG, ++void ath11k_nss_peer_stats_enable(struct ath11k *ar) ++{ ++ ath11k_nss_stats_cfg(ar, NSS_WIFILI_STATS_CFG_MSG, + ATH11K_NSS_STATS_ENABLE); +} + @@ -2012,6 +2058,11 @@ Signed-off-by: Sriram R + sizeof(struct nss_wifili_pdev_init_msg), + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during init sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(ar->nss.ctx, wlmsg); + + if (status != NSS_TX_SUCCESS) { @@ -2020,11 +2071,6 @@ Signed-off-by: Sriram R + goto free; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during init sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -2041,8 +2087,10 @@ Signed-off-by: Sriram R + + kfree(wlmsg); + -+ /* Enable nss stats */ -+ ath11k_nss_stats_enable(ar); ++ /* Disable nss sojourn stats by default */ ++ ath11k_nss_sojourn_stats_disable(ar); ++ /* Enable nss wifili peer stats by default */ ++ ath11k_nss_peer_stats_enable(ar); + + /*TODO CFG Tx buffer limit as per no clients range per radio + * this needs to be based on target/mem cfg @@ -2085,6 +2133,11 @@ Signed-off-by: Sriram R + 0, + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during init sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + + if (status != NSS_TX_SUCCESS) { @@ -2093,11 +2146,6 @@ Signed-off-by: Sriram R + goto free; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during init sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -2143,6 +2191,11 @@ Signed-off-by: Sriram R + 0, + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during deinit sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + + /* Add a retry mechanism to reset nss until success */ @@ -2151,11 +2204,6 @@ Signed-off-by: Sriram R + goto free; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during deinit sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -2196,6 +2244,11 @@ Signed-off-by: Sriram R + 0, + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during deinit sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + + /* Add a retry mechanism to stop nss until success */ @@ -2205,11 +2258,6 @@ Signed-off-by: Sriram R + goto free; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during deinit sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -2244,8 +2292,9 @@ Signed-off-by: Sriram R + ath11k_dbg(ab, ATH11K_DBG_NSS, "NSS pdev %d deinit\n", radio_id); + dyn_if_type = ath11k_nss_get_dynamic_interface_type(ab); + -+ /* Disable stats before teardown */ -+ ath11k_nss_stats_disable(ar); ++ /* Disable NSS wifili peer stats before teardown */ ++ if (ab->nss.stats_enabled) ++ ath11k_nss_peer_stats_disable(ar); + + wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); + if (!wlmsg) @@ -2261,6 +2310,11 @@ Signed-off-by: Sriram R + sizeof(struct nss_wifili_pdev_deinit_msg), + msg_cb, NULL); + ++ reinit_completion(&ab->nss.complete); ++ ++ /* Note: response is contention free during deinit sequence */ ++ ab->nss.response = ATH11K_NSS_MSG_ACK; ++ + status = nss_wifili_tx_msg(ar->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ath11k_warn(ab, "nss send pdev deinit msg tx error %d\n", status); @@ -2268,11 +2322,6 @@ Signed-off-by: Sriram R + goto free; + } + -+ reinit_completion(&ab->nss.complete); -+ -+ /* Note: response is contention free during deinit sequence */ -+ ab->nss.response = ATH11K_NSS_MSG_ACK; -+ + ret = wait_for_completion_timeout(&ab->nss.complete, + msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); + if (!ret) { @@ -2379,8 +2428,8 @@ Signed-off-by: Sriram R + ath11k_nss_stop(ab); + +pdev_deinit: -+ for (; i >= 0; i--) -+ ath11k_nss_pdev_init(ab, i); ++ for (i -= 1; i >= 0; i--) ++ ath11k_nss_pdev_deinit(ab, i); + + ath11k_nss_reset(ab); + ath11k_nss_tx_desc_mem_free(ab); @@ -2389,7 +2438,7 @@ Signed-off-by: Sriram R +} --- /dev/null +++ b/drivers/net/wireless/ath/ath11k/nss.h -@@ -0,0 +1,267 @@ +@@ -0,0 +1,300 @@ +/* SPDX-License-Identifier: BSD-3-Clause-Clear */ +/* + * Copyright (c) 2020 The Linux Foundation. All rights reserved. @@ -2417,7 +2466,7 @@ Signed-off-by: Sriram R +#define ATH11K_WIFILI_TARGET_TYPE_QCA8074 20 +#define ATH11K_WIFILI_TARGET_TYPE_QCA8074V2 24 +#define ATH11K_WIFILI_TARGET_TYPE_QCA6018 25 -+#define ATH11K_WIFILI_TARGET_TYPE_QCN9000 26 ++#define ATH11K_WIFILI_TARGET_TYPE_QCN9074 26 +#define ATH11K_WIFILI_TARGET_TYPE_QCA5018 29 + +/* Max limit for NSS Queue */ @@ -2452,7 +2501,7 @@ Signed-off-by: Sriram R + +/* ATH11K NSS PEER Info */ +/* Host memory allocated for peer info storage in nss */ -+#define WIFILI_NSS_PEER_BYTE_SIZE 1152 ++#define WIFILI_NSS_PEER_BYTE_SIZE NSS_WIFILI_PEER_SIZE + +/* ATH11K NSS Stats */ +#define ATH11K_NSS_STATS_ENABLE 1 @@ -2475,6 +2524,20 @@ Signed-off-by: Sriram R + +#define NSS_TX_TID_MAX 8 + ++#define ATH11K_NSS_TXRX_NETDEV_STATS(txrx, vif, len, pkt_count) \ ++do { \ ++ struct wireless_dev *wdev = ieee80211_vif_to_wdev(vif); \ ++ struct pcpu_sw_netstats *tstats; \ ++ \ ++ if (!wdev) \ ++ break; \ ++ tstats = this_cpu_ptr(netdev_tstats(wdev->netdev)); \ ++ u64_stats_update_begin(&tstats->syncp); \ ++ tstats->txrx ## _packets += pkt_count; \ ++ tstats->txrx ## _bytes += len; \ ++ u64_stats_update_end(&tstats->syncp); \ ++} while (0) ++ +enum ath11k_nss_opmode { + ATH11K_NSS_OPMODE_UNKNOWN, + ATH11K_NSS_OPMODE_AP, @@ -2495,8 +2558,6 @@ Signed-off-by: Sriram R + u32 rx_dropped; + u32 last_rxdrop; + struct rate_info rxrate; -+ u32 tx_tid_msdu[NSS_TX_TID_MAX]; -+ u32 rx_tid_msdu[IEEE80211_NUM_TIDS + 1]; +}; + +enum ath11k_nss_peer_sec_type { @@ -2519,6 +2580,7 @@ Signed-off-by: Sriram R + uint32_t *vaddr; + dma_addr_t paddr; + struct peer_stats *nss_stats; ++ struct completion complete; +}; + +/* Structure to hold the vif related info for nss offload support */ @@ -2546,6 +2608,8 @@ Signed-off-by: Sriram R +struct ath11k_soc_nss { + /* turn on/off nss offload support in ath11k */ + bool enabled; ++ /* turn on/off nss stats support in ath11k */ ++ bool stats_enabled; +#ifdef CPTCFG_ATH11K_NSS_SUPPORT + /* soc nss ctx */ + void* ctx; @@ -2571,7 +2635,10 @@ Signed-off-by: Sriram R +int ath11k_nss_vdev_up(struct ath11k_vif *arvif); +int ath11k_nss_vdev_down(struct ath11k_vif *arvif); +int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr); ++int ath11k_nss_set_peer_authorize(struct ath11k *ar, u16 peer_id); +int ath11k_nss_peer_create(struct ath11k_base *ab, struct ath11k_peer *peer); ++void ath11k_nss_peer_stats_enable(struct ath11k *ar); ++void ath11k_nss_peer_stats_disable(struct ath11k *ar); +int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, + struct ieee80211_key_conf *key_conf); +void ath11k_nss_update_sta_stats(struct station_info *sinfo, @@ -2598,6 +2665,11 @@ Signed-off-by: Sriram R + return 0; +} + ++static inline int ath11k_nss_set_peer_authorize(struct ath11k *ar, u16 peer_id) ++{ ++ return 0; ++} ++ +static inline void ath11k_nss_vdev_delete(struct ath11k_vif *arvif) +{ +} @@ -2635,6 +2707,16 @@ Signed-off-by: Sriram R + return 0; +} + ++static inline void ath11k_nss_peer_stats_enable(struct ath11k *ar) ++{ ++ return; ++} ++ ++static inline void ath11k_nss_peer_stats_disable(struct ath11k *ar) ++{ ++ return; ++} ++ +static inline int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, + struct ieee80211_key_conf *key_conf) +{ @@ -2659,15 +2741,15 @@ Signed-off-by: Sriram R +#endif --- a/drivers/net/wireless/ath/ath11k/hif.h +++ b/drivers/net/wireless/ath/ath11k/hif.h -@@ -24,6 +24,7 @@ struct ath11k_hif_ops { - u32 *base_vector); - void (*get_msi_address)(struct ath11k_base *ab, u32 *msi_addr_lo, - u32 *msi_addr_hi); -+ u32 (*get_window_offset)(struct ath11k_base *ab, u32 offset); +@@ -29,6 +29,7 @@ struct ath11k_hif_ops { + void (*ce_irq_enable)(struct ath11k_base *ab); + void (*ce_irq_disable)(struct ath11k_base *ab); void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx); ++ u32 (*get_window_offset)(struct ath11k_base *ab, u32 offset); }; -@@ -94,6 +95,14 @@ static inline void ath11k_get_msi_addres + static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab) +@@ -126,6 +127,14 @@ static inline void ath11k_get_msi_addres ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi); } @@ -2684,7 +2766,7 @@ Signed-off-by: Sriram R { --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -160,6 +160,20 @@ static inline u32 ath11k_pci_get_window_ +@@ -174,6 +174,20 @@ static inline u32 ath11k_pci_get_window_ return window_start; } @@ -2705,11 +2787,212 @@ Signed-off-by: Sriram R void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) { struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); -@@ -939,6 +953,7 @@ static const struct ath11k_hif_ops ath11 - .get_msi_address = ath11k_pci_get_msi_address, - .get_user_msi_vector = ath11k_get_user_msi_assignment, +@@ -1180,6 +1194,7 @@ static const struct ath11k_hif_ops ath11 .map_service_to_pipe = ath11k_pci_map_service_to_pipe, + .ce_irq_enable = ath11k_pci_hif_ce_irq_enable, + .ce_irq_disable = ath11k_pci_hif_ce_irq_disable, + .get_window_offset = ath11k_pci_get_window_offset, .get_ce_msi_idx = ath11k_pci_get_ce_msi_idx, }; +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -955,6 +955,29 @@ unlock_exit: + spin_unlock_bh(&ab->base_lock); + } + ++/* Sends WMI config to filter packets to route packets to WBM release ring */ ++int ath11k_dp_rx_pkt_type_filter(struct ath11k *ar, enum ath11k_routing_pkt_type pkt_type, u32 meta_data) ++{ ++ struct ath11k_wmi_pkt_route_param param; ++ int ret; ++ ++ /* Routing Eapol packets to CCE is only allowed now */ ++ if (pkt_type != ATH11K_PKT_TYPE_EAP) ++ return -EINVAL; ++ ++ param.opcode = ATH11K_WMI_PKTROUTE_ADD; ++ param.meta_data = meta_data; ++ param.dst_ring = ATH11K_ROUTE_WBM_RELEASE; ++ param.dst_ring_handler = ATH11K_WMI_PKTROUTE_USE_CCE; ++ param.route_type_bmap = 1 << pkt_type; ++ ++ ret = ath11k_wmi_send_pdev_pkt_route(ar, ¶m); ++ if (ret) ++ ath11k_warn(ar->ab, "failed to configure pkt route %d", ret); ++ ++ return ret; ++} ++ + int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + u8 tid, u32 ba_win_sz, u16 ssn, + enum hal_pn_type pn_type) +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -1073,6 +1073,44 @@ int ath11k_wmi_send_pdev_set_regdomain(s + return ret; + } + ++int ath11k_wmi_send_pdev_pkt_route(struct ath11k *ar, struct ath11k_wmi_pkt_route_param *param) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct wmi_pdev_pkt_route_cmd *cmd; ++ struct sk_buff *skb; ++ int ret; ++ ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); ++ if (!skb) ++ return -ENOMEM; ++ ++ cmd = (struct wmi_pdev_pkt_route_cmd *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, ++ WMI_TAG_PDEV_UPDATE_PKT_ROUTING_CMD) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); ++ ++ cmd->pdev_id = ar->pdev->pdev_id; ++ cmd->opcode = param->opcode; ++ cmd->route_type_bmap = param->route_type_bmap; ++ cmd->dst_ring = param->dst_ring; ++ cmd->meta_data = param->meta_data; ++ cmd->dst_ring_handler = param->dst_ring_handler; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, ++ "WMI pdev pkt route opcode %d route_bmap %d dst_ring %d meta_datan %d dst_ringg_handler %d\n", ++ param->opcode, param->route_type_bmap, ++ param->dst_ring, param->meta_data, param->dst_ring_handler); ++ ++ ret = ath11k_wmi_cmd_send(wmi, skb, WMI_PDEV_UPDATE_PKT_ROUTING_CMDID); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "failed to send WMI_PDEV_UPDATE_PKT_ROUTING cmd\n"); ++ dev_kfree_skb(skb); ++ } ++ ++ return ret; ++} ++ + int ath11k_wmi_set_peer_param(struct ath11k *ar, const u8 *peer_addr, + u32 vdev_id, u32 param_id, u32 param_val) + { +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2785,6 +2785,27 @@ struct pdev_set_regdomain_params { + u32 pdev_id; + }; + ++ /* Defines various options for routing policy */ ++enum wmi_pdev_dest_ring_handler_type { ++ ATH11K_WMI_PKTROUTE_USE_CCE = 0, ++ ATH11K_WMI_PKTROUTE_USE_ASPT = 1, ++ ATH11K_WMI_PKTROUTE_USE_FSE = 2, ++ ATH11K_WMI_PKTROUTE_USE_CCE2 = 3, ++}; ++ ++enum ath11k_wmi_pkt_route_opcode { ++ ATH11K_WMI_PKTROUTE_ADD, ++ ATH11K_WMI_PKTROUTE_DEL, ++}; ++ ++struct ath11k_wmi_pkt_route_param { ++ enum ath11k_wmi_pkt_route_opcode opcode; ++ u32 route_type_bmap; ++ u32 dst_ring_handler; ++ u32 dst_ring; ++ u32 meta_data; ++}; ++ + struct rx_reorder_queue_remove_params { + u8 *peer_macaddr; + u16 vdev_id; +@@ -3037,6 +3058,16 @@ struct wmi_pdev_set_regdomain_cmd { + u32 dfs_domain; + } __packed; + ++struct wmi_pdev_pkt_route_cmd { ++ u32 tlv_header; ++ u32 pdev_id; ++ u32 opcode; ++ u32 route_type_bmap; ++ u32 dst_ring; ++ u32 meta_data; ++ u32 dst_ring_handler; ++} __packed; ++ + struct wmi_peer_set_param_cmd { + u32 tlv_header; + u32 vdev_id; +@@ -5733,6 +5764,8 @@ int ath11k_wmi_send_peer_create_cmd(stru + int ath11k_wmi_vdev_set_param_cmd(struct ath11k *ar, u32 vdev_id, + u32 param_id, u32 param_value); + ++int ath11k_wmi_send_pdev_pkt_route(struct ath11k *ar, ++ struct ath11k_wmi_pkt_route_param *param); + int ath11k_wmi_set_sta_ps_param(struct ath11k *ar, u32 vdev_id, + u32 param, u32 param_value); + int ath11k_wmi_force_fw_hang_cmd(struct ath11k *ar, u32 type, u32 delay_time_ms); +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -20,6 +20,34 @@ + #define DP_RX_MPDU_ERR_MPDU_LEN BIT(6) + #define DP_RX_MPDU_ERR_UNENCRYPTED_FRAME BIT(7) + ++/* different supported pkt types for routing */ ++enum ath11k_routing_pkt_type { ++ ATH11K_PKT_TYPE_ARP_IPV4, ++ ATH11K_PKT_TYPE_NS_IPV6, ++ ATH11K_PKT_TYPE_IGMP_IPV4, ++ ATH11K_PKT_TYPE_MLD_IPV6, ++ ATH11K_PKT_TYPE_DHCP_IPV4, ++ ATH11K_PKT_TYPE_DHCP_IPV6, ++ ATH11K_PKT_TYPE_DNS_TCP_IPV4, ++ ATH11K_PKT_TYPE_DNS_TCP_IPV6, ++ ATH11K_PKT_TYPE_DNS_UDP_IPV4, ++ ATH11K_PKT_TYPE_DNS_UDP_IPV6, ++ ATH11K_PKT_TYPE_ICMP_IPV4, ++ ATH11K_PKT_TYPE_ICMP_IPV6, ++ ATH11K_PKT_TYPE_TCP_IPV4, ++ ATH11K_PKT_TYPE_TCP_IPV6, ++ ATH11K_PKT_TYPE_UDP_IPV4, ++ ATH11K_PKT_TYPE_UDP_IPV6, ++ ATH11K_PKT_TYPE_IPV4, ++ ATH11K_PKT_TYPE_IPV6, ++ ATH11K_PKT_TYPE_EAP, ++ ATH11K_PKT_TYPE_MAX ++}; ++ ++#define ATH11K_RX_PROTOCOL_TAG_START_OFFSET 128 ++#define ATH11K_ROUTE_WBM_RELEASE 5 ++#define ATH11K_ROUTE_EAP_METADATA (ATH11K_RX_PROTOCOL_TAG_START_OFFSET + ATH11K_PKT_TYPE_EAP) ++ + enum dp_rx_decap_type { + DP_RX_DECAP_TYPE_RAW, + DP_RX_DECAP_TYPE_NATIVE_WIFI, +@@ -74,6 +102,9 @@ void ath11k_peer_rx_tid_delete(struct at + int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + u8 tid, u32 ba_win_sz, u16 ssn, + enum hal_pn_type pn_type); ++int ath11k_dp_rx_pkt_type_filter(struct ath11k *ar, ++ enum ath11k_routing_pkt_type pkt_type, ++ u32 meta_data); + void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, + struct sk_buff *skb); + int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5217,6 +5217,16 @@ static int ath11k_mac_op_start(struct ie + } + } + ++ /* nss offload requires eapol packets to be routed to wbm release ring */ ++ if (ab->nss.enabled) { ++ ret = ath11k_dp_rx_pkt_type_filter(ar, ATH11K_PKT_TYPE_EAP, ++ ATH11K_ROUTE_EAP_METADATA); ++ if (ret) { ++ ath11k_err(ar->ab, "failed to configure EAP pkt route: %d\n", ret); ++ goto err; ++ } ++ } ++ + __ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask); + + /* TODO: Do we need to enable ANI? */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/199-003-ath11k-add-nss-support.patch b/feeds/wifi-ax/mac80211/patches/qca/199-003-ath11k-add-nss-support.patch index 9aaeadeb1..c77b7d5c2 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/199-003-ath11k-add-nss-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/199-003-ath11k-add-nss-support.patch @@ -24,7 +24,7 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -440,6 +440,12 @@ static int ath11k_ahb_ext_irq_config(str +@@ -442,6 +442,12 @@ static int ath11k_ahb_ext_irq_config(str int i, j; int irq; int ret; @@ -37,7 +37,7 @@ Signed-off-by: Sriram R for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; -@@ -452,20 +458,20 @@ static int ath11k_ahb_ext_irq_config(str +@@ -454,20 +460,20 @@ static int ath11k_ahb_ext_irq_config(str ath11k_ahb_ext_grp_napi_poll, NAPI_POLL_WEIGHT); for (j = 0; j < ATH11K_EXT_IRQ_NUM_MAX; j++) { @@ -62,7 +62,7 @@ Signed-off-by: Sriram R irq_grp->irqs[num_irq++] = wbm2host_rx_release; if (ab->hw_params.ring_mask->reo_status[i] & BIT(j)) -@@ -483,7 +489,7 @@ static int ath11k_ahb_ext_irq_config(str +@@ -480,7 +486,7 @@ static int ath11k_ahb_ext_irq_config(str ath11k_hw_get_mac_from_pdev_id(hw, j); } @@ -71,7 +71,7 @@ Signed-off-by: Sriram R irq_grp->irqs[num_irq++] = host2rxdma_host_buf_ring_mac1 - ath11k_hw_get_mac_from_pdev_id(hw, j); -@@ -653,6 +659,7 @@ static int ath11k_ahb_probe(struct platf +@@ -673,6 +679,7 @@ static int ath11k_ahb_probe(struct platf ab->hw_rev = (enum ath11k_hw_rev)of_id->data; ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; ab->mem = mem; @@ -81,29 +81,20 @@ Signed-off-by: Sriram R platform_set_drvdata(pdev, ab); --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -13,14 +13,21 @@ - #include "dp_rx.h" - #include "debug.h" +@@ -16,6 +16,12 @@ #include "hif.h" -+#include "nss.h" + #include "wow.h" - unsigned int ath11k_debug_mask; - unsigned int cryptmode; - EXPORT_SYMBOL(ath11k_debug_mask); +unsigned int nss_offload; -+ - module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); - module_param_named(cryptmode, cryptmode, uint, 0644); - MODULE_PARM_DESC(debug_mask, "Debugging mask"); - MODULE_PARM_DESC(cryptmode, "crypto mode: 0-hardware, 1-software"); +#ifdef CPTCFG_ATH11K_NSS_SUPPORT +module_param_named(nss_offload, nss_offload, uint, 0644); +MODULE_PARM_DESC(nss_offload, "Enable NSS Offload support"); +#endif - - extern unsigned int ath11k_frame_mode; - -@@ -490,23 +497,30 @@ static int ath11k_core_pdev_create(struc ++ + unsigned int ath11k_debug_mask; + EXPORT_SYMBOL(ath11k_debug_mask); + module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); +@@ -641,23 +647,30 @@ static int ath11k_core_pdev_create(struc return ret; } @@ -140,7 +131,7 @@ Signed-off-by: Sriram R } ret = ath11k_spectral_init(ab); -@@ -519,10 +533,12 @@ static int ath11k_core_pdev_create(struc +@@ -670,10 +683,12 @@ static int ath11k_core_pdev_create(struc err_thermal_unregister: ath11k_thermal_unregister(ab); @@ -153,9 +144,9 @@ Signed-off-by: Sriram R +err_dp_pdev_free: + ath11k_dp_pdev_free(ab); err_pdev_debug: - ath11k_debug_pdev_destroy(ab); + ath11k_debugfs_pdev_destroy(ab); -@@ -534,6 +550,10 @@ static void ath11k_core_pdev_destroy(str +@@ -685,6 +700,10 @@ static void ath11k_core_pdev_destroy(str ath11k_spectral_deinit(ab); ath11k_thermal_unregister(ab); ath11k_mac_unregister(ab); @@ -165,8 +156,8 @@ Signed-off-by: Sriram R + ath11k_hif_irq_disable(ab); ath11k_dp_pdev_free(ab); - ath11k_debug_pdev_destroy(ab); -@@ -773,6 +793,10 @@ static int ath11k_core_reconfigure_on_cr + ath11k_debugfs_pdev_destroy(ab); +@@ -944,6 +963,10 @@ static int ath11k_core_reconfigure_on_cr int ret; mutex_lock(&ab->core_lock); @@ -174,19 +165,21 @@ Signed-off-by: Sriram R + ath11k_nss_teardown(ab); + ab->nss.enabled = false; + - ath11k_thermal_unregister(ab); - ath11k_hif_irq_disable(ab); - ath11k_dp_pdev_free(ab); -@@ -987,6 +1011,8 @@ int ath11k_core_pre_init(struct ath11k_b + #ifdef CONFIG_QCOM_QMI_HELPERS + /* Unregister the ssr notifier as we are not interested + * in receving these notifications after mac is unregistered. +@@ -1165,6 +1188,10 @@ int ath11k_core_pre_init(struct ath11k_b ath11k_err(ab, "failed to get hw params: %d\n", ret); return ret; } + ab->nss.enabled = nss_offload; + ++ if (nss_offload) ++ ab->nss.stats_enabled = 1; return 0; } -@@ -1031,7 +1057,6 @@ int ath11k_core_init(struct ath11k_base +@@ -1179,7 +1206,6 @@ int ath11k_core_init(struct ath11k_base ath11k_err(ab, "failed to create soc core: %d\n", ret); return ret; } @@ -204,7 +197,7 @@ Signed-off-by: Sriram R #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) -@@ -249,6 +250,9 @@ struct ath11k_vif { +@@ -260,6 +261,9 @@ struct ath11k_vif { struct ieee80211_chanctx_conf chanctx; struct dentry *debugfs_twt; struct ath11k_mgmt_frame_stats mgmt_stats; @@ -214,7 +207,7 @@ Signed-off-by: Sriram R }; struct ath11k_vif_iter { -@@ -396,6 +400,9 @@ struct ath11k_sta { +@@ -407,6 +411,9 @@ struct ath11k_sta { #endif bool use_4addr_set; @@ -224,7 +217,7 @@ Signed-off-by: Sriram R }; #define ATH11K_MIN_5G_FREQ 4150 -@@ -512,6 +519,9 @@ struct ath11k { +@@ -524,6 +531,9 @@ struct ath11k { struct ieee80211_hw *hw; struct ieee80211_ops *ops; struct ath11k_pdev_wmi *wmi; @@ -234,7 +227,7 @@ Signed-off-by: Sriram R struct ath11k_pdev_dp dp; u8 mac_addr[ETH_ALEN]; u32 ht_cap_info; -@@ -751,8 +761,10 @@ struct ath11k_base { +@@ -761,8 +771,10 @@ struct ath11k_base { struct ath11k_htc htc; struct ath11k_dp dp; @@ -245,15 +238,6 @@ Signed-off-by: Sriram R unsigned long mem_len; struct { -@@ -970,7 +982,7 @@ extern const struct service_to_pipe ath1 - - void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); - void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, -- u8 *mac_addr, u16 ast_hash); -+ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); - struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, - const u8 *addr); - struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, --- a/drivers/net/wireless/ath/ath11k/dp.c +++ b/drivers/net/wireless/ath/ath11k/dp.c @@ -45,12 +45,17 @@ int ath11k_dp_peer_setup(struct ath11k * @@ -294,7 +278,7 @@ Signed-off-by: Sriram R switch (type) { case HAL_WBM2SW_RELEASE: if (ring_num < 3) { -@@ -733,14 +750,18 @@ int ath11k_dp_service_srng(struct ath11k +@@ -755,14 +772,18 @@ int ath11k_dp_service_srng(struct ath11k int work_done = 0; int i = 0, j; int tot_work_done = 0; @@ -315,7 +299,7 @@ Signed-off-by: Sriram R work_done = ath11k_dp_process_rx_err(ab, napi, budget); budget -= work_done; tot_work_done += work_done; -@@ -748,7 +769,7 @@ int ath11k_dp_service_srng(struct ath11k +@@ -770,7 +791,7 @@ int ath11k_dp_service_srng(struct ath11k goto done; } @@ -324,7 +308,7 @@ Signed-off-by: Sriram R work_done = ath11k_dp_rx_process_wbm_err(ab, napi, budget); -@@ -759,7 +780,7 @@ int ath11k_dp_service_srng(struct ath11k +@@ -781,7 +802,7 @@ int ath11k_dp_service_srng(struct ath11k goto done; } @@ -333,7 +317,7 @@ Signed-off-by: Sriram R i = fls(ab->hw_params.ring_mask->rx[grp_id]) - 1; work_done = ath11k_dp_process_rx(ab, i, napi, budget); -@@ -793,7 +814,7 @@ int ath11k_dp_service_srng(struct ath11k +@@ -815,7 +836,7 @@ int ath11k_dp_service_srng(struct ath11k if (ab->hw_params.ring_mask->reo_status[grp_id]) ath11k_dp_process_reo_status(ab); @@ -344,7 +328,7 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -164,6 +164,7 @@ struct ath11k_pdev_dp { +@@ -166,6 +166,7 @@ struct ath11k_pdev_dp { #define DP_AVG_MSDUS_PER_MPDU 4 #define DP_RX_HASH_ENABLE 1 /* Enable hash based Rx steering */ @@ -354,7 +338,7 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -15,6 +15,7 @@ +@@ -17,6 +17,7 @@ #include "hal_rx.h" #include "dp_tx.h" #include "peer.h" @@ -362,7 +346,7 @@ Signed-off-by: Sriram R #define ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS (2 * HZ) -@@ -194,8 +195,8 @@ static u8 ath11k_dp_rx_h_mpdu_start_tid( +@@ -190,8 +191,8 @@ static u8 ath11k_dp_rx_h_mpdu_start_tid( return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); } @@ -373,7 +357,7 @@ Signed-off-by: Sriram R { return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); } -@@ -206,8 +207,8 @@ static u8 ath11k_dp_rx_h_msdu_end_l3pad( +@@ -202,8 +203,8 @@ static u8 ath11k_dp_rx_h_msdu_end_l3pad( return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); } @@ -384,8 +368,8 @@ Signed-off-by: Sriram R { return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); } -@@ -263,7 +264,7 @@ static void ath11k_dp_rxdesc_set_msdu_le - ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); +@@ -294,7 +295,7 @@ static int ath11k_dp_purge_mon_ring(stru + return -ETIMEDOUT; } -static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, @@ -393,7 +377,7 @@ Signed-off-by: Sriram R struct hal_rx_desc *desc) { struct rx_attention *attn = ath11k_dp_rx_get_attention(ab, desc); -@@ -468,7 +469,9 @@ static int ath11k_dp_rxdma_pdev_buf_setu +@@ -498,7 +499,9 @@ static int ath11k_dp_rxdma_pdev_buf_setu struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; int i; @@ -404,37 +388,7 @@ Signed-off-by: Sriram R if (ar->ab->hw_params.rxdma1_enable) { rx_ring = &dp->rxdma_mon_buf_ring; -@@ -1755,6 +1758,7 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s - u8 mac_addr[ETH_ALEN]; - u16 peer_mac_h16; - u16 ast_hash; -+ u16 hw_peer_id; - - ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); - -@@ -1775,7 +1779,8 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s - resp->peer_map_ev.info1); - ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, - peer_mac_h16, mac_addr); -- ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0); -+ ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, -+ 0); - break; - case HTT_T2H_MSG_TYPE_PEER_MAP2: - vdev_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO_VDEV_ID, -@@ -1788,7 +1793,10 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s - peer_mac_h16, mac_addr); - ast_hash = FIELD_GET(HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL, - resp->peer_map_ev.info2); -- ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash); -+ hw_peer_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID, -+ resp->peer_map_ev.info1); -+ ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, -+ hw_peer_id); - break; - case HTT_T2H_MSG_TYPE_PEER_UNMAP: - case HTT_T2H_MSG_TYPE_PEER_UNMAP2: -@@ -1979,7 +1987,7 @@ static void ath11k_dp_rx_h_csum_offload( +@@ -1971,7 +1974,7 @@ static void ath11k_dp_rx_h_csum_offload( CHECKSUM_NONE : CHECKSUM_UNNECESSARY; } @@ -443,7 +397,7 @@ Signed-off-by: Sriram R enum hal_encrypt_type enctype) { switch (enctype) { -@@ -2006,7 +2014,7 @@ static int ath11k_dp_rx_crypto_mic_len(s +@@ -1998,7 +2001,7 @@ static int ath11k_dp_rx_crypto_mic_len(s return 0; } @@ -452,7 +406,7 @@ Signed-off-by: Sriram R enum hal_encrypt_type enctype) { switch (enctype) { -@@ -2034,7 +2042,7 @@ static int ath11k_dp_rx_crypto_param_len +@@ -2026,7 +2029,7 @@ static int ath11k_dp_rx_crypto_param_len return 0; } @@ -461,7 +415,7 @@ Signed-off-by: Sriram R enum hal_encrypt_type enctype) { switch (enctype) { -@@ -3402,7 +3410,7 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3406,7 +3409,7 @@ int ath11k_dp_rx_process_mon_status(stru struct sk_buff_head skb_list; struct hal_rx_mon_ppdu_info *ppdu_info; struct ath11k_peer *peer; @@ -470,7 +424,7 @@ Signed-off-by: Sriram R int num_buffs_reaped = 0; u32 rx_buf_sz; u16 log_type = 0; -@@ -3482,6 +3490,8 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -3486,6 +3489,8 @@ int ath11k_dp_rx_process_mon_status(stru ath11k_rx_stats_buf_pktlog_process(ar, skb->data, log_type, rx_buf_sz); } @@ -481,9 +435,9 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/dp_rx.h +++ b/drivers/net/wireless/ath/ath11k/dp_rx.h -@@ -114,4 +114,16 @@ int ath11k_dp_rx_pdev_mon_detach(struct - int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar); - int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id); +@@ -115,4 +115,16 @@ int ath11k_peer_rx_frag_setup(struct ath + int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab); + int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer); +int ath11k_dp_rx_crypto_mic_len(struct ath11k *ar, + enum hal_encrypt_type enctype); @@ -500,7 +454,7 @@ Signed-off-by: Sriram R #endif /* ATH11K_DP_RX_H */ --- a/drivers/net/wireless/ath/ath11k/hal.h +++ b/drivers/net/wireless/ath/ath11k/hal.h -@@ -401,6 +401,8 @@ enum hal_srng_ring_id { +@@ -414,6 +414,8 @@ enum hal_srng_ring_id { #define HAL_SRNG_RING_ID_MAX (HAL_SRNG_RING_ID_UMAC_ID_END + \ HAL_SRNG_NUM_LMAC_RINGS) @@ -511,7 +465,7 @@ Signed-off-by: Sriram R HAL_REO_EXCEPTION, --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -801,14 +801,18 @@ void ath11k_hal_reo_init_cmd_ring(struct +@@ -803,14 +803,18 @@ void ath11k_hal_reo_init_cmd_ring(struct void ath11k_hal_reo_hw_setup(struct ath11k_base *ab, u32 ring_hash_map) { @@ -531,7 +485,7 @@ Signed-off-by: Sriram R FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) | FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1); ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val); -@@ -822,6 +826,10 @@ void ath11k_hal_reo_hw_setup(struct ath1 +@@ -824,6 +828,10 @@ void ath11k_hal_reo_hw_setup(struct ath1 ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3(ab), HAL_DEFAULT_REO_TIMEOUT_USEC); @@ -544,15 +498,15 @@ Signed-off-by: Sriram R ring_hash_map)); --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -16,6 +16,7 @@ - #include "testmode.h" +@@ -17,6 +17,7 @@ #include "peer.h" + #include "debugfs_sta.h" #include "vendor.h" +#include "nss.h" #define CHAN2G(_channel, _freq, _flags) { \ .band = NL80211_BAND_2GHZ, \ -@@ -1124,6 +1125,11 @@ static void ath11k_control_beaconing(str +@@ -1102,6 +1103,11 @@ static void ath11k_control_beaconing(str lockdep_assert_held(&arvif->ar->conf_mutex); if (!info->enable_beacon) { @@ -564,7 +518,7 @@ Signed-off-by: Sriram R ret = ath11k_wmi_vdev_down(ar, arvif->vdev_id); if (ret) ath11k_warn(ar->ab, "failed to down vdev_id %i: %d\n", -@@ -1166,6 +1172,12 @@ static void ath11k_control_beaconing(str +@@ -1135,6 +1141,12 @@ static void ath11k_control_beaconing(str arvif->is_up = true; @@ -577,7 +531,7 @@ Signed-off-by: Sriram R ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); } -@@ -2324,6 +2336,12 @@ static void ath11k_bss_assoc(struct ieee +@@ -2306,6 +2318,12 @@ static void ath11k_bss_assoc(struct ieee "mac vdev %d up (associated) bssid %pM aid %d\n", arvif->vdev_id, bss_conf->bssid, bss_conf->aid); @@ -590,7 +544,7 @@ Signed-off-by: Sriram R /* Authorize BSS Peer */ ret = ath11k_wmi_set_peer_param(ar, arvif->bssid, arvif->vdev_id, -@@ -2348,6 +2366,10 @@ static void ath11k_bss_disassoc(struct i +@@ -2330,6 +2348,10 @@ static void ath11k_bss_disassoc(struct i lockdep_assert_held(&ar->conf_mutex); @@ -601,8 +555,8 @@ Signed-off-by: Sriram R ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %i disassoc bssid %pM\n", arvif->vdev_id, arvif->bssid); -@@ -2423,6 +2445,28 @@ static void ath11k_recalculate_mgmt_rate - ath11k_warn(ar->ab, "failed to set beacon tx rate %d\n", ret); +@@ -2603,6 +2625,28 @@ static int ath11k_mac_config_obss_pd(str + return 0; } +static void ath11k_mac_op_nss_bss_info_changed(struct ieee80211_hw *hw, @@ -630,24 +584,45 @@ Signed-off-by: Sriram R static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, -@@ -3168,6 +3212,16 @@ static int ath11k_mac_op_set_key(struct +@@ -3360,6 +3404,26 @@ static int ath11k_mac_op_set_key(struct spin_lock_bh(&ab->base_lock); peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); + + /* TODO: Check if vdev specific security cfg is mandatory */ + ret = ath11k_nss_vdev_set_cmd(arvif, NSS_WIFI_VDEV_SECURITY_TYPE_CMD, key->cipher); -+ if (ret) ++ if (ret) { + ath11k_warn(ab, "failure to set vdev security type in nss"); ++ goto unlock; ++ } + + ret = ath11k_nss_set_peer_sec_type(ar, peer, key); -+ if (ret) ++ if (ret) { + ath11k_warn(ab, "failure to set peer security type in nss"); ++ goto unlock; ++ } ++ ++ ret = ath11k_nss_set_peer_authorize(ar, peer->peer_id); ++ if (ret) { ++ ath11k_warn(ab, "failure to authorize peer in nss"); ++ goto unlock; ++ } + if (peer && cmd == SET_KEY) { peer->keys[key->keyidx] = key; if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { -@@ -4899,7 +4953,10 @@ static void ath11k_mac_op_tx(struct ieee +@@ -3398,9 +3462,8 @@ static int ath11k_mac_op_set_key(struct + break; + } + } +- ++unlock: + spin_unlock_bh(&ab->base_lock); +- + exit: + mutex_unlock(&ar->conf_mutex); + return ret; +@@ -5089,10 +5152,14 @@ static void ath11k_mac_op_tx(struct ieee return; } @@ -659,18 +634,22 @@ Signed-off-by: Sriram R if (ret) { ath11k_warn(ar->ab, "failed to transmit frame %d\n", ret); ieee80211_free_txskb(ar->hw, skb); -@@ -4924,6 +4981,8 @@ static int ath11k_mac_config_mon_status_ ++ return; + } + } + +@@ -5114,6 +5181,8 @@ static int ath11k_mac_config_mon_status_ if (enable) { tlv_filter = ath11k_mac_mon_status_filter_default; + ath11k_nss_ext_rx_stats(ar->ab, &tlv_filter); + - if (ath11k_debug_rx_filter(ar)) - tlv_filter.rx_filter = ath11k_debug_rx_filter(ar); + if (ath11k_debugfs_rx_filter(ar)) + tlv_filter.rx_filter = ath11k_debugfs_rx_filter(ar); } -@@ -5253,6 +5312,12 @@ static int ath11k_mac_op_add_interface(s - list_add(&arvif->list, &ar->arvifs); - spin_unlock_bh(&ar->data_lock); +@@ -5339,6 +5408,12 @@ static void ath11k_mac_op_update_vif_off + u32 param_id, param_value; + int ret; + ret = ath11k_nss_vdev_create(arvif); + if(ret) { @@ -679,59 +658,56 @@ Signed-off-by: Sriram R + } + param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; - if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET) - switch (vif->type) { -@@ -5281,6 +5346,13 @@ static int ath11k_mac_op_add_interface(s - goto err_vdev_del; - } + if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET || + (vif->type != NL80211_IFTYPE_STATION && +@@ -5483,7 +5558,28 @@ static int ath11k_mac_op_add_interface(s + list_add(&arvif->list, &ar->arvifs); + spin_unlock_bh(&ar->data_lock); +- ath11k_mac_op_update_vif_offload(hw, vif); ++ if (ath11k_mac_op_update_vif_offload(hw, vif)) ++ goto err_vdev_del; ++ ++ if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) ++ param_value = ATH11K_HW_TXRX_ETHERNET; ++ else if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) ++ param_value = ATH11K_HW_TXRX_RAW; ++ else ++ param_value = ATH11K_HW_TXRX_NATIVE_WIFI; ++ + ret = ath11k_nss_vdev_set_cmd(arvif, NSS_WIFI_VDEV_ENCAP_TYPE_CMD, param_value); + + if(ret) { + ath11k_warn(ab, "failed to set encap type in nss %d\n", ret); + goto err_vdev_del; + } -+ - /* Do not enable ethernet mode for mesh vifs, packets in mesh network - * can be forwarded to other mesh nodes and mac80211 expects the packet - * in 802.11 format. Also, please note that ethernet mode shall not be -@@ -5300,6 +5372,18 @@ static int ath11k_mac_op_add_interface(s - arvif->vdev_id, ret); - goto err_vdev_del; - } -+ } else if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) { -+ param_value = ATH11K_HW_TXRX_RAW; -+ /* wmi vdev decap commands not required as it is set during wmi init */ -+ } else { -+ param_value = ATH11K_HW_TXRX_NATIVE_WIFI; -+ /* wmi vdev decap commands not required as it is set during wmi init */ -+ } + + ret = ath11k_nss_vdev_set_cmd(arvif, NSS_WIFI_VDEV_DECAP_TYPE_CMD, param_value); + if(ret) { + ath11k_warn(ab, "failed to set decap type in nss %d\n", ret); + goto err_vdev_del; - } ++ } nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1; -@@ -5428,6 +5512,7 @@ err_peer_del: + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +@@ -5611,6 +5707,7 @@ err_peer_del: } err_vdev_del: + ath11k_nss_vdev_delete(arvif); - ath11k_mac_vdev_delete(arvif); + ath11k_wmi_vdev_delete(ar, arvif->vdev_id); + ar->num_created_vdevs--; + ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); +@@ -5660,6 +5757,8 @@ static void ath11k_mac_op_remove_interfa - spin_lock_bh(&ar->data_lock); -@@ -5472,6 +5557,8 @@ static void ath11k_mac_op_remove_interfa - arvif->vdev_id, ret); - } + reinit_completion(&ar->vdev_delete_done); + ath11k_nss_vdev_delete(arvif); + - ret = ath11k_mac_vdev_delete(arvif); - if (ret) - goto err_vdev_del; -@@ -5871,6 +5958,10 @@ ath11k_mac_update_vif_chan(struct ath11k + ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); + if (ret) { + ath11k_warn(ab, "failed to delete WMI vdev %d: %d\n", +@@ -6077,6 +6176,10 @@ ath11k_mac_update_vif_chan(struct ath11k if (WARN_ON(!arvif->is_up)) continue; @@ -742,7 +718,7 @@ Signed-off-by: Sriram R ret = ath11k_wmi_vdev_down(ar, arvif->vdev_id); if (ret) { ath11k_warn(ab, "failed to down vdev %d: %d\n", -@@ -5913,6 +6004,10 @@ ath11k_mac_update_vif_chan(struct ath11k +@@ -6119,6 +6222,10 @@ ath11k_mac_update_vif_chan(struct ath11k arvif->vdev_id, ret); continue; } @@ -753,7 +729,7 @@ Signed-off-by: Sriram R } /* Restart the internal monitor vdev on new channel */ -@@ -6919,6 +7014,8 @@ static void ath11k_mac_op_sta_statistics +@@ -7150,6 +7257,8 @@ static void ath11k_mac_op_sta_statistics /* TODO: Use real NF instead of default one. */ sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); @@ -762,16 +738,26 @@ Signed-off-by: Sriram R } #define ATH11K_WLAN_PRIO_MAX 0x63 -@@ -7015,6 +7112,7 @@ static const struct ieee80211_ops ath11k - .remove_interface = ath11k_mac_op_remove_interface, +@@ -7247,6 +7356,7 @@ static const struct ieee80211_ops ath11k + .update_vif_offload = ath11k_mac_op_update_vif_offload, .config = ath11k_mac_op_config, .bss_info_changed = ath11k_mac_op_bss_info_changed, + .nss_bss_info_changed = ath11k_mac_op_nss_bss_info_changed, .configure_filter = ath11k_mac_op_configure_filter, .hw_scan = ath11k_mac_op_hw_scan, .cancel_hw_scan = ath11k_mac_op_cancel_hw_scan, -@@ -7453,6 +7551,9 @@ static int __ath11k_mac_register(struct - ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL); +@@ -7645,7 +7755,8 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); + ieee80211_hw_set(ar->hw, SUPPORTS_REORDERING_BUFFER); + ieee80211_hw_set(ar->hw, SUPPORTS_AMSDU_IN_AMPDU); +- ieee80211_hw_set(ar->hw, USES_RSS); ++ if(!ab->nss.enabled) ++ ieee80211_hw_set(ar->hw, USES_RSS); + } + + ar->hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS; +@@ -7717,6 +7828,9 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, SUPPORT_FAST_XMIT); } + if (ab->nss.enabled) @@ -790,20 +776,7 @@ Signed-off-by: Sriram R struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, const u8 *addr) -@@ -115,7 +116,7 @@ exit: - } - - void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, -- u8 *mac_addr, u16 ast_hash) -+ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id) - { - struct ath11k_peer *peer; - -@@ -129,9 +130,12 @@ void ath11k_peer_map_event(struct ath11k - peer->vdev_id = vdev_id; - peer->peer_id = peer_id; - peer->ast_hash = ast_hash; -+ peer->hw_peer_id = hw_peer_id; +@@ -150,6 +151,8 @@ void ath11k_peer_map_event(struct ath11k ether_addr_copy(peer->addr, mac_addr); list_add(&peer->list, &ab->peers); wake_up(&ab->peer_mapping_wq); @@ -812,7 +785,7 @@ Signed-off-by: Sriram R } ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "htt peer map vdev %d peer %pM id %d\n", -@@ -221,6 +225,8 @@ int ath11k_peer_delete(struct ath11k *ar +@@ -239,6 +242,8 @@ int ath11k_peer_delete(struct ath11k *ar reinit_completion(&ar->peer_delete_done); @@ -823,29 +796,19 @@ Signed-off-by: Sriram R ath11k_warn(ar->ab, --- a/drivers/net/wireless/ath/ath11k/peer.h +++ b/drivers/net/wireless/ath/ath11k/peer.h -@@ -26,6 +26,10 @@ struct ath11k_peer { - int peer_id; +@@ -27,6 +27,9 @@ struct ath11k_peer { u16 ast_hash; u8 pdev_idx; -+ u16 hw_peer_id; + u16 hw_peer_id; +#ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct ath11k_nss_peer nss; +#endif /* protected by ab->data_lock */ struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1]; -@@ -46,7 +50,7 @@ struct ath11k_peer { - - void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); - void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, -- u8 *mac_addr, u16 ast_hash); -+ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); - struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, - const u8 *addr); - struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -591,6 +591,11 @@ static int ath11k_pci_ext_irq_config(str +@@ -749,6 +749,11 @@ static int ath11k_pci_ext_irq_config(str netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi, ath11k_pci_ext_grp_napi_poll, NAPI_POLL_WEIGHT); @@ -857,7 +820,7 @@ Signed-off-by: Sriram R if (ab->hw_params.ring_mask->tx[i] || ab->hw_params.ring_mask->rx[i] || ab->hw_params.ring_mask->rx_err[i] || -@@ -814,6 +819,7 @@ static int ath11k_pci_claim(struct ath11 +@@ -974,6 +979,7 @@ static int ath11k_pci_claim(struct ath11 goto clear_master; } @@ -865,9 +828,9 @@ Signed-off-by: Sriram R ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem); return 0; ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1019,6 +1019,7 @@ static ssize_t ath11k_write_extd_rx_stat +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -922,6 +922,7 @@ static ssize_t ath11k_write_extd_rx_stat HTT_RX_FP_DATA_FILTER_FLASG3; } else { tlv_filter = ath11k_mac_mon_status_filter_default; @@ -875,9 +838,96 @@ Signed-off-by: Sriram R } ar->debug.rx_filter = tlv_filter.rx_filter; +@@ -1837,6 +1838,75 @@ static const struct file_operations fops + .open = simple_open + }; + ++static ssize_t ath11k_write_nss_stats(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ struct ath11k_base *ab = ar->ab; ++ u32 nss_stats; ++ int ret; ++ ++ if (!ab->nss.enabled) { ++ ath11k_warn(ab, "nss offload not enabled\n"); ++ return -EINVAL; ++ } ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &nss_stats)) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ if (nss_stats == ab->nss.stats_enabled) { ++ ret = count; ++ goto out; ++ } ++ ++ if (nss_stats > 0) { ++ ab->nss.stats_enabled = 1; ++ ath11k_nss_peer_stats_enable(ar); ++ } else { ++ ab->nss.stats_enabled = 0; ++ ath11k_nss_peer_stats_disable(ar); ++ } ++ ++ ret = count; ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_read_nss_stats(struct file *file, ++ char __user *ubuf, ++ size_t count, loff_t *ppos) ++ ++{ ++ char buf[32] = {0}; ++ struct ath11k *ar = file->private_data; ++ struct ath11k_base *ab = ar->ab; ++ int len = 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ len = scnprintf(buf, sizeof(buf) - len, "%08x\n", ++ ab->nss.stats_enabled); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(ubuf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_nss_stats = { ++ .read = ath11k_read_nss_stats, ++ .write = ath11k_write_nss_stats, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + static int ath11k_get_tpc_ctl_mode(struct wmi_tpc_stats_event *tpc_stats, + u32 pream_idx, int *mode) + { +@@ -2483,6 +2553,10 @@ int ath11k_debugfs_register(struct ath11 + debugfs_create_file("tpc_stats_type", 0600, ar->debug.debugfs_pdev, + ar, &fops_tpc_stats_type); + ++ if (ab->nss.enabled) ++ debugfs_create_file("nss_peer_stats_config", 0644, ++ ar->debug.debugfs_pdev, ar, &fops_nss_stats); ++ + return 0; + } + --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -9,7 +9,7 @@ +@@ -10,7 +10,7 @@ #include "hw.h" #include "peer.h" @@ -886,6 +936,15 @@ Signed-off-by: Sriram R ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb) { struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); +@@ -935,7 +935,7 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req( + cmd->msg = FIELD_PREP(HTT_PPDU_STATS_CFG_MSG_TYPE, + HTT_H2T_MSG_TYPE_PPDU_STATS_CFG); + +- pdev_mask = 1 << (i + 1); ++ pdev_mask = 1 << (ar->pdev_idx + i); + cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_PDEV_ID, pdev_mask); + cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK, mask); + --- a/drivers/net/wireless/ath/ath11k/dp_tx.h +++ b/drivers/net/wireless/ath/ath11k/dp_tx.h @@ -36,5 +36,7 @@ int ath11k_dp_tx_htt_rx_filter_setup(str @@ -898,7 +957,7 @@ Signed-off-by: Sriram R #endif --- a/local-symbols +++ b/local-symbols -@@ -134,6 +134,7 @@ ATH10K_DFS_CERTIFIED= +@@ -133,6 +133,7 @@ ATH10K_DFS_CERTIFIED= ATH11K= ATH11K_AHB= ATH11K_PCI= diff --git a/feeds/wifi-ax/mac80211/patches/qca/199-ath11k-Fix-thermal-temperature-read.patch b/feeds/wifi-ax/mac80211/patches/qca/199-ath11k-Fix-thermal-temperature-read.patch index d5a19ae2b..0b57198a3 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/199-ath11k-Fix-thermal-temperature-read.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/199-ath11k-Fix-thermal-temperature-read.patch @@ -13,7 +13,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -5533,31 +5533,6 @@ int ath11k_wmi_pull_fw_stats(struct ath1 +@@ -5891,31 +5891,6 @@ int ath11k_wmi_pull_fw_stats(struct ath1 return 0; } @@ -45,7 +45,7 @@ Signed-off-by: Pradeep Kumar Chitrapu size_t ath11k_wmi_fw_stats_num_vdevs(struct list_head *head) { struct ath11k_fw_stats_vdev *i; -@@ -7031,23 +7006,37 @@ ath11k_wmi_pdev_temperature_event(struct +@@ -7388,23 +7363,37 @@ ath11k_wmi_pdev_temperature_event(struct struct sk_buff *skb) { struct ath11k *ar; @@ -89,4 +89,4 @@ Signed-off-by: Pradeep Kumar Chitrapu + kfree(tb); } - static int ath11k_tpc_get_reg_pwr(struct ath11k_base *ab, + static void ath11k_fils_discovery_event(struct ath11k_base *ab, diff --git a/feeds/wifi-ax/mac80211/patches/qca/199-mac80211-fix-xmit-callback-when-hwencap-enable-in-st.patch b/feeds/wifi-ax/mac80211/patches/qca/199-mac80211-fix-xmit-callback-when-hwencap-enable-in-st.patch index 0f84ebe1f..a59609fea 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/199-mac80211-fix-xmit-callback-when-hwencap-enable-in-st.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/199-mac80211-fix-xmit-callback-when-hwencap-enable-in-st.patch @@ -18,14 +18,14 @@ Signed-off-by: P Praneesh --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -5419,7 +5419,13 @@ int ieee80211_tx_control_port(struct wip +@@ -5485,7 +5485,13 @@ int ieee80211_tx_control_port(struct wip mutex_lock(&local->mtx); local_bh_disable(); - __ieee80211_subif_start_xmit(skb, skb->dev, flags, ctrl_flags, cookie); + + /* added hardware encap check for ethernet mode */ -+ if (sdata->hw_80211_encap) ++ if (sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) + ieee80211_subif_start_xmit_8023(skb, skb->dev); + else + __ieee80211_subif_start_xmit(skb, skb->dev, flags, ctrl_flags, cookie); diff --git a/feeds/wifi-ax/mac80211/patches/qca/200-ath11k-Add-support-spectral-scan-for-QCN9000.patch b/feeds/wifi-ax/mac80211/patches/qca/200-ath11k-Add-support-spectral-scan-for-QCN9000.patch index dd7230c4c..b8f5d470a 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/200-ath11k-Add-support-spectral-scan-for-QCN9000.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/200-ath11k-Add-support-spectral-scan-for-QCN9000.patch @@ -17,37 +17,38 @@ Signed-off-by: Karthikeyan Periyasamy --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -65,6 +65,9 @@ static const struct ath11k_hw_params ath - .vdev_start_delay = false, +@@ -71,6 +71,9 @@ static const struct ath11k_hw_params ath .htt_peer_map_v2 = true, .tcl_0_only = false, + .spectral_fft_sz = 2, + .spectral_fft_pad_sz = 2, + .spectral_max_fft_bins = 512, + .spectral_fft_hdr_len = 16, - }, - { - .hw_rev = ATH11K_HW_IPQ6018, -@@ -99,6 +102,8 @@ static const struct ath11k_hw_params ath - .vdev_start_delay = false, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | +@@ -113,6 +116,8 @@ static const struct ath11k_hw_params ath .htt_peer_map_v2 = true, .tcl_0_only = false, + .spectral_fft_sz = 4, + .spectral_max_fft_bins = 512, + .spectral_fft_hdr_len = 16, - }, - { - .name = "qca6390 hw2.0", -@@ -129,6 +134,7 @@ static const struct ath11k_hw_params ath - .vdev_start_delay = true, - .htt_peer_map_v2 = false, - .tcl_0_only = true, -+ .spectral_fft_sz = 2, - }, - { - .name = "qcn9000 hw1.0", -@@ -161,6 +167,9 @@ static const struct ath11k_hw_params ath + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | +@@ -190,6 +195,8 @@ static const struct ath11k_hw_params ath .vdev_start_delay = false, .htt_peer_map_v2 = true, .tcl_0_only = false, ++ .spectral_fft_sz = 2, ++ + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_MESH_POINT), +@@ -199,6 +206,9 @@ static const struct ath11k_hw_params ath + .cold_boot_calib = true, + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), + .spectral_max_fft_bins = 1024, + .spectral_summary_pad_sz = 16, + .spectral_fft_hdr_len = 24, @@ -56,9 +57,9 @@ Signed-off-by: Karthikeyan Periyasamy --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -134,6 +134,10 @@ struct ath11k_hw_params { - size_t cal_size; - } fw; +@@ -157,6 +157,10 @@ struct ath11k_hw_params { + bool htt_peer_map_v2; + bool tcl_0_only; u8 spectral_fft_sz; + u8 spectral_fft_pad_sz; + u8 spectral_summary_pad_sz; @@ -66,7 +67,7 @@ Signed-off-by: Karthikeyan Periyasamy + u32 spectral_max_fft_bins; bool credit_flow; - const struct ath11k_hw_ops *hw_ops; + u16 interface_modes; --- a/drivers/net/wireless/ath/ath11k/spectral.c +++ b/drivers/net/wireless/ath/ath11k/spectral.c @@ -11,11 +11,9 @@ @@ -82,9 +83,9 @@ Signed-off-by: Karthikeyan Periyasamy +#define ATH11K_SPECTRAL_ATH11K_MIN_IB_BINS 16 +#define ATH11K_SPECTRAL_ATH11K_MAX_IB_BINS (ab->hw_params.spectral_max_fft_bins >> 1) - #define ATH11K_SPECTRAL_SAMPLE_FFT_BIN_MASK 0xFF + #define ATH11K_SPECTRAL_SCAN_COUNT_MAX 4095 -@@ -447,7 +445,7 @@ static ssize_t ath11k_write_file_spectra +@@ -445,7 +443,7 @@ static ssize_t ath11k_write_file_spectra return -EINVAL; if (val < ATH11K_SPECTRAL_ATH11K_MIN_BINS || @@ -93,7 +94,7 @@ Signed-off-by: Karthikeyan Periyasamy return -EINVAL; if (!is_power_of_2(val)) -@@ -595,7 +593,7 @@ int ath11k_spectral_process_fft(struct a +@@ -581,7 +579,7 @@ int ath11k_spectral_process_fft(struct a struct spectral_tlv *tlv; int tlv_len, bin_len, num_bins; u16 length, freq; @@ -102,7 +103,7 @@ Signed-off-by: Karthikeyan Periyasamy int ret; lockdep_assert_held(&ar->spectral.lock); -@@ -610,7 +608,7 @@ int ath11k_spectral_process_fft(struct a +@@ -596,7 +594,7 @@ int ath11k_spectral_process_fft(struct a tlv_len = FIELD_GET(SPECTRAL_TLV_HDR_LEN, __le32_to_cpu(tlv->header)); /* convert Dword into bytes */ tlv_len *= ATH11K_SPECTRAL_DWORD_SIZE; @@ -111,7 +112,7 @@ Signed-off-by: Karthikeyan Periyasamy if (data_len < (bin_len + sizeof(*fft_report))) { ath11k_warn(ab, "mismatch in expected bin len %d and data len %d\n", -@@ -618,7 +616,9 @@ int ath11k_spectral_process_fft(struct a +@@ -604,7 +602,9 @@ int ath11k_spectral_process_fft(struct a return -EINVAL; } @@ -122,7 +123,7 @@ Signed-off-by: Karthikeyan Periyasamy /* Only In-band bins are useful to user for visualize */ num_bins >>= 1; -@@ -765,7 +765,8 @@ static int ath11k_spectral_process_data( +@@ -738,7 +738,8 @@ static int ath11k_spectral_process_data( * is 4 DWORD size (16 bytes). * Need to remove this workaround once HW bug fixed */ @@ -132,7 +133,7 @@ Signed-off-by: Karthikeyan Periyasamy if (tlv_len < (sizeof(*summary) - sizeof(*tlv))) { ath11k_warn(ab, "failed to parse spectral summary at bytes %d tlv_len:%d\n", -@@ -922,6 +923,7 @@ void ath11k_spectral_deinit(struct ath11 +@@ -897,6 +898,7 @@ void ath11k_spectral_deinit(struct ath11 static inline int ath11k_spectral_debug_register(struct ath11k *ar) { @@ -140,7 +141,7 @@ Signed-off-by: Karthikeyan Periyasamy int ret; ar->spectral.rfs_scan = relay_open("spectral_scan", -@@ -930,7 +932,7 @@ static inline int ath11k_spectral_debug_ +@@ -905,7 +907,7 @@ static inline int ath11k_spectral_debug_ ATH11K_SPECTRAL_NUM_SUB_BUF, &rfs_scan_cb, NULL); if (!ar->spectral.rfs_scan) { @@ -149,7 +150,7 @@ Signed-off-by: Karthikeyan Periyasamy ar->pdev_idx); return -EINVAL; } -@@ -940,7 +942,7 @@ static inline int ath11k_spectral_debug_ +@@ -915,7 +917,7 @@ static inline int ath11k_spectral_debug_ ar->debug.debugfs_pdev, ar, &fops_scan_ctl); if (!ar->spectral.scan_ctl) { @@ -158,7 +159,7 @@ Signed-off-by: Karthikeyan Periyasamy ar->pdev_idx); ret = -EINVAL; goto debug_unregister; -@@ -951,7 +953,7 @@ static inline int ath11k_spectral_debug_ +@@ -926,7 +928,7 @@ static inline int ath11k_spectral_debug_ ar->debug.debugfs_pdev, ar, &fops_scan_count); if (!ar->spectral.scan_count) { @@ -167,7 +168,7 @@ Signed-off-by: Karthikeyan Periyasamy ar->pdev_idx); ret = -EINVAL; goto debug_unregister; -@@ -962,7 +964,7 @@ static inline int ath11k_spectral_debug_ +@@ -937,7 +939,7 @@ static inline int ath11k_spectral_debug_ ar->debug.debugfs_pdev, ar, &fops_scan_bins); if (!ar->spectral.scan_bins) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-check-valid-fixed-rate-settings.patch b/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-check-valid-fixed-rate-settings.patch index 3762ebea5..482102aba 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-check-valid-fixed-rate-settings.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-check-valid-fixed-rate-settings.patch @@ -17,7 +17,7 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1082,8 +1082,10 @@ static int ath11k_mac_setup_bcn_tmpl(str +@@ -1062,8 +1062,10 @@ static int ath11k_mac_setup_bcn_tmpl(str struct ieee80211_mutable_offsets offs = {}; struct sk_buff *bcn; struct ieee80211_mgmt *mgmt; @@ -28,7 +28,7 @@ Signed-off-by: Lavanya Suresh if (arvif->vdev_type != WMI_VDEV_TYPE_AP) return 0; -@@ -1100,6 +1102,12 @@ static int ath11k_mac_setup_bcn_tmpl(str +@@ -1080,6 +1082,12 @@ static int ath11k_mac_setup_bcn_tmpl(str if (cfg80211_find_ie(WLAN_EID_RSN, ies, (skb_tail_pointer(bcn) - ies))) arvif->rsnie_present = true; @@ -41,7 +41,7 @@ Signed-off-by: Lavanya Suresh if (cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSOFT_WPA, ies, (skb_tail_pointer(bcn) - ies))) -@@ -6727,6 +6735,53 @@ exit: +@@ -6977,6 +6985,53 @@ exit: return ret; } @@ -95,7 +95,7 @@ Signed-off-by: Lavanya Suresh static int ath11k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -@@ -6797,6 +6852,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie +@@ -7047,6 +7102,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie } else { rate = WMI_FIXED_RATE_NONE; @@ -107,7 +107,7 @@ Signed-off-by: Lavanya Suresh "could not update fixed rate settings to all peers due to mcs/nss incompaitiblity\n"); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -247,6 +247,7 @@ struct ath11k_vif { +@@ -257,6 +257,7 @@ struct ath11k_vif { int txpower; bool rsnie_present; bool wpaie_present; diff --git a/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-ipq5018-support.patch b/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-ipq5018-support.patch index 52377324e..f44e0a62b 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-ipq5018-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/201-ath11k-ipq5018-support.patch @@ -19,7 +19,7 @@ Signed-off-by: Sriram R +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -24,6 +24,9 @@ static const struct of_device_id ath11k_ { .compatible = "qcom,ipq6018-wifi", - .data = (void *)ATH11K_HW_IPQ6018, + .data = (void *)ATH11K_HW_IPQ6018_HW10, }, + { .compatible = "qcom,ipq5018-wifi", + .data = (void *)ATH11K_HW_IPQ5018, @@ -27,7 +27,7 @@ Signed-off-by: Sriram R { } }; -@@ -138,12 +141,22 @@ enum ext_irq_num { +@@ -137,12 +140,22 @@ enum ext_irq_num { static inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset) { @@ -52,7 +52,7 @@ Signed-off-by: Sriram R } static void ath11k_ahb_kill_tasklets(struct ath11k_base *ab) -@@ -209,30 +222,52 @@ static void ath11k_ahb_clearbit32(struct +@@ -208,30 +221,52 @@ static void ath11k_ahb_clearbit32(struct static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id) { const struct ce_pipe_config *ce_config; @@ -111,7 +111,7 @@ Signed-off-by: Sriram R } } -@@ -664,6 +699,21 @@ static int ath11k_ahb_probe(struct platf +@@ -684,6 +719,21 @@ static int ath11k_ahb_probe(struct platf ab->enable_cold_boot_cal = enable_cold_boot_cal; platform_set_drvdata(pdev, ab); @@ -133,8 +133,8 @@ Signed-off-by: Sriram R ret = ath11k_core_pre_init(ab); if (ret) goto err_core_free; -@@ -735,6 +785,10 @@ static int ath11k_ahb_remove(struct plat - +@@ -770,6 +820,10 @@ qmi_fail: + ath11k_ahb_free_irq(ab); ath11k_hal_srng_deinit(ab); ath11k_ce_free_pipes(ab); + @@ -146,9 +146,9 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -42,6 +42,10 @@ - #define ATH11K_RX_RATE_TABLE_NUM 320 - #define ATH11K_RX_RATE_TABLE_11AX_NUM 576 +@@ -46,6 +46,10 @@ extern unsigned int ath11k_frame_mode; + + #define ATH11K_MON_TIMER_INTERVAL 10 +/* Shift value to set the dest rings hash map to the dest control register */ +#define HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT 8 @@ -157,15 +157,15 @@ Signed-off-by: Sriram R enum ath11k_supported_bw { ATH11K_BW_20 = 0, ATH11K_BW_40 = 1, -@@ -110,6 +114,7 @@ enum ath11k_hw_rev { - ATH11K_HW_IPQ6018, +@@ -117,6 +121,7 @@ enum ath11k_hw_rev { ATH11K_HW_QCA6390_HW20, - ATH11K_HW_QCN9000, + ATH11K_HW_IPQ6018_HW10, + ATH11K_HW_QCN9074_HW10, + ATH11K_HW_IPQ5018, }; enum ath11k_firmware_mode { -@@ -765,6 +770,7 @@ struct ath11k_base { +@@ -775,6 +780,7 @@ struct ath11k_base { struct ath11k_soc_nss nss; void __iomem *mem; @@ -173,52 +173,60 @@ Signed-off-by: Sriram R dma_addr_t mem_pa; unsigned long mem_len; -@@ -845,6 +851,9 @@ struct ath11k_base { - u32 sw_pdev_id_map[MAX_RADIOS]; - u32 hw_pdev_id_map[MAX_RADIOS]; +@@ -859,6 +865,8 @@ struct ath11k_base { + struct completion htc_suspend; + bool fw_recovery_support; + bool ce_remap; + u32 ce_remap_base_addr; -+ + /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); - }; -@@ -981,6 +990,9 @@ extern const struct ce_pipe_config ath11 - extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9000[]; - extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; +@@ -1004,6 +1012,9 @@ extern const struct service_to_pipe ath1 + extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[]; + extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[]; +extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[]; +extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[]; + - void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); - void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, - u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); + int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab); + int ath11k_core_pre_init(struct ath11k_base *ab); + int ath11k_core_init(struct ath11k_base *ath11k); --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -170,6 +170,7 @@ struct ath11k_hw_params { +@@ -156,6 +156,7 @@ struct ath11k_hw_params { + bool vdev_start_delay; + bool htt_peer_map_v2; bool tcl_0_only; ++ u8 num_dscp_tid_map_tbl; + u8 spectral_fft_sz; + u8 spectral_fft_pad_sz; + u8 spectral_summary_pad_sz; +@@ -171,6 +172,7 @@ struct ath11k_hw_params { + bool supports_suspend; u32 hal_desc_sz; u32 m3_addr; + u8 reo_dest_ring_map_shift; }; struct ath11k_hw_ops { -@@ -210,12 +211,14 @@ struct ath11k_hw_ops { - void (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len); - struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc); - u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc); +@@ -211,12 +213,15 @@ struct ath11k_hw_ops { + bool (*rx_desc_get_da_mcbc)(struct hal_rx_desc *desc); + bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc); + u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); ++ void (*set_rx_fragmentation_dst_ring)(struct ath11k_base *ab); + u32 (*get_reo_dest_remap_config)(void); }; extern const struct ath11k_hw_ops ipq8074_ops; extern const struct ath11k_hw_ops ipq6018_ops; extern const struct ath11k_hw_ops qca6390_ops; - extern const struct ath11k_hw_ops qcn9000_ops; + extern const struct ath11k_hw_ops qcn9074_ops; +extern const struct ath11k_hw_ops ipq5018_ops; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; -@@ -306,6 +309,12 @@ struct ath11k_hw_regs { +@@ -307,6 +312,12 @@ struct ath11k_hw_regs { u32 hal_reo_tcl_ring_base_lsb; u32 hal_reo_tcl_ring_hp; @@ -231,40 +239,72 @@ Signed-off-by: Sriram R u32 hal_reo_status_ring_base_lsb; u32 hal_reo_status_hp; -@@ -326,5 +335,6 @@ struct ath11k_hw_regs { +@@ -330,5 +341,6 @@ struct ath11k_hw_regs { extern const struct ath11k_hw_regs ipq8074_regs; extern const struct ath11k_hw_regs qca6390_regs; - extern const struct ath11k_hw_regs qcn9000_regs; + extern const struct ath11k_hw_regs qcn9074_regs; +extern const struct ath11k_hw_regs ipq5018_regs; #endif --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -68,6 +68,7 @@ static const struct ath11k_hw_params ath +@@ -74,6 +74,7 @@ static const struct ath11k_hw_params ath .spectral_fft_pad_sz = 2, .spectral_max_fft_bins = 512, .spectral_fft_hdr_len = 16, ++ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | +@@ -84,6 +85,7 @@ static const struct ath11k_hw_params ath + .cold_boot_calib = true, + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, }, { - .hw_rev = ATH11K_HW_IPQ6018, -@@ -104,6 +105,7 @@ static const struct ath11k_hw_params ath - .tcl_0_only = false, + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -118,6 +120,7 @@ static const struct ath11k_hw_params ath + .spectral_fft_sz = 4, .spectral_max_fft_bins = 512, .spectral_fft_hdr_len = 16, ++ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | +@@ -128,6 +131,7 @@ static const struct ath11k_hw_params ath + .cold_boot_calib = true, + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, }, { .name = "qca6390 hw2.0", -@@ -135,6 +137,7 @@ static const struct ath11k_hw_params ath +@@ -158,6 +162,7 @@ static const struct ath11k_hw_params ath .htt_peer_map_v2 = false, .tcl_0_only = true, - .spectral_fft_sz = 2, + .spectral_fft_sz = 0, ++ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP), +@@ -167,6 +172,7 @@ static const struct ath11k_hw_params ath + .cold_boot_calib = false, + .supports_suspend = true, + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, }, { - .name = "qcn9000 hw1.0", -@@ -170,6 +173,45 @@ static const struct ath11k_hw_params ath + .name = "qcn9074 hw1.0", +@@ -196,6 +202,7 @@ static const struct ath11k_hw_params ath + .htt_peer_map_v2 = true, + .tcl_0_only = false, + .spectral_fft_sz = 2, ++ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | +@@ -209,6 +216,53 @@ static const struct ath11k_hw_params ath .spectral_max_fft_bins = 1024, .spectral_summary_pad_sz = 16, .spectral_fft_hdr_len = 24, @@ -280,8 +320,8 @@ Signed-off-by: Sriram R + }, + .max_radios = 1, + .bdf_addr = 0x4BA00000, -+ /* hal_desc_sz is similar to qcn9000 */ -+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9000), ++ /* hal_desc_sz is similar to qcn9074 */ ++ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), + .hw_ops = &ipq5018_ops, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, + .ring_mask = &ath11k_hw_ring_mask_ipq8074, @@ -289,7 +329,15 @@ Signed-off-by: Sriram R + .m3_addr = ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS, + .spectral_fft_sz = 2, + .credit_flow = false, -+ .host_ce_config = ath11k_host_ce_config_qcn9000, ++ .num_dscp_tid_map_tbl = HAL_IPQ5018_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, ++ .interface_modes = BIT(NL80211_IFTYPE_STATION) | ++ BIT(NL80211_IFTYPE_AP) | ++ BIT(NL80211_IFTYPE_MESH_POINT), ++ .supports_monitor = true, ++ .supports_shadow_regs = false, ++ .idle_ps = false, ++ .supports_suspend = false, ++ .host_ce_config = ath11k_host_ce_config_qcn9074, + .ce_count = 6, + .target_ce_config = ath11k_target_ce_config_wlan_ipq5018, + .target_ce_count = 9, @@ -312,15 +360,72 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/hw.c +++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -508,6 +508,47 @@ static u8 *ath11k_hw_qcn9000_rx_desc_get - return &desc->u.qcn9000.msdu_payload[0]; +@@ -10,6 +10,7 @@ + #include "hw.h" + #include "core.h" + #include "ce.h" ++#include "hif.h" + + /* Map from pdev index to hw mac index */ + static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx) +@@ -324,6 +325,25 @@ struct rx_attention *ath11k_hw_ipq8074_r + return &desc->u.ipq8074.attention; } ++static void ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring(struct ath11k_base *ab) ++{ ++ u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1; ++ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG; ++ u32 val; ++ ++ if (ab->nss.enabled) ++ frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT; ++ ++ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE); ++ ++ val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING; ++ val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING, ++ frag_dst_ring) | ++ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) | ++ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1); ++ ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val); ++} ++ + static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) + { + return &desc->u.ipq8074.msdu_payload[0]; +@@ -507,6 +527,70 @@ static u8* ath11k_hw_ipq8074_rx_desc_mpd + return desc->u.ipq8074.mpdu_start.addr2; + } + ++static void ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring(struct ath11k_base *ab) ++{ ++ u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1; ++ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG; ++ u32 val; ++ ++ if (ab->nss.enabled) ++ frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT; ++ ++ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE); ++ ++ val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING; ++ val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) | ++ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1); ++ ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val); ++ ++ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_R0_MISC_CTL); ++ val &= ~HAL_REO1_MISC_CTL_FRAGMENT_DEST_RING; ++ val |= FIELD_PREP(HAL_REO1_MISC_CTL_FRAGMENT_DEST_RING, ++ frag_dst_ring); ++ ath11k_hif_write32(ab, reo_base + HAL_REO1_R0_MISC_CTL, val); ++} ++ +static u32 ath11k_get_reo_dest_remap_config_default(void) +{ + u32 ring_hash_map; + -+ /* For IPQ8074, IPQ6018, QCN9000, the first 8 bits are ++ /* For IPQ8074, IPQ6018, QCN9074, the first 8 bits are + * are reserved/not used and the remainig 24 bits are + * mapped for 8 hash values with 3 bits representing the + * destination ring @@ -359,39 +464,43 @@ Signed-off-by: Sriram R + const struct ath11k_hw_ops ipq8074_ops = { .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, - .wmi_init_config = ath11k_init_wmi_config_qca6390, -@@ -542,6 +583,7 @@ const struct ath11k_hw_ops ipq8074_ops = - .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, - .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, + .wmi_init_config = ath11k_init_wmi_config_ipq8074, +@@ -542,6 +626,8 @@ const struct ath11k_hw_ops ipq8074_ops = + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, }; const struct ath11k_hw_ops ipq6018_ops = { -@@ -579,6 +621,7 @@ const struct ath11k_hw_ops ipq6018_ops = - .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, - .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, +@@ -579,6 +665,8 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, }; const struct ath11k_hw_ops qca6390_ops = { -@@ -618,6 +661,7 @@ const struct ath11k_hw_ops qca6390_ops = +@@ -613,6 +701,8 @@ const struct ath11k_hw_ops qca6390_ops = .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, ++ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, + //TODO + /* .rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid, +@@ -652,8 +742,50 @@ const struct ath11k_hw_ops qcn9074_ops = + .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len, + .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention, + .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, }; - const struct ath11k_hw_ops qcn9000_ops = { -@@ -655,6 +699,46 @@ const struct ath11k_hw_ops qcn9000_ops = - .rx_desc_set_msdu_len = ath11k_hw_qcn9000_rx_desc_set_msdu_len, - .rx_desc_get_attention = ath11k_hw_qcn9000_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_qcn9000_rx_desc_get_msdu_payload, -+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, -+}; -+ -+/* IPQ5018 hw ops is similar to QCN9000 except for the dest ring remap */ ++/* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */ +const struct ath11k_hw_ops ipq5018_ops = { + .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id, + .wmi_init_config = ath11k_init_wmi_config_ipq8074, @@ -400,39 +509,42 @@ Signed-off-by: Sriram R + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, -+ .tx_mesh_enable = ath11k_hw_qcn9000_tx_mesh_enable, -+ .rx_desc_get_first_msdu = ath11k_hw_qcn9000_rx_desc_get_first_msdu, -+ .rx_desc_get_last_msdu = ath11k_hw_qcn9000_rx_desc_get_last_msdu, -+ .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9000_rx_desc_get_l3_pad_bytes, -+ .rx_desc_get_hdr_status = ath11k_hw_qcn9000_rx_desc_get_hdr_status, -+ .rx_desc_encrypt_valid = ath11k_hw_qcn9000_rx_desc_encrypt_valid, -+ .rx_desc_get_encrypt_type = ath11k_hw_qcn9000_rx_desc_get_encrypt_type, -+ .rx_desc_get_decap_type = ath11k_hw_qcn9000_rx_desc_get_decap_type, -+ .rx_desc_get_mesh_ctl = ath11k_hw_qcn9000_rx_desc_get_mesh_ctl, -+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9000_rx_desc_get_mpdu_seq_ctl_vld, -+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9000_rx_desc_get_mpdu_fc_valid, -+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9000_rx_desc_get_mpdu_start_seq_no, -+ .rx_desc_get_msdu_len = ath11k_hw_qcn9000_rx_desc_get_msdu_len, -+ .rx_desc_get_msdu_sgi = ath11k_hw_qcn9000_rx_desc_get_msdu_sgi, -+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9000_rx_desc_get_msdu_rate_mcs, -+ .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9000_rx_desc_get_msdu_rx_bw, -+ .rx_desc_get_msdu_freq = ath11k_hw_qcn9000_rx_desc_get_msdu_freq, -+ .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9000_rx_desc_get_msdu_pkt_type, -+ .rx_desc_get_msdu_nss = ath11k_hw_qcn9000_rx_desc_get_msdu_nss, -+ .rx_desc_get_mpdu_tid = ath11k_hw_qcn9000_rx_desc_get_mpdu_tid, -+ .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9000_rx_desc_get_mpdu_peer_id, -+ .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9000_rx_desc_copy_attn_end, -+ .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9000_rx_desc_get_mpdu_start_tag, -+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9000_rx_desc_get_mpdu_ppdu_id, -+ .rx_desc_set_msdu_len = ath11k_hw_qcn9000_rx_desc_set_msdu_len, -+ .rx_desc_get_attention = ath11k_hw_qcn9000_rx_desc_get_attention, -+ .rx_desc_get_msdu_payload = ath11k_hw_qcn9000_rx_desc_get_msdu_payload, ++ .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, ++ .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, ++ .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, ++ .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes, ++ .rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status, ++ .rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid, ++ .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, ++ .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, ++ .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, ++ .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, ++ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, ++ .rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len, ++ .rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi, ++ .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs, ++ .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw, ++ .rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq, ++ .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type, ++ .rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss, ++ .rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid, ++ .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id, ++ .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end, ++ .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag, ++ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id, ++ .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len, ++ .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention, ++ .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, - }; - ++ }; ++ #define ATH11K_TX_RING_MASK_0 0x1 -@@ -1473,6 +1557,197 @@ const struct service_to_pipe ath11k_targ - + #define ATH11K_TX_RING_MASK_1 0x2 + #define ATH11K_TX_RING_MASK_2 0x4 +@@ -1464,6 +1596,197 @@ const struct service_to_pipe ath11k_targ + }, }; +/* Target firmware's Copy Engine configuration for IPQ5018 */ @@ -626,10 +738,10 @@ Signed-off-by: Sriram R + { /* terminator entry */ } +}; + - const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9000 = { + const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074 = { .tx = { ATH11K_TX_RING_MASK_0, -@@ -1563,6 +1838,14 @@ const struct ath11k_hw_regs ipq8074_regs +@@ -1550,6 +1873,14 @@ const struct ath11k_hw_regs ipq8074_regs .hal_reo_tcl_ring_base_lsb = 0x000003fc, .hal_reo_tcl_ring_hp = 0x00003058, @@ -644,7 +756,7 @@ Signed-off-by: Sriram R /* REO status address */ .hal_reo_status_ring_base_lsb = 0x00000504, .hal_reo_status_hp = 0x00003070, -@@ -1630,6 +1913,14 @@ const struct ath11k_hw_regs qca6390_regs +@@ -1621,6 +1952,14 @@ const struct ath11k_hw_regs qca6390_regs .hal_reo_tcl_ring_base_lsb = 0x000003a4, .hal_reo_tcl_ring_hp = 0x00003050, @@ -659,7 +771,7 @@ Signed-off-by: Sriram R /* REO status address */ .hal_reo_status_ring_base_lsb = 0x000004ac, .hal_reo_status_hp = 0x00003068, -@@ -1697,6 +1988,14 @@ const struct ath11k_hw_regs qcn9000_regs +@@ -1692,6 +2031,14 @@ const struct ath11k_hw_regs qcn9074_regs .hal_reo_tcl_ring_base_lsb = 0x000003fc, .hal_reo_tcl_ring_hp = 0x00003058, @@ -674,7 +786,7 @@ Signed-off-by: Sriram R /* REO status address */ .hal_reo_status_ring_base_lsb = 0x00000504, .hal_reo_status_hp = 0x00003070, -@@ -1709,6 +2008,81 @@ const struct ath11k_hw_regs qcn9000_regs +@@ -1704,6 +2051,81 @@ const struct ath11k_hw_regs qcn9074_regs /* WBM Idle address */ .hal_wbm_idle_link_ring_base_lsb = 0x00000874, @@ -758,7 +870,7 @@ Signed-off-by: Sriram R /* SW2WBM release address */ --- a/drivers/net/wireless/ath/ath11k/dp.c +++ b/drivers/net/wireless/ath/ath11k/dp.c -@@ -438,14 +438,7 @@ static int ath11k_dp_srng_common_setup(s +@@ -460,14 +460,7 @@ static int ath11k_dp_srng_common_setup(s * three bits to map to a particular ring. The ring mapping will be * 0:TCL, 1:SW1, 2:SW2, 3:SW3, 4:SW4, 5:Release, 6:FW and 7:Not used. */ @@ -774,17 +886,43 @@ Signed-off-by: Sriram R ath11k_hal_reo_hw_setup(ab, ring_hash_map); +@@ -1093,7 +1086,7 @@ int ath11k_dp_alloc(struct ath11k_base * + } + } + +- for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++) ++ for (i = 0; i < ab->hw_params.num_dscp_tid_map_tbl; i++) + ath11k_hal_tx_set_dscp_tid_map(ab, i); + + /* Init any SOC level resource for DP */ --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -804,6 +804,7 @@ void ath11k_hal_reo_hw_setup(struct ath1 - u8 frag_dest_ring = HAL_SRNG_RING_ID_REO2SW1; +@@ -803,22 +803,10 @@ void ath11k_hal_reo_init_cmd_ring(struct + + void ath11k_hal_reo_hw_setup(struct ath11k_base *ab, u32 ring_hash_map) + { +- u8 frag_dest_ring = HAL_SRNG_RING_ID_REO2SW1; u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG; - u32 val; +- u32 val; +- +- if (ab->nss.enabled) +- frag_dest_ring = HAL_SRNG_REO_ALTERNATE_SELECT; +- +- val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE); +- +- val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING; +- val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING, +- frag_dest_ring) | +- FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) | +- FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1); +- ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val); + u8 reo_dest_hash_shift = ab->hw_params.reo_dest_ring_map_shift; - if (ab->nss.enabled) - frag_dest_ring = HAL_SRNG_REO_ALTERNATE_SELECT; -@@ -830,18 +831,18 @@ void ath11k_hal_reo_hw_setup(struct ath1 ++ ab->hw_params.hw_ops->set_rx_fragmentation_dst_ring(ab); + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab), + HAL_DEFAULT_REO_TIMEOUT_USEC); + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_1(ab), +@@ -832,18 +820,18 @@ void ath11k_hal_reo_hw_setup(struct ath1 if (ab->nss.enabled) return; @@ -882,25 +1020,25 @@ Signed-off-by: Sriram R memset(srng->ring_base_vaddr, 0, (srng->entry_size * srng->num_entries) << 2); -@@ -967,7 +983,7 @@ int ath11k_hal_srng_setup(struct ath11k_ - srng->flags |= HAL_SRNG_FLAGS_LMAC_RING; +@@ -968,7 +984,7 @@ int ath11k_hal_srng_setup(struct ath11k_ } else { - srng->u.src_ring.hp_addr = + if (!ab->hw_params.supports_shadow_regs) + srng->u.src_ring.hp_addr = - (u32 *)((unsigned long)ab->mem + reg_base); + (u32 *)((unsigned long)mem + reg_base); - } - } else { - /* During initialization loop count in all the descriptors -@@ -992,7 +1008,7 @@ int ath11k_hal_srng_setup(struct ath11k_ - srng->flags |= HAL_SRNG_FLAGS_LMAC_RING; + else + ath11k_dbg(ab, ATH11k_DBG_HAL, + "hal type %d ring_num %d reg_base 0x%x shadow 0x%lx\n", +@@ -1001,7 +1017,7 @@ int ath11k_hal_srng_setup(struct ath11k_ } else { - srng->u.dst_ring.tp_addr = + if (!ab->hw_params.supports_shadow_regs) + srng->u.dst_ring.tp_addr = - (u32 *)((unsigned long)ab->mem + reg_base + + (u32 *)((unsigned long)mem + reg_base + (HAL_REO1_RING_TP(ab) - HAL_REO1_RING_HP(ab))); - } - } -@@ -1032,12 +1048,12 @@ static int ath11k_hal_srng_create_config + else + ath11k_dbg(ab, ATH11k_DBG_HAL, +@@ -1155,12 +1171,12 @@ static int ath11k_hal_srng_create_config s->reg_start[1] = HAL_SEQ_WCSS_UMAC_REO_REG + HAL_REO_TCL_RING_HP(ab); s = &hal->srng_config[HAL_REO_REINJECT]; @@ -928,7 +1066,23 @@ Signed-off-by: Sriram R #define HAL_LINK_DESC_SIZE (32 << 2) #define HAL_LINK_DESC_ALIGN 128 #define HAL_NUM_MPDUS_PER_LINK_DESC 6 -@@ -171,16 +173,16 @@ struct ath11k_base; +@@ -27,6 +29,7 @@ struct ath11k_base; + #define HAL_WBM_IDLE_SCATTER_BUF_SIZE (HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX - \ + HAL_WBM_IDLE_SCATTER_NEXT_PTR_SIZE) + ++#define HAL_IPQ5018_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX 32 + #define HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX 48 + #define HAL_DSCP_TID_TBL_SIZE 24 + +@@ -120,6 +123,7 @@ struct ath11k_base; + #define HAL_REO1_DEST_RING_CTRL_IX_1 0x00000008 + #define HAL_REO1_DEST_RING_CTRL_IX_2 0x0000000c + #define HAL_REO1_DEST_RING_CTRL_IX_3 0x00000010 ++#define HAL_REO1_R0_MISC_CTL 0x000005d8 + #define HAL_REO1_RING_BASE_LSB(ab) ab->hw_params.regs->hal_reo1_ring_base_lsb + #define HAL_REO1_RING_BASE_MSB(ab) ab->hw_params.regs->hal_reo1_ring_base_msb + #define HAL_REO1_RING_ID(ab) ab->hw_params.regs->hal_reo1_ring_id +@@ -179,16 +183,16 @@ struct ath11k_base; #define HAL_REO_TCL_RING_HP(ab) ab->hw_params.regs->hal_reo_tcl_ring_hp /* REO CMD R0 address */ @@ -949,7 +1103,15 @@ Signed-off-by: Sriram R /* CE ring R0 address */ #define HAL_CE_DST_RING_BASE_LSB 0x00000000 -@@ -303,6 +305,10 @@ struct ath11k_base; +@@ -280,6 +284,7 @@ struct ath11k_base; + #define HAL_REO1_GEN_ENABLE_FRAG_DST_RING GENMASK(25, 23) + #define HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE BIT(2) + #define HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE BIT(3) ++#define HAL_REO1_MISC_CTL_FRAGMENT_DEST_RING GENMASK(19, 17) + + /* CE ring bit field mask and shift */ + #define HAL_CE_DST_R0_DEST_CTRL_MAX_LEN GENMASK(15, 0) +@@ -316,6 +321,10 @@ struct ath11k_base; #define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff #define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff @@ -960,7 +1122,7 @@ Signed-off-by: Sriram R /* Add any other errors here and return them in * ath11k_hal_rx_desc_get_err(). */ -@@ -501,6 +507,7 @@ enum hal_srng_dir { +@@ -514,6 +523,7 @@ enum hal_srng_dir { #define HAL_SRNG_FLAGS_LOW_THRESH_INTR_EN 0x00010000 #define HAL_SRNG_FLAGS_MSI_INTR 0x00020000 #define HAL_SRNG_FLAGS_LMAC_RING 0x80000000 @@ -970,7 +1132,7 @@ Signed-off-by: Sriram R #define HAL_SRNG_TLV_HDR_LEN GENMASK(25, 10) --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -30,6 +30,7 @@ +@@ -34,6 +34,7 @@ #define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin" #define ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS 0x51000000 #define ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS 0x50100000 diff --git a/feeds/wifi-ax/mac80211/patches/qca/202-mac80211-Fix-radiotap-channel-flags-for-6GHz.patch b/feeds/wifi-ax/mac80211/patches/qca/202-mac80211-Fix-radiotap-channel-flags-for-6GHz.patch deleted file mode 100644 index f967b3943..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/202-mac80211-Fix-radiotap-channel-flags-for-6GHz.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -451,7 +451,8 @@ ieee80211_add_rx_radiotap_header(struct - else if (status->bw == RATE_INFO_BW_5) - channel_flags |= IEEE80211_CHAN_QUARTER; - -- if (status->band == NL80211_BAND_5GHZ) -+ if (status->band == NL80211_BAND_5GHZ || -+ status->band == NL80211_BAND_6GHZ) - channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ; - else if (status->encoding != RX_ENC_LEGACY) - channel_flags |= IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ; diff --git a/feeds/wifi-ax/mac80211/patches/qca/203-mac80211-ath11k-fw-dynamic-muedca.patch b/feeds/wifi-ax/mac80211/patches/qca/203-mac80211-ath11k-fw-dynamic-muedca.patch index 20c3409b1..531790863 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/203-mac80211-ath11k-fw-dynamic-muedca.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/203-mac80211-ath11k-fw-dynamic-muedca.patch @@ -31,8 +31,8 @@ Signed-off-by: Muna Sinada --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -133,6 +133,9 @@ static const struct wmi_tlv_policy wmi_t - = { .min_len = sizeof(struct wmi_vdev_delete_resp_event) }, +@@ -137,6 +137,9 @@ static const struct wmi_tlv_policy wmi_t + = { .min_len = sizeof(struct wmi_twt_add_dialog_event) }, [WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM] = { .min_len = sizeof(struct wmi_tpc_stats_event_fixed_param) }, + [WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT] @@ -41,7 +41,7 @@ Signed-off-by: Muna Sinada }; -@@ -6192,17 +6195,6 @@ static void ath11k_vdev_start_resp_event +@@ -6549,17 +6552,6 @@ static void ath11k_vdev_start_resp_event vdev_start_resp.vdev_id); } @@ -59,7 +59,7 @@ Signed-off-by: Muna Sinada static void ath11k_vdev_stopped_event(struct ath11k_base *ab, struct sk_buff *skb) { struct ath11k *ar; -@@ -7508,6 +7500,86 @@ exit: +@@ -7980,6 +7972,86 @@ exit: kfree(tb); } @@ -124,7 +124,7 @@ Signed-off-by: Muna Sinada + (0xF & ev->ecwmin[3]); + params->ac_vo.mu_edca_timer = ev->muedca_expiration_time[3]; + -+ ieee80211_update_muedca_params(ar->hw, params); ++ ieee80211_update_muedca_params(ar->hw, params, GFP_ATOMIC); + + kfree(params); +exit: @@ -146,7 +146,7 @@ Signed-off-by: Muna Sinada static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) { struct wmi_cmd_hdr *cmd_hdr; -@@ -7621,6 +7693,9 @@ static void ath11k_wmi_tlv_op_rx(struct +@@ -8102,6 +8174,9 @@ static void ath11k_wmi_tlv_op_rx(struct case WMI_PDEV_GET_TPC_STATS_EVENTID: ath11k_process_tpc_stats(ab, skb); break; @@ -155,10 +155,10 @@ Signed-off-by: Muna Sinada + break; /* TODO: Add remaining events */ default: - ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -740,6 +740,7 @@ enum wmi_tlv_event_id { +@@ -745,6 +745,7 @@ enum wmi_tlv_event_id { WMI_READ_DATA_FROM_FLASH_EVENTID, WMI_REPORT_RX_AGGR_FAILURE_EVENTID, WMI_PKGID_EVENTID, @@ -166,15 +166,15 @@ Signed-off-by: Muna Sinada WMI_GPIO_INPUT_EVENTID = WMI_TLV_CMD(WMI_GRP_GPIO), WMI_UPLOADH_EVENTID, WMI_CAPTUREH_EVENTID, -@@ -1846,6 +1847,7 @@ enum wmi_tlv_tag { - /* TODO add all the missing cmds */ +@@ -1853,6 +1854,7 @@ enum wmi_tlv_tag { + WMI_TAG_NDP_EVENT, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, + WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT = 0x32a, - WMI_TAG_TPC_STATS_GET_CMD = 0x38B, - WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM, - WMI_TAG_TPC_STATS_CONFIG_EVENT, -@@ -4395,6 +4397,16 @@ struct wmi_pdev_temperature_event { + WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344, + WMI_TAG_PDEV_SRG_BSS_COLOR_BITMAP_CMD = 0x37b, + WMI_TAG_PDEV_SRG_PARTIAL_BSSID_BITMAP_CMD, +@@ -4418,6 +4420,16 @@ struct wmi_pdev_temperature_event { u32 pdev_id; } __packed; @@ -193,7 +193,7 @@ Signed-off-by: Muna Sinada #define WMI_RX_STATUS_ERR_DECRYPT 0x08 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -7925,4 +7925,15 @@ void cfg80211_update_owe_info_event(stru +@@ -8196,4 +8196,15 @@ void cfg80211_update_owe_info_event(stru */ void cfg80211_bss_flush(struct wiphy *wiphy); @@ -211,10 +211,10 @@ Signed-off-by: Muna Sinada #endif /* __NET_CFG80211_H */ --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -6627,4 +6627,17 @@ u32 ieee80211_calc_tx_airtime(struct iee - */ - bool ieee80211_set_hw_80211_encap(struct ieee80211_vif *vif, bool enable); - +@@ -6804,4 +6804,18 @@ struct sk_buff *ieee80211_get_fils_disco + struct sk_buff * + ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, + struct ieee80211_vif *vif); +/** + * ieee80211_update_muedca_params - update MU-EDCA parameters. + * @@ -223,17 +223,18 @@ Signed-off-by: Muna Sinada + * + * @hw: pointer as obtained from ieee80211_alloc_hw() + * @params: updated MU-EDCA paramters ++ * @gfp: allocation flags + */ +void ieee80211_update_muedca_params(struct ieee80211_hw *hw, + struct ieee80211_mu_edca_param_set -+ *params); ++ *params, gfp_t gfp); + #endif /* MAC80211_H */ --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -1179,6 +1179,10 @@ - * includes the contents of the frame. %NL80211_ATTR_ACK flag is included - * if the recipient acknowledged the frame. +@@ -1182,6 +1182,10 @@ + * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to + * specify the wiphy index to be applied to. * + * @NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: Updated MU-EDCA parameters from driver. + * This event is used to update dynamic MU-EDCA parameters in Beacon frame, @@ -242,18 +243,18 @@ Signed-off-by: Muna Sinada * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1409,6 +1413,8 @@ enum nl80211_commands { +@@ -1414,6 +1418,8 @@ enum nl80211_commands { - NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + NL80211_CMD_SET_SAR_SPECS, + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -2515,6 +2521,9 @@ enum nl80211_commands { - * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from - * association request when used with NL80211_CMD_NEW_STATION). +@@ -2557,6 +2563,9 @@ enum nl80211_commands { + * disassoc events to indicate that an immediate reconnect to the AP + * is desired. * + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + * %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. @@ -261,9 +262,9 @@ Signed-off-by: Muna Sinada * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2997,6 +3006,7 @@ enum nl80211_attrs { +@@ -3054,6 +3063,7 @@ enum nl80211_attrs { - NL80211_ATTR_HE_6GHZ_CAPABILITY, + NL80211_ATTR_DISABLE_HE, + NL80211_ATTR_HE_MUEDCA_PARAMS, /* add attributes here, update the policy in nl80211.c */ @@ -271,27 +272,26 @@ Signed-off-by: Muna Sinada __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -5803,3 +5803,16 @@ void ieee80211_cqm_beacon_loss_notify(st +@@ -5974,3 +5974,15 @@ void ieee80211_cqm_beacon_loss_notify(st cfg80211_cqm_beacon_loss_notify(sdata->dev, gfp); } EXPORT_SYMBOL(ieee80211_cqm_beacon_loss_notify); + +void ieee80211_update_muedca_params(struct ieee80211_hw *hw, + struct ieee80211_mu_edca_param_set -+ *params) ++ *params, gfp_t gfp) +{ + struct ieee80211_local *local = hw_to_local(hw); + + trace_api_update_muedca_params(local, params); + -+ cfg80211_update_muedca_params_event(local->hw.wiphy, params, -+ GFP_KERNEL); ++ cfg80211_update_muedca_params_event(local->hw.wiphy, params, gfp); +} +EXPORT_SYMBOL(ieee80211_update_muedca_params); --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h -@@ -2791,6 +2791,26 @@ TRACE_EVENT(drv_get_ftm_responder_stats, - ) +@@ -2836,6 +2836,26 @@ DEFINE_EVENT(sta_flag_evt, drv_sta_set_d + TP_ARGS(local, sdata, sta, enabled) ); +TRACE_EVENT(api_update_muedca_params, @@ -319,7 +319,7 @@ Signed-off-by: Muna Sinada #undef TRACE_INCLUDE_PATH --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -17678,6 +17678,42 @@ nla_put_failure: +@@ -18134,6 +18134,42 @@ nla_put_failure: } EXPORT_SYMBOL(cfg80211_update_owe_info_event); diff --git a/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-fix-invalid-he-rates-in-fixed-rate-setting.patch b/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-fix-invalid-he-rates-in-fixed-rate-setting.patch index 9d38f65b6..d0b11e2a3 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-fix-invalid-he-rates-in-fixed-rate-setting.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-fix-invalid-he-rates-in-fixed-rate-setting.patch @@ -12,9 +12,11 @@ Signed-off-by: Lavanya Suresh drivers/net/wireless/ath/ath11k/mac.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1514,10 +1514,12 @@ static void ath11k_peer_assoc_h_vht(stru +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +@@ -1483,10 +1483,12 @@ static void ath11k_peer_assoc_h_vht(stru struct ath11k_vif *arvif = (void *)vif->drv_priv; struct cfg80211_chan_def def; enum nl80211_band band; @@ -28,7 +30,7 @@ Signed-off-by: Lavanya Suresh if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) return; -@@ -1560,6 +1562,23 @@ static void ath11k_peer_assoc_h_vht(stru +@@ -1529,6 +1531,23 @@ static void ath11k_peer_assoc_h_vht(stru if (sta->bandwidth == IEEE80211_STA_RX_BW_160) arg->bw_160 = true; @@ -52,22 +54,20 @@ Signed-off-by: Lavanya Suresh /* Calculate peer NSS capability from VHT capabilities if STA * supports VHT. */ -@@ -1681,11 +1700,13 @@ static void ath11k_peer_assoc_h_he(struc - struct cfg80211_chan_def def; +@@ -1651,9 +1670,11 @@ static void ath11k_peer_assoc_h_he(struc const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + u8 ampdu_factor; enum nl80211_band band; - const u16 *he_mcs_mask; + u16 *he_mcs_mask; u8 max_nss, he_mcs; - u8 ampdu_factor; __le16 he_tx_mcs = 0, v = 0; - int i; + bool user_rate_valid = true; + int he_nss, nss_idx; + int i; if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) - return; -@@ -1770,6 +1791,23 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1739,6 +1760,23 @@ static void ath11k_peer_assoc_h_he(struc if (he_cap->he_cap_elem.mac_cap_info[0] & IEEE80211_HE_MAC_CAP0_TWT_REQ) arg->twt_requester = true; @@ -91,3 +91,26 @@ Signed-off-by: Lavanya Suresh switch (sta->bandwidth) { case IEEE80211_STA_RX_BW_160: if (he_cap->he_cap_elem.phy_cap_info[0] & +Index: backports-20210222_001-4.4.60-b157d2276/net/wireless/nl80211.c +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/net/wireless/nl80211.c ++++ backports-20210222_001-4.4.60-b157d2276/net/wireless/nl80211.c +@@ -4785,12 +4785,17 @@ static int nl80211_parse_tx_bitrate_mask + sband->ht_cap.mcs.rx_mask, + sizeof(mask->control[i].ht_mcs)); + +- if (!sband->vht_cap.vht_supported) ++ if (!sband->vht_cap.vht_supported) { ++ if (i == NL80211_BAND_6GHZ) ++ goto skip_vht_mcs_map; + continue; ++ } + + vht_tx_mcs_map = le16_to_cpu(sband->vht_cap.vht_mcs.tx_mcs_map); + vht_build_mcs_mask(vht_tx_mcs_map, mask->control[i].vht_mcs); + ++skip_vht_mcs_map: ++ + he_cap = ieee80211_get_he_iftype_cap(sband, wdev->iftype); + if (!he_cap) + continue; diff --git a/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-support-for-native-160MHz.patch b/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-support-for-native-160MHz.patch index 92d27ca6b..fe4b98d04 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-support-for-native-160MHz.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/204-ath11k-support-for-native-160MHz.patch @@ -28,7 +28,7 @@ Signed-off-by: P Praneesh --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -686,6 +686,8 @@ struct ath11k_pdev_cap { +@@ -697,6 +697,8 @@ struct ath11k_pdev_cap { u32 tx_chain_mask_shift; u32 rx_chain_mask_shift; struct ath11k_band_cap band[NUM_NL80211_BANDS]; @@ -39,7 +39,7 @@ Signed-off-by: P Praneesh struct ath11k_pdev { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1505,6 +1505,33 @@ ath11k_peer_assoc_h_vht_limit(u16 tx_mcs +@@ -1474,6 +1474,33 @@ ath11k_peer_assoc_h_vht_limit(u16 tx_mcs return tx_mcs_set; } @@ -73,7 +73,7 @@ Signed-off-by: P Praneesh static void ath11k_peer_assoc_h_vht(struct ath11k *ar, struct ieee80211_vif *vif, struct ieee80211_sta *sta, -@@ -1520,6 +1547,7 @@ static void ath11k_peer_assoc_h_vht(stru +@@ -1489,6 +1516,7 @@ static void ath11k_peer_assoc_h_vht(stru int i; bool user_rate_valid = true; int vht_nss, nss_idx; @@ -81,7 +81,7 @@ Signed-off-by: P Praneesh if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) return; -@@ -1611,10 +1639,32 @@ static void ath11k_peer_assoc_h_vht(stru +@@ -1580,10 +1608,32 @@ static void ath11k_peer_assoc_h_vht(stru /* TODO: Check */ arg->tx_max_mcs_nss = 0xFF; @@ -117,23 +117,25 @@ Signed-off-by: P Praneesh } static int ath11k_mac_get_max_he_mcs_map(u16 mcs_map, int nss) -@@ -1707,6 +1757,7 @@ static void ath11k_peer_assoc_h_he(struc - int i; +@@ -1675,6 +1725,7 @@ static void ath11k_peer_assoc_h_he(struc + __le16 he_tx_mcs = 0, v = 0; bool user_rate_valid = true; int he_nss, nss_idx; + u32 rx_nss_160, tx_nss_160; + int i; if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) - return; -@@ -1873,9 +1924,33 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1842,9 +1893,35 @@ static void ath11k_peer_assoc_h_he(struc } arg->peer_nss = min(sta->rx_nss, max_nss); + if (arg->peer_phymode == MODE_11AX_HE160 || + arg->peer_phymode == MODE_11AX_HE80_80) { -+ tx_nss_160 = ath11k_get_nss_160MHz(ar, max_nss); ++ tx_nss_160 = ath11k_get_nss_160MHz(ar, ar->num_tx_chains); + rx_nss_160 = min(arg->peer_nss, tx_nss_160); + ++ arg->peer_nss = min(sta->rx_nss, ar->num_rx_chains); ++ + if (rx_nss_160) { + arg->peer_bw_rxnss_override = + ATH11K_BW_NSS_FWCONF_MAP_ENABLE; @@ -161,7 +163,7 @@ Signed-off-by: P Praneesh } static void ath11k_peer_assoc_h_smps(struct ieee80211_sta *sta, -@@ -2163,11 +2238,11 @@ static void ath11k_peer_assoc_prepare(st +@@ -2132,11 +2209,11 @@ static void ath11k_peer_assoc_prepare(st ath11k_peer_assoc_h_basic(ar, vif, sta, arg); ath11k_peer_assoc_h_crypto(ar, vif, sta, arg); ath11k_peer_assoc_h_rates(ar, vif, sta, arg); @@ -174,7 +176,7 @@ Signed-off-by: P Praneesh ath11k_peer_assoc_h_smps(sta, arg); /* TODO: amsdu_disable req? */ -@@ -4379,11 +4454,6 @@ ath11k_create_vht_cap(struct ath11k *ar, +@@ -4582,11 +4659,6 @@ ath11k_create_vht_cap(struct ath11k *ar, ath11k_set_vht_txbf_cap(ar, &vht_cap.cap); @@ -186,36 +188,108 @@ Signed-off-by: P Praneesh rxmcs_map = 0; txmcs_map = 0; for (i = 0; i < 8; i++) { -@@ -4650,8 +4720,6 @@ static int ath11k_mac_copy_he_cap(struct +@@ -4607,6 +4679,12 @@ ath11k_create_vht_cap(struct ath11k *ar, + vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(rxmcs_map); + vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(txmcs_map); + ++ /* Check if the HW supports 1:1 NSS ratio and reset ++ * EXT NSS BW Support field to 0 to indicate 1:1 ratio ++ */ ++ if (ar->pdev->cap.nss_ratio_info == WMI_NSS_RATIO_1_NSS) ++ vht_cap.cap &= ~IEEE80211_VHT_CAP_EXT_NSS_BW_MASK; ++ + return vht_cap; + } + +@@ -4788,11 +4866,12 @@ static void ath11k_mac_set_hemcsmap(stru + struct ath11k_pdev_cap *cap, + struct ieee80211_sta_he_cap * he_cap) + { +- u16 txmcs_map, rxmcs_map; ++ u16 txmcs_map = 0, rxmcs_map = 0; ++ u16 txmcs_map_160 = 0, rxmcs_map_160 = 0; + u32 i = 0; ++ u8 maxtxnss_160 = ath11k_get_nss_160MHz(ar, ar->num_tx_chains); ++ u8 maxrxnss_160 = ath11k_get_nss_160MHz(ar, ar->num_rx_chains); + +- rxmcs_map = 0; +- txmcs_map = 0; + for (i = 0; i < 8; i++) { + if (i < ar->num_tx_chains && + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) +@@ -4805,19 +4884,31 @@ static void ath11k_mac_set_hemcsmap(stru + rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); + else + rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); ++ ++ if (i < maxtxnss_160 && ++ (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) ++ txmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); ++ else ++ txmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); ++ ++ if (i < maxrxnss_160 && ++ (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) ++ rxmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); ++ else ++ rxmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); + } + he_cap->he_mcs_nss_supp.rx_mcs_80 = + cpu_to_le16(rxmcs_map & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_80 = + cpu_to_le16(txmcs_map & 0xffff); + he_cap->he_mcs_nss_supp.rx_mcs_160 = +- cpu_to_le16(rxmcs_map & 0xffff); ++ cpu_to_le16(rxmcs_map_160 & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_160 = +- cpu_to_le16(txmcs_map & 0xffff); ++ cpu_to_le16(txmcs_map_160 & 0xffff); + he_cap->he_mcs_nss_supp.rx_mcs_80p80 = +- cpu_to_le16(rxmcs_map & 0xffff); ++ cpu_to_le16(rxmcs_map_160 & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_80p80 = +- cpu_to_le16(txmcs_map & 0xffff); ++ cpu_to_le16(txmcs_map_160 & 0xffff); + } + + static int ath11k_mac_copy_he_cap(struct ath11k *ar, +@@ -4852,10 +4943,6 @@ static int ath11k_mac_copy_he_cap(struct + he_cap_elem->mac_cap_info[1] &= IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK; - he_cap_elem->phy_cap_info[0] &= +- he_cap_elem->phy_cap_info[0] &= - ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; - he_cap_elem->phy_cap_info[0] &= - ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; - he_cap_elem->phy_cap_info[4] &= - ~IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK; -@@ -7264,7 +7332,9 @@ static const struct ieee80211_iface_comb - .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | - BIT(NL80211_CHAN_WIDTH_20) | - BIT(NL80211_CHAN_WIDTH_40) | -- BIT(NL80211_CHAN_WIDTH_80), -+ BIT(NL80211_CHAN_WIDTH_80) | -+ BIT(NL80211_CHAN_WIDTH_80P80) | -+ BIT(NL80211_CHAN_WIDTH_160), - }, - }; +- ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; -@@ -7562,6 +7632,9 @@ static int __ath11k_mac_register(struct - ieee80211_hw_set(ar->hw, AP_LINK_PS); - ieee80211_hw_set(ar->hw, SPECTRUM_MGMT); + he_cap_elem->phy_cap_info[5] &= + ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; +@@ -7648,7 +7735,9 @@ static int ath11k_mac_setup_iface_combin + combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | + BIT(NL80211_CHAN_WIDTH_20) | + BIT(NL80211_CHAN_WIDTH_40) | +- BIT(NL80211_CHAN_WIDTH_80); ++ ddBIT(NL80211_CHAN_WIDTH_80) | ++ BIT(NL80211_CHAN_WIDTH_80P80) | ++ BIT(NL80211_CHAN_WIDTH_160); + ar->hw->wiphy->iface_combinations = combinations; + ar->hw->wiphy->n_iface_combinations = 1; +@@ -7855,6 +7944,14 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, USES_RSS); + } + ++ /* If supported number of NSS is less than the maximum ++ * NSS of device, then SUPPORTS_VHT_EXT_NSS_BW capablity ++ * needs to adevertise to upper layer ++ */ + if(cap->nss_ratio_enabled) + ieee80211_hw_set(ar->hw, SUPPORTS_VHT_EXT_NSS_BW); + - /* Use normal tx path for raw mode as fast-tx path does not - * ensure tailroom availability for including MIC length. - */ ++ + ar->hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS; + ar->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h @@ -115,6 +115,9 @@ struct ath11k_generic_iter { @@ -226,11 +300,11 @@ Signed-off-by: P Praneesh +#define ATH11K_PEER_RX_NSS_160MHZ GENMASK(2, 0) +#define ATH11K_PEER_RX_NSS_80_80MHZ GENMASK(5, 3) - /* HECAP info internal bits */ - #define IEEE80211_HE_DL_MUMIMO_SUPP_S 5 + #define ATH11K_OBSS_PD_MAX_THRESHOLD -82 + #define ATH11K_OBSS_PD_NON_SRG_MAX_THRESHOLD -62 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -392,6 +392,10 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st +@@ -390,6 +390,10 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st pdev_cap->he_mcs = mac_phy_caps->he_supp_mcs_5g; pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_5g; pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_5g; @@ -241,7 +315,7 @@ Signed-off-by: P Praneesh } else { return -EINVAL; } -@@ -815,14 +819,22 @@ int ath11k_wmi_vdev_down(struct ath11k * +@@ -813,14 +817,23 @@ int ath11k_wmi_vdev_down(struct ath11k * static void ath11k_wmi_put_wmi_channel(struct wmi_channel *chan, struct wmi_vdev_start_req_arg *arg) { @@ -260,7 +334,8 @@ Signed-off-by: P Praneesh + chan->band_center_freq1 = center_freq1 - 40; + + chan->band_center_freq2 = arg->channel.band_center_freq1; -+ } else if (arg->channel.mode == MODE_11AC_VHT80_80) ++ } else if ((arg->channel.mode == MODE_11AC_VHT80_80) || ++ (arg->channel.mode == MODE_11AX_HE80_80)) chan->band_center_freq2 = arg->channel.band_center_freq2; - else - chan->band_center_freq2 = 0; @@ -269,7 +344,7 @@ Signed-off-by: P Praneesh if (arg->channel.passive) --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2153,6 +2153,24 @@ enum wmi_direct_buffer_module { +@@ -2163,6 +2163,24 @@ enum wmi_direct_buffer_module { WMI_DIRECT_BUF_MAX }; @@ -294,7 +369,7 @@ Signed-off-by: P Praneesh struct wmi_host_pdev_band_to_mac { u32 pdev_id; u32 start_freq; -@@ -2399,6 +2417,12 @@ struct wmi_hw_mode_capabilities { +@@ -2408,6 +2426,12 @@ struct wmi_hw_mode_capabilities { } __packed; #define WMI_MAX_HECAP_PHY_SIZE (3) @@ -307,7 +382,7 @@ Signed-off-by: P Praneesh struct wmi_mac_phy_capabilities { u32 hw_mode_id; -@@ -2432,6 +2456,12 @@ struct wmi_mac_phy_capabilities { +@@ -2441,6 +2465,12 @@ struct wmi_mac_phy_capabilities { u32 he_cap_info_2g_ext; u32 he_cap_info_5g_ext; u32 he_cap_info_internal; diff --git a/feeds/wifi-ax/mac80211/patches/qca/204-frame-size-warning-fix.patch b/feeds/wifi-ax/mac80211/patches/qca/204-frame-size-warning-fix.patch index bce909f36..f0d84e155 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/204-frame-size-warning-fix.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/204-frame-size-warning-fix.patch @@ -17,7 +17,7 @@ Signed-off-by: Karthikeyan Kathirvel --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3048,7 +3048,7 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3238,7 +3238,7 @@ static int ath11k_mac_op_hw_scan(struct struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); struct cfg80211_scan_request *req = &hw_req->req; @@ -26,7 +26,7 @@ Signed-off-by: Karthikeyan Kathirvel int ret = 0; int i; -@@ -3075,41 +3075,48 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3265,41 +3265,47 @@ static int ath11k_mac_op_hw_scan(struct if (ret) goto exit; @@ -35,7 +35,6 @@ Signed-off-by: Karthikeyan Kathirvel - arg.vdev_id = arvif->vdev_id; - arg.scan_id = ATH11K_SCAN_ID; + arg = kzalloc(sizeof(*arg), GFP_KERNEL); -+ + if (!arg) { + ret = -ENOMEM; + goto exit; @@ -79,11 +78,11 @@ Signed-off-by: Karthikeyan Kathirvel - arg.scan_f_wide_band = true; - arg.scan_f_passive = true; - arg.chandef = req->chandef; -- ret = ath11k_wmi_append_scan_chan_list(ar, &arg); +- ret = ath11k_wmi_update_scan_chan_list(ar, &arg); + arg->scan_f_wide_band = true; + arg->scan_f_passive = true; + arg->chandef = req->chandef; -+ ret = ath11k_wmi_append_scan_chan_list(ar, arg); ++ ret = ath11k_wmi_update_scan_chan_list(ar, arg); if (ret) goto exit; } @@ -93,7 +92,7 @@ Signed-off-by: Karthikeyan Kathirvel if (ret) { ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); spin_lock_bh(&ar->data_lock); -@@ -3119,12 +3126,15 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3309,12 +3315,15 @@ static int ath11k_mac_op_hw_scan(struct /* Add a 200ms margin to account for event/command processing */ ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout, diff --git a/feeds/wifi-ax/mac80211/patches/qca/204-mac80211-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch b/feeds/wifi-ax/mac80211/patches/qca/204-mac80211-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch index abdbe999b..68125a56a 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/204-mac80211-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/204-mac80211-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch @@ -1,1010 +1,438 @@ ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2566,6 +2566,63 @@ static void ath11k_recalculate_mgmt_rate - ath11k_warn(ar->ab, "failed to set beacon tx rate %d\n", ret); - } - -+static int ath11k_mac_fils_discovery(struct ath11k_vif *arvif, -+ struct ieee80211_bss_conf *info) -+{ -+ struct ath11k *ar = arvif->ar; -+ struct sk_buff *tmpl; -+ int ret; -+ u32 interval; -+ bool unsol_bcast_probe_resp_enabled = false; -+ -+ if (!(ar->pdev->cap.supported_bands & WMI_HOST_WLAN_5G_CAP) || -+ !ar->supports_6ghz) { -+ if (info->fils_discovery.max_interval || -+ info->unsol_bcast_probe_resp_interval) { -+ ath11k_warn(ar->ab, -+ "FILS discovery/unsolicited broadcast probe response support available only in 6GHz band\n"); -+ return -EOPNOTSUPP; -+ } -+ return 0; -+ } -+ -+ if (info->fils_discovery.max_interval) { -+ interval = info->fils_discovery.max_interval; -+ -+ tmpl = ieee80211_get_fils_discovery_tmpl(ar->hw, arvif->vif); -+ if (tmpl) -+ ret = ath11k_wmi_fils_discovery_tmpl(ar, arvif->vdev_id, -+ tmpl); -+ } else if (info->unsol_bcast_probe_resp_interval) { -+ unsol_bcast_probe_resp_enabled = 1; -+ interval = info->unsol_bcast_probe_resp_interval; -+ -+ tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(ar->hw, -+ arvif->vif); -+ if (tmpl) -+ ret = ath11k_wmi_probe_resp_tmpl(ar, arvif->vdev_id, -+ tmpl); -+ } else { /* Disable */ -+ return ath11k_wmi_fils_discovery(ar, arvif->vdev_id, 0, false); -+ } -+ -+ if (!tmpl) { -+ ath11k_warn(ar->ab, -+ "mac vdev %i failed to retrieve %s template\n", -+ arvif->vdev_id, (unsol_bcast_probe_resp_enabled ? -+ "unsolicited broadcast probe response" : -+ "FILS discovery")); -+ return -EPERM; -+ } -+ kfree_skb(tmpl); -+ -+ if (!ret) -+ ret = ath11k_wmi_fils_discovery(ar, arvif->vdev_id, interval, -+ unsol_bcast_probe_resp_enabled); -+ -+ return ret; -+} -+ - static void ath11k_mac_op_nss_bss_info_changed(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - u32 changed) -@@ -2854,6 +2911,10 @@ static void ath11k_mac_op_bss_info_chang - } - } - -+ if (changed & BSS_CHANGED_FILS_DISCOVERY || -+ changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP) -+ ath11k_mac_fils_discovery(arvif, info); -+ - mutex_unlock(&ar->conf_mutex); - } - ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -127,6 +127,10 @@ static const struct wmi_tlv_policy wmi_t - = { .min_len = sizeof(struct wmi_stats_event) }, - [WMI_TAG_PDEV_CTL_FAILSAFE_CHECK_EVENT] - = { .min_len = sizeof(struct wmi_pdev_ctl_failsafe_chk_event) }, -+ [WMI_TAG_HOST_SWFDA_EVENT] = { -+ .min_len = sizeof(struct wmi_fils_discovery_event) }, -+ [WMI_TAG_OFFLOAD_PRB_RSP_TX_STATUS_EVENT] = { -+ .min_len = sizeof(struct wmi_probe_resp_tx_status_event) }, - [WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT] - = { .min_len = sizeof(struct wmi_twt_add_dialog_event) }, - [WMI_TAG_VDEV_DELETE_RESP_EVENT] -@@ -3483,6 +3487,138 @@ int ath11k_wmi_send_bss_color_change_ena - return ret; - } - -+int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id, -+ struct sk_buff *tmpl) -+{ -+ struct wmi_tlv *tlv; -+ struct sk_buff *skb; -+ void *ptr; -+ int ret, len; -+ -+ size_t aligned_len; -+ struct wmi_fils_discovery_tmpl_cmd *cmd; -+ -+ aligned_len = roundup(tmpl->len, 4); -+ len = sizeof(*cmd) + TLV_HDR_SIZE + aligned_len; -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "WMI vdev %i set FILS discovery template\n", vdev_id); -+ -+ skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_fils_discovery_tmpl_cmd *)skb->data; -+ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_FILS_DISCOVERY_TMPL_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); -+ cmd->vdev_id = vdev_id; -+ cmd->buf_len = tmpl->len; -+ ptr = skb->data + sizeof(*cmd); -+ -+ tlv = ptr; -+ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | -+ FIELD_PREP(WMI_TLV_LEN, aligned_len); -+ memcpy(tlv->value, tmpl->data, tmpl->len); -+ -+ ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_FILS_DISCOVERY_TMPL_CMDID); -+ if (ret) { -+ ath11k_warn(ar->ab, -+ "WMI vdev %i failed to send FILS discovery template command\n", -+ vdev_id); -+ dev_kfree_skb(skb); -+ } -+ return ret; -+} -+ -+int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id, -+ struct sk_buff *tmpl) -+{ -+ struct wmi_probe_tmpl_cmd *cmd; -+ struct wmi_bcn_prb_info *probe_info; -+ struct wmi_tlv *tlv; -+ struct sk_buff *skb; -+ void *ptr; -+ int ret, len; -+ size_t aligned_len = roundup(tmpl->len, 4); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "WMI vdev %i set probe response template\n", vdev_id); -+ -+ len = sizeof(*cmd) + sizeof(*probe_info) + TLV_HDR_SIZE + aligned_len; -+ -+ skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_probe_tmpl_cmd *)skb->data; -+ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PRB_TMPL_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); -+ cmd->vdev_id = vdev_id; -+ cmd->buf_len = tmpl->len; -+ -+ ptr = skb->data + sizeof(*cmd); -+ -+ probe_info = ptr; -+ len = sizeof(*probe_info); -+ probe_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_BCN_PRB_INFO) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ probe_info->caps = 0; -+ probe_info->erp = 0; -+ -+ ptr += sizeof(*probe_info); -+ -+ tlv = ptr; -+ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | -+ FIELD_PREP(WMI_TLV_LEN, aligned_len); -+ memcpy(tlv->value, tmpl->data, tmpl->len); -+ -+ ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_PRB_TMPL_CMDID); -+ if (ret) { -+ ath11k_warn(ar->ab, -+ "WMI vdev %i failed to send probe response template command\n", -+ vdev_id); -+ dev_kfree_skb(skb); -+ } -+ return ret; -+} -+ -+int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval, -+ bool unsol_bcast_probe_resp_enabled) -+{ -+ struct sk_buff *skb; -+ int ret, len; -+ struct wmi_fils_discovery_cmd *cmd; -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "WMI vdev %i set %s interval to %u TU\n", -+ vdev_id, unsol_bcast_probe_resp_enabled ? -+ "unsolicited broadcast probe response" : "FILS discovery", -+ interval); -+ -+ len = sizeof(*cmd); -+ skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_fils_discovery_cmd *)skb->data; -+ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ENABLE_FILS_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->vdev_id = vdev_id; -+ cmd->interval = interval; -+ cmd->config = unsol_bcast_probe_resp_enabled; -+ -+ ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_ENABLE_FILS_CMDID); -+ if (ret) { -+ ath11k_warn(ar->ab, -+ "WMI vdev %i failed to send FILS discovery enable/disable command\n", -+ vdev_id); -+ dev_kfree_skb(skb); -+ } -+ return ret; -+} -+ - static void - ath11k_fill_band_to_mac_param(struct ath11k_base *soc, - struct wmi_host_pdev_band_to_mac *band_to_mac) -@@ -7592,6 +7728,68 @@ static void ath11k_bcn_tx_status_event(s - } - - -+static void ath11k_fils_discovery_event(struct ath11k_base *ab, -+ struct sk_buff *skb) -+{ -+ const void **tb; -+ const struct wmi_fils_discovery_event *ev; -+ int ret; -+ -+ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); -+ if (IS_ERR(tb)) { -+ ret = PTR_ERR(tb); -+ ath11k_warn(ab, -+ "failed to parse FILS discovery event tlv %d\n", -+ ret); -+ return; -+ } -+ -+ ev = tb[WMI_TAG_HOST_SWFDA_EVENT]; -+ if (!ev) { -+ ath11k_warn(ab, "failed to fetch FILS discovery event\n"); -+ kfree(tb); -+ return; -+ } -+ -+ ath11k_warn(ab, -+ "vdev_id: %u, FILS discovery frame scheduled at %u, next TBTT: %u\n", -+ ev->vdev_id, ev->fils_tt, ev->tbtt); -+ -+ kfree(tb); -+} -+ -+static void ath11k_probe_resp_tx_status_event(struct ath11k_base *ab, -+ struct sk_buff *skb) -+{ -+ const void **tb; -+ const struct wmi_probe_resp_tx_status_event *ev; -+ int ret; -+ -+ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); -+ if (IS_ERR(tb)) { -+ ret = PTR_ERR(tb); -+ ath11k_warn(ab, -+ "failed to parse probe response transmission status event tlv: %d\n", -+ ret); -+ return; -+ } -+ -+ ev = tb[WMI_TAG_OFFLOAD_PRB_RSP_TX_STATUS_EVENT]; -+ if (!ev) { -+ ath11k_warn(ab, -+ "failed to fetch probe response transmission status event"); -+ kfree(tb); -+ return; -+ } -+ -+ if (ev->tx_status) -+ ath11k_warn(ab, -+ "Probe response transmission failed for vdev_id %u, status %u\n", -+ ev->vdev_id, ev->tx_status); -+ -+ kfree(tb); -+} -+ - static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) - { - struct wmi_cmd_hdr *cmd_hdr; -@@ -7684,6 +7882,12 @@ static void ath11k_wmi_tlv_op_rx(struct - case WMI_TWT_ADD_DIALOG_EVENTID: - ath11k_wmi_twt_add_dialog_event(ab, skb); - break; -+ case WMI_HOST_FILS_DISCOVERY_EVENTID: -+ ath11k_fils_discovery_event(ab, skb); -+ break; -+ case WMI_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID: -+ ath11k_probe_resp_tx_status_event(ab, skb); -+ break; - /* add Unsupported events here */ - case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: - case WMI_PEER_OPER_MODE_CHANGE_EVENTID: ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -349,6 +349,7 @@ enum wmi_tlv_cmd_id { - WMI_BCN_OFFLOAD_CTRL_CMDID, - WMI_BSS_COLOR_CHANGE_ENABLE_CMDID, - WMI_VDEV_BCN_OFFLOAD_QUIET_CONFIG_CMDID, -+ WMI_FILS_DISCOVERY_TMPL_CMDID, - WMI_ADDBA_CLEAR_RESP_CMDID = WMI_TLV_CMD(WMI_GRP_BA_NEG), - WMI_ADDBA_SEND_CMDID, - WMI_ADDBA_STATUS_CMDID, -@@ -381,6 +382,8 @@ enum wmi_tlv_cmd_id { - WMI_ROAM_CONFIGURE_MAWC_CMDID, - WMI_ROAM_SET_MBO_PARAM_CMDID, - WMI_ROAM_PER_CONFIG_CMDID, -+ WMI_ROAM_BTM_CONFIG_CMDID, -+ WMI_ENABLE_FILS_CMDID, - WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_TLV_CMD(WMI_GRP_OFL_SCAN), - WMI_OFL_SCAN_REMOVE_AP_PROFILE, - WMI_OFL_SCAN_PERIOD, -@@ -674,6 +677,8 @@ enum wmi_tlv_event_id { - WMI_MGMT_TX_COMPLETION_EVENTID, - WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID, - WMI_TBTTOFFSET_EXT_UPDATE_EVENTID, -+ WMI_OFFCHAN_DATA_TX_COMPLETION_EVENTID, -+ WMI_HOST_FILS_DISCOVERY_EVENTID, - WMI_TX_DELBA_COMPLETE_EVENTID = WMI_TLV_CMD(WMI_GRP_BA_NEG), - WMI_TX_ADDBA_COMPLETE_EVENTID, - WMI_BA_RSP_SSN_EVENTID, -@@ -1848,6 +1853,7 @@ enum wmi_tlv_tag { - WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301, - WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, - WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT = 0x32a, -+ WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344, - WMI_TAG_TPC_STATS_GET_CMD = 0x38B, - WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM, - WMI_TAG_TPC_STATS_CONFIG_EVENT, -@@ -4223,6 +4229,17 @@ struct wmi_peer_assoc_conf_arg { - const u8 *macaddr; - }; - -+struct wmi_fils_discovery_event { -+ u32 vdev_id; -+ u32 fils_tt; -+ u32 tbtt; -+} __packed; -+ -+struct wmi_probe_resp_tx_status_event { -+ u32 vdev_id; -+ u32 tx_status; -+} __packed; -+ - /* - * PDEV statistics - */ -@@ -5255,6 +5272,30 @@ struct wmi_dma_buf_release_meta_data { - u32 ch_width; - } __packed; - -+enum wmi_fils_discovery_cmd_type { -+ WMI_FILS_DISCOVERY_CMD, -+ WMI_UNSOL_BCAST_PROBE_RESP, -+}; -+ -+struct wmi_fils_discovery_cmd { -+ u32 tlv_header; -+ u32 vdev_id; -+ u32 interval; -+ u32 config; /* enum wmi_fils_discovery_cmd_type */ -+} __packed; -+ -+struct wmi_fils_discovery_tmpl_cmd { -+ u32 tlv_header; -+ u32 vdev_id; -+ u32 buf_len; -+} __packed; -+ -+struct wmi_probe_tmpl_cmd { -+ u32 tlv_header; -+ u32 vdev_id; -+ u32 buf_len; -+} __packed; -+ - struct target_resource_config { - u32 num_vdevs; - u32 num_peers; -@@ -5659,6 +5700,11 @@ int ath11k_wmi_vdev_spectral_enable(stru - u32 trigger, u32 enable); - int ath11k_wmi_vdev_spectral_conf(struct ath11k *ar, - struct ath11k_wmi_vdev_spectral_conf_param *param); -+int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id, -+ struct sk_buff *tmpl); -+int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval, -+ bool unsol_bcast_probe_resp_enabled); -+int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id, struct sk_buff *tmpl); - int ath11k_wmi_pdev_m3_dump_enable(struct ath11k *ar, u32 enable); - int ath11k_wmi_pdev_get_tpc_table_cmdid(struct ath11k *ar); - void ath11k_wmi_free_tpc_stats_mem(struct ath11k *ar); +From 17f4293abeb87c7bfae9f4056ec16006482b38d0 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Tue, 1 Dec 2020 10:21:04 -0800 +Subject: [PATCH] mac80211: FILS discovery and unsolicited broadcast probe + response + +These features are used in 6GHz for in-band discovery. + +Signed-off-by: Aloka Dixit +--- + include/net/cfg80211.h | 13 +++-- + include/uapi/linux/nl80211.h | 11 ++++ + net/mac80211/cfg.c | 32 ++++------- + net/wireless/nl80211.c | 106 +++++++++++++++++++++-------------- + net/wireless/rdev-ops.h | 24 ++++++++ + net/wireless/trace.h | 47 ++++++++++++++++ + 6 files changed, 166 insertions(+), 67 deletions(-) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 5816db23d116..71d6a6c21360 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -1070,6 +1070,39 @@ struct cfg80211_acl_data { - }; - - /** -+ * struct cfg80211_fils_discovery - FILS discovery parameters from -+ * IEEE Std 802.11ai-2016, Annex C.3 MIB detail. -+ * -+ * @min_interval: Minimum packet interval in TUs (0 - 10000) -+ * @max_interval: Maximum packet interval in TUs (0 - 10000) -+ * @tmpl_len: Template length -+ * @tmpl: Template data from IEEE Std 802.11ai-2016 9.6.8.36 FILS discovery -+ * frame (Figure 9-687a). -+ */ -+struct cfg80211_fils_discovery { -+ u32 min_interval; -+ u32 max_interval; -+ size_t tmpl_len; -+ const u8 *tmpl; -+}; -+ -+/** -+ * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe -+ * response parameters in 6GHz. -+ * -+ * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned -+ * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive -+ * scanning -+ * @tmpl_len: Template length -+ * @tmpl: Template data for probe response -+ */ -+struct cfg80211_unsol_bcast_probe_resp { -+ u32 interval; -+ size_t tmpl_len; -+ const u8 *tmpl; -+}; -+ -+/** - * enum cfg80211_ap_settings_flags - AP settings flags - * - * Used by cfg80211_ap_settings -@@ -1116,6 +1149,8 @@ enum cfg80211_ap_settings_flags { +@@ -1181,8 +1181,6 @@ enum cfg80211_ap_settings_flags { * @he_obss_pd: OBSS Packet Detection settings * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) -+ * @fils_discovery: FILS discovery transmission parameters -+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameter +- * @fils_discovery: FILS discovery transmission parameters +- * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; -@@ -1146,6 +1181,8 @@ struct cfg80211_ap_settings { +@@ -1213,8 +1211,6 @@ struct cfg80211_ap_settings { u32 flags; struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; -+ struct cfg80211_fils_discovery fils_discovery; -+ struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; +- struct cfg80211_fils_discovery fils_discovery; +- struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; }; /** ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -317,6 +317,9 @@ struct ieee80211_vif_chanctx_switch { - * @BSS_CHANGED_TWT: TWT status changed - * @BSS_CHANGED_HE_OBSS_PD: OBSS Packet Detection status changed. - * @BSS_CHANGED_HE_BSS_COLOR: BSS Color has changed -+ * @BSS_CHANGED_FILS_DISCOVERY: FILS discovery status changed. -+ * @BSS_CHANGED_UNSOL_BCAST_PROBE_RESP: Unsolicited broadcast probe response -+ * status changed. +@@ -3986,6 +3982,9 @@ struct mgmt_frame_regs { + * given TIDs. This callback may sleep. * + * @set_sar_specs: Update the SAR (TX power) settings. ++ * @set_fils_discovery: Set FILS discovery transmission parameters. ++ * @set_unsol_bcast_probe_resp: Set unsolicited broadcast probe response ++ * transmission parameters. */ - enum ieee80211_bss_change { -@@ -350,6 +353,8 @@ enum ieee80211_bss_change { - BSS_CHANGED_TWT = 1<<27, - BSS_CHANGED_HE_OBSS_PD = 1<<28, - BSS_CHANGED_HE_BSS_COLOR = 1<<29, -+ BSS_CHANGED_FILS_DISCOVERY = 1<<30, -+ BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = 1<<31, - - /* when adding here, make sure to change ieee80211_reconfig */ - }; -@@ -505,6 +510,18 @@ struct ieee80211_ftm_responder_params { + struct cfg80211_ops { + int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); +@@ -4313,6 +4312,12 @@ struct cfg80211_ops { + const u8 *peer, u8 tids); + int (*set_sar_specs)(struct wiphy *wiphy, + struct cfg80211_sar_specs *sar); ++ int (*set_fils_discovery)(struct wiphy *wiphy, ++ struct net_device *dev, ++ struct cfg80211_fils_discovery *params); ++ int (*set_unsol_bcast_probe_resp)(struct wiphy *wiphy, ++ struct net_device *dev, ++ struct cfg80211_unsol_bcast_probe_resp *params); }; - /** -+ * struct ieee80211_fils_discovery - FILS discovery parameters from -+ * IEEE Std 802.11ai-2016, Annex C.3 MIB detail. -+ * -+ * @min_interval: Minimum packet interval in TUs (0 - 10000) -+ * @max_interval: Maximum packet interval in TUs (0 - 10000) -+ */ -+struct ieee80211_fils_discovery { -+ u32 min_interval; -+ u32 max_interval; -+}; -+ -+/** - * struct ieee80211_bss_conf - holds the BSS's changing parameters - * - * This structure keeps information about a BSS (and an association -@@ -622,6 +639,9 @@ struct ieee80211_ftm_responder_params { - * @he_obss_pd: OBSS Packet Detection parameters. - * @he_bss_color: BSS coloring settings, if BSS supports HE - * @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature -+ * @fils_discovery: FILS discovery configuration -+ * @unsol_bcast_probe_resp_interval: Unsolicited broadcast probe response -+ * interval. - */ - struct ieee80211_bss_conf { - const u8 *bssid; -@@ -691,6 +711,8 @@ struct ieee80211_bss_conf { - struct ieee80211_he_cap_elem he_cap_elem; - struct cfg80211_he_bss_color he_bss_color; - bool nss_ap_isolate; -+ struct ieee80211_fils_discovery fils_discovery; -+ u32 unsol_bcast_probe_resp_interval; - }; - - /** -@@ -1261,7 +1283,7 @@ ieee80211_tx_info_clear_status(struct ie - * @RX_FLAG_AMPDU_EOF_BIT_KNOWN: The EOF value is known - * @RX_FLAG_RADIOTAP_HE: HE radiotap data is present - * (&struct ieee80211_radiotap_he, mac80211 will fill in -- * -+ * - * - DATA3_DATA_MCS - * - DATA3_DATA_DCM - * - DATA3_CODING -@@ -1269,7 +1291,7 @@ ieee80211_tx_info_clear_status(struct ie - * - DATA5_DATA_BW_RU_ALLOC - * - DATA6_NSTS - * - DATA3_STBC -- * -+ * - * from the RX info data, so leave those zeroed when building this data) - * @RX_FLAG_RADIOTAP_HE_MU: HE MU radiotap data is present - * (&struct ieee80211_radiotap_he_mu) -@@ -6640,4 +6662,30 @@ void ieee80211_update_muedca_params(stru - struct ieee80211_mu_edca_param_set - *params); - -+/** -+ * ieee80211_get_fils_discovery_tmpl - Get FILS discovery template. -+ * @hw: pointer obtained from ieee80211_alloc_hw(). -+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. -+ * -+ * The driver is responsible for freeing the returned skb. -+ * -+ * Return: FILS discovery template. %NULL on error. -+ */ -+struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif); -+ -+/** -+ * ieee80211_get_unsol_bcast_probe_resp_tmpl - Get unsolicited broadcast -+ * probe response template. -+ * @hw: pointer obtained from ieee80211_alloc_hw(). -+ * @vif: &struct ieee80211_vif pointer from the add_interface callback. -+ * -+ * The driver is responsible for freeing the returned skb. -+ * -+ * Return: Unsolicited broadcast probe response template. %NULL on error. -+ */ -+struct sk_buff * -+ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif); -+ - #endif /* MAC80211_H */ + /* +diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h +index 595236ab60c7..7bc93188e647 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2524,6 +2524,14 @@ enum nl80211_commands { - * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the - * %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. +@@ -1186,6 +1186,14 @@ + * This event is used to update dynamic MU-EDCA parameters in Beacon frame, + * coming from driver and now need to be reflected in Beacon frame. * -+ * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS -+ * discovery. It is a nested attribute, see -+ * &enum nl80211_fils_discovery_attributes. ++ *@NL80211_CMD_SET_FILS_DISCOVERY: Set FILS discovery transmission parameters. ++ * Inputs to the command are provided using the attribute ++ * %NL80211_ATTR_FILS_DISCOVERY. + * -+ * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure -+ * unsolicited broadcast probe response. It is a nested attribute, see -+ * &enum nl80211_unsol_bcast_probe_resp_attributes. ++ *@NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP: Set unsolicited broadcast ++ * probe response transmission parameters. Inputs to the command are ++ * provided using the attribute %NL80211_ATTR_UNSOL_BCAST_PROBE_RESP. + * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3007,6 +3015,11 @@ enum nl80211_attrs { - NL80211_ATTR_HE_6GHZ_CAPABILITY, + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1420,6 +1428,9 @@ enum nl80211_commands { - NL80211_ATTR_HE_MUEDCA_PARAMS, -+ -+ NL80211_ATTR_FILS_DISCOVERY, -+ -+ NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, -+ - /* add attributes here, update the policy in nl80211.c */ + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, - __NL80211_ATTR_AFTER_LAST, -@@ -7017,4 +7030,61 @@ enum nl80211_iftype_akm_attributes { - NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, - }; ++ NL80211_CMD_SET_FILS_DISCOVERY, ++ NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, ++ + /* add new commands above here */ -+/** -+ * enum nl80211_fils_discovery_attributes - FILS discovery configuration -+ * from IEEE Std 802.11ai-2016, Annex C.3 MIB detail. -+ * -+ * @__NL80211_FILS_DISCOVERY_INVALID: Invalid -+ * -+ * @NL80211_FILS_DISCOVERY_INT_MIN: Minimum packet interval (u32, TU). -+ * Allowed range: 0..10000 (TU = Time Unit) -+ * @NL80211_FILS_DISCOVERY_INT_MAX: Maximum packet interval (u32, TU). -+ * Allowed range: 0..10000 (TU = Time Unit) -+ * @NL80211_FILS_DISCOVERY_TMPL: Optional FILS discovery template. -+ * It has contents of IEEE Std 802.11ai-2016 9.6.8.36 FILS discovery frame -+ * (Figure 9-687a). -+ * It may include 6GHz specific data specified in IEEE P802.11ax/D6.0, -+ * 9.6.7.36 FILS Discovery frame format. -+ * -+ * @__NL80211_FILS_DISCOVERY_LAST: Internal -+ * @NL80211_FILS_DISCOVERY_MAX: highest attribute -+ */ -+enum nl80211_fils_discovery_attributes { -+ __NL80211_FILS_DISCOVERY_INVALID, -+ -+ NL80211_FILS_DISCOVERY_INT_MIN, -+ NL80211_FILS_DISCOVERY_INT_MAX, -+ NL80211_FILS_DISCOVERY_TMPL, -+ -+ /* keep last */ -+ __NL80211_FILS_DISCOVERY_LAST, -+ NL80211_FILS_DISCOVERY_MAX = __NL80211_FILS_DISCOVERY_LAST - 1 -+}; -+ -+/** -+ * enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe -+ * response configuration. Applicable only in 6GHz. -+ * -+ * @__NL80211_UNSOL_BCAST_PROBE_RESP_INVALID: Invalid -+ * -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_INT: Maximum packet interval (u32, TU). -+ * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0 -+ * 26.17.2.3.2 (AP behavior for fast passive scanning. -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_TMPL: Unsolicited broadcast probe response -+ * frame template (binary). -+ * -+ * @__NL80211_UNSOL_BCAST_PROBE_RESP_LAST: Internal -+ * @NL80211_UNSOL_BCAST_PROBE_RESP_MAX: highest attribute -+ */ -+enum nl80211_unsol_bcast_probe_resp_attributes { -+ __NL80211_UNSOL_BCAST_PROBE_RESP_INVALID, -+ -+ NL80211_UNSOL_BCAST_PROBE_RESP_INT, -+ NL80211_UNSOL_BCAST_PROBE_RESP_TMPL, -+ -+ /* keep last */ -+ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST, -+ NL80211_UNSOL_BCAST_PROBE_RESP_MAX = -+ __NL80211_UNSOL_BCAST_PROBE_RESP_LAST - 1 -+}; - #endif /* __LINUX_NL80211_H */ + /* used to define NL80211_CMD_MAX below */ +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index 868227717f34..d56a16a7b3fa 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -838,6 +838,59 @@ static int ieee80211_set_probe_resp(stru +@@ -839,11 +839,13 @@ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata, return 0; } -+static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata, -+ struct cfg80211_fils_discovery *params) -+{ -+ struct fils_discovery_data *new, *old = NULL; -+ struct ieee80211_fils_discovery *fd; +-static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata, ++static int ieee80211_set_fils_discovery(struct wiphy *wiphy, ++ struct net_device *dev, + struct cfg80211_fils_discovery *params) + { + struct fils_discovery_data *new, *old = NULL; + struct ieee80211_fils_discovery *fd; ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + if (!params->tmpl || !params->tmpl_len) + return -EINVAL; +@@ -863,18 +865,23 @@ static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata, + if (old) + kfree_rcu(old, rcu_head); + ++ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_FILS_DISCOVERY); + return 0; + } + + static int +-ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata, ++ieee80211_set_unsol_bcast_probe_resp(struct wiphy *wiphy, ++ struct net_device *dev, + struct cfg80211_unsol_bcast_probe_resp *params) + { + struct unsol_bcast_probe_resp_data *new, *old = NULL; ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + if (!params->tmpl || !params->tmpl_len) + return -EINVAL; + ++ sdata->vif.bss_conf.unsol_bcast_probe_resp_interval = params->interval; + -+ fd = &sdata->vif.bss_conf.fils_discovery; -+ fd->min_interval = params->min_interval; -+ fd->max_interval = params->max_interval; -+ -+ if (!params->tmpl || !params->tmpl_len) /* Optional template */ -+ return 0; -+ -+ old = sdata_dereference(sdata->u.ap.fils_discovery, sdata); -+ new = kzalloc(sizeof(*new) + params->tmpl_len, GFP_KERNEL); -+ if (!new) -+ return -ENOMEM; -+ new->len = params->tmpl_len; -+ memcpy(new->data, params->tmpl, params->tmpl_len); -+ rcu_assign_pointer(sdata->u.ap.fils_discovery, new); -+ -+ if (old) -+ kfree_rcu(old, rcu_head); -+ -+ return 0; -+} -+ -+static int -+ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata, -+ struct cfg80211_unsol_bcast_probe_resp *params) -+{ -+ struct unsol_bcast_probe_resp_data *new, *old = NULL; -+ -+ sdata->vif.bss_conf.unsol_bcast_probe_resp_interval = -+ params->interval; -+ -+ if (!params->tmpl || !params->tmpl_len) /* Optional template */ -+ return 0; -+ -+ old = sdata_dereference(sdata->u.ap.unsol_bcast_probe_resp, sdata); -+ new = kzalloc(sizeof(*new) + params->tmpl_len, GFP_KERNEL); -+ if (!new) -+ return -ENOMEM; -+ new->len = params->tmpl_len; -+ memcpy(new->data, params->tmpl, params->tmpl_len); -+ rcu_assign_pointer(sdata->u.ap.unsol_bcast_probe_resp, new); -+ -+ if (old) -+ kfree_rcu(old, rcu_head); -+ -+ return 0; -+} -+ - static int ieee80211_set_ftm_responder_params( - struct ieee80211_sub_if_data *sdata, - const u8 *lci, size_t lci_len, -@@ -1111,6 +1164,23 @@ static int ieee80211_start_ap(struct wip - } + old = sdata_dereference(sdata->u.ap.unsol_bcast_probe_resp, sdata); + new = kzalloc(sizeof(*new) + params->tmpl_len, GFP_KERNEL); + if (!new) +@@ -886,8 +893,7 @@ ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata, + if (old) + kfree_rcu(old, rcu_head); + +- sdata->vif.bss_conf.unsol_bcast_probe_resp_interval = +- params->interval; ++ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_UNSOL_BCAST_PROBE_RESP); + + return 0; + } +@@ -1166,22 +1172,6 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, + goto error; changed |= err; -+ err = ieee80211_set_fils_discovery(sdata, ¶ms->fils_discovery); -+ if (err < 0) { -+ ieee80211_vif_release_channel(sdata); -+ return err; -+ } else if (err == 0) { -+ changed |= BSS_CHANGED_FILS_DISCOVERY; -+ } -+ -+ err = ieee80211_set_unsol_bcast_probe_resp(sdata, -+ ¶ms->unsol_bcast_probe_resp); -+ if (err < 0) { -+ ieee80211_vif_release_channel(sdata); -+ return err; -+ } else if (err == 0) { -+ changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP; -+ } -+ +- if (params->fils_discovery.max_interval) { +- err = ieee80211_set_fils_discovery(sdata, +- ¶ms->fils_discovery); +- if (err < 0) +- goto error; +- changed |= BSS_CHANGED_FILS_DISCOVERY; +- } +- +- if (params->unsol_bcast_probe_resp.interval) { +- err = ieee80211_set_unsol_bcast_probe_resp(sdata, +- ¶ms->unsol_bcast_probe_resp); +- if (err < 0) +- goto error; +- changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP; +- } +- err = drv_start_ap(sdata->local, sdata); if (err) { old = sdata_dereference(sdata->u.ap.beacon, sdata); -@@ -1166,6 +1236,8 @@ static int ieee80211_stop_ap(struct wiph - struct ieee80211_local *local = sdata->local; - struct beacon_data *old_beacon; - struct probe_resp *old_probe_resp; -+ struct fils_discovery_data *old_fils_discovery; -+ struct unsol_bcast_probe_resp_data *old_unsol_bcast_probe_resp; - struct cfg80211_chan_def chandef; - - sdata_assert_lock(sdata); -@@ -1174,6 +1246,11 @@ static int ieee80211_stop_ap(struct wiph - if (!old_beacon) - return -ENOENT; - old_probe_resp = sdata_dereference(sdata->u.ap.probe_resp, sdata); -+ old_fils_discovery = sdata_dereference(sdata->u.ap.fils_discovery, -+ sdata); -+ old_unsol_bcast_probe_resp = -+ sdata_dereference(sdata->u.ap.unsol_bcast_probe_resp, -+ sdata); - - /* abort any running channel switch */ - mutex_lock(&local->mtx); -@@ -1197,9 +1274,15 @@ static int ieee80211_stop_ap(struct wiph - /* remove beacon and probe response */ - RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); - RCU_INIT_POINTER(sdata->u.ap.probe_resp, NULL); -+ RCU_INIT_POINTER(sdata->u.ap.fils_discovery, NULL); -+ RCU_INIT_POINTER(sdata->u.ap.unsol_bcast_probe_resp, NULL); - kfree_rcu(old_beacon, rcu_head); - if (old_probe_resp) - kfree_rcu(old_probe_resp, rcu_head); -+ if (old_fils_discovery) -+ kfree_rcu(old_fils_discovery, rcu_head); -+ if (old_unsol_bcast_probe_resp) -+ kfree_rcu(old_unsol_bcast_probe_resp, rcu_head); - - kfree(sdata->vif.bss_conf.ftmr_params); - sdata->vif.bss_conf.ftmr_params = NULL; ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -271,6 +271,18 @@ struct probe_resp { - u8 data[]; +@@ -4206,4 +4196,6 @@ const struct cfg80211_ops mac80211_config_ops = { + .set_tid_config = ieee80211_set_tid_config, + .reset_tid_config = ieee80211_reset_tid_config, + .set_sar_specs = ieee80211_set_sar_specs, ++ .set_fils_discovery = ieee80211_set_fils_discovery, ++ .set_unsol_bcast_probe_resp = ieee80211_set_unsol_bcast_probe_resp, }; - -+struct fils_discovery_data { -+ struct rcu_head rcu_head; -+ int len; -+ u8 data[]; -+}; -+ -+struct unsol_bcast_probe_resp_data { -+ struct rcu_head rcu_head; -+ int len; -+ u8 data[]; -+}; -+ - struct ps_data { - /* yes, this looks ugly, but guarantees that we can later use - * bitmap_empty :) -@@ -286,6 +298,8 @@ struct ps_data { - struct ieee80211_if_ap { - struct beacon_data __rcu *beacon; - struct probe_resp __rcu *probe_resp; -+ struct fils_discovery_data __rcu *fils_discovery; -+ struct unsol_bcast_probe_resp_data __rcu *unsol_bcast_probe_resp; - - /* to be used after channel switch. */ - struct cfg80211_beacon_data *next_beacon; ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -5011,6 +5011,57 @@ out: - } - EXPORT_SYMBOL(ieee80211_proberesp_get); - -+struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif) -+{ -+ struct sk_buff *skb = NULL; -+ struct fils_discovery_data *tmpl = NULL; -+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); -+ -+ if (sdata->vif.type != NL80211_IFTYPE_AP) -+ return NULL; -+ -+ rcu_read_lock(); -+ tmpl = rcu_dereference(sdata->u.ap.fils_discovery); -+ if (!tmpl) { -+ rcu_read_unlock(); -+ return NULL; -+ } -+ -+ skb = dev_alloc_skb(tmpl->len); -+ if (skb) -+ skb_put_data(skb, tmpl->data, tmpl->len); -+ rcu_read_unlock(); -+ return skb; -+} -+EXPORT_SYMBOL(ieee80211_get_fils_discovery_tmpl); -+ -+struct sk_buff * -+ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif) -+{ -+ struct sk_buff *skb = NULL; -+ struct unsol_bcast_probe_resp_data *tmpl = NULL; -+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); -+ -+ if (sdata->vif.type != NL80211_IFTYPE_AP) -+ return NULL; -+ -+ rcu_read_lock(); -+ tmpl = rcu_dereference(sdata->u.ap.unsol_bcast_probe_resp); -+ if (!tmpl) { -+ rcu_read_unlock(); -+ return NULL; -+ } -+ -+ skb = dev_alloc_skb(tmpl->len); -+ if (skb) -+ skb_put_data(skb, tmpl->data, tmpl->len); -+ rcu_read_unlock(); -+ return skb; -+} -+EXPORT_SYMBOL(ieee80211_get_unsol_bcast_probe_resp_tmpl); -+ - struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, - struct ieee80211_vif *vif) - { +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 24f985b77d59..a3947d85edae 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -441,6 +441,21 @@ nl80211_tid_config_attr_policy[NL80211_T - NLA_POLICY_NESTED(nl80211_txattr_policy), +@@ -410,9 +410,13 @@ nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = { + [NL80211_FILS_DISCOVERY_ATTR_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000), + [NL80211_FILS_DISCOVERY_ATTR_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000), + #if LINUX_VERSION_IS_GEQ(5,10,0) +- NLA_POLICY_RANGE(NLA_BINARY, +- NL80211_FILS_DISCOVERY_TMPL_MIN_LEN, +- IEEE80211_MAX_DATA_LEN), ++ [NL80211_FILS_DISCOVERY_ATTR_TMPL] = ++ NLA_POLICY_RANGE(NLA_BINARY, ++ NL80211_FILS_DISCOVERY_TMPL_MIN_LEN, ++ IEEE80211_MAX_DATA_LEN), ++#else ++ [NL80211_FILS_DISCOVERY_ATTR_TMPL] = { .type = NLA_BINARY, ++ .len = IEEE80211_MAX_DATA_LEN } + #endif }; -+static const struct nla_policy -+fils_discovery_policy[NL80211_FILS_DISCOVERY_MAX + 1] = { -+ [NL80211_FILS_DISCOVERY_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000), -+ [NL80211_FILS_DISCOVERY_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000), -+ [NL80211_FILS_DISCOVERY_TMPL] = { .type = NLA_BINARY, -+ .len = IEEE80211_MAX_DATA_LEN } -+}; -+ -+static const struct nla_policy -+unsol_bcast_probe_resp_policy[NL80211_UNSOL_BCAST_PROBE_RESP_MAX + 1] = { -+ [NL80211_UNSOL_BCAST_PROBE_RESP_INT] = NLA_POLICY_MAX(NLA_U32, 20), -+ [NL80211_UNSOL_BCAST_PROBE_RESP_TMPL] = { .type = NLA_BINARY, -+ .len = IEEE80211_MAX_DATA_LEN } -+}; -+ - static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { - [0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD }, - [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, -@@ -739,6 +754,10 @@ static const struct nla_policy nl80211_p - .type = NLA_EXACT_LEN, - .len = sizeof(struct ieee80211_he_6ghz_capa), - }, -+ [NL80211_ATTR_FILS_DISCOVERY] = -+ NLA_POLICY_NESTED(fils_discovery_policy), -+ [NL80211_ATTR_UNSOL_BCAST_PROBE_RESP] = -+ NLA_POLICY_NESTED(unsol_bcast_probe_resp_policy), - }; - - /* policy for the key attributes */ -@@ -854,6 +873,7 @@ nl80211_bss_select_policy[NL80211_BSS_SE - [NL80211_BSS_SELECT_ATTR_RSSI_ADJUST] = { - .len = sizeof(struct nl80211_bss_select_rssi_adjust) - }, -+ - }; - - /* policy for NAN function attributes */ -@@ -4837,6 +4857,64 @@ static int nl80211_parse_he_bss_color(st +@@ -5125,19 +5129,24 @@ static int nl80211_parse_he_bss_color(struct nlattr *attrs, return 0; } -+static int nl80211_parse_fils_discovery(struct nlattr *attrs, -+ struct cfg80211_ap_settings *params) -+{ -+ struct nlattr *tmpl; -+ struct nlattr *tb[NL80211_FILS_DISCOVERY_MAX + 1]; -+ int ret; -+ struct cfg80211_fils_discovery *fd = ¶ms->fils_discovery; -+ -+ ret = nla_parse_nested(tb, NL80211_FILS_DISCOVERY_MAX, attrs, -+ fils_discovery_policy, NULL); -+ if (ret) -+ return ret; -+ -+ if (!tb[NL80211_FILS_DISCOVERY_INT_MIN] || -+ !tb[NL80211_FILS_DISCOVERY_INT_MAX]) -+ return -EINVAL; -+ -+ fd->min_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_INT_MIN]); -+ fd->max_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_INT_MAX]); -+ -+ tmpl = tb[NL80211_FILS_DISCOVERY_TMPL]; -+ if (tmpl) { -+ fd->tmpl = nla_data(tmpl); -+ fd->tmpl_len = nla_len(tmpl); -+ } -+ -+ return 0; -+} -+ -+static int -+nl80211_parse_unsol_bcast_probe_resp(struct nlattr *attrs, -+ struct cfg80211_ap_settings *params) -+{ -+ struct nlattr *tmpl; -+ struct nlattr *tb[NL80211_UNSOL_BCAST_PROBE_RESP_MAX + 1]; -+ int ret; -+ struct cfg80211_unsol_bcast_probe_resp *presp = -+ ¶ms->unsol_bcast_probe_resp; -+ -+ ret = nla_parse_nested(tb, NL80211_UNSOL_BCAST_PROBE_RESP_MAX, attrs, -+ unsol_bcast_probe_resp_policy, NULL); -+ if (ret) -+ return ret; -+ -+ if (!tb[NL80211_UNSOL_BCAST_PROBE_RESP_INT]) -+ return -EINVAL; -+ -+ presp->interval = nla_get_u32(tb[NL80211_UNSOL_BCAST_PROBE_RESP_INT]); -+ -+ tmpl = tb[NL80211_UNSOL_BCAST_PROBE_RESP_TMPL]; -+ if (tmpl) { -+ presp->tmpl = nla_data(tmpl); -+ presp->tmpl_len = nla_len(tmpl); -+ } -+ -+ return 0; -+} -+ - static void nl80211_check_ap_rate_selectors(struct cfg80211_ap_settings *params, - const u8 *rates) +-static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev, +- struct nlattr *attrs, +- struct cfg80211_ap_settings *params) ++static int nl80211_set_fils_discovery(struct sk_buff *skb, ++ struct genl_info *info) { -@@ -5145,6 +5223,21 @@ static int nl80211_start_ap(struct sk_bu + struct nlattr *tb[NL80211_FILS_DISCOVERY_ATTR_MAX + 1]; ++ struct cfg80211_registered_device *rdev = info->user_ptr[0]; ++ struct net_device *dev = info->user_ptr[1]; ++ struct wireless_dev *wdev = dev->ieee80211_ptr; ++ struct cfg80211_fils_discovery fd = { 0 }; + int ret; +- struct cfg80211_fils_discovery *fd = ¶ms->fils_discovery; + +- if (!wiphy_ext_feature_isset(&rdev->wiphy, +- NL80211_EXT_FEATURE_FILS_DISCOVERY)) +- return -EINVAL; ++ if (!rdev->ops->set_fils_discovery || ++ !wiphy_ext_feature_isset(&rdev->wiphy, ++ NL80211_EXT_FEATURE_FILS_DISCOVERY)) { ++ return -EOPNOTSUPP; ++ } + +- ret = nla_parse_nested(tb, NL80211_FILS_DISCOVERY_ATTR_MAX, attrs, ++ ret = nla_parse_nested(tb, NL80211_FILS_DISCOVERY_ATTR_MAX, ++ info->attrs[NL80211_ATTR_FILS_DISCOVERY], + NULL, NULL); + if (ret) + return ret; +@@ -5147,30 +5156,36 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev, + !tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]) + return -EINVAL; + +- fd->tmpl_len = nla_len(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]); +- fd->tmpl = nla_data(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]); +- fd->min_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN]); +- fd->max_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX]); ++ fd.tmpl_len = nla_len(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]); ++ fd.tmpl = nla_data(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]); ++ fd.min_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN]); ++ fd.max_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX]); + +- return 0; ++ wdev_lock(wdev); ++ ret = rdev_set_fils_discovery(rdev, dev, &fd); ++ wdev_unlock(wdev); ++ ++ return ret; + } + + static int +-nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, +- struct nlattr *attrs, +- struct cfg80211_ap_settings *params) ++nl80211_set_unsol_bcast_probe_resp(struct sk_buff *skb, struct genl_info *info) + { ++ struct cfg80211_registered_device *rdev = info->user_ptr[0]; ++ struct net_device *dev = info->user_ptr[1]; ++ struct wireless_dev *wdev = dev->ieee80211_ptr; ++ struct cfg80211_unsol_bcast_probe_resp params = { 0 }; + struct nlattr *tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX + 1]; + int ret; +- struct cfg80211_unsol_bcast_probe_resp *presp = +- ¶ms->unsol_bcast_probe_resp; + +- if (!wiphy_ext_feature_isset(&rdev->wiphy, ++ if (!rdev->ops->set_unsol_bcast_probe_resp || ++ !wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP)) +- return -EINVAL; ++ return -EOPNOTSUPP; + + ret = nla_parse_nested(tb, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX, +- attrs, NULL, NULL); ++ info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], ++ NULL, NULL); + if (ret) + return ret; + +@@ -5178,9 +5193,14 @@ nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, + !tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]) + return -EINVAL; + +- presp->tmpl = nla_data(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); +- presp->tmpl_len = nla_len(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); +- presp->interval = nla_get_u32(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT]); ++ params.tmpl = nla_data(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); ++ params.tmpl_len = nla_len(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); ++ params.interval = nla_get_u32(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT]); ++ ++ wdev_lock(wdev); ++ ret = rdev_set_unsol_bcast_probe_resp(rdev, dev, ¶ms); ++ wdev_unlock(wdev); ++ + return 0; + } + +@@ -5495,22 +5515,6 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) goto out; } -+ if (info->attrs[NL80211_ATTR_FILS_DISCOVERY]) { -+ err = nl80211_parse_fils_discovery(info->attrs[NL80211_ATTR_FILS_DISCOVERY], -+ ¶ms); -+ if (err) -+ return err; -+ } -+ -+ if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { -+ err = nl80211_parse_unsol_bcast_probe_resp( -+ info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], -+ ¶ms); -+ if (err) -+ return err; -+ } -+ +- if (info->attrs[NL80211_ATTR_FILS_DISCOVERY]) { +- err = nl80211_parse_fils_discovery(rdev, +- info->attrs[NL80211_ATTR_FILS_DISCOVERY], +- ¶ms); +- if (err) +- goto out; +- } +- +- if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { +- err = nl80211_parse_unsol_bcast_probe_resp( +- rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], +- ¶ms); +- if (err) +- return err; +- } +- nl80211_calculate_ap_params(¶ms); if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) +@@ -15835,6 +15839,22 @@ static const struct genl_small_ops nl80211_small_ops[] = { + .internal_flags = NL80211_FLAG_NEED_WIPHY | + NL80211_FLAG_NEED_RTNL, + }, ++ { ++ .cmd = NL80211_CMD_SET_FILS_DISCOVERY, ++ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, ++ .doit = nl80211_set_fils_discovery, ++ .flags = GENL_UNS_ADMIN_PERM, ++ .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | ++ NL80211_FLAG_NEED_RTNL, ++ }, ++ { ++ .cmd = NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, ++ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, ++ .doit = nl80211_set_unsol_bcast_probe_resp, ++ .flags = GENL_UNS_ADMIN_PERM, ++ .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | ++ NL80211_FLAG_NEED_RTNL, ++ }, + }; + + static struct genl_family nl80211_fam __genl_ro_after_init = { +diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h +index 050953f363ec..e4fe9cccc315 100644 +--- a/net/wireless/rdev-ops.h ++++ b/net/wireless/rdev-ops.h +@@ -1358,4 +1358,28 @@ static inline int rdev_set_sar_specs(struct cfg80211_registered_device *rdev, + return ret; + } + ++static inline int rdev_set_fils_discovery(struct cfg80211_registered_device *rdev, ++ struct net_device *dev, ++ struct cfg80211_fils_discovery *params) ++{ ++ int ret; ++ ++ trace_rdev_set_fils_discovery(&rdev->wiphy, dev, params); ++ ret = rdev->ops->set_fils_discovery(&rdev->wiphy, dev, params); ++ trace_rdev_return_int(&rdev->wiphy, ret); ++ return ret; ++} ++ ++static inline int rdev_set_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, ++ struct net_device *dev, ++ struct cfg80211_unsol_bcast_probe_resp *params) ++{ ++ int ret; ++ ++ trace_rdev_set_unsol_bcast_probe_resp(&rdev->wiphy, dev, params); ++ ret = rdev->ops->set_unsol_bcast_probe_resp(&rdev->wiphy, dev, params); ++ trace_rdev_return_int(&rdev->wiphy, ret); ++ return ret; ++} ++ + #endif /* __CFG80211_RDEV_OPS */ +diff --git a/net/wireless/trace.h b/net/wireless/trace.h +index 0a3bcc9ddace..ad2cec67ae86 100644 +--- a/net/wireless/trace.h ++++ b/net/wireless/trace.h +@@ -3565,6 +3565,53 @@ TRACE_EVENT(rdev_set_sar_specs, + WIPHY_PR_ARG, __entry->type, __entry->num) + ); + ++TRACE_EVENT(rdev_set_fils_discovery, ++ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, ++ struct cfg80211_fils_discovery *params), ++ TP_ARGS(wiphy, netdev, params), ++ TP_STRUCT__entry( ++ WIPHY_ENTRY ++ NETDEV_ENTRY ++ __field(u32, min_interval) ++ __field(u32, max_interval) ++ __field(size_t, tmpl_len) ++ ), ++ TP_fast_assign( ++ WIPHY_ASSIGN; ++ NETDEV_ASSIGN; ++ __entry->min_interval = params->min_interval; ++ __entry->max_interval = params->max_interval; ++ __entry->tmpl_len = params->tmpl_len; ++ ), ++ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ++ ", minimum interval: %u, maximum interval: %u, template length: %zu", ++ WIPHY_PR_ARG, NETDEV_PR_ARG, ++ __entry->min_interval, __entry->max_interval, ++ __entry->tmpl_len) ++); ++ ++TRACE_EVENT(rdev_set_unsol_bcast_probe_resp, ++ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, ++ struct cfg80211_unsol_bcast_probe_resp *params), ++ TP_ARGS(wiphy, netdev, params), ++ TP_STRUCT__entry( ++ WIPHY_ENTRY ++ NETDEV_ENTRY ++ __field(u32, interval) ++ __field(size_t, tmpl_len) ++ ), ++ TP_fast_assign( ++ WIPHY_ASSIGN; ++ NETDEV_ASSIGN; ++ __entry->interval = params->interval; ++ __entry->tmpl_len = params->tmpl_len; ++ ), ++ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ++ ", interval: %u, template length: %zu", ++ WIPHY_PR_ARG, NETDEV_PR_ARG, ++ __entry->interval, __entry->tmpl_len) ++); ++ + #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */ + + #undef TRACE_INCLUDE_PATH +-- +2.25.0 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/205-0001-nl80211-add-basic-multiple-bssid-support.patch b/feeds/wifi-ax/mac80211/patches/qca/205-0001-nl80211-add-basic-multiple-bssid-support.patch index c1372e4a7..21720de2c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/205-0001-nl80211-add-basic-multiple-bssid-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/205-0001-nl80211-add-basic-multiple-bssid-support.patch @@ -1,4 +1,4 @@ -From 75684a3621171f759a2ba0c44ae0f405178df56f Mon Sep 17 00:00:00 2001 +From 9a3e2346e01b569676a2c468063c5689d451e761 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 25 Aug 2020 00:10:23 -0700 Subject: [PATCH 1/9] nl80211: add basic multiple bssid support @@ -11,20 +11,19 @@ as an array. Signed-off-by: John Crispin --- - include/net/cfg80211.h | 35 +++++++++++++++++++++++++++++++ - include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++ - net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++ - 3 files changed, 97 insertions(+) + include/net/cfg80211.h | 35 +++++++++++++++++++++++++++++++++++ + include/uapi/linux/nl80211.h | 23 +++++++++++++++++++++++ + net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 98 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h -index b9f7a81293c1..f509b770175f 100644 +index 71d6a6c..240108e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -455,6 +455,21 @@ struct ieee80211_supported_band { - const struct ieee80211_sband_iftype_data *iftype_data; +@@ -488,6 +488,21 @@ struct ieee80211_supported_band { }; -+/** + /** + * struct ieee80211_multiple_bssid - AP settings for multi bssid + * + * @index: the index of this AP in the multi bssid group. @@ -39,10 +38,11 @@ index b9f7a81293c1..f509b770175f 100644 + bool non_transmitted; +}; + - /** ++/** * ieee80211_get_sband_iftype_data - return sband data for a given iftype * @sband: the sband to search for the STA on -@@ -599,6 +614,7 @@ static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy) + * @iftype: enum nl80211_iftype +@@ -631,6 +646,7 @@ static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy) * belonging to that MU-MIMO groupID; %NULL if not changed * @vht_mumimo_follow_addr: MU-MIMO follow address, used for monitoring * MU-MIMO packets going to the specified station; %NULL if not changed @@ -50,7 +50,7 @@ index b9f7a81293c1..f509b770175f 100644 */ struct vif_params { u32 flags; -@@ -606,6 +622,7 @@ struct vif_params { +@@ -638,6 +654,7 @@ struct vif_params { u8 macaddr[ETH_ALEN]; const u8 *vht_mumimo_groups; const u8 *vht_mumimo_follow_addr; @@ -58,11 +58,10 @@ index b9f7a81293c1..f509b770175f 100644 }; /** -@@ -986,6 +1003,19 @@ struct cfg80211_crypto_settings { - u8 sae_pwd_len; +@@ -1035,6 +1052,19 @@ struct cfg80211_crypto_settings { }; -+/** + /** + * struct cfg80211_multiple_bssid_data - multiple_bssid data + * @ies: array of extra information element(s) to add into Beacon frames for multiple + * bssid or %NULL @@ -75,10 +74,11 @@ index b9f7a81293c1..f509b770175f 100644 + int cnt; +}; + - /** ++/** * struct cfg80211_beacon_data - beacon data * @head: head portion of beacon (before TIM IE) -@@ -1012,6 +1042,7 @@ struct cfg80211_crypto_settings { + * or %NULL if not changed +@@ -1060,6 +1090,7 @@ struct cfg80211_crypto_settings { * Token (measurement type 11) * @lci_len: LCI data length * @civicloc_len: Civic location data length @@ -86,7 +86,7 @@ index b9f7a81293c1..f509b770175f 100644 */ struct cfg80211_beacon_data { const u8 *head, *tail; -@@ -1030,6 +1061,8 @@ struct cfg80211_beacon_data { +@@ -1078,6 +1109,8 @@ struct cfg80211_beacon_data { size_t probe_resp_len; size_t lci_len; size_t civicloc_len; @@ -95,29 +95,29 @@ index b9f7a81293c1..f509b770175f 100644 }; struct mac_address { -@@ -1134,6 +1167,7 @@ enum cfg80211_ap_settings_flags { +@@ -1181,6 +1214,7 @@ enum cfg80211_ap_settings_flags { + * @he_obss_pd: OBSS Packet Detection settings + * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) - * @fils_discovery: FILS discovery transmission parameters - * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameter + * @multiple_bssid: AP settings for multiple bssid */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; -@@ -1166,6 +1200,7 @@ struct cfg80211_ap_settings { +@@ -1211,6 +1245,7 @@ struct cfg80211_ap_settings { + u32 flags; + struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; - struct cfg80211_fils_discovery fils_discovery; - struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; + struct ieee80211_multiple_bssid multiple_bssid; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h -index 30e2b3726a52..d09aab5377a1 100644 +index 7bc9318..835ae03 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2522,6 +2522,20 @@ enum nl80211_commands { - * unsolicited broadcast probe response. It is a nested attribute, see - * &enum nl80211_unsol_bcast_probe_resp_attributes. +@@ -2577,6 +2577,20 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + * %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. * + * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this + * BSSIDs beacon. @@ -136,10 +136,11 @@ index 30e2b3726a52..d09aab5377a1 100644 * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3010,6 +3024,12 @@ enum nl80211_attrs { - - NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, +@@ -3075,6 +3089,13 @@ enum nl80211_attrs { + NL80211_ATTR_DISABLE_HE, + NL80211_ATTR_HE_MUEDCA_PARAMS, ++ + NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING, + NL80211_ATTR_MULTIPLE_BSSID_PARENT, + NL80211_ATTR_MULTIPLE_BSSID_INDEX, @@ -149,7 +150,7 @@ index 30e2b3726a52..d09aab5377a1 100644 /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -3071,6 +3091,8 @@ enum nl80211_attrs { +@@ -3138,6 +3159,8 @@ enum nl80211_attrs { #define NL80211_CQM_TXE_MAX_INTVL 1800 @@ -159,13 +160,13 @@ index 30e2b3726a52..d09aab5377a1 100644 * enum nl80211_iftype - (virtual) interface types * diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c -index d63aeb9dfe64..17e0d3ec622b 100644 +index ab8fc60..f7ec308 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -758,6 +758,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { - NLA_POLICY_NESTED(fils_discovery_policy), - [NL80211_ATTR_UNSOL_BCAST_PROBE_RESP] = - NLA_POLICY_NESTED(unsol_bcast_probe_resp_policy), +@@ -773,6 +773,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { + [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, + [NL80211_ATTR_SAR_SPEC] = NLA_POLICY_NESTED(sar_policy), + [NL80211_ATTR_DISABLE_HE] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, @@ -174,7 +175,7 @@ index d63aeb9dfe64..17e0d3ec622b 100644 }; /* policy for the key attributes */ -@@ -3857,6 +3862,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) +@@ -3986,6 +3991,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) return err; } @@ -189,7 +190,7 @@ index d63aeb9dfe64..17e0d3ec622b 100644 if (!cfg80211_iftype_allowed(&rdev->wiphy, type, params.use_4addr, 0)) return -EOPNOTSUPP; -@@ -4802,6 +4815,21 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev, +@@ -5055,6 +5068,21 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev, bcn->ftm_responder = -1; } @@ -211,8 +212,8 @@ index d63aeb9dfe64..17e0d3ec622b 100644 return 0; } -@@ -5237,6 +5265,18 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) - return err; +@@ -5512,6 +5540,18 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) + goto out; } + if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_INDEX]) @@ -231,10 +232,10 @@ index d63aeb9dfe64..17e0d3ec622b 100644 if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) -- -2.25.0 +2.7.4 -From 91823121198609ce8d289a06893bc11d3f6733d2 Mon Sep 17 00:00:00 2001 +From 3067f5de76b82f77799185ecd1a7f86409d06790 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 26 Aug 2020 10:49:48 -0700 Subject: [PATCH 2/9] mac80211: add multiple bssid support to interface @@ -251,27 +252,27 @@ Fixed Null pointer dereference. Signed-off-by: John Crispin Signed-off-by: Pradeep Kumar Chitrapu --- - include/net/mac80211.h | 13 +++++++++- - net/mac80211/cfg.c | 54 ++++++++++++++++++++++++++++++++++++++++++ + include/net/mac80211.h | 13 +++++++++++- + net/mac80211/cfg.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ net/mac80211/debugfs.c | 1 + - net/mac80211/iface.c | 7 ++++++ + net/mac80211/iface.c | 7 +++++++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h -index b2278cdb2c08..d5209130009c 100644 +index 2adb4bc..26530d0 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1682,6 +1682,9 @@ enum ieee80211_vif_flags { - * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) - * @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped, +@@ -1730,6 +1730,9 @@ enum ieee80211_offload_flags { * protected by fq->lock. + * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see + * &enum ieee80211_offload_flags. + * @multiple_bssid.parent: a non-transmitted bssid has a transmitted parent. + * @multiple_bssid.list: linked list for tracking parent - child relations. + * @multiple_bssid.non_transmitted: Is this a non-transmitted bssi */ struct ieee80211_vif { enum nl80211_iftype type; -@@ -1709,6 +1712,11 @@ struct ieee80211_vif { +@@ -1757,6 +1760,11 @@ struct ieee80211_vif { bool rx_mcast_action_reg; bool txqs_stopped[IEEE80211_NUM_ACS]; @@ -283,7 +284,7 @@ index b2278cdb2c08..d5209130009c 100644 /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); -@@ -2367,7 +2375,7 @@ struct ieee80211_txq { +@@ -2415,7 +2423,7 @@ struct ieee80211_txq { * @IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN: Driver does not report accurate A-MPDU * length in tx status information * @@ -292,7 +293,7 @@ index b2278cdb2c08..d5209130009c 100644 * * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set. -@@ -2378,6 +2386,8 @@ struct ieee80211_txq { +@@ -2435,6 +2443,8 @@ struct ieee80211_txq { * * @IEEE80211_HW_SUPPORTS_NSS_OFFLOAD: Hardware/driver supports NSS offload * @@ -301,16 +302,16 @@ index b2278cdb2c08..d5209130009c 100644 * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { -@@ -2431,6 +2441,7 @@ enum ieee80211_hw_flags { - IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, - IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, +@@ -2491,6 +2501,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD, + IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP, IEEE80211_HW_SUPPORTS_NSS_OFFLOAD, + IEEE80211_HW_SUPPORTS_MULTI_BSSID_AP, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c -index 4e8a8ac9c84b..62b53ee9c77a 100644 +index d56a16a..c9b0072 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -111,6 +111,36 @@ static int ieee80211_set_mon_options(struct ieee80211_sub_if_data *sdata, @@ -387,22 +388,22 @@ index 4e8a8ac9c84b..62b53ee9c77a 100644 return 0; diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c -index 60274d0c83c1..0c8c785a8df9 100644 +index 45849ce..59071d1 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c -@@ -409,6 +409,7 @@ static const char *hw_flag_names[] = { - FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), - FLAG(AMPDU_KEYBORDER_SUPPORT), +@@ -408,6 +408,7 @@ static const char *hw_flag_names[] = { + FLAG(SUPPORTS_RX_DECAP_OFFLOAD), + FLAG(SUPPORTS_CONC_MON_RX_DECAP), FLAG(SUPPORTS_NSS_OFFLOAD), + FLAG(SUPPORTS_MULTI_BSSID_AP), #undef FLAG }; diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index c2a5779839ed..55c9395f4f92 100644 +index 520455d..186c138 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -810,6 +810,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, +@@ -376,6 +376,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do bool cancel_scan; struct cfg80211_nan_func *func; @@ -417,10 +418,10 @@ index c2a5779839ed..55c9395f4f92 100644 cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; -- -2.25.0 +2.7.4 -From 83a12da29048b00c3160a12b1b73aadff43a6481 Mon Sep 17 00:00:00 2001 +From 1ab91aa3c291efb22a9feec070181156d00f4685 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 26 Aug 2020 10:54:07 -0700 Subject: [PATCH 3/9] mac80211: add multiple bssid support to beacon handling @@ -432,35 +433,35 @@ code paths. Signed-off-by: John Crispin --- include/net/mac80211.h | 2 ++ - net/mac80211/cfg.c | 59 ++++++++++++++++++++++++++++++++++++-- + net/mac80211/cfg.c | 59 +++++++++++++++++++++++++++++++++++++++++++--- net/mac80211/ieee80211_i.h | 1 + 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h -index d5209130009c..765e9de4b575 100644 +index 26530d0..20a835f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -642,6 +642,7 @@ struct ieee80211_fils_discovery { - * @fils_discovery: FILS discovery configuration - * @unsol_bcast_probe_resp_interval: Unsolicited broadcast probe response - * interval. -+ `* @multiple_bssid: the multiple bssid settings of the AP. +@@ -646,6 +646,7 @@ struct ieee80211_fils_discovery { + * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed + * to driver when rate control is offloaded to firmware. + * @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature ++ * @multiple_bssid: the multiple bssid settings of the AP. */ struct ieee80211_bss_conf { const u8 *bssid; -@@ -713,6 +714,7 @@ struct ieee80211_bss_conf { +@@ -717,6 +718,7 @@ struct ieee80211_bss_conf { + bool s1g; + struct cfg80211_bitrate_mask beacon_tx_rate; bool nss_ap_isolate; - struct ieee80211_fils_discovery fils_discovery; - u32 unsol_bcast_probe_resp_interval; + struct ieee80211_multiple_bssid multiple_bssid; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c -index 62b53ee9c77a..990787b90ba3 100644 +index c9b0072..15aa4ee 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -987,12 +987,38 @@ static int ieee80211_set_ftm_responder_params( +@@ -994,12 +994,38 @@ static int ieee80211_set_ftm_responder_params( return 0; } @@ -500,7 +501,7 @@ index 62b53ee9c77a..990787b90ba3 100644 int size, err; u32 changed = BSS_CHANGED_BEACON; -@@ -1016,7 +1042,15 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, +@@ -1023,7 +1049,15 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, else new_tail_len = old->tail_len; @@ -517,7 +518,7 @@ index 62b53ee9c77a..990787b90ba3 100644 new = kzalloc(size, GFP_KERNEL); if (!new) -@@ -1033,6 +1067,18 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, +@@ -1040,6 +1074,18 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, new->head_len = new_head_len; new->tail_len = new_tail_len; @@ -534,18 +535,18 @@ index 62b53ee9c77a..990787b90ba3 100644 + &old->multiple_bssid); + if (csa) { - new->csa_current_counter = csa->count; - memcpy(new->csa_counter_offsets, csa->counter_offsets_beacon, -@@ -1182,6 +1228,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, - sizeof(struct ieee80211_he_obss_pd)); - memcpy(&sdata->vif.bss_conf.he_bss_color, ¶ms->he_bss_color, - sizeof(struct ieee80211_he_bss_color)); + new->cntdwn_current_counter = csa->count; + memcpy(new->cntdwn_counter_offsets, csa->counter_offsets_beacon, +@@ -1191,6 +1237,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, + sdata->vif.bss_conf.he_bss_color = params->he_bss_color; + sdata->vif.bss_conf.s1g = params->chandef.chan->band == + NL80211_BAND_S1GHZ; + sdata->vif.bss_conf.multiple_bssid.count = params->multiple_bssid.count; + sdata->vif.bss_conf.multiple_bssid.index = params->multiple_bssid.index; sdata->vif.bss_conf.ssid_len = params->ssid_len; if (params->ssid_len) -@@ -3103,7 +3151,8 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) +@@ -3094,7 +3142,8 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) len = beacon->head_len + beacon->tail_len + beacon->beacon_ies_len + beacon->proberesp_ies_len + beacon->assocresp_ies_len + @@ -555,7 +556,7 @@ index 62b53ee9c77a..990787b90ba3 100644 new_beacon = kzalloc(sizeof(*new_beacon) + len, GFP_KERNEL); if (!new_beacon) -@@ -3146,6 +3195,10 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) +@@ -3137,6 +3186,10 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) memcpy(pos, beacon->probe_resp, beacon->probe_resp_len); pos += beacon->probe_resp_len; } @@ -567,22 +568,22 @@ index 62b53ee9c77a..990787b90ba3 100644 /* might copy -1, meaning no changes requested */ new_beacon->ftm_responder = beacon->ftm_responder; diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h -index 4ac2d24aaa75..5fa18a679114 100644 +index 27702fc..674b241 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -262,6 +262,7 @@ struct beacon_data { +@@ -265,6 +265,7 @@ struct beacon_data { struct ieee80211_meshconf_ie *meshconf; - u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; - u8 csa_current_counter; + u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; + u8 cntdwn_current_counter; + struct cfg80211_multiple_bssid_data multiple_bssid; struct rcu_head rcu_head; }; -- -2.25.0 +2.7.4 -From af57bc61b03173a359fae2a0cdc236008c626f0c Mon Sep 17 00:00:00 2001 +From 27172ed89ee48b5947b2936a04ab78ad572182fe Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 12 Aug 2020 14:58:08 +0200 Subject: [PATCH 4/9] mac80211: add multiple bssid/ema support to bcn @@ -595,18 +596,18 @@ events from the hardware. Signed-off-by: John Crispin --- - include/net/mac80211.h | 26 +++++++++++++++++++++ + include/net/mac80211.h | 26 +++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 1 + - net/mac80211/tx.c | 48 ++++++++++++++++++++++++++++++++++---- + net/mac80211/tx.c | 48 ++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h -index 765e9de4b575..5c8b73df2024 100644 +index 20a835f..d3bb1d1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -4837,12 +4837,16 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); - * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets - * to CSA counters. This array can contain zero values which +@@ -4923,12 +4923,16 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); + * @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets + * to countdown counters. This array can contain zero values which * should be ignored. + * @multiple_bssid_offset: position of the multiple bssid element + * @multiple_bssid_length: size of the multiple bssid element @@ -615,17 +616,16 @@ index 765e9de4b575..5c8b73df2024 100644 u16 tim_offset; u16 tim_length; - u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM]; + u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; + u16 multiple_bssid_offset; + u16 multiple_bssid_length; }; /** -@@ -4869,6 +4873,28 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, +@@ -4956,6 +4960,28 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, struct ieee80211_mutable_offsets *offs); -+/** + /** + * ieee80211_beacon_get_template - beacon template generation function + * @hw: pointer obtained from ieee80211_alloc_hw(). + * @vif: &struct ieee80211_vif pointer from the add_interface callback. @@ -647,26 +647,27 @@ index 765e9de4b575..5c8b73df2024 100644 + struct ieee80211_vif *vif, + struct ieee80211_mutable_offsets *offs); + - /** ++/** * ieee80211_beacon_get_tim - beacon generation function * @hw: pointer obtained from ieee80211_alloc_hw(). + * @vif: &struct ieee80211_vif pointer from the add_interface callback. diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h -index 5fa18a679114..db369c994d78 100644 +index 674b241..521f3a3 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -263,6 +263,7 @@ struct beacon_data { - u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; - u8 csa_current_counter; +@@ -266,6 +266,7 @@ struct beacon_data { + u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; + u8 cntdwn_current_counter; struct cfg80211_multiple_bssid_data multiple_bssid; + u16 ema_index; struct rcu_head rcu_head; }; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c -index dfcedf178884..abb9b052e53e 100644 +index 0d2255a..92f45bb 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4740,11 +4740,26 @@ static int ieee80211_beacon_protect(struct sk_buff *skb, +@@ -4732,11 +4732,26 @@ static int ieee80211_beacon_protect(struct sk_buff *skb, return 0; } @@ -694,16 +695,16 @@ index dfcedf178884..abb9b052e53e 100644 { struct ieee80211_local *local = hw_to_local(hw); struct beacon_data *beacon = NULL; -@@ -4772,6 +4787,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, +@@ -4764,6 +4779,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, beacon = rcu_dereference(ap->beacon); if (beacon) { + int ema_len = 0; - if (beacon->csa_counter_offsets[0]) { + if (beacon->cntdwn_counter_offsets[0]) { if (!is_template) - __ieee80211_csa_update_counter(beacon); -@@ -4779,6 +4795,9 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, - ieee80211_set_csa(sdata, beacon); + ieee80211_beacon_update_cntdwn(vif); +@@ -4771,6 +4787,9 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + ieee80211_set_beacon_cntdwn(sdata, beacon); } + if (is_ema && beacon->multiple_bssid.cnt) @@ -712,7 +713,7 @@ index dfcedf178884..abb9b052e53e 100644 /* * headroom, head length, * tail length and maximum TIM length -@@ -4786,7 +4805,8 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, +@@ -4778,7 +4797,8 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, skb = dev_alloc_skb(local->tx_headroom + beacon->head_len + beacon->tail_len + 256 + @@ -722,7 +723,7 @@ index dfcedf178884..abb9b052e53e 100644 if (!skb) goto out; -@@ -4804,6 +4824,17 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, +@@ -4796,6 +4816,17 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, csa_off_base = skb->len; } @@ -740,7 +741,7 @@ index dfcedf178884..abb9b052e53e 100644 if (beacon->tail) skb_put_data(skb, beacon->tail, beacon->tail_len); -@@ -4932,16 +4963,25 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, +@@ -4924,16 +4955,25 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs) { @@ -769,12 +770,12 @@ index dfcedf178884..abb9b052e53e 100644 struct ieee80211_supported_band *sband; int shift; -- -2.25.0 +2.7.4 -From 5806a3b2d7a30ca99ad0240a9199fede6dc46ee9 Mon Sep 17 00:00:00 2001 +From 538414b5f37c5952cfee454c3ff5c9c7aa62999b Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 12 Aug 2020 15:09:51 +0200 +Date: Wed, 6 Jan 2021 12:50:01 +0530 Subject: [PATCH 5/9] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up @@ -785,16 +786,16 @@ make use of it. Signed-off-by: John Crispin --- - drivers/net/wireless/ath/ath11k/mac.c | 37 ++++++++++++++++++++++----- - drivers/net/wireless/ath/ath11k/wmi.c | 17 +++++++----- - drivers/net/wireless/ath/ath11k/wmi.h | 12 +++++++-- - 3 files changed, 52 insertions(+), 14 deletions(-) + drivers/net/wireless/ath/ath11k/mac.c | 43 +++++++++++++++++++++++++++++------ + drivers/net/wireless/ath/ath11k/wmi.c | 17 +++++++++----- + drivers/net/wireless/ath/ath11k/wmi.h | 12 ++++++++-- + 3 files changed, 57 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c -index fa7f5b1bf983..7c41c1f64093 100644 +index fc9aa50..0697ad1 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -783,6 +783,10 @@ static inline int ath11k_mac_vdev_setup_sync(struct ath11k *ar) +@@ -760,6 +760,10 @@ static inline int ath11k_mac_vdev_setup_sync(struct ath11k *ar) static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) { @@ -802,19 +803,19 @@ index fa7f5b1bf983..7c41c1f64093 100644 + .vdev_id = vdev_id, + .bssid = ar->mac_addr, + }; - struct cfg80211_chan_def *chandef = NULL; - struct ieee80211_channel *channel = NULL; - struct wmi_vdev_start_req_arg arg = {}; -@@ -829,7 +833,7 @@ static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) - vdev_id, ret); - return ret; - } -- ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); + struct cfg80211_chan_def *chandef = NULL; + struct ieee80211_channel *channel = NULL; + struct wmi_vdev_start_req_arg arg = {}; +@@ -812,7 +816,7 @@ static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) + + int ret = 0; + +- ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); + ret = ath11k_wmi_vdev_up(ar, ¶ms); - if (ret) { - ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", - vdev_id, ret); -@@ -1120,6 +1124,12 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, + if (ret) { + ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", + vdev_id, ret); +@@ -1106,6 +1110,12 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, struct ieee80211_bss_conf *info) { struct ath11k *ar = arvif->ar; @@ -827,25 +828,24 @@ index fa7f5b1bf983..7c41c1f64093 100644 int ret = 0; lockdep_assert_held(&arvif->ar->conf_mutex); -@@ -1161,9 +1171,15 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, +@@ -1147,9 +1157,14 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, arvif->aid = 0; ether_addr_copy(arvif->bssid, info->bssid); + if (arvif->vif->multiple_bssid.parent) { + struct ath11k_vif *pvif; ++ ++ pvif = (struct ath11k_vif *)arvif->vif->multiple_bssid.parent->drv_priv; ++ params.trans_bssid = pvif->bssid; ++ } - ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, - arvif->bssid); -+ pvif = (struct ath11k_vif *)arvif->vif->multiple_bssid.parent->drv_priv; -+ -+ params.trans_bssid = pvif->bssid; -+ } -+ + ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms); if (ret) { ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n", arvif->vdev_id, ret); -@@ -2304,6 +2320,11 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, +@@ -2378,6 +2393,11 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = (void *)vif->drv_priv; struct peer_assoc_params peer_arg; @@ -857,7 +857,7 @@ index fa7f5b1bf983..7c41c1f64093 100644 struct ieee80211_sta *ap_sta; struct ieee80211_sta_he_cap he_cap; int ret; -@@ -2361,7 +2382,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, +@@ -2435,7 +2455,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, arvif->aid = bss_conf->aid; ether_addr_copy(arvif->bssid, bss_conf->bssid); @@ -866,7 +866,7 @@ index fa7f5b1bf983..7c41c1f64093 100644 if (ret) { ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n", arvif->vdev_id, ret); -@@ -6070,6 +6091,8 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, +@@ -6326,6 +6346,8 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, /* TODO: Update ar->rx_channel */ for (i = 0; i < n_vifs; i++) { @@ -875,7 +875,7 @@ index fa7f5b1bf983..7c41c1f64093 100644 arvif = (void *)vifs[i].vif->drv_priv; if (WARN_ON(!arvif->is_started)) -@@ -6090,8 +6113,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, +@@ -6346,8 +6368,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, continue; } @@ -888,7 +888,7 @@ index fa7f5b1bf983..7c41c1f64093 100644 if (ret) { ath11k_warn(ab, "failed to bring vdev up %d: %d\n", arvif->vdev_id, ret); -@@ -6279,7 +6340,12 @@ static int ath11k_start_vdev_delay(struc +@@ -6443,7 +6467,12 @@ static int ath11k_start_vdev_delay(struct ieee80211_hw *hw, } if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { @@ -903,10 +903,10 @@ index fa7f5b1bf983..7c41c1f64093 100644 ath11k_warn(ab, "failed put monitor up: %d\n", ret); return ret; diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c -index 2806efccd562..1035fa2a44f8 100644 +index 6239508..91a207e 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -974,7 +974,7 @@ int ath11k_wmi_vdev_set_ratemask(struct ath11k *ar, u32 vdev_id, u32 *params) +@@ -984,7 +984,7 @@ int ath11k_wmi_vdev_set_ratemask(struct ath11k *ar, u32 vdev_id, u32 *params) return ret; } @@ -915,7 +915,7 @@ index 2806efccd562..1035fa2a44f8 100644 { struct ath11k_pdev_wmi *wmi = ar->wmi; struct wmi_vdev_up_cmd *cmd; -@@ -989,10 +989,14 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) +@@ -999,10 +999,14 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_UP_CMD) | FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); @@ -933,7 +933,7 @@ index 2806efccd562..1035fa2a44f8 100644 ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_UP_CMDID); if (ret) { -@@ -1001,8 +1005,9 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) +@@ -1011,8 +1015,9 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) } ath11k_dbg(ar->ab, ATH11K_DBG_WMI, @@ -946,10 +946,10 @@ index 2806efccd562..1035fa2a44f8 100644 return ret; } diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h -index fb7ece7466c0..5a55dd2af41d 100644 +index 5c181a9..69bdac5 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2558,6 +2558,15 @@ struct wmi_vdev_config_ratemask_cmd { +@@ -2582,6 +2582,15 @@ struct wmi_vdev_config_ratemask_cmd { u32 mask_l2; } __packed; @@ -965,7 +965,7 @@ index fb7ece7466c0..5a55dd2af41d 100644 struct wmi_vdev_up_cmd { u32 tlv_header; u32 vdev_id; -@@ -5553,8 +5562,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, +@@ -5755,8 +5764,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, struct ieee80211_mutable_offsets *offs, struct sk_buff *bcn); int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id); @@ -976,10 +976,10 @@ index fb7ece7466c0..5a55dd2af41d 100644 int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg, bool restart); -- -2.25.0 +2.7.4 -From 7bc1e2a2485254b9ab8b938f949a345ff7d8f46e Mon Sep 17 00:00:00 2001 +From e51d8e37adecfcab073a1a487f6256707bc8b035 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 26 Aug 2020 10:55:49 -0700 Subject: [PATCH 6/9] ath11k: add the multiple bssid WMI commands @@ -993,10 +993,10 @@ Signed-off-by: John Crispin 2 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c -index 1035fa2a44f8..856fe9d530e3 100644 +index 91a207e..29701d3 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -681,6 +681,8 @@ int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, +@@ -685,6 +685,8 @@ int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, cmd->vdev_subtype = param->subtype; cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; cmd->pdev_id = param->pdev_id; @@ -1005,19 +1005,19 @@ index 1035fa2a44f8..856fe9d530e3 100644 ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); ptr = skb->data + sizeof(*cmd); -@@ -1788,6 +1790,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, - cmd->csa_switch_count_offset = offs->csa_counter_offs[0]; - cmd->ext_csa_switch_count_offset = offs->csa_counter_offs[1]; +@@ -1807,6 +1809,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, + cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0]; + cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1]; cmd->buf_len = bcn->len; + cmd->mbssid_ie_offset = offs->multiple_bssid_offset; ptr = skb->data + sizeof(*cmd); diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h -index 5a55dd2af41d..297282a60fbd 100644 +index 69bdac5..4d6fd78 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -138,6 +138,12 @@ enum { +@@ -133,6 +133,12 @@ enum { WMI_AUTORATE_3200NS_GI = (1 << 11), }; @@ -1030,7 +1030,7 @@ index 5a55dd2af41d..297282a60fbd 100644 /* * wmi command groups. */ -@@ -2525,6 +2531,8 @@ struct vdev_create_params { +@@ -2549,6 +2555,8 @@ struct vdev_create_params { u8 rx; } chains[NUM_NL80211_BANDS]; u32 pdev_id; @@ -1039,7 +1039,7 @@ index 5a55dd2af41d..297282a60fbd 100644 }; struct wmi_vdev_create_cmd { -@@ -2535,6 +2543,8 @@ struct wmi_vdev_create_cmd { +@@ -2559,6 +2567,8 @@ struct wmi_vdev_create_cmd { struct wmi_mac_addr vdev_macaddr; u32 num_cfg_txrx_streams; u32 pdev_id; @@ -1049,10 +1049,10 @@ index 5a55dd2af41d..297282a60fbd 100644 struct wmi_vdev_txrx_streams { -- -2.25.0 +2.7.4 -From 3af6fb803336d103f7b885ef768ec1369fbdfa08 Mon Sep 17 00:00:00 2001 +From 5d087cf0a0c6148f3a09b68111fbef67caaef227 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 26 Aug 2020 10:56:58 -0700 Subject: [PATCH 7/9] ath11k: add multiple bssid support to device creation @@ -1066,10 +1066,10 @@ Signed-off-by: John Crispin 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c -index 7c41c1f64093..d0bec170905d 100644 +index 0697ad1..9be4d60 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -5269,17 +5269,30 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw) +@@ -5521,17 +5521,30 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw) atomic_set(&ar->num_pending_mgmt_tx, 0); } @@ -1101,15 +1101,15 @@ index 7c41c1f64093..d0bec170905d 100644 if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; -@@ -5294,6 +5307,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, +@@ -5546,6 +5559,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, params->chains[NL80211_BAND_6GHZ].tx = ar->num_tx_chains; params->chains[NL80211_BAND_6GHZ].rx = ar->num_rx_chains; } + return 0; } - static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, -@@ -5386,7 +5400,11 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, + static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, +@@ -5691,7 +5705,11 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES - 1); @@ -1123,12 +1123,12 @@ index 7c41c1f64093..d0bec170905d 100644 ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param); if (ret) { -- -2.25.0 +2.7.4 -From 80e2a22938840e0eca9306c5ce4ebbd44c85c79e Mon Sep 17 00:00:00 2001 +From 33e3c43fa086063a50ccd21fe8d4f539e0678a7a Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 12 Aug 2020 15:33:33 +0200 +Date: Wed, 6 Jan 2021 13:23:31 +0530 Subject: [PATCH 8/9] ath11k: add EMA beacon support We need to update the beacon in multiple bssid mode after each completion @@ -1142,10 +1142,10 @@ Signed-off-by: John Crispin 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c -index d0bec170905d..611286f41f3d 100644 +index 9be4d60..6434d3f 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1086,7 +1086,10 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) +@@ -1072,7 +1072,10 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) if (arvif->vdev_type != WMI_VDEV_TYPE_AP) return 0; @@ -1157,7 +1157,7 @@ index d0bec170905d..611286f41f3d 100644 if (!bcn) { ath11k_warn(ab, "failed to get beacon template from mac80211\n"); return -EPERM; -@@ -1120,6 +1123,21 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) +@@ -1106,6 +1109,21 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) return ret; } @@ -1180,20 +1180,20 @@ index d0bec170905d..611286f41f3d 100644 struct ieee80211_bss_conf *info) { diff --git a/drivers/net/wireless/ath/ath11k/mac.h b/drivers/net/wireless/ath/ath11k/mac.h -index 5aba197fc212..0e3451b0ec1d 100644 +index b87e516..10a4f16 100644 --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -154,4 +154,5 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); +@@ -163,4 +163,5 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); +void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif); #endif diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c -index 856fe9d530e3..181ff2ae4422 100644 +index 29701d3..a8f756c 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -7680,6 +7680,7 @@ exit: +@@ -8099,6 +8099,7 @@ exit: static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, struct sk_buff *skb) { @@ -1201,7 +1201,7 @@ index 856fe9d530e3..181ff2ae4422 100644 u32 vdev_id, tx_status; if (ath11k_pull_bcn_tx_status_ev(ab, skb->data, skb->len, -@@ -7687,6 +7688,13 @@ static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, struct sk_buff *s +@@ -8106,6 +8107,13 @@ static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, struct sk_buff *s ath11k_warn(ab, "failed to extract bcn tx status"); return; } @@ -1216,10 +1216,10 @@ index 856fe9d530e3..181ff2ae4422 100644 -- -2.25.0 +2.7.4 -From 324b51335ca30729f8d627390e0e8d91037b0d61 Mon Sep 17 00:00:00 2001 +From afea0f0cb6f8706d60f2938d788797e1f21d393c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 26 Aug 2020 10:58:56 -0700 Subject: [PATCH 9/9] ath11k: set the multiple bssid hw flags and capabilities @@ -1229,14 +1229,14 @@ the feature available. Signed-off-by: John Crispin --- - drivers/net/wireless/ath/ath11k/mac.c | 6 ++++++ - 1 file changed, 6 insertions(+) + drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ + 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c -index 611286f41f3d..4ad9cc094d7b 100644 +index 6434d3f..3550176 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7481,19 +7481,23 @@ static void ath11k_mac_fetch_coex_info(struct ath11k *ar) +@@ -7865,19 +7865,23 @@ static void ath11k_mac_fetch_coex_info(struct ath11k *ar) static const u8 ath11k_if_types_ext_capa[] = { [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, @@ -1260,15 +1260,15 @@ index 611286f41f3d..4ad9cc094d7b 100644 }; static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = { -@@ -7609,6 +7613,8 @@ static int __ath11k_mac_register(struct ath11k *ar) - ieee80211_hw_set(ar->hw, QUEUE_CONTROL); - ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); - ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); +@@ -7998,6 +8002,8 @@ static int __ath11k_mac_register(struct ath11k *ar) + ieee80211_hw_set(ar->hw, SUPPORTS_RX_DECAP_OFFLOAD); + ieee80211_hw_set(ar->hw, SUPPORTS_CONC_MON_RX_DECAP); + } + ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID); + ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID_AP); if (ht_cap & WMI_HT_CAP_ENABLED) { ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION); ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); -- -2.25.0 +2.7.4 diff --git a/feeds/wifi-ax/mac80211/patches/qca/205-0011-ath11k-fix-mbssid-crash.patch b/feeds/wifi-ax/mac80211/patches/qca/205-0011-ath11k-fix-mbssid-crash.patch index 50b832d74..110fcc485 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/205-0011-ath11k-fix-mbssid-crash.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/205-0011-ath11k-fix-mbssid-crash.patch @@ -25,7 +25,7 @@ Signed-off-by: Aloka Dixit --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1133,12 +1133,27 @@ static int ath11k_mac_setup_bcn_tmpl(str +@@ -1113,12 +1113,27 @@ static int ath11k_mac_setup_bcn_tmpl(str void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) { @@ -55,7 +55,7 @@ Signed-off-by: Aloka Dixit if (!multiple_bssid) return; -@@ -5984,6 +5999,7 @@ ath11k_mac_vdev_start_restart(struct ath +@@ -6148,6 +6163,7 @@ ath11k_mac_vdev_start_restart(struct ath struct ath11k_base *ab = ar->ab; struct wmi_vdev_start_req_arg arg = {}; int ret = 0; @@ -63,7 +63,7 @@ Signed-off-by: Aloka Dixit lockdep_assert_held(&ar->conf_mutex); -@@ -6028,6 +6044,18 @@ ath11k_mac_vdev_start_restart(struct ath +@@ -6192,6 +6208,18 @@ ath11k_mac_vdev_start_restart(struct ath arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); @@ -130,7 +130,7 @@ Signed-off-by: Aloka Dixit }; /* -@@ -2090,6 +2092,40 @@ enum wmi_tlv_service { +@@ -2098,7 +2100,40 @@ enum wmi_tlv_service { WMI_TLV_SERVICE_PER_PEER_HTT_STATS_RESET = 213, WMI_TLV_SERVICE_FREQINFO_IN_METADATA = 219, WMI_TLV_SERVICE_EXT2_MSG = 220, @@ -163,7 +163,7 @@ Signed-off-by: Aloka Dixit + WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT = 246, + WMI_TLV_SERVICE_5_DOT_9GHZ_SUPPORT = 247, + WMI_TLV_SERVICE_MU_PREAMBLE_PUNCTURE_SUPPORT = 248, -+ WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249, + WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249, + WMI_TLV_REQUEST_CTRL_PATH_STATS_REQUEST = 250, + WMI_TLV_SERVICE_TPC_STATS_EVENT = 251, + WMI_TLV_SERVICE_NO_INTERBAND_MCC_SUPPORT = 252, @@ -171,7 +171,7 @@ Signed-off-by: Aloka Dixit WMI_MAX_EXT_SERVICE }; -@@ -2564,8 +2600,8 @@ struct wmi_vdev_create_cmd { +@@ -2572,8 +2607,8 @@ struct wmi_vdev_create_cmd { struct wmi_mac_addr vdev_macaddr; u32 num_cfg_txrx_streams; u32 pdev_id; @@ -182,7 +182,7 @@ Signed-off-by: Aloka Dixit } __packed; struct wmi_vdev_txrx_streams { -@@ -2647,6 +2683,9 @@ struct wmi_vdev_start_request_cmd { +@@ -2654,6 +2689,9 @@ struct wmi_vdev_start_request_cmd { u32 he_ops; u32 cac_duration_ms; u32 regdomain; @@ -192,7 +192,7 @@ Signed-off-by: Aloka Dixit } __packed; #define MGMT_TX_DL_FRM_LEN 64 -@@ -2816,6 +2855,9 @@ struct wmi_vdev_start_req_arg { +@@ -2823,6 +2861,9 @@ struct wmi_vdev_start_req_arg { u32 pref_rx_streams; u32 pref_tx_streams; u32 num_noa_descriptors; @@ -202,7 +202,7 @@ Signed-off-by: Aloka Dixit }; struct peer_create_params { -@@ -3579,6 +3621,11 @@ struct wmi_bcn_tmpl_cmd { +@@ -3585,6 +3626,11 @@ struct wmi_bcn_tmpl_cmd { u32 csa_event_bitmap; u32 mbssid_ie_offset; u32 esp_ie_offset; @@ -216,7 +216,7 @@ Signed-off-by: Aloka Dixit struct wmi_key_seq_counter { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4745,12 +4745,11 @@ static void +@@ -4736,12 +4736,11 @@ static void ieee80211_beacon_add_multiple_bssid_config(struct ieee80211_vif *vif, struct sk_buff *skb, struct cfg80211_multiple_bssid_data *config) { @@ -231,7 +231,7 @@ Signed-off-by: Aloka Dixit *pos++ = vif->bss_conf.multiple_bssid.count; *pos++ = config->cnt; } -@@ -4832,6 +4831,7 @@ __ieee80211_beacon_get(struct ieee80211_ +@@ -4823,6 +4822,7 @@ __ieee80211_beacon_get(struct ieee80211_ beacon->multiple_bssid.len[beacon->ema_index]); if (offs) offs->multiple_bssid_offset = skb->len - ema_len; diff --git a/feeds/wifi-ax/mac80211/patches/qca/205-monitor-crash-fix.patch b/feeds/wifi-ax/mac80211/patches/qca/205-monitor-crash-fix.patch index 0fd1d222d..5fc416ffa 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/205-monitor-crash-fix.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/205-monitor-crash-fix.patch @@ -16,7 +16,7 @@ Signed-off-by: Karthikeyan Kathirvel --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1001,8 +1001,15 @@ int ieee80211_register_hw(struct ieee802 +@@ -992,8 +992,15 @@ int ieee80211_register_hw(struct ieee802 continue; if (!dflt_chandef.chan) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/205-monitor-ring-stuck-fix.patch b/feeds/wifi-ax/mac80211/patches/qca/205-monitor-ring-stuck-fix.patch index d927383e9..55572d2cb 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/205-monitor-ring-stuck-fix.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/205-monitor-ring-stuck-fix.patch @@ -20,7 +20,7 @@ Signed-off-by: Karthikeyan Kathirvel --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -99,6 +99,8 @@ struct ath11k_pdev_mon_stats { +@@ -101,6 +101,8 @@ struct ath11k_pdev_mon_stats { u32 dest_mpdu_drop; u32 dup_mon_linkdesc_cnt; u32 dup_mon_buf_cnt; @@ -29,7 +29,7 @@ Signed-off-by: Karthikeyan Kathirvel }; struct dp_link_desc_bank { -@@ -119,6 +121,13 @@ struct dp_link_desc_bank { +@@ -121,6 +123,13 @@ struct dp_link_desc_bank { (DP_RX_DESC_COOKIE_INDEX_MAX | DP_RX_DESC_COOKIE_POOL_ID_MAX) #define DP_NOT_PPDU_ID_WRAP_AROUND 20000 @@ -43,7 +43,7 @@ Signed-off-by: Karthikeyan Kathirvel enum ath11k_dp_ppdu_state { DP_PPDU_STATUS_START, DP_PPDU_STATUS_DONE, -@@ -141,6 +150,7 @@ struct ath11k_mon_data { +@@ -143,6 +152,7 @@ struct ath11k_mon_data { struct ath11k_pdev_dp { u32 mac_id; @@ -53,27 +53,23 @@ Signed-off-by: Karthikeyan Kathirvel struct dp_rxdma_ring rx_refill_buf_ring; --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -5419,6 +5419,7 @@ void ath11k_dp_rx_mon_dest_process(struc - u32 rx_bufs_used; +@@ -5426,6 +5426,7 @@ void ath11k_dp_rx_mon_dest_process(struc + u32 ring_id; struct ath11k_pdev_mon_stats *rx_mon_stats; u32 npackets = 0; + u32 mpdu_rx_bufs_used; - mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id]; - -@@ -5443,16 +5444,39 @@ void ath11k_dp_rx_mon_dest_process(struc + if (ar->ab->hw_params.rxdma1_enable) + ring_id = dp->rxdma_mon_dst_ring.ring_id; +@@ -5455,10 +5456,29 @@ void ath11k_dp_rx_mon_dest_process(struc head_msdu = NULL; tail_msdu = NULL; -- rx_bufs_used += ath11k_dp_rx_mon_mpdu_pop(ar, ring_entry, -- &head_msdu, -- &tail_msdu, -- &npackets, &ppdu_id); -+ mpdu_rx_bufs_used = ath11k_dp_rx_mon_mpdu_pop(ar, ring_entry, -+ &head_msdu, -+ &tail_msdu, -+ &npackets, &ppdu_id); -+ +- rx_bufs_used += ath11k_dp_rx_mon_mpdu_pop(ar, mac_id, ring_entry, ++ mpdu_rx_bufs_used = ath11k_dp_rx_mon_mpdu_pop(ar, mac_id, ring_entry, + &head_msdu, + &tail_msdu, + &npackets, &ppdu_id); + rx_bufs_used += mpdu_rx_bufs_used; + + if (mpdu_rx_bufs_used) @@ -96,14 +92,3 @@ Signed-off-by: Karthikeyan Kathirvel if (ppdu_id != pmon->mon_ppdu_info.ppdu_id) { pmon->mon_ppdu_status = DP_PPDU_STATUS_START; - ath11k_dbg(ar->ab, ATH11K_DBG_DATA, -- "dest_rx: new ppdu_id %x != status ppdu_id %x", -- ppdu_id, pmon->mon_ppdu_info.ppdu_id); -+ "dest_rx: new ppdu_id %x != status ppdu_id %x dest_mon_not_reaped = %u" \ -+ "dest_mon_stuck = %u\n", -+ ppdu_id, pmon->mon_ppdu_info.ppdu_id, -+ rx_mon_stats->dest_mon_not_reaped, -+ rx_mon_stats->dest_mon_stuck); - break; - } - if (head_msdu && tail_msdu) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/206-ath11k-add-6ghz-params-in-peer-assoc-cmd.patch b/feeds/wifi-ax/mac80211/patches/qca/206-ath11k-add-6ghz-params-in-peer-assoc-cmd.patch index a77b853b9..cbe97ae78 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/206-ath11k-add-6ghz-params-in-peer-assoc-cmd.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/206-ath11k-add-6ghz-params-in-peer-assoc-cmd.patch @@ -18,7 +18,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2002,17 +2002,76 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1981,17 +1981,76 @@ static void ath11k_peer_assoc_h_he(struc arg->peer_bw_rxnss_override); } @@ -43,7 +43,7 @@ Signed-off-by: Pradeep Kumar Chitrapu + if (sta->bandwidth >= IEEE80211_STA_RX_BW_40) + arg->bw_40 = true; + -+ if (sta->bandwidth == IEEE80211_STA_RX_BW_80) ++ if (sta->bandwidth >= IEEE80211_STA_RX_BW_80) + arg->bw_80 = true; + + if (sta->bandwidth == IEEE80211_STA_RX_BW_160) @@ -98,7 +98,7 @@ Signed-off-by: Pradeep Kumar Chitrapu switch (smps) { case WLAN_HT_CAP_SM_PS_STATIC: -@@ -2291,6 +2350,7 @@ static void ath11k_peer_assoc_prepare(st +@@ -2270,6 +2329,7 @@ static void ath11k_peer_assoc_prepare(st ath11k_peer_assoc_h_ht(ar, vif, sta, arg); ath11k_peer_assoc_h_vht(ar, vif, sta, arg); ath11k_peer_assoc_h_he(ar, vif, sta, arg); @@ -106,7 +106,7 @@ Signed-off-by: Pradeep Kumar Chitrapu ath11k_peer_assoc_h_qos(ar, vif, sta, arg); ath11k_peer_assoc_h_smps(sta, arg); -@@ -2299,15 +2359,21 @@ static void ath11k_peer_assoc_prepare(st +@@ -2278,15 +2338,21 @@ static void ath11k_peer_assoc_prepare(st static int ath11k_setup_peer_smps(struct ath11k *ar, struct ath11k_vif *arvif, const u8 *addr, @@ -132,7 +132,7 @@ Signed-off-by: Pradeep Kumar Chitrapu if (smps >= ARRAY_SIZE(ath11k_smps_map)) return -EINVAL; -@@ -2480,7 +2546,7 @@ static void ath11k_bss_assoc(struct ieee +@@ -2459,7 +2525,7 @@ static void ath11k_bss_assoc(struct ieee } ret = ath11k_setup_peer_smps(ar, arvif, bss_conf->bssid, @@ -141,7 +141,7 @@ Signed-off-by: Pradeep Kumar Chitrapu if (ret) { ath11k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n", arvif->vdev_id, ret); -@@ -3706,7 +3772,7 @@ static int ath11k_station_assoc(struct a +@@ -3834,7 +3900,7 @@ static int ath11k_station_assoc(struct a return 0; ret = ath11k_setup_peer_smps(ar, arvif, sta->addr, @@ -150,8 +150,8 @@ Signed-off-by: Pradeep Kumar Chitrapu if (ret) { ath11k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n", arvif->vdev_id, ret); -@@ -7819,7 +7885,7 @@ static int __ath11k_mac_register(struct - ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); +@@ -8028,7 +8094,7 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD); ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID); ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID_AP); - if (ht_cap & WMI_HT_CAP_ENABLED) { @@ -159,7 +159,7 @@ Signed-off-by: Pradeep Kumar Chitrapu ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION); ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); ieee80211_hw_set(ar->hw, SUPPORTS_REORDERING_BUFFER); -@@ -7834,7 +7900,7 @@ static int __ath11k_mac_register(struct +@@ -8048,7 +8114,7 @@ static int __ath11k_mac_register(struct * for each band for a dual band capable radio. It will be tricky to * handle it when the ht capability different for each band. */ @@ -170,7 +170,7 @@ Signed-off-by: Pradeep Kumar Chitrapu ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID; --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -3400,6 +3400,8 @@ struct ieee80211_tspec_ie { +@@ -3474,6 +3474,8 @@ struct ieee80211_tspec_ie { __le16 medium_time; } __packed; @@ -181,7 +181,7 @@ Signed-off-by: Pradeep Kumar Chitrapu __le16 capa; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -5239,8 +5239,7 @@ static int nl80211_start_ap(struct sk_bu +@@ -5528,8 +5528,7 @@ static int nl80211_start_ap(struct sk_bu err = nl80211_parse_he_obss_pd( info->attrs[NL80211_ATTR_HE_OBSS_PD], ¶ms.he_obss_pd); @@ -191,9 +191,9 @@ Signed-off-by: Pradeep Kumar Chitrapu } if (info->attrs[NL80211_ATTR_HE_BSS_COLOR]) { -@@ -6133,6 +6132,10 @@ static int nl80211_set_station_tdls(stru - - if (params->he_capa_len < NL80211_HE_MIN_CAPABILITY_LEN) +@@ -6367,6 +6366,10 @@ static int nl80211_parse_sta_channel_inf + */ + if (params->supported_channels_len % 2) return -EINVAL; + + if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]) @@ -201,7 +201,7 @@ Signed-off-by: Pradeep Kumar Chitrapu + nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]); } - err = nl80211_parse_sta_channel_info(info, params); + if (info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]) { --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -579,6 +579,9 @@ int mesh_add_he_cap_ie(struct ieee80211_ diff --git a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Add-support-for-dynamic-vlan.patch b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Add-support-for-dynamic-vlan.patch index d744eb012..971a3e0c8 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Add-support-for-dynamic-vlan.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Add-support-for-dynamic-vlan.patch @@ -21,7 +21,7 @@ Signed-off-by: Seevalamuthu Mariappan --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -76,6 +76,34 @@ enum hal_encrypt_type ath11k_dp_tx_get_e +@@ -77,6 +77,34 @@ enum hal_encrypt_type ath11k_dp_tx_get_e } } @@ -56,7 +56,7 @@ Signed-off-by: Seevalamuthu Mariappan int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif, struct sk_buff *skb) { -@@ -93,6 +121,7 @@ int ath11k_dp_tx(struct ath11k *ar, stru +@@ -94,6 +122,7 @@ int ath11k_dp_tx(struct ath11k *ar, stru int ret; u8 ring_selector = 0, ring_map = 0; bool tcl_ring_retry; @@ -64,12 +64,13 @@ Signed-off-by: Seevalamuthu Mariappan if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags)) return -ESHUTDOWN; -@@ -203,6 +232,36 @@ tcl_ring_sel: +@@ -205,6 +234,37 @@ tcl_ring_sel: goto fail_remove_idr; } + /* Add metadata for sw encrypted vlan group traffic */ -+ if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) && ++ if (!test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) && ++ !(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) && + !info->control.hw_key && + ieee80211_has_protected(hdr->frame_control)) { + /* HW requirement is that metadata should always point to a @@ -101,7 +102,7 @@ Signed-off-by: Seevalamuthu Mariappan ti.paddr = dma_map_single(ab->dev, skb->data, skb->len, DMA_TO_DEVICE); if (dma_mapping_error(ab->dev, ti.paddr)) { atomic_inc(&ab->soc_stats.tx_err.misc_fail); -@@ -211,7 +270,7 @@ tcl_ring_sel: +@@ -213,7 +273,7 @@ tcl_ring_sel: goto fail_remove_idr; } @@ -110,7 +111,7 @@ Signed-off-by: Seevalamuthu Mariappan skb_cb->paddr = ti.paddr; skb_cb->vif = arvif->vif; skb_cb->ar = ar; -@@ -265,6 +324,8 @@ fail_unmap_dma: +@@ -269,6 +329,8 @@ fail_unmap_dma: dma_unmap_single(ab->dev, ti.paddr, ti.data_len, DMA_TO_DEVICE); fail_remove_idr: @@ -328,9 +329,9 @@ Signed-off-by: Seevalamuthu Mariappan struct sk_buff *skb); --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7966,6 +7966,9 @@ static int __ath11k_mac_register(struct - goto err_free; - } +@@ -8193,6 +8193,9 @@ static int __ath11k_mac_register(struct + */ + ar->hw->wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MONITOR); + ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); + ar->hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN); @@ -349,8 +350,8 @@ Signed-off-by: Seevalamuthu Mariappan + struct sk_buff *skb); /* misc utils */ - static inline void ieee80211_tx_stats(struct net_device *dev, u32 len) -@@ -3941,6 +3944,7 @@ void __ieee80211_subif_start_xmit(struct + static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, +@@ -3927,6 +3930,7 @@ void __ieee80211_subif_start_xmit(struct struct ieee80211_local *local = sdata->local; struct sta_info *sta; struct sk_buff *next; @@ -358,15 +359,18 @@ Signed-off-by: Seevalamuthu Mariappan if (unlikely(skb->len < ETH_HLEN)) { kfree_skb(skb); -@@ -3955,6 +3959,16 @@ void __ieee80211_subif_start_xmit(struct +@@ -3941,6 +3945,19 @@ void __ieee80211_subif_start_xmit(struct if (IS_ERR(sta)) sta = NULL; + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { + ap_sdata = container_of(sdata->bss, + struct ieee80211_sub_if_data, u.ap); -+ if (ap_sdata->hw_80211_encap && !is_multicast_ether_addr(skb->data)) { -+ ieee80211_8023_xmit(sdata, dev, sta, skb); ++ if (ap_sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED && ++ !is_multicast_ether_addr(skb->data)) { ++ if (sta) ++ key = rcu_dereference(sta->ptk[sta->ptk_idx]); ++ ieee80211_8023_xmit(sdata, dev, sta, key, skb); + rcu_read_unlock(); + return; + } diff --git a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Enable-512MB-profile-in-ath11k.patch b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Enable-512MB-profile-in-ath11k.patch index 7dfe79b43..c7631d95e 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Enable-512MB-profile-in-ath11k.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-Enable-512MB-profile-in-ath11k.patch @@ -35,7 +35,7 @@ Signed-off-by: Ramya Gnanasekar + Enables 512MB memory profile for ath11k --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -9,11 +9,22 @@ +@@ -9,11 +9,30 @@ #include "wmi.h" /* Target configuration defines */ @@ -46,6 +46,10 @@ Signed-off-by: Ramya Gnanasekar +/* Max num of stations (per radio) */ +#define TARGET_NUM_STATIONS 128 +#define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_512M ++#define ATH11K_DP_TX_COMP_RING_SIZE 8192 ++#define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 512 ++#define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 128 ++#define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 128 +#else /* Num VDEVS per radio */ #define TARGET_NUM_VDEVS (16 + 1) @@ -54,11 +58,15 @@ Signed-off-by: Ramya Gnanasekar +/* Max num of stations (per radio) */ +#define TARGET_NUM_STATIONS 512 +#define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_DEFAULT ++#define ATH11K_DP_TX_COMP_RING_SIZE 32768 ++#define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024 ++#define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 ++#define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 2048 +#endif /* Num of peers for Single Radio mode */ #define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV) -@@ -24,9 +35,6 @@ +@@ -24,9 +43,6 @@ /* Num of peers for DBS_SBS */ #define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV) @@ -70,7 +78,7 @@ Signed-off-by: Ramya Gnanasekar #define TARGET_NUM_TIDS(x) (2 * TARGET_NUM_PEERS(x) + \ --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -3750,7 +3750,7 @@ int ath11k_qmi_init_service(struct ath11 +@@ -3956,7 +3956,7 @@ int ath11k_qmi_init_service(struct ath11 memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk)); ab->qmi.ab = ab; @@ -81,12 +89,28 @@ Signed-off-by: Ramya Gnanasekar if (ret < 0) { --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -45,11 +45,15 @@ +@@ -32,8 +32,15 @@ + #define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 3 + #define ATH11K_QMI_MAX_QDSS_CONFIG_FILE_NAME_SIZE 64 + #define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin" ++ ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++#define ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS 0x4E800000 ++#define ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS 0x4E300000 ++#else + #define ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS 0x51000000 + #define ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS 0x50100000 ++#endif ++ + #define ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS 0x4C800000 + #define ATH11K_QMI_M3_DUMP_SIZE 0x100000 + +@@ -49,11 +56,15 @@ #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 #define ATH11K_FIRMWARE_MODE_OFF 4 -#define ATH11K_QMI_TARGET_MEM_MODE_DEFAULT 0 - #define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) + #define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) struct ath11k_base; @@ -100,7 +124,7 @@ Signed-off-by: Ramya Gnanasekar ATH11K_QMI_FILE_TYPE_CALDATA = 2, --- a/local-symbols +++ b/local-symbols -@@ -135,6 +135,7 @@ ATH11K= +@@ -134,6 +134,7 @@ ATH11K= ATH11K_AHB= ATH11K_PCI= ATH11K_NSS_SUPPORT= @@ -108,3 +132,73 @@ Signed-off-by: Ramya Gnanasekar ATH11K_DEBUG= ATH11K_DEBUGFS= ATH11K_TRACING= +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -869,6 +869,7 @@ struct ath11k_base { + bool fw_recovery_support; + bool ce_remap; + u32 ce_remap_base_addr; ++ atomic_t num_max_allowed; + + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -186,8 +186,9 @@ struct ath11k_pdev_dp { + + #define DP_WBM_RELEASE_RING_SIZE 64 + #define DP_TCL_DATA_RING_SIZE 512 +-#define DP_TX_COMP_RING_SIZE 32768 ++#define DP_TX_COMP_RING_SIZE ATH11K_DP_TX_COMP_RING_SIZE + #define DP_TX_IDR_SIZE DP_TX_COMP_RING_SIZE ++#define DP_TX_COMP_MAX_ALLOWED ((DP_TX_COMP_RING_SIZE << 1)/3) + #define DP_TCL_CMD_RING_SIZE 32 + #define DP_TCL_STATUS_RING_SIZE 32 + #define DP_REO_DST_RING_MAX 4 +@@ -200,9 +201,9 @@ struct ath11k_pdev_dp { + #define DP_RXDMA_BUF_RING_SIZE 4096 + #define DP_RXDMA_REFILL_RING_SIZE 2048 + #define DP_RXDMA_ERR_DST_RING_SIZE 1024 +-#define DP_RXDMA_MON_STATUS_RING_SIZE 1024 +-#define DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 +-#define DP_RXDMA_MONITOR_DST_RING_SIZE 2048 ++#define DP_RXDMA_MON_STATUS_RING_SIZE ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE ++#define DP_RXDMA_MONITOR_BUF_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE ++#define DP_RXDMA_MONITOR_DST_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE + #define DP_RXDMA_MONITOR_DESC_RING_SIZE 4096 + + #define DP_RX_BUFFER_SIZE 2048 +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -322,6 +322,7 @@ tcl_ring_sel: + skb->data, skb->len); + + atomic_inc(&ar->dp.num_tx_pending); ++ atomic_inc(&ab->num_max_allowed); + + return 0; + +@@ -370,6 +371,7 @@ static void ath11k_dp_tx_free_txbuf(stru + ar = ab->pdevs[mac_id].ar; + if (atomic_dec_and_test(&ar->dp.num_tx_pending)) + wake_up(&ar->dp.tx_empty_waitq); ++ atomic_dec(&ab->num_max_allowed); + } + + static void +@@ -403,6 +405,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + + if (atomic_dec_and_test(&ar->dp.num_tx_pending)) + wake_up(&ar->dp.tx_empty_waitq); ++ atomic_dec(&ab->num_max_allowed); + + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + +@@ -702,6 +705,7 @@ void ath11k_dp_tx_completion_handler(str + wake_up(&ar->dp.tx_empty_waitq); + + ath11k_dp_tx_complete_msdu(ar, msdu, &ts); ++ atomic_dec(&ab->num_max_allowed); + } + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-allow-multiple-single-rates.patch b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-allow-multiple-single-rates.patch deleted file mode 100644 index 5d81a3dc7..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-allow-multiple-single-rates.patch +++ /dev/null @@ -1,269 +0,0 @@ -From ddf4f23a95dd44931d695eb615c6b4e3869a0a56 Mon Sep 17 00:00:00 2001 -From: Venkateswara Naralasetty -Date: Fri, 9 Oct 2020 15:15:46 +0530 -Subject: [PATCH] ath11k: allow multiple single rates from fixed rate settings - -Ath11k driver allows user to set either range of rates like -1:0-9 2:0-9 3:0-9 4:0-9 or single fixed rate like 1:9 from -set bitrates command. -This change allows user to set multiple vht/he single rates -from set bitrates command like 1:9 2:9 3:9 4:9. And rate will -be applied based on the best nss supported by the peer using -peer fixed rate command. - -Signed-off-by: Venkateswara Naralasetty ---- - drivers/net/wireless/ath/ath11k/mac.c | 130 ++++++++++++++++++++++------------ - 1 file changed, 84 insertions(+), 46 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3581,6 +3581,28 @@ exit: - } - - static int -+ath11k_mac_bitrate_num_vht_single_rates(struct ath11k *ar, -+ enum nl80211_band band, -+ const struct cfg80211_bitrate_mask *mask, -+ struct ieee80211_sta *sta) -+{ -+ int num_single_rates = 0; -+ int i; -+ int rates; -+ int nss; -+ -+ nss = sta ? sta->rx_nss : ARRAY_SIZE(mask->control[band].vht_mcs); -+ -+ for (i = 0; i < nss; i++) { -+ rates = hweight16(mask->control[band].vht_mcs[i]); -+ if (rates == 1) -+ num_single_rates++; -+ } -+ -+ return num_single_rates; -+} -+ -+static int - ath11k_mac_bitrate_mask_num_vht_rates(struct ath11k *ar, - enum nl80211_band band, - const struct cfg80211_bitrate_mask *mask) -@@ -3595,6 +3617,28 @@ ath11k_mac_bitrate_mask_num_vht_rates(st - } - - static int -+ath11k_mac_bitrate_num_he_single_rates(struct ath11k *ar, -+ enum nl80211_band band, -+ const struct cfg80211_bitrate_mask *mask, -+ struct ieee80211_sta *sta) -+{ -+ int num_single_rates = 0; -+ int i; -+ int rates; -+ int nss; -+ -+ nss = sta ? sta->rx_nss : ARRAY_SIZE(mask->control[band].he_mcs); -+ -+ for (i = 0; i < nss; i++) { -+ rates = hweight16(mask->control[band].he_mcs[i]); -+ if (rates == 1) -+ num_single_rates++; -+ } -+ -+ return num_single_rates; -+} -+ -+static int - ath11k_mac_bitrate_mask_num_he_rates(struct ath11k *ar, - enum nl80211_band band, - const struct cfg80211_bitrate_mask *mask) -@@ -3623,7 +3667,7 @@ ath11k_mac_set_peer_vht_fixed_rate(struc - - nss = 0; - -- for (i = 0; i < ARRAY_SIZE(mask->control[band].vht_mcs); i++) { -+ for (i = 0; i < sta->rx_nss; i++) { - if (hweight16(mask->control[band].vht_mcs[i]) == 1) { - nss = i + 1; - vht_rate = ffs(mask->control[band].vht_mcs[i]) - 1; -@@ -3636,10 +3680,6 @@ ath11k_mac_set_peer_vht_fixed_rate(struc - return -EINVAL; - } - -- /* Avoid updating invalid nss as fixed rate*/ -- if (nss > sta->rx_nss) -- return -EINVAL; -- - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, - "Setting Fixed VHT Rate for peer %pM. Device will not switch to any other selected rates", - sta->addr); -@@ -3673,7 +3713,7 @@ ath11k_mac_set_peer_he_fixed_rate(struct - - nss = 0; - -- for (i = 0; i < ARRAY_SIZE(mask->control[band].he_mcs); i++) { -+ for (i = 0; i < sta->rx_nss; i++) { - if (hweight16(mask->control[band].he_mcs[i]) == 1) { - nss = i + 1; - he_rate = ffs(mask->control[band].he_mcs[i]) - 1; -@@ -3686,11 +3726,6 @@ ath11k_mac_set_peer_he_fixed_rate(struct - return -EINVAL; - } - -- /* Avoid updating invalid nss as fixed rate*/ -- if (nss > sta->rx_nss) -- return -EINVAL; -- -- - ath11k_dbg(ar->ab, ATH11K_DBG_MAC, - "Setting Fixed HE Rate for peer %pM. Device will not switch to any other selected rates", - sta->addr); -@@ -3720,7 +3755,7 @@ static int ath11k_station_assoc(struct a - struct cfg80211_chan_def def; - enum nl80211_band band; - struct cfg80211_bitrate_mask *mask; -- u8 num_vht_rates, num_he_rates; -+ u8 num_vht_single_rates, num_he_single_rates; - - lockdep_assert_held(&ar->conf_mutex); - -@@ -3745,22 +3780,23 @@ static int ath11k_station_assoc(struct a - return -ETIMEDOUT; - } - -- num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask); -- num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, mask); -+ num_vht_single_rates = ath11k_mac_bitrate_num_vht_single_rates(ar, band, -+ mask, sta); -+ num_he_single_rates = ath11k_mac_bitrate_num_he_single_rates(ar, band, -+ mask, sta); - - /* If single VHT/HE rate is configured (by set_bitrate_mask()), - * peer_assoc will disable VHT/HE. This is now enabled by a peer specific -- * fixed param. -+ * fixed param. If multiple single VHT/HE rates like(1:9 2:9 3:9 4:9) -+ * are configured, apply rate with the best nss supported by the peer. - * Note that all other rates and NSS will be disabled for this peer. - */ -- if (sta->vht_cap.vht_supported && num_vht_rates == 1) { -- ret = ath11k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, -- band); -+ if (sta->vht_cap.vht_supported && num_vht_single_rates >= 1) { -+ ret = ath11k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, band); - if (ret) - return ret; -- } else if (sta->he_cap.has_he && num_he_rates == 1) { -- ret = ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask, -- band); -+ } else if (sta->he_cap.has_he && num_he_single_rates >= 1) { -+ ret = ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask, band); - if (ret) - return ret; - } -@@ -3835,7 +3871,7 @@ static void ath11k_sta_rc_update_wk(stru - const u16 *vht_mcs_mask; - const u16 *he_mcs_mask; - u32 changed, bw, nss, smps; -- int err, num_vht_rates, num_he_rates; -+ int err, num_vht_single_rates, num_he_single_rates; - const struct cfg80211_bitrate_mask *mask; - struct peer_assoc_params peer_arg; - -@@ -3902,26 +3938,27 @@ static void ath11k_sta_rc_update_wk(stru - - if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { - mask = &arvif->bitrate_mask; -- num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, -- mask); -- num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, -- mask); -+ num_vht_single_rates = ath11k_mac_bitrate_num_vht_single_rates(ar, band, -+ mask, sta); -+ num_he_single_rates = ath11k_mac_bitrate_num_he_single_rates(ar, band, -+ mask, sta); - - /* Peer_assoc_prepare will reject vht rates in - * bitrate_mask if its not available in range format and -- * sets vht tx_rateset as unsupported. So multiple VHT MCS -- * setting(eg. MCS 4,5,6) per peer is not supported here. -- * But, Single rate in VHT mask can be set as per-peer -- * fixed rate. But even if any HT rates are configured in -- * the bitrate mask, device will not switch to those rates -- * when per-peer Fixed rate is set. -+ * sets vht tx_rateset as unsupported. If multiple VHT MCS -+ * and NSS (or) single fixed rate are configured from set_bitrate() -+ * setting(eg. 1:9 2:9 3:9 4:9) select the best rate based on NSS -+ * supported by the peer and apply it as peer fixed rate. Also, -+ * if rate is configured as 1:9 2:0-9 will select 1:9 here. -+ * But even if any HT rates are configured in the bitrate mask, -+ * device will not switch to those rates when per-peer Fixed rate is set. - * TODO: Check RATEMASK_CMDID to support auto rates selection - * across HT/VHT and for multiple VHT MCS support. - */ -- if (sta->vht_cap.vht_supported && num_vht_rates == 1) { -+ if (sta->vht_cap.vht_supported && num_vht_single_rates >= 1) { - ath11k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, - band); -- } else if (sta->he_cap.has_he && num_he_rates == 1) { -+ } else if (sta->he_cap.has_he && num_he_single_rates >= 1) { - ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask, - band); - } else { -@@ -7138,7 +7175,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie - u8 he_gi = 0, he_ltf = 0; - int single_nss; - int ret; -- int num_rates; -+ int num_single_rates; - bool he_fixed_rate = false; - - if (ath11k_mac_vif_chan(vif, &def)) -@@ -7215,37 +7252,38 @@ ath11k_mac_op_set_bitrate_mask(struct ie - * the VHT rate as fixed rate for vht peers. - * - Multiple VHT Rates : When Multiple VHT rates are given,this - * can be set using RATEMASK CMD which uses FW rate-ctl alg. -+ * - Multiple VHT single Rates: like 1:9 2:9 3:9 4:9 provided in -+ * set_bitrates(), apply rate based on the best NSS supported by -+ * the peer through peer fixed rate command. - * TODO: Setting multiple VHT MCS and replacing peer_assoc with - * RATEMASK_CMDID can cover all use cases of setting rates - * across multiple preambles and rates within same type. - * But requires more validation of the command at this point. - */ - -- num_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, -- mask); -+ num_single_rates = ath11k_mac_bitrate_num_vht_single_rates(ar, band, -+ mask, NULL); - - if (!ath11k_mac_vht_mcs_range_present(ar, band, mask) && -- num_rates > 1) { -- /* TODO: Handle multiple VHT MCS values setting using -- * RATEMASK CMD -- */ -+ num_single_rates == 0) { - ath11k_warn(ar->ab, - "Setting VHT MCS range other than 0-7, 0-8 and 0-9 in bitrate mask not supported\n"); - return -EINVAL; - } - -- num_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, -- mask); -- if (num_rates == 1) -- he_fixed_rate = true; -+ num_single_rates = ath11k_mac_bitrate_num_he_single_rates(ar, band, -+ mask, NULL); - - if (!ath11k_mac_he_mcs_range_present(ar, band, mask) && -- num_rates > 1) { -+ num_single_rates == 0) { - ath11k_warn(ar->ab, - "Setting HE MCS range other than 0-7, 0-9 and 0-11 in bitrate mask not supported\n"); - return -EINVAL; - } - -+ if (num_single_rates >= 1) -+ he_fixed_rate = true; -+ - mutex_lock(&ar->conf_mutex); - ieee80211_iterate_stations_atomic(ar->hw, - ath11k_mac_disable_peer_fixed_rate, diff --git a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-changes-for-coredump-scripts.patch b/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-changes-for-coredump-scripts.patch deleted file mode 100644 index 010995412..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/207-ath11k-changes-for-coredump-scripts.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -29,6 +29,8 @@ module_param_named(nss_offload, nss_offl - MODULE_PARM_DESC(nss_offload, "Enable NSS Offload support"); - #endif - -+struct ath11k_base *ath11k_soc; -+ - extern unsigned int ath11k_frame_mode; - - static const struct ath11k_hw_params ath11k_hw_params[] = { -@@ -1174,6 +1176,7 @@ struct ath11k_base *ath11k_core_alloc(st - ab->dev = dev; - ab->bus_params = *bus_params; - ab->hif.bus = bus; -+ ath11k_soc = ab; - - return ab; - diff --git a/feeds/wifi-ax/mac80211/patches/qca/207-mac80211-add-nss-redirect-support.patch b/feeds/wifi-ax/mac80211/patches/qca/207-mac80211-add-nss-redirect-support.patch index ccaeedb0d..9145dff11 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/207-mac80211-add-nss-redirect-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/207-mac80211-add-nss-redirect-support.patch @@ -38,10 +38,10 @@ Signed-off-by: Sowmiya Sree Elavalagan extern const struct cfg80211_ops mac80211_config_ops; -@@ -1009,6 +1010,7 @@ struct ieee80211_sub_if_data { +@@ -1008,6 +1009,7 @@ struct ieee80211_sub_if_data { + struct dentry *default_beacon_key; + } debugfs; #endif - - bool hw_80211_encap; + struct nss_virt_if_handle *nssctx; /* must be last, dynamically sized area in this! */ @@ -59,7 +59,19 @@ Signed-off-by: Sowmiya Sree Elavalagan /** * DOC: Interface list locking * -@@ -481,6 +485,32 @@ void ieee80211_del_virtual_monitor(struc +@@ -648,6 +652,11 @@ static int ieee80211_stop(struct net_dev + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + wiphy_lock(sdata->local->hw.wiphy); ++ if (sdata->nssctx) { ++ nss_virt_if_destroy_sync(sdata->nssctx); ++ sdata_info(sdata, "Destroyed NSS virtual interface\n"); ++ } ++ + ieee80211_do_stop(sdata, true); + wiphy_unlock(sdata->local->hw.wiphy); + +@@ -1093,6 +1102,32 @@ void ieee80211_del_virtual_monitor(struc kfree(sdata); } @@ -92,7 +104,7 @@ Signed-off-by: Sowmiya Sree Elavalagan /* * NOTE: Be very careful when changing this function, it must NOT return * an error on interface type changes that have been pre-checked, so most -@@ -734,6 +764,17 @@ int ieee80211_do_open(struct wireless_de +@@ -1324,6 +1359,17 @@ int ieee80211_do_open(struct wireless_de ieee80211_recalc_ps(local); @@ -110,21 +122,9 @@ Signed-off-by: Sowmiya Sree Elavalagan if (sdata->vif.type == NL80211_IFTYPE_MONITOR || sdata->vif.type == NL80211_IFTYPE_AP_VLAN || local->ops->wake_tx_queue) { -@@ -1085,6 +1126,11 @@ static int ieee80211_stop(struct net_dev - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - -+ if (sdata->nssctx) { -+ nss_virt_if_destroy_sync(sdata->nssctx); -+ sdata_info(sdata, "Destroyed NSS virtual interface\n"); -+ } -+ - ieee80211_do_stop(sdata, true); - - return 0; --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2570,6 +2570,52 @@ static bool ieee80211_frame_allowed(stru +@@ -2517,6 +2517,52 @@ static bool ieee80211_frame_allowed(stru return true; } @@ -177,39 +177,26 @@ Signed-off-by: Sowmiya Sree Elavalagan static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb, struct ieee80211_rx_data *rx) { -@@ -2587,12 +2633,7 @@ static void ieee80211_deliver_skb_to_loc - dev_kfree_skb(skb); +@@ -2535,15 +2581,7 @@ static void ieee80211_deliver_skb_to_loc } else { memset(skb->cb, 0, sizeof(skb->cb)); -- + - /* deliver to local stack */ -- if (rx->napi) -- napi_gro_receive(rx->napi, skb); +- if (rx->list) +-#if LINUX_VERSION_IS_GEQ(4,19,0) +- list_add_tail(&skb->list, rx->list); +-#else +- __skb_queue_tail(rx->list, skb); +-#endif - else - netif_receive_skb(skb); + netif_rx_nss(rx, skb); } } -@@ -4493,14 +4534,9 @@ static bool ieee80211_invoke_fast_rx(str - return true; - } - -- /* deliver to local stack */ - skb->protocol = eth_type_trans(skb, fast_rx->dev); - memset(skb->cb, 0, sizeof(skb->cb)); -- if (rx->napi) -- napi_gro_receive(rx->napi, skb); -- else -- netif_receive_skb(skb); -- -+ netif_rx_nss(rx, skb); - return true; - drop: - dev_kfree_skb(skb); --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4149,6 +4149,33 @@ out: +@@ -4138,6 +4138,33 @@ out: rcu_read_unlock(); } @@ -243,7 +230,7 @@ Signed-off-by: Sowmiya Sree Elavalagan /** * ieee80211_subif_start_xmit - netif start_xmit function for 802.3 vifs * @skb: packet to be sent -@@ -4159,6 +4186,8 @@ out: +@@ -4148,6 +4175,8 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -252,11 +239,11 @@ Signed-off-by: Sowmiya Sree Elavalagan if (unlikely(ieee80211_multicast_to_unicast(skb, dev))) { struct sk_buff_head queue; -@@ -4299,6 +4328,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +@@ -4278,6 +4307,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + struct ieee80211_key *key; struct sta_info *sta; + ieee80211_xmit_nss_fixup(skb, dev); - if (WARN_ON(!sdata->hw_80211_encap)) { + if (unlikely(skb->len < ETH_HLEN)) { kfree_skb(skb); return NETDEV_TX_OK; diff --git a/feeds/wifi-ax/mac80211/patches/qca/208-ath11k-add-processor_id-based-ring_selector-logic.patch b/feeds/wifi-ax/mac80211/patches/qca/208-ath11k-add-processor_id-based-ring_selector-logic.patch deleted file mode 100644 index c1b95c05c..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/208-ath11k-add-processor_id-based-ring_selector-logic.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 8851f9b8af90e68a852b48f72b9e212606ce2ac2 Mon Sep 17 00:00:00 2001 -From: P Praneesh -Date: Thu, 10 Sep 2020 10:45:05 +0530 -Subject: [PATCH] ath11k: add processor_id based ring_selector logic - -change ring selector logic from round robbin fashion -to current processor number based using smp_processor_id(). - -Signed-off-by: P Praneesh ---- - drivers/net/wireless/ath/ath11k/dp_tx.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -131,14 +131,14 @@ int ath11k_dp_tx(struct ath11k *ar, stru - - pool_id = skb_get_queue_mapping(skb) & (ATH11K_HW_MAX_QUEUES - 1); - -- /* Let the default ring selection be based on a round robin -- * fashion where one of the 3 tcl rings are selected based on -- * the tcl_ring_selector counter. In case that ring -+ /* Let the default ring selection based on current processor -+ * number, where one of the 3 tcl rings are selected based on -+ * the smp_processor_id() . In case that ring - * is full/busy, we resort to other available rings. - * If all rings are full, we drop the packet. - * //TODO Add throttling logic when all rings are full - */ -- ring_selector = atomic_inc_return(&ab->tcl_ring_selector); -+ ring_selector = smp_processor_id(); - - tcl_ring_sel: - tcl_ring_retry = false; ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -845,9 +845,6 @@ struct ath11k_base { - struct ath11k_ftm_event_obj ftm_event_obj; - u32 pktlog_defs_checksum; - -- /* Round robbin based TCL ring selector */ -- atomic_t tcl_ring_selector; -- - struct ath11k_dbring_cap *db_caps; - u32 num_db_cap; - u32 sw_pdev_id_map[MAX_RADIOS]; diff --git a/feeds/wifi-ax/mac80211/patches/qca/209-ath11k-set-proper-txpower-maxregpower-values.patch b/feeds/wifi-ax/mac80211/patches/qca/209-ath11k-set-proper-txpower-maxregpower-values.patch index d27114f10..0a95fbad3 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/209-ath11k-set-proper-txpower-maxregpower-values.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/209-ath11k-set-proper-txpower-maxregpower-values.patch @@ -18,20 +18,20 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -817,9 +817,9 @@ static int ath11k_mac_monitor_vdev_start - !!(channel->flags & IEEE80211_CHAN_RADAR); +@@ -790,9 +790,9 @@ static int ath11k_mac_monitor_vdev_start + !!(channel->flags & IEEE80211_CHAN_RADAR); - arg.channel.min_power = 0; -- arg.channel.max_power = channel->max_power * 2; -- arg.channel.max_reg_power = channel->max_reg_power * 2; -- arg.channel.max_antenna_gain = channel->max_antenna_gain * 2; -+ arg.channel.max_power = channel->max_power; -+ arg.channel.max_reg_power = channel->max_reg_power; -+ arg.channel.max_antenna_gain = channel->max_antenna_gain; + arg.channel.min_power = 0; +- arg.channel.max_power = channel->max_power * 2; +- arg.channel.max_reg_power = channel->max_reg_power * 2; +- arg.channel.max_antenna_gain = channel->max_antenna_gain * 2; ++ arg.channel.max_power = channel->max_power; ++ arg.channel.max_reg_power = channel->max_reg_power; ++ arg.channel.max_antenna_gain = channel->max_antenna_gain; - arg.pref_tx_streams = ar->num_tx_chains; - arg.pref_rx_streams = ar->num_rx_chains; -@@ -6120,9 +6120,9 @@ ath11k_mac_vdev_start_restart(struct ath + arg.pref_tx_streams = ar->num_tx_chains; + arg.pref_rx_streams = ar->num_rx_chains; +@@ -6282,9 +6282,9 @@ ath11k_mac_vdev_start_restart(struct ath ath11k_phymodes[chandef->chan->band][chandef->width]; arg.channel.min_power = 0; @@ -44,11 +44,11 @@ Signed-off-by: Lavanya Suresh arg.pref_tx_streams = ar->num_tx_chains; arg.pref_rx_streams = ar->num_rx_chains; ---- a/drivers/net/wireless/ath/ath11k/reg.c -+++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -189,9 +189,9 @@ int ath11k_reg_update_chan_list(struct a - ch->mhz = channel->center_freq; - ch->cfreq1 = channel->center_freq; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -2230,9 +2230,9 @@ int ath11k_wmi_update_scan_chan_list(str + IEEE80211_CHAN_NO_IR); + ch->is_chan_passive |= ch->dfs_set; ch->minpower = 0; - ch->maxpower = channel->max_power * 2; - ch->maxregpower = channel->max_reg_power * 2; @@ -57,24 +57,9 @@ Signed-off-by: Lavanya Suresh + ch->maxregpower = channel->max_reg_power; + ch->antennamax = channel->max_antenna_gain; - /* TODO: Use appropriate phymodes */ - if (channel->band == NL80211_BAND_2GHZ) ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -2178,9 +2178,9 @@ int ath11k_wmi_append_scan_chan_list(str - IEEE80211_CHAN_NO_IR); - ch->is_chan_passive |= ch->dfs_set; - ch->minpower = 0; -- ch->maxpower = channel->max_power * 2; -- ch->maxregpower = channel->max_reg_power * 2; -- ch->antennamax = channel->max_antenna_gain * 2; -+ ch->maxpower = channel->max_power; -+ ch->maxregpower = channel->max_reg_power; -+ ch->antennamax = channel->max_antenna_gain; - - ath11k_dbg(ar->ab, ATH11K_DBG_WMI, - "scan chan list %d freq %d cfreq1 %d phymode %d is_dfs_ch %u is_chan_passive %u\n", -@@ -2668,6 +2668,8 @@ int ath11k_wmi_send_scan_chan_list_cmd(s + if (channel->band == NL80211_BAND_6GHZ && + cfg80211_channel_is_psc(channel)) +@@ -2732,6 +2732,8 @@ int ath11k_wmi_send_scan_chan_list_cmd(s tchan_info->reg_class_id); *reg2 |= FIELD_PREP(WMI_CHAN_REG_INFO2_ANT_MAX, tchan_info->antennamax); diff --git a/feeds/wifi-ax/mac80211/patches/qca/209-fix-wrong-wmi-config-ipq8074.patch b/feeds/wifi-ax/mac80211/patches/qca/209-fix-wrong-wmi-config-ipq8074.patch deleted file mode 100644 index 813226ddf..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/209-fix-wrong-wmi-config-ipq8074.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ff63bef0828991915bde3af602bbdb0a6191dabb Mon Sep 17 00:00:00 2001 -From: Karthikeyan Periyasamy -Date: Sun, 20 Sep 2020 13:31:39 +0530 -Subject: [PATCH] ath11k: fix wmi init configuration - -Assign the correct hw_op ath11k_init_wmi_config_ipq8074 to the hw -IPQ8074. Also update the correct TWT radio count. -Incorrect TWT radio count cause TWT feature fails on radio2 because -physical device count is hardcoded to 2. so set the value dynamically. - -Found this during code review. - -Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2 - -Signed-off-by: Karthikeyan Periyasamy ---- - drivers/net/wireless/ath/ath11k/hw.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/hw.c -+++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -142,7 +142,7 @@ static void ath11k_init_wmi_config_ipq80 - config->beacon_tx_offload_max_vdev = ab->num_radios * TARGET_MAX_BCN_OFFLD; - config->rx_batchmode = TARGET_RX_BATCHMODE; - config->peer_map_unmap_v2_support = 1; -- config->twt_ap_pdev_count = 2; -+ config->twt_ap_pdev_count = ab->num_radios; - config->twt_ap_sta_count = 1000; - } - -@@ -551,7 +551,7 @@ static u32 ath11k_get_reo_dest_remap_con - - const struct ath11k_hw_ops ipq8074_ops = { - .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, -- .wmi_init_config = ath11k_init_wmi_config_qca6390, -+ .wmi_init_config = ath11k_init_wmi_config_ipq8074, - .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, - .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, - .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, diff --git a/feeds/wifi-ax/mac80211/patches/qca/209-mac80211-Fix-crash-caused-by-uninitialized-MBSSID-list.patch b/feeds/wifi-ax/mac80211/patches/qca/209-mac80211-Fix-crash-caused-by-uninitialized-MBSSID-list.patch index bbb6ba017..1dfbbc406 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/209-mac80211-Fix-crash-caused-by-uninitialized-MBSSID-list.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/209-mac80211-Fix-crash-caused-by-uninitialized-MBSSID-list.patch @@ -36,7 +36,7 @@ Signed-off-by: Aloka Dixit --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -2032,6 +2032,7 @@ int ieee80211_if_add(struct ieee80211_lo +@@ -2062,6 +2062,7 @@ int ieee80211_if_add(struct ieee80211_lo skb_queue_head_init(&sdata->fragments[i].skb_list); INIT_LIST_HEAD(&sdata->key_list); diff --git a/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-Fix-extended-capability-bit-for-Enhanced-Mult.patch b/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-Fix-extended-capability-bit-for-Enhanced-Mult.patch index c250c233a..bc9a16b1e 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-Fix-extended-capability-bit-for-Enhanced-Mult.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-Fix-extended-capability-bit-for-Enhanced-Mult.patch @@ -15,7 +15,7 @@ Signed-off-by: Aloka Dixit --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7802,7 +7802,7 @@ static const u8 ath11k_if_types_ext_capa +@@ -8013,7 +8013,7 @@ static const u8 ath11k_if_types_ext_capa [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, [9] = WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT, diff --git a/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-full-mon-support-for-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-full-mon-support-for-qcn9000.patch index 0bcd31db1..e5b204e99 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-full-mon-support-for-qcn9000.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/210-ath11k-full-mon-support-for-qcn9000.patch @@ -33,64 +33,49 @@ Signed-off-by: Anilkumar Kolli drivers/net/wireless/ath/ath11k/mac.c | 11 + 14 files changed, 677 insertions(+), 24 deletions(-) -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ahb.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/ahb.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ahb.c -@@ -12,6 +12,7 @@ - #include "debug.h" - #include "hif.h" - #include "qmi.h" -+#include "dp_rx.h" - #include - - static const struct of_device_id ath11k_ahb_of_match[] = { -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/core.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/core.c -@@ -45,6 +45,7 @@ static const struct ath11k_hw_params ath - .spectral_fft_sz = 2, +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -50,6 +50,7 @@ static const struct ath11k_hw_params ath + }, .max_radios = 3, .bdf_addr = 0x4B0C0000, + .full_monitor_mode = false, .hw_ops = &ipq8074_ops, - .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .credit_flow = false, -@@ -83,6 +84,7 @@ static const struct ath11k_hw_params ath - .spectral_fft_sz = 4, + .m3_addr = ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS, +@@ -95,6 +96,7 @@ static const struct ath11k_hw_params ath + }, .max_radios = 2, .bdf_addr = 0x4ABC0000, + .full_monitor_mode = false, .hw_ops = &ipq6018_ops, - .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .credit_flow = false, -@@ -152,6 +154,7 @@ static const struct ath11k_hw_params ath + .m3_addr = ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS, +@@ -182,6 +184,7 @@ static const struct ath11k_hw_params ath .max_radios = 1, .single_pdev_only = false, - .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9000, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074, + .full_monitor_mode = true, - .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9000), - .ring_mask = &ath11k_hw_ring_mask_qcn9000, - .regs = &qcn9000_regs, -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.c -@@ -791,9 +791,9 @@ int ath11k_dp_service_srng(struct ath11k + .hw_ops = &qcn9074_ops, + .ring_mask = &ath11k_hw_ring_mask_qcn9074, + .internal_sleep_clock = false, +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -813,9 +813,10 @@ int ath11k_dp_service_srng(struct ath11k if (ab->hw_params.ring_mask->rx_mon_status[grp_id] & BIT(id)) { work_done = - ath11k_dp_rx_process_mon_rings(ab, - id, - napi, budget); -+ ab->hw_params.hw_ops->rx_process_mon_rings(ab, -+ id, napi, -+ budget); ++ ath11k_dp_rx_process_mon_rings(ab, ++ id, ++ napi, ++ budget); budget -= work_done; tot_work_done += work_done; -@@ -1024,6 +1024,7 @@ int ath11k_dp_alloc(struct ath11k_base * +@@ -1047,6 +1048,7 @@ int ath11k_dp_alloc(struct ath11k_base * INIT_LIST_HEAD(&dp->reo_cmd_list); INIT_LIST_HEAD(&dp->reo_cmd_cache_flush_list); @@ -98,11 +83,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ spin_lock_init(&dp->reo_cmd_lock); dp->reo_cmd_cache_flush_count = 0; -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp.h -@@ -86,6 +86,19 @@ struct dp_tx_ring { +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -88,6 +88,19 @@ struct dp_tx_ring { int tx_status_tail; }; @@ -122,7 +105,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct ath11k_pdev_mon_stats { u32 status_ppdu_state; u32 status_ppdu_start; -@@ -103,6 +116,12 @@ struct ath11k_pdev_mon_stats { +@@ -105,6 +118,12 @@ struct ath11k_pdev_mon_stats { u32 dest_mon_not_reaped; }; @@ -135,7 +118,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct dp_link_desc_bank { void *vaddr_unaligned; void *vaddr; -@@ -141,7 +160,12 @@ struct ath11k_mon_data { +@@ -143,7 +162,12 @@ struct ath11k_mon_data { u32 mon_last_buf_cookie; u64 mon_last_linkdesc_paddr; u16 chan_noise_floor; @@ -148,7 +131,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct ath11k_pdev_mon_stats rx_mon_stats; /* lock for monitor data */ spinlock_t mon_lock; -@@ -238,6 +262,7 @@ struct ath11k_dp { +@@ -255,6 +279,7 @@ struct ath11k_dp { struct hal_wbm_idle_scatter_list scatter_list[DP_IDLE_SCATTER_BUFS_MAX]; struct list_head reo_cmd_list; struct list_head reo_cmd_cache_flush_list; @@ -156,7 +139,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ u32 reo_cmd_cache_flush_count; /** * protects access to below fields, -@@ -283,6 +308,7 @@ enum htt_h2t_msg_type { +@@ -302,6 +327,7 @@ enum htt_h2t_msg_type { HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc, HTT_H2T_MSG_TYPE_EXT_STATS_CFG = 0x10, HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11, @@ -164,7 +147,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ }; #define HTT_VER_REQ_INFO_MSG_ID GENMASK(7, 0) -@@ -986,6 +1012,79 @@ struct htt_rx_ring_tlv_filter { +@@ -1005,6 +1031,79 @@ struct htt_rx_ring_tlv_filter { u32 pkt_filter_flags3; /* DATA */ }; @@ -244,11 +227,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ /* HTT message target->host */ enum htt_t2h_msg_type { -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_rx.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp_rx.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -504,6 +504,8 @@ static void ath11k_dp_rx_pdev_srng_free( +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -534,6 +534,8 @@ static void ath11k_dp_rx_pdev_srng_free( } ath11k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); @@ -257,7 +238,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ } void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab) -@@ -3249,12 +3251,48 @@ fail_desc_get: +@@ -3238,12 +3240,48 @@ fail_desc_get: return req_entries - num_remain; } @@ -306,7 +287,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct hal_srng *srng; void *rx_mon_status_desc; struct sk_buff *skb; -@@ -3268,6 +3306,7 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3257,6 +3295,7 @@ static int ath11k_dp_rx_reap_mon_status_ ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; dp = &ar->dp; @@ -314,7 +295,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ srng_id = ath11k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id); rx_ring = &dp->rx_mon_status_refill_ring[srng_id]; -@@ -3280,8 +3319,10 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3269,8 +3308,10 @@ static int ath11k_dp_rx_reap_mon_status_ *budget -= 1; rx_mon_status_desc = ath11k_hal_srng_src_peek(ab, srng); @@ -326,7 +307,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ ath11k_hal_rx_buf_addr_info_get(rx_mon_status_desc, &paddr, &cookie, &rbm); -@@ -3294,6 +3335,7 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3283,6 +3324,7 @@ static int ath11k_dp_rx_reap_mon_status_ ath11k_warn(ab, "rx monitor status with invalid buf_id %d\n", buf_id); spin_unlock_bh(&rx_ring->idr_lock); @@ -334,32 +315,27 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ goto move_next; } -@@ -3317,15 +3359,23 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3302,10 +3344,19 @@ static int ath11k_dp_rx_reap_mon_status_ FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl)); dev_kfree_skb_any(skb); + pmon->mon_status_buf_state = DP_MON_STATUS_NO_DMA; goto move_next; } - + if (ab->hw_params.full_monitor_mode) { + ath11k_dp_rx_mon_update_status_buf_state(pmon, tlv); + if (paddr == pmon->mon_status_paddr) + pmon->mon_status_buf_state = DP_MON_STATUS_MATCH; + } -+ + __skb_queue_tail(skb_list, skb); + } else { + pmon->mon_status_buf_state = DP_MON_STATUS_REPLINISH; ++ } move_next: skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, - &buf_id, GFP_ATOMIC); -- - if (!skb) { - ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, 0, 0, - HAL_RX_BUF_RBM_SW3_BM); -@@ -3339,6 +3389,7 @@ move_next: +@@ -3324,6 +3375,7 @@ move_next: ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, rxcb->paddr, cookie, HAL_RX_BUF_RBM_SW3_BM); @@ -367,20 +343,23 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ ath11k_hal_srng_src_get_next_entry(ab, srng); num_buffs_reaped++; } -@@ -3452,8 +3503,10 @@ int ath11k_dp_rx_process_mon_status(stru - (pmon->mon_ppdu_status == DP_PPDU_STATUS_START)) { - rx_mon_stats->status_ppdu_done++; - pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; -- ath11k_dp_rx_mon_dest_process(ar, budget, napi); -- pmon->mon_ppdu_status = DP_PPDU_STATUS_START; -+ if (!ab->hw_params.full_monitor_mode) { -+ ath11k_dp_rx_mon_dest_process(ar, budget, napi); -+ pmon->mon_ppdu_status = DP_PPDU_STATUS_START; -+ } - } +@@ -3432,15 +3484,6 @@ int ath11k_dp_rx_process_mon_status(stru + hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb); + +- if ((ar->monitor_started) && +- (hal_status == HAL_TLV_STATUS_PPDU_DONE) && +- (pmon->mon_ppdu_status == DP_PPDU_STATUS_START)) { +- rx_mon_stats->status_ppdu_done++; +- pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; +- ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi); +- pmon->mon_ppdu_status = DP_PPDU_STATUS_START; +- } +- if (ppdu_info->peer_id == HAL_INVALID_PEERID || -@@ -3494,7 +3547,6 @@ int ath11k_dp_rx_process_mon_status(stru + hal_status != HAL_RX_MON_STATUS_PPDU_DONE) { + dev_kfree_skb_any(skb); +@@ -3479,7 +3522,6 @@ int ath11k_dp_rx_process_mon_status(stru spin_unlock_bh(&ab->base_lock); rcu_read_unlock(); @@ -388,7 +367,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ dev_kfree_skb_any(skb); } exit: -@@ -5369,12 +5421,10 @@ static int ath11k_dp_rx_mon_deliver(stru +@@ -5375,12 +5417,10 @@ static int ath11k_dp_rx_mon_deliver(stru mon_skb = ath11k_dp_rx_mon_merg_msdus(ar, mac_id, head_msdu, tail_msdu, rxs); @@ -401,7 +380,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ rxs->flag = 0; do { skb_next = mon_skb->next; -@@ -5413,11 +5463,11 @@ void ath11k_dp_rx_mon_dest_process(struc +@@ -5419,12 +5459,12 @@ void ath11k_dp_rx_mon_dest_process(struc { struct ath11k_pdev_dp *dp = &ar->dp; struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; @@ -410,36 +389,37 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ void *mon_dst_srng; u32 ppdu_id; u32 rx_bufs_used; + u32 ring_id; - struct ath11k_pdev_mon_stats *rx_mon_stats; u32 npackets = 0; u32 mpdu_rx_bufs_used; -@@ -5479,6 +5529,7 @@ void ath11k_dp_rx_mon_dest_process(struc - rx_mon_stats->dest_mon_stuck); +@@ -5487,6 +5527,7 @@ void ath11k_dp_rx_mon_dest_process(struc + ppdu_id, pmon->mon_ppdu_info.ppdu_id); break; } + if (head_msdu && tail_msdu) { ath11k_dp_rx_mon_deliver(ar, dp->mac_id, head_msdu, &pmon->mon_ppdu_info, -@@ -5502,15 +5553,6 @@ void ath11k_dp_rx_mon_dest_process(struc - } +@@ -5572,10 +5613,13 @@ int ath11k_dp_rx_process_mon_rings(struc + struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); + int ret = 0; + +- if (ar->monitor_started) ++ if (!ar->monitor_started) ++ ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); ++ else if (!ab->hw_params.full_monitor_mode) + ret = ath11k_dp_mon_process_rx(ab, mac_id, napi, budget); + else +- ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); ++ ret = ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget); ++ + return ret; } --int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, -- struct napi_struct *napi, int budget) --{ -- int ret = 0; -- -- ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); -- return ret; --} -- - static int ath11k_dp_rx_pdev_mon_status_attach(struct ath11k *ar) - { - struct ath11k_pdev_dp *dp = &ar->dp; -@@ -5582,3 +5624,374 @@ int ath11k_dp_rx_pdev_mon_detach(struct - ath11k_dp_mon_link_free(ar); +@@ -5676,3 +5720,368 @@ int ath11k_dp_rx_pktlog_stop(struct ath1 + return 0; } + @@ -718,8 +698,8 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + return work; +} + -+int ath11k_dp_rx_process_full_monitor(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget) ++int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id, ++ struct napi_struct *napi, int budget) +{ + struct ath11k *ar = ab->pdevs[mac_id].ar; + struct ath11k_pdev_dp *dp = &ar->dp; @@ -735,12 +715,6 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + + spin_lock_bh(&pmon->mon_lock); + -+ if (!ar->monitor_started) { -+ quota = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); -+ spin_unlock_bh(&pmon->mon_lock); -+ return quota; -+ } -+ + sw_mon_entries = &pmon->sw_mon_entries; + rx_mon_stats = &pmon->rx_mon_stats; + @@ -813,11 +787,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + + return quota; +} -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_rx.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp_rx.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_rx.h -@@ -99,10 +99,6 @@ int ath11k_dp_htt_tlv_iter(struct ath11k +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -98,16 +98,16 @@ int ath11k_dp_htt_tlv_iter(struct ath11k int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, const void *ptr, void *data), void *data); @@ -828,11 +800,19 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, struct dp_rxdma_ring *rx_ring, int req_entries, -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_tx.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -982,6 +982,46 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req( + enum hal_rx_buf_return_buf_manager mgr); + void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id, u32 quota, + struct napi_struct *napi); ++int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, ++ struct napi_struct *napi, int budget); ++int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id, ++ struct napi_struct *napi, int budget); + int ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar); + int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar); + int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id); +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -1015,6 +1015,46 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req( return 0; } @@ -854,7 +834,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE); + + cmd->info0 |= FIELD_PREP(HTT_RX_FULL_MON_MODE_CFG_CMD_INFO0_PDEV_ID, -+ ab->hw_pdev_id_map[mac_id]); ++ DP_SW2HW_MACID(mac_id)); + + cmd->cfg = HTT_RX_FULL_MON_MODE_CFG_CMD_CFG_ENABLE | + FIELD_PREP(HTT_RX_FULL_MON_MODE_CFG_CMD_CFG_RELEASE_RING, @@ -879,7 +859,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ int ath11k_dp_tx_htt_rx_filter_setup(struct ath11k_base *ab, u32 ring_id, int mac_id, enum hal_ring_type ring_type, int rx_buf_size, -@@ -1099,6 +1139,15 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c +@@ -1132,6 +1172,15 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c struct htt_rx_ring_tlv_filter tlv_filter = {0}; int ret = 0, ring_id = 0, i; @@ -895,10 +875,8 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ ring_id = dp->rxdma_mon_buf_ring.refill_buf_ring.ring_id; if (!reset) { -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_tx.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/dp_tx.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/dp_tx.h +--- a/drivers/net/wireless/ath/ath11k/dp_tx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.h @@ -237,4 +237,6 @@ int ath11k_dp_tx_htt_rx_filter_setup(str enum hal_tcl_encap_type ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb); @@ -906,10 +884,8 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ +int ath11k_dp_tx_htt_rx_full_mon_setup(struct ath11k_base *ab, int mac_id, + bool config); #endif -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_desc.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/hal_desc.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_desc.h +--- a/drivers/net/wireless/ath/ath11k/hal_desc.h ++++ b/drivers/net/wireless/ath/ath11k/hal_desc.h @@ -859,6 +859,25 @@ struct hal_reo_entrance_ring { * this ring has looped around the ring. */ @@ -936,11 +912,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ #define HAL_REO_CMD_HDR_INFO0_CMD_NUMBER GENMASK(15, 0) #define HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED BIT(16) -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_rx.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/hal_rx.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_rx.c -@@ -1652,3 +1652,50 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -1643,3 +1643,50 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get *pp_buf_addr = (void *)buf_addr_info; } @@ -991,10 +965,8 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ + sw_mon_entries->ppdu_id = + FIELD_GET(HAL_SW_MON_RING_INFO1_PHY_PPDU_ID, sw_mon_ring->info1); +} -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_rx.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/hal_rx.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hal_rx.h +--- a/drivers/net/wireless/ath/ath11k/hal_rx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h @@ -134,6 +134,20 @@ struct hal_rx_user_status { u32 mpdu_err_byte_count; }; @@ -1018,7 +990,7 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ u32 last_ppdu_id; @@ -502,6 +516,9 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get dma_addr_t *paddr, u32 *sw_cookie, - void **pp_buf_addr_info, + void **pp_buf_addr_info, u8 *rbm, u32 *msdu_cnt); +void +ath11k_hal_rx_sw_mon_ring_buf_paddr_get(void *rx_desc, @@ -1026,74 +998,9 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ enum hal_rx_mon_status ath11k_hal_rx_parse_mon_status(struct ath11k_base *ab, struct hal_rx_mon_ppdu_info *ppdu_info, -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hw.c -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/hw.c -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hw.c -@@ -549,6 +549,18 @@ static u32 ath11k_get_reo_dest_remap_con - return ring_hash_map; - } - -+int ath11k_dp_rx_process_mon_rings_ipq8074(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget) -+{ -+ return ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); -+} -+ -+int ath11k_dp_rx_process_mon_rings_qcn9000(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget) -+{ -+ return ath11k_dp_rx_process_full_monitor(ab, mac_id, napi, budget); -+} -+ - const struct ath11k_hw_ops ipq8074_ops = { - .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, - .wmi_init_config = ath11k_init_wmi_config_ipq8074, -@@ -584,6 +596,7 @@ const struct ath11k_hw_ops ipq8074_ops = - .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, -+ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_ipq8074, - }; - - const struct ath11k_hw_ops ipq6018_ops = { -@@ -622,6 +635,7 @@ const struct ath11k_hw_ops ipq6018_ops = - .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, -+ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_ipq8074, - }; - - const struct ath11k_hw_ops qca6390_ops = { -@@ -662,6 +676,7 @@ const struct ath11k_hw_ops qca6390_ops = - .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, - .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, -+ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_qcn9000, - }; - - const struct ath11k_hw_ops qcn9000_ops = { -@@ -700,6 +715,7 @@ const struct ath11k_hw_ops qcn9000_ops = - .rx_desc_get_attention = ath11k_hw_qcn9000_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_qcn9000_rx_desc_get_msdu_payload, - .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, -+ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_qcn9000, - }; - - /* IPQ5018 hw ops is similar to QCN9000 except for the dest ring remap */ -@@ -739,6 +755,7 @@ const struct ath11k_hw_ops ipq5018_ops = - .rx_desc_get_attention = ath11k_hw_qcn9000_rx_desc_get_attention, - .rx_desc_get_msdu_payload = ath11k_hw_qcn9000_rx_desc_get_msdu_payload, - .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, -+ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_qcn9000, - }; - - #define ATH11K_TX_RING_MASK_0 0x1 -Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hw.h -=================================================================== ---- backports-20200902_001-4.4.60-931c337125.orig/drivers/net/wireless/ath/ath11k/hw.h -+++ backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/hw.h -@@ -118,6 +118,7 @@ enum ath11k_bus { +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -126,6 +126,7 @@ enum ath11k_bus { struct hal_rx_desc; struct hal_tcl_data_cmd; @@ -1101,32 +1008,11 @@ Index: backports-20200902_001-4.4.60-931c337125/drivers/net/wireless/ath/ath11k/ struct ath11k_hw_ring_mask { u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; -@@ -147,6 +148,7 @@ struct ath11k_hw_params { +@@ -178,6 +179,7 @@ struct ath11k_hw_params { u8 spectral_fft_hdr_len; u32 spectral_max_fft_bins; bool credit_flow; + bool full_monitor_mode; - const struct ath11k_hw_ops *hw_ops; - const struct ath11k_hw_ring_mask *ring_mask; -@@ -220,6 +222,8 @@ struct ath11k_hw_ops { - struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc); - u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc); - u32 (*get_reo_dest_remap_config)(void); -+ int (*rx_process_mon_rings)(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget); - }; - - extern const struct ath11k_hw_ops ipq8074_ops; -@@ -345,4 +349,11 @@ extern const struct ath11k_hw_regs qca63 - extern const struct ath11k_hw_regs qcn9000_regs; - extern const struct ath11k_hw_regs ipq5018_regs; - -+int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget); -+int ath11k_dp_rx_process_full_monitor(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget); -+int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, -+ struct napi_struct *napi, int budget); -+ - #endif + u16 interface_modes; + bool supports_monitor; diff --git a/feeds/wifi-ax/mac80211/patches/qca/210-nl80211-rename-csa-counter-attributes-countdown-coun.patch b/feeds/wifi-ax/mac80211/patches/qca/210-nl80211-rename-csa-counter-attributes-countdown-coun.patch deleted file mode 100644 index 66353b0b5..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/210-nl80211-rename-csa-counter-attributes-countdown-coun.patch +++ /dev/null @@ -1,105 +0,0 @@ -From: John Crispin -Date: Wed, 26 Aug 2020 07:56:46 +0200 -Subject: [PATCH] nl80211: rename csa counter attributes countdown counters - -We want to reuse the attributes for other counters such as BSS color -change. Rename them to more generic names. - -Signed-off-by: John Crispin ---- - include/uapi/linux/nl80211.h | 14 ++++++++------ - net/wireless/nl80211.c | 16 ++++++++-------- - 2 files changed, 16 insertions(+), 14 deletions(-) - ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -2088,10 +2088,10 @@ enum nl80211_commands { - * operation). - * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information - * for the time while performing a channel switch. -- * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel -- * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). -- * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel -- * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). -+ * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel -+ * switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). -+ * @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel -+ * switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP). - * - * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. - * As specified in the &enum nl80211_rxmgmt_flags. -@@ -2852,8 +2852,8 @@ enum nl80211_attrs { - NL80211_ATTR_CH_SWITCH_COUNT, - NL80211_ATTR_CH_SWITCH_BLOCK_TX, - NL80211_ATTR_CSA_IES, -- NL80211_ATTR_CSA_C_OFF_BEACON, -- NL80211_ATTR_CSA_C_OFF_PRESP, -+ NL80211_ATTR_CNTDWN_OFFS_BEACON, -+ NL80211_ATTR_CNTDWN_OFFS_PRESP, - - NL80211_ATTR_RXMGMT_FLAGS, - -@@ -3052,6 +3052,8 @@ enum nl80211_attrs { - #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG - #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER - #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA -+#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON -+#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP - - /* - * Allow user space programs to use #ifdef on new attributes by defining them ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -663,8 +663,8 @@ static const struct nla_policy nl80211_p - [NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 }, - [NL80211_ATTR_CH_SWITCH_BLOCK_TX] = { .type = NLA_FLAG }, - [NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED }, -- [NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_BINARY }, -- [NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_BINARY }, -+ [NL80211_ATTR_CNTDWN_OFFS_BEACON] = { .type = NLA_BINARY }, -+ [NL80211_ATTR_CNTDWN_OFFS_PRESP] = { .type = NLA_BINARY }, - [NL80211_ATTR_STA_SUPPORTED_CHANNELS] = { .type = NLA_BINARY }, - [NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] = { .type = NLA_BINARY }, - [NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG }, -@@ -9064,10 +9064,10 @@ static int nl80211_channel_switch(struct - if (err) - return err; - -- if (!csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON]) -+ if (!csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON]) - return -EINVAL; - -- len = nla_len(csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON]); -+ len = nla_len(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON]); - if (!len || (len % sizeof(u16))) - return -EINVAL; - -@@ -9078,7 +9078,7 @@ static int nl80211_channel_switch(struct - return -EINVAL; - - params.counter_offsets_beacon = -- nla_data(csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON]); -+ nla_data(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON]); - - /* sanity checks - counters should fit and be the same */ - for (i = 0; i < params.n_counter_offsets_beacon; i++) { -@@ -9091,8 +9091,8 @@ static int nl80211_channel_switch(struct - return -EINVAL; - } - -- if (csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]) { -- len = nla_len(csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]); -+ if (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]) { -+ len = nla_len(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]); - if (!len || (len % sizeof(u16))) - return -EINVAL; - -@@ -9103,7 +9103,7 @@ static int nl80211_channel_switch(struct - return -EINVAL; - - params.counter_offsets_presp = -- nla_data(csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]); -+ nla_data(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]); - - /* sanity checks - counters should fit and be the same */ - for (i = 0; i < params.n_counter_offsets_presp; i++) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-001-ath11k-add-WDS-offload-changes-to-NSS-driver-interface.patch b/feeds/wifi-ax/mac80211/patches/qca/211-001-ath11k-add-WDS-offload-changes-to-NSS-driver-interface.patch index bc966aacf..b945b31b9 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/211-001-ath11k-add-WDS-offload-changes-to-NSS-driver-interface.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/211-001-ath11k-add-WDS-offload-changes-to-NSS-driver-interface.patch @@ -11,8 +11,10 @@ Signed-off-by: Sathishkumar Muruganandam drivers/net/wireless/ath/ath11k/nss.h | 36 ++- 2 files changed, 473 insertions(+), 28 deletions(-) ---- a/drivers/net/wireless/ath/ath11k/nss.c -+++ b/drivers/net/wireless/ath/ath11k/nss.c +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/nss.c +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/nss.c ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/nss.c @@ -7,9 +7,11 @@ #include "nss.h" #include "core.h" @@ -25,7 +27,7 @@ Signed-off-by: Sathishkumar Muruganandam #include "../../../../../net/mac80211/sta_info.h" /*-----------------------------ATH11K-NSS Helpers--------------------------*/ -@@ -323,6 +325,22 @@ void ath11k_nss_wifili_event_receive(str +@@ -304,6 +306,22 @@ void ath11k_nss_wifili_event_receive(str case NSS_WIFILI_TID_REOQ_SETUP_MSG: /* TODO setup tidq */ break; @@ -48,7 +50,7 @@ Signed-off-by: Sathishkumar Muruganandam default: ath11k_dbg(ab, ATH11K_DBG_NSS, "unhandled event %d\n", msg_type); break; -@@ -433,13 +451,6 @@ static void ath11k_nss_vdev_event_receiv +@@ -414,13 +432,6 @@ static void ath11k_nss_vdev_event_receiv /*TODO*/ } @@ -62,7 +64,7 @@ Signed-off-by: Sathishkumar Muruganandam /* TODO: move to mac80211 after cleanups/refactoring required after feature completion */ static int ath11k_nss_deliver_rx(struct ieee80211_vif *vif, struct sk_buff *skb, bool eth, int data_offs, struct napi_struct *napi) -@@ -563,11 +574,234 @@ static int ath11k_nss_undecap_nwifi(stru +@@ -544,11 +555,239 @@ static int ath11k_nss_undecap_nwifi(stru return 0; } @@ -265,6 +267,11 @@ Signed-off-by: Sathishkumar Muruganandam + + skb->dev = dev; + ++ dma_unmap_single(ab->dev, virt_to_phys(skb->head), ++ NSS_WIFI_VDEV_PER_PACKET_METADATA_OFFSET + ++ sizeof(struct nss_wifi_vdev_per_packet_metadata), ++ DMA_FROM_DEVICE); ++ + wifi_metadata = (struct nss_wifi_vdev_per_packet_metadata *)(skb->head + + NSS_WIFI_VDEV_PER_PACKET_METADATA_OFFSET); + @@ -298,7 +305,7 @@ Signed-off-by: Sathishkumar Muruganandam struct wireless_dev *wdev; struct ieee80211_vif *vif; struct ath11k_vif *arvif; -@@ -607,28 +841,16 @@ ath11k_nss_vdev_data_receive(struct net_ +@@ -588,28 +827,16 @@ ath11k_nss_vdev_data_receive(struct net_ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss: ", skb->data, skb->len); @@ -319,7 +326,7 @@ Signed-off-by: Sathishkumar Muruganandam - default: - ret = -EINVAL; - break; -+ if ((vif->type == NL80211_IFTYPE_STATION && vif->use_4addr) && ++ if ((vif->type == NL80211_IFTYPE_STATION && wdev->use_4addr) && + ath11k_nss_vdev_data_receive_mec_check(arvif->ar, skb)) { + dev_kfree_skb_any(skb); + return; @@ -334,12 +341,70 @@ Signed-off-by: Sathishkumar Muruganandam dev_kfree_skb_any(skb); return; } -@@ -1418,6 +1640,195 @@ peer_mem_free: - msg_free: - kfree(wlmsg); +@@ -1292,7 +1519,7 @@ void ath11k_nss_update_sta_rxrate(struct + ppdu_info->udp_msdu_count + ppdu_info->other_msdu_count; + } + +-int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr) ++int ath11k_nss_peer_delete(struct ath11k_base *ab, u32 vdev_id, u8 *addr) + { + struct nss_wifili_peer_msg *peer_msg; + struct nss_wifili_msg *wlmsg = NULL; +@@ -1306,9 +1533,10 @@ int ath11k_nss_peer_delete(struct ath11k + + spin_lock_bh(&ab->base_lock); + +- peer = ath11k_peer_find_by_addr(ab, addr); ++ peer = ath11k_peer_find(ab, vdev_id, addr); + if (!peer) { +- ath11k_warn(ab, "peer not found for nss peer delete\n"); ++ ath11k_warn(ab, "peer %pM not found on vdev_id %d for nss peer delete\n", ++ addr, vdev_id); + spin_unlock_bh(&ab->base_lock); + return -EINVAL; + } +@@ -1381,8 +1609,9 @@ free_peer: return ret; -+} + } + +-int ath11k_nss_peer_create(struct ath11k_base *ab, struct ath11k_peer *peer) ++int ath11k_nss_peer_create(struct ath11k *ar, struct ath11k_peer *peer) + { ++ struct ath11k_base *ab = ar->ab; + struct nss_wifili_peer_msg *peer_msg; + struct nss_wifili_msg *wlmsg = NULL; + nss_wifili_msg_callback_t msg_cb; +@@ -1439,17 +1668,23 @@ int ath11k_nss_peer_create(struct ath11k + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; +- ath11k_warn(ab, "nss send peer (%pM) create msg tx error\n", +- peer->addr); ++ ath11k_warn(ab, "nss send peer (%pM) create msg tx error: %d\n", ++ peer->addr, status); + goto peer_mem_free; + } + +- ret = 0; + ath11k_dbg(ab, ATH11K_DBG_NSS, + "nss peer_create msg success mac:%pM vdev:%d peer_id:%d hw_ast_idx:%d ast_hash:%d\n", + peer_msg->peer_mac_addr, peer_msg->vdev_id, peer_msg->peer_id, + peer_msg->hw_ast_idx, peer_msg->tx_ast_hash); + ++ ret = ath11k_peer_add_ast(ar, peer, peer->addr, ++ ATH11K_AST_TYPE_STATIC); ++ if (ret) { ++ ath11k_warn(ab, "failed to add STATIC ast: %d\n", ret); ++ goto peer_mem_free; ++ } + + peer->nss.nss_stats = kzalloc(sizeof(*peer->nss.nss_stats), GFP_ATOMIC); + if (!peer->nss.nss_stats) { + ret = -ENOMEM; +@@ -1468,6 +1703,199 @@ msg_free: + return ret; + } + +int ath11k_nss_add_wds_peer(struct ath11k *ar, struct ath11k_peer *peer, + u8 *dest_mac, enum ath11k_ast_entry_type type) +{ @@ -377,7 +442,8 @@ Signed-off-by: Sathishkumar Muruganandam + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; -+ ath11k_warn(ab, "nss send wds add peer msg tx error\n"); ++ ath11k_warn(ab, "nss send wds add peer msg tx error: %d\n", ++ status); + goto msg_free; + } + @@ -422,7 +488,8 @@ Signed-off-by: Sathishkumar Muruganandam + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; -+ ath11k_warn(ab, "nss send wds update peer msg tx error\n"); ++ ath11k_warn(ab, "nss send wds update peer msg tx error: %d\n", ++ status); + goto msg_free; + } + @@ -471,7 +538,8 @@ Signed-off-by: Sathishkumar Muruganandam + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; -+ ath11k_warn(ab, "nss send wds peer map msg tx error\n"); ++ ath11k_warn(ab, "nss send wds peer map msg tx error: %d\n", ++ status); + goto msg_free; + } + @@ -516,7 +584,8 @@ Signed-off-by: Sathishkumar Muruganandam + status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { + ret = -EINVAL; -+ ath11k_warn(ab, "nss send wds del peer msg tx error\n"); ++ ath11k_warn(ab, "nss send wds del peer msg tx error: %d\n", ++ status); + goto msg_free; + } + @@ -527,11 +596,34 @@ Signed-off-by: Sathishkumar Muruganandam +msg_free: + kfree(wlmsg); + return ret; - } - ++} ++ /*-------------------------------INIT/DEINIT---------------------------------*/ ---- a/drivers/net/wireless/ath/ath11k/nss.h -+++ b/drivers/net/wireless/ath/ath11k/nss.h + + static int ath11k_nss_radio_buf_cfg(struct ath11k *ar, int range, int buf_sz) +@@ -1860,7 +2288,7 @@ static int ath11k_nss_init(struct ath11k + + status = nss_wifili_tx_msg(nss_contex, wlmsg); + if (status != NSS_TX_SUCCESS) { +- ath11k_warn(ab, "failure to send nss init msg\n"); ++ ath11k_warn(ab, "failure to send nss init msg: %d \n", status); + goto unregister; + } + +@@ -1914,7 +2342,8 @@ static int ath11k_nss_stats_cfg(struct a + + status = nss_wifili_tx_msg(ar->nss.ctx, wlmsg); + if (status != NSS_TX_SUCCESS) { +- ath11k_warn(ab, "nss stats cfg %d msg tx failure\n", nss_msg); ++ ath11k_warn(ab, "nss stats cfg %d msg tx failure: %d\n", ++ nss_msg, status); + ret = -EINVAL; + goto free; + } +Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/nss.h +=================================================================== +--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/nss.h ++++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/nss.h @@ -14,11 +14,13 @@ struct ath11k_base; struct ath11k_vif; struct ath11k_peer; @@ -547,10 +639,17 @@ Signed-off-by: Sathishkumar Muruganandam /* WIFILI Supported Target Types */ #define ATH11K_WIFILI_TARGET_TYPE_UNKNOWN 0xFF -@@ -180,6 +182,14 @@ int ath11k_nss_vdev_up(struct ath11k_vif +@@ -193,11 +195,19 @@ int ath11k_nss_vdev_create(struct ath11k + void ath11k_nss_vdev_delete(struct ath11k_vif *arvif); + int ath11k_nss_vdev_up(struct ath11k_vif *arvif); int ath11k_nss_vdev_down(struct ath11k_vif *arvif); - int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr); - int ath11k_nss_peer_create(struct ath11k_base *ab, struct ath11k_peer *peer); +-int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr); ++int ath11k_nss_peer_delete(struct ath11k_base *ab, u32 vdev_id, u8 *addr); + int ath11k_nss_set_peer_authorize(struct ath11k *ar, u16 peer_id); +-int ath11k_nss_peer_create(struct ath11k_base *ab, struct ath11k_peer *peer); ++int ath11k_nss_peer_create(struct ath11k *ar, struct ath11k_peer *peer); + void ath11k_nss_peer_stats_enable(struct ath11k *ar); + void ath11k_nss_peer_stats_disable(struct ath11k *ar); +int ath11k_nss_add_wds_peer(struct ath11k *ar, struct ath11k_peer *peer, + u8 *dest_mac, enum ath11k_ast_entry_type type); +int ath11k_nss_update_wds_peer(struct ath11k *ar, struct ath11k_peer *peer, @@ -562,11 +661,18 @@ Signed-off-by: Sathishkumar Muruganandam int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, struct ieee80211_key_conf *key_conf); void ath11k_nss_update_sta_stats(struct station_info *sinfo, -@@ -242,6 +252,30 @@ static inline int ath11k_nss_peer_create +@@ -256,12 +266,37 @@ static inline int ath11k_nss_vdev_down(s + return 0; + } + +-static inline int ath11k_nss_peer_delete(struct ath11k_base *ab, u8 *addr) ++static inline int ath11k_nss_peer_delete(struct ath11k_base *ab, u32 vdev_id, ++ u8 *addr) { return 0; } -+ + +-static inline int ath11k_nss_peer_create(struct ath11k_base *ab, struct ath11k_peer *peer) +static inline int ath11k_nss_add_wds_peer(struct ath11k *ar, struct ath11k_peer *peer, + u8 *dest_mac, enum ath11k_ast_entry_type type) +{ @@ -590,6 +696,8 @@ Signed-off-by: Sathishkumar Muruganandam +{ + return 0; +} - - static inline int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, - struct ieee80211_key_conf *key_conf) ++ ++static inline int ath11k_nss_peer_create(struct ath11k *ar, struct ath11k_peer *peer) + { + return 0; + } diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-002-ath11k-add-WDS-offload-support-on-NSS-offload-for-STA-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/211-002-ath11k-add-WDS-offload-support-on-NSS-offload-for-STA-mode.patch index dac439423..bf9dd253c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/211-002-ath11k-add-WDS-offload-support-on-NSS-offload-for-STA-mode.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/211-002-ath11k-add-WDS-offload-support-on-NSS-offload-for-STA-mode.patch @@ -24,11 +24,9 @@ Signed-off-by: Sathishkumar Muruganandam drivers/net/wireless/ath/ath11k/wmi.h | 33 +++ 8 files changed, 658 insertions(+), 14 deletions(-) -diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h -index 5eced25171d8..ebd5711237a2 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -527,6 +527,7 @@ struct ath11k { +@@ -539,6 +539,7 @@ struct ath11k { struct ath11k_pdev_wmi *wmi; #ifdef CPTCFG_ATH11K_NSS_SUPPORT struct ath11k_nss nss; @@ -36,7 +34,7 @@ index 5eced25171d8..ebd5711237a2 100644 #endif struct ath11k_pdev_dp dp; u8 mac_addr[ETH_ALEN]; -@@ -843,8 +844,12 @@ struct ath11k_base { +@@ -857,8 +858,12 @@ struct ath11k_base { u32 fw_crash_counter; } stats; struct ath11k_ftm_event_obj ftm_event_obj; @@ -48,22 +46,10 @@ index 5eced25171d8..ebd5711237a2 100644 + struct ath11k_dbring_cap *db_caps; u32 num_db_cap; - u32 sw_pdev_id_map[MAX_RADIOS]; -@@ -992,9 +997,6 @@ extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390 - extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[]; - extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[]; --void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); --void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, -- u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); - struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, - const u8 *addr); - struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, -diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h -index b29f364c1ac9..b2484e0722bb 100644 --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -1130,13 +1130,15 @@ struct htt_t2h_peer_map_event { +@@ -1149,13 +1149,16 @@ struct htt_t2h_peer_map_event { #define HTT_T2H_PEER_UNMAP_INFO_PEER_ID HTT_T2H_PEER_MAP_INFO_PEER_ID #define HTT_T2H_PEER_UNMAP_INFO1_MAC_ADDR_H16 \ HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16 @@ -71,21 +57,20 @@ index b29f364c1ac9..b2484e0722bb 100644 -#define HTT_T2H_PEER_MAP_INFO1_NEXT_HOP_S HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_S +#define HTT_T2H_PEER_UNMAP_INFO1_NEXT_HOP_M HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_M +#define HTT_T2H_PEER_UNMAP_INFO1_NEXT_HOP_S HTT_T2H_PEER_MAP_INFO2_NEXT_HOP_S -+#define HTT_T2H_PEER_UNMAP_INFO2_WDS_FREE_COUNT GENMASK(15, 0) ++#define HTT_T2H_PEER_UNMAP_INFO3_WDS_FREE_COUNT GENMASK(15, 0) struct htt_t2h_peer_unmap_event { u32 info; u32 mac_addr_l32; u32 info1; + u32 info2; ++ u32 info3; } __packed; struct htt_resp_msg { -diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c -index 76fda6765f77..e6df30b949b3 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1759,6 +1759,8 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, +@@ -1795,6 +1795,8 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s u16 peer_mac_h16; u16 ast_hash; u16 hw_peer_id; @@ -94,7 +79,7 @@ index 76fda6765f77..e6df30b949b3 100644 ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); -@@ -1795,15 +1797,25 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, +@@ -1830,15 +1832,25 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s resp->peer_map_ev.info2); hw_peer_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID, resp->peer_map_ev.info1); @@ -116,18 +101,16 @@ index 76fda6765f77..e6df30b949b3 100644 + resp->peer_unmap_ev.info); + is_wds = FIELD_GET(HTT_T2H_PEER_UNMAP_INFO1_NEXT_HOP_M, + resp->peer_unmap_ev.info1); -+ free_wds_count = FIELD_GET(HTT_T2H_PEER_UNMAP_INFO2_WDS_FREE_COUNT, -+ resp->peer_unmap_ev.info2); ++ free_wds_count = FIELD_GET(HTT_T2H_PEER_UNMAP_INFO3_WDS_FREE_COUNT, ++ resp->peer_unmap_ev.info3); + ath11k_peer_unmap_v2_event(ab, peer_id, is_wds, free_wds_count); + break; case HTT_T2H_MSG_TYPE_PPDU_STATS_IND: ath11k_htt_pull_ppdu_stats(ab, skb); break; -diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c -index e529a79bbb22..aac08b05bf57 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -449,7 +449,7 @@ ath11k_dp_tx_process_htt_tx_complete(struct ath11k_base *ab, +@@ -464,7 +464,7 @@ ath11k_dp_tx_process_htt_tx_complete(str break; case HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY: /* This event is to be handled only when the driver decides to @@ -136,11 +119,9 @@ index e529a79bbb22..aac08b05bf57 100644 */ break; default: -diff --git a/drivers/net/wireless/ath/ath11k/peer.c b/drivers/net/wireless/ath/ath11k/peer.c -index 3b0998cd44b0..e8e04eb7e07a 100644 --- a/drivers/net/wireless/ath/ath11k/peer.c +++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -91,6 +91,283 @@ struct ath11k_peer *ath11k_peer_find_by_ast(struct ath11k_base *ab, +@@ -108,6 +108,285 @@ struct ath11k_peer *ath11k_peer_find_by_ return NULL; } @@ -407,7 +388,9 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 + + list_for_each_entry_safe(ast_entry, tmp, &peer->ast_entry_list, + ase_list) { -+ ast_deleted_count++; ++ if ((ast_entry->type == ATH11K_AST_TYPE_WDS) || ++ (ast_entry->type == ATH11K_AST_TYPE_MEC)) ++ ast_deleted_count++; + ath11k_peer_del_ast(ar, ast_entry); + } + @@ -424,7 +407,7 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id) { struct ath11k_peer *peer; -@@ -115,6 +392,49 @@ exit: +@@ -132,11 +411,57 @@ exit: spin_unlock_bh(&ab->base_lock); } @@ -474,16 +457,39 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, u8 *mac_addr, u16 ast_hash, u16 hw_peer_id) { -@@ -145,6 +465,51 @@ exit: - spin_unlock_bh(&ab->base_lock); - } + struct ath11k_peer *peer; ++ struct ath11k *ar = NULL; ++ rcu_read_lock(); ++ ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); + spin_lock_bh(&ab->base_lock); + peer = ath11k_peer_find(ab, vdev_id, mac_addr); + if (!peer) { +@@ -151,8 +476,8 @@ void ath11k_peer_map_event(struct ath11k + ether_addr_copy(peer->addr, mac_addr); + list_add(&peer->list, &ab->peers); + wake_up(&ab->peer_mapping_wq); +- if (ab->nss.enabled) +- ath11k_nss_peer_create(ab, peer); ++ if (ab->nss.enabled && ar) ++ ath11k_nss_peer_create(ar, peer); + } + + ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "htt peer map vdev %d peer %pM id %d\n", +@@ -160,6 +485,67 @@ void ath11k_peer_map_event(struct ath11k + + exit: + spin_unlock_bh(&ab->base_lock); ++ rcu_read_unlock(); ++} ++ +void ath11k_peer_map_v2_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, + u8 *mac_addr, u16 ast_hash, u16 hw_peer_id, + bool is_wds) +{ + struct ath11k_peer *peer; + struct ath11k *ar = NULL; ++ int ret; + + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); @@ -491,8 +497,12 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 + peer = ath11k_peer_find(ab, vdev_id, mac_addr); + if (!peer && !is_wds) { + peer = kzalloc(sizeof(*peer), GFP_ATOMIC); -+ if (!peer) ++ if (!peer) { ++ ath11k_warn(ab, "failed to allocated peer for %pM vdev_id %d\n", ++ mac_addr, vdev_id); ++ spin_unlock_bh(&ab->base_lock); + goto exit; ++ } + + peer->vdev_id = vdev_id; + peer->peer_id = peer_id; @@ -501,12 +511,15 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 + ether_addr_copy(peer->addr, mac_addr); + list_add(&peer->list, &ab->peers); + INIT_LIST_HEAD(&peer->ast_entry_list); -+ wake_up(&ab->peer_mapping_wq); + if (ab->nss.enabled && ar) { -+ ath11k_nss_peer_create(ab, peer); -+ ath11k_peer_add_ast(ar, peer, mac_addr, -+ ATH11K_AST_TYPE_STATIC); ++ ret = ath11k_nss_peer_create(ar, peer); ++ if (ret) { ++ ath11k_warn(ab, "failed to do nss peer create: %d\n", ++ ret); ++ goto peer_free; ++ } + } ++ wake_up(&ab->peer_mapping_wq); + } + + if (is_wds) @@ -518,15 +531,20 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 + ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "htt peer map vdev %d peer %pM id %d is_wds %d\n", + vdev_id, mac_addr, peer_id, is_wds); + ++ spin_unlock_bh(&ab->base_lock); ++ goto exit; ++ ++peer_free: ++ spin_unlock_bh(&ab->base_lock); ++ mutex_lock(&ar->conf_mutex); ++ ath11k_peer_delete(ar, vdev_id, mac_addr); ++ mutex_unlock(&ar->conf_mutex); +exit: + rcu_read_unlock(); -+ spin_unlock_bh(&ab->base_lock); -+} -+ + } + static int ath11k_wait_for_peer_common(struct ath11k_base *ab, int vdev_id, - const u8 *addr, bool expect_mapped) - { -@@ -169,19 +534,29 @@ static int ath11k_wait_for_peer_common(struct ath11k_base *ab, int vdev_id, +@@ -186,19 +572,29 @@ static int ath11k_wait_for_peer_common(s void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id) { @@ -558,7 +576,16 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 list_del(&peer->list); kfree(peer); ar->num_peers--; -@@ -253,6 +628,7 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, +@@ -242,7 +638,7 @@ int ath11k_peer_delete(struct ath11k *ar + + reinit_completion(&ar->peer_delete_done); + +- ath11k_nss_peer_delete(ar->ab, addr); ++ ath11k_nss_peer_delete(ar->ab, vdev_id, addr); + + ret = ath11k_wmi_send_peer_delete_cmd(ar, addr, vdev_id); + if (ret) { +@@ -270,6 +666,7 @@ int ath11k_peer_create(struct ath11k *ar struct ieee80211_sta *sta, struct peer_create_params *param) { struct ath11k_peer *peer; @@ -566,7 +593,7 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 int ret; lockdep_assert_held(&ar->conf_mutex); -@@ -316,7 +692,14 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, +@@ -337,7 +734,14 @@ int ath11k_peer_create(struct ath11k *ar peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; @@ -574,7 +601,7 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 + peer->vif = vif; + +#ifdef CPTCFG_ATH11K_NSS_SUPPORT -+ if (vif->type == NL80211_IFTYPE_STATION && vif->use_4addr) ++ if (vif->type == NL80211_IFTYPE_STATION && ar->ab->nss.enabled) + ar->bss_peer = peer; + else + ar->bss_peer = NULL; @@ -582,8 +609,6 @@ index 3b0998cd44b0..e8e04eb7e07a 100644 ar->num_peers++; -diff --git a/drivers/net/wireless/ath/ath11k/peer.h b/drivers/net/wireless/ath/ath11k/peer.h -index d52ec8a2d8e6..617d4c944b13 100644 --- a/drivers/net/wireless/ath/ath11k/peer.h +++ b/drivers/net/wireless/ath/ath11k/peer.h @@ -17,6 +17,49 @@ struct ppdu_user_delayba { @@ -659,10 +684,10 @@ index d52ec8a2d8e6..617d4c944b13 100644 struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, const u8 *addr); struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, -@@ -62,5 +112,72 @@ int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr); - int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, - struct ieee80211_sta *sta, struct peer_create_params *param); - int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, const u8 *addr); +@@ -66,4 +116,72 @@ int ath11k_wait_for_peer_delete_done(str + struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab, + int vdev_id); + +#ifdef CPTCFG_ATH11K_NSS_SUPPORT +struct ath11k_ast_entry *ath11k_peer_ast_find_by_addr(struct ath11k_base *ab, + u8* addr); @@ -729,14 +754,12 @@ index d52ec8a2d8e6..617d4c944b13 100644 +{ + return NULL; +} - ++ +#endif /* CPTCFG_ATH11K_NSS_SUPPORT */ #endif /* _PEER_H_ */ -diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c -index fe013e481848..e7a9c911b53c 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -139,8 +139,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = { +@@ -139,8 +139,8 @@ static const struct wmi_tlv_policy wmi_t = { .min_len = sizeof(struct wmi_tpc_stats_event_fixed_param) }, [WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT] = { .min_len = sizeof(struct wmi_pdev_update_muedca_event) }, @@ -747,7 +770,7 @@ index fe013e481848..e7a9c911b53c 100644 }; #define PRIMAP(_hw_mode_) \ -@@ -1108,6 +1108,51 @@ int ath11k_wmi_send_peer_delete_cmd(struct ath11k *ar, +@@ -1067,6 +1067,51 @@ int ath11k_wmi_send_peer_delete_cmd(stru return ret; } @@ -799,7 +822,7 @@ index fe013e481848..e7a9c911b53c 100644 int ath11k_wmi_send_pdev_set_regdomain(struct ath11k *ar, struct pdev_set_regdomain_params *param) { -@@ -5496,6 +5541,36 @@ static int ath11k_pull_peer_assoc_conf_ev(struct ath11k_base *ab, struct sk_buff +@@ -5729,6 +5774,36 @@ static int ath11k_pull_peer_assoc_conf_e return 0; } @@ -836,7 +859,7 @@ index fe013e481848..e7a9c911b53c 100644 static void ath11k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src, struct ath11k_fw_stats_pdev *dst) { -@@ -6217,6 +6292,7 @@ static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len, +@@ -6443,6 +6518,7 @@ static int ath11k_wmi_tlv_rdy_parse(stru ether_addr_copy(ab->mac_addr, fixed_param.ready_event_min.mac_addr.addr); @@ -844,10 +867,10 @@ index fe013e481848..e7a9c911b53c 100644 ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; ab->wmi_ready = true; break; -@@ -7819,6 +7895,22 @@ static void ath11k_probe_resp_tx_status_event(struct ath11k_base *ab, - kfree(tb); +@@ -8097,6 +8173,22 @@ static void ath11k_bcn_tx_status_event(s } + +static void ath11k_wmi_wds_peer_event(struct ath11k_base *ab, + struct sk_buff *skb) +{ @@ -867,9 +890,9 @@ index fe013e481848..e7a9c911b53c 100644 static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) { struct wmi_cmd_hdr *cmd_hdr; -@@ -7917,6 +8009,9 @@ static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) - case WMI_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID: - ath11k_probe_resp_tx_status_event(ab, skb); +@@ -8195,6 +8287,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_TWT_ADD_DIALOG_EVENTID: + ath11k_wmi_twt_add_dialog_event(ab, skb); break; + case WMI_WDS_PEER_EVENTID: + ath11k_wmi_wds_peer_event(ab, skb); @@ -877,11 +900,9 @@ index fe013e481848..e7a9c911b53c 100644 /* add Unsupported events here */ case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: case WMI_PEER_OPER_MODE_CHANGE_EVENTID: -diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h -index 6e5718b48267..c12c910672c9 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2999,6 +2999,21 @@ struct wmi_peer_delete_cmd { +@@ -2990,6 +2990,21 @@ struct wmi_peer_delete_cmd { struct wmi_mac_addr peer_macaddr; } __packed; @@ -903,7 +924,7 @@ index 6e5718b48267..c12c910672c9 100644 struct wmi_peer_reorder_queue_setup_cmd { u32 tlv_header; u32 vdev_id; -@@ -4306,6 +4321,21 @@ struct wmi_probe_resp_tx_status_event { +@@ -4296,6 +4311,21 @@ struct wmi_probe_resp_tx_status_event { u32 tx_status; } __packed; @@ -925,7 +946,7 @@ index 6e5718b48267..c12c910672c9 100644 /* * PDEV statistics */ -@@ -5673,6 +5703,9 @@ int ath11k_wmi_set_sta_ps_param(struct ath11k *ar, u32 vdev_id, +@@ -5844,6 +5874,9 @@ int ath11k_wmi_set_sta_ps_param(struct a int ath11k_wmi_force_fw_hang_cmd(struct ath11k *ar, u32 type, u32 delay_time_ms); int ath11k_wmi_send_peer_delete_cmd(struct ath11k *ar, const u8 *peer_addr, u8 vdev_id); @@ -935,6 +956,3 @@ index 6e5718b48267..c12c910672c9 100644 int ath11k_wmi_vdev_delete(struct ath11k *ar, u8 vdev_id); void ath11k_wmi_start_scan_init(struct ath11k *ar, struct scan_req_params *arg); int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, --- -2.7.4 - diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-Resolve-firmware-crash-on-monitor-delete.patch b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-Resolve-firmware-crash-on-monitor-delete.patch deleted file mode 100644 index 610a34fc0..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-Resolve-firmware-crash-on-monitor-delete.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 3f4b7a9f1318050ae4022701050d6be3abd1632c Mon Sep 17 00:00:00 2001 -From: Aloka Dixit -Date: Mon, 28 Sep 2020 11:43:42 -0700 -Subject: [PATCH] ath11k: Resolve firmware crash on monitor delete - -Monitor interface is not added in pdev->ar->arvifs list during creation. -When this interface is deleted, ath11k_mac_get_ar_from_arvif_list() -returns NULL hence complete() is not called. -This results in timeout ath11k_mac_monitor_vdev_delete() which returns -without resetting monitor related context. - -When multiple VAPs are added on same radio, same monitor interface gets -deleted twice through ath11k_mac_op_remove_interface() resulting in -firmware crash. - -Signed-off-by: Aloka Dixit ---- - drivers/net/wireless/ath/ath11k/mac.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -574,6 +574,9 @@ struct ath11k *ath11k_mac_get_ar_from_ar - if (pdev && pdev->ar) { - ar = pdev->ar; - -+ if (ar->monitor_vdev_id == vdev_id) -+ return ar; -+ - spin_lock_bh(&ar->data_lock); - list_for_each_entry(arvif, &ar->arvifs, list) { - if (arvif->vdev_id == vdev_id) { -@@ -5927,6 +5930,7 @@ static void ath11k_mac_op_remove_interfa - vif->addr, arvif->vdev_id); - - if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { -+ ar->monitor_vdev_id = -1; - ar->monitor_vdev_created = false; - } - else if (ar->monitor_vdev_created && !ar->monitor_started) ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -2664,7 +2664,7 @@ struct wmi_ssid { - u32 ssid[8]; - } __packed; - --#define ATH11K_VDEV_SETUP_TIMEOUT_HZ (1 * HZ) -+#define ATH11K_VDEV_SETUP_TIMEOUT_HZ (3 * HZ) - - struct wmi_vdev_start_request_cmd { - u32 tlv_header; diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-add-obss-pd-support.patch b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-add-obss-pd-support.patch index 8cf257e7b..b029b275b 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-add-obss-pd-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-add-obss-pd-support.patch @@ -12,67 +12,51 @@ Signed-off-by: Rajkumar Manoharan net/wireless/nl80211.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -2718,7 +2718,8 @@ static int ath11k_mac_config_obss_pd(str + { + u32 bitmap[2], param_id, param_val, pdev_id; + int ret; +- s8 non_srg_th = 0, srg_th = 0; ++ s8 non_srg_th = ATH11K_OBSS_PD_THRESHOLD_DISABLED; ++ s8 srg_th = 0; + + pdev_id = ar->pdev->pdev_id; + +@@ -2747,8 +2748,6 @@ static int ath11k_mac_config_obss_pd(str + if (he_obss_pd->sr_ctrl & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) + non_srg_th = (ATH11K_OBSS_PD_MAX_THRESHOLD + + he_obss_pd->non_srg_max_offset); +- else +- non_srg_th = ATH11K_OBSS_PD_NON_SRG_MAX_THRESHOLD; + + param_val |= ATH11K_OBSS_PD_NON_SRG_EN; + } +@@ -2763,7 +2762,8 @@ static int ath11k_mac_config_obss_pd(str + param_val |= ATH11K_OBSS_PD_THRESHOLD_IN_DBM; + param_val |= FIELD_PREP(GENMASK(15, 8), srg_th); + } else { +- non_srg_th -= ATH11K_DEFAULT_NOISE_FLOOR; ++ if ((non_srg_th & 0xff) != ATH11K_OBSS_PD_THRESHOLD_DISABLED) ++ non_srg_th -= ATH11K_DEFAULT_NOISE_FLOOR; + /* SRG not supported and threshold in dB */ + param_val &= ~(ATH11K_OBSS_PD_SRG_EN | + ATH11K_OBSS_PD_THRESHOLD_IN_DBM); +--- a/drivers/net/wireless/ath/ath11k/mac.h ++++ b/drivers/net/wireless/ath/ath11k/mac.h +@@ -120,7 +120,7 @@ struct ath11k_generic_iter { + #define ATH11K_PEER_RX_NSS_80_80MHZ GENMASK(5, 3) + + #define ATH11K_OBSS_PD_MAX_THRESHOLD -82 +-#define ATH11K_OBSS_PD_NON_SRG_MAX_THRESHOLD -62 ++#define ATH11K_OBSS_PD_THRESHOLD_DISABLED 128 + #define ATH11K_OBSS_PD_THRESHOLD_IN_DBM BIT(29) + #define ATH11K_OBSS_PD_SRG_EN BIT(30) + #define ATH11K_OBSS_PD_NON_SRG_EN BIT(31) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -322,6 +322,13 @@ he_obss_pd_policy[NL80211_HE_OBSS_PD_ATT - NLA_POLICY_RANGE(NLA_U8, 1, 20), - [NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET] = - NLA_POLICY_RANGE(NLA_U8, 1, 20), -+ [NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET] = -+ NLA_POLICY_RANGE(NLA_U8, 1, 20), -+ [NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP] = -+ NLA_POLICY_EXACT_LEN(8), -+ [NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP] = -+ NLA_POLICY_EXACT_LEN(8), -+ [NL80211_HE_OBSS_PD_ATTR_SR_CTRL] = { .type = NLA_U8 }, - }; - - static const struct nla_policy -@@ -4844,18 +4851,36 @@ static int nl80211_parse_he_obss_pd(stru - if (err) - return err; - -- if (!tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET] || -- !tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]) -+ if (!tb[NL80211_HE_OBSS_PD_ATTR_SR_CTRL]) - return -EINVAL; - -- he_obss_pd->min_offset = -- nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]); -- he_obss_pd->max_offset = -- nla_get_u32(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]); -+ he_obss_pd->sr_ctrl = nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_SR_CTRL]); -+ -+ if (tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]) -+ he_obss_pd->min_offset = -+ nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET]); -+ if (tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]) -+ he_obss_pd->max_offset = -+ nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET]); -+ if (tb[NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET]) -+ he_obss_pd->non_srg_max_offset = -+ nla_get_u8(tb[NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET]); - -- if (he_obss_pd->min_offset >= he_obss_pd->max_offset) -+ if (he_obss_pd->min_offset > he_obss_pd->max_offset) - return -EINVAL; - -+ if (tb[NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP]) { -+ memcpy(he_obss_pd->bss_color_bitmap, -+ nla_data(tb[NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP]), -+ sizeof(he_obss_pd->bss_color_bitmap)); -+ } -+ -+ if (tb[NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP]) { -+ memcpy(he_obss_pd->partial_bssid_bitmap, -+ nla_data(tb[NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP]), -+ sizeof(he_obss_pd->partial_bssid_bitmap)); -+ } -+ - he_obss_pd->enable = true; - - return 0; -@@ -5239,7 +5264,8 @@ static int nl80211_start_ap(struct sk_bu +@@ -5531,7 +5531,8 @@ static int nl80211_start_ap(struct sk_bu err = nl80211_parse_he_obss_pd( info->attrs[NL80211_ATTR_HE_OBSS_PD], ¶ms.he_obss_pd); @@ -82,574 +66,3 @@ Signed-off-by: Rajkumar Manoharan } if (info->attrs[NL80211_ATTR_HE_BSS_COLOR]) { ---- a/include/linux/ieee80211.h -+++ b/include/linux/ieee80211.h -@@ -2294,8 +2294,11 @@ ieee80211_he_6ghz_oper(const struct ieee - } - - /* HE Spatial Reuse defines */ --#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x4 --#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x8 -+#define IEEE80211_HE_SPR_PSR_DISALLOWED BIT(0) -+#define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED BIT(1) -+#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT BIT(2) -+#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT BIT(3) -+#define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED BIT(4) - - /* - * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -255,13 +255,23 @@ struct ieee80211_rate { - * struct ieee80211_he_obss_pd - AP settings for spatial reuse - * - * @enable: is the feature enabled. -+ * @sr_ctrl: The SR Control field of SRP element. -+ * @non_srg_max_offset: non-SRG maximum tx power offset - * @min_offset: minimal tx power offset an associated station shall use - * @max_offset: maximum tx power offset an associated station shall use -+ * @bss_color_bitmap: bitmap that indicates the BSS color values used by -+ * members of the SRG -+ * @partial_bssid_bitmap: bitmap that indicates the partial BSSID values -+ * used by members of the SRG - */ - struct ieee80211_he_obss_pd { - bool enable; -+ u8 sr_ctrl; -+ u8 non_srg_max_offset; - u8 min_offset; - u8 max_offset; -+ u8 bss_color_bitmap[8]; -+ u8 partial_bssid_bitmap[8]; - }; - - /** ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -6992,6 +6992,13 @@ enum nl80211_peer_measurement_ftm_resp { - * - * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset. - * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset. -+ * @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum -+ * tx power offset. -+ * @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color -+ * values used by members of the SRG. -+ * @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial -+ * BSSID values used by members of the SRG. -+ * @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element. - * - * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal - * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute. -@@ -7001,6 +7008,10 @@ enum nl80211_obss_pd_attributes { - - NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, - NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, -+ NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, -+ NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, -+ NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, -+ NL80211_HE_OBSS_PD_ATTR_SR_CTRL, - - /* keep last */ - __NL80211_HE_OBSS_PD_ATTR_LAST, ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2768,6 +2768,137 @@ static void ath11k_mac_op_nss_bss_info_c - mutex_unlock(&ar->conf_mutex); - } - -+static void ath11k_mac_config_obss_pd(struct ath11k *ar, -+ struct ieee80211_he_obss_pd *he_obss_pd) -+{ -+ u32 bitmap[2], param_id, param_val, pdev_id; -+ int ret; -+ s8 non_srg_th = 0, srg_th = 0; -+ -+ pdev_id = ar->pdev->pdev_id; -+ -+ /* Set and enable SRG/non-SRG OBSS PD Threshold */ -+ param_id = WMI_PDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD; -+ if (ar->monitor_started) { -+ ret = ath11k_wmi_pdev_set_param(ar, param_id, 0, pdev_id); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set obss_pd_threshold for pdev: %u\n", -+ pdev_id); -+ return; -+ } -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, -+ "OBSS PD Params: sr_ctrl %x non_srg_thres %u srg_max %u\n", -+ he_obss_pd->sr_ctrl, he_obss_pd->non_srg_max_offset, -+ he_obss_pd->max_offset); -+ -+ param_val = 0; -+ if (he_obss_pd->sr_ctrl & -+ IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED) { -+ non_srg_th = ATH11K_OBSS_PD_MAX_THRESHOLD; -+ } else { -+ if (he_obss_pd->sr_ctrl & -+ IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) -+ non_srg_th = (ATH11K_OBSS_PD_MAX_THRESHOLD + -+ he_obss_pd->non_srg_max_offset); -+ else -+ non_srg_th = ATH11K_OBSS_PD_NON_SRG_MAX_THRESHOLD; -+ param_val |= ATH11K_OBSS_PD_NON_SRG_EN; -+ } -+ -+ if (he_obss_pd->sr_ctrl & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) { -+ srg_th = ATH11K_OBSS_PD_MAX_THRESHOLD + he_obss_pd->max_offset; -+ param_val |= ATH11K_OBSS_PD_SRG_EN; -+ } -+ -+ if (test_bit(WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT, -+ ar->ab->wmi_ab.svc_map)) { -+ param_val |= ATH11K_OBSS_PD_THRESHOLD_IN_DBM; -+ param_val |= ((u16)(srg_th << 7) & 0xff00); -+ } else { -+ non_srg_th -= ATH11K_DEFAULT_NOISE_FLOOR; -+ /* SRG not supported and threshold in dB */ -+ param_val &= ~(ATH11K_OBSS_PD_SRG_EN | -+ ATH11K_OBSS_PD_THRESHOLD_IN_DBM); -+ } -+ -+ param_val |= (non_srg_th & 0xff); -+ ret = ath11k_wmi_pdev_set_param(ar, param_id, param_val, pdev_id); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set obss_pd_threshold for pdev: %u\n", -+ pdev_id); -+ -+ /* Enable OBSS PD for all access category */ -+ param_id = WMI_PDEV_PARAM_SET_CMD_OBSS_PD_PER_AC; -+ param_val = 0xf; -+ ret = ath11k_wmi_pdev_set_param(ar, param_id, param_val, pdev_id); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set obss_pd_per_ac for pdev: %u\n", -+ pdev_id); -+ -+ /* Set SR Prohibit */ -+ param_id = WMI_PDEV_PARAM_ENABLE_SR_PROHIBIT; -+ param_val = !!(he_obss_pd->sr_ctrl & -+ IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED); -+ ret = ath11k_wmi_pdev_set_param(ar, param_id, param_val, pdev_id); -+ if (ret) -+ ath11k_warn(ar->ab, "Failed to set sr_prohibit for pdev: %u\n", -+ pdev_id); -+ -+ if (!test_bit(WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT, -+ ar->ab->wmi_ab.svc_map)) -+ return; -+ -+ /* Set SRG BSS Color Bitmap */ -+ memcpy(bitmap, he_obss_pd->bss_color_bitmap, sizeof(bitmap)); -+ ret = ath11k_wmi_pdev_set_srg_bss_color_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set bss_color_bitmap for pdev: %u\n", -+ pdev_id); -+ -+ /* Set SRG Partial BSSID Bitmap */ -+ memcpy(bitmap, he_obss_pd->partial_bssid_bitmap, sizeof(bitmap)); -+ ret = ath11k_wmi_pdev_set_srg_patial_bssid_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set partial_bssid_bitmap for pdev: %u\n", -+ pdev_id); -+ -+ memset(bitmap, 0xff, sizeof(bitmap)); -+ -+ /* Enable all BSS Colors for SRG */ -+ ret = ath11k_wmi_pdev_srg_obss_color_enable_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set srg_color_en_bitmap pdev: %u\n", -+ pdev_id); -+ -+ /* Enable all patial BSSID mask for SRG */ -+ ret = ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set srg_bssid_en_bitmap pdev: %u\n", -+ pdev_id); -+ -+ /* Enable all BSS Colors for non-SRG */ -+ ret = ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set non_srg_color_en_bitmap pdev: %u\n", -+ pdev_id); -+ -+ /* Enable all patial BSSID mask for non-SRG */ -+ ret = ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(ar, bitmap); -+ if (ret) -+ ath11k_warn(ar->ab, -+ "Failed to set non_srg_bssid_en_bitmap pdev: %u\n", -+ pdev_id); -+} -+ - static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_bss_conf *info, -@@ -3006,8 +3137,7 @@ static void ath11k_mac_op_bss_info_chang - } - - if (changed & BSS_CHANGED_HE_OBSS_PD) -- ath11k_wmi_send_obss_spr_cmd(ar, arvif->vdev_id, -- &info->he_obss_pd); -+ ath11k_mac_config_obss_pd(ar, &info->he_obss_pd); - - if (changed & BSS_CHANGED_HE_BSS_COLOR) { - if (vif->type == NL80211_IFTYPE_AP) { ---- a/drivers/net/wireless/ath/ath11k/mac.h -+++ b/drivers/net/wireless/ath/ath11k/mac.h -@@ -127,6 +127,12 @@ struct ath11k_generic_iter { - #define IEEE80211_HE_DL_MU_SUPPORT_ENABLE 2 - #define IEEE80211_HE_DL_MU_SUPPORT_INVALID 3 - -+#define ATH11K_OBSS_PD_MAX_THRESHOLD -82 -+#define ATH11K_OBSS_PD_NON_SRG_MAX_THRESHOLD -62 -+#define ATH11K_OBSS_PD_THRESHOLD_IN_DBM BIT(29) -+#define ATH11K_OBSS_PD_SRG_EN BIT(30) -+#define ATH11K_OBSS_PD_NON_SRG_EN BIT(31) -+ - extern const struct htt_rx_ring_tlv_filter ath11k_mac_mon_status_filter_default; - - int ath11k_mac_ap_ps_recalc(struct ath11k *ar); ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -3476,6 +3476,233 @@ ath11k_wmi_send_obss_spr_cmd(struct ath1 - } - - int -+ath11k_wmi_pdev_set_srg_bss_color_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_SRG_BSS_COLOR_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd pdev_id %d bss color bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_SRG_BSS_COLOR_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_SRG_BSS_COLOR_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int -+ath11k_wmi_pdev_set_srg_patial_bssid_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = -+ FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_SRG_PARTIAL_BSSID_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd pdev_id %d partial bssid bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_SRG_PARTIAL_BSSID_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_SRG_PARTIAL_BSSID_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int -+ath11k_wmi_pdev_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = -+ FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd srg pdev_id %d bss color enable bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int -+ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = -+ FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd srg pdev_id %d bssid enable bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int -+ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = -+ FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd non_srg pdev_id %d bss color enable bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int -+ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap) -+{ -+ struct ath11k_pdev_wmi *wmi = ar->wmi; -+ struct ath11k_base *ab = wmi->wmi_ab->ab; -+ struct wmi_pdev_obss_pd_bitmap_cmd *cmd; -+ struct sk_buff *skb; -+ int ret, len; -+ -+ len = sizeof(*cmd); -+ -+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); -+ if (!skb) -+ return -ENOMEM; -+ -+ cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; -+ cmd->tlv_header = -+ FIELD_PREP(WMI_TLV_TAG, -+ WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD) | -+ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); -+ cmd->pdev_id = ar->pdev->pdev_id; -+ memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); -+ -+ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, -+ "obss pd non_srg pdev_id %d bssid enable bitmap %08x %08x\n", -+ cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); -+ -+ ret = ath11k_wmi_cmd_send(wmi, skb, -+ WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID); -+ if (ret) { -+ ath11k_warn(ab, -+ "Failed to send WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID"); -+ dev_kfree_skb(skb); -+ } -+ -+ return ret; -+} -+ -+int - ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id, - u8 bss_color, u32 period, - bool enable) ---- a/drivers/net/wireless/ath/ath11k/wmi.h -+++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -960,6 +960,9 @@ enum wmi_tlv_pdev_param { - WMI_PDEV_PARAM_RADIO_CHAN_STATS_ENABLE, - WMI_PDEV_PARAM_RADIO_DIAGNOSIS_ENABLE, - WMI_PDEV_PARAM_MESH_MCAST_ENABLE, -+ WMI_PDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD = 0xbc, -+ WMI_PDEV_PARAM_SET_CMD_OBSS_PD_PER_AC = 0xbe, -+ WMI_PDEV_PARAM_ENABLE_SR_PROHIBIT = 0xc6, - }; - - enum wmi_tlv_vdev_param { -@@ -1862,6 +1865,13 @@ enum wmi_tlv_tag { - WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, - WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT = 0x32a, - WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344, -+ WMI_TAG_PDEV_SRG_BSS_COLOR_BITMAP_CMD = 0x37b, -+ WMI_TAG_PDEV_SRG_PARTIAL_BSSID_BITMAP_CMD, -+ WMI_TAG_PDEV_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD = -+ WMI_TAG_PDEV_SRG_PARTIAL_BSSID_BITMAP_CMD + 5, -+ WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, -+ WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD, -+ WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, - WMI_TAG_TPC_STATS_GET_CMD = 0x38B, - WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM, - WMI_TAG_TPC_STATS_CONFIG_EVENT, -@@ -5221,6 +5231,12 @@ struct wmi_obss_spatial_reuse_params_cmd - u32 vdev_id; - } __packed; - -+struct wmi_pdev_obss_pd_bitmap_cmd { -+ u32 tlv_header; -+ u32 pdev_id; -+ u32 bitmap[2]; -+} __packed; -+ - #define ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS 200 - #define ATH11K_OBSS_COLOR_COLLISION_DETECTION_DISABLE 0 - #define ATH11K_OBSS_COLOR_COLLISION_DETECTION 1 -@@ -5782,6 +5798,16 @@ int ath11k_wmi_send_twt_resume_dialog_cm - struct wmi_twt_resume_dialog_params *params); - int ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id, - struct ieee80211_he_obss_pd *he_obss_pd); -+int ath11k_wmi_pdev_set_srg_bss_color_bitmap(struct ath11k *ar, u32 *bitmap); -+int ath11k_wmi_pdev_set_srg_patial_bssid_bitmap(struct ath11k *ar, u32 *bitmap); -+int ath11k_wmi_pdev_srg_obss_color_enable_bitmap(struct ath11k *ar, -+ u32 *bitmap); -+int ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap(struct ath11k *ar, -+ u32 *bitmap); -+int ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap(struct ath11k *ar, -+ u32 *bitmap); -+int ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(struct ath11k *ar, -+ u32 *bitmap); - int ath11k_send_coex_config_cmd(struct ath11k *ar, - struct coex_config_arg *coex_config); - int ath11k_wmi_pdev_ap_ps_cmd_send(struct ath11k *ar, u8 pdev_id, u32 value); ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -@@ -3678,6 +3678,18 @@ htt_print_pdev_obss_pd_stats_tlv_v(const - htt_stats_buf->num_obss_tx_ppdu_success); - len += HTT_DBG_OUT(buf + len, buf_len - len, "OBSS Tx failures PPDU = %u\n", - htt_stats_buf->num_obss_tx_ppdu_failure); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG Opportunities = %u\n", -+ htt_stats_buf->num_non_srg_opportunities); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG tried PPDU = %u\n", -+ htt_stats_buf->num_non_srg_ppdu_tried); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG success PPDU = %u\n", -+ htt_stats_buf->num_non_srg_ppdu_success); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG Opportunies = %u\n", -+ htt_stats_buf->num_srg_opportunities); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG tried PPDU = %u\n", -+ htt_stats_buf->num_srg_ppdu_tried); -+ len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG success PPDU = %u\n", -+ htt_stats_buf->num_srg_ppdu_success); - - if (len >= buf_len) - buf[buf_len - 1] = 0; ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -@@ -1715,8 +1715,19 @@ struct htt_tx_sounding_stats_tlv { - }; - - struct htt_pdev_obss_pd_stats_tlv { -- u32 num_obss_tx_ppdu_success; -- u32 num_obss_tx_ppdu_failure; -+ u32 num_obss_tx_ppdu_success; -+ u32 num_obss_tx_ppdu_failure; -+ u32 num_sr_tx_transmissions; -+ u32 num_spatial_reuse_opportunities; -+ u32 num_non_srg_opportunities; -+ u32 num_non_srg_ppdu_tried; -+ u32 num_non_srg_ppdu_success; -+ u32 num_srg_opportunities; -+ u32 num_srg_ppdu_tried; -+ u32 num_srg_ppdu_success; -+ u32 num_psr_opportunities; -+ u32 num_psr_ppdu_tried; -+ u32 num_psr_ppdu_success; - }; - - void ath11k_debug_htt_stats_init(struct ath11k *ar); diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-custom-aggregation-size-support-over-WMI.patch b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-custom-aggregation-size-support-over-WMI.patch new file mode 100644 index 000000000..638007295 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-custom-aggregation-size-support-over-WMI.patch @@ -0,0 +1,271 @@ +From 815ddd8110e03496192c171f3058f85096fb2049 Mon Sep 17 00:00:00 2001 +From: Ramya Gnanasekar +Date: Wed, 7 Oct 2020 20:08:49 +0530 +Subject: [PATCH] ath11k: custom aggregation size support over WMI + +This patch is to support custom aggregation size config for A-MPDU +and A-MSDU through WMI command per vdev_id. rx_aggr_size_disable is +set true to avoid fw from considering rx_aggr_size paramater. +AC is set to all by default. Upon configuring 0, firmware will default +AMPDU aggregation size to 1 and AMDSU to 7. +Default aggregation limit is: + * AMPDU : 0 - 255 + * AMSDU : 0 - 7 + +echo 64 > /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/ampdu_aggr_size +echo 6 > /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/amsdu_aggr_size + +Signed-off-by: Ramya Gnanasekar +--- + drivers/net/wireless/ath/ath11k/debugfs.c | 86 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 2 + + drivers/net/wireless/ath/ath11k/mac.c | 2 + + drivers/net/wireless/ath/ath11k/wmi.c | 54 +++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 52 ++++++++++++++++++++ + 5 files changed, 196 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -250,6 +250,92 @@ void ath11k_debugfs_twt(struct ath11k_vi + } + #endif + ++static ssize_t ath11k_write_ampdu_aggr_size(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ath11k_base *ab = arvif->ar->ab; ++ unsigned int tx_aggr_size = 0; ++ int ret; ++ struct set_custom_aggr_size_params params = {0}; ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &tx_aggr_size)) ++ return -EINVAL; ++ ++ if (tx_aggr_size > ATH11K_CONFIG_AGGR_MAX_AMPDU_SIZE) { ++ ath11k_warn(ab, "Valid AMPDU Aggregation Size is in the range 0-255"); ++ return -EINVAL; ++ } ++ ++ params.aggr_type = WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU; ++ params.tx_aggr_size = tx_aggr_size; ++ params.rx_aggr_size_disable = true; ++ params.vdev_id = arvif->vdev_id; ++ ++ ret = ath11k_wmi_send_aggr_size_cmd(arvif->ar, ¶ms); ++ if (ret) ++ ath11k_warn(ab, "Failed to set ampdu config vdev_id %d" ++ "ret %d \n",params.vdev_id, ret); ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_ampdu_aggr_size = { ++ .write = ath11k_write_ampdu_aggr_size, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_write_amsdu_aggr_size(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ath11k_base *ab = arvif->ar->ab; ++ unsigned int tx_aggr_size = 0; ++ int ret; ++ struct set_custom_aggr_size_params params = {0}; ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &tx_aggr_size)) ++ return -EINVAL; ++ ++ if (tx_aggr_size > ATH11K_CONFIG_AGGR_MAX_AMSDU_SIZE) { ++ ath11k_warn(ab, "Valid AMSDU Aggregation size is in the range 0-7"); ++ return -EINVAL; ++ } ++ ++ params.aggr_type = WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU; ++ params.tx_aggr_size = tx_aggr_size; ++ params.rx_aggr_size_disable = true; ++ params.vdev_id = arvif->vdev_id; ++ ++ ret = ath11k_wmi_send_aggr_size_cmd(arvif->ar, ¶ms); ++ if (ret) ++ ath11k_warn(ab, "Failed to set amsdu config vdev_id %d" ++ "ret %d \n",params.vdev_id, ret); ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_amsdu_aggr_size = { ++ .write = ath11k_write_amsdu_aggr_size, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++void ath11k_debug_aggr_size_config_init(struct ath11k_vif *arvif) ++{ ++ debugfs_create_file("ampdu_aggr_size", 0644, ++ arvif->vif->debugfs_dir, arvif, ++ &fops_ampdu_aggr_size); ++ debugfs_create_file("amsdu_aggr_size", 0644, ++ arvif->vif->debugfs_dir, arvif, ++ &fops_amsdu_aggr_size); ++} ++ + static void ath11k_fw_stats_pdevs_free(struct list_head *head) + { + struct ath11k_fw_stats_pdev *i, *tmp; +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -155,6 +155,8 @@ static inline void ath11k_debugfs_twt(st + } + #endif + ++void ath11k_debug_aggr_size_config_init(struct ath11k_vif *arvif); ++ + #ifdef CPTCFG_ATH11K_DEBUGFS + int ath11k_debugfs_create(void); + void ath11k_debugfs_destroy(void); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5987,6 +5987,8 @@ static int ath11k_mac_op_add_interface(s + goto err_peer_del; + } + ++ ath11k_debug_aggr_size_config_init(arvif); ++ + mutex_unlock(&ar->conf_mutex); + + return ret; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -3791,6 +3791,58 @@ int ath11k_wmi_send_bss_color_change_ena + return ret; + } + ++int ath11k_wmi_send_aggr_size_cmd(struct ath11k *ar, ++ struct set_custom_aggr_size_params *params) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct ath11k_base *ab = wmi->wmi_ab->ab; ++ struct wmi_set_custom_aggr_size_params_cmd *cmd = NULL; ++ struct sk_buff *skb; ++ int ret, len; ++ ++ len = sizeof(*cmd); ++ ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); ++ if (!skb) ++ return -ENOMEM; ++ ++ cmd = (void *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, ++ WMI_TAG_VDEV_SET_CUSTOM_AGGR_SIZE_CMD) | ++ FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); ++ ++ cmd->vdev_id = params->vdev_id; ++ cmd->tx_aggr_size = params->tx_aggr_size; ++ cmd->rx_aggr_size = params->rx_aggr_size; ++ cmd->enable_bitmap = FIELD_PREP(WMI_VDEV_AGGR_AC, params->ac) | ++ FIELD_PREP(WMI_VDEV_AGGR_TYPE, params->aggr_type) | ++ FIELD_PREP(WMI_VDEV_TX_AGGR_SZ_DISABLE, ++ params->tx_aggr_size_disable) | ++ FIELD_PREP(WMI_VDEV_RX_AGGR_SZ_DISABLE, ++ params->rx_aggr_size_disable) | ++ FIELD_PREP(WMI_VDEV_AGGR_AC_ENABLE, ++ params->tx_ac_enable); ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, ++ "WMI set aggr size vdev_id %d tx aggr size %d rx_aggr_size %d " ++ "access category %d aggr type %d tx_aggr_size_disable %d " ++ "rx_aggr_size_disable %d tx_ac_enable %d ", params->vdev_id, ++ params->tx_aggr_size, params->rx_aggr_size, params->ac, ++ params->aggr_type, params->tx_aggr_size_disable, ++ params->rx_aggr_size_disable, params->tx_ac_enable); ++ ++ ret = ath11k_wmi_cmd_send(wmi, skb, ++ WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID); ++ ++ if (ret) { ++ ath11k_warn(ab, ++ "Failed to send WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID"); ++ dev_kfree_skb(skb); ++ } ++ ++ return ret; ++} ++ + int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id, + struct sk_buff *tmpl) + { +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -5244,6 +5244,56 @@ struct wmi_pdev_obss_pd_bitmap_cmd { + u32 bitmap[2]; + } __packed; + ++#define WMI_VDEV_AGGR_AC GENMASK(2, 0) ++#define WMI_VDEV_AGGR_TYPE GENMASK(3, 2) ++#define WMI_VDEV_TX_AGGR_SZ_DISABLE GENMASK(4, 3) ++#define WMI_VDEV_RX_AGGR_SZ_DISABLE GENMASK(5, 4) ++#define WMI_VDEV_AGGR_AC_ENABLE GENMASK(6, 5) ++ ++struct set_custom_aggr_size_params { ++ u32 vdev_id; ++ u32 tx_aggr_size; ++ u32 rx_aggr_size; ++ u32 ac; ++ u32 aggr_type; ++ u32 tx_aggr_size_disable; ++ u32 rx_aggr_size_disable; ++ u32 tx_ac_enable; ++}; ++ ++struct wmi_set_custom_aggr_size_params_cmd { ++ u32 tlv_header; /* TLV tag and len */ ++ u32 vdev_id; /* vdev id indicating to which aggregation size will be applied. */ ++ /* Size for tx aggregation for the vdev mentioned in vdev id ++ * (max MPDUs per A-MPDU or max MSDUs per A-MSDU based on aggr_type field) ++ */ ++ u32 tx_aggr_size; ++ ++ u32 rx_aggr_size; /* Size for rx aggregation (block ack window size limit)for vdev id */ ++ ++ /* To set TX aggregation size limits per VDEV per AC ++ * bits 1:0 (ac): ++ * Access Category (0x0=BE, 0x1=BK, 0x2=VI, 0x3=VO) ++ * If tx_ac_enable bit is not set, tx_aggr_size is applied ++ * for all Access Categories ++ * bit 2 (aggr_type): TX Aggregation Type (0=A-MPDU, 1=A-MSDU) ++ * bit 3 (tx_aggr_size_disable): If set tx_aggr_size is invalid ++ * bit 4 (rx_aggr_size_disable): If set rx_aggr_size is invalid ++ * bit 5 (tx_ac_enable): If set, above ac bitmap is valid. ++ * bits 31:6: Reserved bits. should be set to zero. ++ */ ++ u32 enable_bitmap; ++} __packed; ++ ++enum wmi_vdev_aggr_type { ++ WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU = 0, ++ WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU = 1, ++ WMI_VDEV_CUSTOM_AGGR_TYPE_MAX, ++}; ++ ++#define ATH11K_CONFIG_AGGR_MAX_AMPDU_SIZE 255 /* Maximum Frames for Custom AMPDU Size */ ++#define ATH11K_CONFIG_AGGR_MAX_AMSDU_SIZE 7 /* Maximum Frames for Custom AMSDU Size */ ++ + #define ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS 200 + #define ATH11K_OBSS_COLOR_COLLISION_DETECTION_DISABLE 0 + #define ATH11K_OBSS_COLOR_COLLISION_DETECTION 1 +@@ -6007,5 +6057,7 @@ int ath11k_wmi_wow_enable(struct ath11k + int ath11k_wmi_pdev_m3_dump_enable(struct ath11k *ar, u32 enable); + int ath11k_wmi_pdev_get_tpc_table_cmdid(struct ath11k *ar); + void ath11k_wmi_free_tpc_stats_mem(struct ath11k *ar); ++int ath11k_wmi_send_aggr_size_cmd(struct ath11k *ar, ++ struct set_custom_aggr_size_params *params); + + #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-use-reserved-memory-from-bootargs.patch b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-use-reserved-memory-from-bootargs.patch index edb1b6974..4eaf8dac6 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-use-reserved-memory-from-bootargs.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/211-ath11k-use-reserved-memory-from-bootargs.patch @@ -21,37 +21,38 @@ Signed-off-by: Anilkumar Kolli --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -31,6 +31,11 @@ MODULE_PARM_DESC(nss_offload, "Enable NS - - struct ath11k_base *ath11k_soc; +@@ -37,6 +37,11 @@ module_param_named(frame_mode, ath11k_fr + MODULE_PARM_DESC(frame_mode, + "Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)"); +unsigned int ath11k_host_ddr_addr; +EXPORT_SYMBOL(ath11k_host_ddr_addr); +module_param_named(host_ddr_addr, ath11k_host_ddr_addr, uint, 0644); +MODULE_PARM_DESC(host_ddr_addr, "host ddr addr for FW"); + - extern unsigned int ath11k_frame_mode; + struct ath11k_base *ath11k_soc; static const struct ath11k_hw_params ath11k_hw_params[] = { --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2345,6 +2345,9 @@ static int ath11k_qmi_alloc_target_mem_c +@@ -2487,6 +2487,10 @@ static int ath11k_qmi_alloc_target_mem_c return 0; } -+#define ATH11K_HOST_DDR_CALDB_OFFSET 0x3000000 -+#define ATH11K_HOST_DDR_QDSS_OFFSET 0x400000 ++#define ATH11K_HOST_DDR_M3_OFFSET 0x2D00000 ++#define ATH11K_HOST_DDR_QDSS_OFFSET 0x2E00000 ++#define ATH11K_HOST_DDR_CALDB_OFFSET 0x2F00000 + static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) { struct device *dev = ab->dev; -@@ -2354,7 +2357,15 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2496,7 +2500,15 @@ static int ath11k_qmi_assign_target_mem_ for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { switch (ab->qmi.target_mem[i].type) { case HOST_DDR_REGION_TYPE: - if (of_property_read_u32(dev->of_node, "base-addr", &addr)) { + /* This is HACK -+ * QCN9000 Firmware needs contiguous 60MB HOST DDR memory ++ * QCN9074 Firmware needs contiguous 60MB HOST DDR memory + * use reserve memory from bootargs x86 + * HACK reserve memory using memmap=60M$0x70000000 + */ @@ -62,44 +63,71 @@ Signed-off-by: Anilkumar Kolli ath11k_warn(ab, "qmi fail to get base-addr in dt\n"); return -EINVAL; } -@@ -2378,7 +2389,10 @@ static int ath11k_qmi_assign_target_mem_ - if (ab->qmi.target_mem[i].size > ab->hw_params.fw.cal_size) - ath11k_warn(ab, "qmi mem size is low to load caldata\n"); +@@ -2522,8 +2534,12 @@ static int ath11k_qmi_assign_target_mem_ + return -EINVAL; + } - if (of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr)) + if (ath11k_host_ddr_addr) { + addr = ath11k_host_ddr_addr + + ATH11K_HOST_DDR_CALDB_OFFSET; -+ } else if (of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr)) ++ } else if (of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr)) { ath11k_warn(ab, "qmi fail to get caldb-addr in dt\n"); ++ } - if (ab->bus_params.fixed_bdf_addr && ab->enable_cold_boot_cal) { -@@ -2409,10 +2423,16 @@ static int ath11k_qmi_assign_target_mem_ + if (ab->enable_cold_boot_cal && ab->hw_params.cold_boot_calib) { + ab->qmi.target_mem[idx].paddr = (u32)addr; +@@ -2555,10 +2571,14 @@ static int ath11k_qmi_assign_target_mem_ ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; - if (of_property_read_u32(dev->of_node, "m3-dump-addr", &addr)) +- ab->qmi.target_mem[idx].paddr = ab->hw_params.m3_addr; +- else +- ab->qmi.target_mem[idx].paddr = (phys_addr_t)addr; + + if (ath11k_host_ddr_addr) { + addr = ath11k_host_ddr_addr + -+ ATH11K_HOST_DDR_CALDB_OFFSET + -+ ATH11K_HOST_DDR_QDSS_OFFSET; ++ ATH11K_HOST_DDR_M3_OFFSET; + } else if (of_property_read_u32(dev->of_node, "m3-dump-addr", &addr)) { - ab->qmi.target_mem[idx].paddr = ab->hw_params.m3_addr; -- else -+ } else { - ab->qmi.target_mem[idx].paddr = (phys_addr_t)addr; ++ addr = ab->hw_params.m3_addr; + } ++ ab->qmi.target_mem[idx].paddr = (phys_addr_t)addr; ab->qmi.target_mem[idx].vaddr = ioremap(ab->qmi.target_mem[idx].paddr, +@@ -3395,7 +3415,10 @@ int ath11k_qmi_pci_alloc_qdss_mem(struct + return -ENOMEM; + } + +- if (of_property_read_u32(dev->of_node, ++ if (ath11k_host_ddr_addr) { ++ addr = ath11k_host_ddr_addr + ++ ATH11K_HOST_DDR_QDSS_OFFSET; ++ } else if (of_property_read_u32(dev->of_node, + "etr-addr", &addr)) { + ath11k_warn(ab, "qmi fail to get etr-addr in dt\n"); + return -ENOMEM; --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -48,6 +48,7 @@ - #define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) +@@ -52,6 +52,7 @@ + #define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) struct ath11k_base; +extern unsigned int ath11k_host_ddr_addr; enum ath11k_target_mem_mode { ATH11K_QMI_TARGET_MEM_MODE_DEFAULT = 0, +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -1235,8 +1235,8 @@ static int ath11k_pci_probe(struct pci_d + * allocate memory for FW in DDR, set fixed_mem_region to true for + * these pltforms supports reserved memory. + */ +- ret = of_property_read_u32(ab->dev->of_node, "base-addr", &addr); +- if (ret == 0) ++ if (ath11k_host_ddr_addr || ++ !of_property_read_u32(ab->dev->of_node, "base-addr", &addr)) + ab->bus_params.fixed_mem_region = true; + + ret = ath11k_pci_claim(ab_pci, pdev); diff --git a/feeds/wifi-ax/mac80211/patches/qca/211-mac80211-rename-csa-counters-to-countdown-counters.patch b/feeds/wifi-ax/mac80211/patches/qca/211-mac80211-rename-csa-counters-to-countdown-counters.patch deleted file mode 100644 index 3c1e537c1..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/211-mac80211-rename-csa-counters-to-countdown-counters.patch +++ /dev/null @@ -1,501 +0,0 @@ -From: John Crispin -Date: Wed, 26 Aug 2020 07:56:47 +0200 -Subject: [PATCH] mac80211: rename csa counters to countdown counters - -We want to reuse the functions and structs for other counters such as BSS -color change. Rename them to more generic names. - -Signed-off-by: John Crispin ---- - drivers/net/wireless/ath/ath10k/mac.c | 4 +- - drivers/net/wireless/ath/ath10k/wmi.c | 2 +- - drivers/net/wireless/ath/ath11k/wmi.c | 4 +- - drivers/net/wireless/ath/ath9k/beacon.c | 2 +- - drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 2 +- - drivers/net/wireless/mac80211_hwsim.c | 2 +- - include/net/mac80211.h | 35 ++++++------ - net/mac80211/cfg.c | 14 ++--- - net/mac80211/ibss.c | 4 +- - net/mac80211/ieee80211_i.h | 6 +- - net/mac80211/main.c | 2 +- - net/mac80211/mesh.c | 4 +- - net/mac80211/offchannel.c | 2 +- - net/mac80211/tx.c | 73 +++++++++++++------------ - 14 files changed, 78 insertions(+), 78 deletions(-) - ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -2019,8 +2019,8 @@ static void ath10k_mac_vif_ap_csa_count_ - if (!arvif->is_up) - return; - -- if (!ieee80211_csa_is_complete(vif)) { -- ieee80211_csa_update_counter(vif); -+ if (!ieee80211_beacon_cntdwn_is_complete(vif)) { -+ ieee80211_beacon_update_cntdwn(vif); - - ret = ath10k_mac_setup_bcn_tmpl(arvif); - if (ret) ---- a/drivers/net/wireless/ath/ath10k/wmi.c -+++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -3879,7 +3879,7 @@ void ath10k_wmi_event_host_swba(struct a - * actual channel switch is done - */ - if (arvif->vif->csa_active && -- ieee80211_csa_is_complete(arvif->vif)) { -+ ieee80211_beacon_cntdwn_is_complete(arvif->vif)) { - ieee80211_csa_finish(arvif->vif); - continue; - } ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1861,8 +1861,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a - FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); - cmd->vdev_id = vdev_id; - cmd->tim_ie_offset = offs->tim_offset; -- cmd->csa_switch_count_offset = offs->csa_counter_offs[0]; -- cmd->ext_csa_switch_count_offset = offs->csa_counter_offs[1]; -+ cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0]; -+ cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1]; - cmd->buf_len = bcn->len; - cmd->mbssid_ie_offset = offs->multiple_bssid_offset; - ---- a/drivers/net/wireless/ath/ath9k/beacon.c -+++ b/drivers/net/wireless/ath/ath9k/beacon.c -@@ -365,7 +365,7 @@ bool ath9k_csa_is_finished(struct ath_so - if (!vif || !vif->csa_active) - return false; - -- if (!ieee80211_csa_is_complete(vif)) -+ if (!ieee80211_beacon_cntdwn_is_complete(vif)) - return false; - - ieee80211_csa_finish(vif); ---- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c -@@ -514,7 +514,7 @@ bool ath9k_htc_csa_is_finished(struct at - if (!vif || !vif->csa_active) - return false; - -- if (!ieee80211_csa_is_complete(vif)) -+ if (!ieee80211_beacon_cntdwn_is_complete(vif)) - return false; - - ieee80211_csa_finish(vif); ---- a/drivers/net/wireless/mac80211_hwsim.c -+++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -1699,7 +1699,7 @@ static void mac80211_hwsim_beacon_tx(voi - rcu_dereference(vif->chanctx_conf)->def.chan); - } - -- if (vif->csa_active && ieee80211_csa_is_complete(vif)) -+ if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) - ieee80211_csa_finish(vif); - } - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -3807,7 +3807,7 @@ enum ieee80211_reconfig_type { - * decremented, and when they reach 1 the driver must call - * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get() - * get the csa counter decremented by mac80211, but must check if it is -- * 1 using ieee80211_csa_is_complete() after the beacon has been -+ * 1 using ieee80211_beacon_counter_is_complete() after the beacon has been - * transmitted and then call ieee80211_csa_finish(). - * If the CSA count starts as zero or 1, this function will not be called, - * since there won't be any time to beacon before the switch anyway. -@@ -4831,14 +4831,14 @@ void ieee80211_tx_status_8023(struct iee - */ - void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); - --#define IEEE80211_MAX_CSA_COUNTERS_NUM 2 -+#define IEEE80211_MAX_CNTDWN_COUNTERS_NUM 2 - - /** - * struct ieee80211_mutable_offsets - mutable beacon offsets - * @tim_offset: position of TIM element - * @tim_length: size of TIM element -- * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets -- * to CSA counters. This array can contain zero values which -+ * @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets -+ * to countdown counters. This array can contain zero values which - * should be ignored. - * @multiple_bssid_offset: position of the multiple bssid element - * @multiple_bssid_length: size of the multiple bssid element -@@ -4847,7 +4847,7 @@ struct ieee80211_mutable_offsets { - u16 tim_offset; - u16 tim_length; - -- u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM]; -+ u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; - u16 multiple_bssid_offset; - u16 multiple_bssid_length; - }; -@@ -4940,31 +4940,31 @@ static inline struct sk_buff *ieee80211_ - } - - /** -- * ieee80211_csa_update_counter - request mac80211 to decrement the csa counter -+ * ieee80211_beacon_update_cntdwn - request mac80211 to decrement the beacon countdown - * @vif: &struct ieee80211_vif pointer from the add_interface callback. - * -- * The csa counter should be updated after each beacon transmission. -+ * The beacon counter should be updated after each beacon transmission. - * This function is called implicitly when - * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the - * beacon frames are generated by the device, the driver should call this -- * function after each beacon transmission to sync mac80211's csa counters. -+ * function after each beacon transmission to sync mac80211's beacon countdown. - * -- * Return: new csa counter value -+ * Return: new countdown value - */ --u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif); -+u8 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif); - - /** -- * ieee80211_csa_set_counter - request mac80211 to set csa counter -+ * ieee80211_beacon_set_cntdwn - request mac80211 to set beacon countdown - * @vif: &struct ieee80211_vif pointer from the add_interface callback. - * @counter: the new value for the counter - * -- * The csa counter can be changed by the device, this API should be -+ * The beacon countdown can be changed by the device, this API should be - * used by the device driver to update csa counter in mac80211. - * -- * It should never be used together with ieee80211_csa_update_counter(), -+ * It should never be used together with ieee80211_beacon_update_cntdwn(), - * as it will cause a race condition around the counter value. - */ --void ieee80211_csa_set_counter(struct ieee80211_vif *vif, u8 counter); -+void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter); - - /** - * ieee80211_csa_finish - notify mac80211 about channel switch -@@ -4977,13 +4977,12 @@ void ieee80211_csa_set_counter(struct ie - void ieee80211_csa_finish(struct ieee80211_vif *vif); - - /** -- * ieee80211_csa_is_complete - find out if counters reached 1 -+ * ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1 - * @vif: &struct ieee80211_vif pointer from the add_interface callback. - * -- * This function returns whether the channel switch counters reached zero. -+ * This function returns whether the countdown reached zero. - */ --bool ieee80211_csa_is_complete(struct ieee80211_vif *vif); -- -+bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif); - - /** - * ieee80211_proberesp_get - retrieve a Probe Response template ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -878,9 +878,9 @@ static int ieee80211_set_probe_resp(stru - memcpy(new->data, resp, resp_len); - - if (csa) -- memcpy(new->csa_counter_offsets, csa->counter_offsets_presp, -+ memcpy(new->cntdwn_counter_offsets, csa->counter_offsets_presp, - csa->n_counter_offsets_presp * -- sizeof(new->csa_counter_offsets[0])); -+ sizeof(new->cntdwn_counter_offsets[0])); - - rcu_assign_pointer(sdata->u.ap.probe_resp, new); - if (old) -@@ -1077,10 +1077,10 @@ static int ieee80211_assign_beacon(struc - &old->multiple_bssid); - - if (csa) { -- new->csa_current_counter = csa->count; -- memcpy(new->csa_counter_offsets, csa->counter_offsets_beacon, -+ new->cntdwn_current_counter = csa->count; -+ memcpy(new->cntdwn_counter_offsets, csa->counter_offsets_beacon, - csa->n_counter_offsets_beacon * -- sizeof(new->csa_counter_offsets[0])); -+ sizeof(new->cntdwn_counter_offsets[0])); - } - - /* copy in head */ -@@ -3395,9 +3395,9 @@ static int ieee80211_set_csa_beacon(stru - break; - - if ((params->n_counter_offsets_beacon > -- IEEE80211_MAX_CSA_COUNTERS_NUM) || -+ IEEE80211_MAX_CNTDWN_COUNTERS_NUM) || - (params->n_counter_offsets_presp > -- IEEE80211_MAX_CSA_COUNTERS_NUM)) -+ IEEE80211_MAX_CNTDWN_COUNTERS_NUM)) - return -EINVAL; - - csa.counter_offsets_beacon = params->counter_offsets_beacon; ---- a/net/mac80211/ibss.c -+++ b/net/mac80211/ibss.c -@@ -145,9 +145,9 @@ ieee80211_ibss_build_presp(struct ieee80 - *pos++ = csa_settings->block_tx ? 1 : 0; - *pos++ = ieee80211_frequency_to_channel( - csa_settings->chandef.chan->center_freq); -- presp->csa_counter_offsets[0] = (pos - presp->head); -+ presp->cntdwn_counter_offsets[0] = (pos - presp->head); - *pos++ = csa_settings->count; -- presp->csa_current_counter = csa_settings->count; -+ presp->cntdwn_current_counter = csa_settings->count; - } - - /* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */ ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -260,8 +260,8 @@ struct beacon_data { - u8 *head, *tail; - int head_len, tail_len; - struct ieee80211_meshconf_ie *meshconf; -- u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; -- u8 csa_current_counter; -+ u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; -+ u8 cntdwn_current_counter; - struct cfg80211_multiple_bssid_data multiple_bssid; - u16 ema_index; - struct rcu_head rcu_head; -@@ -270,7 +270,7 @@ struct beacon_data { - struct probe_resp { - struct rcu_head rcu_head; - int len; -- u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; -+ u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; - u8 data[]; - }; - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -1190,7 +1190,7 @@ int ieee80211_register_hw(struct ieee802 - WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT; - } - -- local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; -+ local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CNTDWN_COUNTERS_NUM; - - /* - * We use the number of queues for feature tests (QoS, HT) internally ---- a/net/mac80211/mesh.c -+++ b/net/mac80211/mesh.c -@@ -867,8 +867,8 @@ ieee80211_mesh_build_beacon(struct ieee8 - *pos++ = 0x0; - *pos++ = ieee80211_frequency_to_channel( - csa->settings.chandef.chan->center_freq); -- bcn->csa_current_counter = csa->settings.count; -- bcn->csa_counter_offsets[0] = hdr_len + 6; -+ bcn->cntdwn_current_counter = csa->settings.count; -+ bcn->cntdwn_counter_offsets[0] = hdr_len + 6; - *pos++ = csa->settings.count; - *pos++ = WLAN_EID_CHAN_SWITCH_PARAM; - *pos++ = 6; ---- a/net/mac80211/offchannel.c -+++ b/net/mac80211/offchannel.c -@@ -916,7 +916,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiph - if (beacon) - for (i = 0; i < params->n_csa_offsets; i++) - data[params->csa_offsets[i]] = -- beacon->csa_current_counter; -+ beacon->cntdwn_current_counter; - - rcu_read_unlock(); - } ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -4594,14 +4594,14 @@ static int ieee80211_beacon_add_tim(stru - return 0; - } - --static void ieee80211_set_csa(struct ieee80211_sub_if_data *sdata, -- struct beacon_data *beacon) -+static void ieee80211_set_beacon_cntdwn(struct ieee80211_sub_if_data *sdata, -+ struct beacon_data *beacon) - { - struct probe_resp *resp; - u8 *beacon_data; - size_t beacon_data_len; - int i; -- u8 count = beacon->csa_current_counter; -+ u8 count = beacon->cntdwn_current_counter; - - switch (sdata->vif.type) { - case NL80211_IFTYPE_AP: -@@ -4621,36 +4621,36 @@ static void ieee80211_set_csa(struct iee - } - - rcu_read_lock(); -- for (i = 0; i < IEEE80211_MAX_CSA_COUNTERS_NUM; ++i) { -+ for (i = 0; i < IEEE80211_MAX_CNTDWN_COUNTERS_NUM; ++i) { - resp = rcu_dereference(sdata->u.ap.probe_resp); - -- if (beacon->csa_counter_offsets[i]) { -- if (WARN_ON_ONCE(beacon->csa_counter_offsets[i] >= -+ if (beacon->cntdwn_counter_offsets[i]) { -+ if (WARN_ON_ONCE(beacon->cntdwn_counter_offsets[i] >= - beacon_data_len)) { - rcu_read_unlock(); - return; - } - -- beacon_data[beacon->csa_counter_offsets[i]] = count; -+ beacon_data[beacon->cntdwn_counter_offsets[i]] = count; - } - - if (sdata->vif.type == NL80211_IFTYPE_AP && resp) -- resp->data[resp->csa_counter_offsets[i]] = count; -+ resp->data[resp->cntdwn_counter_offsets[i]] = count; - } - rcu_read_unlock(); - } - --static u8 __ieee80211_csa_update_counter(struct beacon_data *beacon) -+static u8 __ieee80211_beacon_update_cntdwn(struct beacon_data *beacon) - { -- beacon->csa_current_counter--; -+ beacon->cntdwn_current_counter--; - - /* the counter should never reach 0 */ -- WARN_ON_ONCE(!beacon->csa_current_counter); -+ WARN_ON_ONCE(!beacon->cntdwn_current_counter); - -- return beacon->csa_current_counter; -+ return beacon->cntdwn_current_counter; - } - --u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif) -+u8 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif) - { - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct beacon_data *beacon = NULL; -@@ -4668,15 +4668,15 @@ u8 ieee80211_csa_update_counter(struct i - if (!beacon) - goto unlock; - -- count = __ieee80211_csa_update_counter(beacon); -+ count = __ieee80211_beacon_update_cntdwn(beacon); - - unlock: - rcu_read_unlock(); - return count; - } --EXPORT_SYMBOL(ieee80211_csa_update_counter); -+EXPORT_SYMBOL(ieee80211_beacon_update_cntdwn); - --void ieee80211_csa_set_counter(struct ieee80211_vif *vif, u8 counter) -+void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter) - { - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct beacon_data *beacon = NULL; -@@ -4693,15 +4693,15 @@ void ieee80211_csa_set_counter(struct ie - if (!beacon) - goto unlock; - -- if (counter < beacon->csa_current_counter) -- beacon->csa_current_counter = counter; -+ if (counter < beacon->cntdwn_current_counter) -+ beacon->cntdwn_current_counter = counter; - - unlock: - rcu_read_unlock(); - } --EXPORT_SYMBOL(ieee80211_csa_set_counter); -+EXPORT_SYMBOL(ieee80211_beacon_set_cntdwn); - --bool ieee80211_csa_is_complete(struct ieee80211_vif *vif) -+bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif) - { - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct beacon_data *beacon = NULL; -@@ -4744,20 +4744,21 @@ bool ieee80211_csa_is_complete(struct ie - goto out; - } - -- if (!beacon->csa_counter_offsets[0]) -+ if (!beacon->cntdwn_counter_offsets[0]) - goto out; - -- if (WARN_ON_ONCE(beacon->csa_counter_offsets[0] > beacon_data_len)) -+ if (WARN_ON_ONCE(beacon->cntdwn_counter_offsets[0] > beacon_data_len)) - goto out; - -- if (beacon_data[beacon->csa_counter_offsets[0]] == 1) -+ if (beacon_data[beacon->cntdwn_counter_offsets[0]] == 1) - ret = true; -+ - out: - rcu_read_unlock(); - - return ret; - } --EXPORT_SYMBOL(ieee80211_csa_is_complete); -+EXPORT_SYMBOL(ieee80211_beacon_cntdwn_is_complete); - - static int ieee80211_beacon_protect(struct sk_buff *skb, - struct ieee80211_local *local, -@@ -4832,11 +4833,11 @@ __ieee80211_beacon_get(struct ieee80211_ - beacon = rcu_dereference(ap->beacon); - if (beacon) { - int ema_len = 0; -- if (beacon->csa_counter_offsets[0]) { -+ if (beacon->cntdwn_counter_offsets[0]) { - if (!is_template) -- __ieee80211_csa_update_counter(beacon); -+ ieee80211_beacon_update_cntdwn(vif); - -- ieee80211_set_csa(sdata, beacon); -+ ieee80211_set_beacon_cntdwn(sdata, beacon); - } - - if (is_ema && beacon->multiple_bssid.cnt) -@@ -4896,11 +4897,11 @@ __ieee80211_beacon_get(struct ieee80211_ - if (!beacon) - goto out; - -- if (beacon->csa_counter_offsets[0]) { -+ if (beacon->cntdwn_counter_offsets[0]) { - if (!is_template) -- __ieee80211_csa_update_counter(beacon); -+ __ieee80211_beacon_update_cntdwn(beacon); - -- ieee80211_set_csa(sdata, beacon); -+ ieee80211_set_beacon_cntdwn(sdata, beacon); - } - - skb = dev_alloc_skb(local->tx_headroom + beacon->head_len + -@@ -4920,16 +4921,16 @@ __ieee80211_beacon_get(struct ieee80211_ - if (!beacon) - goto out; - -- if (beacon->csa_counter_offsets[0]) { -+ if (beacon->cntdwn_counter_offsets[0]) { - if (!is_template) - /* TODO: For mesh csa_counter is in TU, so - * decrementing it by one isn't correct, but - * for now we leave it consistent with overall - * mac80211's behavior. - */ -- __ieee80211_csa_update_counter(beacon); -+ __ieee80211_beacon_update_cntdwn(beacon); - -- ieee80211_set_csa(sdata, beacon); -+ ieee80211_set_beacon_cntdwn(sdata, beacon); - } - - if (ifmsh->sync_ops) -@@ -4961,13 +4962,13 @@ __ieee80211_beacon_get(struct ieee80211_ - if (offs && beacon) { - int i; - -- for (i = 0; i < IEEE80211_MAX_CSA_COUNTERS_NUM; i++) { -- u16 csa_off = beacon->csa_counter_offsets[i]; -+ for (i = 0; i < IEEE80211_MAX_CNTDWN_COUNTERS_NUM; i++) { -+ u16 csa_off = beacon->cntdwn_counter_offsets[i]; - - if (!csa_off) - continue; - -- offs->csa_counter_offs[i] = csa_off_base + csa_off; -+ offs->cntdwn_counter_offs[i] = csa_off_base + csa_off; - } - } - diff --git a/feeds/wifi-ax/mac80211/patches/qca/212-nl80211-add-support-for-BSS-coloring.patch b/feeds/wifi-ax/mac80211/patches/qca/212-nl80211-add-support-for-BSS-coloring.patch index d94133255..1ddd22544 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/212-nl80211-add-support-for-BSS-coloring.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/212-nl80211-add-support-for-BSS-coloring.patch @@ -1,5 +1,6 @@ +From a2dbe60b46b44d3f742452f02946c78534fdee50 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 26 Aug 2020 07:56:48 +0200 +Date: Tue, 10 Nov 2020 10:03:35 -0800 Subject: [PATCH] nl80211: add support for BSS coloring This patch adds support for BSS color collisions to the wireless subsystem. @@ -8,16 +9,16 @@ collisions, triggering the color change and notifying when it is completed. Signed-off-by: John Crispin --- - include/net/cfg80211.h | 94 ++++++++++++++++++++++++++++++ - include/uapi/linux/nl80211.h | 45 +++++++++++++++ - net/wireless/nl80211.c | 135 +++++++++++++++++++++++++++++++++++++++++++ + include/net/cfg80211.h | 96 +++++++++++++++++++++++++ + include/uapi/linux/nl80211.h | 46 ++++++++++++ + net/wireless/nl80211.c | 135 +++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 12 ++++ - net/wireless/trace.h | 47 +++++++++++++++ - 5 files changed, 333 insertions(+) + net/wireless/trace.h | 48 +++++++++++++ + 5 files changed, 337 insertions(+) --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -1259,6 +1259,27 @@ struct cfg80211_csa_settings { +@@ -1277,6 +1277,27 @@ struct cfg80211_csa_settings { u8 count; }; @@ -45,25 +46,25 @@ Signed-off-by: John Crispin #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10 /** -@@ -3911,6 +3932,7 @@ struct mgmt_frame_regs { - * This callback may sleep. - * @reset_tid_config: Reset TID specific configuration for the peer, for the - * given TIDs. This callback may sleep. +@@ -4020,6 +4041,7 @@ struct mgmt_frame_regs { + * @set_fils_discovery: Set FILS discovery transmission parameters. + * @set_unsol_bcast_probe_resp: Set unsolicited broadcast probe response + * transmission parameters. + * @color_change: initiate a color change (with color change). */ struct cfg80211_ops { int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); -@@ -4239,6 +4261,9 @@ struct cfg80211_ops { - struct cfg80211_tid_config *tid_conf); - int (*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev, - const u8 *peer, u8 tids); -+ int (*color_change)(struct wiphy *wiphy, +@@ -4353,6 +4375,9 @@ struct cfg80211_ops { + int (*set_unsol_bcast_probe_resp)(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_unsol_bcast_probe_resp *params); ++ int (*color_change)(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_color_change_settings *params); }; /* -@@ -8018,4 +8043,75 @@ void cfg80211_update_muedca_params_event +@@ -8247,4 +8272,75 @@ void cfg80211_update_muedca_params_event struct ieee80211_mu_edca_param_set *params, gfp_t gfp); @@ -141,9 +142,9 @@ Signed-off-by: John Crispin #endif /* __NET_CFG80211_H */ --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -1183,6 +1183,21 @@ - * This event is used to update dynamic MU-EDCA parameters in Beacon frame, - * coming from driver and now need to be reflected in Beacon frame. +@@ -1194,6 +1194,21 @@ + * probe response transmission parameters. Inputs to the command are + * provided using the attribute %NL80211_ATTR_UNSOL_BCAST_PROBE_RESP. * + * @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever a + * mac detects a bss color collision. @@ -163,9 +164,9 @@ Signed-off-by: John Crispin * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1415,6 +1430,13 @@ enum nl80211_commands { - - NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, +@@ -1431,6 +1446,13 @@ enum nl80211_commands { + NL80211_CMD_SET_FILS_DISCOVERY, + NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, + NL80211_CMD_OBSS_COLOR_COLLISION, + @@ -177,7 +178,7 @@ Signed-off-by: John Crispin /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -2546,6 +2568,20 @@ enum nl80211_commands { +@@ -2591,6 +2613,20 @@ enum nl80211_commands { * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. * these get passed separately as the kernel might need to split them up for EMA VAP. * @@ -198,7 +199,7 @@ Signed-off-by: John Crispin * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3040,6 +3076,12 @@ enum nl80211_attrs { +@@ -3096,6 +3132,12 @@ enum nl80211_attrs { NL80211_ATTR_MULTIPLE_BSSID_COUNT, NL80211_ATTR_MULTIPLE_BSSID_IES, @@ -211,7 +212,7 @@ Signed-off-by: John Crispin /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -5899,6 +5941,9 @@ enum nl80211_feature_flags { +@@ -5984,6 +6026,9 @@ enum nl80211_feature_flags { * @NL80211_EXT_FEATURE_WIDE_BAND_SCAN: Driver/device supports wide band scan * on a frequency along with its corresponding phymode (40Mhz, 80Mhz) * @@ -221,9 +222,9 @@ Signed-off-by: John Crispin * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ -@@ -5957,6 +6002,7 @@ enum nl80211_ext_feature_index { - NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION, - NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK, +@@ -6046,6 +6091,7 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, + NL80211_EXT_FEATURE_BEACON_RATE_HE, NL80211_EXT_FEATURE_WIDE_BAND_SCAN, + NL80211_EXT_FEATURE_BSS_COLOR, @@ -231,7 +232,7 @@ Signed-off-by: John Crispin NUM_NL80211_EXT_FEATURES, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -770,6 +770,10 @@ static const struct nla_policy nl80211_p +@@ -778,6 +778,10 @@ static const struct nla_policy nl80211_p [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = { .type = NLA_U8 }, [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED }, @@ -242,7 +243,7 @@ Signed-off-by: John Crispin }; /* policy for the key attributes */ -@@ -14597,6 +14601,82 @@ bad_tid_conf: +@@ -14883,6 +14887,82 @@ bad_tid_conf: return ret; } @@ -325,8 +326,8 @@ Signed-off-by: John Crispin #define NL80211_FLAG_NEED_WIPHY 0x01 #define NL80211_FLAG_NEED_NETDEV 0x02 #define NL80211_FLAG_NEED_RTNL 0x04 -@@ -15560,6 +15640,14 @@ static __genl_const struct genl_ops nl80 - .internal_flags = NL80211_FLAG_NEED_NETDEV | +@@ -15895,6 +15975,14 @@ static const struct genl_small_ops nl802 + .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | NL80211_FLAG_NEED_RTNL, }, + { @@ -340,7 +341,7 @@ Signed-off-by: John Crispin }; static struct genl_family nl80211_fam __genl_ro_after_init = { -@@ -17173,6 +17261,53 @@ void cfg80211_ch_switch_started_notify(s +@@ -17526,6 +17614,53 @@ void cfg80211_ch_switch_started_notify(s } EXPORT_SYMBOL(cfg80211_ch_switch_started_notify); @@ -396,7 +397,7 @@ Signed-off-by: John Crispin const struct cfg80211_chan_def *chandef, --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h -@@ -1356,4 +1356,16 @@ static inline int rdev_reset_tid_config( +@@ -1382,4 +1382,16 @@ static inline int rdev_set_unsol_bcast_p return ret; } @@ -415,11 +416,10 @@ Signed-off-by: John Crispin #endif /* __CFG80211_RDEV_OPS */ --- a/net/wireless/trace.h +++ b/net/wireless/trace.h -@@ -3547,6 +3547,53 @@ TRACE_EVENT(rdev_reset_tid_config, - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", tids: 0x%x", - WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tids) +@@ -3612,6 +3612,52 @@ TRACE_EVENT(rdev_set_unsol_bcast_probe_r + __entry->interval, __entry->tmpl_len) ); -+ + +TRACE_EVENT(rdev_color_change, + TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, + struct cfg80211_color_change_settings *params), diff --git a/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-add-support-for-BSS-coloring.patch b/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-add-support-for-BSS-coloring.patch index 8f7df1927..2b0c4c830 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-add-support-for-BSS-coloring.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-add-support-for-BSS-coloring.patch @@ -1,5 +1,6 @@ +From f9df2611ffdd0b236dc136e7a8534929b1c8bed2 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 26 Aug 2020 07:56:49 +0200 +Date: Tue, 3 Nov 2020 20:27:54 -0800 Subject: [PATCH] mac80211: add support for BSS coloring The color change (color change announcement) is very similar to how CSA works where @@ -12,16 +13,16 @@ for other counter IEs gets added. Signed-off-by: John Crispin --- - include/net/mac80211.h | 29 ++++++ - net/mac80211/cfg.c | 228 +++++++++++++++++++++++++++++++++++++++++++-- - net/mac80211/ieee80211_i.h | 12 +++ + include/net/mac80211.h | 29 +++++ + net/mac80211/cfg.c | 228 +++++++++++++++++++++++++++++++++++-- + net/mac80211/ieee80211_i.h | 12 ++ net/mac80211/iface.c | 3 + - net/mac80211/tx.c | 24 +++-- + net/mac80211/tx.c | 24 ++-- 5 files changed, 278 insertions(+), 18 deletions(-) --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1690,6 +1690,10 @@ enum ieee80211_vif_flags { +@@ -1735,6 +1735,10 @@ enum ieee80211_offload_flags { * @multiple_bssid.parent: a non-transmitted bssid has a transmitted parent. * @multiple_bssid.list: linked list for tracking parent - child relations. * @multiple_bssid.non_transmitted: Is this a non-transmitted bssi @@ -32,7 +33,7 @@ Signed-off-by: John Crispin */ struct ieee80211_vif { enum nl80211_iftype type; -@@ -1723,6 +1727,9 @@ struct ieee80211_vif { +@@ -1768,6 +1772,9 @@ struct ieee80211_vif { bool non_transmitted; } multiple_bssid; @@ -42,7 +43,7 @@ Signed-off-by: John Crispin /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); }; -@@ -4985,6 +4992,16 @@ void ieee80211_csa_finish(struct ieee802 +@@ -5068,6 +5075,16 @@ void ieee80211_csa_finish(struct ieee802 bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif); /** @@ -59,9 +60,9 @@ Signed-off-by: John Crispin * ieee80211_proberesp_get - retrieve a Probe Response template * @hw: pointer obtained from ieee80211_alloc_hw(). * @vif: &struct ieee80211_vif pointer from the add_interface callback. -@@ -6726,4 +6743,16 @@ struct sk_buff * - ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, - struct ieee80211_vif *vif); +@@ -6845,4 +6862,16 @@ void ieee80211_update_muedca_params(stru + struct ieee80211_mu_edca_param_set + *params, gfp_t gfp); +/** + * ieeee80211_obss_color_collision_notify notify userland about a BSS color @@ -78,7 +79,7 @@ Signed-off-by: John Crispin #endif /* MAC80211_H */ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -861,7 +861,8 @@ static int ieee80211_set_monitor_channel +@@ -862,7 +862,8 @@ static int ieee80211_set_monitor_channel static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata, const u8 *resp, size_t resp_len, @@ -88,7 +89,7 @@ Signed-off-by: John Crispin { struct probe_resp *new, *old; -@@ -881,6 +882,8 @@ static int ieee80211_set_probe_resp(stru +@@ -882,6 +883,8 @@ static int ieee80211_set_probe_resp(stru memcpy(new->cntdwn_counter_offsets, csa->counter_offsets_presp, csa->n_counter_offsets_presp * sizeof(new->cntdwn_counter_offsets[0])); @@ -97,7 +98,7 @@ Signed-off-by: John Crispin rcu_assign_pointer(sdata->u.ap.probe_resp, new); if (old) -@@ -1011,7 +1014,8 @@ static u8 *ieee80211_copy_multiple_bssid +@@ -1018,7 +1021,8 @@ static u8 *ieee80211_copy_multiple_bssid static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, struct cfg80211_beacon_data *params, @@ -107,7 +108,7 @@ Signed-off-by: John Crispin { struct beacon_data *new, *old; int new_head_len, new_tail_len, new_multiple_bssid_len; -@@ -1083,6 +1087,11 @@ static int ieee80211_assign_beacon(struc +@@ -1090,6 +1094,11 @@ static int ieee80211_assign_beacon(struc sizeof(new->cntdwn_counter_offsets[0])); } @@ -119,7 +120,7 @@ Signed-off-by: John Crispin /* copy in head */ if (params->head) memcpy(new->head, params->head, new_head_len); -@@ -1097,7 +1106,7 @@ static int ieee80211_assign_beacon(struc +@@ -1104,7 +1113,7 @@ static int ieee80211_assign_beacon(struc memcpy(new->tail, old->tail, new_tail_len); err = ieee80211_set_probe_resp(sdata, params->probe_resp, @@ -128,16 +129,27 @@ Signed-off-by: John Crispin if (err < 0) { kfree(new); return err; -@@ -1256,7 +1265,7 @@ static int ieee80211_start_ap(struct wip - } +@@ -1176,9 +1185,7 @@ static int ieee80211_start_ap(struct wip + le32_get_bits(params->he_oper->he_oper_params, + IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK); + changed |= BSS_CHANGED_HE_OBSS_PD; +- +- if (params->he_bss_color.enabled) +- changed |= BSS_CHANGED_HE_BSS_COLOR; ++ changed |= BSS_CHANGED_HE_BSS_COLOR; } + if (params->he_cap) { +@@ -1266,7 +1273,7 @@ static int ieee80211_start_ap(struct wip + if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) + sdata->vif.bss_conf.beacon_tx_rate = params->beacon_rate; + - err = ieee80211_assign_beacon(sdata, ¶ms->beacon, NULL); + err = ieee80211_assign_beacon(sdata, ¶ms->beacon, NULL, NULL); - if (err < 0) { - ieee80211_vif_release_channel(sdata); - return err; -@@ -1311,17 +1320,17 @@ static int ieee80211_change_beacon(struc + if (err < 0) + goto error; + changed |= err; +@@ -1305,17 +1312,17 @@ static int ieee80211_change_beacon(struc sdata = IEEE80211_DEV_TO_SUB_IF(dev); sdata_assert_lock(sdata); @@ -158,7 +170,7 @@ Signed-off-by: John Crispin if (err < 0) return err; ieee80211_bss_info_change_notify(sdata, err); -@@ -3240,7 +3249,7 @@ static int ieee80211_set_after_csa_beaco +@@ -3223,7 +3230,7 @@ static int ieee80211_set_after_csa_beaco switch (sdata->vif.type) { case NL80211_IFTYPE_AP: err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon, @@ -167,7 +179,7 @@ Signed-off-by: John Crispin kfree(sdata->u.ap.next_beacon); sdata->u.ap.next_beacon = NULL; -@@ -3406,7 +3415,7 @@ static int ieee80211_set_csa_beacon(stru +@@ -3389,7 +3396,7 @@ static int ieee80211_set_csa_beacon(stru csa.n_counter_offsets_presp = params->n_counter_offsets_presp; csa.count = params->count; @@ -176,7 +188,7 @@ Signed-off-by: John Crispin if (err < 0) { kfree(sdata->u.ap.next_beacon); return err; -@@ -3494,6 +3503,14 @@ static int ieee80211_set_csa_beacon(stru +@@ -3478,6 +3485,14 @@ static int ieee80211_set_csa_beacon(stru return 0; } @@ -191,7 +203,7 @@ Signed-off-by: John Crispin static int __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_csa_settings *params) -@@ -3562,6 +3579,10 @@ __ieee80211_channel_switch(struct wiphy +@@ -3546,6 +3561,10 @@ __ieee80211_channel_switch(struct wiphy goto out; } @@ -202,8 +214,8 @@ Signed-off-by: John Crispin err = ieee80211_set_csa_beacon(sdata, params, &changed); if (err) { ieee80211_vif_unreserve_chanctx(sdata); -@@ -4202,6 +4223,194 @@ static int ieee80211_reset_tid_config(st - return ret; +@@ -4197,6 +4216,194 @@ static int ieee80211_set_sar_specs(struc + return local->ops->set_sar_specs(&local->hw, sar); } +static int ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata, @@ -397,15 +409,15 @@ Signed-off-by: John Crispin const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, -@@ -4305,4 +4514,5 @@ const struct cfg80211_ops mac80211_confi - .probe_mesh_link = ieee80211_probe_mesh_link, - .set_tid_config = ieee80211_set_tid_config, - .reset_tid_config = ieee80211_reset_tid_config, +@@ -4302,4 +4509,5 @@ const struct cfg80211_ops mac80211_confi + .set_sar_specs = ieee80211_set_sar_specs, + .set_fils_discovery = ieee80211_set_fils_discovery, + .set_unsol_bcast_probe_resp = ieee80211_set_unsol_bcast_probe_resp, + .color_change = ieee80211_color_change, }; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -256,6 +256,13 @@ struct ieee80211_csa_settings { +@@ -260,6 +260,13 @@ struct ieee80211_csa_settings { u8 count; }; @@ -419,7 +431,7 @@ Signed-off-by: John Crispin struct beacon_data { u8 *head, *tail; int head_len, tail_len; -@@ -940,6 +947,8 @@ struct ieee80211_sub_if_data { +@@ -942,6 +949,8 @@ struct ieee80211_sub_if_data { bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */ struct cfg80211_chan_def csa_chandef; @@ -440,7 +452,7 @@ Signed-off-by: John Crispin NETIF_F_HW_CSUM | NETIF_F_SG | \ --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -960,6 +960,8 @@ static void ieee80211_do_stop(struct iee +@@ -486,6 +486,8 @@ static void ieee80211_do_stop(struct iee GFP_KERNEL); } @@ -449,7 +461,7 @@ Signed-off-by: John Crispin /* APs need special treatment */ if (sdata->vif.type == NL80211_IFTYPE_AP) { struct ieee80211_sub_if_data *vlan, *tmpsdata; -@@ -1618,6 +1620,7 @@ static void ieee80211_setup_sdata(struct +@@ -1649,6 +1651,7 @@ static void ieee80211_setup_sdata(struct INIT_WORK(&sdata->work, ieee80211_iface_work); INIT_WORK(&sdata->recalc_smps, ieee80211_recalc_smps_work); INIT_WORK(&sdata->csa_finalize_work, ieee80211_csa_finalize_work); @@ -459,7 +471,7 @@ Signed-off-by: John Crispin --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4597,11 +4597,12 @@ static int ieee80211_beacon_add_tim(stru +@@ -4590,11 +4590,12 @@ static int ieee80211_beacon_add_tim(stru static void ieee80211_set_beacon_cntdwn(struct ieee80211_sub_if_data *sdata, struct beacon_data *beacon) { @@ -473,7 +485,7 @@ Signed-off-by: John Crispin switch (sdata->vif.type) { case NL80211_IFTYPE_AP: -@@ -4621,21 +4622,25 @@ static void ieee80211_set_beacon_cntdwn( +@@ -4614,21 +4615,25 @@ static void ieee80211_set_beacon_cntdwn( } rcu_read_lock(); @@ -507,7 +519,7 @@ Signed-off-by: John Crispin } rcu_read_unlock(); } -@@ -4864,6 +4869,7 @@ __ieee80211_beacon_get(struct ieee80211_ +@@ -4857,6 +4862,7 @@ __ieee80211_beacon_get(struct ieee80211_ if (offs) { offs->tim_offset = beacon->head_len; offs->tim_length = skb->len - beacon->head_len; diff --git a/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-ath11k-Add-HE-UL-MU-fixed-rate-setting.patch b/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-ath11k-Add-HE-UL-MU-fixed-rate-setting.patch new file mode 100644 index 000000000..b817be4b7 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/213-mac80211-ath11k-Add-HE-UL-MU-fixed-rate-setting.patch @@ -0,0 +1,287 @@ +From d88a4dcd4a5177025653a3b5442a41a8362cadc0 Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Wed, 23 Sep 2020 05:55:02 -0700 +Subject: [PATCH] mac80211/ath11k:Add HE UL MU fixed rate setting + +HE UL MU fixed rate is informed to HE STA by HE Basic Trigger frame. +The added code is reusing parts of the existing code path used for HE +fixed rate, this includes nl80211 definitions, policies and parsing +code required to pass HE UL MU fixed rate settings + +Signed-off-by: Muna Sinada +--- + drivers/net/wireless/ath/ath11k/mac.c | 96 +++++++++++++++++++++++++++++++---- + drivers/net/wireless/ath/ath11k/wmi.h | 1 + + include/net/cfg80211.h | 1 + + include/uapi/linux/nl80211.h | 2 + + net/wireless/nl80211.c | 12 +++++ + 5 files changed, 102 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3738,6 +3738,20 @@ ath11k_mac_bitrate_mask_num_he_rates(str + } + + static int ++ath11k_mac_bitrate_mask_num_he_ul_rates(struct ath11k *ar, ++ enum nl80211_band band, ++ const struct cfg80211_bitrate_mask *mask) ++{ ++ int num_rates = 0; ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(mask->control[band].he_ul_mcs); i++) ++ num_rates += hweight16(mask->control[band].he_ul_mcs[i]); ++ ++ return num_rates; ++} ++ ++static int + ath11k_mac_set_peer_vht_fixed_rate(struct ath11k_vif *arvif, + struct ieee80211_sta *sta, + const struct cfg80211_bitrate_mask *mask, +@@ -7048,10 +7062,11 @@ ath11k_mac_set_auto_rate_GI_LTF(struct a + + static int ath11k_mac_set_rate_params(struct ath11k_vif *arvif, + u32 rate, u8 nss, u8 sgi, u8 ldpc, +- u8 he_gi, u8 he_ltf, bool he_fixed_rate) ++ u8 he_gi, u8 he_ltf, bool he_fixed_rate, ++ int he_ul_rate, u8 he_ul_nss) + { + struct ath11k *ar = arvif->ar; +- u32 vdev_param; ++ u32 vdev_param, rate_code; + int ret; + + lockdep_assert_held(&ar->conf_mutex); +@@ -7113,6 +7128,20 @@ static int ath11k_mac_set_rate_params(st + } + } + ++ if ((he_ul_rate < 0) || !he_ul_nss) ++ return 0; ++ ++ rate_code = ATH11K_HW_RATE_CODE(he_ul_rate, he_ul_nss - 1, ++ WMI_RATE_PREAMBLE_HE); ++ ++ vdev_param = WMI_VDEV_PARAM_UL_FIXED_RATE; ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, vdev_param, rate_code); ++ ++ if(ret) { ++ ath11k_warn(ar->ab, "failed to set HE UL Fixed Rate:%d, error:%d\n", ++ he_ul_rate, ret); ++ } ++ + return 0; + } + +@@ -7166,6 +7195,21 @@ ath11k_mac_he_mcs_range_present(struct a + return true; + } + ++static bool ++ath11k_mac_he_ul_mcs_present(struct ath11k *ar, ++ enum nl80211_band band, ++ const struct cfg80211_bitrate_mask *mask) ++{ ++ int i; ++ ++ for (i = 0; i < NL80211_HE_NSS_MAX; i++) { ++ if (mask->control[band].he_ul_mcs[i]) ++ return true; ++ } ++ ++ return false; ++} ++ + static void ath11k_mac_set_bitrate_mask_iter(void *data, + struct ieee80211_sta *sta) + { +@@ -7202,13 +7246,15 @@ ath11k_mac_validate_vht_he_fixed_rate_se + const struct cfg80211_bitrate_mask *mask) + { + bool he_fixed_rate = false, vht_fixed_rate = false; ++ bool he_ul_fixed_rate = false; + struct ath11k_peer *peer, *tmp; +- const u16 *vht_mcs_mask, *he_mcs_mask; +- u8 vht_nss, he_nss; ++ const u16 *vht_mcs_mask, *he_mcs_mask, *he_ul_mcs_mask; ++ u8 vht_nss, he_nss, he_ul_nss; + bool ret = true; + + vht_mcs_mask = mask->control[band].vht_mcs; + he_mcs_mask = mask->control[band].he_mcs; ++ he_ul_mcs_mask = mask->control[band].he_ul_mcs; + + if (ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask) == 1) + vht_fixed_rate = true; +@@ -7216,11 +7262,15 @@ ath11k_mac_validate_vht_he_fixed_rate_se + if (ath11k_mac_bitrate_mask_num_he_rates(ar, band, mask) == 1) + he_fixed_rate = true; + +- if(!vht_fixed_rate && !he_fixed_rate) ++ if (ath11k_mac_bitrate_mask_num_he_ul_rates(ar, band, mask) == 1) ++ he_ul_fixed_rate = true; ++ ++ if(!vht_fixed_rate && !he_fixed_rate && !he_ul_fixed_rate) + return true; + + vht_nss = ath11k_mac_max_vht_nss(vht_mcs_mask); + he_nss = ath11k_mac_max_he_nss(he_mcs_mask); ++ he_ul_nss = ath11k_mac_max_he_nss(he_ul_mcs_mask); + + rcu_read_lock(); + spin_lock_bh(&ar->ab->base_lock); +@@ -7236,6 +7286,14 @@ ath11k_mac_validate_vht_he_fixed_rate_se + ret = false; + goto exit; + } ++ /* TODO: ++ check when UL is valid ++ */ ++ if (he_ul_fixed_rate && (!peer->sta->he_cap.has_he || ++ peer->sta->rx_nss < he_ul_nss)) { ++ ret = false; ++ goto exit; ++ } + } + } + exit: +@@ -7303,14 +7361,16 @@ ath11k_mac_op_set_bitrate_mask(struct ie + const u8 *ht_mcs_mask; + const u16 *vht_mcs_mask; + const u16 *he_mcs_mask; ++ const u16 *he_ul_mcs_mask; + u32 rate; +- u8 nss; ++ u8 nss, he_ul_nss = 0; + u8 sgi; + u8 ldpc; + u8 he_gi = 0, he_ltf = 0; + int single_nss; +- int ret; ++ int ret, i; + int num_rates; ++ int he_ul_rate = -1; + bool he_fixed_rate = false; + + if (ath11k_mac_vif_chan(vif, &def)) +@@ -7320,6 +7380,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie + ht_mcs_mask = mask->control[band].ht_mcs; + vht_mcs_mask = mask->control[band].vht_mcs; + he_mcs_mask = mask->control[band].he_mcs; ++ he_ul_mcs_mask = mask->control[band].he_ul_mcs; + ldpc = !!(ar->ht_cap_info & WMI_HT_CAP_LDPC); + + sgi = mask->control[band].gi; +@@ -7329,6 +7390,15 @@ ath11k_mac_op_set_bitrate_mask(struct ie + he_gi = mask->control[band].he_gi; + he_ltf = mask->control[band].he_ltf; + ++ for (i = 0; i < ARRAY_SIZE(mask->control[band].he_ul_mcs); i++) { ++ if (hweight16(mask->control[band].he_ul_mcs[i]) == 1) { ++ he_ul_nss = i + 1; ++ he_ul_rate = ffs((int) ++ mask->control[band].he_ul_mcs[i]) - 1; ++ break; ++ } ++ } ++ + /* mac80211 doesn't support sending a fixed HT/VHT MCS alone, rather it + * requires passing atleast one of used basic rates along with them. + * Fixed rate setting across different preambles(legacy, HT, VHT) is +@@ -7418,6 +7488,15 @@ ath11k_mac_op_set_bitrate_mask(struct ie + return -EINVAL; + } + ++ num_rates = ath11k_mac_bitrate_mask_num_he_ul_rates(ar, band, ++ mask); ++ if (ath11k_mac_he_ul_mcs_present(ar, band, mask) && ++ num_rates != 1) { ++ ath11k_warn(ar->ab, ++ "Setting HE UL MCS Fixed Rate range is not supported\n"); ++ return -EINVAL; ++ } ++ + mutex_lock(&ar->conf_mutex); + ieee80211_iterate_stations_atomic(ar->hw, + ath11k_mac_disable_peer_fixed_rate, +@@ -7434,9 +7513,10 @@ ath11k_mac_op_set_bitrate_mask(struct ie + mutex_lock(&ar->conf_mutex); + + ret = ath11k_mac_set_rate_params(arvif, rate, nss, sgi, ldpc, he_gi, +- he_ltf, he_fixed_rate); ++ he_ltf, he_fixed_rate, he_ul_rate, ++ he_ul_nss); + if (ret) { +- ath11k_warn(ar->ab, "failed to set rate params on vdev %i: %d\n", ++ ath11k_warn(ar->ab, "failed to set fixed rate params on vdev %i: %d\n", + arvif->vdev_id, ret); + } + +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -1075,6 +1075,7 @@ enum wmi_tlv_vdev_param { + WMI_VDEV_PARAM_BA_MODE = 0x7e, + WMI_VDEV_PARAM_AUTORATE_MISC_CFG = 0x80, + WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE = 0x87, ++ WMI_VDEV_PARAM_UL_FIXED_RATE, + WMI_VDEV_PARAM_6GHZ_PARAMS = 0x99, + WMI_VDEV_PARAM_PROTOTYPE = 0x8000, + WMI_VDEV_PARAM_BSS_COLOR, +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -716,6 +716,7 @@ struct cfg80211_bitrate_mask { + enum nl80211_txrate_gi gi; + enum nl80211_he_gi he_gi; + enum nl80211_he_ltf he_ltf; ++ u16 he_ul_mcs[NL80211_HE_NSS_MAX]; + } control[NUM_NL80211_BANDS]; + }; + +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -4919,6 +4919,7 @@ enum nl80211_key_attributes { + * see &struct nl80211_txrate_he + * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us. + * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF. ++ * @NL80211_TXRATE_HE_UL: HE MCS rates of connected HE STA for uplink traffic. + * @__NL80211_TXRATE_AFTER_LAST: internal + * @NL80211_TXRATE_MAX: highest TX rate attribute + */ +@@ -4931,6 +4932,7 @@ enum nl80211_tx_rate_attributes { + NL80211_TXRATE_HE, + NL80211_TXRATE_HE_GI, + NL80211_TXRATE_HE_LTF, ++ NL80211_TXRATE_HE_UL, + + /* keep last */ + __NL80211_TXRATE_AFTER_LAST, +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -381,6 +381,10 @@ static const struct nla_policy nl80211_t + [NL80211_TXRATE_HE_LTF] = NLA_POLICY_RANGE(NLA_U8, + NL80211_RATE_INFO_HE_1XLTF, + NL80211_RATE_INFO_HE_4XLTF), ++ [NL80211_TXRATE_HE_UL] = { ++ .type = NLA_EXACT_LEN_WARN, ++ .len = sizeof(struct nl80211_txrate_he), ++ }, + }; + + static const struct nla_policy +@@ -4891,6 +4895,14 @@ static int nl80211_parse_tx_bitrate_mask + mask->control[band].he_ltf = + nla_get_u8(tb[NL80211_TXRATE_HE_LTF]); + ++ if (tb[NL80211_TXRATE_HE_UL]) { ++ if (!he_set_mcs_mask( ++ info, wdev, sband, ++ nla_data(tb[NL80211_TXRATE_HE_UL]), ++ mask->control[band].he_ul_mcs)) ++ return -EINVAL; ++ } ++ + if (mask->control[band].legacy == 0) { + /* don't allow empty legacy rates if HT, VHT or HE + * are not even supported. diff --git a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-Enable-WMI-based-FW-Logging.patch b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-Enable-WMI-based-FW-Logging.patch index 4a6e1afb9..8e1b4fd5f 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-Enable-WMI-based-FW-Logging.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-Enable-WMI-based-FW-Logging.patch @@ -24,31 +24,31 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -77,6 +77,7 @@ static const struct ath11k_hw_params ath - .spectral_max_fft_bins = 512, - .spectral_fft_hdr_len = 16, +@@ -90,6 +90,7 @@ static const struct ath11k_hw_params ath + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, }, { - .hw_rev = ATH11K_HW_IPQ6018, -@@ -115,6 +116,7 @@ static const struct ath11k_hw_params ath - .spectral_max_fft_bins = 512, - .spectral_fft_hdr_len = 16, + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -136,6 +137,7 @@ static const struct ath11k_hw_params ath + .supports_suspend = false, + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, }, { .name = "qca6390 hw2.0", -@@ -147,6 +149,7 @@ static const struct ath11k_hw_params ath - .tcl_0_only = true, +@@ -177,6 +179,7 @@ static const struct ath11k_hw_params ath + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .spectral_fft_sz = 2, .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, }, { - .name = "qcn9000 hw1.0", -@@ -184,6 +187,7 @@ static const struct ath11k_hw_params ath + .name = "qcn9074 hw1.0", +@@ -220,6 +223,7 @@ static const struct ath11k_hw_params ath .spectral_summary_pad_sz = 16, .spectral_fft_hdr_len = 24, .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, @@ -56,7 +56,7 @@ Signed-off-by: Sriram R }, { .hw_rev = ATH11K_HW_IPQ5018, -@@ -222,6 +226,7 @@ static const struct ath11k_hw_params ath +@@ -258,6 +262,7 @@ static const struct ath11k_hw_params ath .spectral_summary_pad_sz = 16, .spectral_fft_hdr_len = 24, .reo_dest_ring_map_shift = HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT, @@ -64,11 +64,21 @@ Signed-off-by: Sriram R }, }; -@@ -836,6 +841,14 @@ int ath11k_core_qmi_firmware_ready(struc +@@ -944,6 +949,9 @@ int ath11k_core_ssr_notifier_cb(struct n + return 0; + } + #endif ++unsigned int ce_fwlog = 1; ++module_param_named(ce_fwlog, ce_fwlog, uint, 0644); ++MODULE_PARM_DESC(ce_fwlog, "Enable/Disable CE based FW logging"); + + int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab) + { +@@ -1004,6 +1012,14 @@ int ath11k_core_qmi_firmware_ready(struc ath11k_config_qdss(ab); -+ if (ab->hw_params.ce_fwlog_enable) { ++ if (ab->hw_params.ce_fwlog_enable && ce_fwlog) { + ret = ath11k_enable_fwlog(ab); + if (ret < 0) { + ath11k_err(ab, "failed to enable fwlog: %d\n", ret); @@ -81,7 +91,7 @@ Signed-off-by: Sriram R return 0; --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -181,6 +181,7 @@ struct ath11k_hw_params { +@@ -190,6 +190,7 @@ struct ath11k_hw_params { u32 hal_desc_sz; u32 m3_addr; u8 reo_dest_ring_map_shift; @@ -91,7 +101,7 @@ Signed-off-by: Sriram R struct ath11k_hw_ops { --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -1946,6 +1946,50 @@ struct qmi_elem_info qmi_wlanfw_qdss_tra +@@ -2056,6 +2056,50 @@ struct qmi_elem_info qmi_wlanfw_qdss_tra }, }; @@ -142,7 +152,7 @@ Signed-off-by: Sriram R int wlfw_send_qdss_trace_config_download_req(struct ath11k_base *ab, const u8 *buffer, unsigned int file_len) { -@@ -3762,6 +3806,55 @@ static void ath11k_qmi_driver_event_work +@@ -3949,6 +3993,55 @@ static void ath11k_qmi_driver_event_work spin_unlock(&qmi->event_lock); } @@ -200,7 +210,7 @@ Signed-off-by: Sriram R int ret; --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h -@@ -198,6 +198,18 @@ struct qmi_wlanfw_m3_dump_upload_done_re +@@ -204,6 +204,18 @@ struct qmi_wlanfw_m3_dump_upload_done_re struct qmi_response_type_v01 resp; }; @@ -219,7 +229,7 @@ Signed-off-by: Sriram R #define QMI_WLANFW_QDSS_TRACE_MODE_REQ_V01 0x0045 #define QMI_WLANFW_QDSS_TRACE_MODE_REQ_MSG_V01_MAX_LEN 18 #define QMI_WLANFW_QDSS_TRACE_MODE_RESP_MSG_V01_MAX_LEN 7 -@@ -617,6 +629,7 @@ int wlfw_send_qdss_trace_config_download +@@ -623,6 +635,7 @@ int wlfw_send_qdss_trace_config_download int ath11k_send_qdss_trace_mode_req(struct ath11k_base *ab, enum wlfw_qdss_trace_mode_enum_v01 mode); int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab); @@ -245,7 +255,7 @@ Signed-off-by: Sriram R + struct ath11k_pdev *pdev; + + for (i = 0; i < ab->num_radios; i++) { -+ pdev = rcu_dereference(ab->pdevs_active[i]); ++ pdev = &ab->pdevs[i]; + if (pdev && pdev->ar) { + ar = pdev->ar; + break; @@ -319,7 +329,7 @@ Signed-off-by: Sriram R __ATH11K_TM_ATTR_AFTER_LAST, --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -8138,6 +8138,29 @@ static void ath11k_wmi_wds_peer_event(st +@@ -8237,6 +8237,29 @@ static void ath11k_wmi_wds_peer_event(st wds_addr_arg.dst_macaddr); } @@ -349,7 +359,7 @@ Signed-off-by: Sriram R static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) { struct wmi_cmd_hdr *cmd_hdr; -@@ -8263,6 +8286,9 @@ static void ath11k_wmi_tlv_op_rx(struct +@@ -8365,6 +8388,9 @@ static void ath11k_wmi_tlv_op_rx(struct case WMI_MUEDCA_PARAMS_CONFIG_EVENTID: ath11k_wmi_pdev_update_muedca_params_status_event(ab, skb); break; @@ -358,4 +368,4 @@ Signed-off-by: Sriram R + break; /* TODO: Add remaining events */ default: - ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); diff --git a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-add-support-for-BSS-coloring.patch b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-add-support-for-BSS-coloring.patch index 19934c373..e128c154c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-add-support-for-BSS-coloring.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-add-support-for-BSS-coloring.patch @@ -19,7 +19,7 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1136,30 +1136,32 @@ static int ath11k_mac_setup_bcn_tmpl(str +@@ -1111,30 +1111,32 @@ static int ath11k_mac_setup_bcn_tmpl(str void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) { @@ -73,17 +73,17 @@ Signed-off-by: John Crispin ath11k_mac_setup_bcn_tmpl(arvif); } -@@ -3148,6 +3150,24 @@ static void ath11k_mac_op_bss_info_chang +@@ -3145,6 +3147,24 @@ static void ath11k_mac_op_bss_info_chang if (ret) ath11k_warn(ar->ab, "failed to set bss color collision on vdev %i: %d\n", arvif->vdev_id, ret); + + param_id = WMI_VDEV_PARAM_BSS_COLOR; -+ if (info->he_bss_color.enabled) -+ param_value = info->he_bss_color.color << -+ IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET; -+ else -+ param_value = IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED; ++ param_value = info->he_bss_color.color << ++ IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET; ++ ++ if (!info->he_bss_color.enabled) ++ param_value |= IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED; + + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + param_id, @@ -98,7 +98,7 @@ Signed-off-by: John Crispin } else if (vif->type == NL80211_IFTYPE_STATION) { ret = ath11k_wmi_send_bss_color_change_enable_cmd(ar, arvif->vdev_id, -@@ -8107,6 +8127,7 @@ static int __ath11k_mac_register(struct +@@ -8211,6 +8231,7 @@ static int __ath11k_mac_register(struct wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_STA_TX_PWR); @@ -117,7 +117,7 @@ Signed-off-by: John Crispin [WMI_TAG_WDS_ADDR_EVENT] = { .min_len = sizeof(struct wmi_wds_addr_event) }, }; -@@ -3913,6 +3915,49 @@ int ath11k_wmi_fils_discovery(struct ath +@@ -3988,6 +3990,49 @@ int ath11k_wmi_fils_discovery(struct ath } static void @@ -167,7 +167,7 @@ Signed-off-by: John Crispin ath11k_fill_band_to_mac_param(struct ath11k_base *soc, struct wmi_host_pdev_band_to_mac *band_to_mac) { -@@ -8262,6 +8307,9 @@ static void ath11k_wmi_tlv_op_rx(struct +@@ -8364,6 +8409,9 @@ static void ath11k_wmi_tlv_op_rx(struct case WMI_WDS_PEER_EVENTID: ath11k_wmi_wds_peer_event(ab, skb); break; @@ -179,7 +179,7 @@ Signed-off-by: John Crispin case WMI_PEER_OPER_MODE_CHANGE_EVENTID: --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -786,6 +786,7 @@ enum wmi_tlv_event_id { +@@ -781,6 +781,7 @@ enum wmi_tlv_event_id { WMI_MDNS_STATS_EVENTID = WMI_TLV_CMD(WMI_GRP_MDNS_OFL), WMI_SAP_OFL_ADD_STA_EVENTID = WMI_TLV_CMD(WMI_GRP_SAP_OFL), WMI_SAP_OFL_DEL_STA_EVENTID, @@ -187,7 +187,7 @@ Signed-off-by: John Crispin WMI_OCB_SET_CONFIG_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_OCB), WMI_OCB_GET_TSF_TIMER_RESP_EVENTID, WMI_DCC_GET_STATS_RESP_EVENTID, -@@ -5244,6 +5245,13 @@ struct wmi_pdev_obss_pd_bitmap_cmd { +@@ -5287,6 +5288,13 @@ enum wmi_vdev_aggr_type { #define ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS 10000 #define ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS 5000 @@ -201,7 +201,7 @@ Signed-off-by: John Crispin struct wmi_obss_color_collision_cfg_params_cmd { u32 tlv_header; u32 vdev_id; -@@ -5261,6 +5269,12 @@ struct wmi_bss_color_change_enable_param +@@ -5304,6 +5312,12 @@ struct wmi_bss_color_change_enable_param u32 enable; } __packed; diff --git a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-qos-null-frame-tx-over-wmi.patch b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-qos-null-frame-tx-over-wmi.patch index f5ffebe66..b401f19da 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-qos-null-frame-tx-over-wmi.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/214-ath11k-qos-null-frame-tx-over-wmi.patch @@ -22,7 +22,7 @@ Signed-off-by: Sowmiya Sree Elavalagan --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -5309,6 +5309,16 @@ static int ath11k_mac_mgmt_tx_wmi(struct +@@ -5292,6 +5292,16 @@ static int ath11k_mac_mgmt_tx_wmi(struct ATH11K_SKB_CB(skb)->paddr = paddr; @@ -39,7 +39,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ret = ath11k_wmi_mgmt_send(ar, arvif->vdev_id, buf_id, skb); if (ret) { ath11k_warn(ar->ab, "failed to send mgmt frame: %d\n", ret); -@@ -5374,8 +5384,8 @@ static void ath11k_mgmt_over_wmi_tx_work +@@ -5356,8 +5366,8 @@ static void ath11k_mgmt_over_wmi_tx_work } } @@ -50,7 +50,7 @@ Signed-off-by: Sowmiya Sree Elavalagan { struct sk_buff_head *q = &ar->wmi_mgmt_tx_queue; -@@ -5425,7 +5435,7 @@ static void ath11k_mac_op_tx(struct ieee +@@ -5417,7 +5427,7 @@ static void ath11k_mac_op_tx(struct ieee } else if (ieee80211_is_mgmt(hdr->frame_control)) { frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control); @@ -59,7 +59,7 @@ Signed-off-by: Sowmiya Sree Elavalagan if (ret) { if (ret != -EBUSY) ath11k_warn(ar->ab, "failed to queue management frame %d\n", -@@ -5446,6 +5456,20 @@ static void ath11k_mac_op_tx(struct ieee +@@ -5432,6 +5442,20 @@ static void ath11k_mac_op_tx(struct ieee spin_unlock_bh(&ar->data_lock); } return; @@ -91,7 +91,7 @@ Signed-off-by: Sowmiya Sree Elavalagan [WMI_TAG_SCAN_EVENT] = { .min_len = sizeof(struct wmi_scan_event) }, [WMI_TAG_PEER_STA_KICKOUT_EVENT] -@@ -662,6 +662,55 @@ int ath11k_wmi_mgmt_send(struct ath11k * +@@ -656,6 +656,55 @@ int ath11k_wmi_mgmt_send(struct ath11k * return ret; } @@ -147,7 +147,7 @@ Signed-off-by: Sowmiya Sree Elavalagan int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, struct vdev_create_params *param) { -@@ -5324,7 +5373,7 @@ static int ath11k_pull_mgmt_rx_params_tl +@@ -5381,7 +5430,7 @@ static int ath11k_pull_mgmt_rx_params_tl return 0; } @@ -156,7 +156,19 @@ Signed-off-by: Sowmiya Sree Elavalagan { struct sk_buff *msdu; struct ieee80211_tx_info *info; -@@ -5378,10 +5427,13 @@ static int wmi_process_mgmt_tx_comp(stru +@@ -5417,6 +5466,11 @@ static int wmi_process_mgmt_tx_comp(stru + info->status.is_valid_ack_signal = true; + } + ++ /* dont update rates in this path, qos null data tx completions also can ++ * take this path in case of nss offload and can update invalid rates. ++ */ ++ info->status.rates[0].idx = -1; ++ + hdr = (struct ieee80211_hdr *)msdu->data; + frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); + +@@ -5435,10 +5489,13 @@ static int wmi_process_mgmt_tx_comp(stru arvif = ath11k_vif_to_arvif(vif); mgmt_stats = &arvif->mgmt_stats; @@ -174,7 +186,7 @@ Signed-off-by: Sowmiya Sree Elavalagan spin_unlock_bh(&ar->data_lock); skip_mgmt_stats: -@@ -5394,12 +5446,13 @@ skip_mgmt_stats: +@@ -5451,12 +5508,13 @@ skip_mgmt_stats: return 0; } @@ -192,7 +204,7 @@ Signed-off-by: Sowmiya Sree Elavalagan int ret; tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); -@@ -5409,7 +5462,7 @@ static int ath11k_pull_mgmt_tx_compl_par +@@ -5466,7 +5524,7 @@ static int ath11k_pull_mgmt_tx_compl_par return ret; } @@ -201,7 +213,7 @@ Signed-off-by: Sowmiya Sree Elavalagan if (!ev) { ath11k_warn(ab, "failed to fetch mgmt tx compl ev"); kfree(tb); -@@ -6886,10 +6939,11 @@ exit: +@@ -6935,10 +6993,11 @@ exit: static void ath11k_mgmt_tx_compl_event(struct ath11k_base *ab, struct sk_buff *skb) { @@ -215,7 +227,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ath11k_warn(ab, "failed to extract mgmt tx compl event"); return; } -@@ -6902,7 +6956,7 @@ static void ath11k_mgmt_tx_compl_event(s +@@ -6951,7 +7010,7 @@ static void ath11k_mgmt_tx_compl_event(s goto exit; } @@ -224,7 +236,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ath11k_dbg(ab, ATH11K_DBG_MGMT, "mgmt tx compl ev pdev_id %d, desc_id %d, status %d", -@@ -6913,6 +6967,36 @@ exit: +@@ -6962,6 +7021,36 @@ exit: rcu_read_unlock(); } @@ -261,7 +273,7 @@ Signed-off-by: Sowmiya Sree Elavalagan static struct ath11k *ath11k_get_ar_on_scan_abort(struct ath11k_base *ab, u32 vdev_id) { -@@ -7284,47 +7368,67 @@ static void ath11k_vdev_install_key_comp +@@ -7333,47 +7422,67 @@ static void ath11k_vdev_install_key_comp rcu_read_unlock(); } @@ -361,7 +373,7 @@ Signed-off-by: Sowmiya Sree Elavalagan } static void ath11k_peer_assoc_conf_event(struct ath11k_base *ab, struct sk_buff *skb) -@@ -8337,6 +8441,9 @@ static void ath11k_wmi_tlv_op_rx(struct +@@ -8442,6 +8551,9 @@ static void ath11k_wmi_tlv_op_rx(struct case WMI_DIAG_EVENTID: ath11k_wmi_diag_event(ab, skb); break; @@ -370,10 +382,10 @@ Signed-off-by: Sowmiya Sree Elavalagan + break; /* TODO: Add remaining events */ default: - ath11k_warn(ab, "Unknown eventid: 0x%x\n", id); + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -358,6 +358,7 @@ enum wmi_tlv_cmd_id { +@@ -353,6 +353,7 @@ enum wmi_tlv_cmd_id { WMI_BSS_COLOR_CHANGE_ENABLE_CMDID, WMI_VDEV_BCN_OFFLOAD_QUIET_CONFIG_CMDID, WMI_FILS_DISCOVERY_TMPL_CMDID, @@ -381,7 +393,7 @@ Signed-off-by: Sowmiya Sree Elavalagan WMI_ADDBA_CLEAR_RESP_CMDID = WMI_TLV_CMD(WMI_GRP_BA_NEG), WMI_ADDBA_SEND_CMDID, WMI_ADDBA_STATUS_CMDID, -@@ -687,6 +688,8 @@ enum wmi_tlv_event_id { +@@ -682,6 +683,8 @@ enum wmi_tlv_event_id { WMI_TBTTOFFSET_EXT_UPDATE_EVENTID, WMI_OFFCHAN_DATA_TX_COMPLETION_EVENTID, WMI_HOST_FILS_DISCOVERY_EVENTID, @@ -390,7 +402,7 @@ Signed-off-by: Sowmiya Sree Elavalagan WMI_TX_DELBA_COMPLETE_EVENTID = WMI_TLV_CMD(WMI_GRP_BA_NEG), WMI_TX_ADDBA_COMPLETE_EVENTID, WMI_BA_RSP_SSN_EVENTID, -@@ -1879,6 +1882,9 @@ enum wmi_tlv_tag { +@@ -1873,6 +1876,9 @@ enum wmi_tlv_tag { WMI_TAG_TPC_STATS_REG_PWR_ALLOWED, WMI_TAG_TPC_STATS_RATES_ARRAY, WMI_TAG_TPC_STATS_CTL_PWR_TABLE_EVENT, @@ -400,7 +412,7 @@ Signed-off-by: Sowmiya Sree Elavalagan WMI_TAG_MAX }; -@@ -2137,8 +2143,21 @@ enum wmi_tlv_service { +@@ -2131,8 +2137,21 @@ enum wmi_tlv_service { WMI_TLV_SERVICE_TPC_STATS_EVENT = 251, WMI_TLV_SERVICE_NO_INTERBAND_MCC_SUPPORT = 252, WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT = 253, @@ -423,7 +435,7 @@ Signed-off-by: Sowmiya Sree Elavalagan }; enum wmi_unit_test_cmdid { -@@ -3827,6 +3846,7 @@ struct wmi_scan_chan_list_cmd { +@@ -3808,6 +3827,7 @@ struct wmi_scan_chan_list_cmd { } __packed; #define WMI_MGMT_SEND_DOWNLD_LEN 64 @@ -431,7 +443,7 @@ Signed-off-by: Sowmiya Sree Elavalagan #define WMI_TX_PARAMS_DWORD0_POWER GENMASK(7, 0) #define WMI_TX_PARAMS_DWORD0_MCS_MASK GENMASK(19, 8) -@@ -3837,9 +3857,10 @@ struct wmi_scan_chan_list_cmd { +@@ -3818,9 +3838,10 @@ struct wmi_scan_chan_list_cmd { #define WMI_TX_PARAMS_DWORD1_BW_MASK GENMASK(14, 8) #define WMI_TX_PARAMS_DWORD1_PREAMBLE_TYPE GENMASK(19, 15) #define WMI_TX_PARAMS_DWORD1_FRAME_TYPE BIT(20) @@ -444,7 +456,7 @@ Signed-off-by: Sowmiya Sree Elavalagan u32 tlv_header; u32 tx_params_dword0; u32 tx_params_dword1; -@@ -4610,7 +4631,7 @@ struct wmi_rssi_ctl_ext { +@@ -4591,7 +4612,7 @@ struct wmi_rssi_ctl_ext { u32 rssi_ctl_ext[MAX_ANTENNA_EIGHT - ATH_MAX_ANTENNA]; }; @@ -453,7 +465,7 @@ Signed-off-by: Sowmiya Sree Elavalagan u32 desc_id; u32 status; u32 pdev_id; -@@ -5663,6 +5684,17 @@ enum ath11k_wmi_tpc_stats_ctl_array { +@@ -5706,6 +5727,17 @@ enum ath11k_wmi_tpc_stats_ctl_array { ATH11K_TPC_STATS_CTL_160ARRAY, }; @@ -471,7 +483,7 @@ Signed-off-by: Sowmiya Sree Elavalagan #define WMI_MAX_MEM_REQS 32 #define MAX_RADIOS 3 -@@ -5678,7 +5710,7 @@ struct ath11k_wmi_base { +@@ -5721,7 +5753,7 @@ struct ath11k_wmi_base { struct completion service_ready; struct completion unified_ready; @@ -480,7 +492,7 @@ Signed-off-by: Sowmiya Sree Elavalagan wait_queue_head_t tx_credits_wq; const struct wmi_peer_flags_map *peer_flags; u32 num_mem_chunks; -@@ -5696,6 +5728,8 @@ int ath11k_wmi_cmd_send(struct ath11k_pd +@@ -5902,6 +5934,8 @@ int ath11k_wmi_cmd_send(struct ath11k_pd struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len); int ath11k_wmi_mgmt_send(struct ath11k *ar, u32 vdev_id, u32 buf_id, struct sk_buff *frame); diff --git a/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-Add-offchannel-scanning-support.patch b/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-Add-offchannel-scanning-support.patch index ae0d69173..55f495012 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-Add-offchannel-scanning-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-Add-offchannel-scanning-support.patch @@ -41,7 +41,7 @@ Signed-off-by: Abinaya Kalaiselvan --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3385,6 +3385,7 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3380,6 +3380,7 @@ static int ath11k_mac_op_hw_scan(struct struct scan_req_params *arg; int ret = 0; int i; @@ -49,7 +49,7 @@ Signed-off-by: Abinaya Kalaiselvan mutex_lock(&ar->conf_mutex); -@@ -3450,6 +3451,21 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3445,6 +3446,21 @@ static int ath11k_mac_op_hw_scan(struct goto exit; } @@ -71,7 +71,7 @@ Signed-off-by: Abinaya Kalaiselvan ret = ath11k_start_scan(ar, arg); if (ret) { ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); -@@ -3458,10 +3474,8 @@ static int ath11k_mac_op_hw_scan(struct +@@ -3453,10 +3469,8 @@ static int ath11k_mac_op_hw_scan(struct spin_unlock_bh(&ar->data_lock); } @@ -83,7 +83,7 @@ Signed-off-by: Abinaya Kalaiselvan exit: if (arg) { -@@ -8138,6 +8152,11 @@ static int __ath11k_mac_register(struct +@@ -8297,6 +8311,11 @@ static int __ath11k_mac_register(struct wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT); @@ -97,7 +97,7 @@ Signed-off-by: Abinaya Kalaiselvan ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1; --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -2313,6 +2313,9 @@ void ath11k_wmi_start_scan_init(struct a +@@ -2321,6 +2321,9 @@ void ath11k_wmi_start_scan_init(struct a WMI_SCAN_EVENT_FOREIGN_CHAN | WMI_SCAN_EVENT_DEQUEUED; arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT; @@ -105,19 +105,11 @@ Signed-off-by: Abinaya Kalaiselvan + ar->ab->wmi_ab.svc_map)) + arg->scan_ctrl_flags_ext |= WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE; arg->num_bssid = 1; - } - -@@ -2486,6 +2489,7 @@ int ath11k_wmi_send_scan_start_cmd(struc - cmd->num_ssids = params->num_ssids; - cmd->ie_len = params->extraie.len; - cmd->n_probes = params->n_probes; -+ cmd->scan_ctrl_flags_ext = params->scan_ctrl_flags_ext; - - ptr += sizeof(*cmd); + /* fill bssid_list[0] with 0xff, otherwise bssid and RA will be --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -3351,6 +3351,7 @@ struct wmi_start_scan_cmd { +@@ -3348,6 +3348,7 @@ struct wmi_start_scan_cmd { #define WMI_SCAN_DWELL_MODE_MASK 0x00E00000 #define WMI_SCAN_DWELL_MODE_SHIFT 21 @@ -125,7 +117,7 @@ Signed-off-by: Abinaya Kalaiselvan enum { WMI_SCAN_DWELL_MODE_DEFAULT = 0, -@@ -3414,6 +3415,7 @@ struct scan_req_params { +@@ -3411,6 +3412,7 @@ struct scan_req_params { }; u32 scan_events; }; diff --git a/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-improve-station-wds-performance.patch b/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-improve-station-wds-performance.patch deleted file mode 100644 index baf0c52e6..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/215-ath11k-improve-station-wds-performance.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Karthikeyan Periyasamy - -ath11k: Improve wds performance on station mode - -In UL data traffic, station mode gives half of the -performance for NSS 4 capability. Configured the -hw_peer_id info in the tx descriptor as a search idx -improves the data UL traffic performances. - -Signed-off-by: Karthikeyan Periyasamy - ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -216,6 +216,7 @@ struct ath11k_vif { - u32 beacon_interval; - u32 dtim_period; - u16 ast_hash; -+ u16 ast_idx; - u16 tcl_metadata; - u8 hal_addr_search_flags; - u8 search_type; ---- a/drivers/net/wireless/ath/ath11k/dp_tx.c -+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -192,6 +192,7 @@ tcl_ring_sel: - ti.pkt_offset = 0; - ti.lmac_id = ar->lmac_id; - ti.bss_ast_hash = arvif->ast_hash; -+ ti.bss_ast_idx = arvif->ast_idx; - ti.dscp_tid_tbl_idx = 0; - - if (skb->ip_summed == CHECKSUM_PARTIAL && ---- a/drivers/net/wireless/ath/ath11k/hal_tx.c -+++ b/drivers/net/wireless/ath/ath11k/hal_tx.c -@@ -71,6 +71,8 @@ void ath11k_hal_tx_cmd_desc_setup(struct - tcl_cmd->info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, - ti->dscp_tid_tbl_idx) | - FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX, -+ ti->bss_ast_idx) | -+ FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, - ti->bss_ast_hash); - tcl_cmd->info4 = 0; - ---- a/drivers/net/wireless/ath/ath11k/hal_tx.h -+++ b/drivers/net/wireless/ath/ath11k/hal_tx.h -@@ -29,6 +29,7 @@ struct hal_tx_info { - u32 flags1; /* %HAL_TCL_DATA_CMD_INFO2_ */ - u16 addr_search_flags; /* %HAL_TCL_DATA_CMD_INFO0_ADDR(X/Y)_ */ - u16 bss_ast_hash; -+ u16 bss_ast_idx; - u8 tid; - u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ - u8 lmac_id; ---- a/drivers/net/wireless/ath/ath11k/peer.c -+++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -685,7 +685,11 @@ int ath11k_peer_create(struct ath11k *ar - - peer->pdev_idx = ar->pdev_idx; - peer->sta = sta; -- arvif->ast_hash = peer->ast_hash; -+ -+ if (vif->type == NL80211_IFTYPE_STATION) { -+ arvif->ast_hash = peer->ast_hash; -+ arvif->ast_idx = peer->hw_peer_id; -+ } - - peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; - peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; diff --git a/feeds/wifi-ax/mac80211/patches/qca/215-mac80211-restrict-peer-s-HE-capability-to-own.patch b/feeds/wifi-ax/mac80211/patches/qca/215-mac80211-restrict-peer-s-HE-capability-to-own.patch index 4ec32f3f3..6a5f46628 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/215-mac80211-restrict-peer-s-HE-capability-to-own.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/215-mac80211-restrict-peer-s-HE-capability-to-own.patch @@ -15,56 +15,60 @@ Signed-off-by: P Praneesh --- a/net/mac80211/he.c +++ b/net/mac80211/he.c -@@ -52,6 +52,48 @@ ieee80211_update_from_he_6ghz_capa(const - sta->sta.he_6ghz_capa = *he_6ghz_capa; +@@ -103,6 +103,52 @@ static void ieee80211_he_mcs_intersectio + } } ++ +static void ieee80211_compute_he_mcs_nss(struct ieee80211_supported_band *sband, + struct ieee80211_sta_he_cap *he_cap) +{ -+ struct ieee80211_sta_he_cap own_cap = sband->he_cap; -+ int i; ++ struct ieee80211_he_mcs_nss_supp own_cap_nss = sband->he_cap.he_mcs_nss_supp; ++ struct ieee80211_he_mcs_nss_supp peer_cap_nss = he_cap->he_mcs_nss_supp; ++ u16 own_rx, own_tx, peer_rx, peer_tx; ++ u8 nss; + -+ for (i = 0; i < NL80211_HE_NSS_MAX; i++) { -+ u16 own_rx, own_tx, peer_rx, peer_tx; ++#define IEEE80211_HE_SET_MCS(x,nss) (((le16_to_cpu(x)) >> nss * 2) & IEEE80211_HE_MCS_NOT_SUPPORTED) + -+ own_rx = le16_to_cpu(own_cap.he_mcs_nss_supp.rx_mcs_80); -+ own_rx = (own_rx >> i * 2) & IEEE80211_HE_MCS_NOT_SUPPORTED; -+ own_tx = le16_to_cpu(own_cap.he_mcs_nss_supp.tx_mcs_80); -+ own_tx = (own_tx >> i * 2) & IEEE80211_HE_MCS_NOT_SUPPORTED; ++#define IEEE80211_HE_SET_TXRX_MCS(x, peer_txrx, nss) \ ++ do { \ ++ x &= ~cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << nss * 2); \ ++ x |= cpu_to_le16(peer_txrx << nss * 2); \ ++ } while(0) \ + -+ peer_rx = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80); -+ peer_rx = (peer_rx >> i * 2) & IEEE80211_HE_MCS_NOT_SUPPORTED; -+ peer_tx = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80); -+ peer_tx = (peer_tx >> i * 2) & IEEE80211_HE_MCS_NOT_SUPPORTED; ++#define IEEE80211_HE_COMP_PEER_TXRX(peer_txrx, own_txrx) \ ++ do { \ ++ if (peer_txrx != IEEE80211_HE_MCS_NOT_SUPPORTED) { \ ++ if (own_txrx == IEEE80211_HE_MCS_NOT_SUPPORTED) \ ++ peer_txrx = IEEE80211_HE_MCS_NOT_SUPPORTED; \ ++ else if (own_txrx < peer_txrx) \ ++ peer_txrx = own_txrx; \ ++ } \ ++ } while(0) \ + -+ if (peer_tx != IEEE80211_HE_MCS_NOT_SUPPORTED) { -+ if (own_rx == IEEE80211_HE_MCS_NOT_SUPPORTED) -+ peer_tx = IEEE80211_HE_MCS_NOT_SUPPORTED; -+ else if (own_rx < peer_tx) -+ peer_tx = own_rx; -+ } ++#define IEEE80211_HE_CALC_MCS(x, nss) \ ++ do { \ ++ own_rx = IEEE80211_HE_SET_MCS(own_cap_nss.rx_mcs_##x, nss); \ ++ own_tx = IEEE80211_HE_SET_MCS(own_cap_nss.tx_mcs_##x, nss); \ ++ peer_rx = IEEE80211_HE_SET_MCS(peer_cap_nss.rx_mcs_##x, nss); \ ++ peer_tx = IEEE80211_HE_SET_MCS(peer_cap_nss.tx_mcs_##x, nss); \ ++ IEEE80211_HE_COMP_PEER_TXRX(peer_tx, own_rx); \ ++ IEEE80211_HE_COMP_PEER_TXRX(peer_rx, own_tx); \ ++ IEEE80211_HE_SET_TXRX_MCS(peer_cap_nss.rx_mcs_##x, peer_rx, nss); \ ++ IEEE80211_HE_SET_TXRX_MCS(peer_cap_nss.tx_mcs_##x, peer_tx, nss); \ ++ } while(0) \ + -+ if (peer_rx != IEEE80211_HE_MCS_NOT_SUPPORTED) { -+ if (own_tx == IEEE80211_HE_MCS_NOT_SUPPORTED) -+ peer_rx = IEEE80211_HE_MCS_NOT_SUPPORTED; -+ else if (own_tx < peer_rx) -+ peer_rx = own_tx; -+ } -+ -+ he_cap->he_mcs_nss_supp.rx_mcs_80 &= -+ ~cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << i * 2); -+ he_cap->he_mcs_nss_supp.rx_mcs_80 |= cpu_to_le16(peer_rx << i * 2); -+ he_cap->he_mcs_nss_supp.tx_mcs_80 &= -+ ~cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << i * 2); -+ he_cap->he_mcs_nss_supp.tx_mcs_80 |= cpu_to_le16(peer_tx << i * 2); ++ for (nss = 0; nss < NL80211_HE_NSS_MAX; nss++) { ++ IEEE80211_HE_CALC_MCS(80, nss); ++ IEEE80211_HE_CALC_MCS(80p80, nss); ++ IEEE80211_HE_CALC_MCS(160, nss); + } +} + void ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband, -@@ -87,6 +129,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct +@@ -140,6 +186,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct memcpy(&he_cap->he_mcs_nss_supp, &he_cap_ie[sizeof(he_cap->he_cap_elem)], mcs_nss_size); diff --git a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-Resolve-fw-crash-caused-by-wrong-peer_nss-con.patch b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-Resolve-fw-crash-caused-by-wrong-peer_nss-con.patch index 1148979d0..0a39cfbd6 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-Resolve-fw-crash-caused-by-wrong-peer_nss-con.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-Resolve-fw-crash-caused-by-wrong-peer_nss-con.patch @@ -23,7 +23,7 @@ Signed-off-by: P Praneesh --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1968,11 +1968,7 @@ static void ath11k_peer_assoc_h_he(struc +@@ -1944,11 +1944,7 @@ static void ath11k_peer_assoc_h_he(struc for (i = 0, max_nss = 0, he_mcs = 0; i < NL80211_HE_NSS_MAX; i++) { he_mcs = __le16_to_cpu(he_tx_mcs) >> (2 * i) & 3; @@ -36,7 +36,7 @@ Signed-off-by: P Praneesh he_mcs_mask[i]) max_nss = i + 1; } -@@ -5092,6 +5088,7 @@ static int ath11k_mac_copy_he_cap(struct +@@ -5104,6 +5100,7 @@ static int ath11k_mac_copy_he_cap(struct for (i = 0; i < NUM_NL80211_IFTYPES; i++) { struct ieee80211_sta_he_cap *he_cap = &data[idx].he_cap; struct ath11k_band_cap *band_cap = &cap->band[band]; @@ -44,7 +44,7 @@ Signed-off-by: P Praneesh struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem; -@@ -5150,6 +5147,7 @@ static int ath11k_mac_copy_he_cap(struct +@@ -5155,6 +5152,7 @@ static int ath11k_mac_copy_he_cap(struct ath11k_mac_set_hemcsmap(ar, cap, he_cap); diff --git a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-dont-enable-bss-color-collision-detection-on-non-transmitting-BSS.patch b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-dont-enable-bss-color-collision-detection-on-non-transmitting-BSS.patch index c41d6bdba..049558ad1 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-dont-enable-bss-color-collision-detection-on-non-transmitting-BSS.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-dont-enable-bss-color-collision-detection-on-non-transmitting-BSS.patch @@ -15,7 +15,7 @@ Reported-by: kernel test robot --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3142,7 +3142,8 @@ static void ath11k_mac_op_bss_info_chang +@@ -3137,7 +3137,8 @@ static void ath11k_mac_op_bss_info_chang ret = ath11k_wmi_send_obss_color_collision_cfg_cmd( ar, arvif->vdev_id, info->he_bss_color.color, ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS, diff --git a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-send-multicast-in-4addr.patch b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-send-multicast-in-4addr.patch index f2e9fbb2d..73a68d8e7 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-send-multicast-in-4addr.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/216-ath11k-send-multicast-in-4addr.patch @@ -9,7 +9,7 @@ Signed-off-by: Karthikeyan Periyasamy --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -412,6 +412,7 @@ struct ath11k_sta { +@@ -421,6 +421,7 @@ struct ath11k_sta { #ifdef CPTCFG_ATH11K_NSS_SUPPORT struct ath11k_nss_sta_stats *nss_stats; #endif @@ -19,7 +19,7 @@ Signed-off-by: Karthikeyan Periyasamy #define ATH11K_MIN_5G_FREQ 4150 --- a/drivers/net/wireless/ath/ath11k/dp.c +++ b/drivers/net/wireless/ath/ath11k/dp.c -@@ -974,6 +974,15 @@ void ath11k_dp_vdev_tx_attach(struct ath +@@ -997,6 +997,15 @@ void ath11k_dp_vdev_tx_attach(struct ath ath11k_dp_update_vdev_search(arvif); } @@ -45,7 +45,7 @@ Signed-off-by: Karthikeyan Periyasamy struct dp_rx_tid { u8 tid; -@@ -1783,6 +1784,7 @@ int ath11k_dp_service_srng(struct ath11k +@@ -1802,6 +1803,7 @@ int ath11k_dp_service_srng(struct ath11k int budget); int ath11k_dp_htt_connect(struct ath11k_dp *dp); void ath11k_dp_vdev_tx_attach(struct ath11k *ar, struct ath11k_vif *arvif); @@ -55,7 +55,7 @@ Signed-off-by: Karthikeyan Periyasamy int ath11k_dp_pdev_alloc(struct ath11k_base *ab); --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c -@@ -104,7 +104,7 @@ static int ath11k_dp_prepare_htt_metadat +@@ -106,7 +106,7 @@ static int ath11k_dp_prepare_htt_metadat } int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif, @@ -64,7 +64,7 @@ Signed-off-by: Karthikeyan Periyasamy { struct ath11k_base *ab = ar->ab; struct ath11k_dp *dp = &ab->dp; -@@ -172,7 +172,15 @@ tcl_ring_sel: +@@ -174,7 +174,15 @@ tcl_ring_sel: FIELD_PREP(DP_TX_DESC_ID_MSDU_ID, ret) | FIELD_PREP(DP_TX_DESC_ID_POOL_ID, pool_id); ti.encap_type = ath11k_dp_tx_get_encap_type(arvif, skb); @@ -80,10 +80,10 @@ Signed-off-by: Karthikeyan Periyasamy + } if (ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW) { - if (info->control.hw_key) { + if (skb_cb->flags & ATH11K_SKB_CIPHER_SET) { --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -5488,7 +5488,8 @@ static void ath11k_mac_op_tx(struct ieee +@@ -5502,7 +5502,8 @@ static void ath11k_mac_op_tx(struct ieee if (ar->ab->nss.enabled) ret = ath11k_nss_tx(arvif,skb); else @@ -95,7 +95,7 @@ Signed-off-by: Karthikeyan Periyasamy ieee80211_free_txskb(ar->hw, skb); --- a/drivers/net/wireless/ath/ath11k/peer.c +++ b/drivers/net/wireless/ath/ath11k/peer.c -@@ -626,6 +626,7 @@ int ath11k_peer_create(struct ath11k *ar +@@ -646,6 +646,7 @@ int ath11k_peer_create(struct ath11k *ar { struct ath11k_peer *peer; struct ieee80211_vif *vif = arvif->vif; @@ -103,7 +103,7 @@ Signed-off-by: Karthikeyan Periyasamy int ret; lockdep_assert_held(&ar->conf_mutex); -@@ -701,6 +702,10 @@ int ath11k_peer_create(struct ath11k *ar +@@ -721,6 +722,10 @@ int ath11k_peer_create(struct ath11k *ar else ar->bss_peer = NULL; #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/217-mac80211-notify-non-transmitting-BSS-of-color-changes.patch b/feeds/wifi-ax/mac80211/patches/qca/217-mac80211-notify-non-transmitting-BSS-of-color-changes.patch index 19ab22729..a85932e84 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/217-mac80211-notify-non-transmitting-BSS-of-color-changes.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/217-mac80211-notify-non-transmitting-BSS-of-color-changes.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -4284,6 +4284,32 @@ static int ieee80211_set_color_change_be +@@ -4279,6 +4279,32 @@ static int ieee80211_set_color_change_be return 0; } @@ -47,7 +47,7 @@ Signed-off-by: John Crispin static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) { struct ieee80211_local *local = sdata->local; -@@ -4301,12 +4327,7 @@ static int ieee80211_color_change_finali +@@ -4296,12 +4322,7 @@ static int ieee80211_color_change_finali return err; } @@ -61,7 +61,7 @@ Signed-off-by: John Crispin cfg80211_color_change_notify(sdata->dev); return 0; -@@ -4385,14 +4406,11 @@ __ieee80211_color_change(struct wiphy *w +@@ -4380,14 +4401,11 @@ __ieee80211_color_change(struct wiphy *w cfg80211_color_change_started_notify(sdata->dev, params->count); diff --git a/feeds/wifi-ax/mac80211/patches/qca/218-ath11k-add-support-to-enable-disable-color-collision.patch b/feeds/wifi-ax/mac80211/patches/qca/218-ath11k-add-support-to-enable-disable-color-collision.patch index 95a785bb5..df9d10081 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/218-ath11k-add-support-to-enable-disable-color-collision.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/218-ath11k-add-support-to-enable-disable-color-collision.patch @@ -16,9 +16,9 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -51,6 +51,10 @@ module_param_named(frame_mode, ath11k_fr - MODULE_PARM_DESC(frame_mode, - "Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)"); +@@ -48,6 +48,10 @@ extern unsigned int ath11k_frame_mode; + .max_power = 30, \ + } +unsigned int color_collision_enable = 0; +module_param_named(color_collision_detect, color_collision_enable, uint, 0644); @@ -27,7 +27,7 @@ Signed-off-by: Lavanya Suresh static const struct ieee80211_channel ath11k_2ghz_channels[] = { CHAN2G(1, 2412, 0), CHAN2G(2, 2417, 0), -@@ -3143,7 +3147,8 @@ static void ath11k_mac_op_bss_info_chang +@@ -3138,7 +3142,8 @@ static void ath11k_mac_op_bss_info_chang ar, arvif->vdev_id, info->he_bss_color.color, ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS, !arvif->vif->multiple_bssid.non_transmitted ? diff --git a/feeds/wifi-ax/mac80211/patches/qca/219-ath11k-add-bcca-with-countdown-zero-in-color-change-beacon.patch b/feeds/wifi-ax/mac80211/patches/qca/219-ath11k-add-bcca-with-countdown-zero-in-color-change-beacon.patch index 680638dc1..9bcf42592 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/219-ath11k-add-bcca-with-countdown-zero-in-color-change-beacon.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/219-ath11k-add-bcca-with-countdown-zero-in-color-change-beacon.patch @@ -15,7 +15,7 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -255,6 +255,8 @@ struct ath11k_vif { +@@ -264,6 +264,8 @@ struct ath11k_vif { int txpower; bool rsnie_present; bool wpaie_present; @@ -26,7 +26,7 @@ Signed-off-by: Lavanya Suresh struct dentry *debugfs_twt; --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -1147,7 +1147,7 @@ void ath11k_mac_bcn_tx_event(struct ath1 +@@ -1124,7 +1124,7 @@ void ath11k_mac_bcn_tx_event(struct ath1 !list_empty(&vif->multiple_bssid.list)) multiple_bssid = 1; @@ -35,7 +35,7 @@ Signed-off-by: Lavanya Suresh return; if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) { -@@ -1160,10 +1160,14 @@ void ath11k_mac_bcn_tx_event(struct ath1 +@@ -1137,10 +1137,14 @@ void ath11k_mac_bcn_tx_event(struct ath1 } if (vif->color_change_active && ieee80211_beacon_cntdwn_is_complete(vif)) { @@ -50,7 +50,7 @@ Signed-off-by: Lavanya Suresh if (vif->color_change_active || vif->csa_active) ieee80211_beacon_update_cntdwn(vif); -@@ -2951,10 +2955,17 @@ static void ath11k_mac_op_bss_info_chang +@@ -2937,10 +2941,17 @@ static void ath11k_mac_op_bss_info_chang "Set staggered beacon mode for VDEV: %d\n", arvif->vdev_id); @@ -69,12 +69,12 @@ Signed-off-by: Lavanya Suresh + arvif->do_not_send_tmpl = true; + else + arvif->do_not_send_tmpl = false; + } - if (vif->bss_conf.he_support) { - ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + if (changed & (BSS_CHANGED_BEACON_INFO | BSS_CHANGED_BEACON)) { --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1892,6 +1892,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a +@@ -1899,6 +1899,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a struct ieee80211_mutable_offsets *offs, struct sk_buff *bcn) { @@ -83,7 +83,7 @@ Signed-off-by: Lavanya Suresh struct ath11k_pdev_wmi *wmi = ar->wmi; struct wmi_bcn_tmpl_cmd *cmd; struct wmi_bcn_prb_info *bcn_prb_info; -@@ -1912,8 +1914,12 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a +@@ -1919,8 +1921,12 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); cmd->vdev_id = vdev_id; cmd->tim_ie_offset = offs->tim_offset; diff --git a/feeds/wifi-ax/mac80211/patches/qca/220-mac80211-disable-color-collision-detection-in-case-of-no-free-colors.patch b/feeds/wifi-ax/mac80211/patches/qca/220-mac80211-disable-color-collision-detection-in-case-of-no-free-colors.patch index 8c72c5080..964049107 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/220-mac80211-disable-color-collision-detection-in-case-of-no-free-colors.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/220-mac80211-disable-color-collision-detection-in-case-of-no-free-colors.patch @@ -20,7 +20,7 @@ Signed-off-by: Lavanya Suresh --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -1771,6 +1771,7 @@ struct ieee80211_he_mcs_nss_supp { +@@ -1828,6 +1828,7 @@ struct ieee80211_he_mcs_nss_supp { __le16 tx_mcs_80p80; } __packed; @@ -30,7 +30,7 @@ Signed-off-by: Lavanya Suresh * --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -1080,6 +1080,7 @@ struct cfg80211_beacon_data { +@@ -1102,6 +1102,7 @@ struct cfg80211_beacon_data { const u8 *lci; const u8 *civicloc; s8 ftm_responder; @@ -40,16 +40,16 @@ Signed-off-by: Lavanya Suresh size_t beacon_ies_len; --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1020,6 +1020,8 @@ static int ieee80211_assign_beacon(struc +@@ -1027,6 +1027,8 @@ static int ieee80211_assign_beacon(struc struct beacon_data *new, *old; int new_head_len, new_tail_len, new_multiple_bssid_len; u8 *new_multiple_bssid_offset; + const u8 *cap; -+ struct ieee80211_he_operation *he_oper; ++ struct ieee80211_he_operation *he_oper = NULL; int size, err; u32 changed = BSS_CHANGED_BEACON; -@@ -1130,6 +1132,25 @@ static int ieee80211_assign_beacon(struc +@@ -1137,6 +1139,26 @@ static int ieee80211_assign_beacon(struc changed |= BSS_CHANGED_FTM_RESPONDER; } @@ -58,7 +58,8 @@ Signed-off-by: Lavanya Suresh + if (cap && cap[1] >= sizeof(*he_oper) + 1) + he_oper = (void *)(cap + 3); + -+ if (he_oper->he_oper_params & HE_OPERATION_BSS_COLOR_DISABLED) { ++ if (he_oper && ++ he_oper->he_oper_params & HE_OPERATION_BSS_COLOR_DISABLED) { + if (sdata->vif.bss_conf.he_bss_color.enabled) { + sdata->vif.bss_conf.he_bss_color.enabled = 0; + changed |= BSS_CHANGED_HE_BSS_COLOR; @@ -75,7 +76,7 @@ Signed-off-by: Lavanya Suresh rcu_assign_pointer(sdata->u.ap.beacon, new); if (old) -@@ -4287,9 +4308,15 @@ static int ieee80211_set_color_change_be +@@ -4282,9 +4304,15 @@ static int ieee80211_set_color_change_be static void ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata, u8 color, int enable, u32 changed) { @@ -96,7 +97,7 @@ Signed-off-by: Lavanya Suresh --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -4841,6 +4841,11 @@ static int nl80211_parse_beacon(struct c +@@ -5099,6 +5099,11 @@ static int nl80211_parse_beacon(struct c } } diff --git a/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-debugfs-interface-to-read-write-from-memo.patch b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-debugfs-interface-to-read-write-from-memo.patch new file mode 100644 index 000000000..2e81c1841 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-debugfs-interface-to-read-write-from-memo.patch @@ -0,0 +1,506 @@ +From 29221d565be14bc6549b0d9fa3127dd397b9713e Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Fri, 23 Oct 2020 12:12:14 +0530 +Subject: [PATCH] ath11k: add debugfs interface to read/write target memory for + qcn9000 + +Debugfs file 'athdiag' is added in qcn9000, for reading/writing to +the target memory address through QMI interface, using athdiag tool. + + +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/core.h | 2 + + drivers/net/wireless/ath/ath11k/debugfs.c | 164 +++++++++++++++++++ + drivers/net/wireless/ath/ath11k/qmi.c | 275 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/qmi.h | 32 ++++ + 4 files changed, 473 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -488,6 +488,7 @@ struct ath11k_debug { + #endif + u32 rx_filter; + bool enable_m3_dump; ++ u32 mem_addr; + }; + + struct ath11k_per_peer_tx_stats { +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -13,6 +13,7 @@ + #include "debugfs_htt_stats.h" + #include "peer.h" + #include "pktlog.h" ++#include "qmi.h" + + struct dentry *debugfs_ath11k; + +@@ -1924,6 +1925,103 @@ static const struct file_operations fops + .open = simple_open + }; + ++static ssize_t ath11k_athdiag_read(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ u8 *buf; ++ int ret; ++ ++ if (*ppos <= 0) ++ return -EINVAL; ++ ++ if (!count) ++ return 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ buf = vmalloc(count); ++ if (!buf) { ++ ret = -ENOMEM; ++ goto exit; ++ } ++ ++ ret = ath11k_qmi_mem_read(ar->ab, *ppos, buf, count); ++ if (ret < 0) { ++ ath11k_warn(ar->ab, "failed to read address 0x%08x via diagnose window from debugfs: %d\n", ++ (u32)(*ppos), ret); ++ goto exit; ++ } ++ ++ ret = copy_to_user(user_buf, buf, count); ++ if (ret) { ++ ret = -EFAULT; ++ goto exit; ++ } ++ ++ count -= ret; ++ *ppos += count; ++ ret = count; ++exit: ++ vfree(buf); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return ret; ++} ++ ++static ssize_t ath11k_athdiag_write(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ u8 *buf; ++ int ret; ++ ++ if (*ppos <= 0) ++ return -EINVAL; ++ ++ if (!count) ++ return 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ buf = vmalloc(count); ++ if (!buf) { ++ ret = -ENOMEM; ++ goto exit; ++ } ++ ++ ret = copy_from_user(buf, user_buf, count); ++ if (ret) { ++ ret = -EFAULT; ++ goto exit; ++ } ++ ++ ret = ath11k_qmi_mem_write(ar->ab, *ppos, buf, count); ++ if (ret < 0) { ++ ath11k_warn(ar->ab, "failed to write address 0x%08x via diagnose window from debugfs: %d\n", ++ (u32)(*ppos), ret); ++ goto exit; ++ } ++ ++ *ppos += count; ++ ret = count; ++ ++exit: ++ vfree(buf); ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_athdiag = { ++ .read = ath11k_athdiag_read, ++ .write = ath11k_athdiag_write, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + static int ath11k_get_tpc_ctl_mode(struct wmi_tpc_stats_event *tpc_stats, + u32 pream_idx, int *mode) + { +@@ -2570,6 +2668,10 @@ int ath11k_debugfs_register(struct ath11 + debugfs_create_file("tpc_stats_type", 0600, ar->debug.debugfs_pdev, + ar, &fops_tpc_stats_type); + ++ debugfs_create_file("athdiag", S_IRUSR | S_IWUSR, ++ ar->debug.debugfs_pdev, ar, ++ &fops_athdiag); ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2100,6 +2100,157 @@ struct qmi_elem_info wlfw_ini_resp_msg_v + }, + }; + ++struct qmi_elem_info qmi_wlanfw_mem_read_req_msg_v01_ei[] = { ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x01, ++ .offset = offsetof(struct qmi_wlanfw_mem_read_req_msg_v01, ++ offset), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x02, ++ .offset = offsetof(struct qmi_wlanfw_mem_read_req_msg_v01, ++ mem_type), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x03, ++ .offset = offsetof(struct qmi_wlanfw_mem_read_req_msg_v01, ++ data_len), ++ }, ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ ++struct qmi_elem_info qmi_wlanfw_mem_read_resp_msg_v01_ei[] = { ++ { ++ .data_type = QMI_STRUCT, ++ .elem_len = 1, ++ .elem_size = sizeof(struct qmi_response_type_v01), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x02, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_read_resp_msg_v01, ++ resp), ++ .ei_array = qmi_response_type_v01_ei, ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x10, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_read_resp_msg_v01, ++ data_valid), ++ }, ++ { ++ .data_type = QMI_DATA_LEN, ++ .elem_len = 1, ++ .elem_size = sizeof(u16), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x10, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_read_resp_msg_v01, ++ data_len), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = QMI_WLANFW_MAX_DATA_SIZE_V01, ++ .elem_size = sizeof(u8), ++ .array_type = VAR_LEN_ARRAY, ++ .tlv_type = 0x10, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_read_resp_msg_v01, ++ data), ++ }, ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ ++struct qmi_elem_info qmi_wlanfw_mem_write_req_msg_v01_ei[] = { ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x01, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_write_req_msg_v01, ++ offset), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x02, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_write_req_msg_v01, ++ mem_type), ++ }, ++ { ++ .data_type = QMI_DATA_LEN, ++ .elem_len = 1, ++ .elem_size = sizeof(u16), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x03, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_write_req_msg_v01, ++ data_len), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_1_BYTE, ++ .elem_len = QMI_WLANFW_MAX_DATA_SIZE_V01, ++ .elem_size = sizeof(u8), ++ .array_type = VAR_LEN_ARRAY, ++ .tlv_type = 0x03, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_write_req_msg_v01, ++ data), ++ }, ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ ++struct qmi_elem_info qmi_wlanfw_mem_write_resp_msg_v01_ei[] = { ++ { ++ .data_type = QMI_STRUCT, ++ .elem_len = 1, ++ .elem_size = sizeof(struct qmi_response_type_v01), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x02, ++ .offset = offsetof(struct ++ qmi_wlanfw_mem_write_resp_msg_v01, ++ resp), ++ .ei_array = qmi_response_type_v01_ei, ++ }, ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ + int wlfw_send_qdss_trace_config_download_req(struct ath11k_base *ab, + const u8 *buffer, unsigned int file_len) + { +@@ -3839,6 +3990,130 @@ free_event_data: + kfree(event_data); + } + ++int ath11k_qmi_mem_read(struct ath11k_base *ab, u32 mem_addr, void *mem_value,size_t count) ++{ ++ struct qmi_wlanfw_mem_read_req_msg_v01 *req; ++ struct qmi_wlanfw_mem_read_resp_msg_v01 *resp; ++ struct qmi_txn txn = {}; ++ int ret = 0; ++ ++ req = kzalloc(sizeof(*req), GFP_KERNEL); ++ if (!req) ++ return -ENOMEM; ++ ++ resp = kzalloc(sizeof(*resp), GFP_KERNEL); ++ if (!resp) { ++ kfree(req); ++ return -ENOMEM; ++ } ++ ++ req->offset = mem_addr; ++ ++ /* Firmware uses mem type to map to various memory regions. ++ * If this is set to 0, firmware uses automatic mapping of regions. ++ * i.e, if mem address is given and mem_type is 0, firmware will ++ * find under which memory region that address belongs ++ */ ++ req->mem_type = QMI_MEM_REGION_TYPE; ++ req->data_len = count; ++ ++ ret = qmi_txn_init(&ab->qmi.handle, &txn, ++ qmi_wlanfw_mem_read_resp_msg_v01_ei, resp); ++ if (ret < 0) ++ goto out; ++ ++ ret = ++ qmi_send_request(&ab->qmi.handle, NULL, &txn, ++ QMI_WLANFW_MEM_READ_REQ_V01, ++ QMI_WLANFW_MEM_READ_REQ_MSG_V01_MAX_MSG_LEN, ++ qmi_wlanfw_mem_read_req_msg_v01_ei, req); ++ if (ret < 0) { ++ qmi_txn_cancel(&txn); ++ ath11k_warn(ab, "Failed to send mem read request, err %d\n", ++ ret); ++ goto out; ++ } ++ ++ ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); ++ if (ret < 0) ++ goto out; ++ ++ if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { ++ ath11k_warn(ab, "qmi mem read req failed, result: %d, err: %d\n", ++ resp->resp.result, resp->resp.error); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (!resp->data_valid || resp->data_len != req->data_len) { ++ ath11k_warn(ab, "qmi mem read is invalid\n"); ++ ret = -EINVAL; ++ goto out; ++ } ++ memcpy(mem_value, resp->data, resp->data_len); ++ ++out: ++ kfree(req); ++ kfree(resp); ++ return ret; ++} ++ ++int ath11k_qmi_mem_write(struct ath11k_base *ab, u32 mem_addr, void* mem_value, size_t count) ++{ ++ struct qmi_wlanfw_mem_write_req_msg_v01 *req; ++ struct qmi_wlanfw_mem_write_resp_msg_v01 *resp; ++ struct qmi_txn txn = {}; ++ int ret = 0; ++ ++ req = kzalloc(sizeof(*req), GFP_KERNEL); ++ if (!req) ++ return -ENOMEM; ++ ++ resp = kzalloc(sizeof(*resp), GFP_KERNEL); ++ if (!resp) { ++ kfree(req); ++ return -ENOMEM; ++ } ++ ++ req->offset = mem_addr; ++ req->mem_type = QMI_MEM_REGION_TYPE; ++ req->data_len = count; ++ memcpy(req->data, mem_value, req->data_len); ++ ++ ret = qmi_txn_init(&ab->qmi.handle, &txn, ++ qmi_wlanfw_mem_write_resp_msg_v01_ei, resp); ++ if (ret < 0) ++ goto out; ++ ++ ret = ++ qmi_send_request(&ab->qmi.handle, NULL, &txn, ++ QMI_WLANFW_MEM_WRITE_REQ_V01, ++ QMI_WLANFW_MEM_WRITE_REQ_MSG_V01_MAX_MSG_LEN, ++ qmi_wlanfw_mem_write_req_msg_v01_ei, req); ++ if (ret < 0) { ++ qmi_txn_cancel(&txn); ++ ath11k_warn(ab, "Failed to send mem write request, err %d\n", ++ ret); ++ goto out; ++ } ++ ++ ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); ++ if (ret < 0) ++ goto out; ++ ++ if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { ++ ath11k_warn(ab, "qmi mem write req failed, result: %d, err: %d\n", ++ resp->resp.result, resp->resp.error); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++out: ++ kfree(req); ++ kfree(resp); ++ return ret; ++} ++ + static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { + { + .type = QMI_INDICATION, +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -260,6 +260,7 @@ struct qmi_wlanfw_qdss_trace_mode_resp_m + #define M3_DUMP_REGION_TYPE 0x3 + #define CALDB_MEM_REGION_TYPE 0x4 + #define QDSS_ETR_MEM_REGION_TYPE 0x6 ++#define QMI_MEM_REGION_TYPE 0 + + struct qmi_wlanfw_host_cap_req_msg_v01 { + u8 num_clients_valid; +@@ -355,6 +356,10 @@ struct qmi_wlanfw_ind_register_resp_msg_ + #define QMI_WLFW_QDSS_TRACE_MEM_INFO_REQ_V01 0x0040 + #define QMI_WLANFW_MAX_NUM_MEM_CFG_V01 2 + #define QMI_WLANFW_MAX_STR_LEN_V01 16 ++#define QMI_WLANFW_MEM_WRITE_REQ_V01 0x0031 ++#define QMI_WLANFW_MEM_WRITE_REQ_MSG_V01_MAX_MSG_LEN 6163 ++#define QMI_WLANFW_MEM_READ_REQ_V01 0x0030 ++#define QMI_WLANFW_MEM_READ_REQ_MSG_V01_MAX_MSG_LEN 21 + + struct qmi_wlanfw_mem_cfg_s_v01 { + u64 offset; +@@ -631,6 +636,30 @@ struct qmi_wlanfw_wlan_cfg_resp_msg_v01 + struct qmi_response_type_v01 resp; + }; + ++struct qmi_wlanfw_mem_read_req_msg_v01 { ++ u32 offset; ++ u32 mem_type; ++ u32 data_len; ++}; ++ ++struct qmi_wlanfw_mem_read_resp_msg_v01 { ++ struct qmi_response_type_v01 resp; ++ u8 data_valid; ++ u32 data_len; ++ u8 data[QMI_WLANFW_MAX_DATA_SIZE_V01]; ++}; ++ ++struct qmi_wlanfw_mem_write_req_msg_v01 { ++ u32 offset; ++ u32 mem_type; ++ u32 data_len; ++ u8 data[QMI_WLANFW_MAX_DATA_SIZE_V01]; ++}; ++ ++struct qmi_wlanfw_mem_write_resp_msg_v01 { ++ struct qmi_response_type_v01 resp; ++}; ++ + int ath11k_qmi_firmware_start(struct ath11k_base *ab, + u32 mode); + void ath11k_qmi_firmware_stop(struct ath11k_base *ab); +@@ -645,6 +674,8 @@ int ath11k_send_qdss_trace_mode_req(stru + enum wlfw_qdss_trace_mode_enum_v01 mode); + int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab); + int ath11k_enable_fwlog(struct ath11k_base *ab); ++int ath11k_qmi_mem_read(struct ath11k_base *ab, u32 mem_addr, void *mem_value, size_t count); ++int ath11k_qmi_mem_write(struct ath11k_base *ab, u32 mem_addr, void* mem_value, size_t count); + + + #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-more-htt-stats-support.patch b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-more-htt-stats-support.patch index d5c3d61d4..b2d31a068 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-more-htt-stats-support.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-add-more-htt-stats-support.patch @@ -28,17 +28,15 @@ Usage: echo 37 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type Signed-off-by: Venkateswara Rao Naralasetty --- - drivers/net/wireless/ath/ath11k/debug.h | 3 + - drivers/net/wireless/ath/ath11k/debug_htt_stats.c | 382 +++++++++++++++++++++- - drivers/net/wireless/ath/ath11k/debug_htt_stats.h | 89 +++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 3 + + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c | 382 +++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h | 89 +++++ drivers/net/wireless/ath/ath11k/debugfs_sta.c | 8 +- 4 files changed, 478 insertions(+), 4 deletions(-) -diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h -index c3ec40c..afac68f 100644 ---- a/drivers/net/wireless/ath/ath11k/debug.h -+++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -64,6 +64,9 @@ enum ath11k_dbg_htt_ext_stats_type { +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -44,6 +44,9 @@ enum ath11k_dbg_htt_ext_stats_type { ATH11K_DBG_HTT_EXT_STATS_FSE_RX = 28, ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS = 29, ATH11K_DBG_HTT_EXT_STATS_PDEV_RX_RATE_EXT = 30, @@ -48,11 +46,9 @@ index c3ec40c..afac68f 100644 /* keep this last */ ATH11K_DBG_HTT_NUM_EXT_STATS, -diff --git a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -index 0f57efb..8bbf69d 100644 ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c -@@ -4229,6 +4229,348 @@ static inline void htt_print_rx_pdev_rate_ext_stats_tlv(const void *tag_buf, +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c +@@ -4229,6 +4229,348 @@ static inline void htt_print_rx_pdev_rat stats_req->buf_len = len; } @@ -398,10 +394,10 @@ index 0f57efb..8bbf69d 100644 + stats_req->buf_len = len; +} + - static inline void htt_htt_stats_debug_dump(const u32 *tag_buf, - struct debug_htt_stats_req *stats_req) - { -@@ -4651,6 +4993,30 @@ static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab, + static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab, + u16 tag, u16 len, const void *tag_buf, + void *user_data) +@@ -4607,6 +4949,30 @@ static int ath11k_dbg_htt_ext_stats_pars case HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG: htt_print_rx_pdev_rate_ext_stats_tlv(tag_buf, stats_req); break; @@ -432,7 +428,7 @@ index 0f57efb..8bbf69d 100644 default: break; } -@@ -4738,8 +5104,7 @@ static ssize_t ath11k_write_htt_stats_type(struct file *file, +@@ -4694,8 +5060,7 @@ static ssize_t ath11k_write_htt_stats_ty if (type >= ATH11K_DBG_HTT_NUM_EXT_STATS) return -E2BIG; @@ -442,7 +438,7 @@ index 0f57efb..8bbf69d 100644 return -EPERM; ar->debug.htt_stats.type = type; -@@ -4800,6 +5165,15 @@ static int ath11k_prep_htt_stats_cfg_params(struct ath11k *ar, u8 type, +@@ -4756,6 +5121,15 @@ static int ath11k_prep_htt_stats_cfg_par case ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO: cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS; break; @@ -458,7 +454,7 @@ index 0f57efb..8bbf69d 100644 default: break; } -@@ -4857,7 +5231,9 @@ static int ath11k_open_htt_stats(struct inode *inode, struct file *file) +@@ -4813,7 +5187,9 @@ static int ath11k_open_htt_stats(struct u8 type = ar->debug.htt_stats.type; int ret; @@ -469,10 +465,8 @@ index 0f57efb..8bbf69d 100644 return -EPERM; mutex_lock(&ar->conf_mutex); -diff --git a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -index ed80ccb..34cb7bb 100644 ---- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.h -+++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.h +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h @@ -115,6 +115,13 @@ enum htt_tlv_tag_t { HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, @@ -487,7 +481,7 @@ index ed80ccb..34cb7bb 100644 HTT_STATS_MAX_TAG, }; -@@ -1882,4 +1889,86 @@ struct htt_rx_pdev_rate_ext_stats_tlv { +@@ -1905,4 +1912,86 @@ struct htt_rx_pdev_rate_ext_stats_tlv { u32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT]; }; @@ -574,11 +568,9 @@ index ed80ccb..34cb7bb 100644 + u32 peer_rx_mgmt_subtype[ATH11K_STATS_MGMT_FRM_TYPE_MAX]; +}; #endif -diff --git a/drivers/net/wireless/ath/ath11k/debugfs_sta.c b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -index 65db385..97e6619 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c -@@ -653,15 +653,21 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file) +@@ -654,15 +654,21 @@ ath11k_dbg_sta_open_htt_peer_stats(struc struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; struct ath11k *ar = arsta->arvif->ar; struct debug_htt_stats_req *stats_req; @@ -599,8 +591,5 @@ index 65db385..97e6619 100644 - stats_req->type = ATH11K_DBG_HTT_EXT_STATS_PEER_INFO; + stats_req->type = type; memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN); - ret = ath11k_dbg_htt_stats_req(ar); + ret = ath11k_debugfs_htt_stats_req(ar); mutex_unlock(&ar->conf_mutex); --- -2.7.4 - diff --git a/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-initialize-vdev_up-params-to-avoid-invalid-values.patch b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-initialize-vdev_up-params-to-avoid-invalid-values.patch index 1c199a24e..3a9a7c39a 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-initialize-vdev_up-params-to-avoid-invalid-values.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/221-ath11k-initialize-vdev_up-params-to-avoid-invalid-values.patch @@ -20,7 +20,7 @@ Signed-off-by: Lavanya Suresh --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -6542,7 +6542,7 @@ ath11k_mac_update_vif_chan(struct ath11k +@@ -6603,7 +6603,7 @@ ath11k_mac_update_vif_chan(struct ath11k /* TODO: Update ar->rx_channel */ for (i = 0; i < n_vifs; i++) { @@ -29,3 +29,12 @@ Signed-off-by: Lavanya Suresh arvif = (void *)vifs[i].vif->drv_priv; +@@ -6724,7 +6724,7 @@ static int ath11k_start_vdev_delay(struc + } + + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { +- struct vdev_up_params params; ++ struct vdev_up_params params = {0}; + + params.vdev_id = arvif->vdev_id, + params.bssid = arvif->bssid, diff --git a/feeds/wifi-ax/mac80211/patches/qca/222-ath11k-add-module-param-for-ftm.patch b/feeds/wifi-ax/mac80211/patches/qca/222-ath11k-add-module-param-for-ftm.patch index de1118d4e..d5b75362c 100644 --- a/feeds/wifi-ax/mac80211/patches/qca/222-ath11k-add-module-param-for-ftm.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/222-ath11k-add-module-param-for-ftm.patch @@ -28,22 +28,18 @@ Signed-off-by: Sowmiya Sree Elavalagan --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -19,11 +19,14 @@ unsigned int ath11k_debug_mask; - unsigned int cryptmode; - EXPORT_SYMBOL(ath11k_debug_mask); - unsigned int nss_offload; -+unsigned int ath11k_ftm_mode; +@@ -42,6 +42,10 @@ EXPORT_SYMBOL(ath11k_host_ddr_addr); + module_param_named(host_ddr_addr, ath11k_host_ddr_addr, uint, 0644); + MODULE_PARM_DESC(host_ddr_addr, "host ddr addr for FW"); - module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); - module_param_named(cryptmode, cryptmode, uint, 0644); - MODULE_PARM_DESC(debug_mask, "Debugging mask"); - MODULE_PARM_DESC(cryptmode, "crypto mode: 0-hardware, 1-software"); ++unsigned int ath11k_ftm_mode; +module_param_named(ftm_mode, ath11k_ftm_mode, uint, 0644); +MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode"); - #ifdef CPTCFG_ATH11K_NSS_SUPPORT - module_param_named(nss_offload, nss_offload, uint, 0644); - MODULE_PARM_DESC(nss_offload, "Enable NSS Offload support"); -@@ -518,6 +521,11 @@ static int ath11k_core_soc_create(struct ++ + struct ath11k_base *ath11k_soc; + + static const struct ath11k_hw_params ath11k_hw_params[] = { +@@ -673,6 +677,11 @@ static int ath11k_core_soc_create(struct { int ret; @@ -55,7 +51,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ret = ath11k_qmi_init_service(ab); if (ret) { ath11k_err(ab, "failed to initialize qmi :%d\n", ret); -@@ -999,9 +1007,6 @@ static void ath11k_core_restart(struct w +@@ -1184,9 +1193,6 @@ static void ath11k_core_restart(struct w break; case ATH11K_STATE_TM: ath11k_warn(ab, "fw mode reset done radio %d\n", i); @@ -67,7 +63,7 @@ Signed-off-by: Sowmiya Sree Elavalagan mutex_unlock(&ar->conf_mutex); --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -663,6 +663,7 @@ struct ath11k { +@@ -676,6 +676,7 @@ struct ath11k { bool dfs_block_radar_events; struct ath11k_thermal thermal; struct completion fw_mode_reset; @@ -75,7 +71,7 @@ Signed-off-by: Sowmiya Sree Elavalagan int ap_ps_enabled; enum ath11k_ap_ps_state ap_ps_state; -@@ -849,6 +850,7 @@ struct ath11k_base { +@@ -863,6 +864,7 @@ struct ath11k_base { /* protected by data_lock */ u32 fw_crash_counter; } stats; @@ -85,7 +81,7 @@ Signed-off-by: Sowmiya Sree Elavalagan u32 max_ast_index; --- a/drivers/net/wireless/ath/ath11k/debug.h +++ b/drivers/net/wireless/ath/ath11k/debug.h -@@ -171,6 +171,7 @@ __printf(2, 3) void ath11k_err(struct at +@@ -33,6 +33,7 @@ __printf(2, 3) void ath11k_err(struct at __printf(2, 3) void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...); extern unsigned int ath11k_debug_mask; @@ -95,8 +91,8 @@ Signed-off-by: Sowmiya Sree Elavalagan __printf(3, 4) void __ath11k_dbg(struct ath11k_base *ab, --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -5555,6 +5555,11 @@ static int ath11k_mac_op_start(struct ie - struct ath11k_pdev *pdev = ar->pdev; +@@ -5560,6 +5560,11 @@ static int ath11k_mac_op_start(struct ie + struct device *dev = ab->dev; int ret; + if (ath11k_ftm_mode) { @@ -119,7 +115,7 @@ Signed-off-by: Sowmiya Sree Elavalagan static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = { [ATH11K_TM_ATTR_CMD] = { .type = NLA_U32 }, [ATH11K_TM_ATTR_DATA] = { .type = NLA_BINARY, -@@ -63,53 +66,151 @@ void ath11k_fwlog_write(struct ath11k_ba +@@ -63,20 +66,16 @@ void ath11k_fwlog_write(struct ath11k_ba /* Returns true if callee consumes the skb and the skb should be discarded. * Returns false if skb is not used. Does not sleep. @@ -144,10 +140,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ath11k_dbg(ab, ATH11K_DBG_TESTMODE, "testmode event wmi cmd_id %d skb %pK skb->len %d\n", - cmd_id, skb, skb->len); -- - ath11k_dbg_dump(ab, ATH11K_DBG_TESTMODE, NULL, "", skb->data, skb->len); - +@@ -87,30 +86,123 @@ bool ath11k_tm_event_wmi(struct ath11k_b for (i = 0; i < ab->num_radios; i++) { pdev = &ab->pdevs[i]; ar = pdev->ar; @@ -168,7 +161,7 @@ Signed-off-by: Sowmiya Sree Elavalagan + ath11k_warn(ab, "testmode event not handled due to invalid pdev\n"); return false; } -+ + spin_lock_bh(&ar->data_lock); + /* Only testmode.c should be handling events from utf firmware, @@ -215,9 +208,7 @@ Signed-off-by: Sowmiya Sree Elavalagan + kfree_skb(nl_skb); + goto out; + } - -- datalen = skb->len - (sizeof(struct seg_hdr_info) + WMI_TLV_HDR_SIZE); -- buf_pos = skb->data + (sizeof(struct seg_hdr_info) + WMI_TLV_HDR_SIZE); ++ + cfg80211_testmode_event(nl_skb, GFP_ATOMIC); + +out: @@ -244,7 +235,9 @@ Signed-off-by: Sowmiya Sree Elavalagan + u8 total_segments, current_seq; + u32 data_pos; + u32 pdev_id; -+ + +- datalen = skb->len - (sizeof(struct seg_hdr_info) + WMI_TLV_HDR_SIZE); +- buf_pos = skb->data + (sizeof(struct seg_hdr_info) + WMI_TLV_HDR_SIZE); + ath11k_dbg(ab, ATH11K_DBG_TESTMODE, + "testmode event wmi cmd_id %d ftm event msg %pK datalen %d\n", + cmd_id, ftm_msg, length); @@ -262,15 +255,6 @@ Signed-off-by: Sowmiya Sree Elavalagan + return false; + } + -+ mutex_lock(&ar->conf_mutex); -+ -+ if (ar->state != ATH11K_STATE_TM) { -+ ath11k_warn(ab, "testmode event not handled due to state error\n"); -+ mutex_unlock(&ar->conf_mutex); -+ return false; -+ } -+ -+ mutex_unlock(&ar->conf_mutex); + spin_lock_bh(&ar->data_lock); + consumed = true; + current_seq = FIELD_GET(FTM_SEGHDR_CURRENT_SEQ, @@ -288,7 +272,7 @@ Signed-off-by: Sowmiya Sree Elavalagan data_pos = ab->ftm_event_obj.data_pos; if ((data_pos + datalen) > ATH11K_FTM_EVENT_MAX_BUF_LENGTH) { -@@ -124,16 +225,15 @@ bool ath11k_tm_event_wmi(struct ath11k_b +@@ -125,16 +217,15 @@ bool ath11k_tm_event_wmi(struct ath11k_b if (++ab->ftm_event_obj.expected_seq != total_segments) { ab->ftm_event_obj.data_pos = data_pos; @@ -310,7 +294,7 @@ Signed-off-by: Sowmiya Sree Elavalagan nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy, 2 * sizeof(u32) + data_pos, GFP_ATOMIC); -@@ -143,7 +243,8 @@ bool ath11k_tm_event_wmi(struct ath11k_b +@@ -144,7 +235,8 @@ bool ath11k_tm_event_wmi(struct ath11k_b goto out; } @@ -319,8 +303,8 @@ Signed-off-by: Sowmiya Sree Elavalagan + ATH11K_TM_CMD_WMI_FTM); if (ret) { ath11k_warn(ab, - "failed to to put testmode wmi event cmd attribute: %d\n", -@@ -175,7 +276,6 @@ bool ath11k_tm_event_wmi(struct ath11k_b + "failed to put testmode wmi event cmd attribute: %d\n", +@@ -176,7 +268,6 @@ bool ath11k_tm_event_wmi(struct ath11k_b out: spin_unlock_bh(&ar->data_lock); @@ -328,7 +312,7 @@ Signed-off-by: Sowmiya Sree Elavalagan return consumed; } -@@ -216,7 +316,6 @@ static int ath11k_tm_cmd_testmode_start( +@@ -217,7 +308,6 @@ static int ath11k_tm_cmd_testmode_start( int ret; ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, " enter testmode cmd fw start\n"); @@ -336,7 +320,7 @@ Signed-off-by: Sowmiya Sree Elavalagan mutex_lock(&ar->conf_mutex); if (ar->state == ATH11K_STATE_TM) { -@@ -230,88 +329,23 @@ static int ath11k_tm_cmd_testmode_start( +@@ -231,88 +321,23 @@ static int ath11k_tm_cmd_testmode_start( goto err; } @@ -428,7 +412,19 @@ Signed-off-by: Sowmiya Sree Elavalagan static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[], struct ieee80211_vif *vif) { -@@ -377,7 +411,6 @@ static int ath11k_tm_cmd_wmi(struct ath1 +@@ -326,11 +351,6 @@ static int ath11k_tm_cmd_wmi(struct ath1 + + mutex_lock(&ar->conf_mutex); + +- if (ar->state != ATH11K_STATE_ON) { +- ret = -ENETDOWN; +- goto out; +- } +- + if (!tb[ATH11K_TM_ATTR_DATA]) { + ret = -EINVAL; + goto out; +@@ -378,7 +398,6 @@ static int ath11k_tm_cmd_wmi(struct ath1 ret); goto out; } @@ -436,7 +432,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ret = 0; out: -@@ -389,19 +422,16 @@ static int ath11k_tm_cmd_process_ftm(str +@@ -390,19 +409,16 @@ static int ath11k_tm_cmd_process_ftm(str { struct ath11k_pdev_wmi *wmi = ar->wmi; struct sk_buff *skb; @@ -458,7 +454,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, "ar->state %d\n", ar->state); if (ar->state != ATH11K_STATE_TM) { -@@ -417,12 +447,10 @@ static int ath11k_tm_cmd_process_ftm(str +@@ -418,12 +434,10 @@ static int ath11k_tm_cmd_process_ftm(str buf = nla_data(tb[ATH11K_TM_ATTR_DATA]); buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]); cmd_id = WMI_PDEV_UTF_CMDID; @@ -471,7 +467,7 @@ Signed-off-by: Sowmiya Sree Elavalagan bufpos = buf; total_bytes = buf_len; num_segments = total_bytes / MAX_WMI_UTF_LEN; -@@ -436,27 +464,25 @@ static int ath11k_tm_cmd_process_ftm(str +@@ -437,27 +451,25 @@ static int ath11k_tm_cmd_process_ftm(str else chunk_len = buf_len; @@ -512,7 +508,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ret = ath11k_wmi_cmd_send(wmi, skb, cmd_id); if (ret) { ath11k_warn(ar->ab, "ftm wmi command fail: %d\n", ret); -@@ -466,6 +492,7 @@ static int ath11k_tm_cmd_process_ftm(str +@@ -467,6 +479,7 @@ static int ath11k_tm_cmd_process_ftm(str buf_len -= chunk_len; bufpos += chunk_len; } @@ -520,7 +516,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ret = 0; out: mutex_unlock(&ar->conf_mutex); -@@ -476,6 +503,7 @@ int ath11k_tm_cmd(struct ieee80211_hw *h +@@ -477,6 +490,7 @@ int ath11k_tm_cmd(struct ieee80211_hw *h void *data, int len) { struct ath11k *ar = hw->priv; @@ -528,7 +524,7 @@ Signed-off-by: Sowmiya Sree Elavalagan struct nlattr *tb[ATH11K_TM_ATTR_MAX + 1]; int ret; -@@ -488,16 +516,18 @@ int ath11k_tm_cmd(struct ieee80211_hw *h +@@ -489,16 +503,18 @@ int ath11k_tm_cmd(struct ieee80211_hw *h return -EINVAL; switch (nla_get_u32(tb[ATH11K_TM_ATTR_CMD])) { @@ -610,7 +606,7 @@ Signed-off-by: Sowmiya Sree Elavalagan * and the event to receive WMI events from the firmware.The data --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -7624,6 +7624,37 @@ exit: +@@ -7678,6 +7678,37 @@ exit: kfree(tb); } @@ -648,8 +644,8 @@ Signed-off-by: Sowmiya Sree Elavalagan static void ath11k_wmi_pdev_temperature_event(struct ath11k_base *ab, struct sk_buff *skb) -@@ -8407,7 +8438,10 @@ static void ath11k_wmi_tlv_op_rx(struct - ath11k_wmi_pdev_dma_ring_buf_release_event(ab, skb); +@@ -8520,7 +8551,10 @@ static void ath11k_wmi_tlv_op_rx(struct + ath11k_probe_resp_tx_status_event(ab, skb); break; case WMI_PDEV_UTF_EVENTID: - ath11k_tm_event_wmi(ab, id, skb); @@ -662,7 +658,7 @@ Signed-off-by: Sowmiya Sree Elavalagan ath11k_wmi_twt_add_dialog_event(ab, skb); --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h -@@ -3656,6 +3656,26 @@ struct wmi_get_pdev_temperature_cmd { +@@ -3637,6 +3637,26 @@ struct wmi_get_pdev_temperature_cmd { u32 pdev_id; } __packed; diff --git a/feeds/wifi-ax/mac80211/patches/qca/223-fix-rmmod-failure-on-qmi-sequence-failure.patch b/feeds/wifi-ax/mac80211/patches/qca/223-fix-rmmod-failure-on-qmi-sequence-failure.patch deleted file mode 100644 index 7b8c8924d..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/223-fix-rmmod-failure-on-qmi-sequence-failure.patch +++ /dev/null @@ -1,222 +0,0 @@ -From 26ef325b70eee001a8ae24bc0604dd4cd1c5e559 Mon Sep 17 00:00:00 2001 -From: Sowmiya Sree Elavalagan -Date: Thu, 15 Oct 2020 12:47:47 +0530 -Subject: [PATCH] ath11k: fix rmmod failure on qmi sequence failure - -QMI sequence fails if caldata file is not available. -Handled return value in order to process various qmi -failures. - -Signed-off-by: Anilkumar Kolli -Signed-off-by: Sowmiya Sree Elavalagan ---- - drivers/net/wireless/ath/ath11k/ahb.c | 9 ++++++- - drivers/net/wireless/ath/ath11k/core.h | 1 + - drivers/net/wireless/ath/ath11k/debug.c | 1 + - drivers/net/wireless/ath/ath11k/qmi.c | 42 +++++++++++++++++++++------------ - 4 files changed, 37 insertions(+), 16 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/ahb.c -+++ b/drivers/net/wireless/ath/ath11k/ahb.c -@@ -774,6 +774,13 @@ static int ath11k_ahb_remove(struct plat - - reinit_completion(&ab->driver_recovery); - -+ if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { -+ ath11k_ahb_power_down(ab); -+ ath11k_debug_pdev_destroy(ab); -+ ath11k_qmi_deinit_service(ab); -+ goto qmi_fail; -+ } -+ - if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) - wait_for_completion_timeout(&ab->driver_recovery, - ATH11K_AHB_RECOVERY_TIMEOUT); -@@ -782,8 +789,8 @@ static int ath11k_ahb_remove(struct plat - cancel_work_sync(&ab->restart_work); - - ath11k_core_deinit(ab); -+qmi_fail: - ath11k_ahb_free_irq(ab); -- - ath11k_hal_srng_deinit(ab); - ath11k_ce_free_pipes(ab); - ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -197,6 +197,7 @@ enum ath11k_dev_flags { - ATH11K_FLAG_UNREGISTERING, - ATH11K_FLAG_REGISTERED, - ATH11K_FLAG_FW_RESTART_FOR_HOST, -+ ATH11K_FLAG_QMI_FAIL, - }; - - #define ATH11K_STATS_MGMT_FRM_TYPE_MAX 16 ---- a/drivers/net/wireless/ath/ath11k/debug.c -+++ b/drivers/net/wireless/ath/ath11k/debug.c -@@ -1274,6 +1274,7 @@ int ath11k_debug_pdev_create(struct ath1 - void ath11k_debug_pdev_destroy(struct ath11k_base *ab) - { - } -+EXPORT_SYMBOL(ath11k_debug_pdev_destroy); - - int ath11k_debug_soc_create(struct ath11k_base *ab) - { ---- a/drivers/net/wireless/ath/ath11k/qmi.c -+++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -3238,34 +3238,38 @@ ath11k_qmi_driver_event_post(struct ath1 - return 0; - } - --static void ath11k_qmi_event_server_arrive(struct ath11k_qmi *qmi) -+static int ath11k_qmi_event_server_arrive(struct ath11k_qmi *qmi) - { - struct ath11k_base *ab = qmi->ab; -- int ret; -+ int ret = 0; - - ret = ath11k_qmi_fw_ind_register_send(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to send FW indication QMI:%d\n", ret); -- return; -+ return ret; - } - - ret = ath11k_qmi_host_cap_send(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to send host cap QMI:%d\n", ret); -- return; -+ return ret; - } -+ -+ return 0; - } - --static void ath11k_qmi_event_mem_request(struct ath11k_qmi *qmi) -+static int ath11k_qmi_event_mem_request(struct ath11k_qmi *qmi) - { - struct ath11k_base *ab = qmi->ab; -- int ret; -+ int ret = 0; - - ret = ath11k_qmi_respond_fw_mem_request(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to respond fw mem req:%d\n", ret); -- return; -+ return ret; - } -+ -+ return 0; - } - - int ath11k_qmi_pci_alloc_qdss_mem(struct ath11k_qmi *qmi) -@@ -3435,28 +3439,29 @@ static void ath11k_qmi_event_qdss_trace_ - ath11k_dbg(ab, ATH11K_DBG_QMI, "QDSS configuration is completed and trace started\n"); - } - --static void ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi) -+static int ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi) - { - struct ath11k_base *ab = qmi->ab; -- int ret; -+ int ret = 0; - - ret = ath11k_qmi_request_target_cap(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to req target capabilities:%d\n", ret); -- return; -+ return ret; - } - - ret = ath11k_qmi_load_bdf_qmi(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to load board data file:%d\n", ret); -- return; -+ return ret; - } - - ret = ath11k_qmi_wlanfw_m3_info_send(ab); - if (ret < 0) { - ath11k_warn(ab, "qmi failed to send m3 info req:%d\n", ret); -- return; -+ return ret; - } -+ return 0; - } - - static void ath11k_qmi_msg_mem_request_cb(struct qmi_handle *qmi_hdl, -@@ -3745,6 +3750,7 @@ static void ath11k_qmi_driver_event_work - event_work); - struct ath11k_qmi_driver_event *event; - struct ath11k_base *ab = qmi->ab; -+ int ret = 0; - - spin_lock(&qmi->event_lock); - while (!list_empty(&qmi->event_list)) { -@@ -3758,17 +3764,17 @@ static void ath11k_qmi_driver_event_work - - switch (event->type) { - case ATH11K_QMI_EVENT_SERVER_ARRIVE: -- ath11k_qmi_event_server_arrive(qmi); -+ ret = ath11k_qmi_event_server_arrive(qmi); - break; - case ATH11K_QMI_EVENT_SERVER_EXIT: - set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); - set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); - break; - case ATH11K_QMI_EVENT_REQUEST_MEM: -- ath11k_qmi_event_mem_request(qmi); -+ ret = ath11k_qmi_event_mem_request(qmi); - break; - case ATH11K_QMI_EVENT_FW_MEM_READY: -- ath11k_qmi_event_load_bdf(qmi); -+ ret = ath11k_qmi_event_load_bdf(qmi); - break; - case ATH11K_QMI_EVENT_FW_READY: - if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { -@@ -3783,6 +3789,7 @@ static void ath11k_qmi_driver_event_work - clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); - ath11k_core_qmi_firmware_ready(ab); - set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags); -+ clear_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); - } - break; - case ATH11K_QMI_EVENT_COLD_BOOT_CAL_DONE: -@@ -3801,6 +3808,9 @@ static void ath11k_qmi_driver_event_work - break; - } - kfree(event); -+ if (ret < 0) -+ set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); -+ - spin_lock(&qmi->event_lock); - } - spin_unlock(&qmi->event_lock); -@@ -3854,6 +3864,7 @@ out: - kfree(req); - return ret; - } -+EXPORT_SYMBOL(ath11k_qmi_deinit_service); - - int ath11k_qmi_init_service(struct ath11k_base *ab) - { ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -1107,9 +1107,17 @@ static void ath11k_pci_remove(struct pci - struct ath11k_base *ab = pci_get_drvdata(pdev); - struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); - -+ if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { -+ ath11k_pci_power_down(ab); -+ ath11k_debug_pdev_destroy(ab); -+ ath11k_qmi_deinit_service(ab); -+ goto qmi_fail; -+ } -+ - set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); - cancel_work_sync(&ab->reset_work); - ath11k_core_deinit(ab); -+qmi_fail: - ath11k_mhi_unregister(ab_pci); - - ath11k_pci_free_irq(ab); diff --git a/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-fix-crash-during-recovery.patch b/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-fix-crash-during-recovery.patch new file mode 100644 index 000000000..04766eeac --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-fix-crash-during-recovery.patch @@ -0,0 +1,33 @@ +From 1ef327e5c53a49f6ba4325554d82ef956944fe18 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Thu, 5 Nov 2020 11:22:05 +0530 +Subject: [PATCH] ath11k: Fix crash during FW recovery on reo cmd ring access + +In scenarios when a peer is disassociating, there could be multiple +places where a REO cmd ring is accessed, such as during +aggregation teardown, tid queue cleanup etc. + +When this happens during FW recovery where accessing of FW/HW resources/registers +is not recommended, accessing reo cmd ring in this case could lead to +crash or undefined behaviour. + +Hence avoid this by checking for corresponding flag to avoid +accessing REO CMD ring during FW recovery. + +Signed-off-by: Sriram R +--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -727,6 +727,9 @@ int ath11k_dp_tx_send_reo_cmd(struct ath + struct hal_srng *cmd_ring; + int cmd_num; + ++ if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) ++ return -ESHUTDOWN; ++ + cmd_ring = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id]; + cmd_num = ath11k_hal_reo_cmd_send(ab, cmd_ring, type, cmd); + diff --git a/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-update-HT-cap-to-disable-TX-STBC-with-single-antenna.patch b/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-update-HT-cap-to-disable-TX-STBC-with-single-antenna.patch deleted file mode 100644 index c49763a6d..000000000 --- a/feeds/wifi-ax/mac80211/patches/qca/224-ath11k-update-HT-cap-to-disable-TX-STBC-with-single-antenna.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4693,7 +4693,8 @@ - } - - static struct ieee80211_sta_ht_cap --ath11k_create_ht_cap(struct ath11k *ar, u32 ar_ht_cap, u32 rate_cap_rx_chainmask) -+ath11k_create_ht_cap(struct ath11k *ar, u32 ar_ht_cap, -+ u32 rate_cap_tx_chainmask, u32 rate_cap_rx_chainmask) - { - int i; - struct ieee80211_sta_ht_cap ht_cap = {0}; -@@ -4724,7 +4725,7 @@ - ht_cap.cap |= smps; - } - -- if (ar_ht_cap & WMI_HT_CAP_TX_STBC) -+ if ((ar_ht_cap & WMI_HT_CAP_TX_STBC) && (rate_cap_tx_chainmask > 1)) - ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC; - - if (ar_ht_cap & WMI_HT_CAP_RX_STBC) { -@@ -4903,6 +4904,7 @@ - if (ht_cap_info) - *ht_cap_info = ht_cap; - band->ht_cap = ath11k_create_ht_cap(ar, ht_cap, -+ rate_cap_tx_chainmask, - rate_cap_rx_chainmask); - - band->vht_cap = ath11k_create_vht_cap(ar, rate_cap_tx_chainmask, -@@ -4915,10 +4917,25 @@ - if (ht_cap_info) - *ht_cap_info = ht_cap; - band->ht_cap = ath11k_create_ht_cap(ar, ht_cap, -+ rate_cap_tx_chainmask, - rate_cap_rx_chainmask); - band->vht_cap = ath11k_create_vht_cap(ar, rate_cap_tx_chainmask, - rate_cap_rx_chainmask); - } -+ -+ if (ar->hw->wiphy->bands[NL80211_BAND_5GHZ]) { -+ ar->hw->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap = -+ ar->mac.sbands[NL80211_BAND_5GHZ].ht_cap.cap; -+ ar->hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.cap = -+ ar->mac.sbands[NL80211_BAND_5GHZ].vht_cap.cap; -+ } -+ if (ar->hw->wiphy->bands[NL80211_BAND_2GHZ]) { -+ ar->hw->wiphy->bands[NL80211_BAND_2GHZ]->ht_cap.cap = -+ ar->mac.sbands[NL80211_BAND_2GHZ].ht_cap.cap; -+ ar->hw->wiphy->bands[NL80211_BAND_2GHZ]->vht_cap.cap = -+ ar->mac.sbands[NL80211_BAND_2GHZ].vht_cap.cap; -+ } -+ - } - - static int ath11k_check_chain_mask(struct ath11k *ar, u32 ant, bool is_tx_ant) diff --git a/feeds/wifi-ax/mac80211/patches/qca/224-fix-vif-null-panic-in-data-path.patch b/feeds/wifi-ax/mac80211/patches/qca/224-fix-vif-null-panic-in-data-path.patch new file mode 100644 index 000000000..b5bf0ab70 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/224-fix-vif-null-panic-in-data-path.patch @@ -0,0 +1,49 @@ +Subject: [PATCH] ath11k: fix null panic in data path + + 1. avoid the kernel panic in ath11k_dp_tx_htt_tx_complete_buf() + by cross check the vif parameter against null. + + 2. In ath11k_mgmt_rx_event() avoid kernel panic by cross check the + vif parameter adainst null. + + 3. avoid unnecessary warning print. + + ath11k_mac_get_arvif_by_vdev_id() loop all the active radio + to find out the arvif from the given vdev_id. if we call + ath11k_mac_get_arvif() to find vdev_id for the mismatched radio, + will trigger below warning print. Avoid this unnecessary warning + print by have a check like whether this vdev is created in the + given radio using the member allocated_vdev_map. + + warning print: + ath11k c000000.wifi: No VIF found for vdev 2 + ... + ath11k c000000.wifi: No VIF found for vdev 0 + +Signed-off-by: Karthikeyan Periyasamy +--- +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -510,7 +510,8 @@ struct ath11k_vif *ath11k_mac_get_arvif_ + + for (i = 0; i < ab->num_radios; i++) { + pdev = rcu_dereference(ab->pdevs_active[i]); +- if (pdev && pdev->ar) { ++ if (pdev && pdev->ar && ++ (pdev->ar->allocated_vdev_map & (1LL << vdev_id))) { + arvif = ath11k_mac_get_arvif(pdev->ar, vdev_id); + if (arvif) + return arvif; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6940,6 +6940,10 @@ static void ath11k_mgmt_rx_event(struct + vif = peer->vif; + + spin_unlock_bh(&ab->base_lock); ++ ++ if (!vif) ++ goto skip_mgmt_stats; ++ + spin_lock_bh(&ar->data_lock); + + arvif = ath11k_vif_to_arvif(vif); diff --git a/feeds/wifi-ax/mac80211/patches/qca/225-001-ema-beacon-tx-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/225-001-ema-beacon-tx-offload.patch new file mode 100644 index 000000000..e9f4a5c01 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/225-001-ema-beacon-tx-offload.patch @@ -0,0 +1,1152 @@ +From 65b31d0f691ddcc06ecaf7e86bb13772efd016c8 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 20 Oct 2020 13:50:59 -0700 +Subject: [PATCH 1/5] nl80211: add basic multiple bssid support + +This patch adds support for passing the multiple bssid config to the +kernel when adding an AP gets started. If the BSS is non-transmitting we +need to pass the ifidx of the transmitting parent. The multiple bssid +elements are passed as an array inside the beacon data. This allows use +to generate multiple bssid beacons aswell as EMA ones. + +Signed-off-by: Aloka Dixit +Signed-off-by: John Crispin +--- + include/net/cfg80211.h | 6 +++--- + include/uapi/linux/nl80211.h | 7 +++---- + net/wireless/nl80211.c | 22 ++++++++-------------- + 3 files changed, 14 insertions(+), 21 deletions(-) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 31ab73b..a032810 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -492,14 +492,14 @@ struct ieee80211_supported_band { + * + * @index: the index of this AP in the multi bssid group. + * @count: the total number of multi bssid peer APs. +- * @parent: a non-transmitted bssid has a transmitted parent +- * @non_transmitted: Is this a non-transmitted bssid ++ * @parent: non-transmitted BSSs transmitted parents index ++ * @ema: Shall the beacons be sent out in EMA mode. + */ + struct ieee80211_multiple_bssid { + u8 index; + u8 count; + u32 parent; +- bool non_transmitted; ++ bool ema; + }; + + /** +diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h +index 4b191f8..59d08ac 100644 +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -2599,9 +2599,6 @@ enum nl80211_commands { + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + * %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. + * +- * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this +- * BSSIDs beacon. +- * + * @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define + * the parent (transmitting) interface. + * +@@ -2613,6 +2610,8 @@ enum nl80211_commands { + * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. + * these get passed separately as the kernel might need to split them up for EMA VAP. + * ++ * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. ++ * + * @NL80211_ATTR_OBSS_COLOR_BITMAP: bitmap of the u64 BSS colors for the + * %NL80211_CMD_OBSS_COLOR_COLLISION event. + * +@@ -3126,11 +3125,11 @@ enum nl80211_attrs { + + NL80211_ATTR_HE_MUEDCA_PARAMS, + +- NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING, + NL80211_ATTR_MULTIPLE_BSSID_PARENT, + NL80211_ATTR_MULTIPLE_BSSID_INDEX, + NL80211_ATTR_MULTIPLE_BSSID_COUNT, + NL80211_ATTR_MULTIPLE_BSSID_IES, ++ NL80211_ATTR_MULTIPLE_BSSID_EMA, + + NL80211_ATTR_OBSS_COLOR_BITMAP, + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index f198daf..9c9148e 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -777,11 +777,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { + [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, + [NL80211_ATTR_SAR_SPEC] = NLA_POLICY_NESTED(sar_policy), + [NL80211_ATTR_DISABLE_HE] = { .type = NLA_FLAG }, +- [NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, +- [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = { .type = NLA_U8 }, ++ [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = NLA_POLICY_RANGE(NLA_U8, 1, 16), + [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED }, ++ [NL80211_ATTR_MULTIPLE_BSSID_EMA] = { .type = NLA_FLAG }, + [NL80211_ATTR_OBSS_COLOR_BITMAP] = { .type = NLA_U64 }, + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT] = { .type = NLA_U8 }, + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, +@@ -3999,14 +3999,6 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) + return err; + } + +- if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING]) +- params.multiple_bssid.non_transmitted = +- nla_get_flag(info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING]); +- +- if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]) +- params.multiple_bssid.parent = +- nla_get_u8(info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]); +- + if (!cfg80211_iftype_allowed(&rdev->wiphy, type, params.use_4addr, 0)) + return -EOPNOTSUPP; + +@@ -5560,6 +5552,10 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) + goto out; + } + ++ if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]) ++ params.multiple_bssid.parent = ++ nla_get_u32(info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]); ++ + if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_INDEX]) + params.multiple_bssid.index = nla_get_u8( + info->attrs[NL80211_ATTR_MULTIPLE_BSSID_INDEX]); +@@ -5567,10 +5563,8 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) + if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_COUNT]) + params.multiple_bssid.count = nla_get_u8( + info->attrs[NL80211_ATTR_MULTIPLE_BSSID_COUNT]); +- +- if (params.multiple_bssid.non_transmitted && +- !info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]) +- return -EOPNOTSUPP; ++ params.multiple_bssid.ema = ++ nla_get_flag(info->attrs[NL80211_ATTR_MULTIPLE_BSSID_EMA]); + + nl80211_calculate_ap_params(¶ms); + +-- +2.7.4 + +From c8998ca44327b2f9dbdb0f47522417858220fdc2 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 20 Oct 2020 14:23:02 -0700 +Subject: [PATCH 2/5] mac80211: add multiple bssid support to interface + handling + +When bringing up multi bssid APs we need to track the parent-child +relation aswell as figuring out if the BSS is (non-)transmitting. +The new helper function ieee80211_set_multiple_bssid_options() takes +care of storing the config as well as figuring out the runtime flags of the +virtual interface. + +The patch also makes sure that when a parent is closed, its children are +also closed. + +Signed-off-by: Aloka Dixit +Signed-off-by: John Crispin +--- + include/net/mac80211.h | 21 ++++++++++--- + net/mac80211/cfg.c | 80 ++++++++++++++++++++++++++------------------------ + net/mac80211/iface.c | 10 +++---- + 3 files changed, 62 insertions(+), 49 deletions(-) + +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index af627fd..437dc26 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1687,6 +1687,20 @@ enum ieee80211_offload_flags { + }; + + /** ++ * enum ieee80211_vif_multiple_bssid_flags - virtual interface multiple bssid flags ++ * ++ * @IEEE80211_VIF_MBSS_TRANSMITTING: this BSS is transmitting beacons ++ * @IEEE80211_VIF_MBSS_NON_TRANSMITTING: this BSS is not transmitting beacons ++ * @IEEE80211_VIF_MBSS_EMA_BEACON: beacons should be send out in EMA mode ++ */ ++ ++enum ieee80211_vif_multiple_bssid_flags { ++ IEEE80211_VIF_MBSS_TRANSMITTING = BIT(1), ++ IEEE80211_VIF_MBSS_NON_TRANSMITTING = BIT(2), ++ IEEE80211_VIF_MBSS_EMA_BEACON = BIT(3), ++}; ++ ++/** + * struct ieee80211_vif - per-interface data + * + * Data in this structure is continually present for driver +@@ -1733,8 +1747,8 @@ enum ieee80211_offload_flags { + * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see + * &enum ieee80211_offload_flags. + * @multiple_bssid.parent: a non-transmitted bssid has a transmitted parent. +- * @multiple_bssid.list: linked list for tracking parent - child relations. +- * @multiple_bssid.non_transmitted: Is this a non-transmitted bssi ++ * @multiple_bssid.flags: multiple bssid flags, see ++ * &enum ieee80211_vif_multiple_bssid_flags + * @color_change_active: marks whether a color change is going on. Internally it is + * write-protected by sdata_lock and local->mtx so holding either is fine + * for read access. +@@ -1768,8 +1782,7 @@ struct ieee80211_vif { + bool txqs_stopped[IEEE80211_NUM_ACS]; + struct { + struct ieee80211_vif *parent; +- struct list_head list; +- bool non_transmitted; ++ u32 flags; + } multiple_bssid; + + bool color_change_active; +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index 1f62028..f457ca3 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -111,8 +111,8 @@ static int ieee80211_set_mon_options(struct ieee80211_sub_if_data *sdata, + return 0; + } + +-static int ieee80211_set_multiple_bssid_options(struct ieee80211_sub_if_data *sdata, +- struct vif_params *params) ++static void ieee80211_set_multiple_bssid_options(struct ieee80211_sub_if_data *sdata, ++ struct cfg80211_ap_settings *params) + { + struct ieee80211_local *local = sdata->local; + struct wiphy *wiphy = local->hw.wiphy; +@@ -120,22 +120,28 @@ static int ieee80211_set_multiple_bssid_options(struct ieee80211_sub_if_data *sd + struct ieee80211_sub_if_data *psdata; + + if (!ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID_AP)) +- return 0; ++ return; + +- if (params->multiple_bssid.non_transmitted) { ++ if (!params->multiple_bssid.count) ++ return; ++ ++ if (params->multiple_bssid.parent) { + parent = __dev_get_by_index(wiphy_net(wiphy), + params->multiple_bssid.parent); + if (!parent || !parent->ieee80211_ptr) +- return -EINVAL; ++ return; + psdata = IEEE80211_WDEV_TO_SUB_IF(parent->ieee80211_ptr); +- if (psdata->vif.multiple_bssid.non_transmitted) +- return -EINVAL; ++ if (psdata->vif.multiple_bssid.parent) ++ return; + sdata->vif.multiple_bssid.parent = &psdata->vif; +- list_add(&sdata->vif.multiple_bssid.list, +- &psdata->vif.multiple_bssid.list); +- sdata->vif.multiple_bssid.non_transmitted = true; ++ sdata->vif.multiple_bssid.flags |= IEEE80211_VIF_MBSS_NON_TRANSMITTING; ++ } else { ++ sdata->vif.multiple_bssid.flags |= IEEE80211_VIF_MBSS_TRANSMITTING; + } +- return 0; ++ ++ if (params->multiple_bssid.ema) ++ sdata->vif.multiple_bssid.flags |= IEEE80211_VIF_MBSS_EMA_BEACON; ++ sdata->vif.bss_conf.multiple_bssid = params->multiple_bssid; + } + + static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, +@@ -163,32 +169,25 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, + } + } + +- if (type == NL80211_IFTYPE_AP) { +- err = ieee80211_set_multiple_bssid_options(sdata, params); +- if (err) { +- ieee80211_if_remove(sdata); +- return NULL; +- } +- } +- + return wdev; + } + + static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) + { + struct ieee80211_sub_if_data *sdata; +- struct ieee80211_vif *child, *tmp; + + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + if (sdata && sdata->vif.type == NL80211_IFTYPE_AP) { +- if (!sdata->vif.multiple_bssid.non_transmitted) { +- if (!list_empty(&sdata->vif.multiple_bssid.list)) +- list_for_each_entry_safe(child, tmp, +- &sdata->vif.multiple_bssid.list, +- multiple_bssid.list) +- dev_close(vif_to_sdata(child)->wdev.netdev); ++ if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { ++ struct ieee80211_sub_if_data *child; ++ ++ rcu_read_lock(); ++ list_for_each_entry_rcu(child, &sdata->local->interfaces, list) ++ if (child->vif.multiple_bssid.parent == &sdata->vif) ++ dev_close(child->wdev.netdev); ++ rcu_read_unlock(); + } else { +- list_del(&sdata->vif.multiple_bssid.list); ++ sdata->vif.multiple_bssid.parent = NULL; + } + } + +@@ -1216,6 +1215,9 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, + sizeof(*params->he_cap)); + } + ++ if (sdata->vif.type == NL80211_IFTYPE_AP) ++ ieee80211_set_multiple_bssid_options(sdata, params); ++ + mutex_lock(&local->mtx); + err = ieee80211_vif_use_channel(sdata, ¶ms->chandef, + IEEE80211_CHANCTX_SHARED); +@@ -4316,19 +4318,19 @@ static void ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_dat + ieee80211_bss_info_change_notify(sdata, changed); + + if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_MULTI_BSSID_AP) && +- !sdata->vif.multiple_bssid.non_transmitted) { +- struct ieee80211_vif *child; +- +- list_for_each_entry(child, &sdata->vif.multiple_bssid.list, +- multiple_bssid.list) { +- struct ieee80211_sub_if_data *child_sdata = vif_to_sdata(child); +- +- sdata_lock(child_sdata); +- child->bss_conf.he_bss_color.color = color; +- child->bss_conf.he_bss_color.enabled = enable; +- ieee80211_bss_info_change_notify(child_sdata, BSS_CHANGED_HE_BSS_COLOR); +- sdata_unlock(child_sdata); ++ !(sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING)) { ++ struct ieee80211_sub_if_data *child; ++ ++ rcu_read_lock(); ++ list_for_each_entry_rcu(child, &sdata->local->interfaces, list) { ++ if (child->vif.multiple_bssid.parent == &sdata->vif) { ++ child->vif.bss_conf.he_bss_color.color = color; ++ child->vif.bss_conf.he_bss_color.enabled = enable; ++ ieee80211_bss_info_change_notify(child, BSS_CHANGED_HE_BSS_COLOR); ++ ++ } + } ++ rcu_read_unlock(); + } + } + +diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c +index 741b55a..6aea11f 100644 +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -380,12 +380,11 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do + bool cancel_scan; + struct cfg80211_nan_func *func; + ++ /* make sure the parent is already down */ + if (sdata->vif.type == NL80211_IFTYPE_AP && +- sdata->vif.multiple_bssid.non_transmitted) +- /* make sure the parent is already down */ +- if (sdata->vif.multiple_bssid.parent && +- ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent))) +- dev_close(vif_to_sdata(sdata->vif.multiple_bssid.parent)->wdev.netdev); ++ sdata->vif.multiple_bssid.parent && ++ ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent))) ++ dev_close(vif_to_sdata(sdata->vif.multiple_bssid.parent)->wdev.netdev); + + clear_bit(SDATA_STATE_RUNNING, &sdata->state); + +@@ -2065,7 +2064,6 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, + skb_queue_head_init(&sdata->fragments[i].skb_list); + + INIT_LIST_HEAD(&sdata->key_list); +- INIT_LIST_HEAD(&sdata->vif.multiple_bssid.list); + + INIT_DELAYED_WORK(&sdata->dfs_cac_timer_work, + ieee80211_dfs_cac_timer_work); +-- +2.7.4 + +From acc7bd542b47cdefb373eee145509a265fe504ce Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 20 Oct 2020 14:37:21 -0700 +Subject: [PATCH 3/5] mac80211: add multiple bssid/EMA support to beacon + handling + +With beacon_data now holding the additional information about the +multiple bssid elements, we need to honour these in the various beacon +handling code paths. + +Extend ieee80211_beacon_get_template() to allow generation of multiple +bssid/EMA beacons. The API provides support for HW that can offload the +EMA beaconing aswell as HW that will require periodic updates of the +beacon template upon completion events. + +In case the HW can do full EMA offload, functions are provided that +allow the driver to get a list of the periodicity number of beacons and +their matching mutable offsets. + +Signed-off-by: Aloka Dixit +Signed-off-by: John Crispin +--- + include/net/mac80211.h | 86 ++++++++++++++++++++++++++++ + net/mac80211/tx.c | 148 ++++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 201 insertions(+), 33 deletions(-) + +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index bb43484..81d4c11 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -4960,6 +4960,7 @@ struct ieee80211_mutable_offsets { + u16 tim_length; + + u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; ++ + u16 multiple_bssid_offset; + u16 multiple_bssid_length; + }; +@@ -4989,6 +4990,91 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, + struct ieee80211_mutable_offsets *offs); + + /** ++ * enum ieee80211_bcn_tmpl_ema - EMA beacon generation type ++ * @IEEE80211_BCN_EMA_NONE: don't generate an EMA beacon. ++ * @IEEE80211_BCN_EMA_NEXT: generate the next periodicity beacon. ++ * @IEEE80211_BCN_EMA_INDEX: generate beacon by periodicity index ++ * if the value is >= this enum value. ++ */ ++enum ieee80211_bcn_tmpl_ema { ++ IEEE80211_BCN_EMA_NONE = -2, ++ IEEE80211_BCN_EMA_NEXT = -1, ++ IEEE80211_BCN_EMA_INDEX = 0, ++}; ++ ++/** ++ * ieee80211_beacon_get_template_ema_next - EMA beacon template generation ++ * function for drivers using the sw offload path. ++ * @hw: pointer obtained from ieee80211_alloc_hw(). ++ * @vif: &struct ieee80211_vif pointer from the add_interface callback. ++ * @offs: &struct ieee80211_mutable_offsets pointer to struct that will ++ * receive the offsets that may be updated by the driver. ++ * ++ * This function differs from ieee80211_beacon_get_template in the sense that ++ * it generates EMA VAP templates. When we use multiple_bssid, the beacons can ++ * get very large costing a lot of airtime. To work around this, we iterate ++ * over the multiple bssid elements and only send one inside the beacon for ++ * 1..n. Calling this function will auto-increment the periodicity counter. ++ * ++ * This function needs to follow the same rules as ieee80211_beacon_get_template ++ * ++ * Return: The beacon template. %NULL on error. ++ */ ++ ++struct sk_buff * ++ieee80211_beacon_get_template_ema_next(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct ieee80211_mutable_offsets *offs); ++ ++/** struct ieee80211_ema_bcn_list - list entry of an EMA beacon ++ * @list: the list pointer. ++ * @skb: the skb containing this specific beacon ++ * @offs: &struct ieee80211_mutable_offsets pointer to struct that will ++ * receive the offsets that may be updated by the driver. ++ */ ++struct ieee80211_ema_bcn_list { ++ struct list_head list; ++ struct sk_buff *skb; ++ struct ieee80211_mutable_offsets offs; ++}; ++ ++/** ++ * ieee80211_beacon_get_template_ema_list - EMA beacon template generation ++ * function for drivers using the hw offload. ++ * @hw: pointer obtained from ieee80211_alloc_hw(). ++ * @vif: &struct ieee80211_vif pointer from the add_interface callback. ++ * @head: linked list head that will get populated with ++ * &struct ieee80211_ema_bcn_list pointers. ++ * ++ * This function differs from ieee80211_beacon_get_template in the sense that ++ * it generates EMA VAP templates. When we use multiple_bssid, the beacons can ++ * get very large costing a lot of airtime. To work around this, we iterate ++ * over the multiple bssid elements and only send one inside the beacon for ++ * 1..n. This function will populate a linked list that the driver can pass ++ * to the HW. ++ * ++ * This function needs to follow the same rules as ieee80211_beacon_get_template ++ * ++ * Return: The nuber of entries in the list or 0 on error. ++ */ ++ ++int ++ieee80211_beacon_get_template_ema_list(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct list_head *head); ++ ++/** ++ * ieee80211_beacon_free_ema_list - free an EMA beacon template list ++ * @head: linked list head containing &struct ieee80211_ema_bcn_list pointers. ++ * ++ * This function will free a list previously acquired by calling ++ * ieee80211_beacon_get_template_ema_list() ++ */ ++ ++void ++ieee80211_beacon_free_ema_list(struct list_head *head); ++ ++/** + * ieee80211_beacon_get_template - beacon template generation function + * @hw: pointer obtained from ieee80211_alloc_hw(). + * @vif: &struct ieee80211_vif pointer from the add_interface callback. +diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c +index b955f02..81e634e 100644 +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -4802,7 +4802,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_mutable_offsets *offs, + bool is_template, +- bool is_ema) ++ int ema_index) + { + struct ieee80211_local *local = hw_to_local(hw); + struct beacon_data *beacon = NULL; +@@ -4814,13 +4814,11 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf; + int csa_off_base = 0; + +- rcu_read_lock(); +- + sdata = vif_to_sdata(vif); + chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); + + if (!ieee80211_sdata_running(sdata) || !chanctx_conf) +- goto out; ++ return NULL; + + if (offs) + memset(offs, 0, sizeof(*offs)); +@@ -4830,7 +4828,8 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + + beacon = rcu_dereference(ap->beacon); + if (beacon) { +- int ema_len = 0; ++ int multiple_bssid_len = 0; ++ + if (beacon->cntdwn_counter_offsets[0]) { + if (!is_template) + ieee80211_beacon_update_cntdwn(vif); +@@ -4838,8 +4837,26 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + ieee80211_set_beacon_cntdwn(sdata, beacon); + } + +- if (is_ema && beacon->multiple_bssid.cnt) +- ema_len = beacon->multiple_bssid.len[beacon->ema_index]; ++ if (ema_index == IEEE80211_BCN_EMA_NEXT) { ++ ema_index = beacon->ema_index; ++ beacon->ema_index++; ++ beacon->ema_index %= beacon->multiple_bssid.cnt; ++ } ++ ++ if (ema_index != IEEE80211_BCN_EMA_NONE && ++ ema_index >= beacon->multiple_bssid.cnt) ++ return NULL; ++ ++ if (beacon->multiple_bssid.cnt) { ++ if (ema_index >= IEEE80211_BCN_EMA_INDEX) { ++ multiple_bssid_len = beacon->multiple_bssid.len[ema_index]; ++ } else { ++ int i; ++ ++ for (i = 0; i < beacon->multiple_bssid.cnt; i++) ++ multiple_bssid_len = beacon->multiple_bssid.len[i]; ++ } ++ } + + /* + * headroom, head length, +@@ -4849,9 +4866,9 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + beacon->head_len + + beacon->tail_len + 256 + + local->hw.extra_beacon_tailroom + +- ema_len); ++ multiple_bssid_len); + if (!skb) +- goto out; ++ return NULL; + + skb_reserve(skb, local->tx_headroom); + skb_put_data(skb, beacon->head, beacon->head_len); +@@ -4868,16 +4885,22 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + csa_off_base = skb->len; + } + +- if (ema_len) { +- ieee80211_beacon_add_multiple_bssid_config(vif, skb, ++ if (multiple_bssid_len) { ++ if (ema_index >= IEEE80211_BCN_EMA_INDEX) { ++ ieee80211_beacon_add_multiple_bssid_config(vif, skb, + &beacon->multiple_bssid); +- skb_put_data(skb, beacon->multiple_bssid.ies[beacon->ema_index], +- beacon->multiple_bssid.len[beacon->ema_index]); ++ skb_put_data(skb, ++ beacon->multiple_bssid.ies[beacon->ema_index], ++ beacon->multiple_bssid.len[beacon->ema_index]); ++ } else { ++ int i; ++ ++ for (i = 0; i < beacon->multiple_bssid.cnt; i++) ++ skb_put_data(skb, beacon->multiple_bssid.ies[i], ++ beacon->multiple_bssid.len[i]); ++ } + if (offs) +- offs->multiple_bssid_offset = skb->len - ema_len; +- +- beacon->ema_index++; +- beacon->ema_index %= beacon->multiple_bssid.cnt; ++ offs->multiple_bssid_offset = skb->len - multiple_bssid_len; + } + + if (beacon->tail) +@@ -4885,16 +4908,16 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + beacon->tail_len); + + if (ieee80211_beacon_protect(skb, local, sdata) < 0) +- goto out; ++ return NULL; + } else +- goto out; ++ return NULL; + } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { + struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; + struct ieee80211_hdr *hdr; + + beacon = rcu_dereference(ifibss->presp); + if (!beacon) +- goto out; ++ return NULL; + + if (beacon->cntdwn_counter_offsets[0]) { + if (!is_template) +@@ -4906,7 +4929,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + skb = dev_alloc_skb(local->tx_headroom + beacon->head_len + + local->hw.extra_beacon_tailroom); + if (!skb) +- goto out; ++ return NULL; + skb_reserve(skb, local->tx_headroom); + skb_put_data(skb, beacon->head, beacon->head_len); + +@@ -4918,7 +4941,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + + beacon = rcu_dereference(ifmsh->beacon); + if (!beacon) +- goto out; ++ return NULL; + + if (beacon->cntdwn_counter_offsets[0]) { + if (!is_template) +@@ -4941,7 +4964,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + beacon->tail_len + + local->hw.extra_beacon_tailroom); + if (!skb) +- goto out; ++ return NULL; + skb_reserve(skb, local->tx_headroom); + skb_put_data(skb, beacon->head, beacon->head_len); + ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb, is_template); +@@ -4954,7 +4977,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + skb_put_data(skb, beacon->tail, beacon->tail_len); + } else { + WARN_ON(1); +- goto out; ++ return NULL; + } + + /* CSA offsets */ +@@ -4997,8 +5020,6 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, + info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT | + IEEE80211_TX_CTL_ASSIGN_SEQ | + IEEE80211_TX_CTL_FIRST_FRAGMENT; +- out: +- rcu_read_unlock(); + return skb; + + } +@@ -5008,25 +5029,86 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_mutable_offsets *offs) + { +- return __ieee80211_beacon_get(hw, vif, offs, true, false); ++ struct sk_buff *bcn; ++ ++ rcu_read_lock(); ++ bcn = __ieee80211_beacon_get(hw, vif, offs, true, ++ IEEE80211_BCN_EMA_NONE); ++ rcu_read_unlock(); ++ ++ return bcn; + } + EXPORT_SYMBOL(ieee80211_beacon_get_template); + + struct sk_buff * +-ieee80211_beacon_get_template_ema(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct ieee80211_mutable_offsets *offs) ++ieee80211_beacon_get_template_ema_next(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct ieee80211_mutable_offsets *offs) ++{ ++ struct sk_buff *bcn; ++ ++ rcu_read_lock(); ++ bcn = __ieee80211_beacon_get(hw, vif, offs, true, ++ IEEE80211_BCN_EMA_NEXT); ++ rcu_read_unlock(); ++ ++ return bcn; ++} ++EXPORT_SYMBOL(ieee80211_beacon_get_template_ema_next); ++ ++void ++ieee80211_beacon_free_ema_list(struct list_head *head) ++{ ++ struct ieee80211_ema_bcn_list *ema, *tmp; ++ ++ list_for_each_entry_safe(ema, tmp, head, list) { ++ kfree_skb(ema->skb); ++ kfree(ema); ++ } ++} ++EXPORT_SYMBOL(ieee80211_beacon_free_ema_list); ++ ++int ++ieee80211_beacon_get_template_ema_list(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct list_head *head) + { +- return __ieee80211_beacon_get(hw, vif, offs, true, true); ++ int cnt = 0; ++ ++ rcu_read_lock(); ++ while (true) { ++ struct ieee80211_ema_bcn_list *ema; ++ ++ ema = kmalloc(sizeof(*ema), GFP_KERNEL); ++ if (!ema) { ++ ieee80211_beacon_free_ema_list(head); ++ cnt = 0; ++ goto out; ++ } ++ ++ ema->skb = __ieee80211_beacon_get(hw, vif, &ema->offs, true, ++ cnt); ++ if (!ema->skb) { ++ kfree(ema); ++ break; ++ } ++ list_add_tail(&ema->list, head); ++ cnt++; ++ } ++out: ++ rcu_read_unlock(); ++ ++ return cnt; + } +-EXPORT_SYMBOL(ieee80211_beacon_get_template_ema); ++EXPORT_SYMBOL(ieee80211_beacon_get_template_ema_list); + + struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + u16 *tim_offset, u16 *tim_length) + { + struct ieee80211_mutable_offsets offs = {}; +- struct sk_buff *bcn = __ieee80211_beacon_get(hw, vif, &offs, false, false); ++ struct sk_buff *bcn = __ieee80211_beacon_get(hw, vif, &offs, false, ++ IEEE80211_BCN_EMA_NONE); + struct sk_buff *copy; + struct ieee80211_supported_band *sband; + int shift; +-- +2.7.4 + +From 1d79e56f5a89230ae150ed5d840cecb8ef5696a8 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Thu, 15 Oct 2020 18:11:33 -0700 +Subject: [PATCH 4/5] mac80211: don't allow CSA on non-transmitting interfaces + +As a non-transmitting interface does not broadcast a beacon, we do not +want to allow channel switch announcements. They need to be triggered +on the transmitting interface. + +Signed-off-by: Aloka Dixit +Signed-off-by: John Crispin +--- + net/mac80211/cfg.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index f457ca3..3470991 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -3547,6 +3547,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, + if (sdata->vif.csa_active) + return -EBUSY; + ++ if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) ++ return -EINVAL; ++ + mutex_lock(&local->chanctx_mtx); + conf = rcu_dereference_protected(sdata->vif.chanctx_conf, + lockdep_is_held(&local->chanctx_mtx)); +-- +2.7.4 + +From 3307ad5a2e005ad800e02a6154e95b6cd4450a95 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 20 Oct 2020 14:58:39 -0700 +Subject: [PATCH 5/5] ath11k: add EMA support + +This patch adds EMA support to mac80211/EMA. Currently the patch will +crash the FW. +The RFT is aimed at the QCA team to help debug the FW crash. + +Signed-off-by: John Crispin +--- + drivers/net/wireless/ath/ath11k/mac.c | 145 +++++++++++++++++++++++----------- + drivers/net/wireless/ath/ath11k/wmi.c | 8 +- + drivers/net/wireless/ath/ath11k/wmi.h | 21 ++++- + 3 files changed, 126 insertions(+), 48 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index 282dc82..b158c7f 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -1062,32 +1062,19 @@ err_mon_del: + return 0; + } + +-static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) ++static int __ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif, struct sk_buff *bcn, ++ struct ieee80211_mutable_offsets offs, ++ int ema_idx, int ema_cnt) + { + struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; +- struct ieee80211_hw *hw = ar->hw; +- struct ieee80211_vif *vif = arvif->vif; +- struct ieee80211_mutable_offsets offs = {}; +- struct sk_buff *bcn; + struct ieee80211_mgmt *mgmt; + struct ieee80211_vht_cap *vht_cap; ++ u32 ema_param = 0; + u8 *ies; + int ret; + const u8 *vht_cap_ie; + +- if (arvif->vdev_type != WMI_VDEV_TYPE_AP) +- return 0; +- +- if (arvif->vif->multiple_bssid.non_transmitted) +- return 0; +- +- bcn = ieee80211_beacon_get_template_ema(hw, vif, &offs); +- if (!bcn) { +- ath11k_warn(ab, "failed to get beacon template from mac80211\n"); +- return -EPERM; +- } +- + ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn); + ies += sizeof(mgmt->u.beacon); + +@@ -1105,9 +1092,17 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) + ies, (skb_tail_pointer(bcn) - ies))) + arvif->wpaie_present = true; + +- ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn); ++ if (ema_cnt) { ++ ema_param = ema_cnt << WMI_BEACON_EMA_PARAM_PERIODICITY_SHIFT; ++ ema_param |= ema_idx << WMI_BEACON_EMA_PARAM_TMPL_IDX_SHIFT; ++ ema_param |= (!ema_idx ? 1 : 0) << ++ WMI_BEACON_EMA_PARAM_FIRST_TMPL_SHIFT; ++ ema_param |= (ema_idx + 1 == ema_cnt ? 1 : 0) << ++ WMI_BEACON_EMA_PARAM_LAST_TMPL_SHIFT; ++ printk("%s:%s[%d]%x\n", __FILE__, __func__, __LINE__, ema_param); ++ } + +- kfree_skb(bcn); ++ ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn, ema_param); + + if (ret) + ath11k_warn(ab, "failed to submit beacon template command: %d\n", +@@ -1116,38 +1111,90 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) + return ret; + } + +-void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) ++static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif) + { +- struct ieee80211_vif *vif = arvif->vif, *child, *tmp; +- int multiple_bssid = 0; ++ struct ath11k *ar = arvif->ar; ++ struct ieee80211_vif *vif = arvif->vif; ++ struct ieee80211_ema_bcn_list *bcn; ++ struct ieee80211_hw *hw = ar->hw; ++ struct list_head bcns; ++ int cnt, idx = 0, ret = 0; + +- if (!vif->multiple_bssid.non_transmitted && +- !list_empty(&vif->multiple_bssid.list)) +- multiple_bssid = 1; ++ INIT_LIST_HEAD(&bcns); ++ cnt = ieee80211_beacon_get_template_ema_list(hw, vif, &bcns); ++ if (!cnt){ ++ ath11k_warn(ar->ab, "failed to get ema beacon template from mac80211\n"); ++ return -EPERM; ++ } + +- if (!multiple_bssid && !vif->color_change_active && !arvif->bcca_zero_sent) +- return; ++ printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__); ++ list_for_each_entry(bcn, &bcns, list) { ++ printk("%s:%s[%d]%d / %d\n", __FILE__, __func__, __LINE__, idx, cnt); ++ ret = __ath11k_mac_setup_bcn_tmpl(arvif, bcn->skb, bcn->offs, idx++, cnt); ++ if (ret) ++ break; ++ } ++ printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__); + +- if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) { +- ieee80211_csa_finish(vif); +- list_for_each_entry_safe(child, tmp, +- &vif->multiple_bssid.list, +- multiple_bssid.list) +- ieee80211_csa_finish(child); +- return; +- } ++ ieee80211_beacon_free_ema_list(&bcns); ++ ++ return ret; ++} ++ ++static int ath11k_mac_setup_bcn_tmpl_legacy(struct ath11k_vif *arvif) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct ieee80211_mutable_offsets offs = {}; ++ struct ieee80211_vif *vif = arvif->vif; ++ struct ieee80211_hw *hw = ar->hw; ++ struct sk_buff *bcn; ++ int ret; ++ ++ bcn = ieee80211_beacon_get_template(hw, vif, &offs); ++ if (!bcn) { ++ ath11k_warn(ar->ab, "failed to get beacon template from mac80211\n"); ++ return -EPERM; ++ } ++ ++ ret = __ath11k_mac_setup_bcn_tmpl(arvif, bcn, offs, 0, 0); ++ ++ kfree_skb(bcn); + +- if (vif->color_change_active && ieee80211_beacon_cntdwn_is_complete(vif)) { ++ return ret; ++} ++ ++static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) ++{ ++ if (arvif->vdev_type != WMI_VDEV_TYPE_AP) ++ return 0; ++ ++ if (arvif->vif->multiple_bssid.parent) ++ return 0; ++ ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) ++ return ath11k_mac_setup_bcn_tmpl_ema(arvif); ++ ++ return ath11k_mac_setup_bcn_tmpl_legacy(arvif); ++} ++ ++void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) ++{ ++ struct ieee80211_vif *vif = arvif->vif; ++ ++ if (!vif->color_change_active && !arvif->bcca_zero_sent) ++ return; ++ ++ if (vif->color_change_active && ieee80211_beacon_cntdwn_is_complete(vif)) { + arvif->bcca_zero_sent = true; +- ieee80211_color_change_finish(vif); +- return; +- } ++ ieee80211_color_change_finish(vif); ++ return; ++ } + + if (arvif->bcca_zero_sent) + arvif->bcca_zero_sent = false; + +- if (vif->color_change_active || vif->csa_active) +- ieee80211_beacon_update_cntdwn(vif); ++ if (vif->color_change_active) ++ ieee80211_beacon_update_cntdwn(vif); + + ath11k_mac_setup_bcn_tmpl(arvif); + } +@@ -3153,7 +3200,7 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, + ret = ath11k_wmi_send_obss_color_collision_cfg_cmd( + ar, arvif->vdev_id, info->he_bss_color.color, + ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS, +- !arvif->vif->multiple_bssid.non_transmitted ? ++ !(arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) ? + (info->he_bss_color.enabled & color_collision_enable) : 0); + + if (ret) +@@ -5754,7 +5801,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, + params->subtype = arvif->vdev_subtype; + params->pdev_id = pdev->pdev_id; + params->vdevid_trans = 0; +- if (arvif->vif->multiple_bssid.non_transmitted) { ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { + params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; + parent = arvif->vif->multiple_bssid.parent; + if (!parent) +@@ -5762,10 +5809,13 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, + if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) + return -EINVAL; + params->vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; +- } else { ++ } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { + params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; + } + ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) ++ params->flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ + if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { + params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; + params->chains[NL80211_BAND_2GHZ].rx = ar->num_rx_chains; +@@ -6407,7 +6457,7 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, + + arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); + +- if (arvif->vif->multiple_bssid.non_transmitted) { ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { + arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; + parent = arvif->vif->multiple_bssid.parent; + if (!parent) +@@ -6415,10 +6465,13 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, + if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) + return -EINVAL; + arg.vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; +- } else { ++ } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { + arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; + } + ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) { ++ arg.mbss_capability_flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ } + ath11k_dbg(ab, ATH11K_DBG_MAC, + "mac vdev %d start center_freq %d phymode %s\n", + arg.vdev_id, arg.channel.freq, +diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c +index 7bf688c..a3bde5c 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -1897,7 +1897,7 @@ int ath11k_wmi_send_bcn_offload_control_cmd(struct ath11k *ar, + + int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, + struct ieee80211_mutable_offsets *offs, +- struct sk_buff *bcn) ++ struct sk_buff *bcn, u32 ema_params) + { + struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, vdev_id); + struct ieee80211_vif *vif = arvif->vif; +@@ -1929,6 +1929,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, + + cmd->buf_len = bcn->len; + cmd->mbssid_ie_offset = offs->multiple_bssid_offset; ++ cmd->ema_params = ema_params; + + ptr = skb->data + sizeof(*cmd); + +@@ -4172,6 +4173,8 @@ ath11k_wmi_copy_resource_config(struct wmi_resource_config *wmi_cfg, + wmi_cfg->sched_params = tg_cfg->sched_params; + wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; + wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count; ++ wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; ++ wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; + } + + static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi, +@@ -4388,6 +4391,9 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab) + memset(&init_param, 0, sizeof(init_param)); + memset(&config, 0, sizeof(config)); + ++ config.ema_max_vap_cnt = 16; ++ config.ema_max_profile_period = 8; ++ + ab->hw_params.hw_ops->wmi_init_config(ab, &config); + + memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config)); +diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h +index bd0aa88..d0322ef 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2426,6 +2426,18 @@ struct wmi_resource_config { + u32 sched_params; + u32 twt_ap_pdev_count; + u32 twt_ap_sta_count; ++ u32 max_nlo_ssids; ++ u32 num_pkt_filters; ++ u32 num_max_sta_vdevs; ++ u32 max_bssid_indicator; ++ u32 ul_resp_config; ++ u32 msdu_flow_override_config0; ++ u32 msdu_flow_override_config1; ++ u32 flags2; ++ u32 host_service_flags; ++ u32 max_rnr_neighbours; ++ u32 ema_max_vap_cnt; ++ u32 ema_max_profile_period; + } __packed; + + struct wmi_service_ready_event { +@@ -3674,6 +3686,11 @@ struct wmi_ftm_event_msg { + + #define WMI_BEACON_TX_BUFFER_SIZE 512 + ++#define WMI_BEACON_EMA_PARAM_PERIODICITY_SHIFT 0 ++#define WMI_BEACON_EMA_PARAM_TMPL_IDX_SHIFT 8 ++#define WMI_BEACON_EMA_PARAM_FIRST_TMPL_SHIFT 16 ++#define WMI_BEACON_EMA_PARAM_LAST_TMPL_SHIFT 24 ++ + struct wmi_bcn_tmpl_cmd { + u32 tlv_header; + u32 vdev_id; +@@ -5585,6 +5602,8 @@ struct target_resource_config { + u32 sched_params; + u32 twt_ap_pdev_count; + u32 twt_ap_sta_count; ++ u32 ema_max_vap_cnt; ++ u32 ema_max_profile_period; + }; + + enum wmi_tpc_pream_bw { +@@ -5975,7 +5994,7 @@ int ath11k_wmi_qos_null_send(struct ath11k *ar, u32 vdev_id, u32 buf_id, + struct sk_buff *frame); + int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, + struct ieee80211_mutable_offsets *offs, +- struct sk_buff *bcn); ++ struct sk_buff *bcn, u32 ema_param); + int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id); + int ath11k_wmi_vdev_up(struct ath11k *ar, struct vdev_up_params *params); + int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id); +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/225-002-fixes-in-EMA-beacon-transmission-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/225-002-fixes-in-EMA-beacon-transmission-offload.patch new file mode 100644 index 000000000..dc149e4b6 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/225-002-fixes-in-EMA-beacon-transmission-offload.patch @@ -0,0 +1,728 @@ +From 910f0cd7bcb20eacc0bd5c9a6982032589f68024 Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Fri, 23 Oct 2020 17:02:06 -0700 +Subject: [PATCH] ath11k: Fixes in EMA beacon transmission offload + +(1) Firmware crash on non-MBSSID VAP bring up: Fixed by explicitly + setting WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP flag. + Also, the calculation for beacon_tx_offload_max_vdev is changed to + include ema_max_vap_cnt without which FW allocates insufficient + memory for beacons resulting in either a crash or no beacons. + +(2) Only first EMA beacon transmitted: Fixed by using correct index in + function __ieee80211_beacon_get(). + +(3) CSA failure: Current code initiates channel switch only on the + transmitting VAP hence n_reserved gets set to 1, however n_assigned + remains equal number of total VAPs on the radio resulting in + failure in ieee80211_vif_use_reserved_switch(). + This change executes both start and finish for all BSSes. + Also, csa_base_off is changed to include MBSSID element and + MBSSID configuration element lengths, without this the CSA count + is wrong in EMA beacons. + +(4) WMI service bit indicates if MBSSID and EMA device flags should be set + vdev create or start command. This change moves this check from + wmi.c to mac.c file. + +(5) Use offsets, if provided by the application, to include reduced + neighbor report element in EMA beacons. + +Signed-off-by: Aloka Dixit +--- + drivers/net/wireless/ath/ath11k/hw.c | 4 ++ + drivers/net/wireless/ath/ath11k/hw.h | 1 + + drivers/net/wireless/ath/ath11k/mac.c | 68 ++++++++++++++----------- + drivers/net/wireless/ath/ath11k/wmi.c | 21 +++----- + include/net/cfg80211.h | 16 ++++++ + include/uapi/linux/nl80211.h | 37 ++++++++++++++ + net/mac80211/cfg.c | 72 +++++++++++++++++++++++---- + net/mac80211/ieee80211_i.h | 1 + + net/mac80211/iface.c | 5 +- + net/mac80211/tx.c | 34 ++++++++++--- + net/wireless/nl80211.c | 34 +++++++++++++ + 11 files changed, 232 insertions(+), 61 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -144,6 +144,10 @@ static void ath11k_init_wmi_config_ipq80 + config->peer_map_unmap_v2_support = 1; + config->twt_ap_pdev_count = ab->num_radios; + config->twt_ap_sta_count = 1000; ++ config->ema_max_vap_cnt = ab->num_radios; ++ config->ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD; ++ config->beacon_tx_offload_max_vdev += config->ema_max_vap_cnt; ++ + } + + static int ath11k_hw_mac_id_to_pdev_id_ipq8074(struct ath11k_hw_params *hw, +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -78,6 +78,7 @@ + #define TARGET_NUM_WDS_ENTRIES 32 + #define TARGET_DMA_BURST_SIZE 1 + #define TARGET_RX_BATCHMODE 1 ++#define TARGET_EMA_MAX_PROFILE_PERIOD 8 + + #define ATH11K_HW_MAX_QUEUES 4 + #define ATH11K_QUEUE_LEN 4096 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -1097,7 +1097,6 @@ static int __ath11k_mac_setup_bcn_tmpl(s + WMI_BEACON_EMA_PARAM_FIRST_TMPL_SHIFT; + ema_param |= (ema_idx + 1 == ema_cnt ? 1 : 0) << + WMI_BEACON_EMA_PARAM_LAST_TMPL_SHIFT; +- printk("%s:%s[%d]%x\n", __FILE__, __func__, __LINE__, ema_param); + } + + ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn, ema_param); +@@ -1109,7 +1108,44 @@ static int __ath11k_mac_setup_bcn_tmpl(s + return ret; + } + +-static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif) ++static void ath11k_mac_set_dtim_count(struct sk_buff *bcn, u8 *vdev_up_list) ++{ ++ u8 *profile, *next_profile, profile_len; ++ u8 *ies; ++ struct ieee80211_mgmt *mgmt; ++ int ies_len; ++ ++ if (!vdev_up_list) ++ return; ++ ++ ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn); ++ ies += sizeof(mgmt->u.beacon); ++ ies_len = skb_tail_pointer(bcn) - ies; ++ ++ ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ies, ies_len); ++ while (ies) { ++ ies_len -= (2 + ies[1]); ++ profile_len = ies[1] - 1; ++ profile = &ies[3]; ++ while(profile_len) { ++ next_profile = profile + (2 + profile[1]); ++ profile_len -= (2 + profile[1]); ++ ++ profile += (4 + profile[3]); ++ profile += (2 + profile[1]); ++ ++ if (vdev_up_list[profile[2]]) ++ profile[4] = 0x00; ++ ++ profile = next_profile; ++ } ++ ++ ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, profile, ies_len); ++ } ++} ++ ++static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif, ++ u8 *vdev_up_list) + { + struct ath11k *ar = arvif->ar; + struct ieee80211_vif *vif = arvif->vif; +@@ -1125,21 +1161,20 @@ static int ath11k_mac_setup_bcn_tmpl_ema + return -EPERM; + } + +- printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__); + list_for_each_entry(bcn, &bcns, list) { +- printk("%s:%s[%d]%d / %d\n", __FILE__, __func__, __LINE__, idx, cnt); ++ ath11k_mac_set_dtim_count(bcn->skb, vdev_up_list); + ret = __ath11k_mac_setup_bcn_tmpl(arvif, bcn->skb, bcn->offs, idx++, cnt); + if (ret) + break; + } +- printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__); + + ieee80211_beacon_free_ema_list(&bcns); + + return ret; + } + +-static int ath11k_mac_setup_bcn_tmpl_legacy(struct ath11k_vif *arvif) ++static int ath11k_mac_setup_bcn_tmpl_legacy(struct ath11k_vif *arvif, ++ u8 *vdev_up_list) + { + struct ath11k *ar = arvif->ar; + struct ieee80211_mutable_offsets offs = {}; +@@ -1154,6 +1189,7 @@ static int ath11k_mac_setup_bcn_tmpl_leg + return -EPERM; + } + ++ ath11k_mac_set_dtim_count(bcn, vdev_up_list); + ret = __ath11k_mac_setup_bcn_tmpl(arvif, bcn, offs, 0, 0); + + kfree_skb(bcn); +@@ -1163,16 +1199,43 @@ static int ath11k_mac_setup_bcn_tmpl_leg + + static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) + { ++ struct ath11k_vif *pvif = arvif; ++ struct ath11k_vif *cvif = NULL; ++ u8 *vdev_up = NULL, count = 0; ++ int ret = 0; ++ + if (arvif->vdev_type != WMI_VDEV_TYPE_AP) + return 0; + +- if (arvif->vif->multiple_bssid.parent) +- return 0; ++ if (arvif->vif->multiple_bssid.parent) { ++ if (arvif->is_up) ++ return 0; + +- if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) +- return ath11k_mac_setup_bcn_tmpl_ema(arvif); ++ pvif = (struct ath11k_vif *)arvif->vif->multiple_bssid.parent->drv_priv; ++ } ++ ++ count = pvif->vif->bss_conf.multiple_bssid.count; ++ if (count) { ++ list_for_each_entry(cvif, &pvif->ar->arvifs, list) { ++ if (cvif == pvif) ++ continue; + +- return ath11k_mac_setup_bcn_tmpl_legacy(arvif); ++ if ((cvif->vif->multiple_bssid.parent == arvif->vif->multiple_bssid.parent) && ++ cvif->is_up) { ++ if (!vdev_up) ++ vdev_up = kzalloc(count, GFP_KERNEL); ++ vdev_up[cvif->vif->bss_conf.multiple_bssid.index] = 1; ++ } ++ } ++ } ++ ++ if (pvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) ++ ret = ath11k_mac_setup_bcn_tmpl_ema(pvif, vdev_up); ++ else ++ ret = ath11k_mac_setup_bcn_tmpl_legacy(pvif, vdev_up); ++ ++ kfree(vdev_up); ++ return ret; + } + + void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) +@@ -5775,20 +5838,26 @@ ath11k_mac_setup_vdev_create_params(stru + params->subtype = arvif->vdev_subtype; + params->pdev_id = pdev->pdev_id; + params->vdevid_trans = 0; +- if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { +- params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; +- parent = arvif->vif->multiple_bssid.parent; +- if (!parent) +- return -ENOENT; +- if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) +- return -EINVAL; +- params->vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; +- } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { +- params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; +- } + +- if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) +- params->flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ if (!test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) { ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { ++ params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; ++ parent = arvif->vif->multiple_bssid.parent; ++ if (!parent) ++ return -ENOENT; ++ if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) ++ return -EINVAL; ++ params->vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; ++ } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { ++ params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; ++ } else { ++ params->flags = WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP; ++ } ++ ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) ++ params->flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ } + + if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { + params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; +@@ -6419,21 +6488,27 @@ ath11k_mac_vdev_start_restart(struct ath + + arg.channel.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); + +- if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { +- arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; +- parent = arvif->vif->multiple_bssid.parent; +- if (!parent) +- return -ENOENT; +- if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) +- return -EINVAL; +- arg.vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; +- } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { +- arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; +- } ++ if (test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) { ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) { ++ arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; ++ parent = arvif->vif->multiple_bssid.parent; ++ if (!parent) ++ return -ENOENT; ++ if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) ++ return -EINVAL; ++ arg.vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; ++ } else if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { ++ arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; ++ } else { ++ arg.mbss_capability_flags = WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP; ++ } + +- if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) { +- arg.mbss_capability_flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ if (arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_EMA_BEACON) { ++ arg.mbss_capability_flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE; ++ } + } ++ + ath11k_dbg(ab, ATH11K_DBG_MAC, + "mac vdev %d start center_freq %d phymode %s\n", + arg.vdev_id, arg.channel.freq, +@@ -6649,6 +6724,8 @@ ath11k_mac_update_vif_chan(struct ath11k + params.vdev_id = arvif->vdev_id, + params.bssid = arvif->bssid, + params.aid = arvif->aid, ++ params.profile_num = arvif->vif->bss_conf.multiple_bssid.count, ++ params.profile_idx = arvif->vif->bss_conf.multiple_bssid.index, + ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms); + if (ret) { + ath11k_warn(ab, "failed to bring vdev up %d: %d\n", +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -736,12 +736,8 @@ int ath11k_wmi_vdev_create(struct ath11k + cmd->vdev_subtype = param->subtype; + cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; + cmd->pdev_id = param->pdev_id; +- +- if (!test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT, +- ar->ab->wmi_ab.svc_map)) { +- cmd->flags = param->flags; +- cmd->vdevid_trans = param->vdevid_trans; +- } ++ cmd->flags = param->flags; ++ cmd->vdevid_trans = param->vdevid_trans; + + ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); + +@@ -956,6 +952,8 @@ int ath11k_wmi_vdev_start(struct ath11k + cmd->cac_duration_ms = arg->cac_duration_ms; + cmd->regdomain = arg->regdomain; + cmd->he_ops = arg->he_ops; ++ cmd->mbss_capability_flags = arg->mbss_capability_flags; ++ cmd->vdevid_trans = arg->vdevid_trans; + + if (!restart) { + if (arg->ssid) { +@@ -966,12 +964,6 @@ int ath11k_wmi_vdev_start(struct ath11k + cmd->flags |= WMI_VDEV_START_HIDDEN_SSID; + if (arg->pmf_enabled) + cmd->flags |= WMI_VDEV_START_PMF_ENABLED; +- +- if (test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT, +- ar->ab->wmi_ab.svc_map)) { +- cmd->mbss_capability_flags = arg->mbss_capability_flags; +- cmd->vdevid_trans = arg->vdevid_trans; +- } + } + + cmd->flags |= WMI_VDEV_START_LDPC_RX_ENABLED; +@@ -4405,8 +4397,9 @@ int ath11k_wmi_cmd_init(struct ath11k_ba + memset(&init_param, 0, sizeof(init_param)); + memset(&config, 0, sizeof(config)); + +- config.ema_max_vap_cnt = 16; +- config.ema_max_profile_period = 8; ++ config.ema_max_vap_cnt = ab->num_radios; ++ config.ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD; ++ config.beacon_tx_offload_max_vdev += config.ema_max_vap_cnt; + + ab->hw_params.hw_ops->wmi_init_config(ab, &config); + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1066,6 +1066,21 @@ struct cfg80211_multiple_bssid_data { + }; + + /** ++ * struct cfg80211_rnr_data - Reduced neighbor report data ++ * @ies: array of extra information element(s) to add into Beacon frames for ++ * reduced neighbor report or %NULL. ++ * This is used only when EMA (Enhanced multi-BSSID advertisements) feature ++ * is enabled and profile periodicity is more than 1. ++ * @len: array of lengths of RNR elements in octets ++ * @cnt: number of entries ++ */ ++struct cfg80211_rnr_data { ++ u8 *ies[NL80211_RNR_IES_MAX]; ++ size_t len[NL80211_RNR_IES_MAX]; ++ u8 cnt; ++}; ++ ++/** + * struct cfg80211_beacon_data - beacon data + * @head: head portion of beacon (before TIM IE) + * or %NULL if not changed +@@ -1113,6 +1128,7 @@ struct cfg80211_beacon_data { + size_t civicloc_len; + + struct cfg80211_multiple_bssid_data multiple_bssid; ++ struct cfg80211_rnr_data rnr; + }; + + struct mac_address { +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -2626,6 +2626,17 @@ enum nl80211_commands { + * @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_C_OFF_PRESP: An array of offsets (u16) to the color + switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). + * ++ * @NL80211_ATTR_RNR_OFFSETS: Offsets for Reduced neighbor element (RNR) of ++ * type &enum nl80211_rnr_ies_attributes. ++ * RNR is split into multiple groups when EMA (Enhanced multi-BSSID ++ * advertisements) feature is enabled. Each group excludes the profiles ++ * already included in MBSSID group (%NL80211_ATTR_MULTIPLE_BSSID_IES) at ++ * the same index. Each EMA beacon will be generated by adding MBSSID and ++ * RNR groups at the same index. ++ * The last additional RNR group, if present, points to information ++ * for co-located APs and neighbor APs in ESS to be added in all ++ * EMA beacons. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3137,6 +3148,8 @@ enum nl80211_attrs { + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, + NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, + ++ NL80211_ATTR_RNR_OFFSETS, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -3201,6 +3214,7 @@ enum nl80211_attrs { + #define NL80211_CQM_TXE_MAX_INTVL 1800 + + #define NL80211_MULTIPLE_BSSID_IES_MAX 8 ++#define NL80211_RNR_IES_MAX (NL80211_MULTIPLE_BSSID_IES_MAX + 1) + + /** + * enum nl80211_iftype - (virtual) interface types +@@ -7266,6 +7280,29 @@ enum nl80211_unsol_bcast_probe_resp_attr + }; + + /** ++ * enum nl80211_rnr_ies_attributes - Reduced neighbor report (RNR) offsets. ++ * Used only when enhanced multi-BSSID advertisements (EMA) are enabled. ++ * ++ * @__NL80211_RNR_IES_ATTR_INVALID: Invalid ++ * ++ * @NL80211_RNR_IES_ATTR_COUNT: Count of RNR offsets ++ * ++ * @NL80211_RNR_IES_ATTR_COUNT: RNR offsets and length for each. ++ * ++ * @__NL80211_RNR_IES_ATTR_LAST: Internal ++ * @NL80211_RNR_IES_ATTR_MAX: highest attribute ++ */ ++enum nl80211_rnr_ies_attributes { ++ __NL80211_RNR_IES_ATTR_INVALID, ++ ++ NL80211_RNR_IES_ATTR_COUNT, ++ NL80211_RNR_IES_ATTR_DATA, ++ ++ /* keep last */ ++ __NL80211_RNR_IES_ATTR_LAST, ++ NL80211_RNR_IES_ATTR_MAX = __NL80211_RNR_IES_ATTR_LAST - 1 ++}; ++/** + * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE + * derivation. Applicable only when WPA3-Personal SAE authentication is + * used. +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -175,19 +175,26 @@ static struct wireless_dev *ieee80211_ad + static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) + { + struct ieee80211_sub_if_data *sdata; ++ struct ieee80211_local *local; + + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); ++ local = sdata->local; + if (sdata && sdata->vif.type == NL80211_IFTYPE_AP) { + if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { +- struct ieee80211_sub_if_data *child; ++ struct ieee80211_sub_if_data *child, *tmp; + +- rcu_read_lock(); +- list_for_each_entry_rcu(child, &sdata->local->interfaces, list) +- if (child->vif.multiple_bssid.parent == &sdata->vif) ++ wiphy_unlock(local->hw.wiphy); ++ mutex_lock(&local->iflist_mtx); ++ list_for_each_entry_safe(child, tmp, ++ &local->interfaces, list) ++ if ((child->vif.multiple_bssid.parent == &sdata->vif) && ++ ieee80211_sdata_running(child)) + dev_close(child->wdev.netdev); +- rcu_read_unlock(); ++ mutex_unlock(&local->iflist_mtx); ++ wiphy_lock(local->hw.wiphy); + } else { + sdata->vif.multiple_bssid.parent = NULL; ++ sdata->vif.multiple_bssid.flags = 0; + } + } + +@@ -1018,6 +1025,27 @@ static u8 *ieee80211_copy_multiple_bssid + return offset; + } + ++static int ieee80211_get_rnr_beacon_len(struct cfg80211_rnr_data *data) ++{ ++ int i, len = 0; ++ for (i = 0; i < data->cnt; i++) ++ len += data->len[i]; ++ return len; ++} ++ ++static u8 *ieee80211_copy_rnr_beacon(u8 *offset, struct cfg80211_rnr_data *new, ++ struct cfg80211_rnr_data *old) ++{ ++ int i; ++ *new = *old; ++ for (i = 0; i < new->cnt; i++) { ++ new->ies[i] = offset; ++ memcpy(new->ies[i], old->ies[i], new->len[i]); ++ offset += new->len[i]; ++ } ++ return offset; ++} ++ + static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, + struct cfg80211_beacon_data *params, + const struct ieee80211_csa_settings *csa, +@@ -1030,6 +1058,7 @@ static int ieee80211_assign_beacon(struc + struct ieee80211_he_operation *he_oper = NULL; + int size, err; + u32 changed = BSS_CHANGED_BEACON; ++ int new_rnr_len = 0; + + old = sdata_dereference(sdata->u.ap.beacon, sdata); + +@@ -1059,7 +1088,11 @@ static int ieee80211_assign_beacon(struc + new_multiple_bssid_len = + ieee80211_get_multiple_bssid_beacon_len(&old->multiple_bssid); + +- size = sizeof(*new) + new_head_len + new_tail_len + new_multiple_bssid_len; ++ if (params->rnr.cnt) ++ new_rnr_len = ieee80211_get_rnr_beacon_len(¶ms->rnr); ++ ++ size = sizeof(*new) + new_head_len + new_tail_len + ++ new_multiple_bssid_len + new_rnr_len; + + new = kzalloc(size, GFP_KERNEL); + if (!new) +@@ -1088,6 +1121,14 @@ static int ieee80211_assign_beacon(struc + &new->multiple_bssid, + &old->multiple_bssid); + ++ if (params->rnr.cnt) { ++ ieee80211_copy_rnr_beacon(new_multiple_bssid_offset + ++ new_multiple_bssid_len, &new->rnr, ++ ¶ms->rnr); ++ } ++ else if (old && old->rnr.cnt) ++ old->rnr.cnt = 0; ++ + if (csa) { + new->cntdwn_current_counter = csa->count; + memcpy(new->cntdwn_counter_offsets, csa->counter_offsets_beacon, +@@ -3241,6 +3282,20 @@ void ieee80211_csa_finish(struct ieee802 + { + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + ++ if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_TRANSMITTING) { ++ struct ieee80211_sub_if_data *child, *tmp; ++ wiphy_unlock(sdata->local->hw.wiphy); ++ mutex_lock(&sdata->local->iflist_mtx); ++ list_for_each_entry_safe(child, tmp, ++ &sdata->local->interfaces, list) ++ if (child->vif.multiple_bssid.parent == &sdata->vif && ++ ieee80211_sdata_running(child)) ++ ieee80211_queue_work(&child->local->hw, ++ &child->csa_finalize_work); ++ mutex_unlock(&sdata->local->iflist_mtx); ++ wiphy_lock(sdata->local->hw.wiphy); ++ } ++ + ieee80211_queue_work(&sdata->local->hw, + &sdata->csa_finalize_work); + } +@@ -3546,9 +3601,6 @@ __ieee80211_channel_switch(struct wiphy + if (sdata->vif.csa_active) + return -EBUSY; + +- if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) +- return -EINVAL; +- + mutex_lock(&local->chanctx_mtx); + conf = rcu_dereference_protected(sdata->vif.chanctx_conf, + lockdep_is_held(&local->chanctx_mtx)); +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -275,6 +275,7 @@ struct beacon_data { + u8 cntdwn_current_counter; + struct cfg80211_multiple_bssid_data multiple_bssid; + u16 ema_index; ++ struct cfg80211_rnr_data rnr; + struct rcu_head rcu_head; + }; + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -383,8 +383,11 @@ static void ieee80211_do_stop(struct iee + /* make sure the parent is already down */ + if (sdata->vif.type == NL80211_IFTYPE_AP && + sdata->vif.multiple_bssid.parent && +- ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent))) ++ ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent))) { ++ wiphy_unlock(sdata->local->hw.wiphy); + dev_close(vif_to_sdata(sdata->vif.multiple_bssid.parent)->wdev.netdev); ++ wiphy_lock(sdata->local->hw.wiphy); ++ } + + clear_bit(SDATA_STATE_RUNNING, &sdata->state); + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -4831,7 +4831,7 @@ __ieee80211_beacon_get(struct ieee80211_ + + beacon = rcu_dereference(ap->beacon); + if (beacon) { +- int multiple_bssid_len = 0; ++ int multiple_bssid_len = 0, rnr_len = 0; + + if (beacon->cntdwn_counter_offsets[0]) { + if (!is_template) +@@ -4853,6 +4853,13 @@ __ieee80211_beacon_get(struct ieee80211_ + if (beacon->multiple_bssid.cnt) { + if (ema_index >= IEEE80211_BCN_EMA_INDEX) { + multiple_bssid_len = beacon->multiple_bssid.len[ema_index]; ++ if (beacon->rnr.cnt) { ++ int i; ++ rnr_len = beacon->rnr.len[ema_index]; ++ for (i = beacon->multiple_bssid.cnt; i < beacon->rnr.cnt; i++) { ++ rnr_len += beacon->rnr.len[i]; ++ } ++ } + } else { + int i; + +@@ -4869,7 +4876,7 @@ __ieee80211_beacon_get(struct ieee80211_ + beacon->head_len + + beacon->tail_len + 256 + + local->hw.extra_beacon_tailroom + +- multiple_bssid_len); ++ multiple_bssid_len + rnr_len); + if (!skb) + return NULL; + +@@ -4893,8 +4900,19 @@ __ieee80211_beacon_get(struct ieee80211_ + ieee80211_beacon_add_multiple_bssid_config(vif, skb, + &beacon->multiple_bssid); + skb_put_data(skb, +- beacon->multiple_bssid.ies[beacon->ema_index], +- beacon->multiple_bssid.len[beacon->ema_index]); ++ beacon->multiple_bssid.ies[ema_index], ++ beacon->multiple_bssid.len[ema_index]); ++ ++ if (rnr_len) { ++ int i; ++ skb_put_data(skb, beacon->rnr.ies[ema_index], ++ beacon->rnr.len[ema_index]); ++ for (i = beacon->multiple_bssid.cnt; ++ i < beacon->rnr.cnt; i++) { ++ skb_put_data(skb, beacon->rnr.ies[i], ++ beacon->rnr.len[i]); ++ } ++ } + } else { + int i; + +@@ -4902,8 +4920,12 @@ __ieee80211_beacon_get(struct ieee80211_ + skb_put_data(skb, beacon->multiple_bssid.ies[i], + beacon->multiple_bssid.len[i]); + } +- if (offs) +- offs->multiple_bssid_offset = skb->len - multiple_bssid_len; ++ if (offs) { ++ offs->multiple_bssid_offset = skb->len - ++ (multiple_bssid_len + rnr_len); ++ csa_off_base = skb->len; ++ } ++ + } + + if (beacon->tail) +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -443,6 +443,13 @@ sar_policy[NL80211_SAR_ATTR_MAX + 1] = { + [NL80211_SAR_ATTR_SPECS] = NLA_POLICY_NESTED_ARRAY(sar_specs_policy), + }; + ++static const struct nla_policy ++nl80211_rnr_ies_policy[NL80211_RNR_IES_MAX + 1] = { ++ [NL80211_RNR_IES_ATTR_COUNT] = NLA_POLICY_MAX(NLA_U8, ++ NL80211_RNR_IES_MAX), ++ [NL80211_RNR_IES_ATTR_DATA] = { .type = NLA_NESTED } ++}; ++ + static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { + [0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD }, + [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, +@@ -789,6 +796,7 @@ static const struct nla_policy nl80211_p + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT] = { .type = NLA_U8 }, + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES] = NLA_POLICY_NESTED(nl80211_policy), ++ [NL80211_ATTR_RNR_OFFSETS] = NLA_POLICY_NESTED(nl80211_rnr_ies_policy), + }; + + /* policy for the key attributes */ +@@ -5104,6 +5112,32 @@ static int nl80211_parse_beacon(struct c + else + bcn->bss_color_info = 0; + ++ if (attrs[NL80211_ATTR_RNR_OFFSETS]) { ++ struct nlattr *nl_ie, *tb[NL80211_RNR_IES_ATTR_MAX + 1]; ++ int rem_ie, ret; ++ u8 i = 0; ++ ++ ret = nla_parse_nested(tb, NL80211_RNR_IES_ATTR_MAX, ++ attrs[NL80211_ATTR_RNR_OFFSETS], ++ NULL, NULL); ++ if (ret) ++ return ret; ++ ++ if (!tb[NL80211_RNR_IES_ATTR_COUNT] || ++ !tb[NL80211_RNR_IES_ATTR_DATA]) ++ return -EINVAL; ++ ++ bcn->rnr.cnt = nla_get_u8(tb[NL80211_RNR_IES_ATTR_COUNT]); ++ if (bcn->rnr.cnt > NL80211_RNR_IES_MAX) ++ return -EINVAL; ++ ++ nla_for_each_nested(nl_ie, tb[NL80211_RNR_IES_ATTR_DATA], rem_ie) { ++ bcn->rnr.ies[i] = nla_data(nl_ie); ++ bcn->rnr.len[i] = nla_len(nl_ie); ++ i++; ++ } ++ } ++ + return 0; + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/225-fix-channel-ctx-call-trace-in-monitor.patch b/feeds/wifi-ax/mac80211/patches/qca/225-fix-channel-ctx-call-trace-in-monitor.patch new file mode 100644 index 000000000..42a23ba64 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/225-fix-channel-ctx-call-trace-in-monitor.patch @@ -0,0 +1,87 @@ +Subject: [PATCH] ath11k: fix channel ctx call trace in monitor + +Channel context not created in the radio, so that monitor vdev +start failed due to channel context null. + +Call Trace: + +------------[ cut here ]------------ +WARNING: CPU: 1 PID: 3216 at /local/mnt/workspace/periyasa/4_4_ipq6018_27Oct2020/qsdk/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq60xx/backports-20200908-4.4.60-9a94b73e75/drivers/net/wireless/ath/ath11k/mac.c:807 ath11k_mac_op_add_chanctx+0x5a0/0x86c [ath11k]() +Modules linked in: ath9k ath9k_common iptable_nat ath9k_hw ath11k_pci ath11k_ahb ath11k ath10k_pci ath10k_core ath nf_nat_pptp nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp nf_conntrack_ipv4 nf_conntrack_amanda mac80211 ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss +CPU: 0 PID: 3216 Comm: ifconfig Not tainted 4.4.60 #11 +Hardware name: Generic DT based system +[<80116dac>] (unwind_backtrace) from [<80113700>] (show_stack+0x10/0x14) +[<80113700>] (show_stack) from [<80317eb4>] (dump_stack+0x7c/0x9c) +[<80317eb4>] (dump_stack) from [<801239e0>] (warn_slowpath_common+0x80/0xac) +[<801239e0>] (warn_slowpath_common) from [<80123a9c>] (warn_slowpath_null+0x18/0x20) +[<80123a9c>] (warn_slowpath_null) from [] (ath11k_mac_op_add_chanctx+0x5a0/0x86c [ath11k]) +[] (ath11k_mac_op_add_chanctx [ath11k]) from [] (ath11k_mac_op_unassign_vif_chanctx+0x368/0x64c [ath11k]) +[] (ath11k_mac_op_unassign_vif_chanctx [ath11k]) from [] (ath11k_mac_op_config+0x78/0x1c4 [ath11k]) +[] (ath11k_mac_op_config [ath11k]) from [] (ieee80211_hw_config+0x23c/0x2c0 [mac80211]) +[] (ieee80211_hw_config [mac80211]) from [] (ieee80211_do_open+0x688/0x8cc [mac80211]) +[] (ieee80211_do_open [mac80211]) from [<8054969c>] (__dev_open+0xa0/0xf4) +[<8054969c>] (__dev_open) from [<805498e8>] (__dev_change_flags+0x8c/0x130) +[<805498e8>] (__dev_change_flags) from [<805499a4>] (dev_change_flags+0x18/0x48) +[<805499a4>] (dev_change_flags) from [<805acb10>] (devinet_ioctl+0x2d8/0x648) +[<805acb10>] (devinet_ioctl) from [<8052e5ac>] (sock_ioctl+0x224/0x278) +[<8052e5ac>] (sock_ioctl) from [<801f3204>] (do_vfs_ioctl+0x4f0/0x5b0) +[<801f3204>] (do_vfs_ioctl) from [<801f32f8>] (SyS_ioctl+0x34/0x5c) +[<801f32f8>] (SyS_ioctl) from [<80101b80>] (ret_fast_syscall+0x0/0x34) +---[ end trace 9a32f5c3b9a0b9bd ]--- +ath11k c000000.wifi: failed to start monitor vdev: -2 + +Signed-off-by: Karthikeyan Periyasamy +--- +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -766,25 +766,19 @@ static inline int ath11k_mac_vdev_setup_ + return ar->last_wmi_vdev_start_status ? -EINVAL : 0; + } + +-static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id) ++static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id, ++ struct cfg80211_chan_def *chandef) + { + struct vdev_up_params params = { + .vdev_id = vdev_id, + .bssid = ar->mac_addr, + }; +- struct cfg80211_chan_def *chandef = NULL; + struct ieee80211_channel *channel = NULL; + struct wmi_vdev_start_req_arg arg = {}; + int ret = 0; + + lockdep_assert_held(&ar->conf_mutex); + +- ieee80211_iter_chan_contexts_atomic(ar->hw, +- ath11k_mac_get_any_chandef_iter, +- &chandef); +- +- if (WARN_ON_ONCE(!chandef)) +- return -ENOENT; + channel = chandef->chan; + arg.vdev_id = vdev_id; + arg.channel.freq = channel->center_freq; +@@ -979,6 +973,7 @@ static int ath11k_mac_monitor_vdev_delet + + static int ath11k_mac_monitor_start(struct ath11k *ar) + { ++ struct cfg80211_chan_def *chandef = NULL; + int ret; + + lockdep_assert_held(&ar->conf_mutex); +@@ -986,7 +981,13 @@ static int ath11k_mac_monitor_start(stru + if (ar->monitor_started) + return 0; + +- ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id); ++ ieee80211_iter_chan_contexts_atomic(ar->hw, ++ ath11k_mac_get_any_chandef_iter, ++ &chandef); ++ if (!chandef) ++ return 0; ++ ++ ret = ath11k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id, chandef); + if (ret) { + ath11k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); + ath11k_mac_monitor_vdev_delete(ar); diff --git a/feeds/wifi-ax/mac80211/patches/qca/226-th11k-Update-CE-DP-irq-names-during-registration-fo.patch b/feeds/wifi-ax/mac80211/patches/qca/226-th11k-Update-CE-DP-irq-names-during-registration-fo.patch new file mode 100644 index 000000000..359f6cd05 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/226-th11k-Update-CE-DP-irq-names-during-registration-fo.patch @@ -0,0 +1,195 @@ +From 678c239bbcf06ac54ecdbc34f9299619875b8e7c Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Thu, 12 Nov 2020 17:24:50 +0530 +Subject: [PATCH] ath11k: Update CE/DP irq names during registration for + affinity setup + +Update the ce and dp irq names based on pci domain id and irq idx or group +so that these could be displayed appropriately in proc/interrupts and can +also aid in defining the affinity settings for them based on name. + +This patch got missed during mac80211 package upgrade. Since +irq names are not registered, SMP affinities are not configured +properly. This results low throughput and high single core usage +in KPI testing. + +Fix: (I99e478c - mac80211: Package upgrade) + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/pci.c | 88 ++++++++++++++--------------------- + drivers/net/wireless/ath/ath11k/pci.h | 30 ++++++++++++ + 2 files changed, 64 insertions(+), 54 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -76,58 +76,16 @@ static const struct ath11k_msi_config at + }, + }; + +-static const char *irq_name[ATH11K_IRQ_NUM_MAX] = { +- "bhi", +- "mhi-er0", +- "mhi-er1", +- "ce0", +- "ce1", +- "ce2", +- "ce3", +- "ce4", +- "ce5", +- "ce6", +- "ce7", +- "ce8", +- "ce9", +- "ce10", +- "ce11", +- "host2wbm-desc-feed", +- "host2reo-re-injection", +- "host2reo-command", +- "host2rxdma-monitor-ring3", +- "host2rxdma-monitor-ring2", +- "host2rxdma-monitor-ring1", +- "reo2ost-exception", +- "wbm2host-rx-release", +- "reo2host-status", +- "reo2host-destination-ring4", +- "reo2host-destination-ring3", +- "reo2host-destination-ring2", +- "reo2host-destination-ring1", +- "rxdma2host-monitor-destination-mac3", +- "rxdma2host-monitor-destination-mac2", +- "rxdma2host-monitor-destination-mac1", +- "ppdu-end-interrupts-mac3", +- "ppdu-end-interrupts-mac2", +- "ppdu-end-interrupts-mac1", +- "rxdma2host-monitor-status-ring-mac3", +- "rxdma2host-monitor-status-ring-mac2", +- "rxdma2host-monitor-status-ring-mac1", +- "host2rxdma-host-buf-ring-mac3", +- "host2rxdma-host-buf-ring-mac2", +- "host2rxdma-host-buf-ring-mac1", +- "rxdma2host-destination-ring-mac3", +- "rxdma2host-destination-ring-mac2", +- "rxdma2host-destination-ring-mac1", +- "host2tcl-input-ring4", +- "host2tcl-input-ring3", +- "host2tcl-input-ring2", +- "host2tcl-input-ring1", +- "wbm2host-tx-completions-ring3", +- "wbm2host-tx-completions-ring2", +- "wbm2host-tx-completions-ring1", +- "tcl2host-status-ring", ++const char *ce_irq_name[ATH11K_MAX_PCI_DOMAINS + 1][CE_COUNT_MAX] = { ++ { ++ ATH11K_PCI_CE_IRQS_NAME(0) ++ }, ++ { ++ ATH11K_PCI_CE_IRQS_NAME(1) ++ }, ++ { ++ ATH11K_PCI_CE_IRQS_NAME() ++ }, + }; + + static inline void ath11k_pci_select_window(struct ath11k_pci *ab_pci, u32 offset) +@@ -537,6 +495,18 @@ static int ath11k_get_user_msi_assignmen + base_vector); + } + ++const char *dp_irq_name[ATH11K_MAX_PCI_DOMAINS + 1][ATH11K_EXT_IRQ_GRP_NUM_MAX] = { ++ { ++ ATH11K_PCI_DP_IRQS_NAME(0) ++ }, ++ { ++ ATH11K_PCI_DP_IRQS_NAME(1) ++ }, ++ { ++ ATH11K_PCI_DP_IRQS_NAME() ++ }, ++}; ++ + static void ath11k_pci_free_ext_irq(struct ath11k_base *ab) + { + int i, j; +@@ -730,6 +700,11 @@ static int ath11k_pci_ext_irq_config(str + { + int i, j, ret, num_vectors = 0; + u32 user_base_data = 0, base_vector = 0, base_idx; ++ struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); ++ u8 domain_id = pci_domain_nr(ar_pci->pdev->bus); ++ ++ if (domain_id > ATH11K_MAX_PCI_DOMAINS) ++ domain_id = ATH11K_MAX_PCI_DOMAINS; + + base_idx = ATH11K_PCI_IRQ_CE0_OFFSET + CE_COUNT_MAX; + ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP", +@@ -781,7 +756,7 @@ static int ath11k_pci_ext_irq_config(str + irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); + ret = request_irq(irq, ath11k_pci_ext_interrupt_handler, + IRQF_SHARED, +- "DP_EXT_IRQ", irq_grp); ++ dp_irq_name[domain_id][i], irq_grp); + if (ret) { + ath11k_err(ab, "failed request irq %d: %d\n", + vector, ret); +@@ -803,6 +778,11 @@ static int ath11k_pci_config_irq(struct + u32 msi_irq_start; + unsigned int msi_data; + int irq, i, ret, irq_idx; ++ struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); ++ u8 domain_id = pci_domain_nr(ar_pci->pdev->bus); ++ ++ if (domain_id > ATH11K_MAX_PCI_DOMAINS) ++ domain_id = ATH11K_MAX_PCI_DOMAINS; + + ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), + "CE", &msi_data_count, +@@ -824,7 +804,7 @@ static int ath11k_pci_config_irq(struct + tasklet_setup(&ce_pipe->intr_tq, ath11k_pci_ce_tasklet); + + ret = request_irq(irq, ath11k_pci_ce_interrupt_handler, +- IRQF_SHARED, irq_name[irq_idx], ++ IRQF_SHARED, ce_irq_name[domain_id][i], + ce_pipe); + if (ret) { + ath11k_err(ab, "failed to request irq %d: %d\n", +--- a/drivers/net/wireless/ath/ath11k/pci.h ++++ b/drivers/net/wireless/ath/ath11k/pci.h +@@ -53,6 +53,36 @@ + #define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c + #define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4 + ++#define STR_CONV(str) #str ++ ++#define ATH11K_PCI_DP_IRQS_NAME(x) \ ++ STR_CONV(pci##x##_wbm2host_tx_completions_ring1),\ ++ STR_CONV(pci##x##_wbm2host_tx_completions_ring2),\ ++ STR_CONV(pci##x##_wbm2host_tx_completions_ring3),\ ++ STR_CONV(pci##x##_lmac_reo_misc_irq),\ ++ STR_CONV(pci##x##_reo2host_destination_ring1),\ ++ STR_CONV(pci##x##_reo2host_destination_ring2),\ ++ STR_CONV(pci##x##_reo2host_destination_ring3),\ ++ STR_CONV(pci##x##_reo2host_destination_ring4),\ ++ /* Currently only 8 msi are registered */ \ ++ STR_CONV(pci##x##_dp_res1),\ ++ STR_CONV(pci##x##_dp_res2),\ ++ STR_CONV(pci##x##_dp_res3),\ ++ ++#define ATH11K_PCI_CE_IRQS_NAME(x) \ ++ STR_CONV(pci##x##_ce0),\ ++ STR_CONV(pci##x##_ce1),\ ++ STR_CONV(pci##x##_ce2),\ ++ STR_CONV(pci##x##_ce3),\ ++ STR_CONV(pci##x##_ce4),\ ++ STR_CONV(pci##x##_ce5),\ ++ STR_CONV(pci##x##_ce6),\ ++ STR_CONV(pci##x##_ce7),\ ++ STR_CONV(pci##x##_ce8),\ ++ STR_CONV(pci##x##_ce9),\ ++ STR_CONV(pci##x##_ce10),\ ++ STR_CONV(pci##x##_ce11),\ ++ + struct ath11k_msi_user { + char *name; + int num_vectors; diff --git a/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-Assign-free_vdev_map-before-ieee80211_registe.patch b/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-Assign-free_vdev_map-before-ieee80211_registe.patch new file mode 100644 index 000000000..8a8b48127 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-Assign-free_vdev_map-before-ieee80211_registe.patch @@ -0,0 +1,36 @@ +From 4dc2dd99dc07fdecfd2a191b1efdc8de90e4f3b7 Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 18 Nov 2020 12:48:46 +0530 +Subject: [PATCH] ath11k: Assign free_vdev_map value before ieee80211_register_hw + +Firmware crash is seen sometimes, because of sending wrong vdev_id +in vdev_create command. This is due to free_vdev_map value being 0. +free_vdev_map is getting assigned after ieee80211_register_hw. In +some race conditions, add_interface api is getting called before +assigning value to free_vdev_map. Fix this by assigning free_vdev_map +before ieee80211_register_hw. + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/mac.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8502,6 +8502,8 @@ int ath11k_mac_register(struct ath11k_ba + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + return 0; + ++ ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1; ++ + for (i = 0; i < ab->num_radios; i++) { + pdev = &ab->pdevs[i]; + ar = pdev->ar; +@@ -8522,7 +8524,6 @@ int ath11k_mac_register(struct ath11k_ba + + /* Initialize channel counters frequency value in hertz */ + ab->cc_freq_hz = IPQ8074_CC_FREQ_HERTZ; +- ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1; + + return 0; + diff --git a/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-fix-q6-crash-in-authorize.patch b/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-fix-q6-crash-in-authorize.patch new file mode 100644 index 000000000..74f87b84b --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/227-ath11k-fix-q6-crash-in-authorize.patch @@ -0,0 +1,39 @@ +From: Karthikeyan Periyasamy +Subject: [PATCH] ath11k: fix q6 crash in authorize + +Signed-off-by: Karthikeyan Periyasamy +--- +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -2613,14 +2613,6 @@ static void ath11k_bss_assoc(struct ieee + return; + } + +- /* Authorize BSS Peer */ +- ret = ath11k_wmi_set_peer_param(ar, arvif->bssid, +- arvif->vdev_id, +- WMI_PEER_AUTHORIZE, +- 1); +- if (ret) +- ath11k_warn(ar->ab, "Unable to authorize BSS peer: %d\n", ret); +- + ret = ath11k_wmi_send_obss_spr_cmd(ar, arvif->vdev_id, + &bss_conf->he_obss_pd); + if (ret) +@@ -4486,6 +4478,16 @@ static int ath11k_mac_op_sta_state(struc + ath11k_warn(ar->ab, "Failed to associate station: %pM\n", + sta->addr); + } else if (old_state == IEEE80211_STA_ASSOC && ++ new_state == IEEE80211_STA_AUTHORIZED && ++ vif->type == NL80211_IFTYPE_STATION) { ++ ret = ath11k_wmi_set_peer_param(ar, sta->addr, ++ arvif->vdev_id, ++ WMI_PEER_AUTHORIZE, ++ 1); ++ if (ret) ++ ath11k_warn(ar->ab, "Unable to authorize peer (%pM) vdev %d: %d\n", ++ sta->addr, arvif->vdev_id, ret); ++ } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH && + (vif->type == NL80211_IFTYPE_AP || + vif->type == NL80211_IFTYPE_MESH_POINT || diff --git a/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-add-debugfs-support-to-get-power-save-state-change-and-power-save-duration-of-STA.patch b/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-add-debugfs-support-to-get-power-save-state-change-and-power-save-duration-of-STA.patch new file mode 100644 index 000000000..50c751774 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-add-debugfs-support-to-get-power-save-state-change-and-power-save-duration-of-STA.patch @@ -0,0 +1,644 @@ +From 9999ec48cadf1a6b25d608dbad8f7e66bbd2747d Mon Sep 17 00:00:00 2001 +From: Nishant Pandey +Date: Sat, 28 Nov 2020 20:52:18 +0530 +Subject: [PATCH] ath11k: Add power save state change and power_save_duration + in the debugfs for each client. + +This patch adds support to get the below power_save information +of each connected peer to AP. With WMI_PEER_STA_PS_STATECHG_EVENTID +event, below power save information is reported to user space via +debugfs. + +Use the below commands in AP DUT to get the above power_save information. + +To get the ps state of each sta: +cat /sys/kernel/debug/ieee80211/phyX/netdev::wlanX/stations/ +XX:XX:XX:XX:XX:XX/peer_ps_state + +If STA is in power save state, we get the peer_ps_state value as 1. +if STA is not in power save state, we get the peer_ps_state value as 0. +If ps_state event is disabled, we get the peer_ps_state value as 2. + +We can enable/disable the ps_state events using the debugfs flag +"ps_state_enable" + +echo Y > /sys/kernel/debug/ieee80211/phyX/ath11k/ps_state_enable + +Y = 1 to enable and Y = 0 to disable +1.power_save_duration +2.time_since_station_in_power_save and +3.PS timekeeper to show a timeline about all PS state changes coming to AP, +with each event having information about MAC address of the peer connected, +Timestamp (real system time to milli seconds granularity) and +power save state. + +To know the time_since_station_in_power_save: +cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ +XX:XX:XX:XX:XX:XX/current_ps_duration + +To know power_save_duration: +cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ +XX:XX:XX:XX:XX:XX/total_ps_duration + +To reset the power_save_duration of all stations connected to AP: +echo 1 > /sys/kernel/debug/ieee80211/phyX/ath11k/reset_ps_duration + +To enable/disable the ps_timekeeper: +echo Y > /sys/kernel/debug/ieee80211/phyX/ath11k/ps_timekeeper_enable +Y = 1 to enable and Y = 0 to disable. + +To record PS timekeeer logs after enabling ps_timekeeper: +trace-cmd record -e ath11k_ps_timekeeper + +Signed-off-by: Nishant Pandey +--- + drivers/net/wireless/ath/ath11k/core.h | 12 ++ + drivers/net/wireless/ath/ath11k/debugfs.c | 215 ++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 106 +++++++++++++ + drivers/net/wireless/ath/ath11k/mac.c | 1 + + drivers/net/wireless/ath/ath11k/trace.h | 25 +++ + drivers/net/wireless/ath/ath11k/wmi.c | 82 ++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 21 +++ + 7 files changed, 462 insertions(+) + +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/core.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.h +@@ -424,6 +424,12 @@ struct ath11k_sta { + struct ath11k_nss_sta_stats *nss_stats; + #endif + u16 tcl_metadata; ++ /* Protected with ar->data_lock */ ++ u32 peer_ps_state; ++ u32 ps_start_time; ++ u32 ps_start_jiffies; ++ u8 peer_current_ps_valid; ++ u32 ps_total_duration; + }; + + #define ATH11K_MIN_5G_FREQ 4150 +@@ -680,6 +686,11 @@ struct ath11k { + enum ath11k_ap_ps_state ap_ps_state; + + bool monitor_vdev_created; ++ ++ /* protected by conf_mutex */ ++ u8 ps_state_enable; ++ u8 ps_timekeeper_enable; ++ u8 reset_ps_duration; + }; + + struct ath11k_band_cap { +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/debugfs.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1782,6 +1782,207 @@ static const struct file_operations fops + .open = simple_open + }; + ++static ssize_t ath11k_write_ps_timekeeper_enable(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ ssize_t ret; ++ u8 ps_timekeeper_enable; ++ ++ if (kstrtou8_from_user(user_buf, count, 0, &ps_timekeeper_enable)) ++ return -EINVAL; ++ ++ if (ps_timekeeper_enable > 1) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ if (!ar->ps_state_enable) { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ if (ar->ps_timekeeper_enable == ps_timekeeper_enable) { ++ ret = count; ++ goto exit; ++ } ++ ++ ar->ps_timekeeper_enable = ps_timekeeper_enable; ++ ret = count; ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ ++ return ret; ++} ++ ++static ssize_t ath11k_read_ps_timekeeper_enable(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ char buf[32]; ++ ++ mutex_lock(&ar->conf_mutex); ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ ar->ps_timekeeper_enable); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_ps_timekeeper_enable = { ++ .read = ath11k_read_ps_timekeeper_enable, ++ .write = ath11k_write_ps_timekeeper_enable, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static void ath11k_reset_peer_ps_duration(void *data, struct ieee80211_sta *sta) ++{ ++ struct ath11k *ar = data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ ++ spin_lock_bh(&ar->data_lock); ++ arsta->ps_total_duration = WMI_PEER_RESET_PS_DURATION; ++ spin_unlock_bh(&ar->data_lock); ++} ++ ++static ssize_t ath11k_write_reset_ps_duration(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int ret; ++ u8 reset_ps_duration; ++ ++ if (kstrtou8_from_user(user_buf, count, 0, &reset_ps_duration)) ++ return -EINVAL; ++ ++ if (reset_ps_duration != 1) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ if (!ar->ps_state_enable) { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ar->reset_ps_duration = reset_ps_duration; ++ ieee80211_iterate_stations_atomic(ar->hw, ++ ath11k_reset_peer_ps_duration, ++ ar); ++ ++ ret = count; ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_reset_ps_duration = { ++ .write = ath11k_write_reset_ps_duration, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static void ath11k_peer_ps_state_disable(void *data, ++ struct ieee80211_sta *sta) ++{ ++ struct ath11k *ar = data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ ++ spin_lock_bh(&ar->data_lock); ++ arsta->peer_ps_state = WMI_PEER_PS_STATE_DISABLED; ++ arsta->ps_start_time = WMI_PEER_RESET_PS_TIME; ++ arsta->ps_total_duration = WMI_PEER_RESET_PS_DURATION; ++ spin_unlock_bh(&ar->data_lock); ++} ++ ++static ssize_t ath11k_write_ps_state_enable(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ struct ath11k_pdev *pdev = ar->pdev; ++ int ret; ++ u32 param; ++ u8 ps_state_enable; ++ ++ if (kstrtou8_from_user(user_buf, count, 0, &ps_state_enable)) ++ return -EINVAL; ++ ++ if (ps_state_enable > 1 || ps_state_enable < 0) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->ps_state_enable == ps_state_enable) { ++ ret = count; ++ goto exit; ++ } ++ ++ param = WMI_PDEV_PEER_STA_PS_STATECHG_ENABLE; ++ ret = ath11k_wmi_pdev_set_param(ar, param, ps_state_enable, pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "failed to enable ps_state_enable: %d\n", ++ ret); ++ goto exit; ++ } ++ ar->ps_state_enable = ps_state_enable; ++ ++ if (!ar->ps_state_enable) { ++ ar->ps_timekeeper_enable = WMI_PEER_RESET_PS_TIME_KEEPER; ++ ieee80211_iterate_stations_atomic(ar->hw, ++ ath11k_peer_ps_state_disable, ++ ar); ++ } ++ ++ ret = count; ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ ++ return ret; ++} ++ ++static ssize_t ath11k_read_ps_state_enable(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ char buf[32]; ++ ++ mutex_lock(&ar->conf_mutex); ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ ar->ps_state_enable); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_ps_state_enable = { ++ .read = ath11k_read_ps_state_enable, ++ .write = ath11k_write_ps_state_enable, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++ + static ssize_t ath11k_dump_mgmt_stats(struct file *file, char __user *ubuf, + size_t count, loff_t *ppos) + { +@@ -2651,6 +2852,20 @@ int ath11k_debugfs_register(struct ath11 + ar->debug.debugfs_pdev, ar, + &fops_dump_mgmt_stats); + ++ debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_pdev, ar, ++ &fops_ps_state_enable); ++ ++ if (test_bit(WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) { ++ debugfs_create_file("ps_timekeeper_enable", 0600, ++ ar->debug.debugfs_pdev, ar, ++ &fops_ps_timekeeper_enable); ++ ++ debugfs_create_file("reset_ps_duration", 0200, ++ ar->debug.debugfs_pdev, ar, ++ &fops_reset_ps_duration); ++ } ++ + if (ar->hw->wiphy->bands[NL80211_BAND_5GHZ]) { + debugfs_create_file("dfs_simulate_radar", 0200, + ar->debug.debugfs_pdev, ar, +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs_sta.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -1096,11 +1096,117 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t ath11k_dbg_sta_read_peer_ps_state(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ char buf[20]; ++ int len = 0; ++ ++ spin_lock_bh(&ar->data_lock); ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ arsta->peer_ps_state); ++ ++ spin_unlock_bh(&ar->data_lock); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_peer_ps_state = { ++ .open = simple_open, ++ .read = ath11k_dbg_sta_read_peer_ps_state, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_dbg_sta_read_current_ps_duration(struct file *file, ++ char __user *user_buf, ++ size_t count, ++ loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ u32 time_since_station_in_power_save; ++ char buf[20]; ++ int len = 0; ++ ++ spin_lock_bh(&ar->data_lock); ++ ++ if (arsta->peer_ps_state == WMI_PEER_STA_PS_MODE && arsta->peer_current_ps_valid) ++ time_since_station_in_power_save = jiffies_to_msecs(jiffies ++ - arsta->ps_start_jiffies); ++ else ++ time_since_station_in_power_save = 0; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ time_since_station_in_power_save); ++ spin_unlock_bh(&ar->data_lock); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_current_ps_duration = { ++ .open = simple_open, ++ .read = ath11k_dbg_sta_read_current_ps_duration, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_dbg_sta_read_total_ps_duration(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ char buf[20]; ++ u32 power_save_duration; ++ int len = 0; ++ ++ spin_lock_bh(&ar->data_lock); ++ ++ if (arsta->peer_ps_state == WMI_PEER_STA_PS_MODE && arsta->peer_current_ps_valid) ++ power_save_duration = jiffies_to_msecs(jiffies ++ - arsta->ps_start_jiffies) ++ + arsta->ps_total_duration; ++ else ++ power_save_duration = arsta->ps_total_duration; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n", ++ power_save_duration); ++ ++ spin_unlock_bh(&ar->data_lock); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_total_ps_duration = { ++ .open = simple_open, ++ .read = ath11k_dbg_sta_read_total_ps_duration, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct dentry *dir) + { + struct ath11k *ar = hw->priv; + ++ debugfs_create_file("peer_ps_state", 0400, dir, sta, ++ &fops_peer_ps_state); ++ ++ if (test_bit(WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) { ++ debugfs_create_file("current_ps_duration", 0440, dir, sta, ++ &fops_current_ps_duration); ++ debugfs_create_file("total_ps_duration", 0440, dir, sta, ++ &fops_total_ps_duration); ++ } + if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) + debugfs_create_file("tx_stats", 0400, dir, sta, + &fops_tx_stats); +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c +@@ -4382,6 +4382,7 @@ static int ath11k_mac_op_sta_state(struc + new_state == IEEE80211_STA_NONE) { + memset(arsta, 0, sizeof(*arsta)); + arsta->arvif = arvif; ++ arsta->peer_ps_state = WMI_PEER_PS_STATE_DISABLED; + INIT_WORK(&arsta->update_wk, ath11k_sta_rc_update_wk); + INIT_WORK(&arsta->use_4addr_wk, ath11k_sta_use_4addr_wk); + +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/trace.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/trace.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/trace.h +@@ -51,6 +51,31 @@ TRACE_EVENT(ath11k_htt_pktlog, + ) + ); + ++TRACE_EVENT(ath11k_ps_timekeeper, ++ TP_PROTO(struct ath11k *ar, void *peer_addr, ++ u32 peer_ps_timestamp, u8 peer_ps_state), ++ TP_ARGS(ar, peer_addr, peer_ps_timestamp, peer_ps_state), ++ TP_STRUCT__entry(__string(device, dev_name(ar->ab->dev)) ++ __string(driver, dev_driver_string(ar->ab->dev)) ++ __dynamic_array(u8, peer_addr, ETH_ALEN) ++ __field(u8, peer_ps_state) ++ __field(u32, peer_ps_timestamp) ++ ), ++ TP_fast_assign(__assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); ++ memcpy(__get_dynamic_array(peer_addr), peer_addr, ++ ETH_ALEN); ++ __entry->peer_ps_state = peer_ps_state; ++ __entry->peer_ps_timestamp = peer_ps_timestamp; ++ ), ++ TP_printk("%s %s %u %u", ++ __get_str(driver), ++ __get_str(device), ++ __entry->peer_ps_state, ++ __entry->peer_ps_timestamp ++ ) ++); ++ + TRACE_EVENT(ath11k_htt_ppdu_stats, + TP_PROTO(struct ath11k *ar, const void *data, size_t len), + +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c +@@ -8379,6 +8379,96 @@ static void ath11k_bcn_tx_status_event(s + } + + ++void ++ath11k_wmi_event_peer_sta_ps_state_chg(struct ath11k_base *ab, struct sk_buff *skb) ++{ ++ struct wmi_peer_sta_ps_state_chg_event *ev; ++ struct ieee80211_sta *sta; ++ struct ath11k_peer *peer; ++ struct ath11k *ar; ++ struct ath11k_sta *arsta; ++ u32 peer_previous_ps_state; ++ u8 peer_addr[ETH_ALEN]; ++ ++ ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data; ++ ether_addr_copy(peer_addr, ev->peer_macaddr.addr); ++ ++ rcu_read_lock(); ++ ++ spin_lock_bh(&ab->base_lock); ++ ++ peer = ath11k_peer_find_by_addr(ab, peer_addr); ++ ++ if (!peer) { ++ ath11k_warn(ab, "peer not found %pM\n", ++ peer_addr); ++ ++ ++ spin_unlock_bh(&ab->base_lock); ++ goto exit; ++ } ++ ++ ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); ++ ++ if (!ar) { ++ ath11k_warn(ab, "invalid vdev id in peer sta ps state change ev %d", ++ peer->vdev_id); ++ ++ spin_unlock_bh(&ab->base_lock); ++ goto exit; ++ } ++ ++ sta = peer->sta; ++ ++ spin_unlock_bh(&ab->base_lock); ++ ++ if (!sta) { ++ ath11k_warn(ab, "failed to find station entry %pM\n", ++ peer_addr); ++ goto exit; ++ } ++ ++ arsta = (struct ath11k_sta *)sta->drv_priv; ++ ++ spin_lock_bh(&ar->data_lock); ++ ++ peer_previous_ps_state = arsta->peer_ps_state; ++ arsta->peer_ps_state = ev->peer_ps_state; ++ arsta->peer_current_ps_valid = !WMI_PEER_CURRENT_VALID_PS_STATE; ++ ++ if (test_bit(WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) { ++ if (!(ev->ps_supported_bitmap & WMI_PEER_PS_VALID_SUPPORTED)) ++ goto out; ++ ++ if (!(ev->ps_supported_bitmap & WMI_PEER_PS_STATE_TIMESTAMP_SUPPORTED)) ++ goto out; ++ ++ if (!ev->peer_ps_valid) ++ goto out; ++ ++ arsta->peer_current_ps_valid = WMI_PEER_CURRENT_VALID_PS_STATE; ++ ++ if (arsta->peer_ps_state == WMI_PEER_STA_PS_MODE) { ++ arsta->ps_start_time = ev->peer_ps_timestamp; ++ arsta->ps_start_jiffies = jiffies; ++ } else if (!arsta->peer_ps_state && peer_previous_ps_state == WMI_PEER_STA_PS_MODE) ++ arsta->ps_total_duration = arsta->ps_total_duration + ++ (ev->peer_ps_timestamp - arsta->ps_start_time); ++ ++ if (ar->ps_timekeeper_enable) ++ trace_ath11k_ps_timekeeper(ar, peer_addr, ev->peer_ps_timestamp, ++ arsta->peer_ps_state); ++ ++ } ++ ++out: ++ spin_unlock_bh(&ar->data_lock); ++ ++exit: ++ rcu_read_unlock(); ++} ++ + static void ath11k_wmi_wds_peer_event(struct ath11k_base *ab, + struct sk_buff *skb) + { +@@ -8552,6 +8642,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_MUEDCA_PARAMS_CONFIG_EVENTID: + ath11k_wmi_pdev_update_muedca_params_status_event(ab, skb); + break; ++ case WMI_PEER_STA_PS_STATECHG_EVENTID: ++ ath11k_wmi_event_peer_sta_ps_state_chg(ab, skb); ++ break; + case WMI_DIAG_EVENTID: + ath11k_wmi_diag_event(ab, skb); + break; +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.h ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.h +@@ -5792,6 +5792,33 @@ struct wmi_qos_null_tx_cmd { + #define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ) + #define WMI_SEND_TIMEOUT_HZ (3 * HZ) + ++enum ath11k_wmi_peer_ps_param { ++ WMI_PEER_STA_WAKEUP_MODE = 0, ++ WMI_PEER_STA_PS_MODE = 1, ++ WMI_PEER_PS_STATE_DISABLED = 2, ++}; ++ ++#define WMI_PEER_RESET_PS_TIME_KEEPER 0 ++#define WMI_PEER_RESET_PS_TIME 0 ++#define WMI_PEER_RESET_PS_DURATION 0 ++#define WMI_PEER_CURRENT_VALID_PS_STATE 1 ++ ++ ++enum wmi_peer_ps_supported_bitmap { ++ /* Used to indicate that power save state change is valid */ ++ WMI_PEER_PS_VALID_SUPPORTED = 0x00000001, ++ WMI_PEER_PS_STATE_TIMESTAMP_SUPPORTED = 0x00000002, ++}; ++ ++struct wmi_peer_sta_ps_state_chg_event { ++ u32 tlv_header; ++ struct wmi_mac_addr peer_macaddr; ++ u32 peer_ps_state; ++ u32 ps_supported_bitmap; ++ u32 peer_ps_valid; ++ u32 peer_ps_timestamp; ++} __packed; ++ + struct ath11k_wmi_base { + struct ath11k_base *ab; + struct ath11k_pdev_wmi wmi[MAX_RADIOS]; diff --git a/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-fix-rssi-station-dump-not-updated-in-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-fix-rssi-station-dump-not-updated-in-qcn9000.patch new file mode 100644 index 000000000..3a5796aa6 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/228-ath11k-fix-rssi-station-dump-not-updated-in-qcn9000.patch @@ -0,0 +1,200 @@ +From 2321888a0f07a22af896313ea93d2470546c12f5 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Fri, 20 Nov 2020 16:03:47 +0530 +Subject: [PATCH] ath11k: fix rssi station dump not updated in qcn9000 + +In qcn9000, station dump signal values displays default +-95 dbm, Since there is firmware header change for +HAL_RX_MPDU_START between qcn9000 and qca8074 which +cause wrong peer_id fetch from msdu. Fixed this +by update hal_rx_mpdu_info with corresponding +qcn9000 tlv format. + +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/hal_rx.c | 20 +++++++++++++---- + drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++++++- + drivers/net/wireless/ath/ath11k/hw.c | 38 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 3 +++ + 4 files changed, 73 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -899,6 +899,20 @@ ath11k_hal_rx_populate_mu_user_info(void + ath11k_hal_rx_populate_byte_count(rx_tlv, ppdu_info, rx_user_status); + } + ++static ++u16 ath11k_hal_rxdesc_get_hal_mpdu_peerid(struct ath11k_base *ab, ++ struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_hal_mpdu_peerid(mpdu_info); ++} ++ ++static ++u32 ath11k_hal_rxdesc_get_hal_mpdu_len(struct ath11k_base *ab, ++ struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_hal_mpdu_len(mpdu_info); ++} ++ + static enum hal_rx_mon_status + ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, + struct hal_rx_mon_ppdu_info *ppdu_info, +@@ -1544,13 +1558,11 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + (struct hal_rx_mpdu_info *)tlv_data; + u16 peer_id; + +- peer_id = FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID, +- __le32_to_cpu(mpdu_info->info0)); ++ peer_id = ath11k_hal_rxdesc_get_hal_mpdu_peerid(ab,mpdu_info); + if (peer_id) + ppdu_info->peer_id = peer_id; + +- ppdu_info->mpdu_len += FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, +- __le32_to_cpu(mpdu_info->info1)); ++ ppdu_info->mpdu_len += ath11k_hal_rxdesc_get_hal_mpdu_len(ab,mpdu_info); + break; + } + case HAL_RXPCU_PPDU_END_INFO: { +--- a/drivers/net/wireless/ath/ath11k/hal_rx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h +@@ -445,7 +445,7 @@ struct hal_rx_phyrx_rssi_legacy_info { + + #define HAL_RX_MPDU_INFO_INFO0_PEERID GENMASK(31, 16) + #define HAL_RX_MPDU_INFO_INFO1_MPDU_LEN GENMASK(13, 0) +-struct hal_rx_mpdu_info { ++struct hal_rx_mpdu_info_ipq8074 { + __le32 rsvd0; + __le32 info0; + __le32 rsvd1[11]; +@@ -453,6 +453,21 @@ struct hal_rx_mpdu_info { + __le32 rsvd2[9]; + } __packed; + ++struct hal_rx_mpdu_info_ipq9074 { ++ __le32 rsvd0[10]; ++ __le32 info0; ++ __le32 rsvd1[2]; ++ __le32 info1; ++ __le32 rsvd2[9]; ++} __packed; ++ ++struct hal_rx_mpdu_info { ++ union { ++ struct hal_rx_mpdu_info_ipq8074 ipq8074; ++ struct hal_rx_mpdu_info_ipq9074 qcn9074; ++ } u; ++} __packed; ++ + #define HAL_RX_PPDU_END_DURATION GENMASK(23, 0) + struct hal_rx_ppdu_end_duration { + __le32 rsvd0[9]; +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -353,6 +353,20 @@ static u8 *ath11k_hw_ipq8074_rx_desc_get + return &desc->u.ipq8074.msdu_payload[0]; + } + ++static ++u16 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID, ++ __le32_to_cpu(mpdu_info->u.ipq8074.info0)); ++} ++ ++static ++u32 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, ++ __le32_to_cpu(mpdu_info->u.ipq8074.info1)); ++} ++ + static bool ath11k_hw_qcn9074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) + { + return !!FIELD_GET(RX_MSDU_END_INFO4_FIRST_MSDU, +@@ -554,6 +568,20 @@ static void ath11k_hw_ipq5018_set_rx_fra + ath11k_hif_write32(ab, reo_base + HAL_REO1_R0_MISC_CTL, val); + } + ++static ++u16 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID, ++ __le32_to_cpu(mpdu_info->u.qcn9074.info0)); ++} ++ ++static ++u32 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, ++ __le32_to_cpu(mpdu_info->u.qcn9074.info1)); ++} ++ + static u32 ath11k_get_reo_dest_remap_config_default(void) + { + u32 ring_hash_map; +@@ -632,6 +660,8 @@ const struct ath11k_hw_ops ipq8074_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, + .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, + }; + + const struct ath11k_hw_ops ipq6018_ops = { +@@ -671,6 +701,8 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, + .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, + }; + + const struct ath11k_hw_ops qca6390_ops = { +@@ -707,6 +739,8 @@ const struct ath11k_hw_ops qca6390_ops = + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, + .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, + //TODO + /* .rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid, +@@ -748,6 +782,8 @@ const struct ath11k_hw_ops qcn9074_ops = + .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, + .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, + }; + + /* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */ +@@ -787,6 +823,8 @@ const struct ath11k_hw_ops ipq5018_ops = + .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention, + .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, + .set_rx_fragmentation_dst_ring = ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, + }; + +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -125,6 +125,7 @@ enum ath11k_bus { + + #define ATH11K_EXT_IRQ_GRP_NUM_MAX 11 + ++struct hal_rx_mpdu_info; + struct hal_rx_desc; + struct hal_tcl_data_cmd; + struct napi_struct; +@@ -234,6 +235,8 @@ struct ath11k_hw_ops { + u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); + void (*set_rx_fragmentation_dst_ring)(struct ath11k_base *ab); + u32 (*get_reo_dest_remap_config)(void); ++ u16 (*rx_desc_get_hal_mpdu_peerid) (struct hal_rx_mpdu_info *mpdu_info); ++ u32 (*rx_desc_get_hal_mpdu_len) (struct hal_rx_mpdu_info *mpdu_info); + }; + + extern const struct ath11k_hw_ops ipq8074_ops; diff --git a/feeds/wifi-ax/mac80211/patches/qca/228-mac80211-clear-sta-fast_rx-when-STA-removed-from-4-a.patch b/feeds/wifi-ax/mac80211/patches/qca/228-mac80211-clear-sta-fast_rx-when-STA-removed-from-4-a.patch new file mode 100644 index 000000000..146c84075 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/228-mac80211-clear-sta-fast_rx-when-STA-removed-from-4-a.patch @@ -0,0 +1,57 @@ +From c1a8030e523cef50cc09631af8cfc501d0afd71f Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Tue, 1 Dec 2020 14:45:26 +0530 +Subject: [PATCH] mac80211: clear sta->fast_rx when STA removed from 4-addr + VLAN + +In some race conditions, with more clients and traffic configuration, +below crash is seen when making the interface down. sta->fast_rx wasn't +cleared when STA gets removed from 4-addr AP_VLAN interface. The crash +is due to try accessing 4-addr AP_VLAN interface's net_device (fast_rx->dev) +which has been deleted already. + +Resolve this by clearing sta->fast_rx pointer STA is removed +from a 4-addr VLAN. + +[ 239.449529] Unable to handle kernel NULL pointer dereference at virtual address 00000004 +[ 239.449531] pgd = 80204000 +... +[ 239.481496] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.60 #227 +[ 239.481591] Hardware name: Generic DT based system +[ 239.487665] task: be05b700 ti: be08e000 task.ti: be08e000 +[ 239.492360] PC is at get_rps_cpu+0x2d4/0x31c +[ 239.497823] LR is at 0xbe08fc54 +... +[ 239.778574] [<80739740>] (get_rps_cpu) from [<8073cb10>] (netif_receive_skb_internal+0x8c/0xac) +[ 239.786722] [<8073cb10>] (netif_receive_skb_internal) from [<8073d578>] (napi_gro_receive+0x48/0xc4) +[ 239.795267] [<8073d578>] (napi_gro_receive) from [] (ieee80211_mark_rx_ba_filtered_frames+0xbcc/0x12d4 [mac80211]) +[ 239.804776] [] (ieee80211_mark_rx_ba_filtered_frames [mac80211]) from [] (ieee80211_rx_napi+0x7b8/0x8c8 [mac80211]) +[ 239.815857] [] (ieee80211_rx_napi [mac80211]) from [] (ath11k_dp_process_rx+0x7bc/0x8c8 [ath11k]) +[ 239.827757] [] (ath11k_dp_process_rx [ath11k]) from [] (ath11k_dp_service_srng+0x2c0/0x2e0 [ath11k]) +[ 239.838484] [] (ath11k_dp_service_srng [ath11k]) from [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll+0x20/0x84 [ath11k_ahb]) +[ 239.849419] [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll [ath11k_ahb]) from [<8073ce1c>] (net_rx_action+0xe0/0x28c) +[ 239.860945] [<8073ce1c>] (net_rx_action) from [<80324868>] (__do_softirq+0xe4/0x228) +[ 239.871269] [<80324868>] (__do_softirq) from [<80324c48>] (irq_exit+0x98/0x108) +[ 239.879080] [<80324c48>] (irq_exit) from [<8035c59c>] (__handle_domain_irq+0x90/0xb4) +[ 239.886114] [<8035c59c>] (__handle_domain_irq) from [<8030137c>] (gic_handle_irq+0x50/0x94) +[ 239.894100] [<8030137c>] (gic_handle_irq) from [<803024c0>] (__irq_svc+0x40/0x74) + +Signed-off-by: Seevalamuthu Mariappan +--- + net/mac80211/cfg.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1947,8 +1947,10 @@ static int ieee80211_change_station(stru + } + + if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && +- sta->sdata->u.vlan.sta) ++ sta->sdata->u.vlan.sta) { ++ ieee80211_clear_fast_rx(sta); + RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL); ++ } + + if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) + ieee80211_vif_dec_num_mcast(sta->sdata); diff --git a/feeds/wifi-ax/mac80211/patches/qca/229-ath11k-fix-fw-crash-for-invalid-vdev-id.patch b/feeds/wifi-ax/mac80211/patches/qca/229-ath11k-fix-fw-crash-for-invalid-vdev-id.patch new file mode 100644 index 000000000..c2d2efd51 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/229-ath11k-fix-fw-crash-for-invalid-vdev-id.patch @@ -0,0 +1,28 @@ +Subject: [PATCH] ath11k: fix invalid vdev id fw crash + +num_started_vdevs is incremented for vdev restart scenario also. +Once num_started_vdevs is wrongly incremented, which is not helping +to stop the monitor vdev in multiple VAP cases. Since monitor vap not +stopped, deletion of virtual monitor vdev is missed. It leads to vdev id +leaks in the free_vdev_map. In that case, when we try to create multiple +VAPs, invalid vdev id is passed to firmware due to zero value of +free_vdev_map. So avoid the num_started_vdevs incrementing for restart +case. so that monitor vdev get stopped and deleted properly also vdev id +leaks not happen. will have proper vdev id from free_vdev_map. + +Signed-off-by: Karthikeyan Periyasamy +--- + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6503,7 +6503,9 @@ ath11k_mac_vdev_start_restart(struct ath + return ret; + } + +- ar->num_started_vdevs++; ++ if (!restart) ++ ar->num_started_vdevs++; ++ + ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n", + arvif->vif->addr, arvif->vdev_id); + diff --git a/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-Add-support-for-STA-to-handle-beacon-miss.patch b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-Add-support-for-STA-to-handle-beacon-miss.patch new file mode 100644 index 000000000..4bc188280 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-Add-support-for-STA-to-handle-beacon-miss.patch @@ -0,0 +1,185 @@ +From 1027f2d49304146a1bd1cfc00542615d8b528f92 Mon Sep 17 00:00:00 2001 +From: Michal Kazior +Date: Thu, 17 Dec 2020 20:40:30 +0530 +Subject: [PATCH] ath11k: Add support for STA to handle beacon miss + +When AP goes down without any indication to STA, FW +detects missing beacon, and sends wmi roam event with +reason BEACON_MISS to the host. + +Added support for STA mode to trigger disassociation +from AP, on receiving this event from FW. + +Signed-off-by: Lavanya Suresh +Signed-off-by: Michal Kazior +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath11k/core.h | 2 ++ + drivers/net/wireless/ath/ath11k/mac.c | 50 ++++++++++++++++++++++++++++++---- + drivers/net/wireless/ath/ath11k/mac.h | 1 + + drivers/net/wireless/ath/ath11k/wmi.c | 5 +--- + 4 files changed, 49 insertions(+), 9 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -40,6 +40,7 @@ + #define ATH11K_PRB_RSP_DROP_THRESHOLD ((ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI * 3) / 4) + + #define ATH11K_RESET_TIMEOUT_HZ (10 * HZ) ++#define ATH11K_CONNECTION_LOSS_HZ (3 * HZ) + #define ATH11K_INVALID_HW_MAC_ID 0xFF + #define ATH11K_RX_RATE_TABLE_NUM 320 + #define ATH11K_RX_RATE_TABLE_11AX_NUM 576 +@@ -259,6 +260,7 @@ struct ath11k_vif { + u32 aid; + u8 bssid[ETH_ALEN]; + struct cfg80211_bitrate_mask bitrate_mask; ++ struct delayed_work connection_loss_work; + int num_legacy_stations; + int rtscts_prot_mode; + int txpower; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -1272,6 +1272,75 @@ static void ath11k_control_beaconing(str + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); + } + ++static void ath11k_mac_handle_beacon_iter(void *data, u8 *mac, ++ struct ieee80211_vif *vif) ++{ ++ struct sk_buff *skb = data; ++ struct ieee80211_mgmt *mgmt = (void *)skb->data; ++ struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ ++ if (vif->type != NL80211_IFTYPE_STATION) ++ return; ++ ++ if (!ether_addr_equal(mgmt->bssid, vif->bss_conf.bssid)) ++ return; ++ ++ cancel_delayed_work(&arvif->connection_loss_work); ++} ++ ++void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb) ++{ ++ ieee80211_iterate_active_interfaces_atomic(ar->hw, ++ IEEE80211_IFACE_ITER_NORMAL, ++ ath11k_mac_handle_beacon_iter, ++ skb); ++} ++ ++static void ath11k_mac_handle_beacon_miss_iter(void *data, u8 *mac, ++ struct ieee80211_vif *vif) ++{ ++ u32 *vdev_id = data; ++ struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k *ar = arvif->ar; ++ struct ieee80211_hw *hw = ar->hw; ++ ++ if (arvif->vdev_id != *vdev_id) ++ return; ++ ++ if (!arvif->is_up) ++ return; ++ ++ ieee80211_beacon_loss(vif); ++ ++ /* Firmware doesn't report beacon loss events repeatedly. If AP probe ++ * (done by mac80211) succeeds but beacons do not resume then it ++ * doesn't make sense to continue operation. Queue connection loss work ++ * which can be cancelled when beacon is received. ++ */ ++ ieee80211_queue_delayed_work(hw, &arvif->connection_loss_work, ++ ATH11K_CONNECTION_LOSS_HZ); ++} ++ ++void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id) ++{ ++ ieee80211_iterate_active_interfaces_atomic(ar->hw, ++ IEEE80211_IFACE_ITER_NORMAL, ++ ath11k_mac_handle_beacon_miss_iter, ++ &vdev_id); ++} ++ ++static void ath11k_mac_vif_sta_connection_loss_work(struct work_struct *work) ++{ ++ struct ath11k_vif *arvif = container_of(work, struct ath11k_vif, ++ connection_loss_work.work); ++ struct ieee80211_vif *vif = arvif->vif; ++ ++ if (!arvif->is_up) ++ return; ++ ++ ieee80211_connection_loss(vif); ++} ++ + static void ath11k_peer_assoc_h_basic(struct ath11k *ar, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, +@@ -2643,7 +2712,7 @@ static void ath11k_bss_disassoc(struct i + + arvif->is_up = false; + +- /* TODO: cancel connection_loss_work */ ++ cancel_delayed_work_sync(&arvif->connection_loss_work); + } + + static u32 ath11k_mac_get_rate_hw_value(int bitrate) +@@ -5914,10 +5983,8 @@ static int ath11k_mac_op_add_interface(s + arvif->vif = vif; + + INIT_LIST_HEAD(&arvif->list); +- +- /* Should we initialize any worker to handle connection loss indication +- * from firmware in sta mode? +- */ ++ INIT_DELAYED_WORK(&arvif->connection_loss_work, ++ ath11k_mac_vif_sta_connection_loss_work); + + for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy = 0xffffffff; +@@ -6200,6 +6267,8 @@ static void ath11k_mac_op_remove_interfa + int ret; + int i; + ++ cancel_delayed_work_sync(&arvif->connection_loss_work); ++ + mutex_lock(&ar->conf_mutex); + + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n", +--- a/drivers/net/wireless/ath/ath11k/mac.h ++++ b/drivers/net/wireless/ath/ath11k/mac.h +@@ -164,4 +164,6 @@ u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); + enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); + enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); + void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif); ++void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb); ++void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id); + #endif +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6974,10 +6974,8 @@ skip_mgmt_stats: + } + } + +- /* TODO: Pending handle beacon implementation +- *if (ieee80211_is_beacon(hdr->frame_control)) +- * ath11k_mac_handle_beacon(ar, skb); +- */ ++ if (ieee80211_is_beacon(hdr->frame_control)) ++ ath11k_mac_handle_beacon(ar, skb); + + ath11k_dbg(ab, ATH11K_DBG_MGMT, + "event mgmt rx skb %pK len %d ftype %02x stype %02x\n", +@@ -7226,10 +7224,7 @@ static void ath11k_roam_event(struct ath + + switch (roam_ev.reason) { + case WMI_ROAM_REASON_BEACON_MISS: +- /* TODO: Pending beacon miss and connection_loss_work +- * implementation +- * ath11k_mac_handle_beacon_miss(ar, vdev_id); +- */ ++ ath11k_mac_handle_beacon_miss(ar, roam_ev.vdev_id); + break; + case WMI_ROAM_REASON_BETTER_AP: + case WMI_ROAM_REASON_LOW_RSSI: diff --git a/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-add-wmi-peer-create_event-in-wmi_tlv_event_id.patch b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-add-wmi-peer-create_event-in-wmi_tlv_event_id.patch new file mode 100644 index 000000000..ff028899e --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-add-wmi-peer-create_event-in-wmi_tlv_event_id.patch @@ -0,0 +1,45 @@ +From 42fd8fcafbb2f59305d5584e769964e6231113e0 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Wed, 16 Dec 2020 00:44:00 +0530 +Subject: [PATCH] ath11k: add wmi peer create conf event in wmi_tlv_event_id + +When driver sends peer create cmd, firmware responds with +WMI_PEER_CREATE_CONF_EVENTID to confirm firmware received +WMI_PEER_CREATE_CMDID. Since peer create conf event is +not handled in ath11k_wmi_tlv_op_rx,we are getting unknown +event id warning prints during peer creation. + +Added WMI_PEER_CREATE_CONF_EVENTID in wmi_tlv_event_id and handle +the same as unsupported event id under wmi logs. + +warning prints: +[ 4382.230817] ath11k_pci 0000:01:00.0: Unknown eventid: 0x601a + +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/wmi.c | 1 + + drivers/net/wireless/ath/ath11k/wmi.h | 3 +++ + 2 files changed, 4 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -8705,6 +8705,7 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_TWT_PAUSE_DIALOG_EVENTID: + case WMI_TWT_RESUME_DIALOG_EVENTID: + case WMI_PDEV_DMA_RING_CFG_RSP_EVENTID: ++ case WMI_PEER_CREATE_CONF_EVENTID: + ath11k_dbg(ab, ATH11K_DBG_WMI, + "ignoring unsupported event 0x%x\n", id); + break; +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -678,6 +678,9 @@ enum wmi_tlv_event_id { + WMI_PEER_RESERVED9_EVENTID, + WMI_PEER_RESERVED10_EVENTID, + WMI_PEER_OPER_MODE_CHANGE_EVENTID, ++ WMI_PEER_TX_PN_RESPONSE_EVENTID, ++ WMI_PEER_CFR_CAPTURE_EVENTID, ++ WMI_PEER_CREATE_CONF_EVENTID, + WMI_MGMT_RX_EVENTID = WMI_TLV_CMD(WMI_GRP_MGMT), + WMI_HOST_SWBA_EVENTID, + WMI_TBTTOFFSET_UPDATE_EVENTID, diff --git a/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-update-pdev-fw-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-update-pdev-fw-stats.patch new file mode 100644 index 000000000..e97ab952a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/230-ath11k-update-pdev-fw-stats.patch @@ -0,0 +1,247 @@ +From 7bfda3536d622d53a103d53440b00ed469021f2d Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Mon, 4 Jan 2021 13:36:15 +0530 +Subject: [PATCH] ath11k: update pdev tx,rx fw stats + +Update the fields of PDEV TX and RX firmware stats structure. +This was causing wrong fw stats to be printed as below. + + Illegal rate phy errors 36839112 + +Signed-off-by: Sriram R +--- + drivers/net/wireless/ath/ath11k/core.h | 33 +++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.c | 43 ++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 48 ++++++++++++++++++++++++++++++++++ + 3 files changed, 124 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -949,12 +949,15 @@ struct ath11k_fw_stats_pdev { + s32 hw_reaped; + /* Num underruns */ + s32 underrun; ++ /* Num hw paused */ ++ u32 hw_paused; + /* Num PPDUs cleaned up in TX abort */ + s32 tx_abort; + /* Num MPDUs requed by SW */ + s32 mpdus_requed; + /* excessive retries */ + u32 tx_ko; ++ u32 tx_xretry; + /* data hw rate code */ + u32 data_rc; + /* Scheduler self triggers */ +@@ -975,6 +978,32 @@ struct ath11k_fw_stats_pdev { + u32 phy_underrun; + /* MPDU is more than txop limit */ + u32 txop_ovf; ++ /* Num sequences posted */ ++ u32 seq_posted; ++ /* Num sequences failed in queueing */ ++ u32 seq_failed_queing; ++ /* Num sequences completed */ ++ u32 seq_completed; ++ /* Num sequences restarted */ ++ u32 seq_restarted; ++ /* Num of MU sequences posted */ ++ u32 mu_seq_posted; ++ /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT ++ * (Reset,channel change) ++ */ ++ s32 mpdus_sw_flush; ++ /* Num MPDUs filtered by HW, all filter condition (TTL expired) */ ++ s32 mpdus_hw_filter; ++ /* Num MPDUs truncated by PDG (TXOP, TBTT, ++ * PPDU_duration based on rate, dyn_bw) ++ */ ++ s32 mpdus_truncated; ++ /* Num MPDUs that was tried but didn't receive ACK or BA */ ++ s32 mpdus_ack_failed; ++ /* Num MPDUs that was dropped du to expiry. */ ++ s32 mpdus_expired; ++ /* Num mc drops */ ++ u32 mc_drop; + + /* PDEV RX stats */ + /* Cnts any change in ring routing mid-ppdu */ +@@ -1000,6 +1029,10 @@ struct ath11k_fw_stats_pdev { + s32 phy_err_drop; + /* Number of mpdu errors - FCS, MIC, ENC etc. */ + s32 mpdu_errs; ++ /* Inactivity timeouts */ ++ u32 pdev_rx_timeout; ++ /* Num overflow errors */ ++ s32 rx_ovf_err; + }; + + struct ath11k_fw_stats_vdev { +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6032,9 +6032,11 @@ ath11k_wmi_pull_pdev_stats_tx(const stru + dst->hw_queued = src->hw_queued; + dst->hw_reaped = src->hw_reaped; + dst->underrun = src->underrun; ++ dst->hw_paused = src->hw_paused; + dst->tx_abort = src->tx_abort; + dst->mpdus_requed = src->mpdus_requed; + dst->tx_ko = src->tx_ko; ++ dst->tx_xretry = src->tx_xretry; + dst->data_rc = src->data_rc; + dst->self_triggers = src->self_triggers; + dst->sw_retry_failure = src->sw_retry_failure; +@@ -6045,6 +6047,17 @@ ath11k_wmi_pull_pdev_stats_tx(const stru + dst->stateless_tid_alloc_failure = src->stateless_tid_alloc_failure; + dst->phy_underrun = src->phy_underrun; + dst->txop_ovf = src->txop_ovf; ++ dst->seq_posted = src->seq_posted; ++ dst->seq_failed_queing = src->seq_failed_queing; ++ dst->seq_completed = src->seq_completed; ++ dst->seq_restarted = src->seq_restarted; ++ dst->mu_seq_posted = src->mu_seq_posted; ++ dst->mpdus_sw_flush = src->mpdus_sw_flush; ++ dst->mpdus_hw_filter = src->mpdus_hw_filter; ++ dst->mpdus_truncated = src->mpdus_truncated;; ++ dst->mpdus_ack_failed = src->mpdus_ack_failed; ++ dst->mpdus_expired = src->mpdus_expired; ++ dst->mc_drop = src->mc_drop; + } + + static void ath11k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src, +@@ -6064,6 +6077,8 @@ static void ath11k_wmi_pull_pdev_stats_r + dst->phy_errs = src->phy_errs; + dst->phy_err_drop = src->phy_err_drop; + dst->mpdu_errs = src->mpdu_errs; ++ dst->pdev_rx_timeout = src->pdev_rx_timeout; ++ dst->rx_ovf_err = src->rx_ovf_err; + } + + static void +@@ -6301,6 +6316,8 @@ ath11k_wmi_fw_pdev_tx_stats_fill(const s + len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", + "Num underruns", pdev->underrun); + len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", ++ "Num HW Paused", pdev->hw_paused); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", + "PPDUs cleaned", pdev->tx_abort); + len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", + "MPDUs requed", pdev->mpdus_requed); +@@ -6329,6 +6346,28 @@ ath11k_wmi_fw_pdev_tx_stats_fill(const s + "PHY underrun", pdev->phy_underrun); + len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", + "MPDU is more than txop limit", pdev->txop_ovf); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num sequences posted", pdev->seq_posted); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num seq failed queueing ", pdev->seq_failed_queing); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num sequences completed ", pdev->seq_completed); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num sequences restarted ", pdev->seq_restarted); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MU sequences posted ", pdev->mu_seq_posted); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MPDUS SW flushed ", pdev->mpdus_sw_flush); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MPDUS HW filtered ", pdev->mpdus_hw_filter); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MPDUS truncated ", pdev->mpdus_truncated); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MPDUS ACK failed ", pdev->mpdus_ack_failed); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MPDUS expired ", pdev->mpdus_expired); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", ++ "Num of MC Drops ", pdev->mc_drop); + *length = len; + } + +@@ -6373,6 +6412,10 @@ ath11k_wmi_fw_pdev_rx_stats_fill(const s + "PHY errors drops", pdev->phy_err_drop); + len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", + "MPDU errors (FCS, MIC, ENC)", pdev->mpdu_errs); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", ++ "Inactivity timeouts", pdev->pdev_rx_timeout); ++ len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", ++ "Overflow errors", pdev->rx_ovf_err); + *length = len; + } + +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -4459,6 +4459,9 @@ struct wmi_pdev_stats_tx { + /* Num underruns */ + s32 underrun; + ++ /* Num hw paused */ ++ u32 hw_paused; ++ + /* Num PPDUs cleaned up in TX abort */ + s32 tx_abort; + +@@ -4468,6 +4471,8 @@ struct wmi_pdev_stats_tx { + /* excessive retries */ + u32 tx_ko; + ++ u32 tx_xretry; ++ + /* data hw rate code */ + u32 data_rc; + +@@ -4497,6 +4502,43 @@ struct wmi_pdev_stats_tx { + + /* MPDU is more than txop limit */ + u32 txop_ovf; ++ ++ /* Num sequences posted */ ++ u32 seq_posted; ++ ++ /* Num sequences failed in queueing */ ++ u32 seq_failed_queing; ++ ++ /* Num sequences completed */ ++ u32 seq_completed; ++ ++ /* Num sequences restarted */ ++ u32 seq_restarted; ++ ++ /* Num of MU sequences posted */ ++ u32 mu_seq_posted; ++ ++ /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT ++ * (Reset,channel change) ++ */ ++ s32 mpdus_sw_flush; ++ ++ /* Num MPDUs filtered by HW, all filter condition (TTL expired) */ ++ s32 mpdus_hw_filter; ++ ++ /* Num MPDUs truncated by PDG (TXOP, TBTT, ++ * PPDU_duration based on rate, dyn_bw) ++ */ ++ s32 mpdus_truncated; ++ ++ /* Num MPDUs that was tried but didn't receive ACK or BA */ ++ s32 mpdus_ack_failed; ++ ++ /* Num MPDUs that was dropped du to expiry. */ ++ s32 mpdus_expired; ++ ++ /* Num mc drops */ ++ u32 mc_drop; + } __packed; + + struct wmi_pdev_stats_rx { +@@ -4531,6 +4573,12 @@ struct wmi_pdev_stats_rx { + + /* Number of mpdu errors - FCS, MIC, ENC etc. */ + s32 mpdu_errs; ++ ++ /* Inactivity timeouts */ ++ u32 pdev_rx_timeout; ++ ++ /* Num overflow errors */ ++ s32 rx_ovf_err; + } __packed; + + struct wmi_pdev_stats { diff --git a/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-ATH11K_QMI_TARGET_MEM_MODE_256M-support-f.patch b/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-ATH11K_QMI_TARGET_MEM_MODE_256M-support-f.patch new file mode 100644 index 000000000..a230dc3ea --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-ATH11K_QMI_TARGET_MEM_MODE_256M-support-f.patch @@ -0,0 +1,233 @@ +From 4409eb05f67feef95d1c241aa9c7cded4942226e Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Fri, 18 Dec 2020 12:15:35 +0530 +Subject: [PATCH] ath11k: add ATH11K_QMI_TARGET_MEM_MODE_256M support for + qcn9074 + +Added ATH11K_QMI_TARGET_MEM_MODE_256M in ath11k_target_mem_mode +and enabling ATH11K_QMI_TARGET_MEM_MODE_256M as a default +target memory mode for qcn9074 in hw_params. Also disabled +cold boot calibration if target memory mode is ATH11K_QMI_TARGET_MEM_MODE_256M. + +Co-developed-by: Seevalamuthu Mariappan +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/core.c | 25 +++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 3 ++- + drivers/net/wireless/ath/ath11k/qmi.c | 6 +++++- + drivers/net/wireless/ath/ath11k/qmi.h | 1 + + 4 files changed, 33 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -95,6 +95,7 @@ static const struct ath11k_hw_params ath + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, ++ .fwmem_mode_change = false, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -142,6 +143,7 @@ static const struct ath11k_hw_params ath + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, ++ .fwmem_mode_change = false, + }, + { + .name = "qca6390 hw2.0", +@@ -184,6 +186,7 @@ static const struct ath11k_hw_params ath + .spectral_fft_sz = 2, + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, ++ .fwmem_mode_change = false, + }, + { + .name = "qcn9074 hw1.0", +@@ -228,6 +231,7 @@ static const struct ath11k_hw_params ath + .spectral_fft_hdr_len = 24, + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = true, ++ .fwmem_mode_change = true, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -274,6 +278,22 @@ static const struct ath11k_hw_params ath + .spectral_fft_hdr_len = 24, + .reo_dest_ring_map_shift = HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, ++ .fwmem_mode_change = false, ++ }, ++}; ++ ++static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers[] = { ++ { ++ .num_vdevs = (16 + 1), ++ .num_peers = 512, ++ }, ++ { ++ .num_vdevs = (8 + 1), ++ .num_peers = 128, ++ }, ++ { ++ .num_vdevs = 8, ++ .num_peers = 128, + }, + }; + +@@ -682,6 +702,8 @@ static int ath11k_core_soc_create(struct + ath11k_info(ab, "Booting in ftm mode - %d\n", ab->fw_mode); + } + ++ ab->num_vdevs_peers = &ath11k_vdevs_peers; ++ + ret = ath11k_qmi_init_service(ab); + if (ret) { + ath11k_err(ab, "failed to initialize qmi :%d\n", ret); +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -22,11 +22,10 @@ + #define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 128 + #else + /* Num VDEVS per radio */ +-#define TARGET_NUM_VDEVS (16 + 1) +- +-#define TARGET_NUM_PEERS_PDEV (512 + TARGET_NUM_VDEVS) ++#define TARGET_NUM_VDEVS (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_vdevs) ++#define TARGET_NUM_PEERS_PDEV (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_peers + TARGET_NUM_VDEVS) + /* Max num of stations (per radio) */ +-#define TARGET_NUM_STATIONS 512 ++#define TARGET_NUM_STATIONS (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_peers) + #define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_DEFAULT + #define ATH11K_DP_TX_COMP_RING_SIZE 32768 + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024 +@@ -193,6 +192,7 @@ struct ath11k_hw_params { + u32 m3_addr; + u8 reo_dest_ring_map_shift; + bool ce_fwlog_enable; ++ bool fwmem_mode_change; + }; + + struct ath11k_hw_ops { +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -23,6 +23,10 @@ module_param_named(cold_boot_cal, ath11k + MODULE_PARM_DESC(cold_boot_cal, + "Decrease the channel switch time but increase the driver load time (Default: true)"); + ++unsigned int fwmem_mode = ATH11K_QMI_TARGET_MEM_MODE_256M; ++module_param_named(fwmem_mode, fwmem_mode, uint, 0644); ++MODULE_PARM_DESC(fwmem_mode, "Firmware mem mode (applicable only for qcn9074)"); ++ + static struct qmi_elem_info qmi_wlanfw_qdss_trace_config_download_req_msg_v01_ei[] = { + { + .data_type = QMI_OPT_FLAG, +@@ -2758,20 +2762,16 @@ static int ath11k_qmi_assign_target_mem_ + ath11k_warn(ab, "qmi fail to get caldb-addr in dt\n"); + } + +- if (ab->enable_cold_boot_cal && ab->hw_params.cold_boot_calib) { +- ab->qmi.target_mem[idx].paddr = (u32)addr; +- ab->qmi.target_mem[idx].vaddr = +- ioremap(ab->qmi.target_mem[idx].paddr, +- ab->qmi.target_mem[i].size); +- } else if (ab->bus_params.fixed_bdf_addr) { +- ab->qmi.target_mem[idx].paddr = 0UL; +- ab->qmi.target_mem[idx].vaddr = 0UL; ++ if (!ab->enable_cold_boot_cal) { ++ ab->qmi.target_mem[idx].paddr = 0; ++ ab->qmi.target_mem[idx].vaddr = NULL; + } else { +- ab->qmi.target_mem[idx].paddr = (phys_addr_t)addr; ++ ab->qmi.target_mem[idx].paddr = (u32)addr; + ab->qmi.target_mem[idx].vaddr = + ioremap(ab->qmi.target_mem[idx].paddr, + ab->qmi.target_mem[i].size); + } ++ + ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; + ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; + idx++; +@@ -4339,6 +4339,17 @@ int ath11k_qmi_init_service(struct ath11 + ab->qmi.ab = ab; + + ab->qmi.target_mem_mode = ATH11K_QMI_TARGET_MEM_MODE; ++ ++ if (ab->hw_params.fwmem_mode_change) { ++ ab->qmi.target_mem_mode = fwmem_mode; ++ if (ab->qmi.target_mem_mode == ATH11K_QMI_TARGET_MEM_MODE_256M && ++ ath11k_ftm_mode) ++ ab->enable_cold_boot_cal = 1; ++ else if(ab->qmi.target_mem_mode == ATH11K_QMI_TARGET_MEM_MODE_256M) ++ ab->enable_cold_boot_cal = 0; ++ } ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi target mem mode %d\n", ab->qmi.target_mem_mode); ++ + ret = qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX, + &ath11k_qmi_ops, ath11k_qmi_msg_handlers); + if (ret < 0) { +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -57,6 +57,7 @@ extern unsigned int ath11k_host_ddr_addr + enum ath11k_target_mem_mode { + ATH11K_QMI_TARGET_MEM_MODE_DEFAULT = 0, + ATH11K_QMI_TARGET_MEM_MODE_512M, ++ ATH11K_QMI_TARGET_MEM_MODE_256M, + }; + + enum ath11k_qmi_file_type { +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -786,6 +786,11 @@ struct ath11k_soc_dp_stats { + struct ath11k_dp_ring_bp_stats bp_stats; + }; + ++struct ath11k_num_vdevs_peers { ++ u32 num_vdevs; ++ u32 num_peers; ++}; ++ + /* Master structure to hold the hw data which may be used in core module */ + struct ath11k_base { + enum ath11k_hw_rev hw_rev; +@@ -898,6 +903,7 @@ struct ath11k_base { + bool ce_remap; + u32 ce_remap_base_addr; + atomic_t num_max_allowed; ++ struct ath11k_num_vdevs_peers *num_vdevs_peers; + + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -2038,6 +2038,9 @@ static ssize_t ath11k_dump_mgmt_stats(st + size_t count, loff_t *ppos) + { + struct ath11k *ar = file->private_data; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M ++ struct ath11k_base *ab = ar->ab; ++#endif + struct ath11k_vif *arvif = NULL; + struct ath11k_mgmt_frame_stats *mgmt_stats; + int len = 0, ret, i; +--- a/drivers/net/wireless/ath/ath11k/coredump.c ++++ b/drivers/net/wireless/ath/ath11k/coredump.c +@@ -164,7 +164,7 @@ void ath11k_coredump_download_rddm(struc + + for (i = 0; i < ab->qmi.mem_seg_count; i++) { + if (ab->qmi.target_mem[i].type == HOST_DDR_REGION_TYPE || +- ab->qmi.target_mem[i].type == CALDB_MEM_REGION_TYPE || ++ (ab->qmi.target_mem[i].type == CALDB_MEM_REGION_TYPE && ab->enable_cold_boot_cal && ab->hw_params.cold_boot_calib) || + ab->qmi.target_mem[i].type == M3_DUMP_REGION_TYPE) + rem_seg_cnt++; + } +@@ -228,7 +228,7 @@ void ath11k_coredump_download_rddm(struc + } + + for (i = 0; i < ab->qmi.mem_seg_count; i++) { +- if (ab->qmi.target_mem[i].type == CALDB_MEM_REGION_TYPE) { ++ if (ab->qmi.target_mem[i].type == CALDB_MEM_REGION_TYPE && ab->enable_cold_boot_cal && ab->hw_params.cold_boot_calib) { + seg_info->len = ab->qmi.target_mem[i].size; + seg_info->addr = ab->qmi.target_mem[i].paddr; + seg_info->vaddr = ab->qmi.target_mem[i].vaddr; diff --git a/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-wmi-ctrl-path-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-wmi-ctrl-path-stats.patch new file mode 100644 index 000000000..72c486627 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/231-ath11k-add-wmi-ctrl-path-stats.patch @@ -0,0 +1,914 @@ +From b330e0742cdac4381a996c51809735f07ad01295 Mon Sep 17 00:00:00 2001 +From: Thiraviyam Mariyappan +Date: Fri, 18 Dec 2020 12:46:09 +0530 +Subject: [PATCH] ath11k: add wmi ctrl path stats + +Currently, ath11k HTT debugfs uses the HTT inferface to send stats request +to target and response from target. Here HTT interface already overloaded +with the data path stats. To reduce the load from HTT, using WMI interface +to print the control path stats. This patch come up with framework for +control path stats using wmi interface. + +wmi control path stats command and results are below: +echo > sys/kernel/debug/ieee80211/phy3/netdev\:wlan3/wmi_ctrl_stats +cat sys/kernel/debug/ieee80211/phy3/netdev\:wlan3/wmi_ctrl_stats + +WMI_CTRL_PATH_PDEV_TX_STATS: +fw_tx_mgmt_subtype = 0:0, 1:0, 2:0, 3:0, 4:0, 5:109, 6:0, 7:0, 8:344, 9:0, 10:0, 11:0, 12:3, 13:0, 14:0, 15:0, +fw_rx_mgmt_subtype = 0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, +scan_fail_dfs_violation_time_ms = 0 +nol_chk_fail_last_chan_freq = 0 +nol_chk_fail_time_stamp_ms = 0 +tot_peer_create_cnt = 2 +tot_peer_del_cnt = 1 +tot_peer_del_resp_cnt = 1 +vdev_pause_fail_rt_to_sched_algo_fifo_full_cnt = 0 + +Signed-off-by: Thiraviyam Mariyappan +--- + drivers/net/wireless/ath/ath11k/core.h | 3 + + drivers/net/wireless/ath/ath11k/debugfs.c | 136 ++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 2 + + drivers/net/wireless/ath/ath11k/mac.c | 1 + + drivers/net/wireless/ath/ath11k/wmi.c | 242 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 93 ++++++++++++ + 6 files changed, 477 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -496,6 +496,9 @@ struct ath11k_debug { + u32 rx_filter; + bool enable_m3_dump; + u32 mem_addr; ++ struct list_head wmi_list; ++ struct completion wmi_ctrl_path_stats_rcvd; ++ u32 wmi_ctrl_path_stats_tagid; + }; + + struct ath11k_per_peer_tx_stats { +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -251,6 +251,217 @@ void ath11k_debugfs_twt(struct ath11k_vi + } + #endif + ++static ssize_t ath11k_write_wmi_ctrl_path_stats(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct wmi_ctrl_path_stats_cmd_param param = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); ++ if (ret < 0) { ++ return ret; ++ } ++ ++ buf[ret] = '\0'; ++ ++ ret = sscanf(buf, "%u %u", ¶m.stats_id, ¶m.action); ++ if (ret != 2) ++ return -EINVAL; ++ ++ if (!param.action || param.action > WMI_REQ_CTRL_PATH_STAT_RESET) ++ return -EINVAL; ++ ++ ret = ath11k_wmi_send_wmi_ctrl_stats_cmd(arvif->ar, ¶m); ++ return ret ? ret : count; ++} ++ ++int wmi_ctrl_path_pdev_stat(struct ath11k_vif *arvif, const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ const int size = 2048; ++ char *buf; ++ u8 i; ++ int len = 0, ret_val; ++ u16 index_tx = 0; ++ u16 index_rx = 0; ++ char fw_tx_mgmt_subtype[WMI_MAX_STRING_LEN] = {0}; ++ char fw_rx_mgmt_subtype[WMI_MAX_STRING_LEN] = {0}; ++ struct wmi_ctrl_path_stats_list *stats; ++ struct wmi_ctrl_path_pdev_stats *pdev_stats; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ list_for_each_entry (stats, &arvif->ar->debug.wmi_list, list) { ++ if (!stats) { ++ break; ++ } ++ ++ pdev_stats = stats->stats_ptr; ++ ++ for (i = 0; i < WMI_MGMT_FRAME_SUBTYPE_MAX; i++) { ++ index_tx += snprintf(&fw_tx_mgmt_subtype[index_tx], ++ WMI_MAX_STRING_LEN - index_tx, ++ " %u:%u,", i, ++ pdev_stats->tx_mgmt_subtype[i]); ++ index_rx += snprintf(&fw_rx_mgmt_subtype[index_rx], ++ WMI_MAX_STRING_LEN - index_rx, ++ " %u:%u,", i, ++ pdev_stats->rx_mgmt_subtype[i]); ++ } ++ ++ len += scnprintf(buf + len, size - len, ++ "WMI_CTRL_PATH_PDEV_TX_STATS: \n"); ++ len += scnprintf(buf + len, size - len, ++ "fw_tx_mgmt_subtype = %s \n", ++ fw_tx_mgmt_subtype); ++ len += scnprintf(buf + len, size - len, ++ "fw_rx_mgmt_subtype = %s \n", ++ fw_rx_mgmt_subtype); ++ len += scnprintf(buf + len, size - len, ++ "scan_fail_dfs_violation_time_ms = %u \n", ++ pdev_stats->scan_fail_dfs_violation_time_ms); ++ len += scnprintf(buf + len, size - len, ++ "nol_chk_fail_last_chan_freq = %u \n", ++ pdev_stats->nol_chk_fail_last_chan_freq); ++ len += scnprintf(buf + len, size - len, ++ "nol_chk_fail_time_stamp_ms = %u \n", ++ pdev_stats->nol_chk_fail_time_stamp_ms); ++ len += scnprintf(buf + len, size - len, ++ "tot_peer_create_cnt = %u \n", ++ pdev_stats->tot_peer_create_cnt); ++ len += scnprintf(buf + len, size - len, ++ "tot_peer_del_cnt = %u \n", ++ pdev_stats->tot_peer_del_cnt); ++ len += scnprintf(buf + len, size - len, ++ "tot_peer_del_resp_cnt = %u \n", ++ pdev_stats->tot_peer_del_resp_cnt); ++ len += scnprintf(buf + len, size - len, ++ "vdev_pause_fail_rt_to_sched_algo_fifo_full_cnt = %u \n", ++ pdev_stats->vdev_pause_fail_rt_to_sched_algo_fifo_full_cnt); ++ ++ } ++ ++ ret_val = simple_read_from_buffer(ubuf, count, ppos, buf, len); ++ ath11k_wmi_crl_path_stats_list_free(&arvif->ar->debug.wmi_list); ++ kfree(buf); ++ return ret_val; ++} ++ ++int wmi_ctrl_path_cal_stat(struct ath11k_vif *arvif, const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ const int size = 4096; ++ char *buf; ++ u8 cal_type_mask, cal_prof_mask, is_periodic_cal; ++ int len = 0, ret_val; ++ struct wmi_ctrl_path_stats_list *stats; ++ struct wmi_ctrl_path_cal_stats *cal_stats; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ len += scnprintf(buf + len, size - len, ++ "WMI_CTRL_PATH_CAL_STATS\n"); ++ len += scnprintf(buf + len, size - len, ++ "%-25s %-25s %-17s %-16s %-16s %-16s\n", ++ "cal_profile", "cal_type", ++ "cal_triggered_cnt", "cal_fail_cnt", ++ "cal_fcs_cnt", "cal_fcs_fail_cnt"); ++ ++ list_for_each_entry (stats, &arvif->ar->debug.wmi_list, list) { ++ if (!stats) ++ break; ++ ++ cal_stats = stats->stats_ptr; ++ ++ cal_prof_mask = FIELD_GET(WMI_CTRL_PATH_CAL_PROF_MASK, ++ cal_stats->cal_info); ++ if (cal_prof_mask == WMI_CTRL_PATH_STATS_CAL_PROFILE_INVALID) ++ continue; ++ ++ cal_type_mask = FIELD_GET(WMI_CTRL_PATH_CAL_TYPE_MASK, ++ cal_stats->cal_info); ++ is_periodic_cal = FIELD_GET(WMI_CTRL_PATH_IS_PERIODIC_CAL, ++ cal_stats->cal_info); ++ ++ ++ if (!is_periodic_cal) { ++ len += ++ scnprintf(buf + len, size - len, ++ "%-25s %-25s %-17d %-16d %-16d %-16d\n", ++ wmi_ctrl_path_cal_prof_id_to_name(cal_prof_mask), ++ wmi_ctrl_path_cal_type_id_to_name(cal_type_mask), ++ cal_stats->cal_triggered_cnt, ++ cal_stats->cal_fail_cnt, ++ cal_stats->cal_fcs_cnt, ++ cal_stats->cal_fcs_fail_cnt); ++ } else { ++ len += ++ scnprintf(buf + len, size - len, ++ "%-25s %-25s %-17d %-16d %-16d %-16d\n", ++ "PERIODIC_CAL", ++ wmi_ctrl_path_periodic_cal_type_id_to_name(cal_type_mask), ++ cal_stats->cal_triggered_cnt, ++ cal_stats->cal_fail_cnt, ++ cal_stats->cal_fcs_cnt, ++ cal_stats->cal_fcs_fail_cnt); ++ } ++ ++ } ++ ++ ret_val = simple_read_from_buffer(ubuf, count, ppos, buf, len); ++ ath11k_wmi_crl_path_stats_list_free(&arvif->ar->debug.wmi_list); ++ kfree(buf); ++ return ret_val; ++} ++ ++static ssize_t ath11k_read_wmi_ctrl_path_stats(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ int ret_val = 0; ++ u32 tagid = 0; ++ ++ tagid = arvif->ar->debug.wmi_ctrl_path_stats_tagid; ++ ++ switch (tagid) { ++ case WMI_CTRL_PATH_PDEV_STATS: ++ ret_val = wmi_ctrl_path_pdev_stat(arvif, ubuf, count, ppos); ++ break; ++ case WMI_CTRL_PATH_CAL_STATS: ++ ret_val = wmi_ctrl_path_cal_stat(arvif, ubuf, count, ppos); ++ break; ++ /* Add case for newly wmi ctrl path added stats here */ ++ default : ++ /* Unsupported tag */ ++ break; ++ } ++ ++ return ret_val; ++} ++ ++static const struct file_operations ath11k_fops_wmi_ctrl_stats = { ++ .write = ath11k_write_wmi_ctrl_path_stats, ++ .open = simple_open, ++ .read = ath11k_read_wmi_ctrl_path_stats, ++}; ++ ++void ath11k_debugfs_wmi_ctrl_stats(struct ath11k_vif *arvif) ++{ ++ debugfs_create_file("wmi_ctrl_stats", 0644, ++ arvif->vif->debugfs_dir, arvif, ++ &ath11k_fops_wmi_ctrl_stats); ++ INIT_LIST_HEAD(&arvif->ar->debug.wmi_list); ++ init_completion(&arvif->ar->debug.wmi_ctrl_path_stats_rcvd); ++} ++ + static ssize_t ath11k_write_ampdu_aggr_size(struct file *file, + const char __user *ubuf, + size_t count, loff_t *ppos) +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -159,6 +159,8 @@ static inline void ath11k_debugfs_twt(st + #endif + + void ath11k_debug_aggr_size_config_init(struct ath11k_vif *arvif); ++void ath11k_debugfs_wmi_ctrl_stats(struct ath11k_vif *arvif); ++void ath11k_wmi_crl_path_stats_list_free(struct list_head *head); + + #ifdef CPTCFG_ATH11K_DEBUGFS + int ath11k_debugfs_create(void); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6205,6 +6205,7 @@ static int ath11k_mac_op_add_interface(s + } + + ath11k_debug_aggr_size_config_init(arvif); ++ ath11k_debugfs_wmi_ctrl_stats(arvif); + + mutex_unlock(&ar->conf_mutex); + +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -3045,6 +3045,102 @@ ath11k_wmi_send_twt_add_dialog_cmd(struc + } + + int ++ath11k_wmi_send_wmi_ctrl_stats_cmd(struct ath11k *ar, ++ struct wmi_ctrl_path_stats_cmd_param *param) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct ath11k_base *ab = wmi->wmi_ab->ab; ++ u32 num_pdev_idx = 0; ++ u32 num_vdev_idx = 0; ++ u32 num_mac_addr_list = 0; ++ u32 pdev_id_array[2] = {0}; ++ int len, ret; ++ struct wmi_tlv *tlv; ++ struct sk_buff *skb; ++ struct wmi_ctrl_path_stats_cmd_param *cmd; ++ void *ptr; ++ u32 stats_id = 0; ++ unsigned long time_left; ++ ++ switch (param->stats_id) { ++ case WMI_REQ_CTRL_PATH_PDEV_TX_STAT: ++ pdev_id_array[num_pdev_idx] = ar->pdev->pdev_id; ++ stats_id = (1 << param->stats_id); ++ num_pdev_idx++; ++ break; ++ case WMI_REQ_CTRL_PATH_CAL_STAT: ++ pdev_id_array[num_pdev_idx] = ar->pdev->pdev_id; ++ stats_id = (1 << param->stats_id); ++ num_pdev_idx++; ++ break; ++ /* Add case for newly wmi ctrl path stats here */ ++ default: ++ ath11k_warn(ab, "Unsupported stats id %d", param->stats_id); ++ return -EIO; ++ break; ++ } ++ ++ len = sizeof(*cmd) + ++ TLV_HDR_SIZE + (sizeof(u32) * num_pdev_idx) + ++ TLV_HDR_SIZE + (sizeof(u32) * num_vdev_idx) + ++ TLV_HDR_SIZE + (sizeof(struct wmi_mac_addr) * num_mac_addr_list); ++ ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); ++ if (!skb) ++ return -ENOMEM; ++ ++ cmd = (void *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, ++ WMI_CTRL_PATH_STATS_CMD_FIXED_PARAM) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); ++ cmd->stats_id = stats_id; ++ cmd->req_id = param->req_id; ++ cmd->action = param->action; ++ ++ ptr = skb->data + sizeof(*cmd); ++ ++ tlv = ptr; ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | ++ FIELD_PREP(WMI_TLV_LEN, (sizeof(u32) * num_pdev_idx)); ++ ptr += TLV_HDR_SIZE; ++ memcpy(ptr, &pdev_id_array[0], sizeof(pdev_id_array)); ++ ptr += sizeof(u32) * num_pdev_idx; ++ ++ tlv = ptr; ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | ++ FIELD_PREP(WMI_TLV_LEN, (sizeof(u32) * num_vdev_idx)); ++ ptr += TLV_HDR_SIZE; ++ ++ tlv = ptr; ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | ++ FIELD_PREP(WMI_TLV_LEN, (sizeof(struct wmi_mac_addr) * ++ num_mac_addr_list)); ++ ptr += TLV_HDR_SIZE; ++ ++ if (param->action == WMI_REQ_CTRL_PATH_STAT_GET) ++ reinit_completion(&ar->debug.wmi_ctrl_path_stats_rcvd); ++ ++ ret = ath11k_wmi_cmd_send(wmi, skb, ++ WMI_REQUEST_CTRL_PATH_STATS_CMDID); ++ if (ret) { ++ dev_kfree_skb(skb); ++ ath11k_warn(ab, "Failed to send WMI_REQUEST_CTRL_PATH_STATS_CMDID: %d",ret); ++ } else { ++ if (param->action == WMI_REQ_CTRL_PATH_STAT_GET) { ++ time_left = wait_for_completion_timeout( ++ &ar->debug.wmi_ctrl_path_stats_rcvd, ++ WMI_CTRL_STATS_READY_TIMEOUT_HZ * HZ); ++ if (time_left == 0) { ++ ath11k_warn(ab, "timeout in receiving wmi ctrl path stats\n"); ++ return -ETIMEDOUT; ++ } ++ } ++ } ++ ++ return ret; ++} ++ ++int + ath11k_wmi_send_twt_del_dialog_cmd(struct ath11k *ar, + struct wmi_twt_del_dialog_params *params) + { +@@ -7151,6 +7247,195 @@ exit: + rcu_read_unlock(); + } + ++void ath11k_wmi_crl_path_stats_list_free(struct list_head *head) ++{ ++ struct wmi_ctrl_path_stats_list *stats, *tmp; ++ list_for_each_entry_safe(stats, tmp, head, list) { ++ if (stats->stats_ptr) ++ kfree(stats->stats_ptr); ++ list_del(&stats->list); ++ kfree(stats); ++ } ++} ++ ++int wmi_print_ctrl_path_pdev_tx_stats_tlv(struct ath11k_base *ab, u16 len, const void *ptr, void *data) ++{ ++ struct wmi_ctrl_path_stats_ev_parse_param *stats_buff = (struct wmi_ctrl_path_stats_ev_parse_param *)data; ++ struct wmi_ctrl_path_pdev_stats *pdev_stats_skb = (struct wmi_ctrl_path_pdev_stats *)ptr; ++ struct wmi_ctrl_path_pdev_stats *pdev_stats = NULL; ++ struct wmi_ctrl_path_stats_list *stats = kzalloc(sizeof(struct wmi_ctrl_path_stats_list),GFP_ATOMIC); ++ struct ath11k *ar = NULL; ++ ++ if (!stats) ++ return -ENOMEM; ++ ++ pdev_stats = kzalloc(sizeof(*pdev_stats), GFP_ATOMIC); ++ if (!pdev_stats) ++ return -ENOMEM; ++ ++ memcpy(pdev_stats, pdev_stats_skb, sizeof(struct wmi_ctrl_path_pdev_stats)); ++ stats->stats_ptr = pdev_stats; ++ list_add_tail(&stats->list, &stats_buff->list); ++ ++ ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_stats_skb->pdev_id + 1); ++ if (!ar) { ++ ath11k_warn(ab, "Failed to get ar for wmi ctrl stats\n"); ++ return -EINVAL; ++ } ++ ++ ar->debug.wmi_ctrl_path_stats_tagid = WMI_CTRL_PATH_PDEV_STATS; ++ stats_buff->ar = ar; ++ return 0; ++} ++ ++int wmi_print_ctrl_path_cal_stats_tlv(struct ath11k_base *ab, u16 len, ++ const void *ptr, void *data) ++{ ++ struct wmi_ctrl_path_stats_ev_parse_param *stats_buff = (struct wmi_ctrl_path_stats_ev_parse_param *)data; ++ struct wmi_ctrl_path_cal_stats *cal_stats_skb = (struct wmi_ctrl_path_cal_stats *)ptr; ++ struct wmi_ctrl_path_cal_stats *cal_stats = NULL; ++ struct wmi_ctrl_path_stats_list *stats = kzalloc(sizeof(struct wmi_ctrl_path_stats_list),GFP_ATOMIC); ++ struct ath11k *ar = NULL; ++ ++ if (!stats) ++ return -ENOMEM; ++ ++ cal_stats = kzalloc(sizeof(*cal_stats), GFP_ATOMIC); ++ if (!cal_stats) { ++ kfree(stats); ++ return -ENOMEM; ++ } ++ ++ memcpy(cal_stats, cal_stats_skb, sizeof(struct wmi_ctrl_path_cal_stats)); ++ stats->stats_ptr = cal_stats; ++ list_add_tail(&stats->list, &stats_buff->list); ++ ++ ar = ath11k_mac_get_ar_by_pdev_id(ab, cal_stats_skb->pdev_id + 1); ++ if (!ar) { ++ ath11k_warn(ab, "Failed to get ar for wmi ctrl cal stats\n"); ++ return -EINVAL; ++ } ++ ++ ar->debug.wmi_ctrl_path_stats_tagid = WMI_CTRL_PATH_CAL_STATS; ++ stats_buff->ar = ar; ++ return 0; ++} ++ ++static int ath11k_wmi_ctrl_stats_subtlv_parser(struct ath11k_base *ab, ++ u16 tag, u16 len, ++ const void *ptr, void *data) ++{ ++ int ret = 0; ++ ++ switch (tag) { ++ case WMI_CTRL_PATH_STATS_EV_FIXED_PARAM: ++ break; ++ case WMI_CTRL_PATH_PDEV_STATS: ++ ret = wmi_print_ctrl_path_pdev_tx_stats_tlv(ab, len, ptr, data); ++ break; ++ case WMI_CTRL_PATH_CAL_STATS: ++ ret = wmi_print_ctrl_path_cal_stats_tlv(ab, len, ptr, data); ++ break; ++ /* Add case for newly wmi ctrl path added stats here */ ++ default: ++ ath11k_warn(ab, ++ "Received invalid tag for wmi ctrl path stats in subtlvs\n"); ++ return -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++static int ath11k_wmi_ctrl_stats_event_parser(struct ath11k_base *ab, ++ u16 tag, u16 len, ++ const void *ptr, void *data) ++{ ++ int ret = 0; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, "wmi ctrl path stats tag 0x%x of len %d rcvd\n", ++ tag, len); ++ ++ switch (tag) { ++ case WMI_CTRL_PATH_STATS_EV_FIXED_PARAM: ++ /* Fixed param is already processed*/ ++ break; ++ case WMI_TAG_ARRAY_STRUCT: ++ /* len 0 is expected for array of struct when there ++ * is no content of that type to pack inside that tlv ++ */ ++ if (len == 0) ++ return 0; ++ ret = ath11k_wmi_tlv_iter(ab, ptr, len, ++ ath11k_wmi_ctrl_stats_subtlv_parser, ++ data); ++ break; ++ default: ++ ath11k_warn(ab, "Received invalid tag for wmi ctrl path stats\n"); ++ ret = -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++static void ath11k_wmi_ctrl_path_stats_event(struct ath11k_base *ab, struct sk_buff *skb) ++{ ++ int ret; ++ const struct wmi_tlv *tlv; ++ struct wmi_ctrl_path_stats_ev_param *fixed_param; ++ u16 tlv_tag; ++ u8 *ptr = skb->data; ++ struct ath11k *ar = NULL; ++ struct wmi_ctrl_path_stats_ev_parse_param param; ++ INIT_LIST_HEAD(¶m.list); ++ ++ if (!skb->data) { ++ ath11k_warn(ab, "No data present in wmi ctrl stats event\n"); ++ return; ++ } ++ ++ if (skb->len < (sizeof(*fixed_param) + TLV_HDR_SIZE)) { ++ ath11k_warn(ab, "wmi ctrl stats event size invalid\n"); ++ return; ++ } ++ ++ param.ar = NULL; ++ ++ tlv = (struct wmi_tlv *)ptr; ++ tlv_tag = FIELD_GET(WMI_TLV_TAG, tlv->header); ++ ptr += sizeof(*tlv); ++ ++ if (tlv_tag == WMI_CTRL_PATH_STATS_EV_FIXED_PARAM) { ++ fixed_param = (struct wmi_ctrl_path_stats_ev_param *)ptr; ++ } else { ++ ath11k_warn(ab, "wmi ctrl Stats received without fixed param tlv at start\n"); ++ } ++ ++ ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, ++ ath11k_wmi_ctrl_stats_event_parser, ++ ¶m); ++ if (ret) { ++ ath11k_warn(ab, "failed to parse wmi_ctrl_path_stats tlv: %d\n", ret); ++ goto free; ++ } ++ ++ ar = param.ar; ++ if (!ar) ++ return; ++ ++ list_splice_tail_init(¶m.list, &ar->debug.wmi_list); ++ ++ if (!fixed_param->more) { ++ complete(&ar->debug.wmi_ctrl_path_stats_rcvd); ++ ath11k_dbg(ab, ATH11K_DBG_WMI,"wmi ctrl path stats completed"); ++ } ++ ++free: ++ ath11k_wmi_crl_path_stats_list_free(¶m.list); ++} ++ ++ + static struct ath11k *ath11k_get_ar_on_scan_abort(struct ath11k_base *ab, + u32 vdev_id) + { +@@ -8779,6 +9064,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_QOS_NULL_FRAME_TX_COMPLETION_EVENTID: + ath11k_qos_null_compl_event(ab, skb); + break; ++ case WMI_CTRL_PATH_STATS_EVENTID: ++ ath11k_wmi_ctrl_path_stats_event(ab, skb); ++ break; + /* TODO: Add remaining events */ + default: + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -454,6 +454,8 @@ enum wmi_tlv_cmd_id { + WMI_REQUEST_RCPI_CMDID, + WMI_REQUEST_PEER_STATS_INFO_CMDID, + WMI_REQUEST_RADIO_CHAN_STATS_CMDID, ++ WMI_REQUEST_WLM_STATS_CMDID, ++ WMI_REQUEST_CTRL_PATH_STATS_CMDID, + WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_TLV_CMD(WMI_GRP_ARP_NS_OFL), + WMI_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID, + WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID, +@@ -723,6 +725,8 @@ enum wmi_tlv_event_id { + WMI_UPDATE_RCPI_EVENTID, + WMI_PEER_STATS_INFO_EVENTID, + WMI_RADIO_CHAN_STATS_EVENTID, ++ WMI_WLM_STATS_EVENTID, ++ WMI_CTRL_PATH_STATS_EVENTID, + WMI_NLO_MATCH_EVENTID = WMI_TLV_CMD(WMI_GRP_NLO_OFL), + WMI_NLO_SCAN_COMPLETE_EVENTID, + WMI_APFIND_EVENTID, +@@ -1878,6 +1882,11 @@ enum wmi_tlv_tag { + WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, + WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD, + WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD, ++ /* TODO add all the missing cmds */ ++ WMI_CTRL_PATH_STATS_CMD_FIXED_PARAM = ++ WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD + 4, ++ WMI_CTRL_PATH_STATS_EV_FIXED_PARAM, ++ WMI_CTRL_PATH_PDEV_STATS, + WMI_TAG_TPC_STATS_GET_CMD = 0x38B, + WMI_TAG_TPC_STATS_EVENT_FIXED_PARAM, + WMI_TAG_TPC_STATS_CONFIG_EVENT, +@@ -1887,6 +1896,7 @@ enum wmi_tlv_tag { + /* TODO add all the missing cmds */ + WMI_TAG_QOS_NULL_FRAME_TX_SEND = 0x3A6, + WMI_TAG_QOS_NULL_FRAME_TX_STATUS, ++ WMI_CTRL_PATH_CAL_STATS = 0x3BC, + + WMI_TAG_MAX + }; +@@ -5342,6 +5352,257 @@ struct wmi_twt_resume_dialog_params_cmd + u32 next_twt_size; + }; + ++/** ++ * WMI arrays of length WMI_MGMT_FRAME_SUBTYPE_MAX use the ++ * IEEE802.11 standard's enumeration of mgmt frame subtypes: ++ * 0 -> IEEE80211_STYPE_FC0_SUBTYPE_ASSOC_REQ ++ * 1 -> IEEE80211_STYPE_FC0_SUBTYPE_ASSOC_RESP ++ * 2 -> IEEE80211_STYPE_FC0_SUBTYPE_REASSOC_REQ ++ * 3 -> IEEE80211_STYPE_FC0_SUBTYPE_REASSOC_RESP ++ * 4 -> IEEE80211_STYPE_FC0_SUBTYPE_PROBE_REQ ++ * 5 -> IEEE80211_STYPE_FC0_SUBTYPE_PROBE_RESP ++ * 6 -> Reserved ++ * 7 -> Reserved ++ * 8 -> IEEE80211_STYPE_FC0_SUBTYPE_BEACON ++ * 9 -> IEEE80211_STYPE_FC0_SUBTYPE_ATIM ++ * 10 -> IEEE80211_STYPE_FC0_SUBTYPE_DISASSOC ++ * 11 -> IEEE80211_STYPE_FC0_SUBTYPE_AUTH ++ * 12 -> IEEE80211_STYPE_FC0_SUBTYPE_DEAUTH ++ * 13 -> IEEE80211_STYPE_FCO_SUBTYPE_ACTION ++ * 14 -> IEEE80211_STYPE_FC0_SUBTYPE_ACTION_NOACK ++ * 15 -> IEEE80211_STYPE_FC0_SUBTYPE_RESERVED ++ */ ++#define WMI_MGMT_FRAME_SUBTYPE_MAX 16 ++#define WMI_MAX_STRING_LEN 256 ++ ++enum wmi_ctrl_path_cal_prof_id { ++ WMI_CTRL_PATH_STATS_CAL_PROF_COLD_BOOT_CAL = 0, ++ WMI_CTRL_PATH_STATS_CAL_PROF_FULL_CHAN_SWITCH, ++ WMI_CTRL_PATH_STATS_CAL_PROF_SCAN_CHAN_SWITCH, ++ WMI_CTRL_PATH_STATS_CAL_PROF_DPD_SPLIT_CAL, ++ WMI_CTRL_PATH_STATS_CAL_PROF_TEMP_TRIGEER_CAL, ++ WMI_CTRL_PATH_STATS_CAL_PROF_POWER_SAVE_WAKE_UP, ++ WMI_CTRL_PATH_STATS_CAL_PROF_TIMER_TRIGGER_CAL, ++ WMI_CTRL_PATH_STATS_CAL_PROF_FTM_TRIGGER_CAL, ++ WMI_CTRL_PATH_STATS_CAL_PROF_AGILE_OR_POWER_DOWN_DTIM, ++ WMI_CTRL_PATH_STATS_CAL_PROF_NOISY_ENV_RXDO, ++ /* IDs from 10 to 30 for future use*/ ++ WMI_CTRL_PATH_STATS_CAL_PROFILE_INVALID = 0x1F, ++}; ++ ++static inline const char * ++wmi_ctrl_path_cal_prof_id_to_name(u8 prof_id) { ++ switch (prof_id) { ++ case WMI_CTRL_PATH_STATS_CAL_PROF_COLD_BOOT_CAL: ++ return "COLD_BOOT_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_FULL_CHAN_SWITCH: ++ return "FULL_CHAN_SWITCH"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_SCAN_CHAN_SWITCH: ++ return "SCAN_CHAN_SWITCH"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_DPD_SPLIT_CAL: ++ return "DPD_SPLIT_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_TEMP_TRIGEER_CAL: ++ return "TEMP_TRIGEER_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_POWER_SAVE_WAKE_UP: ++ return "POWER_SAVE_WAKE_UP"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_TIMER_TRIGGER_CAL: ++ return "TIMER_TRIGGER_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_FTM_TRIGGER_CAL: ++ return "FTM_TRIGGER_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_AGILE_OR_POWER_DOWN_DTIM: ++ return "AGILE_OR_POWER_DOWN_DTIM"; ++ case WMI_CTRL_PATH_STATS_CAL_PROF_NOISY_ENV_RXDO: ++ return "NOISY_ENV_RXDO"; ++ case WMI_CTRL_PATH_STATS_CAL_PROFILE_INVALID: ++ break; ++ } ++ return "UNKOWN_CAL_PROFILE"; ++} ++ ++enum wmi_ctrl_path_cal_type_id { ++ WMI_CTRL_PATH_STATS_CAL_TYPE_ADC = 0, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DAC, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_PROCESS, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_TXLO, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_TXIQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_RXIQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_IM2, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_LNA, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_IBF, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_BWFILTER, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_PEF, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_PADROOP, ++ WMI_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC, ++ /* IDs 25 to 254 for future use*/ ++ WMI_CTRL_PATH_STATS_CAL_TYPE_INVALID = 0xff, ++}; ++ ++static inline const char * ++wmi_ctrl_path_cal_type_id_to_name(u8 type_id) { ++ switch (type_id) { ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_ADC: ++ return "ADC"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DAC: ++ return "DAC"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_PROCESS: ++ return "PROCESS"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR: ++ return "NOISE_FLOOR"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO: ++ return "RXDCO"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ: ++ return "COMB_TXLO_TXIQ_RXIQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_TXLO: ++ return "TXLO"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_TXIQ: ++ return "TXIQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_RXIQ: ++ return "RXIQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_IM2: ++ return "IM2"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_LNA: ++ return "LNA"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO: ++ return "DPD_LP_RXDCO"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ: ++ return "DPD_LP_RXIQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS: ++ return "DPD_MEMORYLESS"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY: ++ return "DPD_MEMORY"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_IBF: ++ return "IBF"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL: ++ return "PDET_AND_PAL"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ: ++ return "RXDCO_IQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM: ++ return "RXDCO_DTIM"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL: ++ return "TPC_CAL"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ: ++ return "DPD_TIMEREQ"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_BWFILTER: ++ return "BWFILTER"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_PEF: ++ return "PEF"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_PADROOP: ++ return "PADROOP"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC: ++ return "SELFCALTPC"; ++ case WMI_CTRL_PATH_STATS_CAL_TYPE_INVALID: ++ break; ++ } ++ return "UNKNOWN_CAL_TYPE"; ++} ++ ++enum wmi_ctrl_path_periodic_cal_type_id { ++ WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_NOISE_FLOOR, ++ WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_DPD_MEMORYLESS, ++ WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_DPD_MEMORY, ++ /* IDs 3 to 254 for future use*/ ++ WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_INVALID = 0xFF, ++}; ++ ++static inline const char * ++wmi_ctrl_path_periodic_cal_type_id_to_name(u8 type_id) { ++ switch(type_id) { ++ case WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_NOISE_FLOOR: ++ return "NOISE_FLOOR"; ++ case WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_DPD_MEMORYLESS: ++ return "DPD_MEMORYLESS"; ++ case WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_DPD_MEMORY: ++ return "DPD_MEMORY"; ++ case WMI_CTRL_PATH_STATS_PERIODIC_CAL_TYPE_INVALID: ++ break; ++ } ++ return "UNKNOWN_PERIODIC_CAL_TYPE"; ++} ++ ++#define WMI_CTRL_PATH_CAL_PROF_MASK GENMASK(12, 8) ++#define WMI_CTRL_PATH_CAL_TYPE_MASK GENMASK(7, 0) ++#define WMI_CTRL_PATH_IS_PERIODIC_CAL GENMASK(13, 13) ++ ++struct wmi_ctrl_path_pdev_stats { ++ u32 pdev_id; ++ u32 tx_mgmt_subtype[WMI_MGMT_FRAME_SUBTYPE_MAX]; ++ u32 rx_mgmt_subtype[WMI_MGMT_FRAME_SUBTYPE_MAX]; ++ u32 scan_fail_dfs_violation_time_ms; ++ u32 nol_chk_fail_last_chan_freq; ++ u32 nol_chk_fail_time_stamp_ms; ++ u32 tot_peer_create_cnt; ++ u32 tot_peer_del_cnt; ++ u32 tot_peer_del_resp_cnt; ++ u32 vdev_pause_fail_rt_to_sched_algo_fifo_full_cnt; ++}; ++ ++struct wmi_ctrl_path_cal_stats { ++ u32 pdev_id; ++ u32 cal_info; ++ u32 cal_triggered_cnt; ++ u32 cal_fail_cnt; ++ u32 cal_fcs_cnt; ++ u32 cal_fcs_fail_cnt; ++}; ++ ++struct wmi_ctrl_path_stats_cmd_param { ++ u32 tlv_header; ++ u32 stats_id; ++ u32 req_id; ++ /* get/reset/start/stop based on stats id is defined as ++ * a part of wmi_ctrl_path_stats_action ++ */ ++ u32 action; ++}; ++ ++ ++struct wmi_ctrl_path_stats_ev_param { ++ u32 req_id; ++ /* more flag ++ * 1 - More events sent after this event. ++ * 0 - no more events after this event. ++ */ ++ u32 more; ++}; ++ ++struct wmi_ctrl_path_stats_list { ++ struct list_head list; ++ void *stats_ptr; ++}; ++ ++struct wmi_ctrl_path_stats_ev_parse_param { ++ struct list_head list; ++ struct ath11k *ar; ++}; ++ ++enum wmi_ctrl_path_stats_id { ++ /* bit 0 is currently unused / reserved */ ++ WMI_REQ_CTRL_PATH_PDEV_TX_STAT = 1, ++ WMI_REQ_CTRL_PATH_VDEV_EXTD_STAT = 2, ++ WMI_REQ_CTRL_PATH_MEM_STAT = 3, ++ WMI_REQ_CTRL_PATH_CAL_STAT = 5, ++}; ++ ++enum wmi_ctrl_path_stats_action { ++ /* bit 0 is currently unused / reserved */ ++ WMI_REQ_CTRL_PATH_STAT_GET = 1, ++ WMI_REQ_CTRL_PATH_STAT_RESET = 2, ++ WMI_REQ_CTRL_PATH_STAT_START = 3, ++ WMI_REQ_CTRL_PATH_STAT_STOP = 4, ++}; ++ + struct wmi_obss_spatial_reuse_params_cmd { + u32 tlv_header; + u32 pdev_id; +@@ -5851,6 +6112,7 @@ struct wmi_qos_null_tx_cmd { + + #define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ) + #define WMI_SEND_TIMEOUT_HZ (3 * HZ) ++#define WMI_CTRL_STATS_READY_TIMEOUT_HZ (1 * HZ) + + enum ath11k_wmi_peer_ps_param { + WMI_PEER_STA_WAKEUP_MODE = 0, +@@ -6227,5 +6489,6 @@ int ath11k_wmi_pdev_get_tpc_table_cmdid( + void ath11k_wmi_free_tpc_stats_mem(struct ath11k *ar); + int ath11k_wmi_send_aggr_size_cmd(struct ath11k *ar, + struct set_custom_aggr_size_params *params); +- ++int ath11k_wmi_send_wmi_ctrl_stats_cmd(struct ath11k *ar, ++ struct wmi_ctrl_path_stats_cmd_param *param); + #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-Clear-auth-flag-only-for-actual-association-i.patch b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-Clear-auth-flag-only-for-actual-association-i.patch new file mode 100644 index 000000000..fbd9bb10f --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-Clear-auth-flag-only-for-actual-association-i.patch @@ -0,0 +1,66 @@ +From 0ead9297ed3372961b436f5c840f40f688a8eb58 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Fri, 8 Jan 2021 12:15:26 +0530 +Subject: [PATCH] ath11k: Clear auth flag only for actual association in + security mode + +AUTH flag is needed when peer assoc command is sent from host in +security mode for non-assoc cases. Firmware will handle AUTH flag +when client is associating as AUTH flag will be set after key exchange. +For internally provided peer assoc commands from host, there won't be +any key exchange, so AUTH flag is expected to be set in host. + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/mac.c | 3 +++ + drivers/net/wireless/ath/ath11k/wmi.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.h | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -2631,6 +2631,7 @@ static void ath11k_bss_assoc(struct ieee + + rcu_read_unlock(); + ++ peer_arg.is_assoc = true; + ret = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg); + if (ret) { + ath11k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n", +@@ -4062,6 +4063,7 @@ static int ath11k_station_assoc(struct a + + ath11k_peer_assoc_prepare(ar, vif, sta, &peer_arg, reassoc); + ++ peer_arg.is_assoc = true; + ret = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg); + if (ret) { + ath11k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n", +@@ -4275,6 +4277,7 @@ static void ath11k_sta_rc_update_wk(stru + ath11k_peer_assoc_prepare(ar, arvif->vif, sta, + &peer_arg, true); + ++ peer_arg.is_assoc = false; + err = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg); + if (err) + ath11k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n", +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -2057,7 +2057,7 @@ ath11k_wmi_copy_peer_flags(struct wmi_pe + cmd->peer_flags |= WMI_PEER_AUTH; + if (param->need_ptk_4_way) { + cmd->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; +- if (!hw_crypto_disabled) ++ if (!hw_crypto_disabled && param->is_assoc) + cmd->peer_flags &= ~WMI_PEER_AUTH; + } + if (param->need_gtk_2_way) +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -3834,6 +3834,7 @@ struct peer_assoc_params { + u32 peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET]; + bool twt_responder; + bool twt_requester; ++ bool is_assoc; + struct ath11k_ppe_threshold peer_ppet; + }; + diff --git a/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-add-trace-log-support.patch b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-add-trace-log-support.patch new file mode 100644 index 000000000..c18628887 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-add-trace-log-support.patch @@ -0,0 +1,200 @@ +From 98106256d6d36db5e6b848a969d0e7a7728be864 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Tue, 22 Dec 2020 20:29:01 +0530 +Subject: [PATCH] ath11k: add trace log support + +This change is to add trace log support for, + * WMI events + * WMI commands + * ath11k_dbg messages + * ath11k_dbg_dump messages + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/debug.c | 6 +- + drivers/net/wireless/ath/ath11k/trace.h | 124 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.c | 4 ++ + 3 files changed, 133 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/debug.c ++++ b/drivers/net/wireless/ath/ath11k/debug.c +@@ -68,7 +68,7 @@ void __ath11k_dbg(struct ath11k_base *ab + if (ath11k_debug_mask & mask) + dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); + +- /* TODO: trace log */ ++ trace_ath11k_log_dbg(ab, mask, &vaf); + + va_end(args); + } +@@ -100,6 +100,10 @@ void ath11k_dbg_dump(struct ath11k_base + dev_printk(KERN_DEBUG, ab->dev, "%s\n", linebuf); + } + } ++ ++ /* tracing code doesn't like null strings */ ++ trace_ath11k_log_dbg_dump(ab, msg ? msg : "", prefix ? prefix : "", ++ buf, len); + } + EXPORT_SYMBOL(ath11k_dbg_dump); + +--- a/drivers/net/wireless/ath/ath11k/trace.h ++++ b/drivers/net/wireless/ath/ath11k/trace.h +@@ -20,6 +20,8 @@ static inline void trace_ ## name(proto) + #undef TRACE_SYSTEM + #define TRACE_SYSTEM ath11k + ++#define ATH11K_MSG_MAX 400 ++ + TRACE_EVENT(ath11k_htt_pktlog, + TP_PROTO(struct ath11k *ar, const void *buf, u16 buf_len, + u32 pktlog_checksum), +@@ -76,6 +78,128 @@ TRACE_EVENT(ath11k_ps_timekeeper, + ) + ); + ++TRACE_EVENT(ath11k_wmi_cmd, ++ TP_PROTO(struct ath11k_base *ab, int id, const void *buf, size_t buf_len), ++ ++ TP_ARGS(ab, id, buf, buf_len), ++ ++ TP_STRUCT__entry( ++ __string(device, dev_name(ab->dev)) ++ __string(driver, dev_driver_string(ab->dev)) ++ __field(unsigned int, id) ++ __field(size_t, buf_len) ++ __dynamic_array(u8, buf, buf_len) ++ ), ++ ++ TP_fast_assign( ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); ++ __entry->id = id; ++ __entry->buf_len = buf_len; ++ memcpy(__get_dynamic_array(buf), buf, buf_len); ++ ), ++ ++ TP_printk( ++ "%s %s id %d len %zu", ++ __get_str(driver), ++ __get_str(device), ++ __entry->id, ++ __entry->buf_len ++ ) ++); ++ ++TRACE_EVENT(ath11k_wmi_event, ++ TP_PROTO(struct ath11k_base *ab, int id, const void *buf, size_t buf_len), ++ ++ TP_ARGS(ab, id, buf, buf_len), ++ ++ TP_STRUCT__entry( ++ __string(device, dev_name(ab->dev)) ++ __string(driver, dev_driver_string(ab->dev)) ++ __field(unsigned int, id) ++ __field(size_t, buf_len) ++ __dynamic_array(u8, buf, buf_len) ++ ), ++ ++ TP_fast_assign( ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); ++ __entry->id = id; ++ __entry->buf_len = buf_len; ++ memcpy(__get_dynamic_array(buf), buf, buf_len); ++ ), ++ ++ TP_printk( ++ "%s %s id %d len %zu", ++ __get_str(driver), ++ __get_str(device), ++ __entry->id, ++ __entry->buf_len ++ ) ++); ++ ++TRACE_EVENT(ath11k_log_dbg, ++ TP_PROTO(struct ath11k_base *ab, unsigned int level, struct va_format *vaf), ++ ++ TP_ARGS(ab, level, vaf), ++ ++ TP_STRUCT__entry( ++ __string(device, dev_name(ab->dev)) ++ __string(driver, dev_driver_string(ab->dev)) ++ __field(unsigned int, level) ++ __dynamic_array(char, msg, ATH11K_MSG_MAX) ++ ), ++ ++ TP_fast_assign( ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); ++ __entry->level = level; ++ WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), ++ ATH11K_MSG_MAX, vaf->fmt, ++ *vaf->va) >= ATH11K_MSG_MAX); ++ ), ++ ++ TP_printk( ++ "%s %s %s", ++ __get_str(driver), ++ __get_str(device), ++ __get_str(msg) ++ ) ++); ++ ++TRACE_EVENT(ath11k_log_dbg_dump, ++ TP_PROTO(struct ath11k_base *ab, const char *msg, const char *prefix, ++ const void *buf, size_t buf_len), ++ ++ TP_ARGS(ab, msg, prefix, buf, buf_len), ++ ++ TP_STRUCT__entry( ++ __string(device, dev_name(ab->dev)) ++ __string(driver, dev_driver_string(ab->dev)) ++ __string(msg, msg) ++ __string(prefix, prefix) ++ __field(size_t, buf_len) ++ __dynamic_array(u8, buf, buf_len) ++ ), ++ ++ TP_fast_assign( ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); ++ __assign_str(msg, msg); ++ __assign_str(prefix, prefix); ++ __entry->buf_len = buf_len; ++ memcpy(__get_dynamic_array(buf), buf, buf_len); ++ ), ++ ++ TP_printk( ++ "%s %s %s/%s\n", ++ __get_str(driver), ++ __get_str(device), ++ __get_str(prefix), ++ __get_str(msg) ++ ) ++); ++ + TRACE_EVENT(ath11k_htt_ppdu_stats, + TP_PROTO(struct ath11k *ar, const void *data, size_t len), + +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -266,6 +266,8 @@ static int ath11k_wmi_cmd_send_nowait(st + cmd_hdr = (struct wmi_cmd_hdr *)skb->data; + cmd_hdr->cmd_id = cmd; + ++ trace_ath11k_wmi_cmd(ab, cmd_id, skb->data, skb->len); ++ + memset(skb_cb, 0, sizeof(*skb_cb)); + ret = ath11k_htc_send(&ab->htc, wmi->eid, skb); + +@@ -8931,6 +8933,8 @@ static void ath11k_wmi_tlv_op_rx(struct + if (skb_pull(skb, sizeof(struct wmi_cmd_hdr)) == NULL) + goto out; + ++ trace_ath11k_wmi_event(ab, id, skb->data, skb->len); ++ + switch (id) { + /* Process all the WMI events here */ + case WMI_SERVICE_READY_EVENTID: diff --git a/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-qcn6122-support.patch b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-qcn6122-support.patch new file mode 100644 index 000000000..f5a90a9da --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/232-ath11k-qcn6122-support.patch @@ -0,0 +1,1823 @@ +From 12ce51423d768da650db9c76c5b67a8d2e86ff8c Mon Sep 17 00:00:00 2001 +From: Sowmiya Sree Elavalagan +Date: Tue, 22 Dec 2020 20:08:37 +0530 +Subject: [PATCH] ath11k: qcn9100 bring up + +Add qcn9100 platform support. +qcn9100 is a hybrid bus type device which is enumerated as +pci device by Q6 and enumerates as ahb device on host. +It uses qgic interrupts to notify events to host driver. +Used qgic api to convert MSI interrupt to qgic interrupt. +Added qmi message to learn bar address from qcn9100. +Test performed: +Ran ping test for open, ccmp and tkip modes. +Ran iperf traffic for few mins. + +Signed-off-by: Sowmiya Sree Elavalagan +--- + drivers/net/wireless/ath/ath11k/ahb.c | 190 +++++++++++++++++++++---- + drivers/net/wireless/ath/ath11k/ce.c | 2 +- + drivers/net/wireless/ath/ath11k/core.c | 80 +++++++++-- + drivers/net/wireless/ath/ath11k/core.h | 11 ++ + drivers/net/wireless/ath/ath11k/debugfs.c | 7 +- + drivers/net/wireless/ath/ath11k/hal.h | 1 - + drivers/net/wireless/ath/ath11k/hif.h | 33 +++++ + drivers/net/wireless/ath/ath11k/hw.c | 117 +++++++++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 3 + + drivers/net/wireless/ath/ath11k/mhi.c | 6 +- + drivers/net/wireless/ath/ath11k/nss.c | 3 + + drivers/net/wireless/ath/ath11k/nss.h | 1 + + drivers/net/wireless/ath/ath11k/pci.c | 243 +++++++++++++++++++++----------- + drivers/net/wireless/ath/ath11k/pci.h | 62 +++++++- + drivers/net/wireless/ath/ath11k/qmi.c | 178 ++++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/qmi.h | 23 ++- + 16 files changed, 828 insertions(+), 132 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -12,7 +12,9 @@ + #include "debug.h" + #include "hif.h" + #include "qmi.h" ++#include "pci.h" + #include ++#include + + static const struct of_device_id ath11k_ahb_of_match[] = { + /* TODO: Should we change the compatible string to something similar +@@ -27,6 +29,9 @@ static const struct of_device_id ath11k_ + { .compatible = "qcom,ipq5018-wifi", + .data = (void *)ATH11K_HW_IPQ5018, + }, ++ { .compatible = "qcom,qcn6122-wifi", ++ .data = (void *)ATH11K_HW_QCN6122, ++ }, + { } + }; + +@@ -39,6 +44,14 @@ static const struct ath11k_bus_params at + .fixed_mem_region = true, + }; + ++static const struct ath11k_bus_params ath11k_internal_pci_bus_params = { ++ .mhi_support = false, ++ .m3_fw_support = false, ++ .fixed_bdf_addr = true, ++ .fixed_mem_region = true, ++ .static_window_map = true, ++}; ++ + #define ATH11K_IRQ_CE0_OFFSET 4 + + static const char *irq_name[ATH11K_IRQ_NUM_MAX] = { +@@ -376,6 +389,29 @@ static void ath11k_ahb_power_down(struct + rproc_shutdown(ab_ahb->tgt_rproc); + } + ++static int ath11k_get_userpd_id(struct device *dev) ++{ ++ int ret; ++ int userpd_id = 0; ++ const char *subsys_name; ++ ++ ret = of_property_read_string(dev->of_node, ++ "qcom,userpd-subsys-name", ++ &subsys_name); ++ if (ret) { ++ dev_err(dev, "Not multipd architecture"); ++ return 0; ++ } ++ ++ if (strcmp(subsys_name, "q6v5_wcss_userpd2") == 0) { ++ userpd_id = QCN6122_USERPD_0; ++ } else if (strcmp(subsys_name, "q6v5_wcss_userpd3") == 0) { ++ userpd_id = QCN6122_USERPD_1; ++ } ++ ++ return userpd_id; ++} ++ + static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) + { + struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; +@@ -385,6 +421,7 @@ static void ath11k_ahb_init_qmi_ce_confi + cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; + cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; + ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; ++ ab->qmi.service_ins_id += ab->userpd_id; + } + + static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) +@@ -559,10 +596,65 @@ static int ath11k_ahb_ext_irq_config(str + return 0; + } + ++static void ath11k_internal_pci_free_irq(struct ath11k_base *ab) ++{ ++ ath11k_pci_free_irq(ab); ++ qgic2_disable_msi(ab->ipci.qgicm_id); ++} ++ ++struct qgic2_msi *ath11k_qgic2_enable_msi(struct ath11k_base *ab, int qgicm_id) ++{ ++ struct qgic2_msi *qgic2_msi; ++ ++ ab->ipci.msi_cfg = &ath11k_msi_config[ATH11K_MSI_CONFIG_QCN6122]; ++ qgic2_msi = qgic2_enable_msi(qgicm_id, ++ ab->ipci.msi_cfg->total_vectors); ++ if (IS_ERR(qgic2_msi)) { ++ ath11k_err(ab, "qgic2_enable_msi fails %ld\n", PTR_ERR(qgic2_msi)); ++ return NULL; ++ } ++ ++ return qgic2_msi; ++} ++ ++static int ath11k_config_irq_internal_pci(struct ath11k_base *ab) ++{ ++ int ret; ++ ++ if (ab->userpd_id == QCN6122_USERPD_0) { ++ ab->ipci.qgicm_id = APCS_QGIC2M_0; ++ } else if (ab->userpd_id == QCN6122_USERPD_1) { ++ ab->ipci.qgicm_id = APCS_QGIC2M_1; ++ } else { ++ ath11k_warn(ab, "ath11k userpd invalid %d\n", ab->userpd_id); ++ return -ENODEV; ++ } ++ ++ ab->ipci.qgic2_msi = ++ ath11k_qgic2_enable_msi(ab, ab->ipci.qgicm_id); ++ if (!ab->ipci.qgic2_msi) { ++ ath11k_err(ab, "qgic2_msi fails: dev %d\n", ab->hw_rev); ++ return -ENODEV; ++ } ++ ab->ipci.qgic_enabled = 1; ++ wake_up(&ab->ipci.qgic_msi_waitq); ++ ++ /* qcn6122 is seen as ahb based device by driver but internallly it is pci ++ * Hence configuring pci irq for qcn6122 ++ */ ++ ret = ath11k_pci_config_qgic_msi_irq(ab); ++ if (ret) { ++ ath11k_err(ab, "internal pci msi configuration failed: dev %d\n", ++ ab->hw_rev); ++ qgic2_disable_msi(ab->ipci.qgicm_id); ++ } ++ return ret; ++} ++ + static int ath11k_ahb_config_irq(struct ath11k_base *ab) + { + int irq, irq_idx, i; +- int ret; ++ int ret = 0; + + /* Configure CE irqs */ + for (i = 0; i < ab->hw_params.ce_count; i++) { +@@ -643,25 +735,67 @@ static const struct ath11k_hif_ops ath11 + .map_service_to_pipe = ath11k_ahb_map_service_to_pipe, + .power_down = ath11k_ahb_power_down, + .power_up = ath11k_ahb_power_up, ++ .free_irq = ath11k_ahb_free_irq, ++ .config_irq = ath11k_ahb_config_irq, ++}; ++ ++static const struct ath11k_hif_ops ath11k_internal_pci_hif_ops = { ++ .start = ath11k_ipci_start, ++ .stop = ath11k_pci_stop, ++ .read32 = ath11k_ipci_read32, ++ .write32 = ath11k_ipci_write32, ++ .power_down = ath11k_ahb_power_down, ++ .power_up = ath11k_ahb_power_up, ++ .irq_enable = ath11k_pci_ext_irq_enable, ++ .irq_disable = ath11k_pci_ext_irq_disable, ++ .get_msi_address = ath11k_pci_get_qgic_msi_address, ++ .get_user_msi_vector = ath11k_get_user_qgic_msi_assignment, ++ .map_service_to_pipe = ath11k_pci_map_service_to_pipe, ++ .get_window_offset = ath11k_pci_get_window_offset, ++ .get_ce_msi_idx = ath11k_pci_get_ce_msi_idx, ++ /* TODO: Additional hif ops has been brought in to remove ++ * platform checks. QCN6122 is a hybrid bus which is a ++ * combination of pic and ahb. This addition ops needs ++ * to be removed in future ++ */ ++ .config_static_window = ath11k_pci_config_static_window, ++ .free_irq = ath11k_internal_pci_free_irq, ++ .config_irq = ath11k_config_irq_internal_pci, ++ .get_msi_irq = ath11k_pci_get_qgic_msi_irq, + }; + + static int ath11k_core_get_rproc(struct ath11k_base *ab) + { + struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab); + struct device *dev = ab->dev; ++ const char *name; + struct rproc *prproc; + phandle rproc_phandle; ++ bool multi_pd_arch; + +- if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) { +- ath11k_err(ab, "failed to get q6_rproc handle\n"); +- return -ENOENT; +- } ++ multi_pd_arch = of_property_read_bool(dev->of_node, "qcom,multipd_arch"); ++ if (multi_pd_arch) { ++ if (of_property_read_string(dev->of_node, "qcom,userpd-subsys-name", &name)) ++ return -EINVAL; ++ ++ prproc = rproc_get_by_name(name); ++ if (!prproc) { ++ ath11k_err(ab, "failed to get rproc\n"); ++ return -EINVAL; ++ } ++ } else { ++ if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) { ++ ath11k_err(ab, "failed to get q6_rproc handle\n"); ++ return -ENOENT; ++ } + +- prproc = rproc_get_by_phandle(rproc_phandle); +- if (!prproc) { +- ath11k_err(ab, "failed to get rproc\n"); +- return -EINVAL; ++ prproc = rproc_get_by_phandle(rproc_phandle); ++ if (!prproc) { ++ ath11k_err(ab, "failed to get rproc\n"); ++ return -EINVAL; ++ } + } ++ + ab_ahb->tgt_rproc = prproc; + + return 0; +@@ -675,6 +809,7 @@ static int ath11k_ahb_probe(struct platf + struct resource *mem_res; + void __iomem *mem; + int ret; ++ int userpd_id; + u32 hw_mode_id; + + of_id = of_match_device(ath11k_ahb_of_match, &pdev->dev); +@@ -683,18 +818,7 @@ static int ath11k_ahb_probe(struct platf + return -EINVAL; + } + +- mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!mem_res) { +- dev_err(&pdev->dev, "failed to get IO memory resource\n"); +- return -ENXIO; +- } +- +- mem = devm_ioremap_resource(&pdev->dev, mem_res); +- if (IS_ERR(mem)) { +- dev_err(&pdev->dev, "ioremap error\n"); +- return PTR_ERR(mem); +- } +- ++ userpd_id = ath11k_get_userpd_id(dev); + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(&pdev->dev, "failed to set 32-bit consistent dma\n"); +@@ -713,25 +837,45 @@ static int ath11k_ahb_probe(struct platf + ab->pdev = pdev; + ab->hw_rev = (enum ath11k_hw_rev)of_id->data; + ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; +- ab->mem = mem; +- ab->mem_pa = mem_res->start; +- ab->mem_len = resource_size(mem_res); + ab->enable_cold_boot_cal = enable_cold_boot_cal; ++ ab->userpd_id = userpd_id; ++ + platform_set_drvdata(pdev, ab); + +- ab->mem_ce = ab->mem; +- if (ab->hw_rev == ATH11K_HW_IPQ5018) { +- /* ce register space is moved out of wcss unlike ipq8074 or ipq6018 +- * and the space is not contiguous, hence remapping the CE registers +- * to a new space for accessing them. +- */ +- ab->mem_ce = ioremap_nocache(HAL_IPQ5018_CE_WFSS_REG_BASE, HAL_IPQ5018_CE_SIZE); +- if (IS_ERR(ab->mem_ce)) { +- dev_err(&pdev->dev, "ce ioremap error\n"); +- return -ENOMEM; ++ if (ab->hw_rev != ATH11K_HW_QCN6122) { ++ mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!mem_res) { ++ dev_err(&pdev->dev, "failed to get IO memory resource\n"); ++ return -ENXIO; ++ } ++ ++ mem = devm_ioremap_resource(&pdev->dev, mem_res); ++ if (IS_ERR(mem)) { ++ dev_err(&pdev->dev, "ioremap error\n"); ++ return PTR_ERR(mem); + } +- ab->ce_remap = true; +- ab->ce_remap_base_addr = HAL_IPQ5018_CE_WFSS_REG_BASE; ++ ++ ab->mem = mem; ++ ab->mem_pa = mem_res->start; ++ ab->mem_len = resource_size(mem_res); ++ ab->mem_ce = ab->mem; ++ if (ab->hw_rev == ATH11K_HW_IPQ5018) { ++ /* ce register space is moved out of wcss unlike ipq8074 or ipq6018 ++ * and the space is not contiguous, hence remapping the CE registers ++ * to a new space for accessing them. ++ */ ++ ab->mem_ce = ioremap_nocache(HAL_IPQ5018_CE_WFSS_REG_BASE, ++ HAL_IPQ5018_CE_SIZE); ++ if (IS_ERR(ab->mem_ce)) { ++ dev_err(&pdev->dev, "ce ioremap error\n"); ++ return -ENOMEM; ++ } ++ ab->ce_remap = true; ++ ab->ce_remap_base_addr = HAL_IPQ5018_CE_WFSS_REG_BASE; ++ } ++ } else { ++ ab->hif.ops = &ath11k_internal_pci_hif_ops; ++ ab->bus_params = ath11k_internal_pci_bus_params; + } + + ret = ath11k_core_pre_init(ab); +@@ -762,7 +906,7 @@ static int ath11k_ahb_probe(struct platf + goto err_ce_free; + } + +- ret = ath11k_ahb_config_irq(ab); ++ ret = ath11k_hif_config_irq(ab); + if (ret) { + ath11k_err(ab, "failed to configure irq: %d\n", ret); + goto err_ce_free; +@@ -817,7 +961,7 @@ static int ath11k_ahb_remove(struct plat + + ath11k_core_deinit(ab); + qmi_fail: +- ath11k_ahb_free_irq(ab); ++ ath11k_hif_free_irq(ab); + ath11k_hal_srng_deinit(ab); + ath11k_ce_free_pipes(ab); + +--- a/drivers/net/wireless/ath/ath11k/ce.c ++++ b/drivers/net/wireless/ath/ath11k/ce.c +@@ -215,7 +215,7 @@ const struct ce_attr ath11k_host_ce_conf + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, +- .dest_nentries = 32, ++ .dest_nentries = 128, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -284,7 +284,58 @@ static const struct ath11k_hw_params ath + .reo_dest_ring_map_shift = HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, + .fwmem_mode_change = false, ++ .cold_boot_calib = true, + }, ++ { ++ .hw_rev = ATH11K_HW_QCN6122, ++ .name = "qcn6122", ++ .fw = { ++ .dir = "qcn6122/hw1.0", ++ .board_size = 256 * 1024, ++ .cal_size = 256 * 1024, ++ }, ++ .max_radios = 1, ++ .bdf_addr = 0x4D200000, ++ /* hal_desc_sz is similar to qcn9074 */ ++ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), ++ .hw_ops = &qcn6122_ops, ++ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122, ++ .ring_mask = &ath11k_hw_ring_mask_ipq8074, ++ .regs = &qcn6122_regs, ++ .m3_addr = ATH11K_QMI_QCN6122_M3_DUMP_ADDRESS, ++ .spectral_fft_sz = 2, ++ .credit_flow = false, ++ .num_dscp_tid_map_tbl = HAL_IPQ5018_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX, ++ .interface_modes = BIT(NL80211_IFTYPE_STATION) | ++ BIT(NL80211_IFTYPE_AP) | ++ BIT(NL80211_IFTYPE_MESH_POINT), ++ .supports_monitor = true, ++ .supports_shadow_regs = false, ++ .idle_ps = false, ++ .cold_boot_calib = false, ++ .supports_suspend = false, ++ .host_ce_config = ath11k_host_ce_config_qcn9074, ++ .ce_count = 6, ++ .target_ce_config = ath11k_target_ce_config_wlan_ipq5018, ++ .target_ce_count = 9, ++ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018, ++ .svc_to_ce_map_len = 17, ++ .single_pdev_only = false, ++ .needs_band_to_mac = true, ++ .rxdma1_enable = true, ++ .num_rxmda_per_pdev = 1, ++ .rx_mac_buf_ring = false, ++ .vdev_start_delay = false, ++ .htt_peer_map_v2 = true, ++ .tcl_0_only = false, ++ .spectral_max_fft_bins = 1024, ++ .spectral_summary_pad_sz = 16, ++ .spectral_fft_hdr_len = 24, ++ .reo_dest_ring_map_shift = HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT, ++ .ce_fwlog_enable = false, ++ .cold_boot_calib = false, ++ .fwmem_mode_change = false, ++ }, + }; + + static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers[] = { +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -125,6 +125,7 @@ enum ath11k_hw_rev { + ATH11K_HW_IPQ6018_HW10, + ATH11K_HW_QCN9074_HW10, + ATH11K_HW_IPQ5018, ++ ATH11K_HW_QCN6122, + }; + + enum ath11k_firmware_mode { +@@ -792,6 +793,14 @@ struct ath11k_num_vdevs_peers { + u32 num_peers; + }; + ++struct ath11k_internal_pci { ++ int qgicm_id; ++ bool qgic_enabled; ++ struct qgic2_msi *qgic2_msi; ++ const struct ath11k_msi_config *msi_cfg; ++ wait_queue_head_t qgic_msi_waitq; ++}; ++ + /* Master structure to hold the hw data which may be used in core module */ + struct ath11k_base { + enum ath11k_hw_rev hw_rev; +@@ -905,6 +914,8 @@ struct ath11k_base { + u32 ce_remap_base_addr; + atomic_t num_max_allowed; + struct ath11k_num_vdevs_peers *num_vdevs_peers; ++ int userpd_id; ++ struct ath11k_internal_pci ipci; + + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); +--- a/drivers/net/wireless/ath/ath11k/hal.h ++++ b/drivers/net/wireless/ath/ath11k/hal.h +@@ -55,7 +55,6 @@ struct ath11k_base; + (ab->hw_params.regs->hal_seq_wcss_umac_ce1_dst_reg) + #define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000 + +-#define HAL_CE_WFSS_CE_REG_BASE 0x01b80000 + #define HAL_WLAON_REG_BASE 0x01f80000 + + /* SW2TCL(x) R0 ring configuration address */ +--- a/drivers/net/wireless/ath/ath11k/hif.h ++++ b/drivers/net/wireless/ath/ath11k/hif.h +@@ -30,6 +30,10 @@ struct ath11k_hif_ops { + void (*ce_irq_disable)(struct ath11k_base *ab); + void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx); + u32 (*get_window_offset)(struct ath11k_base *ab, u32 offset); ++ void (*config_static_window)(struct ath11k_base *ab); ++ int (*config_irq)(struct ath11k_base *ab); ++ void (*free_irq)(struct ath11k_base *ab); ++ int (*get_msi_irq)(struct ath11k_base *ab, unsigned int vector); + }; + + static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab) +@@ -143,4 +147,33 @@ static inline void ath11k_get_ce_msi_idx + else + *msi_data_idx = ce_id; + } ++ ++static inline void ath11k_hif_config_static_window(struct ath11k_base *ab) ++{ ++ if (!ab->hif.ops->config_static_window) ++ return; ++ ++ ab->hif.ops->config_static_window(ab); ++} ++ ++static inline void ath11k_hif_free_irq(struct ath11k_base *ab) ++{ ++ if (!ab->hif.ops->free_irq) ++ return; ++ ++ return ab->hif.ops->free_irq(ab); ++} ++ ++static inline int ath11k_hif_config_irq(struct ath11k_base *ab) ++{ ++ return ab->hif.ops->config_irq(ab); ++} ++ ++static inline int ath11k_hif_get_msi_irq(struct ath11k_base *ab, unsigned int vector) ++{ ++ if (!ab->hif.ops->get_msi_irq) ++ return -EOPNOTSUPP; ++ ++ return ab->hif.ops->get_msi_irq(ab, vector); ++} + #endif /* _HIF_H_ */ +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -828,6 +828,48 @@ const struct ath11k_hw_ops ipq5018_ops = + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, + }; + ++const struct ath11k_hw_ops qcn6122_ops = { ++ .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id, ++ .wmi_init_config = ath11k_init_wmi_config_ipq8074, ++ .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, ++ .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, ++ .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, ++ .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, ++ .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, ++ .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, ++ .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, ++ .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, ++ .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes, ++ .rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status, ++ .rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid, ++ .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, ++ .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, ++ .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, ++ .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, ++ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, ++ .rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len, ++ .rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi, ++ .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs, ++ .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw, ++ .rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq, ++ .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type, ++ .rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss, ++ .rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid, ++ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring, ++ .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id, ++ .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end, ++ .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag, ++ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id, ++ .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len, ++ .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention, ++ .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, ++ .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, ++ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, ++ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, ++ .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_ipq8074, ++}; ++ + #define ATH11K_TX_RING_MASK_0 0x1 + #define ATH11K_TX_RING_MASK_1 0x2 + #define ATH11K_TX_RING_MASK_2 0x4 +@@ -2181,3 +2223,79 @@ const struct ath11k_hw_regs ipq5018_regs + .pcie_qserdes_sysclk_en_sel = 0x01e0e0a8, + .pcie_pcs_osc_dtct_config_base = 0x01e0f45c, + }; ++ ++const struct ath11k_hw_regs qcn6122_regs = { ++ /* SW2TCL(x) R0 ring configuration address */ ++ .hal_tcl1_ring_base_lsb = 0x00000694, ++ .hal_tcl1_ring_base_msb = 0x00000698, ++ .hal_tcl1_ring_id = 0x0000069c, ++ .hal_tcl1_ring_misc = 0x000006a4, ++ .hal_tcl1_ring_tp_addr_lsb = 0x000006b0, ++ .hal_tcl1_ring_tp_addr_msb = 0x000006b4, ++ .hal_tcl1_ring_consumer_int_setup_ix0 = 0x000006c4, ++ .hal_tcl1_ring_consumer_int_setup_ix1 = 0x000006c8, ++ .hal_tcl1_ring_msi1_base_lsb = 0x000006dc, ++ .hal_tcl1_ring_msi1_base_msb = 0x000006e0, ++ .hal_tcl1_ring_msi1_data = 0x000006e4, ++ .hal_tcl2_ring_base_lsb = 0x000006ec, ++ .hal_tcl_ring_base_lsb = 0x0000079c, ++ ++ /* TCL STATUS ring address */ ++ .hal_tcl_status_ring_base_lsb = 0x000008a4, ++ ++ /* REO2SW(x) R0 ring configuration address */ ++ .hal_reo1_ring_base_lsb = 0x000001ec, ++ .hal_reo1_ring_base_msb = 0x000001f0, ++ .hal_reo1_ring_id = 0x000001f4, ++ .hal_reo1_ring_misc = 0x000001fc, ++ .hal_reo1_ring_hp_addr_lsb = 0x00000200, ++ .hal_reo1_ring_hp_addr_msb = 0x00000204, ++ .hal_reo1_ring_producer_int_setup = 0x00000210, ++ .hal_reo1_ring_msi1_base_lsb = 0x00000234, ++ .hal_reo1_ring_msi1_base_msb = 0x00000238, ++ .hal_reo1_ring_msi1_data = 0x0000023c, ++ .hal_reo2_ring_base_lsb = 0x00000244, ++ .hal_reo1_aging_thresh_ix_0 = 0x00000564, ++ .hal_reo1_aging_thresh_ix_1 = 0x00000568, ++ .hal_reo1_aging_thresh_ix_2 = 0x0000056c, ++ .hal_reo1_aging_thresh_ix_3 = 0x00000570, ++ ++ /* REO2SW(x) R2 ring pointers (head/tail) address */ ++ .hal_reo1_ring_hp = 0x00003028, ++ .hal_reo1_ring_tp = 0x0000302c, ++ .hal_reo2_ring_hp = 0x00003030, ++ ++ /* REO2TCL R0 ring configuration address */ ++ .hal_reo_tcl_ring_base_lsb = 0x000003fc, ++ .hal_reo_tcl_ring_hp = 0x00003058, ++ ++ /* SW2REO ring address */ ++ .hal_sw2reo_ring_base_lsb = 0x0000013c, ++ .hal_sw2reo_ring_hp = 0x00003018, ++ ++ /* REO CMD ring address */ ++ .hal_reo_cmd_ring_base_lsb = 0x000000e4, ++ .hal_reo_cmd_ring_hp = 0x00003010, ++ ++ /* REO status address */ ++ .hal_reo_status_ring_base_lsb = 0x00000504, ++ .hal_reo_status_hp = 0x00003070, ++ ++ /* WCSS relative address */ ++ .hal_seq_wcss_umac_ce0_src_reg = 0x03B80000, ++ .hal_seq_wcss_umac_ce0_dst_reg = 0x03b81000, ++ .hal_seq_wcss_umac_ce1_src_reg = 0x03b82000, ++ .hal_seq_wcss_umac_ce1_dst_reg = 0x03b83000, ++ ++ /* WBM Idle address */ ++ .hal_wbm_idle_link_ring_base_lsb = 0x00000874, ++ .hal_wbm_idle_link_ring_misc = 0x00000884, ++ ++ /* SW2WBM release address */ ++ .hal_wbm_release_ring_base_lsb = 0x000001ec, ++ ++ /* WBM2SW release address */ ++ .hal_wbm0_release_ring_base_lsb = 0x00000924, ++ .hal_wbm1_release_ring_base_lsb = 0x0000097c, ++}; ++ +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -192,6 +192,7 @@ struct ath11k_hw_params { + u32 hal_desc_sz; + u32 m3_addr; + u8 reo_dest_ring_map_shift; ++ bool cold_boot_calib; + bool ce_fwlog_enable; + bool fwmem_mode_change; + }; +@@ -245,6 +246,7 @@ extern const struct ath11k_hw_ops ipq601 + extern const struct ath11k_hw_ops qca6390_ops; + extern const struct ath11k_hw_ops qcn9074_ops; + extern const struct ath11k_hw_ops ipq5018_ops; ++extern const struct ath11k_hw_ops qcn6122_ops; + + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; +@@ -365,5 +367,6 @@ extern const struct ath11k_hw_regs ipq80 + extern const struct ath11k_hw_regs qca6390_regs; + extern const struct ath11k_hw_regs qcn9074_regs; + extern const struct ath11k_hw_regs ipq5018_regs; ++extern const struct ath11k_hw_regs qcn6122_regs; + + #endif +--- a/drivers/net/wireless/ath/ath11k/mhi.c ++++ b/drivers/net/wireless/ath/ath11k/mhi.c +@@ -9,6 +9,7 @@ + #include "debug.h" + #include "mhi.h" + #include "pci.h" ++#include "hif.h" + + #define MHI_TIMEOUT_DEFAULT_MS 90000 + +@@ -258,7 +259,8 @@ static int ath11k_mhi_get_msi(struct ath + int ret, num_vectors, i; + int *irq; + +- ret = ath11k_pci_get_user_msi_assignment(ab_pci, ++ ret = ath11k_pci_get_user_msi_assignment(ab, ab_pci->msi_config, ++ ab_pci->msi_ep_base_data, + "MHI", &num_vectors, + &user_base_data, &base_vector); + if (ret) +@@ -272,7 +274,7 @@ static int ath11k_mhi_get_msi(struct ath + return -ENOMEM; + + for (i = 0; i < num_vectors; i++) +- irq[i] = ath11k_pci_get_msi_irq(ab->dev, ++ irq[i] = ath11k_hif_get_msi_irq(ab, + base_vector + i); + + ab_pci->mhi_ctrl->irq = irq; +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -2137,6 +2137,8 @@ static int ath11k_nss_get_target_type(st + return ATH11K_WIFILI_TARGET_TYPE_QCN9074; + case ATH11K_HW_IPQ5018: + return ATH11K_WIFILI_TARGET_TYPE_QCA5018; ++ case ATH11K_HW_QCN6122: ++ return ATH11K_WIFILI_TARGET_TYPE_QCN6122; + default: + ath11k_warn(ab, "NSS Offload not supported for this HW\n"); + return ATH11K_WIFILI_TARGET_TYPE_UNKNOWN; +@@ -2151,6 +2153,7 @@ static int ath11k_nss_get_interface_type + case ATH11K_HW_IPQ5018: + return NSS_WIFILI_INTERNAL_INTERFACE; + case ATH11K_HW_QCN9074_HW10: ++ case ATH11K_HW_QCN6122: + return nss_get_available_wifili_external_if(); + default: + /* This can't happen since we validated target type earlier */ +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -29,6 +29,7 @@ struct hal_rx_mon_ppdu_info; + #define ATH11K_WIFILI_TARGET_TYPE_QCA6018 25 + #define ATH11K_WIFILI_TARGET_TYPE_QCN9074 26 + #define ATH11K_WIFILI_TARGET_TYPE_QCA5018 29 ++#define ATH11K_WIFILI_TARGET_TYPE_QCN6122 30 + + /* Max limit for NSS Queue */ + #define ATH11K_WIFIILI_MAX_TX_PROCESSQ 1024 +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -14,6 +14,8 @@ + #include "debug.h" + #include "qmi.h" + #include ++#include ++ + + #define ATH11K_PCI_BAR_NUM 0 + #define ATH11K_PCI_DMA_MASK 32 +@@ -54,28 +56,6 @@ static const struct ath11k_bus_params at + .fixed_mem_region = false, + }; + +-static const struct ath11k_msi_config ath11k_msi_config[] = { +- { +- .total_vectors = 32, +- .total_users = 4, +- .users = (struct ath11k_msi_user[]) { +- { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, +- { .name = "CE", .num_vectors = 10, .base_vector = 3 }, +- { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, +- { .name = "DP", .num_vectors = 18, .base_vector = 14 }, +- }, +- }, +- { +- .total_vectors = 16, +- .total_users = 3, +- .users = (struct ath11k_msi_user[]) { +- { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, +- { .name = "CE", .num_vectors = 5, .base_vector = 3 }, +- { .name = "DP", .num_vectors = 8, .base_vector = 8 }, +- }, +- }, +-}; +- + const char *ce_irq_name[ATH11K_MAX_PCI_DOMAINS + 1][CE_COUNT_MAX] = { + { + ATH11K_PCI_CE_IRQS_NAME(0) +@@ -88,9 +68,9 @@ const char *ce_irq_name[ATH11K_MAX_PCI_D + }, + }; + +-static inline void ath11k_pci_select_window(struct ath11k_pci *ab_pci, u32 offset) ++static inline void ath11k_pci_select_window(struct ath11k_base *ab, u32 offset) + { +- struct ath11k_base *ab = ab_pci->ab; ++ struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + + u32 window = FIELD_GET(WINDOW_VALUE_MASK, offset); + +@@ -104,15 +84,15 @@ static inline void ath11k_pci_select_win + } + } + +-static inline void ath11k_pci_select_static_window(struct ath11k_pci *ab_pci) ++static inline void ath11k_pci_select_static_window(struct ath11k_base *ab) + { + u32 umac_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_OFFSET); +- u32 ce_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_CE_WFSS_CE_REG_BASE); ++ u32 ce_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab)); + u32 window; + + window = (umac_window << 12) | (ce_window << 6); + +- iowrite32(WINDOW_ENABLE_BIT | window, ab_pci->ab->mem + WINDOW_REG_ADDRESS); ++ iowrite32(WINDOW_ENABLE_BIT | window, ab->mem + WINDOW_REG_ADDRESS); + } + + static inline u32 ath11k_pci_get_window_start(struct ath11k_base *ab, +@@ -124,7 +104,7 @@ static inline u32 ath11k_pci_get_window_ + if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < WINDOW_RANGE_MASK) + window_start = 3 * WINDOW_START; + /* If offset lies within CE register range, use 2nd window */ +- else if ((offset ^ HAL_CE_WFSS_CE_REG_BASE) < WINDOW_RANGE_MASK) ++ else if ((offset ^ HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab)) < WINDOW_RANGE_MASK) + window_start = 2 * WINDOW_START; + else + window_start = WINDOW_START; +@@ -132,8 +112,7 @@ static inline u32 ath11k_pci_get_window_ + return window_start; + } + +-static inline u32 ath11k_pci_get_window_offset(struct ath11k_base *ab, +- u32 offset) ++u32 ath11k_pci_get_window_offset(struct ath11k_base *ab, u32 offset) + { + u32 window_start; + +@@ -145,6 +124,37 @@ static inline u32 ath11k_pci_get_window_ + } + return offset; + } ++EXPORT_SYMBOL(ath11k_pci_get_window_offset); ++ ++void ath11k_ipci_write32(struct ath11k_base *ab, u32 offset, u32 value) ++{ ++ u32 window_start; ++ ++ if (offset < WINDOW_START) { ++ iowrite32(value, ab->mem + offset); ++ } else { ++ window_start = ath11k_pci_get_window_start(ab, offset); ++ iowrite32(value, ab->mem + window_start + ++ (offset & WINDOW_RANGE_MASK)); ++ } ++} ++EXPORT_SYMBOL(ath11k_ipci_write32); ++ ++u32 ath11k_ipci_read32(struct ath11k_base *ab, u32 offset) ++{ ++ u32 val, window_start; ++ ++ if (offset < WINDOW_START) { ++ val = ioread32(ab->mem + offset); ++ } else { ++ window_start = ath11k_pci_get_window_start(ab, offset); ++ val = ioread32(ab->mem + window_start + ++ (offset & WINDOW_RANGE_MASK)); ++ } ++ ++ return val; ++} ++EXPORT_SYMBOL(ath11k_ipci_read32); + + void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) + { +@@ -155,7 +165,7 @@ void ath11k_pci_write32(struct ath11k_ba + * need to wakeup MHI to access. + */ + if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && +- offset >= ACCESS_ALWAYS_OFF) ++ offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_get_sync(ab_pci->mhi_ctrl->mhi_dev); + + if (offset < WINDOW_START) { +@@ -168,7 +178,7 @@ void ath11k_pci_write32(struct ath11k_ba + + if (window_start == WINDOW_START) { + spin_lock_bh(&ab_pci->window_lock); +- ath11k_pci_select_window(ab_pci, offset); ++ ath11k_pci_select_window(ab, offset); + iowrite32(value, ab->mem + window_start + + (offset & WINDOW_RANGE_MASK)); + spin_unlock_bh(&ab_pci->window_lock); +@@ -179,9 +189,10 @@ void ath11k_pci_write32(struct ath11k_ba + } + + if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && +- offset >= ACCESS_ALWAYS_OFF) ++ offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_put(ab_pci->mhi_ctrl->mhi_dev); + } ++EXPORT_SYMBOL(ath11k_pci_write32); + + u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) + { +@@ -192,7 +203,7 @@ u32 ath11k_pci_read32(struct ath11k_base + * need to wakeup MHI to access. + */ + if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && +- offset >= ACCESS_ALWAYS_OFF) ++ offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_get_sync(ab_pci->mhi_ctrl->mhi_dev); + + if (offset < WINDOW_START) { +@@ -205,7 +216,7 @@ u32 ath11k_pci_read32(struct ath11k_base + + if (window_start == WINDOW_START) { + spin_lock_bh(&ab_pci->window_lock); +- ath11k_pci_select_window(ab_pci, offset); ++ ath11k_pci_select_window(ab, offset); + val = ioread32(ab->mem + window_start + + (offset & WINDOW_RANGE_MASK)); + spin_unlock_bh(&ab_pci->window_lock); +@@ -216,11 +227,12 @@ u32 ath11k_pci_read32(struct ath11k_base + } + + if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && +- offset >= ACCESS_ALWAYS_OFF) ++ offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_put(ab_pci->mhi_ctrl->mhi_dev); + + return val; + } ++EXPORT_SYMBOL(ath11k_pci_read32); + + static void ath11k_pci_soc_global_reset(struct ath11k_base *ab) + { +@@ -415,15 +427,35 @@ static void ath11k_pci_sw_reset(struct a + ath11k_pci_clear_dbg_registers(ab); + } + +-int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector) ++#define MAX_MSI_IRQS 32 ++ ++int ath11k_pci_get_qgic_msi_irq(struct ath11k_base *ab, unsigned int vector) + { ++ struct qgic2_msi *qgic2_msi = ab->ipci.qgic2_msi; ++ ++ if (!qgic2_msi) { ++ ath11k_err(ab, "qgic2_msi is NULL\n"); ++ return -EINVAL; ++ } ++ ++ if (vector >= MAX_MSI_IRQS) { ++ ath11k_err(ab, "irq vector greater than MAX MSI IRQ\n"); ++ return -EINVAL; ++ } ++ return qgic2_msi->msi[vector]; ++} ++EXPORT_SYMBOL(ath11k_pci_get_qgic_msi_irq); ++ ++int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector) ++{ ++ struct device *dev = ab->dev; + struct pci_dev *pci_dev = to_pci_dev(dev); + + return pci_irq_vector(pci_dev, vector); + } + +-static void ath11k_pci_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo, +- u32 *msi_addr_hi) ++void ath11k_pci_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo, ++ u32 *msi_addr_hi) + { + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + struct pci_dev *pci_dev = to_pci_dev(ab->dev); +@@ -439,19 +471,33 @@ static void ath11k_pci_get_msi_address(s + } + } + +-int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ab_pci, char *user_name, ++void ath11k_pci_get_qgic_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo, ++ u32 *msi_addr_hi) ++{ ++ struct qgic2_msi *qgic2_msi = ab->ipci.qgic2_msi; ++ ++ if (!qgic2_msi) { ++ ath11k_err(ab, "qgic2_msi is NULL\n"); ++ return; ++ } ++ *msi_addr_lo = qgic2_msi->msi_gicm_addr; ++ *msi_addr_hi = 0; ++} ++EXPORT_SYMBOL(ath11k_pci_get_qgic_msi_address); ++ ++int ath11k_pci_get_user_msi_assignment(struct ath11k_base *ab, ++ struct ath11k_msi_config *msi_config, ++ u32 msi_ep_base_data, char *user_name, + int *num_vectors, u32 *user_base_data, + u32 *base_vector) + { +- struct ath11k_base *ab = ab_pci->ab; +- const struct ath11k_msi_config *msi_config = ab_pci->msi_config; + int idx; + + for (idx = 0; idx < msi_config->total_users; idx++) { + if (strcmp(user_name, msi_config->users[idx].name) == 0) { + *num_vectors = msi_config->users[idx].num_vectors; + *user_base_data = msi_config->users[idx].base_vector +- + ab_pci->msi_ep_base_data; ++ + msi_ep_base_data; + *base_vector = msi_config->users[idx].base_vector; + + ath11k_dbg(ab, ATH11K_DBG_PCI, "Assign MSI to user: %s, num_vectors: %d, user_base_data: %u, base_vector: %u\n", +@@ -467,8 +513,8 @@ int ath11k_pci_get_user_msi_assignment(s + return -EINVAL; + } + +-static void ath11k_pci_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, +- u32 *msi_idx) ++void ath11k_pci_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, ++ u32 *msi_idx) + { + u32 i, msi_data_idx; + +@@ -483,18 +529,35 @@ static void ath11k_pci_get_ce_msi_idx(st + } + *msi_idx = msi_data_idx; + } ++EXPORT_SYMBOL(ath11k_pci_get_ce_msi_idx); + +-static int ath11k_get_user_msi_assignment(struct ath11k_base *ab, char *user_name, +- int *num_vectors, u32 *user_base_data, ++int ath11k_get_user_msi_assignment(struct ath11k_base *ab, char *user_name, ++ int *num_vectors, u32 *user_base_data, + u32 *base_vector) + { + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + +- return ath11k_pci_get_user_msi_assignment(ab_pci, user_name, ++ return ath11k_pci_get_user_msi_assignment(ab, ab_pci->msi_config, ++ ab_pci->msi_ep_base_data, user_name, + num_vectors, user_base_data, + base_vector); ++ + } + ++int ath11k_get_user_qgic_msi_assignment(struct ath11k_base *ab, char *user_name, ++ int *num_vectors, u32 *user_base_data, ++ u32 *base_vector) ++{ ++ struct qgic2_msi *qgic2_msi = ab->ipci.qgic2_msi; ++ struct ath11k_msi_config *msi_cfg = ab->ipci.msi_cfg; ++ ++ return ath11k_pci_get_user_msi_assignment(ab, msi_cfg, ++ qgic2_msi->msi_gicm_base, user_name, ++ num_vectors, user_base_data, ++ base_vector); ++} ++EXPORT_SYMBOL(ath11k_get_user_qgic_msi_assignment); ++ + const char *dp_irq_name[ATH11K_MAX_PCI_DOMAINS + 1][ATH11K_EXT_IRQ_GRP_NUM_MAX] = { + { + ATH11K_PCI_DP_IRQS_NAME(0) +@@ -521,7 +584,7 @@ static void ath11k_pci_free_ext_irq(stru + } + } + +-static void ath11k_pci_free_irq(struct ath11k_base *ab) ++void ath11k_pci_free_irq(struct ath11k_base *ab) + { + int i, irq_idx; + +@@ -534,6 +597,7 @@ static void ath11k_pci_free_irq(struct a + + ath11k_pci_free_ext_irq(ab); + } ++EXPORT_SYMBOL(ath11k_pci_free_irq); + + static void ath11k_pci_ce_irq_enable(struct ath11k_base *ab, u16 ce_id) + { +@@ -628,7 +692,7 @@ static void ath11k_pci_ext_grp_enable(st + enable_irq(irq_grp->ab->irq_num[irq_grp->irqs[i]]); + } + +-static void ath11k_pci_ext_irq_enable(struct ath11k_base *ab) ++void ath11k_pci_ext_irq_enable(struct ath11k_base *ab) + { + int i; + +@@ -639,6 +703,7 @@ static void ath11k_pci_ext_irq_enable(st + ath11k_pci_ext_grp_enable(irq_grp); + } + } ++EXPORT_SYMBOL(ath11k_pci_ext_irq_enable); + + static void ath11k_pci_sync_ext_irqs(struct ath11k_base *ab) + { +@@ -654,11 +719,12 @@ static void ath11k_pci_sync_ext_irqs(str + } + } + +-static void ath11k_pci_ext_irq_disable(struct ath11k_base *ab) ++void ath11k_pci_ext_irq_disable(struct ath11k_base *ab) + { + __ath11k_pci_ext_irq_disable(ab); + ath11k_pci_sync_ext_irqs(ab); + } ++EXPORT_SYMBOL(ath11k_pci_ext_irq_disable); + + static int ath11k_pci_ext_grp_napi_poll(struct napi_struct *napi, int budget) + { +@@ -696,20 +762,34 @@ static irqreturn_t ath11k_pci_ext_interr + return IRQ_HANDLED; + } + +-static int ath11k_pci_ext_irq_config(struct ath11k_base *ab) ++static int ath11k_pci_get_domain_id(struct ath11k_base *ab) + { +- int i, j, ret, num_vectors = 0; +- u32 user_base_data = 0, base_vector = 0, base_idx; +- struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); +- u8 domain_id = pci_domain_nr(ar_pci->pdev->bus); ++ u8 domain_id; ++ struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); ++ ++ if (ab->userpd_id) ++ domain_id = ab->userpd_id; ++ else ++ domain_id = pci_domain_nr(ab_pci->pdev->bus); + + if (domain_id > ATH11K_MAX_PCI_DOMAINS) + domain_id = ATH11K_MAX_PCI_DOMAINS; + ++ return domain_id; ++} ++ ++static int ath11k_pci_ext_irq_config(struct ath11k_base *ab, ++ struct ath11k_msi_config *msi_config, ++ u32 msi_ep_base_data) ++{ ++ int i, j, ret, num_vectors = 0; ++ u32 user_base_data = 0, base_vector = 0, base_idx; ++ u8 domain_id; ++ ++ domain_id = ath11k_pci_get_domain_id(ab); + base_idx = ATH11K_PCI_IRQ_CE0_OFFSET + CE_COUNT_MAX; +- ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP", +- &num_vectors, +- &user_base_data, ++ ret = ath11k_pci_get_user_msi_assignment(ab, msi_config, msi_ep_base_data, ++ "DP", &num_vectors, &user_base_data, + &base_vector); + if (ret < 0) + return ret; +@@ -746,7 +826,7 @@ static int ath11k_pci_ext_irq_config(str + for (j = 0; j < irq_grp->num_irq; j++) { + int irq_idx = irq_grp->irqs[j]; + int vector = (i % num_vectors) + base_vector; +- int irq = ath11k_pci_get_msi_irq(ab->dev, vector); ++ int irq = ath11k_hif_get_msi_irq(ab, vector); + + ab->irq_num[irq_idx] = irq; + +@@ -770,21 +850,19 @@ static int ath11k_pci_ext_irq_config(str + return 0; + } + +-static int ath11k_pci_config_irq(struct ath11k_base *ab) ++static int ath11k_config_msi_irq(struct ath11k_base *ab, ++ struct ath11k_msi_config *msi_config, u32 msi_ep_base_data) + { + struct ath11k_ce_pipe *ce_pipe; + u32 msi_data_start; + u32 msi_data_count, msi_data_idx; + u32 msi_irq_start; + unsigned int msi_data; +- int irq, i, ret, irq_idx; +- struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); +- u8 domain_id = pci_domain_nr(ar_pci->pdev->bus); ++ int irq, i, ret = 0, irq_idx; ++ u8 domain_id; + +- if (domain_id > ATH11K_MAX_PCI_DOMAINS) +- domain_id = ATH11K_MAX_PCI_DOMAINS; +- +- ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), ++ domain_id = ath11k_pci_get_domain_id(ab); ++ ret = ath11k_pci_get_user_msi_assignment(ab, msi_config, msi_ep_base_data, + "CE", &msi_data_count, + &msi_data_start, &msi_irq_start); + if (ret) +@@ -796,7 +874,7 @@ static int ath11k_pci_config_irq(struct + continue; + + msi_data = (msi_data_idx % msi_data_count) + msi_irq_start; +- irq = ath11k_pci_get_msi_irq(ab->dev, msi_data); ++ irq = ath11k_hif_get_msi_irq(ab, msi_data); + ce_pipe = &ab->ce.ce_pipe[i]; + + irq_idx = ATH11K_PCI_IRQ_CE0_OFFSET + i; +@@ -818,13 +896,22 @@ static int ath11k_pci_config_irq(struct + ath11k_pci_ce_irq_disable(ab, i); + } + +- ret = ath11k_pci_ext_irq_config(ab); ++ ret = ath11k_pci_ext_irq_config(ab, msi_config, msi_ep_base_data); + if (ret) + return ret; + + return 0; + } + ++static int ath11k_pci_config_irq(struct ath11k_base *ab) ++{ ++ int ret; ++ struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); ++ ++ ret = ath11k_config_msi_irq(ab, ab_pci->msi_config, ab_pci->msi_ep_base_data); ++ return ret; ++} ++ + static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab) + { + struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; +@@ -1034,7 +1121,7 @@ static int ath11k_pci_power_up(struct at + } + + if (ab->bus_params.static_window_map) +- ath11k_pci_select_static_window(ab_pci); ++ ath11k_pci_select_static_window(ab); + + return 0; + } +@@ -1091,13 +1178,23 @@ static void ath11k_pci_ce_irq_disable_sy + ath11k_pci_kill_tasklets(ab); + } + +-static void ath11k_pci_stop(struct ath11k_base *ab) ++void ath11k_pci_stop(struct ath11k_base *ab) + { + ath11k_pci_ce_irq_disable_sync(ab); + ath11k_ce_cleanup_pipes(ab); + } ++EXPORT_SYMBOL(ath11k_pci_stop); + +-static int ath11k_pci_start(struct ath11k_base *ab) ++int ath11k_ipci_start(struct ath11k_base *ab) ++{ ++ ath11k_pci_ce_irqs_enable(ab); ++ ath11k_ce_rx_post_buf(ab); ++ ++ return 0; ++} ++EXPORT_SYMBOL(ath11k_ipci_start); ++ ++int ath11k_pci_start(struct ath11k_base *ab) + { + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + +@@ -1110,6 +1207,7 @@ static int ath11k_pci_start(struct ath11 + + return 0; + } ++EXPORT_SYMBOL(ath11k_pci_start); + + static void ath11k_pci_hif_ce_irq_enable(struct ath11k_base *ab) + { +@@ -1121,7 +1219,14 @@ static void ath11k_pci_hif_ce_irq_disabl + ath11k_pci_ce_irq_disable_sync(ab); + } + +-static int ath11k_pci_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, ++void ath11k_pci_config_static_window(struct ath11k_base *ab) ++{ ++ if (ab->bus_params.static_window_map) ++ ath11k_pci_select_static_window(ab); ++} ++EXPORT_SYMBOL(ath11k_pci_config_static_window); ++ ++int ath11k_pci_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, + u8 *ul_pipe, u8 *dl_pipe) + { + const struct service_to_pipe *entry; +@@ -1163,6 +1268,7 @@ static int ath11k_pci_map_service_to_pip + + return 0; + } ++EXPORT_SYMBOL(ath11k_pci_map_service_to_pipe); + + static const struct ath11k_hif_ops ath11k_pci_hif_ops = { + .start = ath11k_pci_start, +@@ -1182,8 +1288,23 @@ static const struct ath11k_hif_ops ath11 + .ce_irq_disable = ath11k_pci_hif_ce_irq_disable, + .get_window_offset = ath11k_pci_get_window_offset, + .get_ce_msi_idx = ath11k_pci_get_ce_msi_idx, ++ .config_static_window = ath11k_pci_config_static_window, ++ .free_irq = ath11k_pci_free_irq, ++ .get_msi_irq = ath11k_pci_get_msi_irq, + }; + ++int ath11k_pci_config_qgic_msi_irq(struct ath11k_base *ab) ++{ ++ int ret = 0; ++ struct qgic2_msi *qgic2_msi = ab->ipci.qgic2_msi; ++ struct ath11k_msi_config *msi_cfg = ab->ipci.msi_cfg; ++ ++ ret = ath11k_config_msi_irq(ab, msi_cfg, ++ qgic2_msi->msi_gicm_base); ++ return ret; ++} ++EXPORT_SYMBOL(ath11k_pci_config_qgic_msi_irq); ++ + static int ath11k_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *pci_dev) + { +@@ -1246,10 +1367,10 @@ static int ath11k_pci_probe(struct pci_d + ret = -EOPNOTSUPP; + goto err_pci_free_region; + } +- ab_pci->msi_config = &ath11k_msi_config[0]; ++ ab_pci->msi_config = &ath11k_msi_config[ATH11K_MSI_CONFIG_QCA6390]; + break; + case QCN9074_DEVICE_ID: +- ab_pci->msi_config = &ath11k_msi_config[1]; ++ ab_pci->msi_config = &ath11k_msi_config[ATH11K_MSI_CONFIG_QCN9074]; + ab->bus_params.static_window_map = true; + ab->hw_rev = ATH11K_HW_QCN9074_HW10; + ab->enable_cold_boot_cal = ath11k_cold_boot_cal; +@@ -1304,7 +1425,7 @@ static int ath11k_pci_probe(struct pci_d + return 0; + + err_free_irq: +- ath11k_pci_free_irq(ab); ++ ath11k_hif_free_irq(ab); + + err_ce_free: + ath11k_ce_free_pipes(ab); +@@ -1347,7 +1468,7 @@ static void ath11k_pci_remove(struct pci + qmi_fail: + ath11k_mhi_unregister(ab_pci); + +- ath11k_pci_free_irq(ab); ++ ath11k_hif_free_irq(ab); + ath11k_pci_disable_msi(ab_pci); + ath11k_pci_free_region(ab_pci); + +--- a/drivers/net/wireless/ath/ath11k/pci.h ++++ b/drivers/net/wireless/ath/ath11k/pci.h +@@ -101,6 +101,42 @@ enum ath11k_pci_flags { + ATH11K_PCI_ASPM_RESTORE, + }; + ++enum ath11k_msi_supported_hw { ++ ATH11K_MSI_CONFIG_QCA6390, ++ ATH11K_MSI_CONFIG_QCN9074, ++ ATH11K_MSI_CONFIG_QCN6122, ++}; ++ ++static const struct ath11k_msi_config ath11k_msi_config[] = { ++ { ++ .total_vectors = 32, ++ .total_users = 4, ++ .users = (struct ath11k_msi_user[]) { ++ { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, ++ { .name = "CE", .num_vectors = 10, .base_vector = 3 }, ++ { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, ++ { .name = "DP", .num_vectors = 18, .base_vector = 14 }, ++ }, ++ }, ++ { ++ .total_vectors = 16, ++ .total_users = 3, ++ .users = (struct ath11k_msi_user[]) { ++ { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, ++ { .name = "CE", .num_vectors = 5, .base_vector = 3 }, ++ { .name = "DP", .num_vectors = 8, .base_vector = 8 }, ++ }, ++ }, ++ { ++ .total_vectors = 13, ++ .total_users = 2, ++ .users = (struct ath11k_msi_user[]) { ++ { .name = "CE", .num_vectors = 5, .base_vector = 0 }, ++ { .name = "DP", .num_vectors = 8, .base_vector = 5 }, ++ }, ++ }, ++}; ++ + struct ath11k_pci { + struct pci_dev *pdev; + struct ath11k_base *ab; +@@ -125,11 +161,34 @@ static inline struct ath11k_pci *ath11k_ + return (struct ath11k_pci *)ab->drv_priv; + } + +-int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ar_pci, char *user_name, ++int ath11k_pci_get_user_msi_assignment(struct ath11k_base *ab, ++ struct ath11k_msi_config *msi_config, ++ u32 msi_ep_base_data, char *user_name, + int *num_vectors, u32 *user_base_data, + u32 *base_vector); +-int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector); ++int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector); + void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value); + u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset); +- ++int ath11k_pci_config_qgic_msi_irq(struct ath11k_base *ab); ++int ath11k_pci_start(struct ath11k_base *ab); ++void ath11k_pci_stop(struct ath11k_base *ab); ++void ath11k_pci_ext_irq_enable(struct ath11k_base *ab); ++void ath11k_pci_ext_irq_disable(struct ath11k_base *ab); ++void ath11k_pci_get_qgic_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo, ++ u32 *msi_addr_hi); ++int ath11k_get_user_qgic_msi_assignment(struct ath11k_base *ab, char *user_name, ++ int *num_vectors, u32 *user_base_data, ++ u32 *base_vector); ++int ath11k_pci_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, ++ u8 *ul_pipe, u8 *dl_pipe); ++u32 ath11k_pci_get_window_offset(struct ath11k_base *ab, ++ u32 offset); ++void ath11k_pci_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, ++ u32 *msi_idx); ++void ath11k_pci_config_static_window(struct ath11k_base *ab); ++void ath11k_pci_free_irq(struct ath11k_base *ab); ++int ath11k_pci_get_qgic_msi_irq(struct ath11k_base *ab, unsigned int vector); ++int ath11k_ipci_start(struct ath11k_base *ab); ++void ath11k_ipci_write32(struct ath11k_base *ab, u32 offset, u32 value); ++u32 ath11k_ipci_read32(struct ath11k_base *ab, u32 offset); + #endif +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -1060,6 +1060,68 @@ static struct qmi_elem_info qmi_wlanfw_c + }, + }; + ++static struct qmi_elem_info qmi_wlanfw_device_info_req_msg_v01_ei[] = { ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ ++struct qmi_elem_info qmi_wlanfw_device_info_resp_msg_v01_ei[] = { ++ { ++ .data_type = QMI_STRUCT, ++ .elem_len = 1, ++ .elem_size = sizeof(struct qmi_response_type_v01), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x02, ++ .offset = offsetof(struct qmi_wlanfw_device_info_resp_msg_v01, ++ resp), ++ .ei_array = qmi_response_type_v01_ei, ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x10, ++ .offset = offsetof(struct qmi_wlanfw_device_info_resp_msg_v01, ++ bar_addr_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_8_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u64), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x10, ++ .offset = offsetof(struct qmi_wlanfw_device_info_resp_msg_v01, ++ bar_addr), ++ }, ++ { ++ .data_type = QMI_OPT_FLAG, ++ .elem_len = 1, ++ .elem_size = sizeof(u8), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x11, ++ .offset = offsetof(struct qmi_wlanfw_device_info_resp_msg_v01, ++ bar_size_valid), ++ }, ++ { ++ .data_type = QMI_UNSIGNED_4_BYTE, ++ .elem_len = 1, ++ .elem_size = sizeof(u32), ++ .array_type = NO_ARRAY, ++ .tlv_type = 0x11, ++ .offset = offsetof(struct qmi_wlanfw_device_info_resp_msg_v01, ++ bar_size), ++ }, ++ { ++ .data_type = QMI_EOTI, ++ .array_type = NO_ARRAY, ++ .tlv_type = QMI_COMMON_TLV_TYPE, ++ }, ++}; ++ + static struct qmi_elem_info qmi_wlanfw_rf_chip_info_s_v01_ei[] = { + { + .data_type = QMI_UNSIGNED_4_BYTE, +@@ -2717,6 +2779,7 @@ static int ath11k_qmi_assign_target_mem_ + struct device *dev = ab->dev; + int i, idx; + u32 addr = 0; ++ u32 location[3]; + + for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { + switch (ab->qmi.target_mem[i].type) { +@@ -2743,6 +2806,10 @@ static int ath11k_qmi_assign_target_mem_ + idx++; + break; + case BDF_MEM_REGION_TYPE: ++ if (!of_property_read_u32_array(dev->of_node, "qcom,bdf-addr", location, ++ ARRAY_SIZE(location))) { ++ ab->hw_params.bdf_addr = location[ab->qmi.target_mem_mode]; ++ } + ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr; + ab->qmi.target_mem[idx].vaddr = NULL; + ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; +@@ -2762,7 +2829,8 @@ static int ath11k_qmi_assign_target_mem_ + ath11k_warn(ab, "qmi fail to get caldb-addr in dt\n"); + } + +- if (!ab->enable_cold_boot_cal) { ++ if (!ab->enable_cold_boot_cal || ++ !ab->hw_params.cold_boot_calib) { + ab->qmi.target_mem[idx].paddr = 0; + ab->qmi.target_mem[idx].vaddr = NULL; + } else { +@@ -2813,6 +2881,86 @@ static int ath11k_qmi_assign_target_mem_ + return 0; + } + ++static int ath11k_qmi_request_device_info(struct ath11k_base *ab) ++{ ++ struct qmi_wlanfw_device_info_req_msg_v01 req; ++ struct qmi_wlanfw_device_info_resp_msg_v01 resp; ++ struct qmi_txn txn = {}; ++ void *bar_addr_va = NULL; ++ int ret = 0; ++ ++ /*device info message only supported for internal-PCI devices */ ++ if (ab->hw_rev != ATH11K_HW_QCN6122) ++ return 0; ++ ++ memset(&req, 0, sizeof(req)); ++ memset(&resp, 0, sizeof(resp)); ++ ++ ret = qmi_txn_init(&ab->qmi.handle, &txn, ++ qmi_wlanfw_device_info_resp_msg_v01_ei, &resp); ++ if (ret < 0) ++ goto out; ++ ++ ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, ++ QMI_WLANFW_DEVICE_INFO_REQ_V01, ++ QMI_WLANFW_DEVICE_INFO_REQ_MSG_V01, ++ qmi_wlanfw_device_info_req_msg_v01_ei, &req); ++ if (ret < 0) { ++ ath11k_warn(ab, "qmi failed to send target device info request, err = %d\n", ++ ret); ++ goto out; ++ } ++ ++ ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); ++ if (ret < 0) { ++ ath11k_warn(ab, "qmi failed target device info request %d\n", ret); ++ goto out; ++ } ++ ++ if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ++ ath11k_warn(ab, "qmi device info req failed, result: %d, err: %d\n", ++ resp.resp.result, resp.resp.error); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (!resp.bar_addr_valid || !resp.bar_size_valid) { ++ ath11k_warn(ab, "qmi device info response invalid, result: %d, err: %d\n", ++ resp.resp.result, resp.resp.error); ++ ret = -EINVAL; ++ goto out; ++ } ++ if (!resp.bar_addr || ++ resp.bar_size != QCN6122_DEVICE_BAR_SIZE) { ++ ath11k_warn(ab, "qmi device info invalid addr and size, result: %d, err: %d\n", ++ resp.resp.result, resp.resp.error); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ bar_addr_va = ioremap_nocache(resp.bar_addr, resp.bar_size); ++ ++ if (!bar_addr_va) { ++ ath11k_warn(ab, "qmi device info ioremap failed\n"); ++ ab->mem_pa = 0; ++ ab->mem_len = 0; ++ ret = -EIO; ++ goto out; ++ } ++ ++ ab->mem = bar_addr_va; ++ ab->mem_pa = resp.bar_addr; ++ ab->mem_len = resp.bar_size; ++ ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "Device BAR Info pa: 0x%llx, va: 0x%p, size: 0x%lx\n", ++ (u64)ab->mem_pa, ab->mem, ab->mem_len); ++ ++ ath11k_hif_config_static_window(ab); ++ return 0; ++out: ++ return ret; ++} ++ + static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) + { + struct device *dev = ab->dev; +@@ -3040,6 +3188,12 @@ static int ath11k_qmi_load_bdf_qmi(struc + if(ab->bus_params.fixed_bdf_addr) { + snprintf(filename, sizeof(filename), + "%s", ATH11K_DEFAULT_CAL_FILE); ++ if (ab->userpd_id) { ++ snprintf(filename, sizeof(filename), "%s%d%s", ++ ATH11K_QMI_DEF_CAL_FILE_PREFIX, ++ ab->userpd_id, ++ ATH11K_QMI_DEF_CAL_FILE_SUFFIX); ++ } + } else { + snprintf(filename, sizeof(filename), + "%s%d%s", +@@ -3382,7 +3536,8 @@ int ath11k_qmi_fwreset_from_cold_boot(st + { + int timeout; + +- if (ab->enable_cold_boot_cal == 0 || ab->qmi.cal_done) ++ if (ab->enable_cold_boot_cal == 0 || ab->qmi.cal_done || ++ ab->hw_params.cold_boot_calib == 0) + return 0; + + ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n"); +@@ -3658,6 +3813,25 @@ int ath11k_qmi_pci_alloc_qdss_mem(struct + return 0; + } + ++static ++struct device_node *ath11k_get_etr_dev_node(struct ath11k_base *ab) ++{ ++ struct device_node *dev_node = NULL; ++ ++ if (ab->userpd_id) { ++ if (ab->userpd_id == QCN6122_USERPD_0) ++ dev_node = of_find_node_by_name(NULL, ++ "q6_qcn6122_etr_1"); ++ else if (ab->userpd_id == QCN6122_USERPD_1) ++ dev_node = of_find_node_by_name(NULL, ++ "q6_qcn6122_etr_2"); ++ } else { ++ dev_node = of_find_node_by_name(NULL, "q6_etr_dump"); ++ } ++ ++ return dev_node; ++} ++ + int ath11k_qmi_qdss_mem_alloc(struct ath11k_qmi *qmi) + { + int ret, i; +@@ -3666,7 +3840,7 @@ int ath11k_qmi_qdss_mem_alloc(struct ath + struct resource q6_etr; + + if (ab->bus_params.fixed_bdf_addr) { +- dev_node = of_find_node_by_name(NULL, "q6_etr_dump"); ++ dev_node = ath11k_get_etr_dev_node(ab); + if (!dev_node) { + ath11k_err(ab, "No q6_etr_dump available in dts\n"); + return -ENOMEM; +@@ -3681,6 +3855,19 @@ int ath11k_qmi_qdss_mem_alloc(struct ath + ab->qmi.qdss_mem[i].paddr = q6_etr.start; + ab->qmi.qdss_mem[i].size = resource_size(&q6_etr); + ab->qmi.qdss_mem[i].type = QDSS_ETR_MEM_REGION_TYPE; ++ if (ab->hw_rev == ATH11K_HW_QCN6122) { ++ ab->qmi.qdss_mem[i].vaddr = ++ ioremap(ab->qmi.qdss_mem[i].paddr, ++ ab->qmi.qdss_mem[i].size); ++ if (!ab->qmi.qdss_mem[i].vaddr) { ++ ath11k_err(ab, "Error: etr-addr remap failed\n"); ++ return -ENOMEM; ++ } ++ } ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "QDSS mem addr pa 0x%x va 0x%p, size 0x%x", ++ (unsigned int)ab->qmi.qdss_mem[i].paddr, ++ ab->qmi.qdss_mem[i].vaddr, ++ (unsigned int)ab->qmi.qdss_mem[i].size); + } + } else { + ret = ath11k_qmi_pci_alloc_qdss_mem(qmi); +@@ -3791,6 +3978,12 @@ static int ath11k_qmi_event_load_bdf(str + return ret; + } + ++ ret = ath11k_qmi_request_device_info(ab); ++ if (ret < 0) { ++ ath11k_warn(ab, "qmi failed to req device info %d\n", ret); ++ return ret; ++ } ++ + ret = ath11k_qmi_load_bdf_qmi(ab); + if (ret < 0) { + ath11k_warn(ab, "qmi failed to load board data file:%d\n", ret); +@@ -4211,6 +4404,23 @@ static const struct qmi_ops ath11k_qmi_o + .del_server = ath11k_qmi_ops_del_server, + }; + ++static int ath11k_wait_for_qgic_msi(struct ath11k_base *ab) ++{ ++ int timeout; ++ ++ if (ab->hw_rev != ATH11K_HW_QCN6122) ++ return 0; ++ ++ timeout = wait_event_timeout(ab->ipci.qgic_msi_waitq, ++ (ab->ipci.qgic_enabled == 1), ++ ATH11K_RCV_QGIC_MSI_HDLR_DELAY); ++ if (timeout <= 0) { ++ ath11k_warn(ab, "Receive qgic msi handler timed out\n"); ++ return -ETIMEDOUT; ++ } ++ return 0; ++} ++ + static void ath11k_qmi_driver_event_work(struct work_struct *work) + { + struct ath11k_qmi *qmi = container_of(work, struct ath11k_qmi, +@@ -4264,6 +4474,14 @@ static void ath11k_qmi_driver_event_work + clear_bit(ATH11K_FLAG_CRASH_FLUSH, + &ab->dev_flags); + clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); ++ ret = ath11k_wait_for_qgic_msi(ab); ++ if (ret) { ++ ath11k_warn(ab, ++ "Failed to get qgic handler for dev %d ret: %d\n", ++ ab->hw_rev, ret); ++ break; ++ } ++ + ath11k_core_qmi_firmware_ready(ab); + set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags); + } +@@ -4385,7 +4603,7 @@ int ath11k_qmi_init_service(struct ath11 + destroy_workqueue(ab->qmi.event_wq); + return ret; + } +- ++ init_waitqueue_head(&ab->ipci.qgic_msi_waitq); + return ret; + } + +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -24,6 +24,7 @@ + #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01 + #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02 + #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07 ++#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122 0x40 + #define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 + #define ATH11K_QMI_RESP_LEN_MAX 8192 + #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 52 +@@ -41,7 +42,8 @@ + #define ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS 0x50100000 + #endif + +-#define ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS 0x4C800000 ++#define ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS 0x4C800000 ++#define ATH11K_QMI_QCN6122_M3_DUMP_ADDRESS 0x4E200000 + #define ATH11K_QMI_M3_DUMP_SIZE 0x100000 + + #define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035 +@@ -58,6 +60,11 @@ + #define ATH11K_FIRMWARE_MODE_OFF 4 + #define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) + ++#define QCN6122_USERPD_0 1 ++#define QCN6122_USERPD_1 2 ++#define QCN6122_DEVICE_BAR_SIZE 0x200000 ++#define ATH11K_RCV_QGIC_MSI_HDLR_DELAY (3 * HZ) ++ + struct ath11k_base; + extern unsigned int ath11k_host_ddr_addr; + +@@ -452,6 +459,9 @@ struct ath11k_qmi_event_qdss_trace_save_ + #define QMI_WLANFW_CAP_RESP_MSG_V01_MAX_LEN 235 + #define QMI_WLANFW_CAP_REQ_V01 0x0024 + #define QMI_WLANFW_CAP_RESP_V01 0x0024 ++#define QMI_WLANFW_DEVICE_INFO_REQ_V01 0x004C ++#define QMI_WLANFW_DEVICE_INFO_REQ_MSG_V01 0 ++ + + enum qmi_wlanfw_pipedir_enum_v01 { + QMI_WLFW_PIPEDIR_NONE_V01 = 0, +@@ -544,6 +554,18 @@ struct qmi_wlanfw_cap_req_msg_v01 { + char placeholder; + }; + ++struct qmi_wlanfw_device_info_req_msg_v01 { ++ char placeholder; ++}; ++ ++struct qmi_wlanfw_device_info_resp_msg_v01 { ++ struct qmi_response_type_v01 resp; ++ u8 bar_addr_valid; ++ u64 bar_addr; ++ u8 bar_size_valid; ++ u32 bar_size; ++}; ++ + #define QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN 6182 + #define QMI_WLANFW_BDF_DOWNLOAD_RESP_MSG_V01_MAX_LEN 7 + #define QMI_WLANFW_BDF_DOWNLOAD_RESP_V01 0x0025 +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1510,7 +1510,12 @@ int ath11k_debugfs_soc_create(struct ath + return 0; + + if (ab->hif.bus == ATH11K_BUS_AHB) { +- snprintf(soc_name, sizeof(soc_name), "%s", ab->hw_params.name); ++ if (ab->userpd_id) { ++ snprintf(soc_name, sizeof(soc_name), "%s_%d", ++ ab->hw_params.name, ab->userpd_id); ++ } else { ++ snprintf(soc_name, sizeof(soc_name), "%s", ab->hw_params.name); ++ } + } else { + snprintf(soc_name, sizeof(soc_name), "%s_%s", + ab->hw_params.name, dev_name(dev)); diff --git a/feeds/wifi-ax/mac80211/patches/qca/233-001-ath11k-add-support-memory-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/233-001-ath11k-add-support-memory-stats.patch new file mode 100644 index 000000000..d66dfb9de --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/233-001-ath11k-add-support-memory-stats.patch @@ -0,0 +1,981 @@ +From 9c99e124a279391dbe2cef66226fd4e86bde8f4d Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Mon, 4 Jan 2021 23:46:53 +0530 +Subject: [PATCH 1/2] ath11k/mac80211: Add support to account memory stats + +Memory allocations in the driver & mac80211 are logged +and populate those values to the user space via debugfs. +This stats will give the snapshot of the memory being +used by the driver at the time of dumping these +memory stats. + +Command: +cat /sys/kernel/debug/ath11k/ipq8074\ hw2.0/memory_stats + +Sample output of the stats +MEMORY STATS IN BYTES: +malloc size : 6287583 +ce_ring_alloc size: 109308 +dma_alloc size:: 10831860 +htc_skb_alloc size: 3840 +wmi alloc size: 0 +per peer object: 4644 +rx_post_buf size: 5091840 +Total size: 22329075 + +User can disable/enable the memory stats accounting with +the below command. + +echo N > /sys/kernel/debug/ath11k/ipq8074\ hw2.0/enable_memory_stats +where N = 0 to disable logging, 1 to enable the logging. + +Note: This should be enabled/disabled only after wifi is down. +User shouldn't enable/disable when the wifi is up to avoid +accounting the negative values which cause incorrect values +in the memory stats. + +Command: + +cat /sys/kernel/debug/ieee80211/phyX/memory_stats +memory stats: malloc_size: 108 + +Signed-off-by: Maharaja Kennadyrajan +--- + drivers/net/wireless/ath/ath11k/ce.c | 24 ++++ + drivers/net/wireless/ath/ath11k/core.c | 2 +- + drivers/net/wireless/ath/ath11k/core.h | 19 +++ + drivers/net/wireless/ath/ath11k/coredump.c | 15 ++- + drivers/net/wireless/ath/ath11k/dbring.c | 3 + + drivers/net/wireless/ath/ath11k/debugfs.c | 115 ++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 29 +++++ + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 4 + + drivers/net/wireless/ath/ath11k/dp.c | 13 ++ + drivers/net/wireless/ath/ath11k/hal.c | 6 + + drivers/net/wireless/ath/ath11k/htc.c | 5 + + drivers/net/wireless/ath/ath11k/mac.c | 15 ++- + drivers/net/wireless/ath/ath11k/nss.c | 46 +++++++ + drivers/net/wireless/ath/ath11k/peer.c | 5 + + drivers/net/wireless/ath/ath11k/wmi.c | 4 + + 15 files changed, 302 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ce.c ++++ b/drivers/net/wireless/ath/ath11k/ce.c +@@ -357,6 +357,9 @@ static int ath11k_ce_rx_post_pipe(struct + dev_kfree_skb_any(skb); + goto exit; + } ++ ++ ATH11K_MEMORY_STATS_INC(ab, ce_rx_pipe, skb->truesize); ++ + } + + exit: +@@ -425,6 +428,9 @@ static void ath11k_ce_recv_process_cb(st + __skb_queue_head_init(&list); + while (ath11k_ce_completed_recv_next(pipe, &skb, &nbytes) == 0) { + max_nbytes = skb->len + skb_tailroom(skb); ++ ++ ATH11K_MEMORY_STATS_DEC(ab, ce_rx_pipe, skb->truesize); ++ + dma_unmap_single(ab->dev, ATH11K_SKB_RXCB(skb)->paddr, + max_nbytes, DMA_FROM_DEVICE); + +@@ -618,6 +624,9 @@ ath11k_ce_alloc_ring(struct ath11k_base + if (ce_ring == NULL) + return ERR_PTR(-ENOMEM); + ++ ATH11K_MEMORY_STATS_INC(ab, ce_ring_alloc, ++ struct_size(ce_ring, skb, nentries)); ++ + ce_ring->nentries = nentries; + ce_ring->nentries_mask = nentries - 1; + +@@ -633,6 +642,9 @@ ath11k_ce_alloc_ring(struct ath11k_base + return ERR_PTR(-ENOMEM); + } + ++ ATH11K_MEMORY_STATS_INC(ab, ce_ring_alloc, ++ nentries * desc_sz + CE_DESC_RING_ALIGN); ++ + ce_ring->base_addr_ce_space_unaligned = base_addr; + + ce_ring->base_addr_owner_space = PTR_ALIGN( +@@ -812,6 +824,9 @@ static void ath11k_ce_rx_pipe_cleanup(st + continue; + + ring->skb[i] = NULL; ++ ++ ATH11K_MEMORY_STATS_DEC(ab, ce_rx_pipe, skb->truesize); ++ + dma_unmap_single(ab->dev, ATH11K_SKB_RXCB(skb)->paddr, + skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); + dev_kfree_skb_any(skb); +@@ -991,6 +1006,9 @@ void ath11k_ce_free_pipes(struct ath11k_ + CE_DESC_RING_ALIGN, + pipe->src_ring->base_addr_owner_space, + pipe->src_ring->base_addr_ce_space); ++ ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, ++ pipe->src_ring->nentries * desc_sz + ++ CE_DESC_RING_ALIGN); + kfree(pipe->src_ring); + pipe->src_ring = NULL; + } +@@ -1002,6 +1020,9 @@ void ath11k_ce_free_pipes(struct ath11k_ + CE_DESC_RING_ALIGN, + pipe->dest_ring->base_addr_owner_space, + pipe->dest_ring->base_addr_ce_space); ++ ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, ++ pipe->dest_ring->nentries * desc_sz + ++ CE_DESC_RING_ALIGN); + kfree(pipe->dest_ring); + pipe->dest_ring = NULL; + } +@@ -1014,6 +1035,9 @@ void ath11k_ce_free_pipes(struct ath11k_ + CE_DESC_RING_ALIGN, + pipe->status_ring->base_addr_owner_space, + pipe->status_ring->base_addr_ce_space); ++ ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, ++ pipe->status_ring->nentries * desc_sz + ++ CE_DESC_RING_ALIGN); + kfree(pipe->status_ring); + pipe->status_ring = NULL; + } +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -1353,6 +1353,8 @@ int ath11k_core_pre_init(struct ath11k_b + if (nss_offload) + ab->nss.stats_enabled = 1; + ++ ab->enable_memory_stats = ATH11K_DEBUG_ENABLE_MEMORY_STATS; ++ + return 0; + } + EXPORT_SYMBOL(ath11k_core_pre_init); +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -801,6 +801,23 @@ struct ath11k_internal_pci { + wait_queue_head_t qgic_msi_waitq; + }; + ++struct ath11k_memory_stats { ++ /* Account kzalloc and valloc */ ++ atomic_t malloc_size; ++ /* Account dma_alloc in dp.c & hal.c */ ++ atomic_t dma_alloc; ++ /* Account memory used in ce rings */ ++ atomic_t ce_ring_alloc; ++ /* Account memory used in htc_send */ ++ atomic_t htc_skb_alloc; ++ /* Account memory used in wmi tx skb alloc */ ++ atomic_t wmi_tx_skb_alloc; ++ /* Account memory consumed for peer object */ ++ atomic_t per_peer_object; ++ /* Account memory used in ce rx pipe */ ++ atomic_t ce_rx_pipe; ++}; ++ + /* Master structure to hold the hw data which may be used in core module */ + struct ath11k_base { + enum ath11k_hw_rev hw_rev; +@@ -878,6 +895,7 @@ struct ath11k_base { + enum ath11k_dfs_region dfs_region; + #ifdef CPTCFG_ATH11K_DEBUGFS + struct dentry *debugfs_soc; ++ struct ath11k_memory_stats memory_stats; + #endif + struct ath11k_soc_dp_stats soc_stats; + +@@ -916,6 +934,7 @@ struct ath11k_base { + struct ath11k_num_vdevs_peers *num_vdevs_peers; + int userpd_id; + struct ath11k_internal_pci ipci; ++ bool enable_memory_stats; + + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); +--- a/drivers/net/wireless/ath/ath11k/coredump.c ++++ b/drivers/net/wireless/ath/ath11k/coredump.c +@@ -109,6 +109,8 @@ void ath11k_coredump_build_inline(struct + if (!buf) + return; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, header_size); ++ + file_data = (struct ath11k_dump_file_data *)buf; + strlcpy(file_data->df_magic, "ATH11K-FW-DUMP", + sizeof(file_data->df_magic)); +@@ -132,8 +134,10 @@ void ath11k_coredump_build_inline(struct + memcpy(file_data->seg, segments, num_seg * sizeof(*segments)); + + dump_state = vzalloc(sizeof(*dump_state)); +- if(!dump_state) ++ if(!dump_state) { ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, header_size); + return; ++ } + + dump_state->header = file_data; + dump_state->num_seg = num_seg; +@@ -145,6 +149,8 @@ void ath11k_coredump_build_inline(struct + + /* Wait until the dump is read and free is called */ + wait_for_completion(&dump_state->dump_done); ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(*dump_state)); ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, header_size); + vfree(dump_state); + vfree(file_data); + } +@@ -274,14 +280,19 @@ void ath11k_coredump_qdss_dump(struct at + return; + } + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, len); ++ + if (event_data->total_size && + event_data->total_size <= ab->qmi.qdss_mem[0].size) + dump = vzalloc(event_data->total_size); + if (!dump) { ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, len); + vfree(segment); + return; + } + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, event_data->total_size); ++ + if (num_seg == 1) { + segment->len = event_data->mem_seg[0].size; + segment->vaddr = ab->qmi.qdss_mem[0].vaddr; +@@ -339,6 +350,8 @@ void ath11k_coredump_qdss_dump(struct at + } + ath11k_coredump_build_inline(ar_pci, segment, 1); + out: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, event_data->total_size); ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, len); + vfree(segment); + vfree(dump); + } +--- a/drivers/net/wireless/ath/ath11k/dbring.c ++++ b/drivers/net/wireless/ath/ath11k/dbring.c +@@ -104,6 +104,7 @@ static int ath11k_dbring_fill_bufs(struc + break; + } + num_remain--; ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, size); + } + + spin_unlock_bh(&srng->lock); +@@ -348,6 +349,8 @@ void ath11k_dbring_buf_cleanup(struct at + idr_remove(&ring->bufs_idr, buf_id); + dma_unmap_single(ar->ab->dev, buff->paddr, + ring->buf_sz, DMA_FROM_DEVICE); ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, sizeof(*buff) + ++ ring->buf_sz + ring->buf_align - 1); + kfree(buff); + } + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1358,6 +1358,8 @@ static ssize_t ath11k_debugfs_dump_soc_d + if (!buf) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, size); ++ + len += scnprintf(buf + len, size - len, "SOC RX STATS:\n\n"); + len += scnprintf(buf + len, size - len, "err ring pkts: %u\n", + soc_stats->err_ring_pkts); +@@ -1399,6 +1401,8 @@ static ssize_t ath11k_debugfs_dump_soc_d + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); + kfree(buf); + ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, size); ++ + return retval; + } + +@@ -1476,6 +1480,106 @@ static const struct file_operations fops + .open = simple_open, + }; + ++static ssize_t ++ath11k_debug_read_enable_memory_stats(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ char buf[10]; ++ size_t len; ++ ++ len = scnprintf(buf, sizeof(buf), "%d\n", ab->enable_memory_stats); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ++ath11k_debug_write_enable_memory_stats(struct file *file, ++ char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ bool enable; ++ int ret; ++ ++ if (kstrtobool_from_user(ubuf, count, &enable)) ++ return -EINVAL; ++ ++ if (enable == ab->enable_memory_stats) { ++ ret = count; ++ goto exit; ++ } ++ ++ ab->enable_memory_stats = enable; ++ ret = count; ++exit: ++ return ret; ++} ++ ++static const struct file_operations fops_enable_memory_stats = { ++ .read = ath11k_debug_read_enable_memory_stats, ++ .write = ath11k_debug_write_enable_memory_stats, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++ .open = simple_open, ++}; ++ ++static ssize_t ath11k_debug_dump_memory_stats(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ struct ath11k_memory_stats *memory_stats = &ab->memory_stats; ++ int len = 0, retval; ++ const int size = 4096; ++ ++ char *buf; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ len += scnprintf(buf + len, size - len, "MEMORY STATS IN BYTES:\n"); ++ len += scnprintf(buf + len, size - len, "malloc size : %u\n", ++ atomic_read(&memory_stats->malloc_size)); ++ len += scnprintf(buf + len, size - len, "ce_ring_alloc size: %u\n", ++ atomic_read(&memory_stats->ce_ring_alloc)); ++ len += scnprintf(buf + len, size - len, "dma_alloc size:: %u\n", ++ atomic_read(&memory_stats->dma_alloc)); ++ len += scnprintf(buf + len, size - len, "htc_skb_alloc size: %u\n", ++ atomic_read(&memory_stats->htc_skb_alloc)); ++ len += scnprintf(buf + len, size - len, "wmi tx skb alloc size: %u\n", ++ atomic_read(&memory_stats->wmi_tx_skb_alloc)); ++ len += scnprintf(buf + len, size - len, "per peer object: %u\n", ++ atomic_read(&memory_stats->per_peer_object)); ++ len += scnprintf(buf + len, size - len, "rx_post_buf size: %u\n", ++ atomic_read(&memory_stats->ce_rx_pipe)); ++ len += scnprintf(buf + len, size - len, "Total size: %u\n\n", ++ (atomic_read(&memory_stats->malloc_size) + ++ atomic_read(&memory_stats->ce_ring_alloc) + ++ atomic_read(&memory_stats->dma_alloc) + ++ atomic_read(&memory_stats->htc_skb_alloc) + ++ atomic_read(&memory_stats->wmi_tx_skb_alloc) + ++ atomic_read(&memory_stats->per_peer_object) + ++ atomic_read(&memory_stats->ce_rx_pipe))); ++ ++ if (len > size) ++ len = size; ++ ++ retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ kfree(buf); ++ ++ return retval; ++} ++ ++static const struct file_operations fops_memory_stats = { ++ .read = ath11k_debug_dump_memory_stats, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + int ath11k_debugfs_pdev_create(struct ath11k_base *ab) + { + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) +@@ -1639,6 +1743,12 @@ static ssize_t ath11k_write_pktlog_filte + } + } + ++ debugfs_create_file("enable_memory_stats", 0600, ab->debugfs_soc, ++ ab, &fops_enable_memory_stats); ++ ++ debugfs_create_file("memory_stats", 0600, ab->debugfs_soc, ab, ++ &fops_memory_stats); ++ + + #define HTT_RX_FILTER_TLV_LITE_MODE \ + (HTT_RX_FILTER_TLV_FLAGS_PPDU_START | \ +@@ -2225,6 +2335,8 @@ static ssize_t ath11k_dump_mgmt_stats(st + if (!buf) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, size); ++ + mutex_lock(&ar->conf_mutex); + spin_lock_bh(&ar->data_lock); + +@@ -2275,6 +2387,9 @@ static ssize_t ath11k_dump_mgmt_stats(st + ret = simple_read_from_buffer(ubuf, count, ppos, buf, len); + mutex_unlock(&ar->conf_mutex); + kfree(buf); ++ ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, size); ++ + return ret; + } + +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -10,6 +10,7 @@ + + #define ATH11K_TX_POWER_MAX_VAL 70 + #define ATH11K_TX_POWER_MIN_VAL 0 ++#define ATH11K_DEBUG_ENABLE_MEMORY_STATS 1 + + /* htt_dbg_ext_stats_type */ + enum ath11k_dbg_htt_ext_stats_type { +@@ -163,6 +164,24 @@ void ath11k_debugfs_wmi_ctrl_stats(struc + void ath11k_wmi_crl_path_stats_list_free(struct list_head *head); + + #ifdef CPTCFG_ATH11K_DEBUGFS ++#define ATH11K_MEMORY_STATS_INC(_struct, _field, _size) \ ++do { \ ++ if (ath11k_debug_is_memory_stats_enabled(_struct)) \ ++ atomic_add(_size, &_struct->memory_stats._field); \ ++} while(0) ++ ++#define ATH11K_MEMORY_STATS_DEC(_struct, _field, _size) \ ++do { \ ++ if (ath11k_debug_is_memory_stats_enabled(_struct)) \ ++ atomic_sub(_size, &_struct->memory_stats._field); \ ++} while(0) ++ ++#else ++#define ATH11K_MEMORY_STATS_INC(_struct, _field, _size) ++#define ATH11K_MEMORY_STATS_DEC(_struct, _field, _size) ++#endif ++ ++#ifdef CPTCFG_ATH11K_DEBUGFS + int ath11k_debugfs_create(void); + void ath11k_debugfs_destroy(void); + int ath11k_debugfs_soc_create(struct ath11k_base *ab); +@@ -208,6 +227,11 @@ static inline int ath11k_debugfs_rx_filt + return ar->debug.rx_filter; + } + ++static inline int ath11k_debug_is_memory_stats_enabled(struct ath11k_base *ab) ++{ ++ return ab->enable_memory_stats; ++} ++ + #else + static inline int ath11k_debugfs_create(void) + { +@@ -285,6 +309,11 @@ static inline bool ath11k_debugfs_is_pkt + return false; + } + ++static inline int ath11k_debug_is_memory_stats_enabled(struct ath11k_base *ab) ++{ ++ return 0; ++} ++ + static inline int ath11k_debugfs_rx_filter(struct ath11k *ar) + { + return 0; +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -492,6 +492,8 @@ static ssize_t ath11k_dbg_sta_dump_rx_st + if (!buf) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, size); ++ + he_rates_avail = (rx_stats->pream_cnt[HAL_RX_PREAMBLE_11AX] > 1) ? 1 : 0; + rate_table_len = he_rates_avail ? ATH11K_RX_RATE_TABLE_11AX_NUM : + ATH11K_RX_RATE_TABLE_NUM; +@@ -636,6 +638,8 @@ static ssize_t ath11k_dbg_sta_dump_rx_st + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); + kfree(buf); + ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, size); ++ + mutex_unlock(&ar->conf_mutex); + return retval; + } +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -109,6 +109,8 @@ void ath11k_dp_srng_cleanup(struct ath11 + dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned, + ring->paddr_unaligned); + ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, ring->size); ++ + ring->vaddr_unaligned = NULL; + } + +@@ -253,6 +255,8 @@ int ath11k_dp_srng_setup(struct ath11k_b + if (!ring->vaddr_unaligned) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, ring->size); ++ + ring->vaddr = PTR_ALIGN(ring->vaddr_unaligned, HAL_RING_BASE_ALIGN); + ring->paddr = ring->paddr_unaligned + ((unsigned long)ring->vaddr - + (unsigned long)ring->vaddr_unaligned); +@@ -485,6 +489,7 @@ static void ath11k_dp_scatter_idle_link_ + dma_free_coherent(ab->dev, HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX, + slist[i].vaddr, slist[i].paddr); + slist[i].vaddr = NULL; ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX); + } + } + +@@ -522,6 +527,7 @@ static int ath11k_dp_scatter_idle_link_d + ret = -ENOMEM; + goto err; + } ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX); + } + + scatter_idx = 0; +@@ -576,6 +582,7 @@ ath11k_dp_link_desc_bank_free(struct ath + link_desc_banks[i].vaddr_unaligned, + link_desc_banks[i].paddr_unaligned); + link_desc_banks[i].vaddr_unaligned = NULL; ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, link_desc_banks[i].size); + } + } + } +@@ -609,6 +616,7 @@ static int ath11k_dp_link_desc_bank_allo + ((unsigned long)desc_bank[i].vaddr - + (unsigned long)desc_bank[i].vaddr_unaligned); + desc_bank[i].size = desc_sz; ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, desc_bank[i].size); + } + + return 0; +@@ -1023,8 +1031,11 @@ static int ath11k_dp_tx_pending_cleanup( + void ath11k_dp_free(struct ath11k_base *ab) + { + struct ath11k_dp *dp = &ab->dp; ++ size_t size = 0; + int i; + ++ size = sizeof(struct hal_wbm_release_ring) * DP_TX_COMP_RING_SIZE; ++ + ath11k_dp_link_desc_cleanup(ab, dp->link_desc_banks, + HAL_WBM_IDLE_LINK, &dp->wbm_idle_ring); + +@@ -1038,6 +1049,7 @@ void ath11k_dp_free(struct ath11k_base * + ath11k_dp_tx_pending_cleanup, ab); + idr_destroy(&dp->tx_ring[i].txbuf_idr); + spin_unlock_bh(&dp->tx_ring[i].tx_idr_lock); ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, size); + kfree(dp->tx_ring[i].tx_status); + } + +@@ -1095,6 +1107,7 @@ int ath11k_dp_alloc(struct ath11k_base * + ret = -ENOMEM; + goto fail_cmn_srng_cleanup; + } ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, size); + } + + for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++) +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -200,6 +200,8 @@ static int ath11k_hal_alloc_cont_rdp(str + if (!hal->rdp.vaddr) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, size); ++ + return 0; + } + +@@ -214,6 +216,7 @@ static void ath11k_hal_free_cont_rdp(str + size = sizeof(u32) * HAL_SRNG_RING_ID_MAX; + dma_free_coherent(ab->dev, size, + hal->rdp.vaddr, hal->rdp.paddr); ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, size); + hal->rdp.vaddr = NULL; + } + +@@ -228,6 +231,8 @@ static int ath11k_hal_alloc_cont_wrp(str + if (!hal->wrp.vaddr) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, size); ++ + return 0; + } + +@@ -242,6 +247,7 @@ static void ath11k_hal_free_cont_wrp(str + size = sizeof(u32) * HAL_SRNG_NUM_LMAC_RINGS; + dma_free_coherent(ab->dev, size, + hal->wrp.vaddr, hal->wrp.paddr); ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, size); + hal->wrp.vaddr = NULL; + } + +--- a/drivers/net/wireless/ath/ath11k/htc.c ++++ b/drivers/net/wireless/ath/ath11k/htc.c +@@ -28,6 +28,7 @@ struct sk_buff *ath11k_htc_alloc_skb(str + static void ath11k_htc_control_tx_complete(struct ath11k_base *ab, + struct sk_buff *skb) + { ++ ATH11K_MEMORY_STATS_DEC(ab, htc_skb_alloc, skb->truesize); + kfree_skb(skb); + } + +@@ -650,6 +651,8 @@ int ath11k_htc_connect_service(struct at + return status; + } + ++ ATH11K_MEMORY_STATS_INC(ab, htc_skb_alloc, skb->truesize); ++ + /* wait for response */ + time_left = wait_for_completion_timeout(&htc->ctl_resp, + ATH11K_HTC_CONN_SVC_TIMEOUT_HZ); +@@ -773,6 +776,8 @@ int ath11k_htc_start(struct ath11k_htc * + return status; + } + ++ ATH11K_MEMORY_STATS_INC(ab, htc_skb_alloc, skb->truesize); ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3535,6 +3535,8 @@ static int ath11k_mac_op_hw_scan(struct + goto exit; + } + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, sizeof(*arg)); ++ + ath11k_wmi_start_scan_init(ar, arg); + arg->vdev_id = arvif->vdev_id; + arg->scan_id = ATH11K_SCAN_ID; +@@ -3546,6 +3548,8 @@ static int ath11k_mac_op_hw_scan(struct + memcpy(arg->extraie.ptr, req->ie, req->ie_len); + } + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, req->ie_len); ++ + if (req->n_ssids) { + arg->num_ssids = req->n_ssids; + for (i = 0; i < arg->num_ssids; i++) { +@@ -3597,8 +3601,13 @@ static int ath11k_mac_op_hw_scan(struct + + exit: + if (arg) { +- if (arg->extraie.ptr) ++ if (arg->extraie.ptr) { ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, req->ie_len); + kfree(arg->extraie.ptr); ++ } ++ ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, sizeof(*arg)); ++ + kfree(arg); + } + +@@ -6770,6 +6779,8 @@ ath11k_mac_update_active_vif_chan(struct + if (!arg.vifs) + return; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, sizeof(arg.vifs[0])); ++ + ieee80211_iterate_active_interfaces_atomic(ar->hw, + IEEE80211_IFACE_ITER_NORMAL, + ath11k_mac_change_chanctx_fill_iter, +@@ -6777,6 +6788,8 @@ ath11k_mac_update_active_vif_chan(struct + + ath11k_mac_update_vif_chan(ar, arg.vifs, arg.n_vifs); + ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, sizeof(arg.vifs[0])); ++ + kfree(arg.vifs); + } + +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -876,6 +876,8 @@ int ath11k_nss_vdev_set_cmd(struct ath11 + if (!vdev_msg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, sizeof(*vdev_msg)); ++ + /* TODO: Convert to function for conversion in case of many + * such commands + */ +@@ -906,6 +908,7 @@ int ath11k_nss_vdev_set_cmd(struct ath11 + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss vdev set cmd success cmd:%d val:%d\n", + cmd, val); + free: ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, sizeof(*vdev_msg)); + kfree(vdev_msg); + return status; + } +@@ -922,6 +925,9 @@ static int ath11k_nss_vdev_configure(str + if (!vdev_msg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); ++ + vdev_cfg = &vdev_msg->msg.vdev_config; + + vdev_cfg->radio_ifnum = ar->nss.if_num; +@@ -957,6 +963,8 @@ static int ath11k_nss_vdev_configure(str + + ret = 0; + free: ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); + kfree(vdev_msg); + + return ret; +@@ -1180,6 +1188,9 @@ int ath11k_nss_vdev_up(struct ath11k_vif + if (!vdev_msg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); ++ + vdev_en = &vdev_msg->msg.vdev_enable; + + ether_addr_copy(vdev_en->mac_addr, arvif->vif->addr); +@@ -1198,6 +1209,8 @@ int ath11k_nss_vdev_up(struct ath11k_vif + + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss vdev up tx msg success\n"); + free: ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); + kfree(vdev_msg); + return ret; + } +@@ -1220,6 +1233,8 @@ int ath11k_nss_vdev_down(struct ath11k_v + if (!vdev_msg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); + nss_wifi_vdev_msg_init(vdev_msg, arvif->nss.if_num, + NSS_WIFI_VDEV_INTERFACE_DOWN_MSG, + sizeof(struct nss_wifi_vdev_disable_msg), +@@ -1234,6 +1249,8 @@ int ath11k_nss_vdev_down(struct ath11k_v + + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss vdev down tx msg success\n"); + free: ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, ++ sizeof(struct nss_wifi_vdev_msg)); + kfree(vdev_msg); + return ret; + } +@@ -1257,6 +1274,9 @@ int ath11k_nss_set_peer_sec_type(struct + if (!wlmsg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ar->ab, malloc_size, ++ sizeof(struct nss_wifili_msg)); ++ + sec_msg = &wlmsg->msg.securitymsg; + sec_msg->peer_id = peer->peer_id; + +@@ -1288,6 +1308,8 @@ int ath11k_nss_set_peer_sec_type(struct + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss peer id %d security cfg complete\n", + peer->peer_id); + free: ++ ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, ++ sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + return status; + } +@@ -1886,6 +1908,7 @@ static void ath11k_nss_tx_desc_mem_free( + ab->nss.tx_desc_vaddr[i], + ab->nss.tx_desc_paddr[i]); + ab->nss.tx_desc_vaddr[i] = NULL; ++ ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, ab->nss.tx_desc_size[i]); + } + + ath11k_dbg(ab, ATH11K_DBG_NSS, "allocated tx desc mem freed\n"); +@@ -1917,6 +1940,8 @@ static int ath11k_nss_tx_desc_mem_alloc( + ab->nss.tx_desc_size[curr_page_idx] = alloc_size; + curr_page_idx++; + ++ ATH11K_MEMORY_STATS_INC(ab, dma_alloc, alloc_size); ++ + ath11k_dbg(ab, ATH11K_DBG_NSS, + "curr page %d, allocated %d, total allocated %d\n", + curr_page_idx, alloc_size, i + alloc_size); +@@ -2093,6 +2118,8 @@ static int ath11k_nss_init(struct ath11k + if (!wlmsg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + wim = &wlmsg->msg.init; + + wim->target_type = target_type; +@@ -2211,6 +2238,7 @@ unregister: + nss_unregister_wifili_if(ab->nss.if_num); + free: + ath11k_nss_tx_desc_mem_free(ab); ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + return -EINVAL; + } +@@ -2316,6 +2344,8 @@ int ath11k_nss_pdev_init(struct ath11k_b + goto unregister; + } + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + pdevmsg = &wlmsg->msg.pdevmsg; + + pdevmsg->radio_id = radio_id; +@@ -2361,6 +2391,8 @@ int ath11k_nss_pdev_init(struct ath11k_b + goto free; + } + ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + kfree(wlmsg); + + /* Disable nss sojourn stats by default */ +@@ -2379,6 +2411,7 @@ int ath11k_nss_pdev_init(struct ath11k_b + return 0; + + free: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + unregister: + nss_unregister_wifili_radio_if(ar->nss.if_num); +@@ -2401,6 +2434,8 @@ int ath11k_nss_start(struct ath11k_base + if (!wlmsg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; + + /* Empty message for NSS Start message */ +@@ -2441,6 +2476,7 @@ int ath11k_nss_start(struct ath11k_base + ath11k_dbg(ab, ATH11K_DBG_NSS, "nss start success\n"); + + free: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + return ret; + } +@@ -2459,6 +2495,8 @@ static void ath11k_nss_reset(struct ath1 + return; + } + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; + + /* Empty message for NSS Reset message */ +@@ -2497,6 +2535,7 @@ static void ath11k_nss_reset(struct ath1 + nss_unregister_wifili_if(ab->nss.if_num); + + free: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + } + +@@ -2512,6 +2551,8 @@ static int ath11k_nss_stop(struct ath11k + if (!wlmsg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; + + /* Empty message for Stop command */ +@@ -2551,6 +2592,8 @@ static int ath11k_nss_stop(struct ath11k + /* NSS Stop success */ + ret = 0; + free: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + kfree(wlmsg); + return ret; + } +@@ -2576,6 +2619,8 @@ int ath11k_nss_pdev_deinit(struct ath11k + if (!wlmsg) + return -ENOMEM; + ++ ATH11K_MEMORY_STATS_INC(ab, malloc_size, sizeof(struct nss_wifili_msg)); ++ + deinit = &wlmsg->msg.pdevdeinit; + deinit->ifnum = radio_id; + +@@ -2618,6 +2663,7 @@ int ath11k_nss_pdev_deinit(struct ath11k + nss_dynamic_interface_dealloc_node(ar->nss.if_num, dyn_if_type); + nss_unregister_wifili_radio_if(ar->nss.if_num); + free: ++ ATH11K_MEMORY_STATS_DEC(ab, malloc_size, sizeof(struct nss_wifili_msg)); + kfree(wlmsg); + return ret; + } +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -633,6 +633,9 @@ int ath11k_peer_delete(struct ath11k *ar + if (ret) + return ret; + ++ ATH11K_MEMORY_STATS_DEC(ar->ab, per_peer_object, ++ sizeof(struct ath11k_peer)); ++ + ar->num_peers--; + + return 0; +@@ -729,6 +732,8 @@ int ath11k_peer_create(struct ath11k *ar + ath11k_dp_sta_tx_attach(arsta, peer->peer_id); + } + ++ ATH11K_MEMORY_STATS_INC(ar->ab, per_peer_object, sizeof(*peer)); ++ + ar->num_peers++; + + spin_unlock_bh(&ar->ab->base_lock); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -599,6 +599,8 @@ struct sk_buff *ath11k_wmi_alloc_skb(str + if (!skb) + return NULL; + ++ ATH11K_MEMORY_STATS_INC(ab, wmi_tx_skb_alloc, skb->truesize); ++ + skb_reserve(skb, WMI_SKB_HEADROOM); + if (!IS_ALIGNED((unsigned long)skb->data, 4)) + ath11k_warn(ab, "unaligned WMI skb data\n"); +@@ -6666,6 +6668,7 @@ static void ath11k_wmi_htc_tx_complete(s + if (wmi_ep_count > ab->hw_params.max_radios) + goto out; + ++ ATH11K_MEMORY_STATS_DEC(ab, wmi_tx_skb_alloc, skb->truesize); + dev_kfree_skb(skb); + + for (i = 0; i < ab->htc.wmi_ep_count; i++) { +@@ -6679,6 +6682,7 @@ static void ath11k_wmi_htc_tx_complete(s + + return; + out: ++ ATH11K_MEMORY_STATS_DEC(ab, wmi_tx_skb_alloc, skb->truesize); + dev_kfree_skb(skb); + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/233-002-mac80211-add-support-memory-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/233-002-mac80211-add-support-memory-stats.patch new file mode 100644 index 000000000..c6482b9f5 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/233-002-mac80211-add-support-memory-stats.patch @@ -0,0 +1,382 @@ +From e16e606c956892bda991ffc50dedc85042ddd3ca Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Mon, 4 Jan 2021 23:47:57 +0530 +Subject: [PATCH 2/2] ath11k/mac80211: Add support to account memory stats + +Memory allocations in the driver & mac80211 are logged +and populate those values to the user space via debugfs. +This stats will give the snapshot of the memory being +used by the driver at the time of dumping these +memory stats. + +Command: +cat /sys/kernel/debug/ath11k/ipq8074\ hw2.0/memory_stats + +Sample output of the stats +MEMORY STATS IN BYTES: +malloc size : 6287583 +ce_ring_alloc size: 109308 +dma_alloc size:: 10831860 +htc_skb_alloc size: 3840 +wmi alloc size: 0 +per peer object: 4644 +rx_post_buf size: 5091840 +Total size: 22329075 + +User can disable/enable the memory stats accounting with +the below command. + +echo N > /sys/kernel/debug/ath11k/ipq8074\ hw2.0/enable_memory_stats +where N = 0 to disable logging, 1 to enable the logging. + +Note: This should be enabled/disabled only after wifi is down. +User shouldn't enable/disable when the wifi is up to avoid +accounting the negative values which cause incorrect values +in the memory stats. + +Command: +cat /sys/kernel/debug/ieee80211/phyX/memory_stats +memory stats: malloc_size: 108 + +Signed-off-by: Maharaja Kennadyrajan +--- + net/mac80211/chan.c | 12 ++++++++++++ + net/mac80211/debugfs.c | 4 ++++ + net/mac80211/ieee80211_i.h | 6 ++++++ + net/mac80211/iface.c | 5 +++++ + net/mac80211/mesh.c | 4 ++++ + net/mac80211/mesh_hwmp.c | 5 +++++ + net/mac80211/mesh_pathtbl.c | 12 ++++++++++++ + net/mac80211/offchannel.c | 7 +++++++ + net/mac80211/scan.c | 18 ++++++++++++++++++ + net/mac80211/sta_info.c | 16 ++++++++++++++++ + 10 files changed, 89 insertions(+) + +--- a/net/mac80211/chan.c ++++ b/net/mac80211/chan.c +@@ -517,6 +517,9 @@ ieee80211_alloc_chanctx(struct ieee80211 + if (!ctx) + return NULL; + ++ atomic_add(sizeof(*ctx) + local->hw.chanctx_data_size, ++ &local->memory_stats.malloc_size); ++ + INIT_LIST_HEAD(&ctx->assigned_vifs); + INIT_LIST_HEAD(&ctx->reserved_vifs); + ctx->conf.def = *chandef; +@@ -577,6 +580,8 @@ ieee80211_new_chanctx(struct ieee80211_l + + err = ieee80211_add_chanctx(local, ctx); + if (err) { ++ atomic_sub(sizeof(*ctx) + local->hw.chanctx_data_size, ++ &local->memory_stats.malloc_size); + kfree(ctx); + return ERR_PTR(err); + } +@@ -629,6 +634,8 @@ static void ieee80211_free_chanctx(struc + + list_del_rcu(&ctx->list); + ieee80211_del_chanctx(local, ctx); ++ atomic_sub(sizeof(*ctx) + local->hw.chanctx_data_size, ++ &local->memory_stats.malloc_size); + kfree_rcu(ctx, rcu_head); + } + +@@ -1265,6 +1272,9 @@ static int ieee80211_chsw_switch_vifs(st + if (!vif_chsw) + return -ENOMEM; + ++ atomic_add(sizeof(vif_chsw[0]) * n_vifs, ++ &local->memory_stats.malloc_size); ++ + i = 0; + list_for_each_entry(ctx, &local->chanctx_list, list) { + if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) +@@ -1294,6 +1304,8 @@ static int ieee80211_chsw_switch_vifs(st + CHANCTX_SWMODE_SWAP_CONTEXTS); + + out: ++ atomic_sub(sizeof(vif_chsw[0]) * n_vifs, ++ &local->memory_stats.malloc_size); + kfree(vif_chsw); + return err; + } +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -71,6 +71,8 @@ DEBUGFS_READONLY_FILE(wep_iv, "%#08x", + local->wep_iv & 0xffffff); + DEBUGFS_READONLY_FILE(rate_ctrl_alg, "%s", + local->rate_ctrl ? local->rate_ctrl->ops->name : "hw/driver"); ++DEBUGFS_READONLY_FILE(memory_stats, "memory stats: malloc_size: %u", ++ atomic_read(&local->memory_stats.malloc_size)); + + static ssize_t aqm_read(struct file *file, + char __user *user_buf, +@@ -587,6 +589,8 @@ void debugfs_hw_add(struct ieee80211_loc + if (!statsd) + return; + ++ DEBUGFS_ADD(memory_stats); ++ + #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS + DEBUGFS_STATS_ADD(dot11TransmittedFragmentCount); + DEBUGFS_STATS_ADD(dot11MulticastTransmittedFrameCount); +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -1164,6 +1164,10 @@ enum mac80211_scan_state { + SCAN_ABORT, + }; + ++struct mac80211_memory_stats { ++ atomic_t malloc_size; ++}; ++ + struct ieee80211_local { + /* embed the driver visible part. + * don't cast (use the static inlines below), but we keep +@@ -1451,6 +1455,8 @@ struct ieee80211_local { + /* TDLS channel switch */ + struct work_struct tdls_chsw_work; + struct sk_buff_head skb_queue_tdls_chsw; ++ ++ struct mac80211_memory_stats memory_stats; + }; + + static inline struct ieee80211_sub_if_data * +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1065,6 +1065,9 @@ int ieee80211_add_virtual_monitor(struct + return ret; + } + ++ atomic_add(sizeof(*sdata) + local->hw.vif_data_size, ++ &local->memory_stats.malloc_size); ++ + skb_queue_head_init(&sdata->skb_queue); + INIT_WORK(&sdata->work, ieee80211_iface_work); + +@@ -1100,6 +1103,8 @@ void ieee80211_del_virtual_monitor(struc + + drv_remove_interface(local, sdata); + ++ atomic_sub(sizeof(*sdata) + local->hw.vif_data_size, ++ &local->memory_stats.malloc_size); + kfree(sdata); + } + +--- a/net/mac80211/mesh.c ++++ b/net/mac80211/mesh.c +@@ -173,6 +173,8 @@ int mesh_rmc_init(struct ieee80211_sub_i + sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); + if (!sdata->u.mesh.rmc) + return -ENOMEM; ++ atomic_add(sizeof(struct mesh_rmc), ++ &sdata->local->memory_stats.malloc_size); + sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; + for (i = 0; i < RMC_BUCKETS; i++) + INIT_HLIST_HEAD(&sdata->u.mesh.rmc->bucket[i]); +@@ -196,6 +198,8 @@ void mesh_rmc_free(struct ieee80211_sub_ + } + } + ++ atomic_sub(sizeof(struct mesh_rmc), ++ &sdata->local->memory_stats.malloc_size); + kfree(rmc); + sdata->u.mesh.rmc = NULL; + } +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -997,6 +997,9 @@ static void mesh_queue_preq(struct mesh_ + return; + } + ++ atomic_add(sizeof(struct mesh_preq_queue), ++ &sdata->local->memory_stats.malloc_size); ++ + memcpy(preq_node->dst, mpath->dst, ETH_ALEN); + preq_node->flags = flags; + +@@ -1111,6 +1114,8 @@ void mesh_path_start_discovery(struct ie + + enddiscovery: + rcu_read_unlock(); ++ atomic_sub(sizeof(struct mesh_preq_queue), ++ &sdata->local->memory_stats.malloc_size); + kfree(preq_node); + } + +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -764,6 +764,9 @@ int mesh_pathtbl_init(struct ieee80211_s + struct mesh_table *tbl_path, *tbl_mpp; + int ret; + ++ atomic_add(sizeof(struct mesh_table), ++ &sdata->local->memory_stats.malloc_size); ++ + tbl_path = mesh_table_alloc(); + if (!tbl_path) + return -ENOMEM; +@@ -774,12 +777,17 @@ int mesh_pathtbl_init(struct ieee80211_s + goto free_path; + } + ++ atomic_add(sizeof(struct mesh_table), ++ &sdata->local->memory_stats.malloc_size); ++ + sdata->u.mesh.mesh_paths = tbl_path; + sdata->u.mesh.mpp_paths = tbl_mpp; + + return 0; + + free_path: ++ atomic_sub(sizeof(struct mesh_table), ++ &sdata->local->memory_stats.malloc_size); + mesh_table_free(tbl_path); + return ret; + } +@@ -809,6 +817,10 @@ void mesh_path_expire(struct ieee80211_s + + void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata) + { ++ atomic_sub(sizeof(struct mesh_table), ++ &sdata->local->memory_stats.malloc_size); ++ atomic_sub(sizeof(struct mesh_table), ++ &sdata->local->memory_stats.malloc_size); + mesh_table_free(sdata->u.mesh.mesh_paths); + mesh_table_free(sdata->u.mesh.mpp_paths); + } +--- a/net/mac80211/offchannel.c ++++ b/net/mac80211/offchannel.c +@@ -168,6 +168,7 @@ void ieee80211_offchannel_return(struct + + static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) + { ++ struct ieee80211_sub_if_data *sdata = roc->sdata; + /* was never transmitted */ + if (roc->frame) { + cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie, +@@ -186,6 +187,8 @@ static void ieee80211_roc_notify_destroy + roc->chan, GFP_KERNEL); + + list_del(&roc->list); ++ atomic_sub(sizeof(*roc), ++ &sdata->local->memory_stats.malloc_size); + kfree(roc); + } + +@@ -548,6 +551,8 @@ static int ieee80211_start_roc_work(stru + if (!roc) + return -ENOMEM; + ++ atomic_add(sizeof(*roc), &local->memory_stats.malloc_size); ++ + /* + * If the duration is zero, then the driver + * wouldn't actually do anything. Set it to +@@ -593,6 +598,8 @@ static int ieee80211_start_roc_work(stru + ret = drv_remain_on_channel(local, sdata, channel, + duration, type); + if (ret) { ++ atomic_sub(sizeof(*roc), ++ &local->memory_stats.malloc_size); + kfree(roc); + return ret; + } +--- a/net/mac80211/scan.c ++++ b/net/mac80211/scan.c +@@ -441,6 +441,12 @@ static void __ieee80211_scan_completed(s + scan_req = rcu_dereference_protected(local->scan_req, + lockdep_is_held(&local->mtx)); + ++ atomic_sub(sizeof(*local->hw_scan_req) + ++ scan_req->n_channels * ++ sizeof(scan_req->channels[0]) + ++ local->hw_scan_ies_bufsize, ++ &local->memory_stats.malloc_size); ++ + if (scan_req != local->int_scan_req) { + local->scan_info.aborted = aborted; + cfg80211_scan_done(scan_req, &local->scan_info); +@@ -710,6 +716,12 @@ static int __ieee80211_start_scan(struct + if (!local->hw_scan_req) + return -ENOMEM; + ++ atomic_add(sizeof(*local->hw_scan_req) + ++ req->n_channels * ++ sizeof(req->channels[0]) + ++ local->hw_scan_ies_bufsize, ++ &local->memory_stats.malloc_size); ++ + local->hw_scan_req->req.chandef = req->chandef; + local->hw_scan_req->req.ssids = req->ssids; + local->hw_scan_req->req.n_ssids = req->n_ssids; +@@ -799,6 +811,12 @@ static int __ieee80211_start_scan(struct + } + + if (rc) { ++ atomic_sub(sizeof(*local->hw_scan_req) + ++ req->n_channels * ++ sizeof(req->channels[0]) + ++ local->hw_scan_ies_bufsize, ++ &local->memory_stats.malloc_size); ++ + kfree(local->hw_scan_req); + local->hw_scan_req = NULL; + local->scanning = 0; +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -258,6 +258,7 @@ struct sta_info *sta_info_get_by_idx(str + */ + void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) + { ++ struct ieee80211_hw *hw = &local->hw; + /* + * If we had used sta_info_pre_move_state() then we might not + * have gone through the state transitions down again, so do +@@ -285,8 +286,13 @@ void sta_info_free(struct ieee80211_loca + kfree(to_txq_info(sta->sta.txq[0])); + kfree(rcu_dereference_raw(sta->sta.rates)); + #ifdef CPTCFG_MAC80211_MESH ++ if (sta->mesh) ++ atomic_sub(sizeof(*sta->mesh), ++ &local->memory_stats.malloc_size); + kfree(sta->mesh); + #endif ++ atomic_sub(sizeof(*sta) + hw->sta_data_size, ++ &local->memory_stats.malloc_size); + free_percpu(sta->pcpu_rx_stats); + kfree(sta); + } +@@ -345,6 +351,9 @@ struct sta_info *sta_info_alloc(struct i + if (!sta) + return NULL; + ++ atomic_add(sizeof(*sta) + hw->sta_data_size, ++ &local->memory_stats.malloc_size); ++ + if (ieee80211_hw_check(hw, USES_RSS)) { + sta->pcpu_rx_stats = + alloc_percpu_gfp(struct ieee80211_sta_rx_stats, gfp); +@@ -362,6 +371,8 @@ struct sta_info *sta_info_alloc(struct i + sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); + if (!sta->mesh) + goto free; ++ atomic_add(sizeof(*sta->mesh), ++ &local->memory_stats.malloc_size); + sta->mesh->plink_sta = sta; + spin_lock_init(&sta->mesh->plink_lock); + if (ieee80211_vif_is_mesh(&sdata->vif) && +@@ -526,8 +537,12 @@ free_txq: + free: + free_percpu(sta->pcpu_rx_stats); + #ifdef CPTCFG_MAC80211_MESH ++ atomic_sub(sizeof(*sta->mesh), ++ &local->memory_stats.malloc_size); + kfree(sta->mesh); + #endif ++ atomic_sub(sizeof(*sta) + hw->sta_data_size, ++ &local->memory_stats.malloc_size); + kfree(sta); + return NULL; + } diff --git a/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch new file mode 100644 index 000000000..0b7117d77 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch @@ -0,0 +1,1059 @@ +From 30f54666ae15128f26fbad787a35253885a10513 Mon Sep 17 00:00:00 2001 +From: Ramya Gnanasekar +Date: Fri, 25 Dec 2020 16:11:06 +0530 +Subject: [PATCH] ath11k: Disable rx_header tlv for 2K SKB + +On low memory platform hdr_status in hal_rx_desc is not subscribed to +get a savings of 128bytes in skb. This is required to reduce the skb +size from 4K to 2K. Use HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message +to unsubscribe rx_pkt_header tlv for rxdma ring. + +Signed-off-by: Ramya Gnanasekar + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1224,6 +1224,7 @@ static ssize_t ath11k_write_extd_rx_stat + } + + ar->debug.rx_filter = tlv_filter.rx_filter; ++ tlv_filter.offset_valid = false; + + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; +@@ -1732,6 +1733,7 @@ static ssize_t ath11k_write_pktlog_filte + } + + /* Clear rx filter set for monitor mode and rx status */ ++ tlv_filter.offset_valid = false; + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; + ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, ar->dp.mac_id, +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -224,7 +224,8 @@ struct ath11k_pdev_dp { + #define DP_REO_CMD_RING_SIZE 128 + #define DP_REO_STATUS_RING_SIZE 2048 + #define DP_RXDMA_BUF_RING_SIZE 4096 +-#define DP_RXDMA_REFILL_RING_SIZE 2048 ++#define DP_RXDMA_REFILL_RING_SIZE ATH11K_DP_RXDMA_REFILL_RING_SIZE ++#define DP_RXDMA_NSS_REFILL_RING_SIZE ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE + #define DP_RXDMA_ERR_DST_RING_SIZE 1024 + #define DP_RXDMA_MON_STATUS_RING_SIZE ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE + #define DP_RXDMA_MONITOR_BUF_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE +@@ -646,7 +647,7 @@ enum htt_stats_internal_ppdu_frametype { + * + * |31 26|25|24|23 16|15 8|7 0| + * |-----------------+----------------+----------------+---------------| +- * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type | ++ * | rsvd1|OV|PS|SS| ring_id | pdev_id | msg_type | + * |-------------------------------------------------------------------| + * | rsvd2 | ring_buffer_size | + * |-------------------------------------------------------------------| +@@ -660,6 +661,14 @@ enum htt_stats_internal_ppdu_frametype { + * |-------------------------------------------------------------------| + * | tlv_filter_in_flags | + * |-------------------------------------------------------------------| ++ * | rx_header_offset | rx_packet_offset | ++ * |-------------------------------------------------------------------| ++ * | rx_mpdu_start_offset | rx_mpdu_end_offset | ++ * |-------------------------------------------------------------------| ++ * | rx_msdu_start_offset | rx_msdu_end_offset | ++ * |-------------------------------------------------------------------| ++ * | rsvd3 | rx_attention_offset | ++ * |-------------------------------------------------------------------| + * Where: + * PS = pkt_swap + * SS = status_swap +@@ -673,7 +682,10 @@ enum htt_stats_internal_ppdu_frametype { + * More details can be got from enum htt_srng_ring_id + * b'24 - status_swap: 1 is to swap status TLV + * b'25 - pkt_swap: 1 is to swap packet TLV +- * b'26:31 - rsvd1: reserved for future use ++ * b'26 - rx_offset_valid (OV): flag to indicate rx offsets ++ * configuration fields are valid ++ * ++ * b'27:31 - rsvd1: reserved for future use + * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring, + * in byte units. + * Valid only for HW_TO_SW_RING and SW_TO_HW_RING +@@ -702,6 +714,42 @@ enum htt_stats_internal_ppdu_frametype { + * dword6 - b'0:31 - tlv_filter_in_flags: + * Filter in Attention/MPDU/PPDU/Header/User tlvs + * Refer to CFG_TLV_FILTER_IN_FLAG defs ++ * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_1 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_header_offset: rx_header_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_1 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_2 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_2 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_3 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_3 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_4 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rsvd3 for future use + */ + + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_MSG_TYPE GENMASK(7, 0) +@@ -709,8 +757,16 @@ enum htt_stats_internal_ppdu_frametype { + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_RING_ID GENMASK(23, 16) + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_SS BIT(24) + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PS BIT(25) ++#define HTT_RX_RING_SELECTION_CFG_CMD_OFFSET_VALID BIT(26) + + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO1_BUF_SIZE GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET GENMASK(15, 0) + + enum htt_rx_filter_tlv_flags { + HTT_RX_FILTER_TLV_FLAGS_MPDU_START = BIT(0), +@@ -1014,6 +1070,14 @@ enum htt_rx_data_pkt_filter_tlv_flasg3 { + HTT_RX_FILTER_TLV_FLAGS_PER_MSDU_HEADER | \ + HTT_RX_FILTER_TLV_FLAGS_ATTENTION) + ++#define HTT_RX_RXDMA_FILTER_TLV_FLAGS_BUF_RING \ ++ (HTT_RX_FILTER_TLV_FLAGS_MPDU_START | \ ++ HTT_RX_FILTER_TLV_FLAGS_MSDU_START | \ ++ HTT_RX_FILTER_TLV_FLAGS_RX_PACKET | \ ++ HTT_RX_FILTER_TLV_FLAGS_MSDU_END | \ ++ HTT_RX_FILTER_TLV_FLAGS_MPDU_END | \ ++ HTT_RX_FILTER_TLV_FLAGS_ATTENTION) ++ + struct htt_rx_ring_selection_cfg_cmd { + u32 info0; + u32 info1; +@@ -1022,6 +1086,10 @@ struct htt_rx_ring_selection_cfg_cmd { + u32 pkt_type_en_flags2; + u32 pkt_type_en_flags3; + u32 rx_filter_tlv; ++ u32 rx_packet_offset; ++ u32 rx_mpdu_offset; ++ u32 rx_msdu_offset; ++ u32 rx_attn_offset; + } __packed; + + struct htt_rx_ring_tlv_filter { +@@ -1030,6 +1098,14 @@ struct htt_rx_ring_tlv_filter { + u32 pkt_filter_flags1; /* MGMT */ + u32 pkt_filter_flags2; /* CTRL */ + u32 pkt_filter_flags3; /* DATA */ ++ bool offset_valid; ++ u16 rx_packet_offset; ++ u16 rx_header_offset; ++ u16 rx_mpdu_end_offset; ++ u16 rx_mpdu_start_offset; ++ u16 rx_msdu_end_offset; ++ u16 rx_msdu_start_offset; ++ u16 rx_attn_offset; + }; + + /** +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -59,6 +59,12 @@ static bool ath11k_dp_rx_h_mpdu_start_fc + return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); + } + ++static u16 ath11k_dp_rxdesc_get_mpdu_frame_ctrl(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_mpdu_frame_ctl(desc); ++} ++ + static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, + struct sk_buff *skb) + { +@@ -306,17 +312,46 @@ bool ath11k_dp_rx_h_attn_is_mcbc(struct + } + + static bool ath11k_dp_rxdesc_mac_addr2_valid(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++ struct hal_rx_desc *desc) + { +- return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); ++ return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); + } + + static u8* ath11k_dp_rxdesc_get_mpdu_start_addr2(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2; + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_dp_get_rx_header_offset(struct ath11k_base *ab, ++ struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_offset(tlv_filter); ++} ++#endif ++ ++static bool ath11k_dp_rx_desc_dot11_hdr_fields_valid(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) ++{ ++ return ab->hw_params.hw_ops->rx_desc_dot11_hdr_fields_valid(desc); ++} ++ ++static void ath11k_dp_rx_desc_get_dot11_hdr(struct ath11k_base *ab, ++ struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_dot11_hdr(desc, hdr); ++} ++ ++static void ath11k_dp_rx_desc_get_crypto_header(struct ath11k_base *ab, ++ struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); ++} ++ + /* Returns number of Rx buffers replenished */ + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, +@@ -2068,6 +2103,49 @@ int ath11k_dp_rx_crypto_icv_len(struct a + return 0; + } + ++static void ath11k_get_dot11_hdr_from_rx_desc(struct ath11k *ar, ++ struct sk_buff *msdu, ++ struct ath11k_skb_rxcb *rxcb, ++ struct ieee80211_rx_status *status, ++ enum hal_encrypt_type enctype) ++{ ++ struct hal_rx_desc *rx_desc = rxcb->rx_desc; ++ struct ath11k_base *ab = ar->ab; ++ size_t hdr_len, crypto_len; ++ struct ieee80211_hdr *hdr; ++ u16 fc, qos_ctl = 0; ++ u8 *crypto_hdr; ++ ++ if (!(status->flag & RX_FLAG_IV_STRIPPED)) { ++ crypto_len = ath11k_dp_rx_crypto_param_len(ar, enctype); ++ crypto_hdr = skb_push(msdu, crypto_len); ++ ath11k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); ++ } ++ ++ fc = ath11k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc); ++ hdr_len = ieee80211_hdrlen(fc); ++ skb_push(msdu, hdr_len); ++ hdr = (struct ieee80211_hdr *)msdu->data; ++ hdr->frame_control = fc; ++ ++ /* Get wifi header from rx_desc */ ++ ath11k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); ++ ++ if (rxcb->is_mcbc) ++ status->flag &= ~RX_FLAG_PN_VALIDATED; ++ ++ /* Add QOS header */ ++ if (ieee80211_is_data_qos(hdr->frame_control)) { ++ qos_ctl = rxcb->tid; ++ if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ab, rx_desc)) ++ qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT; ++ ++ /* TODO Add other QoS ctl fields when required */ ++ memcpy(msdu->data + (hdr_len - IEEE80211_QOS_CTL_LEN), ++ &qos_ctl, IEEE80211_QOS_CTL_LEN); ++ } ++} ++ + static void ath11k_dp_rx_h_undecap_nwifi(struct ath11k *ar, + struct sk_buff *msdu, + u8 *first_hdr, +@@ -2081,7 +2159,8 @@ static void ath11k_dp_rx_h_undecap_nwifi + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u16 qos_ctl = 0; +- u8 *qos; ++ u8 *qos, *crypto_hdr; ++ bool add_qos_ctrl = false; + + /* copy SA & DA and pull decapped header */ + hdr = (struct ieee80211_hdr *)msdu->data; +@@ -2090,7 +2169,7 @@ static void ath11k_dp_rx_h_undecap_nwifi + ether_addr_copy(sa, ieee80211_get_SA(hdr)); + skb_pull(msdu, ieee80211_hdrlen(hdr->frame_control)); + +- if (rxcb->is_first_msdu) { ++ if (rxcb->is_first_msdu && first_hdr) { + /* original 802.11 header is valid for the first msdu + * hence we can reuse the same header + */ +@@ -2120,16 +2199,23 @@ static void ath11k_dp_rx_h_undecap_nwifi + + /* copy decap header before overwriting for reuse below */ + memcpy(decap_hdr, (uint8_t *)hdr, hdr_len); ++ add_qos_ctrl = true; + } + + if (!(status->flag & RX_FLAG_IV_STRIPPED)) { +- memcpy(skb_push(msdu, +- ath11k_dp_rx_crypto_param_len(ar, enctype)), +- (void *)hdr + hdr_len, +- ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ if (first_hdr) { ++ memcpy(skb_push(msdu, ++ ath11k_dp_rx_crypto_param_len(ar, enctype)), ++ (void *)hdr + hdr_len, ++ ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ } else { ++ crypto_hdr = skb_push(msdu, ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ ath11k_dp_rx_desc_get_crypto_header(ar->ab, ++ rxcb->rx_desc, crypto_hdr, enctype); ++ } + } + +- if (!rxcb->is_first_msdu) { ++ if (!rxcb->is_first_msdu || add_qos_ctrl) { + memcpy(skb_push(msdu, + IEEE80211_QOS_CTL_LEN), &qos_ctl, + IEEE80211_QOS_CTL_LEN); +@@ -2245,6 +2331,20 @@ static void ath11k_dp_rx_h_undecap_eth(s + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + void *rfc1042; ++ struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); ++ struct ath11k_dp_rfc1042_hdr rfc = {0xaa, 0xaa, 0x03, {0x00, 0x00, 0x00}}; ++ ++ if (!first_hdr) { ++ eth = (struct ethhdr *)msdu->data; ++ ether_addr_copy(da, eth->h_dest); ++ ether_addr_copy(sa, eth->h_source); ++ rfc.snap_type = eth->h_proto; ++ skb_pull(msdu, sizeof(struct ethhdr)); ++ memcpy(skb_push(msdu, sizeof(struct ath11k_dp_rfc1042_hdr)), &rfc, ++ sizeof(struct ath11k_dp_rfc1042_hdr)); ++ ath11k_get_dot11_hdr_from_rx_desc(ar, msdu, rxcb, status, enctype); ++ goto exit; ++ } + + rfc1042 = ath11k_dp_rx_h_find_rfc1042(ar, msdu, enctype); + if (WARN_ON_ONCE(!rfc1042)) +@@ -2273,6 +2373,7 @@ static void ath11k_dp_rx_h_undecap_eth(s + + memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); + ++exit: + /* original 802.11 header has a different DA and in + * case of 4addr it may also have different SA + */ +@@ -2291,6 +2392,7 @@ static void ath11k_dp_rx_h_undecap_snap( + size_t hdr_len; + u8 l3_pad_bytes; + struct hal_rx_desc *rx_desc; ++ struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); + + /* Delivered decapped frame: + * [amsdu header] <-- replaced with 802.11 hdr +@@ -2304,6 +2406,11 @@ static void ath11k_dp_rx_h_undecap_snap( + skb_put(msdu, l3_pad_bytes); + skb_pull(msdu, sizeof(struct ath11k_dp_amsdu_subframe_hdr) + l3_pad_bytes); + ++ if (!first_hdr) { ++ ath11k_get_dot11_hdr_from_rx_desc(ar, msdu, rxcb, status, enctype); ++ return; ++ } ++ + hdr = (struct ieee80211_hdr *)first_hdr; + hdr_len = ieee80211_hdrlen(hdr->frame_control); + +@@ -2671,6 +2778,20 @@ static int ath11k_dp_rx_process_msdu(str + goto free_out; + } + ++ hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); ++ /* wifi hdr fields validation for 512M:: ++ * Mcast packets in ethernet frame mode ++ * will need wifi hdr in msdu to validate PN. ++ * Header will be added in undecap routine. ++ * Validation on wifi hdr fields from rx_desc. ++ */ ++ if (!hdr_status && ath11k_dp_rx_h_attn_is_mcbc(ab, rx_desc) && ++ !ath11k_dp_rx_desc_dot11_hdr_fields_valid(ab, rx_desc)) { ++ ath11k_warn(ab, "One or more invalid dot11 header fields\n"); ++ ret = -EIO; ++ goto free_out; ++ } ++ + rxcb = ATH11K_SKB_RXCB(msdu); + rxcb->rx_desc = rx_desc; + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); +@@ -2683,8 +2804,9 @@ static int ath11k_dp_rx_process_msdu(str + hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); + ret = -EINVAL; + ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); +- ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, +- sizeof(struct ieee80211_hdr)); ++ if (hdr_status) ++ ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, ++ sizeof(struct ieee80211_hdr)); + ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, + sizeof(struct hal_rx_desc)); + goto free_out; +@@ -3649,6 +3771,7 @@ static int ath11k_dp_rx_h_verify_tkip_mi + + hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); + hdr_len = ieee80211_hdrlen(hdr->frame_control); ++ + head_len = hdr_len + hal_rx_desc_sz + IEEE80211_TKIP_IV_LEN; + tail_len = IEEE80211_CCMP_MIC_LEN + IEEE80211_TKIP_ICV_LEN + FCS_LEN; + +@@ -3928,8 +4051,8 @@ static void ath11k_dp_rx_h_sort_frags(st + + static u64 ath11k_dp_rx_h_get_pn(struct ath11k *ar, struct sk_buff *skb) + { +- struct ieee80211_hdr *hdr; + u64 pn = 0; ++ struct ieee80211_hdr *hdr; + u8 *ehdr; + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; + +@@ -4146,8 +4269,9 @@ ath11k_dp_process_rx_err_buf(struct ath1 + if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { + hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); + ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); +- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, +- sizeof(struct ieee80211_hdr)); ++ if (hdr_status) ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, ++ sizeof(struct ieee80211_hdr)); + ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, + sizeof(struct hal_rx_desc)); + dev_kfree_skb_any(msdu); +@@ -4770,6 +4894,47 @@ void ath11k_dp_rx_pdev_free(struct ath11 + ath11k_dp_rxdma_pdev_buf_free(ar); + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static int ath11k_dp_rxdma_ring_sel_config(struct ath11k *ar) ++{ ++ struct ath11k_pdev_dp *dp = &ar->dp; ++ struct htt_rx_ring_tlv_filter tlv_filter = {0}; ++ u32 ring_id; ++ int ret; ++ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; ++ ++ ring_id = dp->rx_refill_buf_ring.refill_buf_ring.ring_id; ++ ++ tlv_filter.rx_filter = HTT_RX_RXDMA_FILTER_TLV_FLAGS_BUF_RING; ++ tlv_filter.pkt_filter_flags2 = HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BAR; ++ tlv_filter.pkt_filter_flags3 = HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_MCAST | ++ HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_UCAST; ++ tlv_filter.offset_valid = true; ++ tlv_filter.rx_packet_offset = hal_rx_desc_sz; ++ tlv_filter.rx_header_offset = 0; ++ ++ ath11k_dp_get_rx_header_offset(ar->ab, &tlv_filter); ++ ++ if (!ar->ab->nss.enabled) ++ ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, dp->mac_id, ++ HAL_RXDMA_BUF, ++ DP_RXDMA_REFILL_RING_SIZE, ++ &tlv_filter); ++ else ++ ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, dp->mac_id, ++ HAL_RXDMA_BUF, ++ DP_RXDMA_NSS_REFILL_RING_SIZE, ++ &tlv_filter); ++ ++ return ret; ++} ++#else ++static int ath11k_dp_rxdma_ring_sel_config(struct ath11k *ar) ++{ ++ return 0; ++} ++#endif ++ + int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) + { + struct ath11k *ar = ab->pdevs[mac_id].ar; +@@ -4863,6 +5028,12 @@ config_refill_ring: + } + } + ++ ret = ath11k_dp_rxdma_ring_sel_config(ar); ++ if (ret) { ++ ath11k_warn(ab, "failed to setup rxdma ring selection config\n"); ++ return ret; ++ } ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -1112,6 +1112,8 @@ int ath11k_dp_tx_htt_rx_filter_setup(str + !!(params.flags & HAL_SRNG_FLAGS_MSI_SWAP)); + cmd->info0 |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PS, + !!(params.flags & HAL_SRNG_FLAGS_DATA_TLV_SWAP)); ++ cmd->info0 |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_OFFSET_VALID, ++ tlv_filter->offset_valid); + + cmd->info1 = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO1_BUF_SIZE, + rx_buf_size); +@@ -1121,6 +1123,26 @@ int ath11k_dp_tx_htt_rx_filter_setup(str + cmd->pkt_type_en_flags3 = tlv_filter->pkt_filter_flags3; + cmd->rx_filter_tlv = tlv_filter->rx_filter; + ++ if (tlv_filter->offset_valid) { ++ cmd->rx_packet_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, ++ tlv_filter->rx_packet_offset); ++ cmd->rx_packet_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, ++ tlv_filter->rx_header_offset); ++ ++ cmd->rx_mpdu_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, ++ tlv_filter->rx_mpdu_end_offset); ++ cmd->rx_mpdu_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, ++ tlv_filter->rx_mpdu_start_offset); ++ ++ cmd->rx_msdu_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, ++ tlv_filter->rx_msdu_end_offset); ++ cmd->rx_msdu_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, ++ tlv_filter->rx_msdu_start_offset); ++ ++ cmd->rx_attn_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, ++ tlv_filter->rx_attn_offset); ++ } ++ + ret = ath11k_htc_send(&ab->htc, ab->dp.eid, skb); + if (ret) + goto err_free; +@@ -1193,6 +1215,7 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c + } + + ring_id = dp->rxdma_mon_buf_ring.refill_buf_ring.ring_id; ++ tlv_filter.offset_valid = false; + + if (!reset) { + tlv_filter.rx_filter = HTT_RX_MON_FILTER_TLV_FLAGS_MON_BUF_RING; +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -194,7 +194,11 @@ static u8 ath11k_hw_ipq8074_rx_desc_get_ + + static u8 *ath11k_hw_ipq8074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) + { ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + return desc->u.ipq8074.hdr_status; ++#else ++ return NULL; ++#endif + } + + static bool ath11k_hw_ipq8074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) +@@ -367,6 +371,123 @@ u32 ath11k_hw_ipq8074_rx_desc_get_hal_mp + __le32_to_cpu(mpdu_info->u.ipq8074.info1)); + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_hw_ipq8074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ tlv_filter->rx_mpdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, mpdu_end_tag)); ++ tlv_filter->rx_mpdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, mpdu_start_tag)); ++ tlv_filter->rx_msdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, msdu_end_tag)); ++ tlv_filter->rx_msdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, msdu_start_tag)); ++ tlv_filter->rx_attn_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, rx_attn_tag)); ++} ++#endif ++ ++static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl(struct hal_rx_desc *desc) ++{ ++ return __le16_to_cpu(desc->u.ipq8074.mpdu_start.frame_ctrl); ++} ++ ++static bool ath11k_hw_ipq8074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc) ++{ ++ return __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR2_VALID; ++} ++ ++static u8* ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) ++{ ++ return desc->u.ipq8074.mpdu_start.addr2; ++} ++ ++static bool ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid(struct hal_rx_desc *desc) ++{ ++ if ((ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(desc) && ++ ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid(desc) && ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR1_VALID && ++ ath11k_hw_ipq8074_rx_desc_mac_addr2_valid(desc) && ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR3_VALID && ++ FIELD_GET((RX_MPDU_START_INFO1_MPDU_DUR_VALID), ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)))) { ++ return true; ++ } ++ return false; ++} ++ ++static void ath11k_hw_ipq8074_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ hdr->frame_control = __le16_to_cpu(desc->u.ipq8074.mpdu_start.frame_ctrl); ++ hdr->duration_id = __le16_to_cpu(desc->u.ipq8074.mpdu_start.duration); ++ ether_addr_copy(hdr->addr1, desc->u.ipq8074.mpdu_start.addr1); ++ ether_addr_copy(hdr->addr2, desc->u.ipq8074.mpdu_start.addr2); ++ ether_addr_copy(hdr->addr3, desc->u.ipq8074.mpdu_start.addr3); ++ if (__le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR4_VALID) { ++ ether_addr_copy(hdr->addr4, desc->u.ipq8074.mpdu_start.addr4); ++ } ++ hdr->seq_ctrl = __le16_to_cpu(desc->u.ipq8074.mpdu_start.seq_ctrl); ++} ++ ++static void ath11k_hw_ipq8074_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ unsigned int key_id; ++ ++ switch (enctype) { ++ case HAL_ENCRYPT_TYPE_OPEN: ++ return; ++ case HAL_ENCRYPT_TYPE_TKIP_NO_MIC: ++ case HAL_ENCRYPT_TYPE_TKIP_MIC: ++ crypto_hdr[0] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[1] = 0; ++ crypto_hdr[2] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[0]); ++ break; ++ case HAL_ENCRYPT_TYPE_CCMP_128: ++ case HAL_ENCRYPT_TYPE_CCMP_256: ++ case HAL_ENCRYPT_TYPE_GCMP_128: ++ case HAL_ENCRYPT_TYPE_AES_GCMP_256: ++ crypto_hdr[0] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[1] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[2] = 0; ++ break; ++ case HAL_ENCRYPT_TYPE_WEP_40: ++ case HAL_ENCRYPT_TYPE_WEP_104: ++ case HAL_ENCRYPT_TYPE_WEP_128: ++ case HAL_ENCRYPT_TYPE_WAPI_GCM_SM4: ++ case HAL_ENCRYPT_TYPE_WAPI: ++ return; ++ } ++ key_id = FIELD_GET(RX_MPDU_START_INFO5_KEY_ID, ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info5)); ++ crypto_hdr[3] = 0x20 | (key_id << 6); ++ crypto_hdr[4] = HAL_RX_MPDU_INFO_PN_GET_BYTE3(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[5] = HAL_RX_MPDU_INFO_PN_GET_BYTE4(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[6] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[1]); ++ crypto_hdr[7] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[1]); ++} ++ ++static bool ath11k_hw_qcn9074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc) ++{ ++ return __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR2_VALID; ++} ++ ++static u8* ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) ++{ ++ return desc->u.qcn9074.mpdu_start.addr2; ++} ++ + static bool ath11k_hw_qcn9074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) + { + return !!FIELD_GET(RX_MSDU_END_INFO4_FIRST_MSDU, +@@ -387,7 +508,11 @@ static u8 ath11k_hw_qcn9074_rx_desc_get_ + + static u8 *ath11k_hw_qcn9074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) + { +- return desc->u.qcn9074.hdr_status; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M ++ return desc->u.ipq8074.hdr_status; ++#else ++ return NULL; ++#endif + } + + static bool ath11k_hw_qcn9074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) +@@ -534,17 +659,6 @@ static bool ath11k_hw_ipq8074_rx_desc_ge + + } + +-static bool ath11k_hw_ipq8074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc) +-{ +- return __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & +- RX_MPDU_START_INFO1_MAC_ADDR2_VALID; +-} +- +-static u8* ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) +-{ +- return desc->u.ipq8074.mpdu_start.addr2; +-} +- + static void ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring(struct ath11k_base *ab) + { + u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1; +@@ -582,6 +696,97 @@ u32 ath11k_hw_qcn9074_rx_desc_get_hal_mp + __le32_to_cpu(mpdu_info->u.qcn9074.info1)); + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_hw_qcn9074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ tlv_filter->rx_mpdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, mpdu_end_tag)); ++ tlv_filter->rx_mpdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, mpdu_start_tag)); ++ tlv_filter->rx_msdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, msdu_end_tag)); ++ tlv_filter->rx_msdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, msdu_start_tag)); ++ tlv_filter->rx_attn_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, rx_attn_tag)); ++} ++#endif ++ ++static u16 ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl(struct hal_rx_desc *desc) ++{ ++ return __le16_to_cpu(desc->u.qcn9074.mpdu_start.frame_ctrl); ++} ++ ++static bool ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid(struct hal_rx_desc *desc) ++{ ++ if ((ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld(desc) && ++ ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid(desc) && ++ (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR1_VALID) && ++ ath11k_hw_qcn9074_rx_desc_mac_addr2_valid(desc) && ++ (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR3_VALID) && ++ FIELD_GET((RX_MPDU_START_INFO11_MPDU_DUR_VALID), ++ __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11)))) { ++ return true; ++ } ++ return false; ++} ++ ++static void ath11k_hw_qcn9074_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ hdr->frame_control = __le16_to_cpu(desc->u.qcn9074.mpdu_start.frame_ctrl); ++ hdr->duration_id = __le16_to_cpu(desc->u.qcn9074.mpdu_start.duration); ++ ether_addr_copy(hdr->addr1, desc->u.qcn9074.mpdu_start.addr1); ++ ether_addr_copy(hdr->addr2, desc->u.qcn9074.mpdu_start.addr2); ++ ether_addr_copy(hdr->addr3, desc->u.qcn9074.mpdu_start.addr3); ++ if (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR4_VALID) { ++ ether_addr_copy(hdr->addr4, desc->u.qcn9074.mpdu_start.addr4); ++ } ++ hdr->seq_ctrl = __le16_to_cpu(desc->u.qcn9074.mpdu_start.seq_ctrl); ++} ++ ++static void ath11k_hw_qcn9074_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ unsigned int key_id; ++ ++ switch (enctype) { ++ case HAL_ENCRYPT_TYPE_OPEN: ++ return; ++ case HAL_ENCRYPT_TYPE_TKIP_NO_MIC: ++ case HAL_ENCRYPT_TYPE_TKIP_MIC: ++ crypto_hdr[0] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[1] = 0; ++ crypto_hdr[2] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[0]); ++ break; ++ case HAL_ENCRYPT_TYPE_CCMP_128: ++ case HAL_ENCRYPT_TYPE_CCMP_256: ++ case HAL_ENCRYPT_TYPE_GCMP_128: ++ case HAL_ENCRYPT_TYPE_AES_GCMP_256: ++ crypto_hdr[0] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[1] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[2] = 0; ++ break; ++ case HAL_ENCRYPT_TYPE_WEP_40: ++ case HAL_ENCRYPT_TYPE_WEP_104: ++ case HAL_ENCRYPT_TYPE_WEP_128: ++ case HAL_ENCRYPT_TYPE_WAPI_GCM_SM4: ++ case HAL_ENCRYPT_TYPE_WAPI: ++ return; ++ } ++ key_id = FIELD_GET(RX_MPDU_START_INFO12_KEY_ID, ++ __le32_to_cpu(desc->u.qcn9074.mpdu_start.info12)); ++ crypto_hdr[3] = 0x20 | (key_id << 6); ++ crypto_hdr[4] = HAL_RX_MPDU_INFO_PN_GET_BYTE3(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[5] = HAL_RX_MPDU_INFO_PN_GET_BYTE4(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[6] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[1]); ++ crypto_hdr[7] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[1]); ++} ++ + static u32 ath11k_get_reo_dest_remap_config_default(void) + { + u32 ring_hash_map; +@@ -662,6 +867,13 @@ const struct ath11k_hw_ops ipq8074_ops = + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops ipq6018_ops = { +@@ -703,6 +915,13 @@ const struct ath11k_hw_ops ipq6018_ops = + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops qca6390_ops = { +@@ -741,6 +960,13 @@ const struct ath11k_hw_ops qca6390_ops = + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + //TODO + /* .rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid, +@@ -753,6 +979,9 @@ const struct ath11k_hw_ops qcn9074_ops = + .wmi_init_config = ath11k_init_wmi_config_ipq8074, + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, ++ .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, ++ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid, ++ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2, + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, +@@ -784,6 +1013,13 @@ const struct ath11k_hw_ops qcn9074_ops = + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default, + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_qcn9074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, + }; + + /* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */ +@@ -793,8 +1029,8 @@ const struct ath11k_hw_ops ipq5018_ops = + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, +- .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, +- .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, ++ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid, ++ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2, + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, +@@ -826,6 +1062,13 @@ const struct ath11k_hw_ops ipq5018_ops = + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_qcn9074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops qcn6122_ops = { +@@ -834,8 +1077,8 @@ const struct ath11k_hw_ops qcn6122_ops = + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, + .rx_desc_get_da_mcbc = ath11k_hw_ipq8074_rx_desc_get_da_mcbc, +- .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid, +- .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, ++ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid, ++ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2, + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, +@@ -867,7 +1110,13 @@ const struct ath11k_hw_ops qcn6122_ops = + .rx_desc_get_hal_mpdu_peerid = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid, + .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, + .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018, +- .rx_process_mon_rings = ath11k_dp_rx_process_mon_rings_ipq8074, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_qcn9074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, + }; + + #define ATH11K_TX_RING_MASK_0 0x1 +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -20,6 +20,11 @@ + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 512 + #define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 128 + #define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 128 ++#define ATH11K_DP_RXDMA_REFILL_RING_SIZE 2048 ++/* 256b desc TLV + 4b(rounded) Pad + 30byte max nwifi header + ++ * 18byte mesh hdr + 8byte snap + 1500 eth payload ++ */ ++#define ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE 1816 + #else + /* Num VDEVS per radio */ + #define TARGET_NUM_VDEVS (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_vdevs) +@@ -31,6 +36,8 @@ + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024 + #define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 + #define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 2048 ++#define ATH11K_DP_RXDMA_REFILL_RING_SIZE 2048 ++#define ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE 2048 + #endif + + /* Num of peers for Single Radio mode */ +@@ -128,6 +135,8 @@ struct hal_rx_mpdu_info; + struct hal_rx_desc; + struct hal_tcl_data_cmd; + struct napi_struct; ++struct htt_rx_ring_tlv_filter; ++enum hal_encrypt_type; + + struct ath11k_hw_ring_mask { + u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; +@@ -238,6 +247,16 @@ struct ath11k_hw_ops { + u32 (*get_reo_dest_remap_config)(void); + u16 (*rx_desc_get_hal_mpdu_peerid) (struct hal_rx_mpdu_info *mpdu_info); + u32 (*rx_desc_get_hal_mpdu_len) (struct hal_rx_mpdu_info *mpdu_info); ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ void (*rx_desc_get_offset)(struct htt_rx_ring_tlv_filter *tlv_filter); ++#endif ++ u16 (*rx_desc_get_mpdu_frame_ctl)(struct hal_rx_desc *desc); ++ bool (*rx_desc_dot11_hdr_fields_valid)(struct hal_rx_desc *desc); ++ void (*rx_desc_get_dot11_hdr)(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr); ++ void (*rx_desc_get_crypto_header)(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype); + }; + + extern const struct ath11k_hw_ops ipq8074_ops; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5691,6 +5691,7 @@ static int ath11k_mac_config_mon_status_ + tlv_filter.rx_filter = ath11k_debugfs_rx_filter(ar); + } + ++ tlv_filter.offset_valid = false; + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; + ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, +--- a/drivers/net/wireless/ath/ath11k/rx_desc.h ++++ b/drivers/net/wireless/ath/ath11k/rx_desc.h +@@ -1375,9 +1375,11 @@ struct hal_rx_desc_ipq8074 { + __le32 mpdu_end_tag; + struct rx_mpdu_end mpdu_end; + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + __le32 hdr_status_tag; + __le32 phy_ppdu_id; + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; ++#endif + u8 msdu_payload[0]; + } __packed; + +@@ -1394,9 +1396,11 @@ struct hal_rx_desc_qcn9074 { + __le32 mpdu_end_tag; + struct rx_mpdu_end mpdu_end; + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + __le32 hdr_status_tag; + __le32 phy_ppdu_id; + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; ++#endif + u8 msdu_payload[0]; + } __packed; + +@@ -1420,4 +1424,17 @@ struct hal_rx_desc { + #define RU_484 18 + #define RU_996 37 + ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE1(__val) \ ++ FIELD_GET(GENMASK(7, 0), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE2(__val) \ ++ FIELD_GET(GENMASK(15, 8), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE3(__val) \ ++ FIELD_GET(GENMASK(23, 16), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE4(__val) \ ++ FIELD_GET(GENMASK(31, 24), __le32_to_cpu(__val)) ++ ++ + #endif /* ATH11K_RX_DESC_H */ +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -2168,7 +2168,7 @@ static int ath11k_nss_init(struct ath11k + + /* fill rx parameters to initialize rx context */ + wim->wrip.tlv_size = sizeof(struct hal_rx_desc); +- wim->wrip.rx_buf_len = DP_RX_BUFFER_SIZE; ++ wim->wrip.rx_buf_len = DP_RXDMA_NSS_REFILL_RING_SIZE; + + /* fill hal srng message */ + wim->hssm.dev_base_addr = (u32)ab->mem_pa; diff --git a/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-QDSS-support-for-qcn9100.patch b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-QDSS-support-for-qcn9100.patch new file mode 100644 index 000000000..37a6bc344 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-QDSS-support-for-qcn9100.patch @@ -0,0 +1,173 @@ +From 8b24a51b51e503807da62ab3aac3e4a0780579e3 Mon Sep 17 00:00:00 2001 +From: Ramya Gnanasekar +Date: Thu, 31 Dec 2020 17:31:55 +0530 +Subject: [PATCH] ath11k: QDSS support for qcn9100 + +qcn9100 is a hybrid bus type device which is enumerated as +pci device by Q6. Hence qdss trace collection is similar to qcn9000. +QDSS trace collection depends on parameters from pci_dev structure for +pci devices. Changed the dependent parameter to fetch from ab for +qcn9100 and pci_dev for qcn9000. + +Signed-off-by: Ramya Gnanasekar +--- + drivers/net/wireless/ath/ath11k/core.c | 6 +++++ + drivers/net/wireless/ath/ath11k/coredump.c | 38 +++++++++++++++++++++--------- + drivers/net/wireless/ath/ath11k/debugfs.c | 2 +- + drivers/net/wireless/ath/ath11k/hw.h | 1 + + 4 files changed, 35 insertions(+), 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -96,6 +96,7 @@ static const struct ath11k_hw_params ath + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, + .fwmem_mode_change = false, ++ .is_qdss_support = false, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -144,6 +145,7 @@ static const struct ath11k_hw_params ath + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, + .fwmem_mode_change = false, ++ .is_qdss_support = false, + }, + { + .name = "qca6390 hw2.0", +@@ -187,6 +189,7 @@ static const struct ath11k_hw_params ath + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = false, + .fwmem_mode_change = false, ++ .is_qdss_support = false, + }, + { + .name = "qcn9074 hw1.0", +@@ -232,6 +235,7 @@ static const struct ath11k_hw_params ath + .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT, + .ce_fwlog_enable = true, + .fwmem_mode_change = true, ++ .is_qdss_support = true, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -273,6 +277,7 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = false, + .fwmem_mode_change = false, + .cold_boot_calib = true, ++ .is_qdss_support = false, + }, + { + .hw_rev = ATH11K_HW_QCN6122, +@@ -314,6 +319,7 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = false, + .cold_boot_calib = false, + .fwmem_mode_change = false, ++ .is_qdss_support = true, + }, + }; + +--- a/drivers/net/wireless/ath/ath11k/coredump.c ++++ b/drivers/net/wireless/ath/ath11k/coredump.c +@@ -4,6 +4,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -93,13 +94,15 @@ static void ath11k_coredump_free_q6dump( + complete(&dump_state->dump_done); + } + +-void ath11k_coredump_build_inline(struct ath11k_pci *ar_pci, ++void ath11k_coredump_build_inline(struct ath11k_base *ab, + struct ath11k_dump_segment *segments, int num_seg) + { + struct ath11k_coredump_state *dump_state; + struct timespec64 timestamp; + struct ath11k_dump_file_data *file_data; + size_t header_size; ++ struct ath11k_pci *ar_pci = (struct ath11k_pci *)ab->drv_priv; ++ struct device dev; + u8 *buf; + + header_size = sizeof(struct ath11k_dump_file_data); +@@ -116,9 +119,17 @@ void ath11k_coredump_build_inline(struct + sizeof(file_data->df_magic)); + file_data->len = cpu_to_le32(header_size); + file_data->version = cpu_to_le32(ATH11K_FW_CRASH_DUMP_VERSION); +- file_data->chip_id = ar_pci->dev_id; +- file_data->qrtr_id = ar_pci->ab->qmi.service_ins_id; +- file_data->bus_id = pci_domain_nr(ar_pci->pdev->bus); ++ if (ab->hw_rev == ATH11K_HW_QCN6122) { ++ file_data->chip_id = ab->qmi.target.chip_id; ++ file_data->qrtr_id = ab->qmi.service_ins_id; ++ file_data->bus_id = ab->userpd_id; ++ dev = ab->pdev->dev; ++ } else { ++ file_data->chip_id = ar_pci->dev_id; ++ file_data->qrtr_id = ar_pci->ab->qmi.service_ins_id; ++ file_data->bus_id = pci_domain_nr(ar_pci->pdev->bus); ++ dev = ar_pci->pdev->dev; ++ } + if (file_data->bus_id > ATH11K_MAX_PCI_DOMAINS) + file_data->bus_id = ATH11K_MAX_PCI_DOMAINS; + guid_gen(&file_data->guid); +@@ -144,7 +155,7 @@ void ath11k_coredump_build_inline(struct + dump_state->segments = segments; + init_completion(&dump_state->dump_done); + +- dev_coredumpm(&ar_pci->pdev->dev, NULL, dump_state, header_size, GFP_KERNEL, ++ dev_coredumpm(&dev, NULL, dump_state, header_size, GFP_KERNEL, + ath11k_coredump_read_q6dump, ath11k_coredump_free_q6dump); + + /* Wait until the dump is read and free is called */ +@@ -258,7 +269,7 @@ void ath11k_coredump_download_rddm(struc + + BUG_ON(1); + } else { +- ath11k_coredump_build_inline(ar_pci, segment, num_seg); ++ ath11k_coredump_build_inline(ab, segment, num_seg); + } + + vfree(segment); +@@ -267,7 +278,6 @@ void ath11k_coredump_download_rddm(struc + void ath11k_coredump_qdss_dump(struct ath11k_base *ab, + struct ath11k_qmi_event_qdss_trace_save_data *event_data) + { +- struct ath11k_pci *ar_pci = (struct ath11k_pci *)ab->drv_priv; + struct ath11k_dump_segment *segment; + int len, num_seg; + void *dump; +@@ -348,7 +358,7 @@ void ath11k_coredump_qdss_dump(struct at + segment->vaddr, segment->len); + segment->type = ATH11K_FW_QDSS_DATA; + } +- ath11k_coredump_build_inline(ar_pci, segment, 1); ++ ath11k_coredump_build_inline(ab, segment, 1); + out: + ATH11K_MEMORY_STATS_DEC(ab, malloc_size, event_data->total_size); + ATH11K_MEMORY_STATS_DEC(ab, malloc_size, len); +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1090,7 +1090,7 @@ ath11k_write_trace_qdss(struct file *fil + ret = count; + goto exit; + } +- if (!ab->bus_params.fixed_bdf_addr) { ++ if (ab->hw_params.is_qdss_support) { + ret = ath11k_send_qdss_trace_mode_req(ab, + QMI_WLANFW_QDSS_TRACE_OFF_V01); + if (ret < 0) +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -198,6 +198,7 @@ struct ath11k_hw_params { + bool cold_boot_calib; + bool ce_fwlog_enable; + bool fwmem_mode_change; ++ bool is_qdss_support; + }; + + struct ath11k_hw_ops { diff --git a/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-add-ce-latency-stats.patch b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-add-ce-latency-stats.patch new file mode 100644 index 000000000..723c14c83 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/233-ath11k-add-ce-latency-stats.patch @@ -0,0 +1,342 @@ +From aa224d8563bdbf582d75fc3af8177dfad4632a3e Mon Sep 17 00:00:00 2001 +From: Thiraviyam Mariyappan +Date: Thu, 24 Dec 2020 13:06:14 +0530 +Subject: [PATCH] ath11k: Track ce tasklet scheduled and execution time + +Add support to track ce tasklet scheduled and execution time in +different buckets for debugging purposes. +Tasklet sched and exec derived from below calculation: +sched_time = exec_entry_ts - sched_entry_ts +exec_time = exec_exit_ts - exec_entry_ts +The different buckets in terms of 100us,200us,300us,400us,500us. + +enable/disable the stats using below debugfs command: +echo <1/0> > /sys/kernel/debug/ath11k/ipq5018\ hw1.0/ce_latency_stats + +stats can be displayed during FW crash and debugfs command: +cat /sys/kernel/debug/ath11k/ipq5018\ hw1.0/ce_latency_stats + +Signed-off-by: Thiraviyam Mariyappan +--- + drivers/net/wireless/ath/ath11k/ahb.c | 11 ++++ + drivers/net/wireless/ath/ath11k/ce.c | 30 +++++++++++ + drivers/net/wireless/ath/ath11k/ce.h | 25 +++++++++ + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/debugfs.c | 89 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/hal.c | 24 +++++++-- + drivers/net/wireless/ath/ath11k/pci.c | 12 +++++ + 7 files changed, 189 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -455,8 +455,16 @@ static void ath11k_ahb_ce_tasklet(struct + { + struct ath11k_ce_pipe *ce_pipe = from_tasklet(ce_pipe, t, intr_tq); + ++ if (ce_pipe->ab->ce_latency_stats_enable) ++ ce_pipe->tasklet_ts.exec_entry_ts = ktime_get_boottime(); ++ + ath11k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); + ++ if (ce_pipe->ab->ce_latency_stats_enable) { ++ ce_pipe->tasklet_ts.exec_complete_ts = ktime_get_boottime(); ++ ce_update_tasklet_time_duration_stats(ce_pipe); ++ } ++ + ath11k_ahb_ce_irq_enable(ce_pipe->ab, ce_pipe->pipe_num); + } + +@@ -471,6 +479,9 @@ static irqreturn_t ath11k_ahb_ce_interru + + tasklet_schedule(&ce_pipe->intr_tq); + ++ if (ce_pipe->ab->ce_latency_stats_enable) ++ ce_pipe->tasklet_ts.sched_entry_ts = ktime_get_boottime(); ++ + return IRQ_HANDLED; + } + +--- a/drivers/net/wireless/ath/ath11k/ce.c ++++ b/drivers/net/wireless/ath/ath11k/ce.c +@@ -1049,6 +1049,8 @@ int ath11k_ce_alloc_pipes(struct ath11k_ + int ret; + const struct ce_attr *attr; + ++ ab->ce_latency_stats_enable = 1; ++ + spin_lock_init(&ab->ce.ce_lock); + + for (i = 0; i < ab->hw_params.ce_count; i++) { +@@ -1097,3 +1099,30 @@ int ath11k_ce_get_attr_flags(struct ath1 + return ab->hw_params.host_ce_config[ce_id].flags; + } + EXPORT_SYMBOL(ath11k_ce_get_attr_flags); ++ ++void ce_update_tasklet_time_duration_stats(struct ath11k_ce_pipe *ce_pipe) ++{ ++ s64 sched_us, exec_us; ++ ++ sched_us = (ce_pipe->tasklet_ts.exec_entry_ts.tv64 - ++ ce_pipe->tasklet_ts.sched_entry_ts.tv64); ++ exec_us = (ce_pipe->tasklet_ts.exec_complete_ts.tv64 - ++ ce_pipe->tasklet_ts.exec_entry_ts.tv64); ++ ++ sched_us = div_s64(sched_us, CE_TIME_DURATION_USEC * NSEC_PER_USEC); ++ if (sched_us > CE_TIME_DURATION_USEC_500) { ++ ce_pipe->sched_delay_gt_500US++; ++ } else if (sched_us >= 0){ ++ ce_pipe->tracker[sched_us].sched_count++; ++ ce_pipe->tracker[sched_us].sched_last_update = jiffies; ++ } ++ ++ exec_us = div_s64(exec_us, CE_TIME_DURATION_USEC * NSEC_PER_USEC); ++ if (exec_us > CE_TIME_DURATION_USEC_500) { ++ ce_pipe->exec_delay_gt_500US++; ++ } else if (exec_us >= 0){ ++ ce_pipe->tracker[exec_us].exec_count++; ++ ce_pipe->tracker[exec_us].exec_last_update = jiffies; ++ } ++} ++EXPORT_SYMBOL(ce_update_tasklet_time_duration_stats); +--- a/drivers/net/wireless/ath/ath11k/ce.h ++++ b/drivers/net/wireless/ath/ath11k/ce.h +@@ -60,6 +60,12 @@ void ath11k_ce_byte_swap(void *mem, u32 + + #define ATH11K_CE_RX_POST_RETRY_JIFFIES 50 + ++#define CE_TIME_DURATION_USEC 100 ++ ++#define CE_TIME_DURATION_USEC_500 4 ++ ++#define CE_TIME_DURATION_MAX 5 ++ + struct ath11k_base; + + /* +@@ -153,6 +159,19 @@ struct ath11k_ce_ring { + struct sk_buff *skb[0]; + }; + ++struct ce_tasklet_time { ++ u64 sched_count; ++ u64 exec_count; ++ u64 sched_last_update; ++ u64 exec_last_update; ++}; ++ ++struct ce_tasklet_entry_ts { ++ ktime_t sched_entry_ts; ++ ktime_t exec_entry_ts; ++ ktime_t exec_complete_ts; ++}; ++ + struct ath11k_ce_pipe { + struct ath11k_base *ab; + u16 pipe_num; +@@ -168,6 +187,11 @@ struct ath11k_ce_pipe { + struct ath11k_ce_ring *dest_ring; + struct ath11k_ce_ring *status_ring; + u64 timestamp; ++ ++ struct ce_tasklet_entry_ts tasklet_ts; ++ struct ce_tasklet_time tracker[CE_TIME_DURATION_MAX]; ++ u32 sched_delay_gt_500US; ++ u32 exec_delay_gt_500US; + }; + + struct ath11k_ce { +@@ -198,5 +222,5 @@ int ath11k_ce_attr_attach(struct ath11k_ + void ath11k_ce_get_shadow_config(struct ath11k_base *ab, + u32 **shadow_cfg, u32 *shadow_cfg_len); + void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab); +- ++void ce_update_tasklet_time_duration_stats(struct ath11k_ce_pipe *ce_pipe); + #endif +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -929,6 +929,7 @@ struct ath11k_base { + + bool fw_recovery_support; + bool ce_remap; ++ bool ce_latency_stats_enable; + u32 ce_remap_base_addr; + atomic_t num_max_allowed; + struct ath11k_num_vdevs_peers *num_vdevs_peers; +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1581,6 +1581,93 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t ath11k_write_ce_latency_stats(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ bool enable; ++ int ret; ++ ++ if (kstrtobool_from_user(user_buf, count, &enable)) ++ return -EINVAL; ++ ++ if (enable == ab->ce_latency_stats_enable) { ++ ret = count; ++ goto exit; ++ } ++ ++ ab->ce_latency_stats_enable = enable; ++ ret = count; ++ ++exit: ++ return ret; ++} ++ ++static ssize_t ath11k_read_ce_latency_stats(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ int len = 0, retval; ++ const int size = 12288; ++ char *buf; ++ struct ath11k_ce_pipe *ce_pipe; ++ int i, j; ++ unsigned int last_sched, last_exec; ++ char *ce_time_dur[CE_TIME_DURATION_MAX] = { ++ "ce_time_dur_100US", "ce_time_dur_200US", "ce_time_dur_300US", ++ "ce_time_dur_400US", "ce_time_dur_500US"}; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ len += scnprintf(buf + len, size - len, "CE_LATENCY_STATS:\n"); ++ for (i = 0; i < ab->hw_params.ce_count; i++) { ++ ce_pipe = &ab->ce.ce_pipe[i]; ++ ++ len += scnprintf(buf + len, size - len, "CE_id %u ", i); ++ len += scnprintf(buf + len, size - len, "pipe_num %d ", ++ ce_pipe->pipe_num); ++ len += scnprintf(buf + len, size - len, "%ums before, ", ++ jiffies_to_msecs(jiffies - ce_pipe->timestamp)); ++ len += scnprintf(buf + len, size - len, "sched_delay_gt_500US %u, ", ++ ce_pipe->sched_delay_gt_500US); ++ len += scnprintf(buf + len, size - len, "exec_delay_gt_500US %u,\n", ++ ce_pipe->sched_delay_gt_500US); ++ ++ for (j = 0; j < CE_TIME_DURATION_MAX; j++) { ++ last_sched = jiffies_to_msecs(jiffies - ++ ce_pipe->tracker[j].sched_last_update); ++ last_exec = jiffies_to_msecs(jiffies - ++ ce_pipe->tracker[j].exec_last_update); ++ ++ len += scnprintf(buf + len, size - len, "%-17s,\t ", ce_time_dur[j]); ++ len += scnprintf(buf + len, size - len, "last_sched_before %10ums,\t ", ++ ((ce_pipe->tracker[j].sched_last_update > 0) ? last_sched : 0)); ++ len += scnprintf(buf + len, size - len, "tot_sched_cnt %20llu,\t ", ++ ce_pipe->tracker[j].sched_count); ++ len += scnprintf(buf + len, size - len, "last_exec_before %10ums,\t ", ++ ((ce_pipe->tracker[j].exec_last_update > 0) ? last_exec : 0)); ++ len += scnprintf(buf + len, size - len, "tot_exec_cnt %20llu\n", ++ ce_pipe->tracker[j].exec_count); ++ } ++ } ++ if (len > size) ++ len = size; ++ retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ kfree(buf); ++ ++ return retval; ++} ++ ++static const struct file_operations fops_ce_latency_stats = { ++ .write = ath11k_write_ce_latency_stats, ++ .open = simple_open, ++ .read = ath11k_read_ce_latency_stats, ++}; ++ + int ath11k_debugfs_pdev_create(struct ath11k_base *ab) + { + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) +@@ -1598,6 +1685,8 @@ int ath11k_debugfs_pdev_create(struct at + debugfs_create_file("set_fw_recovery", 0600, ab->debugfs_soc, ab, + &fops_fw_recovery); + ++ debugfs_create_file("ce_latency_stats", 0600, ab->debugfs_soc, ab, ++ &fops_ce_latency_stats); + + return 0; + } +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -1289,7 +1289,11 @@ void ath11k_hal_dump_srng_stats(struct a + struct hal_srng *srng; + struct ath11k_ext_irq_grp *irq_grp; + struct ath11k_ce_pipe *ce_pipe; +- int i; ++ int i, j; ++ unsigned int last_sched, last_exec; ++ char *ce_time_dur[CE_TIME_DURATION_MAX] = { ++ "ce_time_dur_100US", "ce_time_dur_200US", "ce_time_dur_300US", ++ "ce_time_dur_400US", "ce_time_dur_500US"}; + + ath11k_err(ab, "Last interrupt received for each CE:\n"); + for (i = 0; i < ab->hw_params.ce_count; i++) { +@@ -1298,9 +1302,23 @@ void ath11k_hal_dump_srng_stats(struct a + if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) + continue; + +- ath11k_err(ab, "CE_id %d pipe_num %d %ums before\n", ++ ath11k_info(ab, "CE_id %d pipe_num %d %ums before, sched_delay_gt_500US %u, exec_delay_gt_500US %u\n", + i, ce_pipe->pipe_num, +- jiffies_to_msecs(jiffies - ce_pipe->timestamp)); ++ jiffies_to_msecs(jiffies - ce_pipe->timestamp), ++ ce_pipe->sched_delay_gt_500US, ce_pipe->exec_delay_gt_500US); ++ ++ for (j = 0; j < CE_TIME_DURATION_MAX; j++) { ++ last_sched = jiffies_to_msecs(jiffies - ++ ce_pipe->tracker[j].sched_last_update); ++ last_exec = jiffies_to_msecs(jiffies - ++ ce_pipe->tracker[j].exec_last_update); ++ ath11k_info(ab, "%-17s,\t last_sched_before %10ums,\t tot_sched_cnt %20llu,\t last_exec_before %10ums,\t tot_exec_cnt %20llu\n", ++ ce_time_dur[j], ++ ((ce_pipe->tracker[j].sched_last_update > 0) ? last_sched : 0), ++ ce_pipe->tracker[j].sched_count, ++ ((ce_pipe->tracker[j].exec_last_update > 0) ? last_exec : 0), ++ ce_pipe->tracker[j].exec_count); ++ } + } + + ath11k_err(ab, "\nLast interrupt received for each group:\n"); +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -644,8 +644,16 @@ static void ath11k_pci_ce_tasklet(struct + { + struct ath11k_ce_pipe *ce_pipe = from_tasklet(ce_pipe, t, intr_tq); + ++ if (ce_pipe->ab->ce_latency_stats_enable) ++ ce_pipe->tasklet_ts.exec_entry_ts = ktime_get_boottime(); ++ + ath11k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); + ++ if (ce_pipe->ab->ce_latency_stats_enable) { ++ ce_pipe->tasklet_ts.exec_complete_ts = ktime_get_boottime(); ++ ce_update_tasklet_time_duration_stats(ce_pipe); ++ } ++ + ath11k_pci_ce_irq_enable(ce_pipe->ab, ce_pipe->pipe_num); + } + +@@ -657,8 +665,12 @@ static irqreturn_t ath11k_pci_ce_interru + ce_pipe->timestamp = jiffies; + + ath11k_pci_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num); ++ + tasklet_schedule(&ce_pipe->intr_tq); + ++ if (ce_pipe->ab->ce_latency_stats_enable) ++ ce_pipe->tasklet_ts.sched_entry_ts = ktime_get_boottime(); ++ + return IRQ_HANDLED; + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/234-001-ath11k-account-tx-rx-packets-flow.patch b/feeds/wifi-ax/mac80211/patches/qca/234-001-ath11k-account-tx-rx-packets-flow.patch new file mode 100644 index 000000000..3312a00de --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/234-001-ath11k-account-tx-rx-packets-flow.patch @@ -0,0 +1,407 @@ +From d6d86c0c48c8d114e94c5b5f749c97d629d727ef Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Mon, 4 Jan 2021 23:49:21 +0530 +Subject: [PATCH 1/2] ath11k/mac80211: Add support to account Tx and Rx flow + packets + +Added support to log the inflow and outflow of the Tx and Rx +packets in netif and host driver. + +Command to dump the Tx pkts flow in driver: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/driver_tx_pkts_flow + +Command to dump the Rx pkts flow in driver: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/driver_rx_pkts_flow + +Commands to reset the Tx/Rx pkts flow in driver: +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_tx_stats + +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_rx_stats + +Command to dump the Tx pkts flow in mac80211: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/mac80211_tx_pkts_flow + +Command to dump the Rx pkts flow in mac80211: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/mac80211_rx_pkts_flow + +Commands to reset the Tx/Rx pkts flow in mac80211: +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_mac80211_tx_pkts_flow + +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_mac80211_rx_pkts_flow + +Sample output after running the Tx and Rx traffic. + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/driver_tx_pkts_flow +Tx packets inflow from mac80211: 20 +Tx packets outflow to HW: 20 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/mac80211_tx_pkts_flow +Tx packets outflow from netif: 20 +Tx packets inflow in mac80211: 20 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/driver_rx_pkts_flow +Rx packets inflow from HW: 28 +Rx packets outflow from driver: 28 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/mac80211_rx_pkts_flow +Rx packets inflow in mac80211: 28 +Rx packets inflow in netif: 26 +Rx forwarded packets in bridge: 2 + +Signed-off-by: Maharaja Kennadyrajan +--- + drivers/net/wireless/ath/ath11k/core.h | 12 ++ + drivers/net/wireless/ath/ath11k/debugfs.h | 2 + + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 145 +++++++++++++++++- + drivers/net/wireless/ath/ath11k/dp_rx.c | 38 +++++ + drivers/net/wireless/ath/ath11k/mac.c | 11 ++ + 5 files changed, 207 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -398,6 +398,16 @@ struct ath11k_per_ppdu_tx_stats { + u32 retry_bytes; + }; + ++struct ath11k_driver_tx_pkts_flow { ++ atomic_t pkts_in; ++ atomic_t pkts_out; ++}; ++ ++struct ath11k_driver_rx_pkts_flow { ++ atomic_t pkts_frm_hw; ++ atomic_t pkts_out; ++}; ++ + struct ath11k_sta { + struct ath11k_vif *arvif; + +@@ -427,6 +437,8 @@ struct ath11k_sta { + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct ath11k_nss_sta_stats *nss_stats; + #endif ++ struct ath11k_driver_tx_pkts_flow drv_tx_pkts; ++ struct ath11k_driver_rx_pkts_flow drv_rx_pkts; + u16 tcl_metadata; + /* Protected with ar->data_lock */ + u32 peer_ps_state; +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -72,6 +72,8 @@ enum ath11k_dbg_htt_ext_stats_type { + #define TPC_STATS_TOT_COLUMN 100 + #define ATH11K_TPC_STATS_BUF_SIZE (TPC_STATS_TOT_ROW * TPC_STATS_TOT_COLUMN) + ++#define ATH11K_DRV_TX_STATS_SIZE 1024 ++ + enum ath11k_debug_tpc_stats_type { + ATH11K_DBG_TPC_STATS_SU, + ATH11K_DBG_TPC_STATS_SU_WITH_TXBF, +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -1087,6 +1087,8 @@ static ssize_t ath11k_dbg_sta_reset_rx_s + + spin_lock_bh(&ar->ab->base_lock); + memset(arsta->rx_stats, 0, sizeof(*arsta->rx_stats)); ++ atomic_set(&arsta->drv_rx_pkts.pkts_frm_hw, 0); ++ atomic_set(&arsta->drv_rx_pkts.pkts_out, 0); + spin_unlock_bh(&ar->ab->base_lock); + + ret = count; +@@ -1196,6 +1198,139 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t ++ath11k_dbg_sta_dump_driver_tx_pkts_flow(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ int len = 0, ret_val; ++ const int size = ATH11K_DRV_TX_STATS_SIZE; ++ char *buf; ++ ++ if (!arsta->tx_stats) ++ return -ENOENT; ++ ++ buf = kzalloc(ATH11K_DRV_TX_STATS_SIZE, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ mutex_lock(&ar->conf_mutex); ++ spin_lock_bh(&ar->ab->base_lock); ++ len += scnprintf(buf + len, size - len, ++ "Tx packets inflow from mac80211: %u\n", ++ atomic_read(&arsta->drv_tx_pkts.pkts_in)); ++ len += scnprintf(buf + len, size - len, ++ "Tx packets outflow to HW: %u\n", ++ atomic_read(&arsta->drv_tx_pkts.pkts_out)); ++ spin_unlock_bh(&ar->ab->base_lock); ++ ++ if (len > size) ++ len = size; ++ ++ ret_val = simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ kfree(buf); ++ ++ mutex_unlock(&ar->conf_mutex); ++ return ret_val; ++} ++ ++static const struct file_operations fops_driver_tx_pkts_flow = { ++ .read = ath11k_dbg_sta_dump_driver_tx_pkts_flow, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_dbg_sta_reset_tx_stats(struct file *file, ++ const char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ int ret, reset; ++ ++ if (!arsta->tx_stats) ++ return -ENOENT; ++ ++ ret = kstrtoint_from_user(buf, count, 0, &reset); ++ if (ret) ++ return ret; ++ ++ if (!reset || reset > 1) ++ return -EINVAL; ++ ++ spin_lock_bh(&ar->ab->base_lock); ++ memset(arsta->tx_stats, 0, sizeof(*arsta->tx_stats)); ++ atomic_set(&arsta->drv_tx_pkts.pkts_in, 0); ++ atomic_set(&arsta->drv_tx_pkts.pkts_out, 0); ++ spin_unlock_bh(&ar->ab->base_lock); ++ ++ ret = count; ++ return ret; ++} ++ ++static const struct file_operations fops_reset_tx_stats = { ++ .write = ath11k_dbg_sta_reset_tx_stats, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ++ath11k_dbg_sta_dump_driver_rx_pkts_flow(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; ++ int len = 0, ret_val = 0; ++ const int size = 1024; ++ char *buf; ++ ++ if (!rx_stats) ++ return -ENOENT; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ mutex_lock(&ar->conf_mutex); ++ spin_lock_bh(&ar->ab->base_lock); ++ ++ len += scnprintf(buf + len, size - len, ++ "Rx packets inflow from HW: %u\n", ++ atomic_read(&arsta->drv_rx_pkts.pkts_frm_hw)); ++ len += scnprintf(buf + len, size - len, ++ "Rx packets outflow from driver: %u\n", ++ atomic_read(&arsta->drv_rx_pkts.pkts_out)); ++ ++ len += scnprintf(buf + len, size - len, "\n"); ++ ++ spin_unlock_bh(&ar->ab->base_lock); ++ ++ if (len > size) ++ len = size; ++ ++ ret_val = simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ kfree(buf); ++ ++ mutex_unlock(&ar->conf_mutex); ++ return ret_val; ++} ++ ++static const struct file_operations fops_driver_rx_pkts_flow = { ++ .read = ath11k_dbg_sta_dump_driver_rx_pkts_flow, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct dentry *dir) + { +@@ -1211,14 +1346,21 @@ void ath11k_debugfs_sta_op_add(struct ie + debugfs_create_file("total_ps_duration", 0440, dir, sta, + &fops_total_ps_duration); + } +- if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) ++ if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) { + debugfs_create_file("tx_stats", 0400, dir, sta, + &fops_tx_stats); ++ debugfs_create_file("reset_tx_stats", 0600, dir, sta, ++ &fops_reset_tx_stats); ++ debugfs_create_file("driver_tx_pkts_flow", 0400, dir, sta, ++ &fops_driver_tx_pkts_flow); ++ } + if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) { + debugfs_create_file("rx_stats", 0400, dir, sta, + &fops_rx_stats); + debugfs_create_file("reset_rx_stats", 0600, dir, sta, + &fops_reset_rx_stats); ++ debugfs_create_file("driver_rx_pkts_flow", 0400, dir, sta, ++ &fops_driver_rx_pkts_flow); + } + + debugfs_create_file("htt_peer_stats", 0400, dir, sta, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2692,6 +2692,7 @@ static void ath11k_dp_rx_deliver_msdu(st + struct ieee80211_rx_status *rx_status; + struct ieee80211_radiotap_he *he = NULL; + struct ieee80211_sta *pubsta = NULL; ++ struct ath11k_sta *arsta = NULL; + struct ath11k_peer *peer; + struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); + u8 decap = DP_RX_DECAP_TYPE_RAW; +@@ -2754,6 +2755,18 @@ static void ath11k_dp_rx_deliver_msdu(st + rx_status->flag |= RX_FLAG_8023; + + ieee80211_rx_napi(ar->hw, pubsta, msdu, napi); ++ ++ if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) { ++ if (!(status->flag & RX_FLAG_ONLY_MONITOR)) { ++ spin_lock_bh(&ar->ab->base_lock); ++ if (peer && peer->sta) ++ arsta = ++ (struct ath11k_sta *)peer->sta->drv_priv; ++ spin_unlock_bh(&ar->ab->base_lock); ++ if (arsta) ++ atomic_inc(&arsta->drv_rx_pkts.pkts_out); ++ } ++ } + } + + static int ath11k_dp_rx_process_msdu(struct ath11k *ar, +@@ -2903,6 +2916,8 @@ int ath11k_dp_process_rx(struct ath11k_b + int total_msdu_reaped = 0; + struct hal_srng *srng; + struct sk_buff *msdu; ++ struct ath11k_peer *peer = NULL; ++ struct ath11k_sta *arsta = NULL; + int quota = budget; + bool done = false; + int buf_id, mac_id; +@@ -2974,6 +2989,19 @@ try_again: + rxcb->tid = FIELD_GET(HAL_REO_DEST_RING_INFO0_RX_QUEUE_NUM, + desc.info0); + ++ if (ath11k_debugfs_is_extd_rx_stats_enabled(ar) && rxcb->peer_id) { ++ rcu_read_lock(); ++ spin_lock_bh(&ab->base_lock); ++ peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); ++ if (peer && peer->sta) ++ arsta = ++ (struct ath11k_sta *)peer->sta->drv_priv; ++ spin_unlock_bh(&ab->base_lock); ++ if (arsta) ++ atomic_inc(&arsta->drv_rx_pkts.pkts_frm_hw); ++ rcu_read_unlock(); ++ } ++ + rxcb->mac_id = mac_id; + __skb_queue_tail(&msdu_list, msdu); + +@@ -4458,7 +4486,10 @@ static int ath11k_dp_rx_h_null_q_desc(st + struct rx_attention *rx_attention; + u8 l3pad_bytes; + struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); ++ struct ath11k_peer *peer = NULL; ++ struct ath11k_sta *arsta = NULL; + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; ++ u32 peer_id; + + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); + +@@ -4510,6 +4541,18 @@ static int ath11k_dp_rx_h_null_q_desc(st + * rx with mac80211. Need not worry about cleaning up amsdu_list. + */ + ++ if (ath11k_debugfs_is_extd_rx_stats_enabled(ar)) { ++ peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, desc); ++ spin_lock_bh(&ar->ab->base_lock); ++ if (peer_id) ++ peer = ath11k_peer_find_by_id(ar->ab, rxcb->peer_id); ++ if (peer && peer->sta) ++ arsta = (struct ath11k_sta *)peer->sta->drv_priv; ++ spin_unlock_bh(&ar->ab->base_lock); ++ if (arsta) ++ atomic_inc(&arsta->drv_rx_pkts.pkts_frm_hw); ++ } ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5590,6 +5590,8 @@ static void ath11k_mac_op_tx(struct ieee + struct ieee80211_key_conf *key = info->control.hw_key; + struct ath11k_mgmt_frame_stats *mgmt_stats = &arvif->mgmt_stats; + u32 info_flags = info->flags; ++ struct ieee80211_sta *sta = control->sta; ++ struct ath11k_sta *arsta = NULL; + bool is_prb_rsp; + u16 frm_type = 0; + int ret; +@@ -5653,6 +5655,15 @@ static void ath11k_mac_op_tx(struct ieee + ath11k_warn(ar->ab, "failed to transmit frame %d\n", ret); + ieee80211_free_txskb(ar->hw, skb); + } ++ ++ if (ath11k_debugfs_is_extd_tx_stats_enabled(ar) && sta) { ++ arsta = (struct ath11k_sta *)sta->drv_priv; ++ if (arsta) { ++ atomic_inc(&arsta->drv_tx_pkts.pkts_in); ++ if (!ret) ++ atomic_inc(&arsta->drv_tx_pkts.pkts_out); ++ } ++ } + } + + void ath11k_mac_drain_tx(struct ath11k *ar) diff --git a/feeds/wifi-ax/mac80211/patches/qca/234-002-mac80211-account-tx-rx-packets-flow.patch b/feeds/wifi-ax/mac80211/patches/qca/234-002-mac80211-account-tx-rx-packets-flow.patch new file mode 100644 index 000000000..1869c5fef --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/234-002-mac80211-account-tx-rx-packets-flow.patch @@ -0,0 +1,361 @@ +From 26bf6027fe93346f47358e8933e613ac1ece3455 Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Mon, 4 Jan 2021 23:50:37 +0530 +Subject: [PATCH 2/2] ath11k/mac80211: Add support to account Tx and Rx flow + packets + +Added support to log the inflow and outflow of the Tx and Rx +packets in netif and host driver. + +Command to dump the Tx pkts flow in driver: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/driver_tx_pkts_flow + +Command to dump the Rx pkts flow in driver: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/driver_rx_pkts_flow + +Commands to reset the Tx/Rx pkts flow in driver: +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_tx_stats + +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_rx_stats + +Command to dump the Tx pkts flow in mac80211: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/mac80211_tx_pkts_flow + +Command to dump the Rx pkts flow in mac80211: +cat +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/mac80211_rx_pkts_flow + +Commands to reset the Tx/Rx pkts flow in mac80211: +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_mac80211_tx_pkts_flow + +echo 1 > +/sys/kernel/debug/ieee80211/phyX/netdev\:wlanX/stations/ +XX\:XX\:XX\:XX\:XX\:XX/reset_mac80211_rx_pkts_flow + +Sample output after running the Tx and Rx traffic. + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/driver_tx_pkts_flow +Tx packets inflow from mac80211: 20 +Tx packets outflow to HW: 20 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/mac80211_tx_pkts_flow +Tx packets outflow from netif: 20 +Tx packets inflow in mac80211: 20 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/driver_rx_pkts_flow +Rx packets inflow from HW: 28 +Rx packets outflow from driver: 28 + +root@OpenWrt:/# cat sys/kernel/debug/ieee80211/phy0/netdev\: +wlan0/stations/8c\:fd\:f0\:06\:23\:41/mac80211_rx_pkts_flow +Rx packets inflow in mac80211: 28 +Rx packets inflow in netif: 26 +Rx forwarded packets in bridge: 2 + +Signed-off-by: Maharaja Kennadyrajan +--- + net/mac80211/debugfs_sta.c | 174 +++++++++++++++++++++++++++++++++++++ + net/mac80211/rx.c | 13 +++ + net/mac80211/sta_info.h | 7 ++ + net/mac80211/tx.c | 8 ++ + 4 files changed, 202 insertions(+) + +--- a/net/mac80211/debugfs_sta.c ++++ b/net/mac80211/debugfs_sta.c +@@ -984,6 +984,176 @@ out: + } + STA_OPS(he_capa); + ++static ssize_t ++sta_reset_mac80211_tx_pkts_flow_read(struct file *file, ++ char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ size_t bufsz = 30; ++ char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; ++ ssize_t rv; ++ ++ if (!buf) ++ return -ENOMEM; ++ ++ p += scnprintf(p, bufsz + buf - p, "write 1 to reset the stats\n"); ++ ++ rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); ++ kfree(buf); ++ return rv; ++} ++ ++static ssize_t ++sta_reset_mac80211_tx_pkts_flow_write(struct file *file, ++ const char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ u32 tx_stats_reset; ++ int ret; ++ char _buf[2] = {}, *buf = _buf; ++ ++ if (count > sizeof(_buf)) ++ return -EINVAL; ++ ++ if (copy_from_user(buf, userbuf, count)) ++ return -EFAULT; ++ ++ buf[sizeof(_buf) - 1] = '\0'; ++ if (sscanf(buf, "%u", &tx_stats_reset) != 1) ++ return -EINVAL; ++ ++ ret = kstrtoul(buf, 0, &tx_stats_reset); ++ if (ret || tx_stats_reset != 1) ++ return -EINVAL; ++ ++ atomic_set(&sta->tx_drv_pkts, 0); ++ atomic_set(&sta->tx_netif_pkts, 0); ++ ++ return count; ++} ++STA_OPS_RW(reset_mac80211_tx_pkts_flow); ++ ++static ssize_t ++sta_reset_mac80211_rx_pkts_flow_read(struct file *file, ++ char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ size_t bufsz = 30; ++ char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; ++ ssize_t rv; ++ ++ if (!buf) ++ return -ENOMEM; ++ ++ p += scnprintf(p, bufsz + buf - p, "write 1 to reset the stats\n"); ++ ++ rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); ++ kfree(buf); ++ return rv; ++} ++ ++static ssize_t ++sta_reset_mac80211_rx_pkts_flow_write(struct file *file, ++ const char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ u32 rx_stats_reset; ++ int ret; ++ char _buf[2] = {}, *buf = _buf; ++ ++ if (count > sizeof(_buf)) ++ return -EINVAL; ++ ++ if (copy_from_user(buf, userbuf, count)) ++ return -EFAULT; ++ ++ buf[sizeof(_buf) - 1] = '\0'; ++ if (sscanf(buf, "%u", &rx_stats_reset) != 1) ++ return -EINVAL; ++ ++ ret = kstrtoul(buf, 0, &rx_stats_reset); ++ if (ret || rx_stats_reset != 1) ++ return -EINVAL; ++ ++ atomic_set(&sta->rx_drv_pkts, 0); ++ atomic_set(&sta->rx_netif_pkts, 0); ++ atomic_set(&sta->rx_forwarded_pkts, 0); ++ ++ return count; ++} ++STA_OPS_RW(reset_mac80211_rx_pkts_flow); ++ ++static ssize_t sta_mac80211_tx_pkts_flow_read(struct file *file, ++ char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ int retval = 0, len = 0; ++ const int size = 256; ++ char *buf; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ rcu_read_lock(); ++ ++ len += scnprintf(buf + len, size - len, ++ "Tx packets outflow from netif: %u\n", ++ atomic_read(&sta->tx_netif_pkts)); ++ len += scnprintf(buf + len, size - len, ++ "Tx packets outflow from mac80211: %u\n", ++ atomic_read(&sta->tx_drv_pkts)); ++ rcu_read_unlock(); ++ ++ if (len > size) ++ len = size; ++ ++ retval = simple_read_from_buffer(userbuf, count, ppos, buf, len); ++ kfree(buf); ++ ++ return retval; ++} ++STA_OPS(mac80211_tx_pkts_flow); ++ ++static ssize_t sta_mac80211_rx_pkts_flow_read(struct file *file, ++ char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ int retval = 0, len = 0; ++ const int size = 512; ++ char *buf; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ rcu_read_lock(); ++ ++ len += scnprintf(buf + len, size - len, ++ "Rx packets inflow in mac80211: %u\n", ++ atomic_read(&sta->rx_drv_pkts)); ++ len += scnprintf(buf + len, size - len, ++ "Rx packets inflow in netif: %u\n", ++ atomic_read(&sta->rx_netif_pkts)); ++ len += scnprintf(buf + len, size - len, ++ "Rx forwarded packets in bridge: %u\n", ++ atomic_read(&sta->rx_forwarded_pkts)); ++ ++ rcu_read_unlock(); ++ ++ if (len > size) ++ len = size; ++ retval = simple_read_from_buffer(userbuf, count, ppos, buf, len); ++ kfree(buf); ++ ++ return retval; ++} ++STA_OPS(mac80211_rx_pkts_flow); ++ + #define DEBUGFS_ADD(name) \ + debugfs_create_file(#name, 0400, \ + sta->debugfs_dir, sta, &sta_ ##name## _ops) +@@ -1022,6 +1192,10 @@ void ieee80211_sta_debugfs_add(struct st + DEBUGFS_ADD(ht_capa); + DEBUGFS_ADD(vht_capa); + DEBUGFS_ADD(he_capa); ++ DEBUGFS_ADD(reset_mac80211_tx_pkts_flow); ++ DEBUGFS_ADD(reset_mac80211_rx_pkts_flow); ++ DEBUGFS_ADD(mac80211_tx_pkts_flow); ++ DEBUGFS_ADD(mac80211_rx_pkts_flow); + + DEBUGFS_ADD_COUNTER(rx_duplicates, rx_stats.num_duplicates); + DEBUGFS_ADD_COUNTER(rx_fragments, rx_stats.fragments); +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2542,6 +2542,7 @@ static void netif_rx_nss(struct ieee8021 + struct sk_buff *skb) + { + struct ieee80211_sub_if_data *sdata = rx->sdata; ++ struct sta_info *sta = rx->sta; + int ret; + + if (!sdata->nssctx) +@@ -2564,6 +2565,7 @@ out: + napi_gro_receive(rx->napi, skb); + else + netif_receive_skb(skb); ++ atomic_inc(&sta->rx_netif_pkts); + } + + static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb, +@@ -2646,6 +2648,7 @@ ieee80211_deliver_skb(struct ieee80211_r + */ + xmit_skb = skb; + skb = NULL; ++ atomic_inc(&rx->sta->rx_forwarded_pkts); + } + } + } +@@ -4802,9 +4805,18 @@ void ieee80211_rx_list(struct ieee80211_ + struct ieee80211_rate *rate = NULL; + struct ieee80211_supported_band *sband; + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); ++ struct sta_info *sta = NULL; + + WARN_ON_ONCE(softirq_count() == 0); + ++ if (pubsta) { ++ sta = container_of(pubsta, struct sta_info, sta); ++ if (sta && napi) { ++ if (!(status->flag & RX_FLAG_ONLY_MONITOR)) ++ atomic_inc(&sta->rx_drv_pkts); ++ } ++ } ++ + if (WARN_ON(status->band >= NUM_NL80211_BANDS)) + goto drop; + +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -639,6 +639,13 @@ struct sta_info { + + struct cfg80211_chan_def tdls_chandef; + ++ atomic_t tx_drv_pkts; ++ atomic_t tx_netif_pkts; ++ atomic_t rx_drv_pkts; ++ atomic_t rx_netif_pkts; ++ /* Rx packets forwarded to bridge */ ++ atomic_t rx_forwarded_pkts; ++ + /* keep last! */ + struct ieee80211_sta sta; + }; +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3945,6 +3945,9 @@ void __ieee80211_subif_start_xmit(struct + if (IS_ERR(sta)) + sta = NULL; + ++ if (sta) ++ atomic_inc(&sta->tx_netif_pkts); ++ + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { + ap_sdata = container_of(sdata->bss, + struct ieee80211_sub_if_data, u.ap); +@@ -4229,6 +4232,9 @@ static bool ieee80211_tx_8023(struct iee + + drv_tx(local, &control, skb); + ++ if (sta) ++ atomic_inc(&sta->tx_drv_pkts); ++ + return true; + } + +@@ -4293,6 +4299,9 @@ static void ieee80211_8023_xmit(struct i + + ieee80211_tx_8023(sdata, skb, skb->len, sta, false); + ++ if (sta) ++ atomic_inc(&sta->tx_netif_pkts); ++ + return; + + out_free: diff --git a/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-add-dbring-debug-and-buffer-validation-suppor.patch b/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-add-dbring-debug-and-buffer-validation-suppor.patch new file mode 100644 index 000000000..dc479e03a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-add-dbring-debug-and-buffer-validation-suppor.patch @@ -0,0 +1,567 @@ +From 475f5c31d6c28a5fbb53aa9779af61214613cde9 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Wed, 23 Dec 2020 10:53:49 +0530 +Subject: [PATCH] ath11k: add dbring debug and buffer validation support + +Target copy spectral report through dbring to host for further +processing. This mechanism involves ring and buffer management +in the Host, FW, and uCode, where improper tail pointer update +issues are seen. This dbring debug support help to debug such +issues by tracking head and tail pointer movement along with +the timestamp at which each buffer is received and replenished. + +Currently there is no validation on the spectral report over the +db ring buffers from the hardware. Improper/incomplete DMA by +the target can result in invalid data received by host. +Due to this we may populate incorrect data to user space. + +This buffer validation support fix this issues by filling some +magic value in the buffer during buffer replenish and check for +the magic value in the buffer received by the target. +If host detect magic value in the received buffer it will +drop the buffer. + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/dbring.c | 54 ++++++- + drivers/net/wireless/ath/ath11k/dbring.h | 4 +- + drivers/net/wireless/ath/ath11k/debugfs.c | 218 +++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 40 +++++- + drivers/net/wireless/ath/ath11k/spectral.c | 29 ++-- + 6 files changed, 331 insertions(+), 15 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -512,6 +512,7 @@ struct ath11k_debug { + struct list_head wmi_list; + struct completion wmi_ctrl_path_stats_rcvd; + u32 wmi_ctrl_path_stats_tagid; ++ struct ath11k_db_module_debug *module_debug[WMI_DIRECT_BUF_MAX]; + }; + + struct ath11k_per_peer_tx_stats { +--- a/drivers/net/wireless/ath/ath11k/dbring.c ++++ b/drivers/net/wireless/ath/ath11k/dbring.c +@@ -6,9 +6,45 @@ + #include "core.h" + #include "debug.h" + ++#define ATH11K_DB_MAGIC_VALUE 0xdeadbeaf ++ ++int ath11k_dbring_validate_buffer(struct ath11k *ar, void *buffer, u32 size) ++{ ++ u32 *temp = (u32 *)buffer; ++ int idx; ++ ++ size = size >> 2; ++ ++ for (idx = 0; idx < size; idx++) { ++ if (*temp == ATH11K_DB_MAGIC_VALUE) { ++ ath11k_warn(ar->ab, "found magic value in the buffer\n"); ++ return -EINVAL; ++ } ++ ++ temp++; ++ } ++ ++ return 0; ++} ++ ++static void ath11k_dbring_fill_magic_value(struct ath11k *ar, ++ void *buffer, u32 size) ++{ ++ u32 *temp = (u32 *)buffer; ++ int idx; ++ ++ size = size >> 2; ++ ++ for (idx = 0; idx < size; idx++) { ++ *temp = ATH11K_DB_MAGIC_VALUE; ++ temp++; ++ } ++} ++ + static int ath11k_dbring_bufs_replenish(struct ath11k *ar, + struct ath11k_dbring *ring, + struct ath11k_dbring_element *buff, ++ enum wmi_direct_buffer_module id, + gfp_t gfp) + { + struct ath11k_base *ab = ar->ab; +@@ -27,6 +63,7 @@ static int ath11k_dbring_bufs_replenish( + + ptr_unaligned = buff->payload; + ptr_aligned = PTR_ALIGN(ptr_unaligned, ring->buf_align); ++ ath11k_dbring_fill_magic_value(ar, ptr_aligned, ring->buf_sz); + paddr = dma_map_single(ab->dev, ptr_aligned, ring->buf_sz, + DMA_FROM_DEVICE); + +@@ -55,6 +92,7 @@ static int ath11k_dbring_bufs_replenish( + + ath11k_hal_rx_buf_addr_info_set(desc, paddr, cookie, 0); + ++ ath11k_dbring_add_debug_entry(ar, id, DBR_RING_DEBUG_EVENT_REPLENISH, srng); + ath11k_hal_srng_access_end(ab, srng); + + return 0; +@@ -73,6 +111,7 @@ err: + + static int ath11k_dbring_fill_bufs(struct ath11k *ar, + struct ath11k_dbring *ring, ++ enum wmi_direct_buffer_module id, + gfp_t gfp) + { + struct ath11k_dbring_element *buff; +@@ -96,7 +135,7 @@ static int ath11k_dbring_fill_bufs(struc + if (!buff) + break; + +- ret = ath11k_dbring_bufs_replenish(ar, ring, buff, gfp); ++ ret = ath11k_dbring_bufs_replenish(ar, ring, buff, id, gfp); + if (ret) { + ath11k_warn(ar->ab, "failed to replenish db ring num_remain %d req_ent %d\n", + num_remain, req_entries); +@@ -161,7 +200,8 @@ int ath11k_dbring_set_cfg(struct ath11k + + int ath11k_dbring_buf_setup(struct ath11k *ar, + struct ath11k_dbring *ring, +- struct ath11k_dbring_cap *db_cap) ++ struct ath11k_dbring_cap *db_cap, ++ enum wmi_direct_buffer_module id) + { + struct ath11k_base *ab = ar->ab; + struct hal_srng *srng; +@@ -177,7 +217,7 @@ int ath11k_dbring_buf_setup(struct ath11 + ring->hp_addr = ath11k_hal_srng_get_hp_addr(ar->ab, srng); + ring->tp_addr = ath11k_hal_srng_get_tp_addr(ar->ab, srng); + +- ret = ath11k_dbring_fill_bufs(ar, ring, GFP_KERNEL); ++ ret = ath11k_dbring_fill_bufs(ar, ring, id, GFP_KERNEL); + + return ret; + } +@@ -237,7 +277,7 @@ int ath11k_dbring_buffer_release_event(s + struct ath11k_buffer_addr desc; + u8 *vaddr_unalign; + u32 num_entry, num_buff_reaped; +- u8 pdev_idx, rbm; ++ u8 pdev_idx, rbm, module_id; + u32 cookie; + int buf_id; + int size; +@@ -245,6 +285,7 @@ int ath11k_dbring_buffer_release_event(s + int ret = 0; + + pdev_idx = ev->fixed.pdev_id; ++ module_id = ev->fixed.module_id; + + if (pdev_idx >= ab->num_radios) { + ath11k_warn(ab, "Invalid pdev id %d\n", pdev_idx); +@@ -313,6 +354,9 @@ int ath11k_dbring_buffer_release_event(s + dma_unmap_single(ab->dev, buff->paddr, ring->buf_sz, + DMA_FROM_DEVICE); + ++ ath11k_dbring_add_debug_entry(ar, module_id, ++ DBR_RING_DEBUG_EVENT_RX, srng); ++ + if (ring->handler) { + vaddr_unalign = buff->payload; + handler_data.data = PTR_ALIGN(vaddr_unalign, +@@ -323,7 +367,7 @@ int ath11k_dbring_buffer_release_event(s + } + + memset(buff, 0, size); +- ath11k_dbring_bufs_replenish(ar, ring, buff, GFP_ATOMIC); ++ ath11k_dbring_bufs_replenish(ar, ring, buff, module_id, GFP_ATOMIC); + } + + spin_unlock_bh(&srng->lock); +--- a/drivers/net/wireless/ath/ath11k/dbring.h ++++ b/drivers/net/wireless/ath/ath11k/dbring.h +@@ -65,7 +65,8 @@ int ath11k_dbring_wmi_cfg_setup(struct a + enum wmi_direct_buffer_module id); + int ath11k_dbring_buf_setup(struct ath11k *ar, + struct ath11k_dbring *ring, +- struct ath11k_dbring_cap *db_cap); ++ struct ath11k_dbring_cap *db_cap, ++ enum wmi_direct_buffer_module id); + int ath11k_dbring_srng_setup(struct ath11k *ar, struct ath11k_dbring *ring, + int ring_num, int num_entries); + int ath11k_dbring_buffer_release_event(struct ath11k_base *ab, +@@ -76,4 +77,5 @@ int ath11k_dbring_get_cap(struct ath11k_ + struct ath11k_dbring_cap *db_cap); + void ath11k_dbring_srng_cleanup(struct ath11k *ar, struct ath11k_dbring *ring); + void ath11k_dbring_buf_cleanup(struct ath11k *ar, struct ath11k_dbring *ring); ++int ath11k_dbring_validate_buffer(struct ath11k *ar, void *data, u32 size); + #endif /* ATH11K_DBRING_H */ +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -3281,6 +3281,203 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++void ath11k_dbring_add_debug_entry(struct ath11k *ar, ++ enum wmi_direct_buffer_module id, ++ enum ath11k_db_ring_dbg_event event, ++ struct hal_srng *srng) ++{ ++ struct ath11k_db_module_debug *db_module_debug; ++ struct ath11k_db_ring_debug *db_ring_debug; ++ struct ath11k_db_ring_debug_entry *entry; ++ ++ if (id > WMI_DIRECT_BUF_MAX || event > DBR_RING_DEBUG_EVENT_MAX) ++ return; ++ ++ db_module_debug = ar->debug.module_debug[id]; ++ if (!db_module_debug) ++ return; ++ ++ db_ring_debug = &db_module_debug->db_ring_debug; ++ ++ if (!db_module_debug->db_ring_debug_enabled) ++ return; ++ ++ if (db_ring_debug->entries) { ++ entry = &db_ring_debug->entries[db_ring_debug->db_ring_debug_idx]; ++ entry->hp = srng->u.src_ring.hp; ++ entry->tp = *srng->u.src_ring.tp_addr; ++ entry->timestamp = jiffies; ++ entry->event = event; ++ ++ db_ring_debug->db_ring_debug_idx++; ++ if (db_ring_debug->db_ring_debug_idx == ++ db_ring_debug->num_ring_debug_entries) ++ db_ring_debug->db_ring_debug_idx = 0; ++ } ++} ++ ++static ssize_t ath11k_dbr_dump_debug_entries(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_db_ring_debug *db_ring_debug = file->private_data; ++ static const char * const event_id_to_string[] = {"empty", "Rx", "Replenish"}; ++ int size = 25 * 1024; ++ char *buf; ++ int i, ret; ++ int len = 0; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ len += scnprintf(buf + len, size - len, "-------------------------------------\n"); ++ len += scnprintf(buf + len, size - len, "| idx | hp | tp | timestamp | event |\n"); ++ len += scnprintf(buf + len, size - len, "-------------------------------------\n"); ++ ++ for (i = 0; i < db_ring_debug->num_ring_debug_entries; i++) { ++ len += scnprintf(buf + len, size - len, ++ "|%4u|%8u|%8u|%11llu|%8s|\n", i, ++ db_ring_debug->entries[i].hp, ++ db_ring_debug->entries[i].tp, ++ db_ring_debug->entries[i].timestamp, ++ event_id_to_string[db_ring_debug->entries[i].event]); ++ } ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ kfree(buf); ++ ++ return ret; ++} ++ ++static const struct file_operations fops_dump_dbr_debug_entries = { ++ .read = ath11k_dbr_dump_debug_entries, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static void ath11k_db_module_debugfs_destroy(struct ath11k *ar, int module_id) ++{ ++ struct ath11k_db_module_debug *module_debug; ++ struct ath11k_db_ring_debug *db_ring_debug; ++ ++ module_debug = ar->debug.module_debug[module_id]; ++ db_ring_debug = &module_debug->db_ring_debug; ++ ++ if (!module_debug || !module_debug->module_debugfs) ++ return; ++ ++ debugfs_remove_recursive(module_debug->module_debugfs); ++ module_debug->module_debugfs = NULL; ++ module_debug->db_ring_debug_enabled = false; ++ kfree(db_ring_debug->entries); ++ db_ring_debug->entries = NULL; ++ kfree(module_debug); ++ ar->debug.module_debug[module_id] = NULL; ++} ++ ++static int ath11k_db_module_debugfs_init(struct ath11k *ar, int module_id) ++{ ++ struct ath11k_db_module_debug *module_debug; ++ struct ath11k_db_ring_debug *db_ring_debug; ++ static const char * const module_id_to_str[] = {"spectral", "CFR"}; ++ u32 size; ++ ++ if (!ar->debug.module_debug[module_id]) ++ ar->debug.module_debug[module_id] = kzalloc(sizeof(*module_debug), ++ GFP_KERNEL); ++ ++ module_debug = ar->debug.module_debug[module_id]; ++ db_ring_debug = &module_debug->db_ring_debug; ++ ++ if (module_debug->module_debugfs) ++ return 0; ++ ++ module_debug->module_debugfs = debugfs_create_dir(module_id_to_str[module_id], ++ ar->debug.debugfs_pdev); ++ if (IS_ERR_OR_NULL(module_debug->module_debugfs)) { ++ if (IS_ERR(module_debug->module_debugfs)) ++ return PTR_ERR(module_debug->module_debugfs); ++ return -ENOMEM; ++ } ++ ++ size = ATH11K_DBR_DEUBG_ENTRIES_MAX * ++ sizeof(struct ath11k_db_ring_debug_entry); ++ ++ module_debug->db_ring_debug_enabled = true; ++ db_ring_debug->num_ring_debug_entries = ATH11K_DBR_DEUBG_ENTRIES_MAX; ++ db_ring_debug->db_ring_debug_idx = 0; ++ db_ring_debug->entries = kzalloc(size, GFP_KERNEL); ++ if (!db_ring_debug->entries) ++ return -ENOMEM; ++ ++ debugfs_create_file("dump_db_ring_debug", 0444, module_debug->module_debugfs, ++ db_ring_debug, &fops_dump_dbr_debug_entries); ++ ++ return 0; ++} ++ ++static ssize_t ath11k_write_enable_dbr_debug(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ char buf[32] = {0}; ++ u32 module_id, enable; ++ int ret; ++ static const char usage[] = "usage: echo " ++ "module_id:0-Spectral 1-CFR val:0-disable 1-enable"; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); ++ if (ret < 0) ++ goto out; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%u %u", &module_id, &enable); ++ if (ret != 2) { ++ ath11k_warn(ar->ab, "%s\n", usage); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (module_id > 1 || enable > 1) { ++ ath11k_warn(ar->ab, "%s\n", usage); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (enable) { ++ ret = ath11k_db_module_debugfs_init(ar, module_id); ++ if (ret) { ++ ath11k_warn(ar->ab, "db ring module debgfs init failed: %d\n", ++ ret); ++ goto out; ++ } ++ } else { ++ ath11k_db_module_debugfs_destroy(ar, module_id); ++ } ++ ++ ret = count; ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_dbr_debug = { ++ .write = ath11k_write_enable_dbr_debug, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +@@ -3368,11 +3565,32 @@ int ath11k_debugfs_register(struct ath11 + &fops_athdiag); + } + ++ debugfs_create_file("enable_dbr_debug", 0200, ar->debug.debugfs_pdev, ++ ar, &fops_dbr_debug); ++ + return 0; + } + + void ath11k_debugfs_unregister(struct ath11k *ar) + { ++ struct ath11k_db_module_debug *module_debug; ++ struct ath11k_db_ring_debug *db_ring_debug; ++ int i; ++ ++ for (i = 0; i < WMI_DIRECT_BUF_MAX; i++) { ++ module_debug = ar->debug.module_debug[i]; ++ if (!module_debug) ++ continue; ++ ++ db_ring_debug = &module_debug->db_ring_debug; ++ module_debug->db_ring_debug_enabled = false; ++ kfree(db_ring_debug->entries); ++ db_ring_debug->entries = NULL; ++ debugfs_remove_recursive(module_debug->module_debugfs); ++ kfree(module_debug); ++ ar->debug.module_debug[i] = NULL; ++ } ++ + ath11k_deinit_pktlog(ar); + debugfs_remove_recursive(ar->debug.debugfs_pdev); + ar->debug.debugfs_pdev = NULL; +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -92,6 +92,34 @@ enum ath11k_debug_tpc_stats_ctl_mode { + ATH11K_TPC_STATS_CTL_MODE_BW_160, + }; + ++#define ATH11K_DBR_DEUBG_ENTRIES_MAX 512 ++ ++enum ath11k_db_ring_dbg_event { ++ DBR_RING_DEBUG_EVENT_INVALID, ++ DBR_RING_DEBUG_EVENT_RX, ++ DBR_RING_DEBUG_EVENT_REPLENISH, ++ DBR_RING_DEBUG_EVENT_MAX, ++}; ++ ++struct ath11k_db_ring_debug_entry { ++ u32 hp; ++ u32 tp; ++ u64 timestamp; ++ enum ath11k_db_ring_dbg_event event; ++}; ++ ++struct ath11k_db_ring_debug { ++ struct ath11k_db_ring_debug_entry *entries; ++ u32 db_ring_debug_idx; ++ u32 num_ring_debug_entries; ++}; ++ ++struct ath11k_db_module_debug { ++ struct ath11k_db_ring_debug db_ring_debug; ++ struct dentry *module_debugfs; ++ bool db_ring_debug_enabled; ++}; ++ + struct debug_htt_stats_req { + bool done; + u8 pdev_id; +@@ -197,6 +225,10 @@ void ath11k_debugfs_fw_stats_process(str + void ath11k_debugfs_fw_stats_init(struct ath11k *ar); + ssize_t ath11k_debugfs_dump_soc_ring_bp_stats(struct ath11k_base *ab, + char *buf, int size); ++void ath11k_dbring_add_debug_entry(struct ath11k *ar, ++ enum wmi_direct_buffer_module id, ++ enum ath11k_db_ring_dbg_event event, ++ struct hal_srng *srng); + + static inline bool ath11k_debugfs_is_pktlog_lite_mode_enabled(struct ath11k *ar) + { +@@ -320,7 +352,13 @@ static inline int ath11k_debugfs_rx_filt + { + return 0; + } +- ++static inline void ++ath11k_dbring_add_debug_entry(struct ath11k *ar, ++ enum wmi_direct_buffer_module id, ++ enum ath11k_db_ring_dbg_event event, ++ struct hal_srng *srng) ++{ ++} + #endif /* CPTCFG_MAC80211_DEBUGFS*/ + + #ifdef CPTCFG_ATH11K_PKTLOG +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -581,6 +581,7 @@ int ath11k_spectral_process_fft(struct a + u16 length, freq; + u8 chan_width_mhz, bin_sz; + int ret; ++ u32 check_length; + + lockdep_assert_held(&ar->spectral.lock); + +@@ -615,6 +616,11 @@ int ath11k_spectral_process_fft(struct a + return -EINVAL; + } + ++ check_length = sizeof(*fft_report) + (num_bins * ab->hw_params.spectral_fft_sz); ++ ret = ath11k_dbring_validate_buffer(ar, data, check_length); ++ if (ret) ++ return ret; ++ + ret = ath11k_spectral_pull_search(ar, data, &search); + if (ret) { + ath11k_warn(ab, "failed to pull search report %d\n", ret); +@@ -731,15 +737,18 @@ static int ath11k_spectral_process_data( + + tag = FIELD_GET(SPECTRAL_TLV_HDR_TAG, + __le32_to_cpu(tlv->header)); +- switch (tag) { +- case ATH11K_SPECTRAL_TAG_SCAN_SUMMARY: +- /* HW bug in tlv length of summary report, +- * HW report 3 DWORD size but the data payload +- * is 4 DWORD size (16 bytes). +- * Need to remove this workaround once HW bug fixed +- */ ++ ++ ++ /* HW bug in tlv length of summary report, ++ * HW report 3 DWORD size but the data payload ++ * is 4 DWORD size (16 bytes). ++ * Need to remove this workaround once HW bug fixed ++ */ ++ if (tag == ATH11K_SPECTRAL_TAG_SCAN_SUMMARY) + tlv_len = sizeof(*summary) - sizeof(*tlv) + + ab->hw_params.spectral_summary_pad_sz; ++ switch (tag) { ++ case ATH11K_SPECTRAL_TAG_SCAN_SUMMARY: + + if (tlv_len < (sizeof(*summary) - sizeof(*tlv))) { + ath11k_warn(ab, "failed to parse spectral summary at bytes %d tlv_len:%d\n", +@@ -748,6 +757,10 @@ static int ath11k_spectral_process_data( + goto err; + } + ++ ret = ath11k_dbring_validate_buffer(ar, data, tlv_len); ++ if (ret) ++ goto err; ++ + summary = (struct spectral_summary_fft_report *)tlv; + ath11k_spectral_pull_summary(ar, ¶m->meta, + summary, &summ_rpt); +@@ -804,7 +817,7 @@ static int ath11k_spectral_ring_alloc(st + ATH11K_SPECTRAL_EVENT_TIMEOUT_MS, + ath11k_spectral_process_data); + +- ret = ath11k_dbring_buf_setup(ar, &sp->rx_ring, db_cap); ++ ret = ath11k_dbring_buf_setup(ar, &sp->rx_ring, db_cap, WMI_DIRECT_BUF_SPECTRAL); + if (ret) { + ath11k_warn(ar->ab, "failed to setup db ring buffer\n"); + goto srng_cleanup; diff --git a/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-disabling-5-dot-9-channels.patch b/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-disabling-5-dot-9-channels.patch new file mode 100644 index 000000000..bc1135af3 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/234-ath11k-disabling-5-dot-9-channels.patch @@ -0,0 +1,53 @@ +From 439900d674e7dc2ea088c03c0a73ac40589534fc Mon Sep 17 00:00:00 2001 +From: Karthikeyan Kathirvel +Date: Thu, 7 Jan 2021 12:43:48 +0530 +Subject: [PATCH] ath11k: disabling 5.9Ghz channels from ath11k + +Disabling the 5.9Ghz channels based on +WMI_TLV_SERVICE_5_DOT_9GHZ_SUPPORT response from FW. + +Signed-off-by: Karthikeyan Kathirvel +--- + drivers/net/wireless/ath/ath11k/mac.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8117,6 +8117,28 @@ static void ath11k_mac_update_ch_list(st + } + } + ++#define ATH11k_5_DOT_9_MIN_FREQ 5845 ++#define ATH11k_5_DOT_9_MAX_FREQ 5885 ++ ++static void ath11k_mac_update_5_dot_9_ch_list(struct ath11k *ar, ++ struct ieee80211_supported_band *band) ++{ ++ int i; ++ ++ if (test_bit(WMI_TLV_SERVICE_5_DOT_9GHZ_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) ++ return; ++ ++ if (ar->ab->dfs_region != ATH11K_DFS_REG_FCC) ++ return; ++ ++ for (i = 0; i < band->n_channels; i++) { ++ if (band->channels[i].center_freq >= ATH11k_5_DOT_9_MIN_FREQ && ++ band->channels[i].center_freq <= ATH11k_5_DOT_9_MAX_FREQ) ++ band->channels[i].flags |= IEEE80211_CHAN_DISABLED; ++ } ++} ++ + static u32 ath11k_get_phy_id(struct ath11k *ar, u32 band) + { + struct ath11k_pdev *pdev = ar->pdev; +@@ -8222,6 +8244,8 @@ static int ath11k_mac_setup_channels_rat + ath11k_mac_update_ch_list(ar, band, + reg_cap->low_5ghz_chan, + reg_cap->high_5ghz_chan); ++ ++ ath11k_mac_update_5_dot_9_ch_list(ar, band); + } + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-001-ath11k-Add-support-for-beacon-tx-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/235-001-ath11k-Add-support-for-beacon-tx-mode.patch new file mode 100644 index 000000000..0cb6e7ced --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-001-ath11k-Add-support-for-beacon-tx-mode.patch @@ -0,0 +1,45 @@ +From a297f43a9ad6d8c95cf8b984337ffb410f3eb92c Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Tue, 12 Jan 2021 18:07:51 +0530 +Subject: [PATCH] ath11k: Add support for beacon tx mode + +User can configure the beacon tx mode while bring-up the +AP via hostapd configuration. + +Use the below configuration in the hostapd to configure +the beacon tx mode. + +"beacon_tx_mode=N", where N = 0 for STAGGERED beacon mode +and N = 1 for BURST beacon mode. + +Signed-off-by: Maharaja Kennadyrajan +--- + drivers/net/wireless/ath/ath11k/mac.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3050,7 +3050,10 @@ static void ath11k_mac_op_bss_info_chang + + if (changed & BSS_CHANGED_BEACON) { + param_id = WMI_PDEV_PARAM_BEACON_TX_MODE; +- param_value = WMI_BEACON_STAGGERED_MODE; ++ if (info->beacon_tx_mode == NL80211_BEACON_BURST_MODE) ++ param_value = WMI_BEACON_BURST_MODE; ++ else ++ param_value = WMI_BEACON_STAGGERED_MODE; + ret = ath11k_wmi_pdev_set_param(ar, param_id, + param_value, ar->pdev->pdev_id); + if (ret) +@@ -3058,8 +3061,9 @@ static void ath11k_mac_op_bss_info_chang + arvif->vdev_id); + else + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +- "Set staggered beacon mode for VDEV: %d\n", +- arvif->vdev_id); ++ "Set %s beacon mode for VDEV: %d mode: %d\n", ++ param_value ? "burst" : "staggered", ++ arvif->vdev_id, param_value); + + if (!arvif->do_not_send_tmpl || !arvif->bcca_zero_sent) { + ret = ath11k_mac_setup_bcn_tmpl(arvif); diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-001-mac80211-add-AP_VLAN-iftype-support-on-NSS-offload-case.patch b/feeds/wifi-ax/mac80211/patches/qca/235-001-mac80211-add-AP_VLAN-iftype-support-on-NSS-offload-case.patch new file mode 100644 index 000000000..977ca0611 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-001-mac80211-add-AP_VLAN-iftype-support-on-NSS-offload-case.patch @@ -0,0 +1,223 @@ +From 05d9bff2eb8b057d34c7c4b24329dd92cf4faddb Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Wed, 18 Nov 2020 23:54:38 +0530 +Subject: [PATCH 1/3] mac80211: add AP_VLAN iftype support on NSS offload case + +- allow AP_VLAN iftype to get added, removed +- add new callback for 4addr rx_notify to get AP_VLAN created from hostapd +- modify sta_use_4addr drv callback to advertise AP_VLAN vif instead of AP vif +- modify drv_tx callback to use AP_VLAN vif on NSS offload case + +Signed-off-by: Sathishkumar Muruganandam +--- + include/net/mac80211.h | 11 +++++++++++ + net/mac80211/cfg.c | 5 ++++- + net/mac80211/driver-ops.c | 9 +++++---- + net/mac80211/iface.c | 10 ++++++---- + net/mac80211/rx.c | 6 ++++++ + net/mac80211/tx.c | 14 ++++++++++---- + net/mac80211/util.c | 6 ++---- + 7 files changed, 44 insertions(+), 17 deletions(-) + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -4717,6 +4717,17 @@ void ieee80211_sta_pspoll(struct ieee802 + */ + void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, u8 tid); + ++/** ++ * ieee80211_rx_nss_notify_4addr - notify userspace about 4addr frame rx ++ * @dev: The device the frame matched to ++ * @addr: the transmitter address of 4addr sta ++ * ++ * When operating in AP mode with NSS offload enabled, this function is used ++ * to invoke cfg80211 callback to notify userspace that an associated station ++ * sent a 4addr frame. ++ */ ++void ieee80211_rx_nss_notify_4addr(struct net_device *dev, u8* sta_addr); ++ + /* + * The TX headroom reserved by mac80211 for its own tx_status functions. + * This is enough for the radiotap header. +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1952,7 +1952,13 @@ static int ieee80211_change_station(stru + + rcu_assign_pointer(vlansdata->u.vlan.sta, sta); + __ieee80211_check_fast_rx_iface(vlansdata); +- drv_sta_set_4addr(local, sta->sdata, &sta->sta, true); ++ ++ if (ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) ++ drv_sta_set_4addr(local, vlansdata, &sta->sta, ++ true); ++ else ++ drv_sta_set_4addr(local, sta->sdata, &sta->sta, ++ true); + } + + if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -56,10 +56,9 @@ int drv_add_interface(struct ieee80211_l + + might_sleep(); + +- if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN || +- (sdata->vif.type == NL80211_IFTYPE_MONITOR && ++ if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_MONITOR && + !ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF) && +- !(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)))) ++ !(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE))) + return -EINVAL; + + trace_drv_add_interface(local, sdata); +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -613,6 +613,9 @@ static void ieee80211_do_stop(struct iee + + switch (sdata->vif.type) { + case NL80211_IFTYPE_AP_VLAN: ++ if (ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD) && ++ going_down) ++ drv_remove_interface(local, sdata); + break; + case NL80211_IFTYPE_MONITOR: + if (local->monitors == 0) +@@ -861,6 +864,7 @@ static bool ieee80211_iftype_supports_hd + switch (iftype) { + /* P2P GO and client are mapped to AP/STATION types */ + case NL80211_IFTYPE_AP: ++ case NL80211_IFTYPE_AP_VLAN: + case NL80211_IFTYPE_STATION: + return true; + default: +@@ -915,7 +919,8 @@ static void ieee80211_set_vif_encap_ops( + struct ieee80211_sub_if_data *bss = sdata; + bool enabled; + +- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { + if (!sdata->bss) + return; + +@@ -1237,10 +1242,17 @@ int ieee80211_do_open(struct wireless_de + + switch (sdata->vif.type) { + case NL80211_IFTYPE_AP_VLAN: +- /* no need to tell driver, but set carrier and chanctx */ + if (rtnl_dereference(sdata->bss->beacon)) { + ieee80211_vif_vlan_copy_chanctx(sdata); + netif_carrier_on(dev); ++ ++ if (ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { ++ ieee80211_set_sdata_offload_flags(sdata); ++ res = drv_add_interface(local, sdata); ++ if (res) ++ goto err_del_interface; ++ } ++ + ieee80211_set_vif_encap_ops(sdata); + } else { + netif_carrier_off(dev); +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -1662,6 +1662,12 @@ void ieee80211_sta_uapsd_trigger(struct + } + EXPORT_SYMBOL(ieee80211_sta_uapsd_trigger); + ++void ieee80211_rx_nss_notify_4addr(struct net_device *dev, u8 *sta_addr) ++{ ++ cfg80211_rx_unexpected_4addr_frame(dev, sta_addr, GFP_ATOMIC); ++} ++EXPORT_SYMBOL(ieee80211_rx_nss_notify_4addr); ++ + static ieee80211_rx_result debug_noinline + ieee80211_rx_h_uapsd_and_pspoll(struct ieee80211_rx_data *rx) + { +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3951,8 +3951,13 @@ void __ieee80211_subif_start_xmit(struct + atomic_inc(&sta->tx_netif_pkts); + + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +- ap_sdata = container_of(sdata->bss, +- struct ieee80211_sub_if_data, u.ap); ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) ++ ap_sdata = container_of(sdata->bss, ++ struct ieee80211_sub_if_data, ++ u.ap); ++ else ++ ap_sdata = sdata; ++ + if (ap_sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED && + !is_multicast_ether_addr(skb->data)) { + if (sta) +@@ -4290,7 +4295,8 @@ static void ieee80211_8023_xmit(struct i + sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; + } + +- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) + sdata = container_of(sdata->bss, + struct ieee80211_sub_if_data, u.ap); + +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -2193,6 +2193,10 @@ static void ieee80211_assign_chanctx(str + if (!local->use_chanctx) + return; + ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) ++ return; ++ + mutex_lock(&local->chanctx_mtx); + conf = rcu_dereference_protected(sdata->vif.chanctx_conf, + lockdep_is_held(&local->chanctx_mtx)); +@@ -2368,7 +2372,8 @@ int ieee80211_reconfig(struct ieee80211_ + } + + list_for_each_entry(sdata, &local->interfaces, list) { +- if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && ++ if ((sdata->vif.type != NL80211_IFTYPE_AP_VLAN || ++ ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) && + sdata->vif.type != NL80211_IFTYPE_MONITOR && + ieee80211_sdata_running(sdata)) { + res = drv_add_interface(local, sdata); +@@ -2383,7 +2388,8 @@ int ieee80211_reconfig(struct ieee80211_ + if (res) { + list_for_each_entry_continue_reverse(sdata, &local->interfaces, + list) +- if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && ++ if ((sdata->vif.type != NL80211_IFTYPE_AP_VLAN || ++ ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) && + sdata->vif.type != NL80211_IFTYPE_MONITOR && + ieee80211_sdata_running(sdata)) + drv_remove_interface(local, sdata); +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -3665,7 +3665,8 @@ static bool ieee80211_assoc_success(stru + * If we're using 4-addr mode, let the AP know that we're + * doing so, so that it can create the STA VLAN on its side + */ +- if (ifmgd->use_4addr) ++ if (ifmgd->use_4addr && ++ (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD))) + ieee80211_send_4addr_nullfunc(local, sdata); + + /* +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -1420,7 +1420,9 @@ static inline void drv_sta_set_4addr(str + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, bool enabled) + { +- sdata = get_bss_sdata(sdata); ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) ++ sdata = get_bss_sdata(sdata); ++ + if (!check_sdata_in_driver(sdata)) + return; + diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-002-ath11k-add-support-for-ext-vdev-in-NSS-for-AP_VLAN-vif-handling.patch b/feeds/wifi-ax/mac80211/patches/qca/235-002-ath11k-add-support-for-ext-vdev-in-NSS-for-AP_VLAN-vif-handling.patch new file mode 100644 index 000000000..e54789445 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-002-ath11k-add-support-for-ext-vdev-in-NSS-for-AP_VLAN-vif-handling.patch @@ -0,0 +1,774 @@ +From 83c2a029a5300b2aaeaa9855011668b407d142c2 Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Fri, 20 Nov 2020 11:41:11 +0530 +Subject: [PATCH 2/3] ath11k: add support for ext vdev in NSS for AP_VLAN vif + handling + +- add ext vdev NSS API callbacks required for AP_VLAN vif +- invoke ieee80211_rx_nss_notify_4addr on WDS Rx path for 4addr frames until + ext vdev interface is UP +- do ext vdev down of all AP_VLAN vifs upon vdev down of associated AP vif + +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/nss.c | 452 ++++++++++++++++++++++++++++++++-- + drivers/net/wireless/ath/ath11k/nss.h | 57 +++++ + 2 files changed, 495 insertions(+), 14 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -322,6 +322,10 @@ void ath11k_nss_wifili_event_receive(str + ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, "nss wifili wds peer del event received %d response %d error %d\n", + msg_type, response, error); + break; ++ case NSS_WIFILI_PEER_4ADDR_EVENT_MSG: ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, "nss wifili peer 4addr event received %d response %d error %d\n", ++ msg_type, response, error); ++ break; + default: + ath11k_dbg(ab, ATH11K_DBG_NSS, "unhandled event %d\n", msg_type); + break; +@@ -555,8 +559,9 @@ static int ath11k_nss_undecap_nwifi(stru + return 0; + } + +-static void ath11k_nss_wds_type_rx(struct ath11k *ar, u8* src_mac, u8 is_sa_valid, +- u8 addr4_valid, u16 peer_id) ++static void ath11k_nss_wds_type_rx(struct ath11k *ar, struct net_device *dev, ++ u8* src_mac, u8 is_sa_valid, u8 addr4_valid, ++ u16 peer_id, bool *drop) + { + struct ath11k_base *ab = ar->ab; + struct ath11k_ast_entry *ast_entry = NULL; +@@ -578,19 +583,22 @@ static void ath11k_nss_wds_type_rx(struc + if (!is_sa_valid) { + ath11k_peer_add_ast(ar, ta_peer, src_mac, + ATH11K_AST_TYPE_WDS); +- ath11k_nss_add_wds_peer(ar, ta_peer, +- src_mac, ATH11K_AST_TYPE_WDS); ++ if (!ta_peer->nss.ext_vdev_up) ++ ieee80211_rx_nss_notify_4addr(dev, ta_peer->addr); + } else { + if (!ast_entry) { + ath11k_peer_add_ast(ar, ta_peer, src_mac, + ATH11K_AST_TYPE_WDS); +- ath11k_nss_add_wds_peer(ar, ta_peer, src_mac, +- ATH11K_AST_TYPE_WDS); +- } else { ++ if (!ta_peer->nss.ext_vdev_up) ++ ieee80211_rx_nss_notify_4addr(dev, ta_peer->addr); ++ } else if (ast_entry->type == ATH11K_AST_TYPE_WDS) { + ath11k_peer_update_ast(ar, ta_peer, ast_entry); + ath11k_nss_update_wds_peer(ar, ta_peer, src_mac); + } + } ++ ++ if (!ta_peer->nss.ext_vdev_up) ++ drop = true; + } + + spin_unlock_bh(&ab->base_lock); +@@ -634,7 +642,8 @@ static void ath11k_nss_mec_handler(struc + + static void ath11k_nss_vdev_spl_receive_ext_wdsdata(struct ath11k_vif *arvif, + struct sk_buff *skb, +- struct nss_wifi_vdev_wds_per_packet_metadata *wds_metadata) ++ struct nss_wifi_vdev_wds_per_packet_metadata *wds_metadata, ++ bool *drop) + { + struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; +@@ -655,8 +664,8 @@ static void ath11k_nss_vdev_spl_receive_ + + switch (wds_type) { + case NSS_WIFI_VDEV_WDS_TYPE_RX: +- ath11k_nss_wds_type_rx(ar, src_mac, is_sa_valid, +- addr4_valid, peer_id); ++ ath11k_nss_wds_type_rx(ar, skb->dev, src_mac, is_sa_valid, ++ addr4_valid, peer_id, &drop); + break; + case NSS_WIFI_VDEV_WDS_TYPE_MEC: + ath11k_nss_mec_handler(ar, (u8 *)(skb->data)); +@@ -723,6 +732,7 @@ ath11k_nss_vdev_special_data_receive(str + struct ieee80211_vif *vif; + struct ath11k_vif *arvif; + struct ath11k_base *ab; ++ bool drop = false; + bool eth_decap = false; + int data_offs = 0; + int ret = 0; +@@ -773,10 +783,11 @@ ath11k_nss_vdev_special_data_receive(str + NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN) { + wds_metadata = &wifi_metadata->metadata.wds_metadata; + ath11k_nss_vdev_spl_receive_ext_wdsdata(arvif, skb, +- wds_metadata); ++ wds_metadata, &drop); + } + +- ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); ++ if (!drop) ++ ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); + } + + static void +@@ -839,6 +850,68 @@ ath11k_nss_vdev_data_receive(struct net_ + ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); + } + ++static void ++ath11k_nss_ext_vdev_special_data_receive(struct net_device *dev, ++ struct sk_buff *skb, ++ __attribute__((unused)) struct napi_struct *napi) ++{ ++ dev_kfree_skb_any(skb); ++} ++ ++static void ++ath11k_nss_ext_vdev_data_receive(struct net_device *dev, struct sk_buff *skb, ++ __attribute__((unused)) struct napi_struct *napi) ++{ ++ struct wireless_dev *wdev; ++ struct ieee80211_vif *vif; ++ struct ath11k_vif *arvif; ++ struct ath11k_base *ab; ++ bool eth_decap = false; ++ int data_offs = 0; ++ int ret; ++ ++ if (!dev) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ wdev = dev->ieee80211_ptr; ++ if (!wdev) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ vif = wdev_to_ieee80211_vif(wdev); ++ if (!vif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ arvif = (struct ath11k_vif *)vif->drv_priv; ++ if (!arvif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ab = arvif->ar->ab; ++ ++ skb->dev = dev; ++ ++ /* log the original skb received from nss */ ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss ext : ", ++ skb->data, skb->len); ++ ++ ret = ath11k_nss_undecap(arvif, skb, &data_offs, ð_decap); ++ if (ret) { ++ ath11k_warn(ab, "error in nss ext rx undecap, type %d err %d\n", ++ arvif->nss.decap, ret); ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); ++} ++ + int ath11k_nss_tx(struct ath11k_vif *arvif, struct sk_buff *skb) + { + struct ath11k *ar = arvif->ar; +@@ -861,10 +934,16 @@ int ath11k_nss_tx(struct ath11k_vif *arv + ath11k_nss_tx_encap_nwifi(skb); + + send: +- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, "", "nss tx msdu: ", +- skb->data, skb->len); +- +- status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, arvif->nss.if_num); ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, ++ arvif->vif->type == NL80211_IFTYPE_AP_VLAN ? "ext vdev" : "", ++ "nss tx msdu: ", skb->data, skb->len); ++ ++ if (arvif->vif->type == NL80211_IFTYPE_AP_VLAN) ++ status = nss_wifi_ext_vdev_tx_buf(arvif->nss.ctx, skb, ++ arvif->nss.if_num); ++ else ++ status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, ++ arvif->nss.if_num); + + if (status != NSS_TX_SUCCESS) { + ath11k_dbg(ar->ab, (ATH11K_DBG_NSS | ATH11K_DBG_DP_TX), +@@ -1195,6 +1274,7 @@ int ath11k_nss_vdev_up(struct ath11k_vif + struct nss_wifi_vdev_msg *vdev_msg = NULL; + struct nss_wifi_vdev_enable_msg *vdev_en; + struct ath11k *ar = arvif->ar; ++ struct ath11k_vif *ap_vlan_arvif, *tmp; + nss_tx_status_t status; + int ret = 0; + +@@ -1229,6 +1309,12 @@ int ath11k_nss_vdev_up(struct ath11k_vif + } + + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss vdev up tx msg success\n"); ++ ++ if (arvif->vif->type == NL80211_IFTYPE_AP) ++ list_for_each_entry_safe(ap_vlan_arvif, tmp, &arvif->ap_vlan_arvifs, ++ list) ++ if (ap_vlan_arvif->nss.added) ++ ath11k_nss_ext_vdev_up(ap_vlan_arvif); + free: + ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, + sizeof(struct nss_wifi_vdev_msg)); +@@ -1240,6 +1326,7 @@ int ath11k_nss_vdev_down(struct ath11k_v + { + struct nss_wifi_vdev_msg *vdev_msg = NULL; + struct ath11k *ar = arvif->ar; ++ struct ath11k_vif *ap_vlan_arvif, *tmp; + nss_tx_status_t status; + int ret = 0; + +@@ -1269,6 +1356,11 @@ int ath11k_nss_vdev_down(struct ath11k_v + } + + ath11k_dbg(ar->ab, ATH11K_DBG_NSS, "nss vdev down tx msg success\n"); ++ ++ if (arvif->vif->type == NL80211_IFTYPE_AP) ++ list_for_each_entry_safe(ap_vlan_arvif, tmp, &arvif->ap_vlan_arvifs, ++ list) ++ ath11k_nss_ext_vdev_down(ap_vlan_arvif); + free: + ATH11K_MEMORY_STATS_DEC(ar->ab, malloc_size, + sizeof(struct nss_wifi_vdev_msg)); +@@ -1276,6 +1368,352 @@ free: + return ret; + } + ++int ath11k_nss_ext_vdev_cfg_wds_peer(struct ath11k_vif *arvif, ++ u8 *wds_addr, u32 wds_peer_id) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct nss_wifi_ext_vdev_msg *ext_vdev_msg = NULL; ++ struct nss_wifi_ext_vdev_wds_msg *cfg_wds_msg = NULL; ++ nss_tx_status_t status; ++ int ret; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ ext_vdev_msg = kzalloc(sizeof(struct nss_wifi_ext_vdev_msg), GFP_ATOMIC); ++ if (!ext_vdev_msg) ++ return -ENOMEM; ++ ++ cfg_wds_msg = &ext_vdev_msg->msg.wmsg; ++ cfg_wds_msg->wds_peer_id = wds_peer_id; ++ ether_addr_copy(cfg_wds_msg->mac_addr, wds_addr); ++ ++ nss_wifi_ext_vdev_msg_init(ext_vdev_msg, arvif->nss.if_num, ++ NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_WDS, ++ sizeof(struct nss_wifi_ext_vdev_wds_msg), ++ NULL, arvif); ++ ++ status = nss_wifi_ext_vdev_tx_msg_sync(arvif->nss.ctx, ext_vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "failed to configure wds peer nss_err:%d\n", ++ status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ret = 0; ++free: ++ kfree(ext_vdev_msg); ++ ++ return ret; ++} ++ ++int ath11k_nss_ext_vdev_wds_4addr_allow(struct ath11k_vif *arvif, ++ u32 wds_peer_id) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct nss_wifili_peer_wds_4addr_allow_msg *cfg_4addr_msg = NULL; ++ nss_wifili_msg_callback_t msg_cb; ++ struct nss_wifili_msg *wlmsg; ++ nss_tx_status_t status; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); ++ if (!wlmsg) ++ return -ENOMEM; ++ ++ cfg_4addr_msg = &wlmsg->msg.wpswm; ++ cfg_4addr_msg->peer_id = wds_peer_id; ++ cfg_4addr_msg->if_num = arvif->nss.if_num; ++ cfg_4addr_msg->enable = true; ++ ++ msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; ++ ++ nss_cmn_msg_init(&wlmsg->cm, ar->ab->nss.if_num, ++ NSS_WIFILI_PEER_4ADDR_EVENT_MSG, ++ sizeof(struct nss_wifili_peer_wds_4addr_allow_msg), ++ msg_cb, NULL); ++ ++ status = nss_wifili_tx_msg(ar->nss.ctx, wlmsg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss wds 4addr allow if_num %d, peer_id %d cfg fail: %d\n", ++ arvif->nss.if_num, wds_peer_id, status); ++ goto free; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_WDS, "nss wds 4addr allow if_num %d, peer_id %d cfg complete\n", ++ arvif->nss.if_num, wds_peer_id); ++free: ++ kfree(wlmsg); ++ return status; ++} ++ ++int ath11k_nss_ext_vdev_configure(struct ath11k_vif *arvif) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_vif *ap_vif = arvif->nss.ap_vif; ++ struct nss_wifi_ext_vdev_msg *ext_vdev_msg = NULL; ++ struct nss_wifi_ext_vdev_configure_if_msg *ext_vdev_cfg = NULL; ++ nss_tx_status_t status; ++ int ret; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ ext_vdev_msg = kzalloc(sizeof(struct nss_wifi_ext_vdev_msg), GFP_ATOMIC); ++ if (!ext_vdev_msg) ++ return -ENOMEM; ++ ++ ext_vdev_cfg = &ext_vdev_msg->msg.cmsg; ++ ++ ext_vdev_cfg->radio_ifnum = ar->nss.if_num; ++ ext_vdev_cfg->pvap_ifnum = ap_vif->nss.if_num; ++ ++ ether_addr_copy(ext_vdev_cfg->mac_addr, arvif->vif->addr); ++ ++ nss_wifi_ext_vdev_msg_init(ext_vdev_msg, arvif->nss.if_num, ++ NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_IF, ++ sizeof(struct nss_wifi_ext_vdev_configure_if_msg), ++ NULL, arvif); ++ ++ status = nss_wifi_ext_vdev_tx_msg_sync(arvif->ar->nss.ctx, ext_vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "failed to configure nss ext vdev nss_err:%d\n", ++ status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ret = 0; ++free: ++ kfree(ext_vdev_msg); ++ ++ return ret; ++} ++ ++void ath11k_nss_ext_vdev_unregister(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return; ++ ++ nss_wifi_ext_vdev_unregister_if(arvif->nss.if_num); ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, "unregistered nss vdev %d \n", ++ arvif->nss.if_num); ++} ++ ++static int ath11k_nss_ext_vdev_register(struct ath11k_vif *arvif, ++ struct net_device *netdev) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_base *ab = ar->ab; ++ nss_tx_status_t status; ++ enum nss_dynamic_interface_type di_type; ++ u32 features = 0; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN || arvif->nss.ctx) ++ return -EINVAL; ++ ++ di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS; ++ ++ arvif->nss.ctx = nss_wifi_ext_vdev_register_if(arvif->nss.if_num, ++ ath11k_nss_ext_vdev_data_receive, ++ ath11k_nss_ext_vdev_special_data_receive, ++ NULL, netdev, features, ++ arvif); ++ ++ if (!arvif->nss.ctx) { ++ ath11k_warn(ab, "failed to register nss vdev if_num %d nss_err:%d\n", ++ arvif->nss.if_num, status); ++ return -EINVAL; ++ } ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, "registered nss ext vdev if_num %d\n", ++ arvif->nss.if_num); ++ return 0; ++} ++ ++static void ath11k_nss_ext_vdev_free(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ nss_tx_status_t status; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return; ++ ++ status = nss_dynamic_interface_dealloc_node( ++ arvif->nss.if_num, ++ NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS); ++ if (status != NSS_TX_SUCCESS) ++ ath11k_warn(ab, "failed to free nss ext vdev err:%d\n", ++ status); ++ else ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, ++ "nss ext vdev interface deallocated\n"); ++} ++ ++static int ath11k_nss_ext_vdev_alloc(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ enum nss_dynamic_interface_type di_type; ++ int if_num; ++ ++ di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS; ++ ++ if_num = nss_dynamic_interface_alloc_node(di_type); ++ if (if_num < 0) { ++ ath11k_warn(ab, "failed to allocate nss ext vdev\n"); ++ return -EINVAL; ++ } ++ ++ arvif->nss.if_num = if_num; ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, ++ "nss ext vdev interface %pM allocated if_num %d\n", ++ arvif->vif->addr, if_num); ++ ++ return 0; ++} ++ ++int ath11k_nss_ext_vdev_create(struct ath11k_vif *arvif) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_base *ab = ar->ab; ++ struct wireless_dev *wdev; ++ int ret; ++ ++ if (!ab->nss.enabled) ++ return 0; ++ ++ if (arvif->nss.created) ++ return 0; ++ ++ wdev = ieee80211_vif_to_wdev_relaxed(arvif->vif); ++ if (!wdev) { ++ ath11k_warn(ab, "ath11k_nss: ext wdev is null\n"); ++ return -EINVAL; ++ } ++ ++ if (!wdev->netdev) { ++ ath11k_warn(ab, "ath11k_nss: ext netdev is null\n"); ++ return -EINVAL; ++ } ++ ++ ret = ath11k_nss_ext_vdev_alloc(arvif); ++ if (ret) ++ return ret; ++ ++ ret = ath11k_nss_ext_vdev_register(arvif, wdev->netdev); ++ if (ret) ++ goto free_ext_vdev; ++ ++ arvif->nss.created = true; ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, ++ "nss ext vdev interface created ctx %pK, ifnum %d\n", ++ arvif->nss.ctx, arvif->nss.if_num); ++ ++ return ret; ++ ++free_ext_vdev: ++ ath11k_nss_ext_vdev_free(arvif); ++ ++ return ret; ++} ++ ++void ath11k_nss_ext_vdev_delete(struct ath11k_vif *arvif) ++{ ++ if (!arvif->ar->ab->nss.enabled) ++ return; ++ ++ if (!arvif->nss.created) ++ return; ++ ++ ath11k_dbg(arvif->ar->ab, ATH11K_DBG_NSS_WDS, ++ "nss ext vdev interface delete ctx %pK, ifnum %d\n", ++ arvif->nss.ctx, arvif->nss.if_num); ++ ++ ath11k_nss_ext_vdev_unregister(arvif); ++ ++ ath11k_nss_ext_vdev_free(arvif); ++ ++ arvif->nss.created = false; ++} ++ ++int ath11k_nss_ext_vdev_up(struct ath11k_vif *arvif) ++{ ++ struct nss_wifi_ext_vdev_msg *ext_vdev_msg = NULL; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ if (arvif->nss.ext_vdev_up) ++ return 0; ++ ++ ext_vdev_msg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_ATOMIC); ++ if (!ext_vdev_msg) ++ return -ENOMEM; ++ ++ nss_wifi_ext_vdev_msg_init(ext_vdev_msg, arvif->nss.if_num, NSS_IF_OPEN, ++ sizeof(struct nss_if_open), NULL, arvif); ++ ++ status = nss_wifi_ext_vdev_tx_msg_sync(arvif->nss.ctx, ext_vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss ext vdev up tx msg error %d\n", status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_WDS, "nss ext vdev up tx msg success\n"); ++ arvif->nss.ext_vdev_up = true; ++free: ++ kfree(ext_vdev_msg); ++ return ret; ++} ++ ++int ath11k_nss_ext_vdev_down(struct ath11k_vif *arvif) ++{ ++ struct nss_wifi_ext_vdev_msg *ext_vdev_msg = NULL; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ ext_vdev_msg = kzalloc(sizeof(struct nss_wifi_ext_vdev_msg), GFP_ATOMIC); ++ if (!ext_vdev_msg) ++ return -ENOMEM; ++ ++ nss_wifi_ext_vdev_msg_init(ext_vdev_msg, arvif->nss.if_num, NSS_IF_CLOSE, ++ sizeof(struct nss_if_close), NULL, arvif); ++ ++ status = nss_wifi_ext_vdev_tx_msg_sync(arvif->nss.ctx, ext_vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss ext vdev down tx msg error %d\n", status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_WDS, "nss ext vdev down tx msg success\n"); ++ ++ arvif->nss.ext_vdev_up = false; ++free: ++ kfree(ext_vdev_msg); ++ return ret; ++} ++ + /*----------------------------Peer Setup/Config -----------------------------*/ + + int ath11k_nss_set_peer_sec_type(struct ath11k *ar, +@@ -1374,23 +1812,22 @@ free: + return status; + } + +-void ath11k_nss_update_sta_stats(struct station_info *sinfo, +- struct ieee80211_sta *sta, +- struct ath11k_sta *arsta) ++void ath11k_nss_update_sta_stats(struct ath11k_vif *arvif, ++ struct station_info *sinfo, ++ struct ieee80211_sta *sta) + { + struct sta_info *stainfo; + struct ath11k_peer *peer; +- int tid_idx; +- struct ath11k *ar = arsta->arvif->ar; ++ struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + +- if (!ab->nss.enabled) ++ if (!ab->nss.stats_enabled) + return; + + spin_lock_bh(&ab->base_lock); +- peer = ath11k_peer_find_by_addr(arsta->arvif->ar->ab, sta->addr); ++ peer = ath11k_peer_find_by_addr(ab, sta->addr); + if (!peer) { +- ath11k_dbg(ab, ATH11K_DBG_NSS, "unable to find peer %pM\n", ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "sta stats: unable to find peer %pM\n", + sta->addr); + goto exit; + } +@@ -1461,12 +1898,12 @@ exit: + void ath11k_nss_update_sta_rxrate(struct hal_rx_mon_ppdu_info *ppdu_info, + struct ath11k_peer *peer) + { +- struct ath11k_sta *arsta = (struct ath11k_sta *)peer->sta->drv_priv; + u16 ath11k_hal_rx_legacy_rates[] = + { 10, 20, 55, 60, 90, 110, 120, 180, 240, 360, 480, 540 }; + u16 rate = 0; + u16 num_msdu; +- struct ath11k *ar = arsta->arvif->ar; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(peer->vif); ++ struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + + if (!ab->nss.enabled) +@@ -1745,8 +2182,8 @@ int ath11k_nss_add_wds_peer(struct ath11 + } + + ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, +- "nss add wds peer success peer mac:%pM dest mac:%pM peer_id:%d\n", +- wds_peer_msg->peer_mac, wds_peer_msg->dest_mac, wds_peer_msg->peer_id); ++ "nss add wds peer success pdev:%d peer mac:%pM dest mac:%pM peer_id:%d\n", ++ wds_peer_msg->pdev_id, wds_peer_msg->peer_mac, wds_peer_msg->dest_mac, wds_peer_msg->peer_id); + + msg_free: + kfree(wlmsg); +@@ -1791,8 +2228,8 @@ int ath11k_nss_update_wds_peer(struct at + } + + ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, +- "nss update wds peer success peer mac:%pM dest mac:%pM peer_id:%d\n", +- wds_peer_msg->peer_mac, wds_peer_msg->dest_mac, wds_peer_msg->peer_id); ++ "nss update wds peer success pdev:%d peer mac:%pM dest mac:%pM peer_id:%d\n", ++ wds_peer_msg->pdev_id, wds_peer_msg->peer_mac, wds_peer_msg->dest_mac, wds_peer_msg->peer_id); + + msg_free: + kfree(wlmsg); +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -141,6 +141,7 @@ enum ath11k_nss_peer_sec_type { + struct ath11k_nss_peer { + uint32_t *vaddr; + dma_addr_t paddr; ++ bool ext_vdev_up; + struct peer_stats *nss_stats; + struct completion complete; + }; +@@ -155,6 +156,16 @@ struct arvif_nss { + int encap; + /* Keep the copy of decap type for nss */ + int decap; ++ /* AP_VLAN vif context obtained on ext vdev register */ ++ void* ctx; ++ /* Parent AP vif stored in case of AP_VLAN vif */ ++ struct ath11k_vif *ap_vif; ++ /* Flag to notify if vlan arvif object is added to arvif list*/ ++ bool added; ++ /* Flag to notify if ext vdev is up/down */ ++ bool ext_vdev_up; ++ /* WDS cfg should be done only once for ext vdev */ ++ bool wds_cfg_done; + bool created; + }; + +@@ -209,11 +220,21 @@ int ath11k_nss_map_wds_peer(struct ath11 + u8 *dest_mac, enum ath11k_ast_entry_type type); + int ath11k_nss_del_wds_peer(struct ath11k *ar, struct ath11k_peer *peer, + u8 *dest_mac); ++int ath11k_nss_ext_vdev_cfg_wds_peer(struct ath11k_vif *arvif, ++ u8 *wds_addr, u32 wds_peer_id); ++int ath11k_nss_ext_vdev_wds_4addr_allow(struct ath11k_vif *arvif, ++ u32 wds_peer_id); ++int ath11k_nss_ext_vdev_create(struct ath11k_vif *arvif); ++int ath11k_nss_ext_vdev_configure(struct ath11k_vif *arvif); ++void ath11k_nss_ext_vdev_unregister(struct ath11k_vif *arvif); ++int ath11k_nss_ext_vdev_up(struct ath11k_vif *arvif); ++int ath11k_nss_ext_vdev_down(struct ath11k_vif *arvif); ++void ath11k_nss_ext_vdev_delete(struct ath11k_vif *arvif); + int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, + struct ieee80211_key_conf *key_conf); +-void ath11k_nss_update_sta_stats(struct station_info *sinfo, +- struct ieee80211_sta *sta, +- struct ath11k_sta *arsta); ++void ath11k_nss_update_sta_stats(struct ath11k_vif *arvif, ++ struct station_info *sinfo, ++ struct ieee80211_sta *sta); + void ath11k_nss_update_sta_rxrate(struct hal_rx_mon_ppdu_info *ppdu_info, + struct ath11k_peer *peer); + int ath11k_nss_setup(struct ath11k_base *ab); +@@ -244,9 +265,9 @@ static inline void ath11k_nss_vdev_delet + { + } + +-static inline void ath11k_nss_update_sta_stats(struct station_info *sinfo, +- struct ieee80211_sta *sta, +- struct ath11k_sta *arsta) ++static inline void ath11k_nss_update_sta_stats(struct ath11k_vif *arvif, ++ struct station_info *sinfo, ++ struct ieee80211_sta *sta) + { + return; + } +@@ -301,6 +322,43 @@ static inline int ath11k_nss_peer_create + { + return 0; + } ++ ++static inline int ath11k_nss_ext_vdev_cfg_wds_peer(struct ath11k_vif *arvif, ++ u8 *wds_addr, u32 wds_peer_id) ++{ ++ return 0; ++} ++ ++static inline int ath11k_nss_ext_vdev_wds_4addr_allow(struct ath11k_vif *arvif, ++ u32 wds_peer_id) ++{ ++ return 0; ++} ++ ++static inline int ath11k_nss_ext_vdev_create(struct ath11k_vif *arvif) ++{ ++ return 0; ++} ++ ++static inline int ath11k_nss_ext_vdev_configure(struct ath11k_vif *arvif) ++{ ++ return 0; ++} ++ ++static inline void ath11k_nss_ext_vdev_unregister(struct ath11k_vif *arvif) ++{ ++ return; ++} ++ ++static inline int ath11k_nss_ext_vdev_up(struct ath11k_vif *arvif) ++{ ++ return 0; ++} ++ ++static inline int ath11k_nss_ext_vdev_down(struct ath11k_vif *arvif) ++{ ++ return 0; ++} + + static inline void ath11k_nss_peer_stats_enable(struct ath11k *ar) + { diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-002-mac80211-Add-support-for-beacon-tx-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/235-002-mac80211-Add-support-for-beacon-tx-mode.patch new file mode 100644 index 000000000..4bc1c6223 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-002-mac80211-Add-support-for-beacon-tx-mode.patch @@ -0,0 +1,160 @@ +From f8e7ec408c357d6438abd980f700353a7efcac7e Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Tue, 12 Jan 2021 18:11:33 +0530 +Subject: [PATCH] mac80211: Add support for beacon tx mode + +User can configure the beacon tx mode while bring-up the +AP via hostapd configuration. + +Use the below configuration in the hostapd to configure +the beacon tx mode. + +"beacon_tx_mode=N", where N = 0 for STAGGERED beacon mode +and N = 1 for BURST beacon mode. + +Signed-off-by: Maharaja Kennadyrajan +--- + include/net/cfg80211.h | 2 +- + include/net/mac80211.h | 1 + + include/uapi/linux/nl80211.h | 2 ++ + net/mac80211/cfg.c | 1 + + net/wireless/nl80211.c | 7 ++++++- + 5 files changed, 11 insertions(+), 2 deletions(-) + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1233,6 +1233,7 @@ enum cfg80211_ap_settings_flags { + * @he_bss_color: BSS Color settings + * @he_oper: HE operation IE (or %NULL if HE isn't enabled) + * @multiple_bssid: AP settings for multiple bssid ++ * @beacon_tx_mode: Beacon Tx Mode setting + */ + struct cfg80211_ap_settings { + struct cfg80211_chan_def chandef; +@@ -1264,6 +1265,7 @@ struct cfg80211_ap_settings { + struct ieee80211_he_obss_pd he_obss_pd; + struct cfg80211_he_bss_color he_bss_color; + struct ieee80211_multiple_bssid multiple_bssid; ++ enum nl80211_beacon_tx_mode beacon_tx_mode; + }; + + /** +@@ -2132,6 +2134,7 @@ struct mesh_config { + * to operate on DFS channels. + * @control_port_over_nl80211: TRUE if userspace expects to exchange control + * port frames over NL80211 instead of the network interface. ++ * @beacon_tx_mode: Beacon Tx Mode setting. + * + * These parameters are fixed when the mesh is created. + */ +@@ -2155,6 +2158,7 @@ struct mesh_setup { + struct cfg80211_bitrate_mask beacon_rate; + bool userspace_handles_dfs; + bool control_port_over_nl80211; ++ enum nl80211_beacon_tx_mode beacon_tx_mode; + }; + + /** +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -647,6 +647,7 @@ struct ieee80211_fils_discovery { + * to driver when rate control is offloaded to firmware. + * @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature + * @multiple_bssid: the multiple bssid settings of the AP. ++ * @beacon_tx_mode: Beacon Tx Mode setting. + */ + struct ieee80211_bss_conf { + const u8 *bssid; +@@ -719,6 +720,7 @@ struct ieee80211_bss_conf { + struct cfg80211_bitrate_mask beacon_tx_rate; + bool nss_ap_isolate; + struct ieee80211_multiple_bssid multiple_bssid; ++ enum nl80211_beacon_tx_mode beacon_tx_mode; + }; + + /** +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -2636,7 +2636,9 @@ enum nl80211_commands { + * The last additional RNR group, if present, points to information + * for co-located APs and neighbor APs in ESS to be added in all + * EMA beacons. +- * ++ * @NL80211_ATTR_BEACON_TX_MODE: used to configure the beacon tx mode as ++ * staggered mode = 1 or burst mode = 2 in %NL80211_CMD_START_AP or ++ * %NL80211_CMD_JOIN_MESH from user-space. + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3150,6 +3152,8 @@ enum nl80211_attrs { + + NL80211_ATTR_RNR_OFFSETS, + ++ NL80211_ATTR_BEACON_TX_MODE, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -7412,4 +7416,12 @@ enum nl80211_sar_specs_attrs { + NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, + }; + ++/** ++ * enum nl80211_beacon_tx_mode - Beacon Tx Mode enum. ++ * Used to configure beacon staggered mode or beacon burst mode. ++ */ ++enum nl80211_beacon_tx_mode { ++ NL80211_BEACON_STAGGERED_MODE = 1, ++ NL80211_BEACON_BURST_MODE = 2, ++}; + #endif /* __LINUX_NL80211_H */ +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1228,6 +1228,7 @@ static int ieee80211_start_ap(struct wip + + prev_beacon_int = sdata->vif.bss_conf.beacon_int; + sdata->vif.bss_conf.beacon_int = params->beacon_interval; ++ sdata->vif.bss_conf.beacon_tx_mode = params->beacon_tx_mode; + + if (params->he_cap && params->he_oper) { + sdata->vif.bss_conf.he_support = true; +@@ -2256,6 +2257,7 @@ static int copy_mesh_setup(struct ieee80 + + sdata->vif.bss_conf.beacon_int = setup->beacon_interval; + sdata->vif.bss_conf.dtim_period = setup->dtim_period; ++ sdata->vif.bss_conf.beacon_tx_mode = setup->beacon_tx_mode; + + sdata->beacon_rate_set = false; + if (wiphy_ext_feature_isset(sdata->local->hw.wiphy, +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -794,6 +794,8 @@ static const struct nla_policy nl80211_p + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, + [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES] = NLA_POLICY_NESTED(nl80211_policy), + [NL80211_ATTR_RNR_OFFSETS] = NLA_POLICY_NESTED(nl80211_rnr_ies_policy), ++ [NL80211_ATTR_BEACON_TX_MODE] = NLA_POLICY_RANGE(NLA_U32, 1, 2), ++ + }; + + /* policy for the key attributes */ +@@ -5437,6 +5439,9 @@ static int nl80211_start_ap(struct sk_bu + nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); + params.dtim_period = + nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]); ++ if (info->attrs[NL80211_ATTR_BEACON_TX_MODE]) ++ params.beacon_tx_mode = ++ nla_get_u32(info->attrs[NL80211_ATTR_BEACON_TX_MODE]); + + err = cfg80211_validate_beacon_int(rdev, dev->ieee80211_ptr->iftype, + params.beacon_interval); +@@ -12024,6 +12029,10 @@ static int nl80211_join_mesh(struct sk_b + return -EINVAL; + } + ++ if (info->attrs[NL80211_ATTR_BEACON_TX_MODE]) ++ setup.beacon_tx_mode = ++ nla_get_u32(info->attrs[NL80211_ATTR_BEACON_TX_MODE]); ++ + if (info->attrs[NL80211_ATTR_MESH_SETUP]) { + /* parse additional setup parameters if given */ + err = nl80211_parse_mesh_setup(info, &setup); diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch new file mode 100644 index 000000000..294ebf124 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch @@ -0,0 +1,552 @@ +From 730f568af3fac2f31467ea0ff374ea442ddc379f Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Fri, 20 Nov 2020 11:57:36 +0530 +Subject: [PATCH 3/3] ath11k: add AP_VLAN vif support for WDS offload in NSS + offload + +- AP_VLAN vif support is required for WDS offload to interop with mac80211 + based 4addr STA and also for multicast-to-unicast conversion of 3addr + multicast to 4addr frames for each associated 4addr STA. + +- For each associated 4addr STA, corresponding AP_VLAN vif having same MAC + address as AP vif is created from hostapd upon 4addr rx_notify from NSS RX. + +- AP_VLAN vif support is added to add/remove interface mac80211 callbacks only + for NSS ext vdev handling and vdev_id, FW vdev operations are not needed. + +- mac80211 advertises AP_VLAN vif for sta_use_4addr drv callback in case of + NSS offload. Extending ath11k_mac_op_sta_use_4addr to invoke ext vdev NSS + APIs required for AP WDS handling. + +- Maintain AP_VLAN vif(s) list on corresponding AP vif and vice versa required + for ext vdev operations (VDEV_DOWN, DELETE, CONFIGURE_IF). + +- NSS require ENABLE_NAWDS and WDS_BACKHAUL to be configured for AP_VLAN + support via ext vdev. + +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/mac.c | 156 +++++++++++++++++++++++++++++++-- + drivers/net/wireless/ath/ath11k/wmi.h | 2 + + 3 files changed, 154 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -276,6 +276,7 @@ struct ath11k_vif { + struct ath11k_mgmt_frame_stats mgmt_stats; + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct arvif_nss nss; ++ struct list_head ap_vlan_arvifs; + #endif + }; + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4233,6 +4233,11 @@ static void ath11k_sta_rc_update_wk(stru + arvif = arsta->arvif; + ar = arvif->ar; + ++ if (ar->ab->nss.enabled && ++ arsta->arvif->vif->type == NL80211_IFTYPE_AP_VLAN && ++ arsta->use_4addr_set) ++ arvif = arvif->nss.ap_vif; ++ + if (WARN_ON(ath11k_mac_vif_chan(arvif->vif, &def))) + return; + +@@ -4350,26 +4355,130 @@ static void ath11k_sta_rc_update_wk(stru + static void ath11k_sta_use_4addr_wk(struct work_struct *wk) + { + struct ath11k *ar; +- struct ath11k_vif *arvif; ++ struct ath11k_vif *arvif, *ap_vlan_arvif = NULL; ++ struct ieee80211_vif *vif; + struct ath11k_sta *arsta; + struct ieee80211_sta *sta; ++ struct ath11k_base *ab; ++ struct ath11k_peer *wds_peer; ++ u8 wds_addr[ETH_ALEN]; ++ u32 wds_peer_id; + int ret = 0; + + arsta = container_of(wk, struct ath11k_sta, use_4addr_wk); + sta = container_of((void *)arsta, struct ieee80211_sta, drv_priv); + arvif = arsta->arvif; + ar = arvif->ar; ++ ab = ar->ab; + +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +- "setting USE_4ADDR for STA %pM\n", sta->addr); ++ if (ab->nss.enabled && arvif->vif->type == NL80211_IFTYPE_AP_VLAN) { ++ ap_vlan_arvif = arsta->arvif; ++ arvif = ap_vlan_arvif->nss.ap_vif; ++ } ++ ++ ath11k_dbg(ab, ATH11K_DBG_MAC, ++ "setting USE_4ADDR for peer %pM\n", sta->addr); + + ret = ath11k_wmi_set_peer_param(ar, sta->addr, + arvif->vdev_id, + WMI_PEER_USE_4ADDR, 1); + + if (ret) +- ath11k_warn(ar->ab, "failed to set 4addr for STA %pM: %d\n", ++ ath11k_warn(ab, "failed to set 4addr for STA %pM: %d\n", + sta->addr, ret); ++ ++ if (!ab->nss.enabled || !ap_vlan_arvif) ++ return; ++ ++ vif = ap_vlan_arvif->vif; ++ ++ spin_lock_bh(&ab->base_lock); ++ wds_peer = ath11k_peer_find_by_addr(ab, sta->addr); ++ if (!wds_peer) { ++ spin_unlock_bh(&ab->base_lock); ++ ath11k_warn(ab, "mac sta use 4addr failed to find peer %pM\n", ++ sta->addr); ++ return; ++ } ++ ++ wds_peer_id = wds_peer->peer_id; ++ ether_addr_copy(wds_addr, wds_peer->addr); ++ spin_unlock_bh(&ab->base_lock); ++ ++ /* skip NSS ext vdev registration if already done */ ++ if (ap_vlan_arvif->nss.wds_cfg_done) ++ goto skip_nss_ext; ++ ++ ret = ath11k_nss_ext_vdev_configure(ap_vlan_arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to nss cfg ext vdev %pM: %d\n", ++ vif->addr, ret); ++ goto ext_vdev_delete; ++ } ++ ++ ap_vlan_arvif->nss.wds_cfg_done = true; ++ ++skip_nss_ext: ++ ++ ret = ath11k_nss_ext_vdev_cfg_wds_peer(ap_vlan_arvif, ++ wds_addr, wds_peer_id); ++ if (ret) { ++ ath11k_warn(ab, "failed to nss cfg_wds_peer %pM on %pM: %d\n", ++ sta->addr, vif->addr, ret); ++ goto ext_vdev_delete; ++ } ++ ++ ret = ath11k_nss_ext_vdev_wds_4addr_allow(ap_vlan_arvif, ++ wds_peer_id); ++ if (ret) { ++ ath11k_warn(ab, "failed to nss 4addr allow %pM: %d\n", ++ vif->addr, ret); ++ goto ext_vdev_delete; ++ } ++ ++ ret = ath11k_nss_ext_vdev_up(ap_vlan_arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to nss ext vdev up %pM: %d\n", ++ vif->addr, ret); ++ goto ext_vdev_delete; ++ } ++ ++ spin_lock_bh(&ab->base_lock); ++ wds_peer->nss.ext_vdev_up = true; ++ spin_unlock_bh(&ab->base_lock); ++ ++ /* NAWDS and CFG_WDS_BACKHAUL configs should be done on corresponding ++ * AP vif of the AP_VLAN vif ++ */ ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, ++ WMI_VDEV_PARAM_AP_ENABLE_NAWDS, ++ MIN_IDLE_INACTIVE_TIME_SECS); ++ if (ret) { ++ ath11k_warn(ab, "failed to set vdev %i nawds parameters: %d\n", ++ arvif->vdev_id, ret); ++ goto ext_vdev_down; ++ } ++ ++ ret = ath11k_nss_vdev_set_cmd(arvif, ++ NSS_WIFI_VDEV_CFG_WDS_BACKHAUL_CMD, ++ true); ++ if (ret) { ++ ath11k_warn(ab, "failed to cfg wds backhaul in nss %d\n", ++ ret); ++ goto ext_vdev_down; ++ } ++ ++ return; ++ ++ext_vdev_down: ++ ath11k_nss_ext_vdev_down(ap_vlan_arvif); ++ext_vdev_delete: ++ ath11k_nss_ext_vdev_delete(ap_vlan_arvif); ++ ++ spin_lock_bh(&ar->data_lock); ++ list_del(&ap_vlan_arvif->list); ++ spin_unlock_bh(&ar->data_lock); ++ ap_vlan_arvif->nss.added = false; + } + + static int ath11k_mac_inc_num_stations(struct ath11k_vif *arvif, +@@ -4670,9 +4779,32 @@ static void ath11k_mac_op_sta_set_4addr( + bool enabled) + { + struct ath11k *ar = hw->priv; ++ struct ath11k_vif *arvif = (void *)vif->drv_priv; + struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_vif *ap_arvif = NULL; + + if (enabled && !arsta->use_4addr_set) { ++ if (ar->ab->nss.enabled && vif->type == NL80211_IFTYPE_AP_VLAN) { ++ /* 4addr STA is initially associated to AP vif, change ++ * it to AP_VLAN vif and add AP_VLAN vif to AP vifs list ++ */ ++ ap_arvif = arsta->arvif; ++ arvif->nss.ap_vif = ap_arvif; ++ ++ /* Check if the vlan arvif object was already present in the ++ * list. We can receive this path multiple times for the same ++ * vlan vif for different sta objects ++ */ ++ if (!arvif->nss.added) { ++ spin_lock_bh(&ar->data_lock); ++ list_add(&arvif->list, &ap_arvif->ap_vlan_arvifs); ++ spin_unlock_bh(&ar->data_lock); ++ arvif->nss.added = true; ++ } ++ ++ arsta->arvif = arvif; ++ } ++ + ieee80211_queue_work(ar->hw, &arsta->use_4addr_wk); + arsta->use_4addr_set = true; + } +@@ -5997,6 +6129,9 @@ static void ath11k_mac_op_update_vif_off + u32 param_id, param_value; + int ret; + ++ if (ab->nss.enabled && vif->type == NL80211_IFTYPE_AP_VLAN) ++ return 0; ++ + ret = ath11k_nss_vdev_create(arvif); + if(ret) { + ath11k_warn(ab, "failed to create nss vdev %d\n", ret); +@@ -6067,7 +6202,8 @@ static int ath11k_mac_op_add_interface(s + goto err; + } + +- if (ar->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) { ++ if (vif->type != NL80211_IFTYPE_AP_VLAN && ++ ar->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) { + ath11k_warn(ab, "failed to create vdev %u, reached max vdev limit %d\n", + ar->num_created_vdevs, TARGET_NUM_VDEVS); + ret = -EBUSY; +@@ -6080,6 +6216,28 @@ static int ath11k_mac_op_add_interface(s + arvif->vif = vif; + + INIT_LIST_HEAD(&arvif->list); ++ ++ if ((vif->type == NL80211_IFTYPE_AP_VLAN || ++ vif->type == NL80211_IFTYPE_STATION) && ab->nss.enabled) { ++ if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET && ++ ieee80211_set_hw_80211_encap(vif, true)) { ++ vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR; ++ arvif->nss.encap = ATH11K_HW_TXRX_ETHERNET; ++ arvif->nss.decap = ATH11K_HW_TXRX_ETHERNET; ++ } ++ ++ if (vif->type == NL80211_IFTYPE_AP_VLAN) { ++ ret = ath11k_nss_ext_vdev_create(arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to create ext vdev %pM: %d\n", ++ vif->addr, ret); ++ goto err; ++ } ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++ } ++ } ++ + INIT_DELAYED_WORK(&arvif->connection_loss_work, + ath11k_mac_vif_sta_connection_loss_work); + +@@ -6109,6 +6267,7 @@ static int ath11k_mac_op_add_interface(s + fallthrough; + case NL80211_IFTYPE_AP: + arvif->vdev_type = WMI_VDEV_TYPE_AP; ++ INIT_LIST_HEAD(&arvif->ap_vlan_arvifs); + break; + case NL80211_IFTYPE_MONITOR: + arvif->vdev_type = WMI_VDEV_TYPE_MONITOR; +@@ -6332,15 +6491,32 @@ static void ath11k_mac_op_remove_interfa + { + struct ath11k *ar = hw->priv; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); ++ struct ath11k_vif *ap_vlan_arvif, *tmp; + struct ath11k_base *ab = ar->ab; + unsigned long time_left; + int ret; + int i; + +- cancel_delayed_work_sync(&arvif->connection_loss_work); +- + mutex_lock(&ar->conf_mutex); + ++ if (vif->type == NL80211_IFTYPE_AP_VLAN) { ++ ath11k_nss_ext_vdev_delete(arvif); ++ ++ /* In case the vlan vif never got added into the ap vlan arvifs ++ * list, avoid removal here ++ */ ++ if (!arvif->nss.added) ++ goto unlock; ++ ++ spin_lock_bh(&ar->data_lock); ++ list_del(&arvif->list); ++ spin_unlock_bh(&ar->data_lock); ++ ++ goto unlock; ++ } ++ ++ cancel_delayed_work_sync(&arvif->connection_loss_work); ++ + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n", + arvif->vdev_id); + +@@ -6349,6 +6525,14 @@ static void ath11k_mac_op_remove_interfa + if (ret) + ath11k_warn(ab, "failed to submit AP self-peer removal on vdev %d: %d\n", + arvif->vdev_id, ret); ++ ++ list_for_each_entry_safe(ap_vlan_arvif, tmp, &arvif->ap_vlan_arvifs, ++ list) { ++ ath11k_nss_ext_vdev_delete(ap_vlan_arvif); ++ spin_lock_bh(&ar->data_lock); ++ list_del(&ap_vlan_arvif->list); ++ spin_unlock_bh(&ar->data_lock); ++ } + } + + reinit_completion(&ar->vdev_delete_done); +@@ -6409,7 +6593,7 @@ err_vdev_del: + /* Remove TWT related files and directory */ + debugfs_remove_recursive(arvif->debugfs_twt); + arvif->debugfs_twt = NULL; +- ++unlock: + mutex_unlock(&ar->conf_mutex); + } + +@@ -6474,16 +6658,17 @@ static int ath11k_mac_op_ampdu_action(st + struct ieee80211_ampdu_params *params) + { + struct ath11k *ar = hw->priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret = -EINVAL; + + mutex_lock(&ar->conf_mutex); + + switch (params->action) { + case IEEE80211_AMPDU_RX_START: +- ret = ath11k_dp_rx_ampdu_start(ar, params); ++ ret = ath11k_dp_rx_ampdu_start(arvif, params); + break; + case IEEE80211_AMPDU_RX_STOP: +- ret = ath11k_dp_rx_ampdu_stop(ar, params); ++ ret = ath11k_dp_rx_ampdu_stop(arvif, params); + break; + case IEEE80211_AMPDU_TX_START: + case IEEE80211_AMPDU_TX_STOP_CONT: +@@ -7982,6 +8167,7 @@ static void ath11k_mac_op_sta_statistics + struct station_info *sinfo) + { + struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + + sinfo->rx_duration = arsta->rx_duration; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION); +@@ -8009,7 +8195,8 @@ static void ath11k_mac_op_sta_statistics + sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); + +- ath11k_nss_update_sta_stats(sinfo, sta, arsta); ++ if (arvif->ar->ab->nss.enabled) ++ ath11k_nss_update_sta_stats(arvif, sinfo, sta); + } + + #define ATH11K_WLAN_PRIO_MAX 0x63 +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -4818,6 +4818,8 @@ enum wmi_vdev_subtype { + WMI_VDEV_SUBTYPE_MESH_11S, + }; + ++#define MIN_IDLE_INACTIVE_TIME_SECS 256 ++ + enum wmi_sta_powersave_param { + WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0, + WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1093,12 +1093,13 @@ err_mem_free: + return ret; + } + +-int ath11k_dp_rx_ampdu_start(struct ath11k *ar, ++int ath11k_dp_rx_ampdu_start(struct ath11k_vif *arvif, + struct ieee80211_ampdu_params *params) + { ++ struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + struct ath11k_sta *arsta = (void *)params->sta->drv_priv; +- int vdev_id = arsta->arvif->vdev_id; ++ int vdev_id = arvif->vdev_id; + int ret; + + ret = ath11k_peer_rx_tid_setup(ar, params->sta->addr, vdev_id, +@@ -1110,13 +1111,13 @@ int ath11k_dp_rx_ampdu_start(struct ath1 + return ret; + } + +-int ath11k_dp_rx_ampdu_stop(struct ath11k *ar, ++int ath11k_dp_rx_ampdu_stop(struct ath11k_vif *arvif, + struct ieee80211_ampdu_params *params) + { ++ struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + struct ath11k_peer *peer; +- struct ath11k_sta *arsta = (void *)params->sta->drv_priv; +- int vdev_id = arsta->arvif->vdev_id; ++ int vdev_id = arvif->vdev_id; + dma_addr_t paddr; + bool active; + int ret; +@@ -3086,11 +3087,11 @@ ath11k_dp_rx_update_peer_rate_table_stat + rx_stats->byte_stats.rx_rate[rate_idx] += ppdu_info->mpdu_len; + } + +-static void ath11k_dp_rx_update_peer_su_stats(struct ath11k_sta *arsta, +- struct hal_rx_mon_ppdu_info *ppdu_info) ++static void ath11k_dp_rx_update_peer_su_stats(struct ath11k *ar, ++ struct ath11k_sta *arsta, ++ struct hal_rx_mon_ppdu_info *ppdu_info) + { + struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; +- struct ath11k *ar = arsta->arvif->ar; + u32 num_msdu; + + if (!rx_stats) +@@ -3682,7 +3683,7 @@ int ath11k_dp_rx_process_mon_status(stru + + if (ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_SU) { + arsta = (struct ath11k_sta *)peer->sta->drv_priv; +- ath11k_dp_rx_update_peer_su_stats(arsta, ppdu_info); ++ ath11k_dp_rx_update_peer_su_stats(ar, arsta, ppdu_info); + } else if ((ppdu_info->fc_valid) && + (ppdu_info->ast_index != HAL_AST_IDX_INVALID)) { + ath11k_dp_rx_mon_process_ulofdma(ppdu_info); +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -60,9 +60,9 @@ static inline u32 ath11k_he_gi_to_nl8021 + return ret; + } + +-int ath11k_dp_rx_ampdu_start(struct ath11k *ar, ++int ath11k_dp_rx_ampdu_start(struct ath11k_vif *arvif, + struct ieee80211_ampdu_params *params); +-int ath11k_dp_rx_ampdu_stop(struct ath11k *ar, ++int ath11k_dp_rx_ampdu_stop(struct ath11k_vif *arvif, + struct ieee80211_ampdu_params *params); + int ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif, + const u8 *peer_addr, +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -139,6 +139,24 @@ struct ath11k_ast_entry *ath11k_peer_ast + return NULL; + } + ++struct ath11k_ast_entry *ath11k_peer_ast_find_by_pdev_idx(struct ath11k *ar, ++ u8* addr) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct ath11k_ast_entry *ast_entry; ++ struct ath11k_peer *peer; ++ ++ lockdep_assert_held(&ab->base_lock); ++ ++ list_for_each_entry(peer, &ab->peers, list) ++ list_for_each_entry(ast_entry, &peer->ast_entry_list, ase_list) ++ if (ether_addr_equal(ast_entry->addr, addr) && ++ ast_entry->pdev_idx == ar->pdev_idx) ++ return ast_entry; ++ ++ return NULL; ++} ++ + void ath11k_peer_ast_wds_wmi_wk(struct work_struct *wk) + { + struct ath11k_ast_entry *ast_entry = container_of(wk, +@@ -199,8 +217,8 @@ int ath11k_peer_add_ast(struct ath11k *a + } + + if (type != ATH11K_AST_TYPE_STATIC) { +- ast_entry = ath11k_peer_ast_find_by_addr(ab, mac_addr); +- if (ast_entry) { ++ ast_entry = ath11k_peer_ast_find_by_pdev_idx(ar, mac_addr); ++ if (ast_entry && ast_entry->type != ATH11K_AST_TYPE_STATIC) { + ath11k_dbg(ab, ATH11K_DBG_MAC, "ast_entry %pM already present on peer %pM\n", + mac_addr, ast_entry->peer->addr); + return 0; +@@ -297,7 +315,6 @@ int ath11k_peer_update_ast(struct ath11k + ath11k_dbg(ab, ATH11K_DBG_MAC, "ath11k_peer_update_ast old peer %pM new peer %pM ast_entry %pM\n", + old_peer->addr, peer->addr, ast_entry->addr); + +- flush_work(&ast_entry->wds_wmi_wk); + ast_entry->action = ATH11K_WDS_WMI_UPDATE; + ieee80211_queue_work(ar->hw, &ast_entry->wds_wmi_wk); + +@@ -342,8 +359,8 @@ void ath11k_peer_del_ast(struct ath11k * + + peer = ast_entry->peer; + +- ath11k_dbg(ab, ATH11K_DBG_MAC, "ath11k_peer_del_ast peer %pM ast_entry %pM\n", +- peer->addr, ast_entry->addr); ++ ath11k_dbg(ab, ATH11K_DBG_MAC, "ath11k_peer_del_ast pdev:%d peer %pM ast_entry %pM\n", ++ ar->pdev->pdev_id, peer->addr, ast_entry->addr); + + if (ast_entry->is_mapped) + list_del(&ast_entry->ase_list); +--- a/drivers/net/wireless/ath/ath11k/peer.h ++++ b/drivers/net/wireless/ath/ath11k/peer.h +@@ -34,6 +34,7 @@ enum ath11k_ast_entry_type { + enum ath11k_wds_wmi_action { + ATH11K_WDS_WMI_ADD = 1, + ATH11K_WDS_WMI_UPDATE, ++ ATH11K_WDS_WMI_REMOVE, + + ATH11K_WDS_WMI_MAX + }; +@@ -119,6 +120,8 @@ struct ath11k_peer *ath11k_peer_find_by_ + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct ath11k_ast_entry *ath11k_peer_ast_find_by_addr(struct ath11k_base *ab, + u8* addr); ++struct ath11k_ast_entry *ath11k_peer_ast_find_by_pdev_idx(struct ath11k *ar, ++ u8* addr); + int ath11k_peer_add_ast(struct ath11k *ar, struct ath11k_peer *peer, + u8* mac_addr, enum ath11k_ast_entry_type type); + int ath11k_peer_update_ast(struct ath11k *ar, struct ath11k_peer *peer, +@@ -138,6 +141,12 @@ static inline struct ath11k_ast_entry *a + { + return NULL; + } ++ ++static inline struct ath11k_ast_entry *ath11k_peer_ast_find_by_pdev_idx(struct ath11k *ar, ++ u8* addr) ++{ ++ return NULL; ++} + + static inline int ath11k_peer_add_ast(struct ath11k *ar, struct ath11k_peer *peer, + u8* mac_addr, enum ath11k_ast_entry_type type) diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-debug-log.patch b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-debug-log.patch new file mode 100644 index 000000000..11d6053db --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-debug-log.patch @@ -0,0 +1,130 @@ +From: Karthikeyan Periyasamy +Subject: [PATCH] ath11k: Add debug logs for the CR2849877 and CR2854245 + +Signed-off-by: Karthikeyan Periyasamy +--- +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2678,6 +2678,14 @@ static void ath11k_dp_rx_h_ppdu(struct a + rx_status->freq = ieee80211_channel_to_frequency(channel_num, + rx_status->band); + ++ if (!ar->hw->wiphy->bands[rx_status->band]) { ++ ath11k_err(ar->ab, "sband NULL status band %d freq %d channel_num %d pdev_idx %d cookie pdev id %d\n", ++ rx_status->band, rx_status->freq, channel_num, ar->pdev_idx, ar->cookie_pdev_id); ++ ++ print_hex_dump(KERN_DEBUG, "rx_desc: ", DUMP_PREFIX_ADDRESS, 16, 1, ++ rx_desc, sizeof(struct hal_rx_desc), false); ++ } ++ + if (rx_status->band == NL80211_BAND_6GHZ) + rx_status->freq = center_freq; + +@@ -3494,6 +3502,12 @@ static int ath11k_dp_rx_reap_mon_status_ + &cookie, &rbm); + if (paddr) { + buf_id = FIELD_GET(DP_RXDMA_BUF_COOKIE_BUF_ID, cookie); ++ ar->cookie_pdev_id = FIELD_GET(DP_RXDMA_BUF_COOKIE_PDEV_ID, cookie); ++ ++ if (mac_id != ar->cookie_pdev_id) { ++ ath11k_warn(ab, "invalid local mac_id %d pdev_id %d\n", ++ mac_id, ar->cookie_pdev_id); ++ } + + spin_lock_bh(&rx_ring->idr_lock); + skb = idr_find(&rx_ring->bufs_idr, buf_id); +@@ -5784,6 +5798,11 @@ void ath11k_dp_rx_mon_dest_process(struc + spin_unlock_bh(&pmon->mon_lock); + + if (rx_bufs_used) { ++ if (ar->cookie_pdev_id != dp->mac_id || mac_id != dp->mac_id) { ++ ath11k_warn(ar->ab, "invalid mac_id for rxbuf replenish pdev id %d mac id %d dp mac id %d\n", ++ ar->cookie_pdev_id, mac_id, dp->mac_id); ++ } ++ + rx_mon_stats->dest_ppdu_done++; + if (ar->ab->hw_params.rxdma1_enable) + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3661,7 +3661,8 @@ static int ath11k_mac_op_hw_scan(struct + + ret = ath11k_start_scan(ar, arg); + if (ret) { +- ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); ++ ath11k_warn(ar->ab, "failed to start hw scan: %d scan_state %d pdev_idx %d\n", ++ ret, ar->scan.state, ar->pdev_idx); + spin_lock_bh(&ar->data_lock); + ar->scan.state = ATH11K_SCAN_IDLE; + spin_unlock_bh(&ar->data_lock); +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -4823,12 +4823,16 @@ void ieee80211_rx_list(struct ieee80211_ + } + } + +- if (WARN_ON(status->band >= NUM_NL80211_BANDS)) ++ if (WARN_ON(status->band >= NUM_NL80211_BANDS)) { ++ printk("invalid status band %d freq %d\n", status->band, status->freq); + goto drop; ++ } + + sband = local->hw.wiphy->bands[status->band]; +- if (WARN_ON(!sband)) ++ if (WARN_ON(!sband)) { ++ printk("NULL sband status band %d freq %d\n", status->band, status->freq); + goto drop; ++ } + + /* + * If we're suspending, it is possible although not too likely +--- a/net/mac80211/scan.c ++++ b/net/mac80211/scan.c +@@ -633,9 +633,15 @@ static void ieee80211_scan_state_send_pr + int i; + struct ieee80211_sub_if_data *sdata; + struct cfg80211_scan_request *scan_req; +- enum nl80211_band band = local->hw.conf.chandef.chan->band; ++ enum nl80211_band band; + u32 flags = 0, tx_flags; + ++ if (!local->hw.conf.chandef.chan) { ++ printk("channel NULL\n"); ++ WARN_ON(1); ++ } ++ ++ band = local->hw.conf.chandef.chan->band; + scan_req = rcu_dereference_protected(local->scan_req, + lockdep_is_held(&local->mtx)); + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -708,6 +708,8 @@ struct ath11k { + + bool monitor_vdev_created; + ++ int cookie_pdev_id; ++ + /* protected by conf_mutex */ + u8 ps_state_enable; + u8 ps_timekeeper_enable; +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -3729,6 +3729,7 @@ int ieee80211_attach_ack_skb(struct ieee + + if (id < 0) { + kfree_skb(ack_skb); ++ printk(KERN_ERR "attach ack fail %d\n", id); + return -ENOMEM; + } + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -2477,6 +2477,7 @@ static u16 ieee80211_store_ack_skb(struc + } + } else { + kfree_skb(ack_skb); ++ printk(KERN_ERR "store ack fail %d\n", id); + } + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-mod-param-support-to-skip-radio.patch b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-mod-param-support-to-skip-radio.patch new file mode 100644 index 000000000..7734726db --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-mod-param-support-to-skip-radio.patch @@ -0,0 +1,116 @@ +From 094d6e53e9c654144d1fba484965fc63c9493282 Mon Sep 17 00:00:00 2001 +From: Sowmiya Sree Elavalagan +Date: Mon, 18 Jan 2021 13:11:29 +0530 +Subject: [PATCH] ath11k:add mod param support to skip radio during boot + +Added a module param which skip qcn6122-5G or 6G or both +during device boot up. This will boot only unskipped radios. + +Signed-off-by: Sowmiya Sree Elavalagan +--- + drivers/net/wireless/ath/ath11k/ahb.c | 27 +++++++++++++++++++++++++-- + drivers/net/wireless/ath/ath11k/ahb.h | 2 ++ + drivers/net/wireless/ath/ath11k/core.c | 4 ++++ + 3 files changed, 31 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -813,6 +813,22 @@ static int ath11k_core_get_rproc(struct + return 0; + } + ++static bool ath11k_skip_target_probe(int userpd_id, const struct of_device_id *of_id) ++{ ++ int hw_rev = (enum ath11k_hw_rev)of_id->data; ++ ++ if (ath11k_skip_radio & SKIP_QCN6122_0) { ++ if (hw_rev == ATH11K_HW_QCN6122 && ++ userpd_id == QCN6122_USERPD_0) ++ return true; ++ } else if (ath11k_skip_radio & SKIP_QCN6122_1) { ++ if (hw_rev == ATH11K_HW_QCN6122 && ++ userpd_id == QCN6122_USERPD_1) ++ return true; ++ } ++ return false; ++} ++ + static int ath11k_ahb_probe(struct platform_device *pdev) + { + struct ath11k_base *ab; +@@ -820,7 +836,7 @@ static int ath11k_ahb_probe(struct platf + const struct of_device_id *of_id; + struct resource *mem_res; + void __iomem *mem; +- int ret; ++ int ret = 0; + int userpd_id; + u32 hw_mode_id; + +@@ -831,6 +847,9 @@ static int ath11k_ahb_probe(struct platf + } + + userpd_id = ath11k_get_userpd_id(dev); ++ if (ath11k_skip_target_probe(userpd_id, of_id)) ++ goto end; ++ + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(&pdev->dev, "failed to set 32-bit consistent dma\n"); +@@ -942,8 +961,8 @@ err_hal_srng_deinit: + + err_core_free: + ath11k_core_free(ab); ++end: + platform_set_drvdata(pdev, NULL); +- + return ret; + } + +@@ -952,6 +971,9 @@ static int ath11k_ahb_remove(struct plat + struct ath11k_base *ab = platform_get_drvdata(pdev); + unsigned long left; + ++ if (!ab) ++ return 0; ++ + if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { + ath11k_ahb_power_down(ab); + ath11k_debugfs_soc_destroy(ab); +--- a/drivers/net/wireless/ath/ath11k/ahb.h ++++ b/drivers/net/wireless/ath/ath11k/ahb.h +@@ -8,6 +8,8 @@ + #include "core.h" + + #define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ) ++#define SKIP_QCN6122_0 0x2 ++#define SKIP_QCN6122_1 0x4 + struct ath11k_base; + + struct ath11k_ahb { +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -46,6 +46,12 @@ unsigned int ath11k_ftm_mode; + module_param_named(ftm_mode, ath11k_ftm_mode, uint, 0644); + MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode"); + ++module_param_named(skip_radio_bmap, ath11k_skip_radio, uint, 0644); ++MODULE_PARM_DESC(skip_radio_bmap, "Bitmap to skip device probe"); ++unsigned int ath11k_skip_radio; ++EXPORT_SYMBOL(ath11k_skip_radio); ++ ++ + struct ath11k_base *ath11k_soc; + + static const struct ath11k_hw_params ath11k_hw_params[] = { +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -28,6 +28,8 @@ + #include "rx_desc.h" + #include "nss.h" + ++extern unsigned int ath11k_skip_radio; ++ + #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) + + #define ATH11K_TX_MGMT_NUM_PENDING_MAX 512 diff --git a/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-provison-to-use-segmentted-memory-on-hk10.patch b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-provison-to-use-segmentted-memory-on-hk10.patch new file mode 100644 index 000000000..b0e7bf373 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/235-ath11k-add-provison-to-use-segmentted-memory-on-hk10.patch @@ -0,0 +1,61 @@ +From aacb25d8cd6f23b49dd27e0933bd95778bad30e2 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Tue, 12 Jan 2021 13:20:53 +0530 +Subject: [PATCH] ath11k: add provison to use segmentted memory on hk10 + +By default QCN9074 uses fixed reserved memory of hk10. +Use below commands to boot FW to use segmented memory +allocated dynamically from host. + + rmmod ath11k_pci + insmod ath11k_pci.ko fw_mem_seg=1 + +Signed-off-by: Anilkumar Kolli +--- + drivers/net/wireless/ath/ath11k/pci.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -41,6 +41,11 @@ + #define QCA6390_DEVICE_ID 0x1101 + #define QCN9074_DEVICE_ID 0x1104 + ++unsigned int ath11k_fw_mem_seg; ++EXPORT_SYMBOL(ath11k_fw_mem_seg); ++module_param_named(fw_mem_seg, ath11k_fw_mem_seg, uint, 0644); ++MODULE_PARM_DESC(fw_mem_seg, "Enable/Disable FW segmentted memory"); ++ + static const struct pci_device_id ath11k_pci_id_table[] = { + { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) }, + { PCI_VDEVICE(QCOM, QCN9074_DEVICE_ID) }, +@@ -1352,6 +1357,10 @@ static int ath11k_pci_probe(struct pci_d + !of_property_read_u32(ab->dev->of_node, "base-addr", &addr)) + ab->bus_params.fixed_mem_region = true; + ++ /* This is HACK to bring up the QCN9074 with segemnted memory */ ++ if (ath11k_fw_mem_seg) ++ ab->bus_params.fixed_mem_region = false; ++ + ret = ath11k_pci_claim(ab_pci, pdev); + if (ret) { + ath11k_err(ab, "failed to claim device: %d\n", ret); +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2726,6 +2726,16 @@ static int ath11k_qmi_alloc_target_mem_c + chunk = &ab->qmi.target_mem[i]; + + /* ++ * Ignore the memory request from FW if size is more than 2MB ++ * if host sends failure, FW reqesut for 2MB segments in mode-0 ++ * and 1MB segments in mode-1 and mode-2 ++ */ ++ if (chunk->size > 2*1024*1024) { ++ ab->qmi.target_mem_delayed = true; ++ return 0; ++ } ++ ++ /* + * FW reloads in coldboot/FWrecovery. + * in such case, no need to allocate memory for FW again. + */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/236-001-mac80211-add-dynamic-VLAN-support-on-NSS-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/236-001-mac80211-add-dynamic-VLAN-support-on-NSS-offload.patch new file mode 100644 index 000000000..d3636812f --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/236-001-mac80211-add-dynamic-VLAN-support-on-NSS-offload.patch @@ -0,0 +1,129 @@ +From 36ee9d37b53c933f4dd8f934f8e0273b5e901549 Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Fri, 8 Jan 2021 00:02:54 +0530 +Subject: [PATCH 1/3] mac80211: add dynamic VLAN support on NSS offload + +NSS requires dynamic AP_VLAN vif ifnum and its corresponding VLAN ID +and group key index to configure dynamic VLAN ext VDEV in NSS. + +Hence mac80211 set_key and sta_state callbacks are modified to advertise +AP_VLAN vif when NSS offload is enabled and VLAN ID provided by hostapd +in key params is stored to ieee80211_key_conf for the driver. + +Co-Developed-by: Seevalamuthu Mariappan +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Sathishkumar Muruganandam +--- + include/net/mac80211.h | 3 +++ + net/mac80211/cfg.c | 1 + + net/mac80211/driver-ops.c | 4 +++- + net/mac80211/driver-ops.h | 4 +++- + net/mac80211/key.c | 5 ++++- + net/mac80211/tx.c | 4 ++++ + 6 files changed, 18 insertions(+), 3 deletions(-) + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1910,6 +1910,8 @@ enum ieee80211_key_flags { + * @tx_pn: PN used for TX keys, may be used by the driver as well if it + * needs to do software PN assignment by itself (e.g. due to TSO) + * @flags: key flags, see &enum ieee80211_key_flags. ++ * @vlan_id: VLAN ID corresponding to the group key. ++ * For VLAN interfaces 1-4096, 0 for non-vlan interfaces + * @keyidx: the key index (0-3) + * @keylen: key material length + * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) +@@ -1928,6 +1930,7 @@ struct ieee80211_key_conf { + u8 hw_key_idx; + s8 keyidx; + u16 flags; ++ u16 vlan_id; + u8 keylen; + u8 key[]; + }; +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -510,6 +510,7 @@ static int ieee80211_add_key(struct wiph + break; + case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_AP_VLAN: ++ key->conf.vlan_id = params->vlan_id; + /* Keys without a station are used for TX only */ + if (sta && test_sta_flag(sta, WLAN_STA_MFP)) + key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT; +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -113,7 +113,11 @@ int drv_sta_state(struct ieee80211_local + + might_sleep(); + +- sdata = get_bss_sdata(sdata); ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD) || ++ !(old_state == IEEE80211_STA_ASSOC && ++ new_state == IEEE80211_STA_AUTHORIZED)) ++ sdata = get_bss_sdata(sdata); ++ + if (!check_sdata_in_driver(sdata)) + return -EIO; + +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -261,7 +261,9 @@ static inline int drv_set_key(struct iee + + might_sleep(); + +- sdata = get_bss_sdata(sdata); ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) ++ sdata = get_bss_sdata(sdata); ++ + if (!check_sdata_in_driver(sdata)) + return -EIO; + +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -167,7 +167,8 @@ static int ieee80211_key_enable_hw_accel + goto out_unsupported; + + sdata = key->sdata; +- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !ieee80211_hw_check(&key->local->hw, SUPPORTS_NSS_OFFLOAD)) { + /* + * The driver doesn't know anything about VLAN interfaces. + * Hence, don't send GTKs for VLAN interfaces to the driver. +@@ -553,6 +554,8 @@ ieee80211_key_alloc(u32 cipher, int idx, + */ + key->conf.flags = 0; + key->flags = 0; ++ /* VLAN ID initialised to zero for non-vlan interfaces */ ++ key->conf.vlan_id = 0; + + key->conf.cipher = cipher; + key->conf.keyidx = idx; +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -4248,8 +4248,11 @@ static void ieee80211_8023_xmit(struct i + struct ieee80211_key *key, struct sk_buff *skb) + { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ struct ethhdr *ehdr = (struct ethhdr *)skb->data; + struct ieee80211_local *local = sdata->local; + struct tid_ampdu_tx *tid_tx; ++ unsigned char *ra = ehdr->h_dest; ++ bool multicast; + u8 tid; + + if (local->ops->wake_tx_queue) { +@@ -4258,6 +4261,12 @@ static void ieee80211_8023_xmit(struct i + skb_get_hash(skb); + } + ++ multicast = is_multicast_ether_addr(ra); ++ ++ if (multicast && sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !atomic_read(&sdata->u.vlan.num_mcast_sta)) ++ goto out_free; ++ + if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) && + test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state)) + goto out_free; diff --git a/feeds/wifi-ax/mac80211/patches/qca/236-002-ath11k-extend-ext-vdev-in-NSS-for-dynamic-VLAN-handling.patch b/feeds/wifi-ax/mac80211/patches/qca/236-002-ath11k-extend-ext-vdev-in-NSS-for-dynamic-VLAN-handling.patch new file mode 100644 index 000000000..27ca255e7 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/236-002-ath11k-extend-ext-vdev-in-NSS-for-dynamic-VLAN-handling.patch @@ -0,0 +1,211 @@ +From 6f51430f2614ca2fb2a1e45cc81464c6d7a29f03 Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Fri, 8 Jan 2021 00:34:09 +0530 +Subject: [PATCH 2/3] ath11k: extend ext vdev in NSS for dynamic VLAN handling + +- add ext vdev NSS API callbacks required for dynamic AP_VLAN vif +- existing ext vdev NSS API callbacks are used for both WDS and + dynamic VLAN di_types. + +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/nss.c | 101 +++++++++++++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/nss.h | 17 ++++++ + 2 files changed, 109 insertions(+), 9 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -1483,14 +1483,11 @@ static int ath11k_nss_ext_vdev_register( + struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + nss_tx_status_t status; +- enum nss_dynamic_interface_type di_type; + u32 features = 0; + + if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN || arvif->nss.ctx) + return -EINVAL; + +- di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS; +- + arvif->nss.ctx = nss_wifi_ext_vdev_register_if(arvif->nss.if_num, + ath11k_nss_ext_vdev_data_receive, + ath11k_nss_ext_vdev_special_data_receive, +@@ -1518,7 +1515,8 @@ static void ath11k_nss_ext_vdev_free(str + + status = nss_dynamic_interface_dealloc_node( + arvif->nss.if_num, +- NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS); ++ arvif->nss.di_type); ++ + if (status != NSS_TX_SUCCESS) + ath11k_warn(ab, "failed to free nss ext vdev err:%d\n", + status); +@@ -1527,14 +1525,19 @@ static void ath11k_nss_ext_vdev_free(str + "nss ext vdev interface deallocated\n"); + } + +-static int ath11k_nss_ext_vdev_alloc(struct ath11k_vif *arvif) ++static int ath11k_nss_ext_vdev_alloc(struct ath11k_vif *arvif, ++ struct wireless_dev *wdev) + { + struct ath11k_base *ab = arvif->ar->ab; + enum nss_dynamic_interface_type di_type; + int if_num; + +- di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS; ++ if (wdev->use_4addr) ++ di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS; ++ else ++ di_type = NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN; + ++ arvif->nss.di_type = di_type; + if_num = nss_dynamic_interface_alloc_node(di_type); + if (if_num < 0) { + ath11k_warn(ab, "failed to allocate nss ext vdev\n"); +@@ -1543,8 +1546,8 @@ static int ath11k_nss_ext_vdev_alloc(str + + arvif->nss.if_num = if_num; + ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, +- "nss ext vdev interface %pM allocated if_num %d\n", +- arvif->vif->addr, if_num); ++ "nss ext vdev interface %pM di_type %d allocated if_num %d\n", ++ arvif->vif->addr, di_type, if_num); + + return 0; + } +@@ -1573,7 +1576,7 @@ int ath11k_nss_ext_vdev_create(struct at + return -EINVAL; + } + +- ret = ath11k_nss_ext_vdev_alloc(arvif); ++ ret = ath11k_nss_ext_vdev_alloc(arvif, wdev); + if (ret) + return ret; + +@@ -1684,6 +1687,86 @@ free: + return ret; + } + ++int ath11k_nss_ext_vdev_cfg_dyn_vlan(struct ath11k_vif *arvif, u16 vlan_id) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct nss_wifi_ext_vdev_msg *ext_vdev_msg = NULL; ++ struct nss_wifi_ext_vdev_vlan_msg *cfg_dyn_vlan_msg = NULL; ++ nss_tx_status_t status; ++ int ret; ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ if (arvif->vif->type != NL80211_IFTYPE_AP_VLAN) ++ return -EINVAL; ++ ++ ext_vdev_msg = kzalloc(sizeof(struct nss_wifi_ext_vdev_msg), GFP_ATOMIC); ++ if (!ext_vdev_msg) ++ return -ENOMEM; ++ ++ cfg_dyn_vlan_msg = &ext_vdev_msg->msg.vmsg; ++ cfg_dyn_vlan_msg->vlan_id = vlan_id; ++ ++ nss_wifi_ext_vdev_msg_init(ext_vdev_msg, arvif->nss.if_num, ++ NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_VLAN, ++ sizeof(struct nss_wifi_ext_vdev_vlan_msg), ++ NULL, arvif); ++ ++ status = nss_wifi_ext_vdev_tx_msg_sync(arvif->nss.ctx, ext_vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "failed to configure dyn vlan nss_err:%d\n", ++ status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ret = 0; ++free: ++ kfree(ext_vdev_msg); ++ ++ return ret; ++} ++ ++int ath11k_nss_dyn_vlan_set_group_key(struct ath11k_vif *arvif, u16 vlan_id, ++ u16 group_key) ++{ ++ struct nss_wifi_vdev_msg *vdev_msg = NULL; ++ struct nss_wifi_vdev_set_vlan_group_key *vlan_group_key; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ vdev_msg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_ATOMIC); ++ if (!vdev_msg) ++ return -ENOMEM; ++ ++ vlan_group_key = &vdev_msg->msg.vlan_group_key; ++ vlan_group_key->vlan_id = vlan_id; ++ vlan_group_key->group_key = group_key; ++ ++ nss_wifi_vdev_msg_init(vdev_msg, arvif->nss.if_num, ++ NSS_WIFI_VDEV_SET_GROUP_KEY, ++ sizeof(struct nss_wifi_vdev_set_vlan_group_key), ++ NULL, NULL); ++ ++ status = nss_wifi_vdev_tx_msg(ar->nss.ctx, vdev_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss vdev set vlan group key error %d\n", status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_WDS, "nss vdev set vlan group key success\n"); ++free: ++ kfree(vdev_msg); ++ return ret; ++ ++} ++ + /*----------------------------Peer Setup/Config -----------------------------*/ + + int ath11k_nss_set_peer_sec_type(struct ath11k *ar, +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -150,6 +150,8 @@ struct arvif_nss { + bool added; + /* Flag to notify if ext vdev is up/down */ + bool ext_vdev_up; ++ /* Keep the copy of di_type for nss */ ++ enum nss_dynamic_interface_type di_type; + /* WDS cfg should be done only once for ext vdev */ + bool wds_cfg_done; + bool created; +@@ -215,6 +217,9 @@ void ath11k_nss_ext_vdev_unregister(stru + int ath11k_nss_ext_vdev_up(struct ath11k_vif *arvif); + int ath11k_nss_ext_vdev_down(struct ath11k_vif *arvif); + void ath11k_nss_ext_vdev_delete(struct ath11k_vif *arvif); ++int ath11k_nss_ext_vdev_cfg_dyn_vlan(struct ath11k_vif *arvif, u16 vlan_id); ++int ath11k_nss_dyn_vlan_set_group_key(struct ath11k_vif *arvif, u16 vlan_id, ++ u16 group_key); + int ath11k_nss_set_peer_sec_type(struct ath11k *ar, struct ath11k_peer *peer, + struct ieee80211_key_conf *key_conf); + void ath11k_nss_update_sta_stats(struct ath11k_vif *arvif, +@@ -343,6 +348,18 @@ static inline int ath11k_nss_ext_vdev_do + { + return 0; + } ++ ++static inline int ath11k_nss_ext_vdev_cfg_dyn_vlan(struct ath11k_vif *arvif, ++ u16 vlan_id) ++{ ++ return 0; ++} ++ ++static inline int ath11k_nss_dyn_vlan_set_group_key(struct ath11k_vif *arvif, ++ u16 vlan_id, u16 group_key) ++{ ++ return 0; ++} + + static inline void ath11k_nss_peer_stats_enable(struct ath11k *ar) + { diff --git a/feeds/wifi-ax/mac80211/patches/qca/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch b/feeds/wifi-ax/mac80211/patches/qca/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch new file mode 100644 index 000000000..95fbd9737 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch @@ -0,0 +1,499 @@ +From da432fe6dda831c867416d338def3e277c989287 Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Fri, 8 Jan 2021 00:39:47 +0530 +Subject: [PATCH 3/3] ath11k: add dynamic VLAN support in NSS offload + +Driver should advertise NL80211_EXT_FEATURE_VLAN_OFFLOAD to enable +vlan offload in hostapd. + +Group Key for multiple vlan interfaces are configured with the help +of group key index as NSS uses this index to get the corresponding +group key during transmission. + +Each dynamic AP-VLAN interface choose unique group key index which +will be sent to NSS along with VLAN ID for dynamic VLAN ext vdev +configuration. + +ath11k_mac_op_set_key() does the NSS ext vdev config upon receiving +VLAN ID on group key. + +ath11k_mac_op_sta_state() does the STA assignment from AP vif to +AP_VLAN vif in NSS after mac80211. + +Currently, the firmware supports upto 128 group keys for an AP +interface. The multiple group key support can be enabled during +resource config. + +Co-Developed-by: Seevalamuthu Mariappan +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/core.h | 8 ++ + drivers/net/wireless/ath/ath11k/mac.c | 237 ++++++++++++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/wmi.c | 5 + + drivers/net/wireless/ath/ath11k/wmi.h | 2 + + 4 files changed, 233 insertions(+), 19 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -81,6 +81,11 @@ enum ath11k_crypt_mode { + ATH11K_CRYPT_MODE_SW, + }; + ++#define ATH11K_GROUP_KEYS_NUM_MAX 128 ++#define ATH11K_FREE_GROUP_IDX_MAP_BITS 32 ++#define ATH11K_FREE_GROUP_IDX_MAP_MAX (ATH11K_GROUP_KEYS_NUM_MAX / \ ++ ATH11K_FREE_GROUP_IDX_MAP_BITS) ++ + static inline enum wme_ac ath11k_tid_to_ac(u32 tid) + { + return (((tid == 0) || (tid == 3)) ? WME_AC_BE : +@@ -279,6 +284,9 @@ struct ath11k_vif { + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct arvif_nss nss; + struct list_head ap_vlan_arvifs; ++ /* VLAN keyidx map required for Dynamic VLAN */ ++ u16 *vlan_keyid_map; ++ DECLARE_BITMAP(free_groupidx_map, ATH11K_GROUP_KEYS_NUM_MAX); + #endif + }; + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -561,6 +561,33 @@ struct ath11k *ath11k_mac_get_ar_by_pdev + return NULL; + } + ++struct ath11k_vif *ath11k_mac_get_ap_arvif_by_addr(struct ath11k_base *ab, ++ const u8 *addr) ++{ ++ int i; ++ struct ath11k_pdev *pdev; ++ struct ath11k_vif *arvif; ++ struct ath11k *ar; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = rcu_dereference(ab->pdevs_active[i]); ++ if (pdev && pdev->ar) { ++ ar = pdev->ar; ++ ++ spin_lock_bh(&ar->data_lock); ++ list_for_each_entry(arvif, &ar->arvifs, list) { ++ if (arvif->vif->type == NL80211_IFTYPE_AP && ++ ether_addr_equal(arvif->vif->addr, addr)) { ++ spin_unlock_bh(&ar->data_lock); ++ return arvif; ++ } ++ } ++ spin_unlock_bh(&ar->data_lock); ++ } ++ } ++ return NULL; ++} ++ + static void ath11k_pdev_caps_update(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +@@ -3722,6 +3749,9 @@ static int ath11k_install_key(struct ath + if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) + return 0; + ++ if (key->vlan_id) ++ arg.group_key_idx = key->hw_key_idx; ++ + if (cmd == DISABLE_KEY) { + /* TODO: Check if FW expects value other than NONE for del */ + /* arg.key_cipher = WMI_CIPHER_NONE; */ +@@ -3813,15 +3843,40 @@ static int ath11k_clear_peer_keys(struct + return first_errno; + } + ++static int ath11k_get_vlan_groupkey_index(struct ath11k_vif *arvif, ++ struct ieee80211_key_conf *key) ++{ ++ struct ath11k *ar = arvif->ar; ++ int map_idx = 0; ++ int free_bit; ++ ++ for (map_idx = 0; map_idx < ATH11K_FREE_GROUP_IDX_MAP_MAX; map_idx++) ++ if (arvif->free_groupidx_map[map_idx] != 0) ++ break; ++ ++ if (map_idx == ATH11K_FREE_GROUP_IDX_MAP_MAX) ++ return -ENOSPC; ++ ++ spin_lock_bh(&ar->data_lock); ++ /* select the first free key index */ ++ free_bit = __ffs64(arvif->free_groupidx_map[map_idx]); ++ key->hw_key_idx = (map_idx * ATH11K_FREE_GROUP_IDX_MAP_BITS) + free_bit; ++ /* clear the selected bit from free index map */ ++ clear_bit(key->hw_key_idx, arvif->free_groupidx_map); ++ spin_unlock_bh(&ar->data_lock); ++ ++ return 0; ++} ++ + static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, + struct ieee80211_vif *vif, struct ieee80211_sta *sta, + struct ieee80211_key_conf *key) + { + struct ath11k *ar = hw->priv; + struct ath11k_base *ab = ar->ab; +- struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); ++ struct ath11k_vif *arvif, *ap_vlan_arvif = NULL; + struct ath11k_peer *peer; +- struct ath11k_sta *arsta; ++ struct ath11k_sta *arsta = NULL; + const u8 *peer_addr; + int ret = 0; + u32 flags = 0; +@@ -3839,17 +3894,36 @@ static int ath11k_mac_op_set_key(struct + if (key->keyidx > WMI_MAX_KEY_INDEX) + return -ENOSPC; + +- mutex_lock(&ar->conf_mutex); ++ arvif = ath11k_vif_to_arvif(vif); + +- if (sta) ++ mutex_lock(&ar->conf_mutex); ++ if (sta) { + peer_addr = sta->addr; +- else if (arvif->vdev_type == WMI_VDEV_TYPE_STA) ++ arsta = (struct ath11k_sta *)sta->drv_priv; ++ } else if (arvif->vdev_type == WMI_VDEV_TYPE_STA) { + peer_addr = vif->bss_conf.bssid; +- else ++ } else { + peer_addr = vif->addr; ++ } + + key->hw_key_idx = key->keyidx; + ++ if (ab->nss.enabled && vif->type == NL80211_IFTYPE_AP_VLAN) { ++ ap_vlan_arvif = arvif; ++ if (arsta) { ++ ap_vlan_arvif->nss.ap_vif = arsta->arvif; ++ arvif = arsta->arvif; ++ } else { ++ rcu_read_lock(); ++ arvif = ath11k_mac_get_ap_arvif_by_addr(ab, peer_addr); ++ if (!arvif) { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ap_vlan_arvif->nss.ap_vif = arvif; ++ } ++ } ++ + /* the peer should not disappear in mid-way (unless FW goes awry) since + * we already hold conf_mutex. we just make sure its there now. + */ +@@ -3888,6 +3962,74 @@ static int ath11k_mac_op_set_key(struct + goto exit; + } + ++ /* VLAN ID is updated non-zero only for AP_VLAN vif */ ++ if (key->vlan_id && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE) && ++ ap_vlan_arvif) { ++ if (arvif->vlan_keyid_map) ++ key->hw_key_idx = arvif->vlan_keyid_map[key->vlan_id]; ++ else ++ key->hw_key_idx = 0; ++ switch (cmd) { ++ case SET_KEY: ++ /* If the group key idx is already available, ++ * no need to find the free index again. ++ * This happens during GTK rekey. It uses ++ * the same index after rekey also. ++ */ ++ if (!key->hw_key_idx) ++ ret = ath11k_get_vlan_groupkey_index(arvif, key); ++ break; ++ case DISABLE_KEY: ++ /* If the group key idx is already 0, ++ * no need of freeing the index. ++ */ ++ if (key->hw_key_idx) { ++ spin_lock_bh(&ar->data_lock); ++ /* make the group index as available */ ++ set_bit(key->hw_key_idx, arvif->free_groupidx_map); ++ spin_unlock_bh(&ar->data_lock); ++ } ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ ++ if (ret) { ++ ath11k_warn(ab, "failed to set group key index for vlan %u : %d\n", ++ key->vlan_id, ret); ++ goto exit; ++ } ++ ++ ret = ath11k_nss_ext_vdev_configure(ap_vlan_arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to nss cfg ext vdev %pM: %d\n", ++ ap_vlan_arvif->vif->addr, ret); ++ goto exit; ++ } ++ ++ ret = ath11k_nss_ext_vdev_cfg_dyn_vlan(ap_vlan_arvif, ++ key->vlan_id); ++ if (ret) { ++ ath11k_warn(ab, "failed to cfg dynamic vlan %d\n", ret); ++ goto exit; ++ } ++ ++ ret = ath11k_nss_dyn_vlan_set_group_key(ap_vlan_arvif->nss.ap_vif, ++ key->vlan_id, ++ key->hw_key_idx); ++ if (ret) { ++ ath11k_warn(ab, "failed to set dynamic vlan group key %d\n", ++ ret); ++ goto exit; ++ } ++ ++ ret = ath11k_nss_ext_vdev_up(ap_vlan_arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to set dyn vlan UP %d\n", ret); ++ goto exit; ++ } ++ } ++ + spin_lock_bh(&ab->base_lock); + peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); + +@@ -3919,18 +4061,23 @@ static int ath11k_mac_op_set_key(struct + peer->mcast_keyidx = key->keyidx; + peer->sec_type_grp = ath11k_dp_tx_get_encrypt_type(key->cipher); + } ++ /* storing group key idx which will be used during rekey */ ++ if (key->vlan_id) ++ arvif->vlan_keyid_map[key->vlan_id] = key->hw_key_idx; + } else if (peer && cmd == DISABLE_KEY) { + peer->keys[key->keyidx] = NULL; + if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) + peer->ucast_keyidx = 0; + else + peer->mcast_keyidx = 0; +- } else if (!peer) ++ if (key->vlan_id) ++ arvif->vlan_keyid_map[key->vlan_id] = 0; ++ } else if (!peer) { + /* impossible unless FW goes crazy */ + ath11k_warn(ab, "peer %pM disappeared!\n", peer_addr); ++ } + +- if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ if (arsta) { + + switch (key->cipher) { + case WLAN_CIPHER_SUITE_TKIP: +@@ -3951,6 +4098,9 @@ static int ath11k_mac_op_set_key(struct + unlock: + spin_unlock_bh(&ab->base_lock); + exit: ++ if (ap_vlan_arvif && !arsta) ++ rcu_read_unlock(); ++ + mutex_unlock(&ar->conf_mutex); + return ret; + } +@@ -4634,6 +4784,33 @@ exit: + return ret; + } + ++static int ath11k_mac_cfg_dyn_vlan(struct ath11k_base *ab, ++ struct ath11k_vif *ap_vlan_arvif, ++ struct ieee80211_sta *sta) ++{ ++ struct ath11k_peer *peer; ++ int peer_id, ret; ++ ++ spin_lock_bh(&ab->base_lock); ++ peer = ath11k_peer_find_by_addr(ab, sta->addr); ++ if (!peer) { ++ ath11k_warn(ab, "failed to find peer for %pM\n", sta->addr); ++ spin_unlock_bh(&ab->base_lock); ++ return -EINVAL; ++ } ++ peer_id = peer->peer_id; ++ spin_unlock_bh(&ab->base_lock); ++ ++ ret = ath11k_nss_ext_vdev_wds_4addr_allow(ap_vlan_arvif, peer_id); ++ if (ret) { ++ ath11k_warn(ab, "failed to set 4addr allow for %pM:%d\n", ++ sta->addr, ret); ++ return ret; ++ } ++ ++ return ret; ++} ++ + static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, +@@ -4710,15 +4887,23 @@ static int ath11k_mac_op_sta_state(struc + ath11k_warn(ar->ab, "Failed to associate station: %pM\n", + sta->addr); + } else if (old_state == IEEE80211_STA_ASSOC && +- new_state == IEEE80211_STA_AUTHORIZED && +- vif->type == NL80211_IFTYPE_STATION) { +- ret = ath11k_wmi_set_peer_param(ar, sta->addr, +- arvif->vdev_id, +- WMI_PEER_AUTHORIZE, +- 1); +- if (ret) +- ath11k_warn(ar->ab, "Unable to authorize peer (%pM) vdev %d: %d\n", +- sta->addr, arvif->vdev_id, ret); ++ new_state == IEEE80211_STA_AUTHORIZED) { ++ if (vif->type == NL80211_IFTYPE_STATION) { ++ ret = ath11k_wmi_set_peer_param(ar, sta->addr, ++ arvif->vdev_id, ++ WMI_PEER_AUTHORIZE, ++ 1); ++ if (ret) ++ ath11k_warn(ar->ab, "Unable to authorize peer (%pM) vdev %d: %d\n", ++ sta->addr, arvif->vdev_id, ret); ++ } else if (ar->ab->nss.enabled && ++ vif->type == NL80211_IFTYPE_AP_VLAN && ++ !arsta->use_4addr_set) { ++ ret = ath11k_mac_cfg_dyn_vlan(ar->ab, arvif, sta); ++ if (ret) ++ ath11k_warn(ar->ab, "failed to cfg dyn vlan for peer %pM: %d\n", ++ sta->addr, ret); ++ } + } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH && + (vif->type == NL80211_IFTYPE_AP || +@@ -6253,6 +6438,20 @@ static int ath11k_mac_op_add_interface(s + arvif->vdev_id = bit; + arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE; + ++ spin_lock_bh(&ar->data_lock); ++ /* Configure vlan specific parameters */ ++ for (i = 0; i < ATH11K_FREE_GROUP_IDX_MAP_MAX; i++) ++ arvif->free_groupidx_map[i] = 0xFFFFFFFFL; ++ /* Group idx 0 is not valid for VLAN*/ ++ arvif->free_groupidx_map[0] &= ~(1L); ++ spin_unlock_bh(&ar->data_lock); ++ ++ arvif->vlan_keyid_map = kzalloc(VLAN_N_VID, GFP_KERNEL); ++ if (!arvif->vlan_keyid_map) { ++ ret = -ENOMEM; ++ goto err; ++ } ++ + switch (vif->type) { + case NL80211_IFTYPE_UNSPECIFIED: + case NL80211_IFTYPE_STATION: +@@ -6285,14 +6484,14 @@ static int ath11k_mac_op_add_interface(s + ret = ath11k_mac_setup_vdev_create_params(arvif, &vdev_param); + if (ret) { + ath11k_warn(ab, "failed to prepare vdev %d\n", ret); +- goto err; ++ goto err_keyid; + } + + ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param); + if (ret) { + ath11k_warn(ab, "failed to create WMI vdev %d: %d\n", + arvif->vdev_id, ret); +- goto err; ++ goto err_keyid; + } + ar->num_created_vdevs++; + ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM created, vdev_id %d\n", +@@ -6444,13 +6643,13 @@ err_peer_del: + if (ret) { + ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", + arvif->vdev_id, vif->addr); +- goto err; ++ goto err_keyid; + } + + ret = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id, + vif->addr); + if (ret) +- goto err; ++ goto err_keyid; + + ar->num_peers--; + } +@@ -6465,6 +6664,8 @@ err_vdev_del: + list_del(&arvif->list); + spin_unlock_bh(&ar->data_lock); + ++err_keyid: ++ kfree(arvif->vlan_keyid_map); + err: + mutex_unlock(&ar->conf_mutex); + +@@ -6568,6 +6769,7 @@ err_vdev_del: + list_del(&arvif->list); + spin_unlock_bh(&ar->data_lock); + ++ kfree(arvif->vlan_keyid_map); + ath11k_peer_cleanup(ar, arvif->vdev_id); + + idr_for_each(&ar->txmgmt_idr, +@@ -8808,8 +9010,11 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, SUPPORT_FAST_XMIT); + } + +- if (ab->nss.enabled) ++ if (ab->nss.enabled) { + ieee80211_hw_set(ar->hw, SUPPORTS_NSS_OFFLOAD); ++ wiphy_ext_feature_set(ar->hw->wiphy, ++ NL80211_EXT_FEATURE_VLAN_OFFLOAD); ++ } + + ret = ieee80211_register_hw(ar->hw); + if (ret) { +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -1941,6 +1941,7 @@ int ath11k_wmi_vdev_install_key(struct a + cmd->key_len = arg->key_len; + cmd->key_txmic_len = arg->key_txmic_len; + cmd->key_rxmic_len = arg->key_rxmic_len; ++ cmd->group_key_id = arg->group_key_idx; + + if (arg->key_rsc_counter) + memcpy(&cmd->key_rsc_counter, &arg->key_rsc_counter, +@@ -4281,6 +4282,7 @@ ath11k_wmi_copy_resource_config(struct w + wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count; + wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; + wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; ++ wmi_cfg->max_num_group_keys = tg_cfg->max_num_group_keys; + } + + static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi, +@@ -4501,6 +4503,9 @@ int ath11k_wmi_cmd_init(struct ath11k_ba + config.ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD; + config.beacon_tx_offload_max_vdev += config.ema_max_vap_cnt; + ++ if (ab->nss.enabled) ++ config.max_num_group_keys = ATH11K_GROUP_KEYS_NUM_MAX; ++ + ab->hw_params.hw_ops->wmi_init_config(ab, &config); + + memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config)); +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -3738,6 +3738,7 @@ struct wmi_vdev_install_key_arg { + u32 vdev_id; + const u8 *macaddr; + u32 key_idx; ++ u32 group_key_idx; + u32 key_flags; + u32 key_cipher; + u32 key_len; +@@ -5898,6 +5899,7 @@ struct target_resource_config { + u32 bpf_instruction_size; + u32 max_bssid_rx_filters; + u32 use_pdev_id; ++ u32 max_num_group_keys; + u32 peer_map_unmap_v2_support; + u32 sched_params; + u32 twt_ap_pdev_count; diff --git a/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-Add-checks-for-vdev-id-in-fwtest-command.patch b/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-Add-checks-for-vdev-id-in-fwtest-command.patch new file mode 100644 index 000000000..1b224cf7a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-Add-checks-for-vdev-id-in-fwtest-command.patch @@ -0,0 +1,37 @@ +From d4342be9786373d76303dae06bb7b560d7b8f864 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 21 Jan 2021 21:27:14 +0530 +Subject: [PATCH] ath11k: Add vdev null checks for fwtest command + +Added null checks for vif ptr of vdev, to avoid sending fwtest +cmd when vdev is not up. + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/testmode.c | 37 +++++++++++++++++------------- + 1 file changed, 21 insertions(+), 16 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/testmode.c ++++ b/drivers/net/wireless/ath/ath11k/testmode.c +@@ -381,9 +381,18 @@ static int ath11k_tm_cmd_wmi(struct ath1 + if (tag == WMI_TAG_PDEV_SET_PARAM_CMD) + *ptr = ar->pdev->pdev_id; + +- if (vif && (tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) { +- arvif = (struct ath11k_vif *)vif->drv_priv; +- *ptr = arvif->vdev_id; ++ if (ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM && ++ (tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) { ++ if (vif) { ++ arvif = (struct ath11k_vif *)vif->drv_priv; ++ *ptr = arvif->vdev_id; ++ } ++ else { ++ ret = -EINVAL; ++ ath11k_warn(ar->ab, "vdev is not up for given vdev id, so failed to send wmi command (testmode): %d\n", ++ ret); ++ goto out; ++ } + } + + ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, diff --git a/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-add-debugfs-to-disable-dynamic-bandwidth-oper.patch b/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-add-debugfs-to-disable-dynamic-bandwidth-oper.patch new file mode 100644 index 000000000..9f7fb468c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/236-ath11k-add-debugfs-to-disable-dynamic-bandwidth-oper.patch @@ -0,0 +1,105 @@ +From 804e9b7fb356ead474a64f036ac227fef6ad8bbc Mon Sep 17 00:00:00 2001 +From: Pradeep Kumar Chitrapu +Date: Thu, 21 Jan 2021 11:53:43 -0800 +Subject: [PATCH] ath11k: add debugfs to disable dynamic bandwidth operation + +Bydefault dynamic bandwidth operation is enabled. Setting this debugfs +to 1 disables it. + +Signed-off-by: Pradeep Kumar Chitrapu +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/debugfs.c | 65 +++++++++++++++++++++++++ + 2 files changed, 66 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -524,6 +524,7 @@ struct ath11k_debug { + struct completion wmi_ctrl_path_stats_rcvd; + u32 wmi_ctrl_path_stats_tagid; + struct ath11k_db_module_debug *module_debug[WMI_DIRECT_BUF_MAX]; ++ bool disable_dynamic_bw; + }; + + struct ath11k_per_peer_tx_stats { +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -3478,6 +3478,68 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t ath11k_write_disable_dynamic_bw(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ u32 filter; ++ int ret; ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &filter)) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ if (filter == ar->debug.disable_dynamic_bw) { ++ ret = count; ++ goto out; ++ } ++ ++ ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_DYNAMIC_BW, !filter, ++ ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_err(ar->ab, "failed to %s dynamic bw: %d\n", ++ filter ? "disable" : "enable", ret); ++ goto out; ++ } ++ ++ ar->debug.disable_dynamic_bw = filter; ++ ret = count; ++ ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_read_disable_dynamic_bw(struct file *file, ++ char __user *ubuf, ++ size_t count, loff_t *ppos) ++ ++{ ++ char buf[32] = {0}; ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ len = scnprintf(buf, sizeof(buf) - len, "%08x\n", ++ ar->debug.disable_dynamic_bw); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(ubuf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_disable_dyn_bw = { ++ .read = ath11k_read_disable_dynamic_bw, ++ .write = ath11k_write_disable_dynamic_bw, ++ .open = simple_open ++}; ++ + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +@@ -3527,6 +3589,9 @@ int ath11k_debugfs_register(struct ath11 + debugfs_create_file("dump_mgmt_stats", 0644, + ar->debug.debugfs_pdev, ar, + &fops_dump_mgmt_stats); ++ debugfs_create_file("disable_dynamic_bw", 0644, ++ ar->debug.debugfs_pdev, ar, ++ &fops_disable_dyn_bw); + + debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_pdev, ar, + &fops_ps_state_enable); diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-001-ath11k-Disable-unused-CE8-interrupts.patch b/feeds/wifi-ax/mac80211/patches/qca/237-001-ath11k-Disable-unused-CE8-interrupts.patch new file mode 100644 index 000000000..68527785a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-001-ath11k-Disable-unused-CE8-interrupts.patch @@ -0,0 +1,31 @@ +From b71cab89b4be24528db1f4641825d2a0fd5f8efe Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Mon, 14 Dec 2020 19:05:02 +0530 +Subject: [PATCH] ath11k: Disable unused CE8 interrupts + +Host driver doesn't need to process CE8 interrupts (used +by target independently) + +The volume of interrupts is huge within short interval, + CPU0 CPU1 CPU2 CPU3 +14022188 0 0 0 GIC 71 Edge ce8 + +Hence disable these interrupts. + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/ce.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/ce.c ++++ b/drivers/net/wireless/ath/ath11k/ce.c +@@ -80,7 +80,7 @@ const struct ce_attr ath11k_host_ce_conf + + /* CE8: target autonomous hif_memcpy */ + { +- .flags = CE_ATTR_FLAGS, ++ .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-002-ath11k-Add-provision-to-configure-rx-hashmap.patch b/feeds/wifi-ax/mac80211/patches/qca/237-002-ath11k-Add-provision-to-configure-rx-hashmap.patch new file mode 100644 index 000000000..76214b0ee --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-002-ath11k-Add-provision-to-configure-rx-hashmap.patch @@ -0,0 +1,191 @@ +From 60d0a63d537c280ff9501296cefd322b981b88f5 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Mon, 14 Dec 2020 19:13:49 +0530 +Subject: [PATCH] ath11k: Add provision to configure rx hashmap + +Currently the hashmap is set to default during REO +setup and all REO rings are equally distributed across +32 hash values. + +Add provision to configure the hashmap so that destination +rings can be controlled. Setting 0 will disable hash based +steering. + +echo "hashmap" > /sys/kernel/debug/ath11k/ipq8074\ hw2.0/rx_hash + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/core.h | 2 ++ + drivers/net/wireless/ath/ath11k/debugfs.c | 51 ++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/dp.c | 4 ++- + drivers/net/wireless/ath/ath11k/hal.h | 1 + + drivers/net/wireless/ath/ath11k/hal_rx.c | 30 +++++++++++-------- + 5 files changed, 74 insertions(+), 14 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -967,6 +967,8 @@ struct ath11k_base { + struct ath11k_internal_pci ipci; + bool enable_memory_stats; + ++ u32 rx_hash; ++ + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); + }; +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1414,6 +1414,55 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t ath11k_write_rx_hash(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ struct ath11k_pdev *pdev; ++ u32 rx_hash; ++ u8 buf[128] = {0}; ++ int ret, i, radioup = 0; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ if (pdev && pdev->ar) { ++ radioup = 1; ++ break; ++ } ++ } ++ ++ if (radioup == 0) { ++ ath11k_err(ab, "radio is not up\n"); ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); ++ if (ret < 0) ++ goto exit; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%x", &rx_hash); ++ if (!ret) { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ if (rx_hash != ab->rx_hash) { ++ ab->rx_hash = rx_hash; ++ if (rx_hash) ++ ath11k_hal_reo_hash_setup(ab, rx_hash); ++ } ++ ret = count; ++exit: ++ return ret; ++} ++static const struct file_operations fops_soc_rx_hash = { ++ .open = simple_open, ++ .write = ath11k_write_rx_hash, ++}; ++ + static ssize_t ath11k_debug_write_fw_recovery(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) +@@ -1688,6 +1737,9 @@ int ath11k_debugfs_pdev_create(struct at + debugfs_create_file("ce_latency_stats", 0600, ab->debugfs_soc, ab, + &fops_ce_latency_stats); + ++ debugfs_create_file("rx_hash", 0600, ab->debugfs_soc, ab, ++ &fops_soc_rx_hash); ++ + return 0; + } + +@@ -1840,7 +1892,6 @@ static ssize_t ath11k_write_pktlog_filte + debugfs_create_file("memory_stats", 0600, ab->debugfs_soc, ab, + &fops_memory_stats); + +- + #define HTT_RX_FILTER_TLV_LITE_MODE \ + (HTT_RX_FILTER_TLV_FLAGS_PPDU_START | \ + HTT_RX_FILTER_TLV_FLAGS_PPDU_END | \ +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -48,7 +48,7 @@ int ath11k_dp_peer_setup(struct ath11k * + bool rx_hash_enable = DP_RX_HASH_ENABLE; + + /* RX Hash based steering is disabled for NSS Offload */ +- if (ar->ab->nss.enabled) ++ if (ar->ab->nss.enabled || !ab->rx_hash) + rx_hash_enable = DP_RX_HASH_DISABLE; + + /* NOTE: reo_dest ring id starts from 1 unlike mac_id which starts from 0 */ +@@ -468,6 +468,8 @@ static int ath11k_dp_srng_common_setup(s + + ath11k_hal_reo_hw_setup(ab, ring_hash_map); + ++ ab->rx_hash = ring_hash_map; ++ + return 0; + + err: +--- a/drivers/net/wireless/ath/ath11k/hal.h ++++ b/drivers/net/wireless/ath/ath11k/hal.h +@@ -917,6 +917,7 @@ void ath11k_hal_reo_qdesc_setup(void *va + void ath11k_hal_reo_init_cmd_ring(struct ath11k_base *ab, + struct hal_srng *srng); + void ath11k_hal_reo_hw_setup(struct ath11k_base *ab, u32 ring_hash_map); ++void ath11k_hal_reo_hash_setup(struct ath11k_base *ab, u32 ring_hash_map); + void ath11k_hal_setup_link_idle_list(struct ath11k_base *ab, + struct hal_wbm_idle_scatter_list *sbuf, + u32 nsbufs, u32 tot_link_desc, +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -801,11 +801,25 @@ void ath11k_hal_reo_init_cmd_ring(struct + } + } + +-void ath11k_hal_reo_hw_setup(struct ath11k_base *ab, u32 ring_hash_map) ++void ath11k_hal_reo_hash_setup(struct ath11k_base *ab, u32 ring_hash_map) + { + u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG; + u8 reo_dest_hash_shift = ab->hw_params.reo_dest_ring_map_shift; + ++ /* These registers use only 24bits(3 bits x 8 hash values) for ++ * mapping the dest rings and remaining bits are reserved/not used ++ * so its safe to write them completely. ++ */ ++ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2, ++ ring_hash_map << reo_dest_hash_shift); ++ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3, ++ ring_hash_map << reo_dest_hash_shift); ++} ++ ++void ath11k_hal_reo_hw_setup(struct ath11k_base *ab, u32 ring_hash_map) ++{ ++ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG; ++ + ab->hw_params.hw_ops->set_rx_fragmentation_dst_ring(ab); + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab), + HAL_DEFAULT_REO_TIMEOUT_USEC); +@@ -820,18 +834,7 @@ void ath11k_hal_reo_hw_setup(struct ath1 + if (ab->nss.enabled) + return; + +- /* These registers use only 24bits(3 bits x 8 hash values) for +- * mapping the dest rings and remaining bits are reserved/not used +- * so its safe to write them completely. +- */ +- ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_0, +- ring_hash_map << reo_dest_hash_shift); +- ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_1, +- ring_hash_map << reo_dest_hash_shift); +- ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2, +- ring_hash_map << reo_dest_hash_shift); +- ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3, +- ring_hash_map << reo_dest_hash_shift); ++ ath11k_hal_reo_hash_setup(ab, ring_hash_map); + } + + static inline void diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-003-ath11k-allocate-dst-ring-descriptors-from-cacheable-.patch b/feeds/wifi-ax/mac80211/patches/qca/237-003-ath11k-allocate-dst-ring-descriptors-from-cacheable-.patch new file mode 100644 index 000000000..c3ab5b109 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-003-ath11k-allocate-dst-ring-descriptors-from-cacheable-.patch @@ -0,0 +1,295 @@ +From 61342ee83df7fa0b90d5ece88e3f83dea426802c Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Mon, 14 Dec 2020 20:22:22 +0530 +Subject: [PATCH] ath11k: allocate dst ring descriptors from cacheable + memory + +tcl_data and reo_dst rings are currently being allocated +using dma_allocate_coherent() which is non cachable. + +Allocating ring memory from cacheable memory area +allows cached descriptor access and prefetch next +descriptors to optimize CPU usage during +descriptor processing on NAPI. + +Signed-off-by: Pradeep Kumar Chitrapu +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/dp.c | 39 ++++++++++++++++++++++++++++++----- + drivers/net/wireless/ath/ath11k/dp.h | 1 + + drivers/net/wireless/ath/ath11k/hal.c | 33 ++++++++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/hal.h | 1 + + 4 files changed, 66 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -106,8 +106,11 @@ void ath11k_dp_srng_cleanup(struct ath11 + if (!ring->vaddr_unaligned) + return; + +- dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned, +- ring->paddr_unaligned); ++ if (!ring->cached) ++ dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned, ++ ring->paddr_unaligned); ++ else ++ kfree(ring->vaddr_unaligned); + + ATH11K_MEMORY_STATS_DEC(ab, dma_alloc, ring->size); + +@@ -241,6 +244,7 @@ int ath11k_dp_srng_setup(struct ath11k_b + int entry_sz = ath11k_hal_srng_get_entrysize(ab, type); + int max_entries = ath11k_hal_srng_get_max_entries(ab, type); + int ret; ++ bool cached; + + if (max_entries < 0 || entry_sz < 0) + return -EINVAL; +@@ -248,10 +252,30 @@ int ath11k_dp_srng_setup(struct ath11k_b + if (num_entries > max_entries) + num_entries = max_entries; + ++ /* Allocate the reo dst and tx completion rings from cacheable memory */ ++ switch (type) { ++ case HAL_REO_DST: ++ case HAL_WBM2SW_RELEASE: ++ cached = true; ++ break; ++ default: ++ cached = false; ++ } ++ ++ if (ab->nss.enabled) ++ cached = false; ++ + ring->size = (num_entries * entry_sz) + HAL_RING_BASE_ALIGN - 1; +- ring->vaddr_unaligned = dma_alloc_coherent(ab->dev, ring->size, +- &ring->paddr_unaligned, +- GFP_KERNEL); ++ ++ if (!cached) { ++ ring->vaddr_unaligned = dma_alloc_coherent(ab->dev, ring->size, ++ &ring->paddr_unaligned, ++ GFP_KERNEL); ++ } else { ++ ring->vaddr_unaligned = kzalloc(ring->size, GFP_KERNEL); ++ ring->paddr_unaligned = virt_to_phys(ring->vaddr_unaligned); ++ } ++ + if (!ring->vaddr_unaligned) + return -ENOMEM; + +@@ -313,6 +337,11 @@ int ath11k_dp_srng_setup(struct ath11k_b + return -EINVAL; + } + ++ if (cached) { ++ params.flags |= HAL_SRNG_FLAGS_CACHED; ++ ring->cached = 1; ++ } ++ + ret = ath11k_hal_srng_setup(ab, type, ring_num, mac_id, ¶ms); + if (ret < 0) { + ath11k_warn(ab, "failed to setup srng: %d ring_id %d\n", +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -65,6 +65,7 @@ struct dp_srng { + dma_addr_t paddr; + int size; + u32 ring_id; ++ u8 cached; + }; + + struct dp_rxdma_ring { +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -626,7 +626,8 @@ u32 *ath11k_hal_srng_dst_peek(struct ath + u32 *ath11k_hal_srng_dst_get_next_entry(struct ath11k_base *ab, + struct hal_srng *srng) + { +- u32 *desc; ++ u32 *desc,*desc_next; ++ u32 tp; + + lockdep_assert_held(&srng->lock); + +@@ -638,11 +639,79 @@ u32 *ath11k_hal_srng_dst_get_next_entry( + srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size) % + srng->ring_size; + ++ /* Try to prefetch the next descriptor in the ring */ ++ if (srng->flags & HAL_SRNG_FLAGS_CACHED) { ++ tp = srng->u.dst_ring.tp; ++ /* prefetch only if desc is available */ ++ desc_next = ath11k_hal_srng_dst_peek(ab, srng); ++ if (likely(desc_next)) { ++ dma_sync_single_for_cpu(ab->dev, virt_to_phys(desc_next), ++ (srng->entry_size *sizeof(u32)), ++ DMA_FROM_DEVICE); ++ prefetch(desc_next); ++ } ++ } + return desc; + } + +-int ath11k_hal_srng_dst_num_free(struct ath11k_base *ab, struct hal_srng *srng, +- bool sync_hw_ptr) ++u32 *ath11k_hal_srng_dst_get_next_cache_entry(struct ath11k_base *ab, ++ struct hal_srng *srng) ++{ ++ u32 *desc,*desc_next; ++ ++ lockdep_assert_held(&srng->lock); ++ ++ if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) ++ return NULL; ++ ++ desc = srng->ring_base_vaddr + srng->u.dst_ring.tp; ++ ++ srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size) % ++ srng->ring_size; ++ ++ /* Try to prefetch the next descriptor in the ring */ ++ if (srng->u.dst_ring.tp != srng->u.dst_ring.cached_hp) { ++ /* prefetch only if desc is available */ ++ desc_next = srng->ring_base_vaddr + srng->u.dst_ring.tp; ++ prefetch(desc_next); ++ } ++ return desc; ++} ++ ++void ath11k_hal_srng_dst_invalidate_entry(struct ath11k_base *ab, ++ struct hal_srng *srng, int entries) ++{ ++ u32 *desc; ++ u32 tp, hp; ++ ++ lockdep_assert_held(&srng->lock); ++ ++ if (!(srng->flags & HAL_SRNG_FLAGS_CACHED) || !entries) ++ return; ++ ++ tp = srng->u.dst_ring.tp; ++ hp = srng->u.dst_ring.cached_hp; ++ ++ desc = srng->ring_base_vaddr + tp; ++ if (hp > tp) { ++ dma_sync_single_for_cpu(ab->dev, virt_to_phys(desc), ++ entries * srng->entry_size * sizeof(u32), ++ DMA_FROM_DEVICE); ++ } else { ++ entries = srng->ring_size - tp; ++ dma_sync_single_for_cpu(ab->dev, virt_to_phys(desc), ++ entries * sizeof(u32), ++ DMA_FROM_DEVICE); ++ ++ entries = hp; ++ dma_sync_single_for_cpu(ab->dev, virt_to_phys(srng->ring_base_vaddr), ++ entries * sizeof(u32), ++ DMA_FROM_DEVICE); ++ } ++} ++ ++int ath11k_hal_srng_dst_num_valid(struct ath11k_base *ab, struct hal_srng *srng, ++ bool sync_hw_ptr) + { + u32 tp, hp; + +@@ -769,13 +838,27 @@ u32 *ath11k_hal_srng_src_peek(struct ath + + void ath11k_hal_srng_access_begin(struct ath11k_base *ab, struct hal_srng *srng) + { ++ u32 *desc; ++ + lockdep_assert_held(&srng->lock); + +- if (srng->ring_dir == HAL_SRNG_DIR_SRC) ++ if (srng->ring_dir == HAL_SRNG_DIR_SRC) { + srng->u.src_ring.cached_tp = + *(volatile u32 *)srng->u.src_ring.tp_addr; +- else ++ } else { + srng->u.dst_ring.cached_hp = *srng->u.dst_ring.hp_addr; ++ ++ /* Prefetch the first descriptor memory */ ++ if (srng->flags & HAL_SRNG_FLAGS_CACHED) { ++ desc = ath11k_hal_srng_dst_peek(ab, srng); ++ if (likely(desc)) { ++ dma_sync_single_for_cpu(ab->dev, virt_to_phys(desc), ++ (srng->entry_size *sizeof(u32)), ++ DMA_FROM_DEVICE); ++ prefetch(desc); ++ } ++ } ++ } + } + + /* Update cached ring head/tail pointers to HW. ath11k_hal_srng_access_begin() +--- a/drivers/net/wireless/ath/ath11k/hal.h ++++ b/drivers/net/wireless/ath/ath11k/hal.h +@@ -522,6 +522,7 @@ enum hal_srng_dir { + #define HAL_SRNG_FLAGS_MSI_INTR 0x00020000 + #define HAL_SRNG_FLAGS_LMAC_RING 0x80000000 + #define HAL_SRNG_FLAGS_REMAP_CE_RING 0x10000000 ++#define HAL_SRNG_FLAGS_CACHED 0x20000000 + + #define HAL_SRNG_TLV_HDR_TAG GENMASK(9, 1) + #define HAL_SRNG_TLV_HDR_LEN GENMASK(25, 10) +@@ -940,9 +941,13 @@ void ath11k_hal_srng_get_params(struct a + struct hal_srng_params *params); + u32 *ath11k_hal_srng_dst_get_next_entry(struct ath11k_base *ab, + struct hal_srng *srng); ++u32 *ath11k_hal_srng_dst_get_next_cache_entry(struct ath11k_base *ab, ++ struct hal_srng *srng); + u32 *ath11k_hal_srng_dst_peek(struct ath11k_base *ab, struct hal_srng *srng); +-int ath11k_hal_srng_dst_num_free(struct ath11k_base *ab, struct hal_srng *srng, +- bool sync_hw_ptr); ++int ath11k_hal_srng_dst_num_valid(struct ath11k_base *ab, struct hal_srng *srng, ++ bool sync_hw_ptr); ++void ath11k_hal_srng_dst_invalidate_entry(struct ath11k_base *ab, ++ struct hal_srng *srng, int entries); + u32 *ath11k_hal_srng_src_peek(struct ath11k_base *ab, struct hal_srng *srng); + u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *ab, + struct hal_srng *srng); +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -3011,7 +3011,7 @@ try_again: + * head pointer so that we can reap complete MPDU in the current + * rx processing. + */ +- if (!done && ath11k_hal_srng_dst_num_free(ab, srng, true)) { ++ if (!done && ath11k_hal_srng_dst_num_valid(ab, srng, true)) { + ath11k_hal_srng_access_end(ab, srng); + goto try_again; + } +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -646,6 +646,7 @@ void ath11k_dp_tx_completion_handler(str + struct sk_buff *msdu; + struct hal_tx_status ts = { 0 }; + struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id]; ++ int valid_entries; + u32 *desc; + u32 msdu_id; + u8 mac_id; +@@ -654,9 +655,18 @@ void ath11k_dp_tx_completion_handler(str + + ath11k_hal_srng_access_begin(ab, status_ring); + ++ valid_entries = ath11k_hal_srng_dst_num_valid(ab, status_ring, false); ++ if (!valid_entries) { ++ ath11k_hal_srng_access_end(ab, status_ring); ++ spin_unlock_bh(&status_ring->lock); ++ return; ++ } ++ ++ ath11k_hal_srng_dst_invalidate_entry(ab, status_ring, valid_entries); ++ + while ((ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_head) != + tx_ring->tx_status_tail) && +- (desc = ath11k_hal_srng_dst_get_next_entry(ab, status_ring))) { ++ (desc = ath11k_hal_srng_dst_get_next_cache_entry(ab, status_ring))) { + memcpy(&tx_ring->tx_status[tx_ring->tx_status_head], + desc, sizeof(struct hal_wbm_release_ring)); + tx_ring->tx_status_head = diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-004-ath11k-Modify-dp_rx-desc-access-wrapper-calls-inline.patch b/feeds/wifi-ax/mac80211/patches/qca/237-004-ath11k-Modify-dp_rx-desc-access-wrapper-calls-inline.patch new file mode 100644 index 000000000..41c4f2e97 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-004-ath11k-Modify-dp_rx-desc-access-wrapper-calls-inline.patch @@ -0,0 +1,298 @@ +From dd7302d5d68f555251b9aeb82eb44fb463648a36 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Mon, 14 Dec 2020 21:16:42 +0530 +Subject: [PATCH] ath11k: Modify dp_rx desc access wrapper calls inline + +Modify all the desc access wrapper functions in dp_rx +file as inline to avoid function call overhead. + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 123 ++++++++++++++++---------------- + 1 file changed, 61 insertions(+), 62 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -21,13 +21,13 @@ + + #define ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS (2 * HZ) + +-static u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) ++static inline u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); + } + +-static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) + return HAL_ENCRYPT_TYPE_OPEN; +@@ -35,25 +35,25 @@ static enum hal_encrypt_type ath11k_dp_r + return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_decap_type(struct ath11k_base *ab, ++static inline u8 ath11k_dp_rx_h_msdu_start_decap_type(struct ath11k_base *ab, + struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct ath11k_base *ab, ++static inline u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct ath11k_base *ab, + struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); + } + +-static bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct ath11k_base *ab, ++static inline bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct ath11k_base *ab, + struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); + } + +-static bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct ath11k_base *ab, ++static inline bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct ath11k_base *ab, + struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); +@@ -65,7 +65,7 @@ static u16 ath11k_dp_rxdesc_get_mpdu_fra + return ab->hw_params.hw_ops->rx_desc_get_mpdu_frame_ctl(desc); + } + +-static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, ++static inline bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, + struct sk_buff *skb) + { + struct ieee80211_hdr *hdr; +@@ -74,8 +74,8 @@ static bool ath11k_dp_rx_h_mpdu_start_mo + return ieee80211_has_morefrags(hdr->frame_control); + } + +-static u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct ath11k_base *ab, +- struct sk_buff *skb) ++static inline u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct ath11k_base *ab, ++ struct sk_buff *skb) + { + struct ieee80211_hdr *hdr; + +@@ -83,37 +83,37 @@ static u16 ath11k_dp_rx_h_mpdu_start_fra + return le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; + } + +-static u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); + } + +-static void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_attention(desc); + } + +-static bool ath11k_dp_rx_h_attn_msdu_done(struct rx_attention *attn) ++static inline bool ath11k_dp_rx_h_attn_msdu_done(struct rx_attention *attn) + { + return !!FIELD_GET(RX_ATTENTION_INFO2_MSDU_DONE, + __le32_to_cpu(attn->info2)); + } + +-static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct rx_attention *attn) ++static inline bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct rx_attention *attn) + { + return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, + __le32_to_cpu(attn->info1)); + } + +-static bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct rx_attention *attn) ++static inline bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct rx_attention *attn) + { + return !!FIELD_GET(RX_ATTENTION_INFO1_IP_CKSUM_FAIL, + __le32_to_cpu(attn->info1)); + } + +-static bool ath11k_dp_rx_h_attn_is_decrypted(struct rx_attention *attn) ++static inline bool ath11k_dp_rx_h_attn_is_decrypted(struct rx_attention *attn) + { + return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE, + __le32_to_cpu(attn->info2)) == +@@ -149,68 +149,68 @@ static u32 ath11k_dp_rx_h_attn_mpdu_err( + return errmap; + } + +-static u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); + } + +-static u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); + } + +-static u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); + } + +-u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++inline u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); + } + +-static u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); + } + +-bool ath11k_dp_rx_h_msdu_end_first_msdu(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++inline bool ath11k_dp_rx_h_msdu_end_first_msdu(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); + } +@@ -228,14 +228,14 @@ static void ath11k_dp_rx_desc_end_tlv_co + ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); + } + +-static u32 ath11k_dp_rxdesc_get_mpdulen_err(struct rx_attention *attn) ++static inline u32 ath11k_dp_rxdesc_get_mpdulen_err(struct rx_attention *attn) + { + return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, + __le32_to_cpu(attn->info1)); + } + +-static u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, +- struct hal_rx_desc *rx_desc) ++static inline u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, ++ struct hal_rx_desc *rx_desc) + { + u8 *rx_pkt_hdr; + +@@ -244,8 +244,8 @@ static u8 *ath11k_dp_rxdesc_get_80211hdr + return rx_pkt_hdr; + } + +-static bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, +- struct hal_rx_desc *rx_desc) ++static inline bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, ++ struct hal_rx_desc *rx_desc) + { + u32 tlv_tag; + +@@ -254,15 +254,15 @@ static bool ath11k_dp_rxdesc_mpdu_valid( + return tlv_tag == HAL_RX_MPDU_START; + } + +-static u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, +- struct hal_rx_desc *rx_desc) ++static inline u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, ++ struct hal_rx_desc *rx_desc) + { + return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); + } + +-static void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, +- struct hal_rx_desc *desc, +- u16 len) ++static inline void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, ++ struct hal_rx_desc *desc, ++ u16 len) + { + ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); + } +@@ -301,8 +301,8 @@ static int ath11k_dp_purge_mon_ring(stru + return -ETIMEDOUT; + } + +-bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++inline bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + struct rx_attention *attn = ath11k_dp_rx_get_attention(ab, desc); + +@@ -311,13 +311,13 @@ bool ath11k_dp_rx_h_attn_is_mcbc(struct + __le32_to_cpu(attn->info1))); + } + +-static bool ath11k_dp_rxdesc_mac_addr2_valid(struct ath11k_base *ab, +- struct hal_rx_desc *desc) ++static inline bool ath11k_dp_rxdesc_mac_addr2_valid(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); + } + +-static u8* ath11k_dp_rxdesc_get_mpdu_start_addr2(struct ath11k_base *ab, ++static inline u8* ath11k_dp_rxdesc_get_mpdu_start_addr2(struct ath11k_base *ab, + struct hal_rx_desc *desc) + { + return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2; diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch b/feeds/wifi-ax/mac80211/patches/qca/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch new file mode 100644 index 000000000..2006b3cdd --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch @@ -0,0 +1,449 @@ +From 594992a7ef169aa406e7fc025df2455af5d226be Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Tue, 15 Dec 2020 10:31:30 +0530 +Subject: [PATCH] ath11k: Allow fast rx by bypassing stats update + +Add a provision to disable stats and enable fast rx support +for a peer when it is connected to an AP with ethernet decap support. +All valid IP packets are directly passed to the net core stack +bypassing mac80211 stats update + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/core.h | 3 ++ + drivers/net/wireless/ath/ath11k/debugfs.c | 76 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/dp.c | 45 +++++++++++++++++++ + drivers/net/wireless/ath/ath11k/dp_rx.c | 54 ++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/hw.c | 25 +++++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 1 + + drivers/net/wireless/ath/ath11k/mac.c | 2 + + drivers/net/wireless/ath/ath11k/peer.h | 1 + + 8 files changed, 201 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -124,6 +124,7 @@ struct ath11k_skb_rxcb { + u8 tid; + u16 peer_id; + u16 seq_no; ++ struct napi_struct *napi; + }; + + enum ath11k_hw_rev { +@@ -965,6 +966,7 @@ struct ath11k_base { + bool enable_memory_stats; + + u32 rx_hash; ++ bool stats_disable; + + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1463,6 +1463,79 @@ static const struct file_operations fops + .write = ath11k_write_rx_hash, + }; + ++static void ath11k_debug_config_mon_status(struct ath11k *ar, bool enable) ++{ ++ struct htt_rx_ring_tlv_filter tlv_filter = {0}; ++ struct ath11k_base *ab = ar->ab; ++ int i; ++ u32 ring_id; ++ ++ if (enable) ++ tlv_filter = ath11k_mac_mon_status_filter_default; ++ ++ for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { ++ ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; ++ ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, ++ ar->dp.mac_id + i, ++ HAL_RXDMA_MONITOR_STATUS, ++ DP_RX_BUFFER_SIZE, ++ &tlv_filter); ++ } ++} ++ ++static ssize_t ath11k_write_stats_disable(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ struct ath11k_pdev *pdev; ++ bool disable; ++ int ret, i, radioup = 0; ++ u32 mask = 0; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ if (pdev && pdev->ar) { ++ radioup = 1; ++ break; ++ } ++ } ++ ++ if (radioup == 0) { ++ ath11k_err(ab, "radio is not up\n"); ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ if (kstrtobool_from_user(user_buf, count, &disable)) ++ return -EINVAL; ++ ++ if (disable != ab->stats_disable) { ++ ab->stats_disable = disable; ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ if (pdev && pdev->ar) { ++ ath11k_debug_config_mon_status(pdev->ar, !disable); ++ ++ if (!disable) ++ mask = HTT_PPDU_STATS_TAG_DEFAULT; ++ ++ ath11k_dp_tx_htt_h2t_ppdu_stats_req(pdev->ar, mask); ++ } ++ } ++ } ++ ++ ret = count; ++ ++exit: ++ return ret; ++} ++ ++static const struct file_operations fops_soc_stats_disable = { ++ .open = simple_open, ++ .write = ath11k_write_stats_disable, ++}; ++ + static ssize_t ath11k_debug_write_fw_recovery(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) +@@ -1774,6 +1847,9 @@ int ath11k_debugfs_soc_create(struct ath + return -ENOMEM; + } + ++ debugfs_create_file("stats_disable", 0600, ab->debugfs_soc, ab, ++ &fops_soc_stats_disable); ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -352,6 +352,12 @@ static void ath11k_dp_rx_desc_get_crypto + ab->hw_params.hw_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); + } + ++static inline u8 ath11k_dp_rx_h_msdu_start_ip_valid(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_ip_valid(desc); ++} ++ + /* Returns number of Rx buffers replenished */ + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, +@@ -2490,10 +2496,60 @@ ath11k_dp_rx_h_find_peer(struct ath11k_b + return peer; + } + ++static bool ath11k_dp_rx_check_fast_rx(struct ath11k *ar, ++ struct sk_buff *msdu, ++ struct hal_rx_desc *rx_desc, ++ struct ath11k_peer *peer) ++{ ++ struct ethhdr *ehdr; ++ struct ath11k_peer *f_peer; ++ struct ath11k_skb_rxcb *rxcb; ++ u8 decap; ++ ++ lockdep_assert_held(&ar->ab->base_lock); ++ ++ decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); ++ rxcb = ATH11K_SKB_RXCB(msdu); ++ ++ if (!ar->ab->stats_disable || ++ decap != DP_RX_DECAP_TYPE_ETHERNET2_DIX || ++ peer->vif->type != NL80211_IFTYPE_AP) ++ return false; ++ ++ /* mcbc packets go through mac80211 for PN validation */ ++ if (rxcb->is_mcbc) ++ return false; ++ ++ if (!peer->is_authorized) ++ return false; ++ ++ if (!ath11k_dp_rx_h_msdu_start_ip_valid(ar->ab, rx_desc)) ++ return false; ++ ++ /* fast rx is supported only on ethernet decap, so ++ * we can directly gfet the ethernet header ++ */ ++ ehdr = (struct ethhdr *)msdu->data; ++ ++ /* requires rebroadcast from mac80211 */ ++ if (is_multicast_ether_addr(ehdr->h_dest)) ++ return false; ++ ++ /* check if the msdu needs to be bridged to our connected peer */ ++ f_peer = ath11k_peer_find_by_addr(ar->ab, ehdr->h_dest); ++ ++ if (f_peer && f_peer != peer) ++ return false; ++ ++ /* allow direct rx */ ++ return true; ++} ++ + static void ath11k_dp_rx_h_mpdu(struct ath11k *ar, + struct sk_buff *msdu, + struct hal_rx_desc *rx_desc, +- struct ieee80211_rx_status *rx_status) ++ struct ieee80211_rx_status *rx_status, ++ bool *fast_rx) + { + bool fill_crypto_hdr; + enum hal_encrypt_type enctype; +@@ -2503,6 +2559,7 @@ static void ath11k_dp_rx_h_mpdu(struct a + struct ath11k_peer *peer; + struct rx_attention *rx_attention; + u32 err_bitmap; ++ struct wireless_dev *wdev = NULL; + + /* PN for multicast packets will be checked in mac80211 */ + rxcb = ATH11K_SKB_RXCB(msdu); +@@ -2516,6 +2573,25 @@ static void ath11k_dp_rx_h_mpdu(struct a + spin_lock_bh(&ar->ab->base_lock); + peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); + if (peer) { ++ /* If the pkt is a valid IP packet and peer supports ++ * fast rx, deliver directly to net, also note that ++ * pkts with crypto error are not expected to arrive in this ++ * path, so its safe to skip checking errors here */ ++ if (*fast_rx && ++ ath11k_dp_rx_check_fast_rx(ar, msdu, rx_desc, peer)) { ++ wdev = ieee80211_vif_to_wdev(peer->vif); ++ if (wdev) { ++ spin_unlock_bh(&ar->ab->base_lock); ++ ath11k_dp_rx_h_csum_offload(ar, msdu); ++ msdu->dev = wdev->netdev; ++ msdu->protocol = eth_type_trans(msdu, msdu->dev); ++ napi_gro_receive(rxcb->napi, msdu); ++ return; ++ } ++ } ++ ++ *fast_rx = false; ++ + if (rxcb->is_mcbc) + enctype = peer->sec_type_grp; + else +@@ -2778,7 +2854,8 @@ static void ath11k_dp_rx_deliver_msdu(st + static int ath11k_dp_rx_process_msdu(struct ath11k *ar, + struct sk_buff *msdu, + struct sk_buff_head *msdu_list, +- struct ieee80211_rx_status *rx_status) ++ struct ieee80211_rx_status *rx_status, ++ bool *fast_rx) + { + struct ath11k_base *ab = ar->ab; + struct hal_rx_desc *rx_desc, *lrx_desc; +@@ -2854,8 +2931,13 @@ static int ath11k_dp_rx_process_msdu(str + } + } + ++ ath11k_dp_rx_h_mpdu(ar, msdu, rx_desc, rx_status, fast_rx); ++ if (*fast_rx) { ++ ab->soc_stats.invalid_rbm++; ++ return 0; ++ } ++ + ath11k_dp_rx_h_ppdu(ar, rx_desc, rx_status); +- ath11k_dp_rx_h_mpdu(ar, msdu, rx_desc, rx_status); + + rx_status->flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; + +@@ -2876,6 +2958,7 @@ static void ath11k_dp_rx_process_receive + struct ieee80211_rx_status rx_status = {0}; + u8 mac_id; + int ret; ++ bool fast_rx; + + if (skb_queue_empty(msdu_list)) + return; +@@ -2896,7 +2979,11 @@ static void ath11k_dp_rx_process_receive + continue; + } + +- ret = ath11k_dp_rx_process_msdu(ar, msdu, msdu_list, &rx_status); ++ /* Enable fast rx by default, the value will cahnge based on peer cap ++ * and packet type */ ++ fast_rx = true; ++ rxcb->napi = napi; ++ ret = ath11k_dp_rx_process_msdu(ar, msdu, msdu_list, &rx_status, &fast_rx); + if (ret) { + ath11k_dbg(ab, ATH11K_DBG_DATA, + "Unable to process msdu %d", ret); +@@ -2904,7 +2991,10 @@ static void ath11k_dp_rx_process_receive + continue; + } + +- ath11k_dp_rx_deliver_msdu(ar, napi, msdu, &rx_status); ++ /* msdu is already delivered directectly */ ++ if (!fast_rx) ++ ath11k_dp_rx_deliver_msdu(ar, napi, msdu, &rx_status); ++ + (*quota)--; + } + +@@ -4491,6 +4581,7 @@ static int ath11k_dp_rx_h_null_q_desc(st + struct ath11k_sta *arsta = NULL; + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; + u32 peer_id; ++ bool fast_rx; + + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); + +@@ -4534,7 +4625,8 @@ static int ath11k_dp_rx_h_null_q_desc(st + } + ath11k_dp_rx_h_ppdu(ar, desc, status); + +- ath11k_dp_rx_h_mpdu(ar, msdu, desc, status); ++ fast_rx = false; ++ ath11k_dp_rx_h_mpdu(ar, msdu, desc, status, &fast_rx); + + rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); + +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -225,6 +225,16 @@ static u8 ath11k_hw_ipq8074_rx_desc_get_ + __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); + } + ++static u8 ath11k_hw_ipq8074_rx_desc_get_ip_valid(struct hal_rx_desc *desc) ++{ ++ bool ipv4, ipv6; ++ ipv4 = FIELD_GET(RX_MSDU_START_INFO2_IPV4, ++ __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); ++ ipv6 = FIELD_GET(RX_MSDU_START_INFO2_IPV6, ++ __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); ++ return (ipv4 || ipv6); ++} ++ + static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) + { + return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, +@@ -539,6 +549,16 @@ static u8 ath11k_hw_qcn9074_rx_desc_get_ + __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); + } + ++static u8 ath11k_hw_qcn9074_rx_desc_get_ip_valid(struct hal_rx_desc *desc) ++{ ++ bool ipv4 , ipv6; ++ ipv4 = FIELD_GET(RX_MSDU_START_INFO2_IPV4, ++ __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); ++ ipv6 = FIELD_GET(RX_MSDU_START_INFO2_IPV6, ++ __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); ++ return (ipv4 || ipv6); ++} ++ + static bool ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) + { + return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID, +@@ -842,6 +862,7 @@ const struct ath11k_hw_ops ipq8074_ops = + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_ipq8074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, +@@ -890,6 +911,7 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_ipq8074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, +@@ -938,6 +960,7 @@ const struct ath11k_hw_ops qca6390_ops = + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_ipq8074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, +@@ -991,6 +1014,7 @@ const struct ath11k_hw_ops qcn9074_ops = + .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_qcn9074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, +@@ -1040,6 +1064,7 @@ const struct ath11k_hw_ops ipq5018_ops = + .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_qcn9074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, +@@ -1088,6 +1113,7 @@ const struct ath11k_hw_ops qcn6122_ops = + .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_qcn9074_rx_desc_get_ip_valid, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -222,6 +222,7 @@ struct ath11k_hw_ops { + u32 (*rx_desc_get_encrypt_type)(struct hal_rx_desc *desc); + u8 (*rx_desc_get_decap_type)(struct hal_rx_desc *desc); + u8 (*rx_desc_get_mesh_ctl)(struct hal_rx_desc *desc); ++ u8 (*rx_desc_get_ip_valid)(struct hal_rx_desc *desc); + bool (*rx_desc_get_mpdu_seq_ctl_vld)(struct hal_rx_desc *desc); + bool (*rx_desc_get_mpdu_fc_valid)(struct hal_rx_desc *desc); + u16 (*rx_desc_get_mpdu_start_seq_no)(struct hal_rx_desc *desc); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4830,6 +4830,22 @@ static int ath11k_mac_op_sta_state(struc + ath11k_warn(ar->ab, "failed to cfg dyn vlan for peer %pM: %d\n", + sta->addr, ret); + } ++ ++ spin_lock_bh(&ar->ab->base_lock); ++ peer = ath11k_peer_find(ar->ab, arvif->vdev_id, sta->addr); ++ if (peer && peer->sta) ++ peer->is_authorized = true; ++ spin_unlock_bh(&ar->ab->base_lock); ++ ++ } else if (old_state == IEEE80211_STA_AUTHORIZED && ++ new_state == IEEE80211_STA_ASSOC) { ++ ++ spin_lock_bh(&ar->ab->base_lock); ++ peer = ath11k_peer_find(ar->ab, arvif->vdev_id, sta->addr); ++ if (peer && peer->sta) ++ peer->is_authorized = false; ++ spin_unlock_bh(&ar->ab->base_lock); ++ + } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH && + (vif->type == NL80211_IFTYPE_AP || +--- a/drivers/net/wireless/ath/ath11k/peer.h ++++ b/drivers/net/wireless/ath/ath11k/peer.h +@@ -92,6 +92,7 @@ struct ath11k_peer { + + struct ppdu_user_delayba ppdu_stats_delayba; + bool delayba_flag; ++ bool is_authorized; + }; + + void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-007-ath11k-optimizations-in-ath11k_dp_process_rx.patch b/feeds/wifi-ax/mac80211/patches/qca/237-007-ath11k-optimizations-in-ath11k_dp_process_rx.patch new file mode 100644 index 000000000..1b764a76b --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-007-ath11k-optimizations-in-ath11k_dp_process_rx.patch @@ -0,0 +1,266 @@ +From 0fe4a7f57a44a0aaad6fb1d6861c9fb9597358a2 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Tue, 15 Dec 2020 11:27:48 +0530 +Subject: [PATCH] ath11k: optimizations in ath11k_dp_process_rx() + +Incaludes below changes, + 1. Increment total_msdu_reaped only when continuation is not set and update + drop flag correspondingly. This is to avoid additional access to ath11k_hal_srng_dst_num_free() + 2. Avoid descriptor memcpy as the data is prefetched already + 3. The Active Pdev and CAC check are done for each msdu in ath11k_dp_rx_process_received_packets + Rather, collect all msdu's in a per mac msdu list, and pass to the function. + 4. Add branch predictors where required in the process rx() + 5. Remove usage of quota variable since we add only max napi budget msdus to the list + 6. Prefetch the initial descriptor part which is used by all the hw ops for msdu info collection. + + About 3-4% improvement on single radio UDP UL on single core was seen. + More validation/confirmation on perf stats required. + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 107 ++++++++++++++++---------------- + 1 file changed, 55 insertions(+), 52 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2856,6 +2856,9 @@ static int ath11k_dp_rx_process_msdu(str + int ret; + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; + ++ /* Prefetch the full descriptor range before hdr status into cache */ ++ prefetch_range(msdu->data, 256); ++ + last_buf = ath11k_dp_rx_get_msdu_last_buf(msdu_list, msdu); + if (!last_buf) { + ath11k_warn(ab, +@@ -2920,10 +2923,8 @@ static int ath11k_dp_rx_process_msdu(str + } + + ath11k_dp_rx_h_mpdu(ar, msdu, rx_desc, rx_status, fast_rx); +- if (*fast_rx) { +- ab->soc_stats.invalid_rbm++; ++ if (*fast_rx) + return 0; +- } + + ath11k_dp_rx_h_ppdu(ar, rx_desc, rx_status); + +@@ -2938,13 +2939,12 @@ free_out: + static void ath11k_dp_rx_process_received_packets(struct ath11k_base *ab, + struct napi_struct *napi, + struct sk_buff_head *msdu_list, +- int *quota, int ring_id) ++ int mac_id) + { + struct ath11k_skb_rxcb *rxcb; + struct sk_buff *msdu; + struct ath11k *ar; + struct ieee80211_rx_status rx_status = {0}; +- u8 mac_id; + int ret; + bool fast_rx; + +@@ -2953,26 +2953,28 @@ static void ath11k_dp_rx_process_receive + + rcu_read_lock(); + +- while (*quota && (msdu = __skb_dequeue(msdu_list))) { +- rxcb = ATH11K_SKB_RXCB(msdu); +- mac_id = rxcb->mac_id; +- ar = ab->pdevs[mac_id].ar; +- if (!rcu_dereference(ab->pdevs_active[mac_id])) { +- dev_kfree_skb_any(msdu); +- continue; +- } + +- if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { +- dev_kfree_skb_any(msdu); +- continue; +- } ++ ar = ab->pdevs[mac_id].ar; ++ if (unlikely(!rcu_dereference(ab->pdevs_active[mac_id]))) { ++ __skb_queue_purge(msdu_list); ++ rcu_read_unlock(); ++ return; ++ } + ++ if (unlikely(test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags))) { ++ __skb_queue_purge(msdu_list); ++ rcu_read_unlock(); ++ return; ++ } ++ ++ while ((msdu = __skb_dequeue(msdu_list))) { ++ rxcb = ATH11K_SKB_RXCB(msdu); + /* Enable fast rx by default, the value will cahnge based on peer cap + * and packet type */ + fast_rx = true; + rxcb->napi = napi; + ret = ath11k_dp_rx_process_msdu(ar, msdu, msdu_list, &rx_status, &fast_rx); +- if (ret) { ++ if (unlikely(ret)) { + ath11k_dbg(ab, ATH11K_DBG_DATA, + "Unable to process msdu %d", ret); + dev_kfree_skb_any(msdu); +@@ -2982,8 +2984,6 @@ static void ath11k_dp_rx_process_receive + /* msdu is already delivered directectly */ + if (!fast_rx) + ath11k_dp_rx_deliver_msdu(ar, napi, msdu, &rx_status); +- +- (*quota)--; + } + + rcu_read_unlock(); +@@ -2995,22 +2995,24 @@ int ath11k_dp_process_rx(struct ath11k_b + struct ath11k_dp *dp = &ab->dp; + struct dp_rxdma_ring *rx_ring; + int num_buffs_reaped[MAX_RADIOS] = {0}; +- struct sk_buff_head msdu_list; ++ struct sk_buff_head msdu_list[MAX_RADIOS]; + struct ath11k_skb_rxcb *rxcb; + int total_msdu_reaped = 0; + struct hal_srng *srng; + struct sk_buff *msdu; + struct ath11k_peer *peer = NULL; + struct ath11k_sta *arsta = NULL; +- int quota = budget; + bool done = false; + int buf_id, mac_id; + struct ath11k *ar; +- u32 *rx_desc; ++ struct hal_reo_dest_ring *desc; ++ enum hal_reo_dest_ring_push_reason push_reason; ++ u32 cookie; + int i; + +- __skb_queue_head_init(&msdu_list); + ++ for (i = 0; i < MAX_RADIOS; i++) ++ __skb_queue_head_init(&msdu_list[i]); + srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; + + spin_lock_bh(&srng->lock); +@@ -3018,13 +3020,9 @@ int ath11k_dp_process_rx(struct ath11k_b + ath11k_hal_srng_access_begin(ab, srng); + + try_again: +- while ((rx_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { +- struct hal_reo_dest_ring desc = *(struct hal_reo_dest_ring *)rx_desc; +- enum hal_reo_dest_ring_push_reason push_reason; +- u32 cookie; +- ++ while (likely(desc = (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, srng))) { + cookie = FIELD_GET(BUFFER_ADDR_INFO1_SW_COOKIE, +- desc.buf_addr_info.info1); ++ desc->buf_addr_info.info1); + buf_id = FIELD_GET(DP_RXDMA_BUF_COOKIE_BUF_ID, + cookie); + mac_id = FIELD_GET(DP_RXDMA_BUF_COOKIE_PDEV_ID, cookie); +@@ -3033,7 +3031,7 @@ try_again: + rx_ring = &ar->dp.rx_refill_buf_ring; + spin_lock_bh(&rx_ring->idr_lock); + msdu = idr_find(&rx_ring->bufs_idr, buf_id); +- if (!msdu) { ++ if (unlikely(!msdu)) { + ath11k_warn(ab, "frame rx with invalid buf_id %d\n", + buf_id); + spin_unlock_bh(&rx_ring->idr_lock); +@@ -3049,29 +3047,28 @@ try_again: + DMA_FROM_DEVICE); + + num_buffs_reaped[mac_id]++; +- total_msdu_reaped++; + + push_reason = FIELD_GET(HAL_REO_DEST_RING_INFO0_PUSH_REASON, +- desc.info0); +- if (push_reason != +- HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION) { ++ desc->info0); ++ if (unlikely(push_reason != ++ HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION)) { + dev_kfree_skb_any(msdu); + ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; + continue; + } + +- rxcb->is_first_msdu = !!(desc.rx_msdu_info.info0 & ++ rxcb->is_first_msdu = !!(desc->rx_msdu_info.info0 & + RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU); +- rxcb->is_last_msdu = !!(desc.rx_msdu_info.info0 & ++ rxcb->is_last_msdu = !!(desc->rx_msdu_info.info0 & + RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU); +- rxcb->is_continuation = !!(desc.rx_msdu_info.info0 & ++ rxcb->is_continuation = !!(desc->rx_msdu_info.info0 & + RX_MSDU_DESC_INFO0_MSDU_CONTINUATION); + rxcb->peer_id = FIELD_GET(RX_MPDU_DESC_META_DATA_PEER_ID, +- desc.rx_mpdu_info.meta_data); ++ desc->rx_mpdu_info.meta_data); + rxcb->seq_no = FIELD_GET(RX_MPDU_DESC_INFO0_SEQ_NUM, +- desc.rx_mpdu_info.info0); ++ desc->rx_mpdu_info.info0); + rxcb->tid = FIELD_GET(HAL_REO_DEST_RING_INFO0_RX_QUEUE_NUM, +- desc.info0); ++ desc->info0); + + if (ath11k_debugfs_is_extd_rx_stats_enabled(ar) && rxcb->peer_id) { + rcu_read_lock(); +@@ -3087,12 +3084,17 @@ try_again: + } + + rxcb->mac_id = mac_id; +- __skb_queue_tail(&msdu_list, msdu); ++ __skb_queue_tail(&msdu_list[mac_id], msdu); + +- if (total_msdu_reaped >= quota && !rxcb->is_continuation) { ++ if (!rxcb->is_continuation) { ++ total_msdu_reaped++; + done = true; +- break; ++ } else { ++ done = false; + } ++ ++ if (total_msdu_reaped >= budget) ++ break; + } + + /* Hw might have updated the head pointer after we cached it. +@@ -3101,7 +3103,7 @@ try_again: + * head pointer so that we can reap complete MPDU in the current + * rx processing. + */ +- if (!done && ath11k_hal_srng_dst_num_valid(ab, srng, true)) { ++ if (unlikely(!done && ath11k_hal_srng_dst_num_valid(ab, srng, true))) { + ath11k_hal_srng_access_end(ab, srng); + goto try_again; + } +@@ -3110,13 +3112,14 @@ try_again: + + spin_unlock_bh(&srng->lock); + +- if (!total_msdu_reaped) ++ if (unlikely(!total_msdu_reaped)) + goto exit; + + for (i = 0; i < ab->num_radios; i++) { + if (!num_buffs_reaped[i]) + continue; + ++ ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list[i], i); + ar = ab->pdevs[i].ar; + rx_ring = &ar->dp.rx_refill_buf_ring; + +@@ -3124,11 +3127,8 @@ try_again: + HAL_RX_BUF_RBM_SW3_BM); + } + +- ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list, +- "a, ring_id); +- + exit: +- return budget - quota; ++ return total_msdu_reaped; + } + + static void diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-add-debugfs-interface-to-configure-firmware-d.patch b/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-add-debugfs-interface-to-configure-firmware-d.patch new file mode 100644 index 000000000..15f64dc72 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-add-debugfs-interface-to-configure-firmware-d.patch @@ -0,0 +1,233 @@ +From c7a64ef56edcc32c18431ec7aba345b20eda5e8f Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Mon, 25 Jan 2021 10:10:30 +0530 +Subject: [PATCH] ath11k: add debugfs interface to configure firmware dbg log + level + +Added debugfs interface "fw_dbglog_config" to configure firmware log levels. +Configuration is done via WMI command WMI_DBGLOG_CFG_CMDID. + +Command to configure, +echo " " > /sys/kernel/debug/ath11k//fw_dbglog_config + +where dbglog_param can be, + 1) WMI_DEBUG_LOG_PARAM_LOG_LEVEL - configure log level for a given module + here, = <0xaaaa00bb>, 'aaaa' - module id and 'bb' - loglevel + 2) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE - enable the debug log for a given vdev + here, = vdev_id + 3) WMI_DEBUG_LOG_PARAM_VDEV_DISABLE - disable debug log for a given vdev + except ERROR logs + here, = vdev_id + 4) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE_BITMAP - set vdev enable bitmap + here, = vdev_enable_bitmap + 5) WMI_DEBUG_LOG_PARAM_MOD_ENABLE_BITMAP - set a given log level to all the + modules specified in the module bitmap + here, = <0xaaaaaaaa000000bb>, 'aaaaaaaa' - module bitmap and + 'bb' - loglevel + 6) WMI_DEBUG_LOG_PARAM_WOW_MOD_ENABLE_BITMAP - Wow mode specific logging enable + here, = <0xaaaaaaaa000000bb>, 'aaaaaaaa' - module bitmap and + 'bb' - loglevel + +Sample command usage, +echo "1 0xffff0001" > /sys/kernel/debug/ath11k/qcn9000\ hw1.0_0000 +\:01\:00.0/fw_dbglog_config + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/core.h | 2 + + drivers/net/wireless/ath/ath11k/debugfs.c | 66 ++++++++++++++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/wmi.c | 48 ++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 16 ++++++++ + 4 files changed, 131 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -967,6 +967,8 @@ struct ath11k_base { + int userpd_id; + struct ath11k_internal_pci ipci; + bool enable_memory_stats; ++ u32 fw_dbglog_param; ++ u64 fw_dbglog_val; + + u32 rx_hash; + bool stats_disable; +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1790,6 +1790,71 @@ static const struct file_operations fops + .read = ath11k_read_ce_latency_stats, + }; + ++static ssize_t ath11k_read_fw_dbglog(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ size_t len; ++ char buf[128]; ++ ++ len = scnprintf(buf, sizeof(buf), "%u 0x%016llx\n", ++ ab->fw_dbglog_param, ab->fw_dbglog_val); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_write_fw_dbglog(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_base *ab = file->private_data; ++ struct ath11k *ar = ab->pdevs[0].ar; ++ char buf[128] = {0}; ++ unsigned int param; ++ u64 value; ++ int ret; ++ ++ if (!ar) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ++ user_buf, count); ++ if (ret <= 0) ++ goto out; ++ ++ ret = sscanf(buf, "%u %llx", ¶m, &value); ++ ++ if (ret != 2) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ ab->fw_dbglog_param = param; ++ ab->fw_dbglog_val = value; ++ ret = ath11k_wmi_dbglog_cfg(ar, param, value); ++ if (ret) { ++ ath11k_warn(ar, "dbglog cfg failed from debugfs: %d\n", ++ ret); ++ goto out; ++ } ++ ++ ret = count; ++ ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_fw_dbglog = { ++ .read = ath11k_read_fw_dbglog, ++ .write = ath11k_write_fw_dbglog, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + int ath11k_debugfs_pdev_create(struct ath11k_base *ab) + { + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) +@@ -1809,6 +1874,9 @@ int ath11k_debugfs_pdev_create(struct at + + debugfs_create_file("ce_latency_stats", 0600, ab->debugfs_soc, ab, + &fops_ce_latency_stats); ++ debugfs_create_file("fw_dbglog_config", 0600, ab->debugfs_soc, ab, ++ &fops_fw_dbglog); ++ + + debugfs_create_file("rx_hash", 0600, ab->debugfs_soc, ab, + &fops_soc_rx_hash); +@@ -3759,7 +3827,6 @@ int ath11k_debugfs_register(struct ath11 + + debugfs_create_file("enable_dbr_debug", 0200, ar->debug.debugfs_pdev, + ar, &fops_dbr_debug); +- + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -8683,6 +8683,55 @@ int ath11k_wmi_pdev_get_tpc_table_cmdid( + return ret; + } + ++int ath11k_wmi_dbglog_cfg(struct ath11k *ar, u32 param, u64 value) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct wmi_dbglog_config_cmd_fixed_param *cmd; ++ struct sk_buff *skb; ++ struct wmi_tlv *tlv; ++ u32 module_id_bitmap; ++ int ret, len; ++ ++ len = sizeof(*cmd) + TLV_HDR_SIZE + sizeof(module_id_bitmap); ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); ++ if (!skb) ++ return -ENOMEM; ++ cmd = (struct wmi_dbglog_config_cmd_fixed_param *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DEBUG_LOG_CONFIG_CMD) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); ++ cmd->dbg_log_param = param; ++ ++ tlv = (u8 *) cmd + sizeof(*cmd); ++ tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(u32)); ++ ++ switch (param) { ++ case WMI_DEBUG_LOG_PARAM_LOG_LEVEL: ++ case WMI_DEBUG_LOG_PARAM_VDEV_ENABLE: ++ case WMI_DEBUG_LOG_PARAM_VDEV_DISABLE: ++ case WMI_DEBUG_LOG_PARAM_VDEV_ENABLE_BITMAP: ++ cmd->value = value; ++ break; ++ case WMI_DEBUG_LOG_PARAM_MOD_ENABLE_BITMAP: ++ case WMI_DEBUG_LOG_PARAM_WOW_MOD_ENABLE_BITMAP: ++ cmd->value = value; ++ module_id_bitmap = value >> 32; ++ memcpy(tlv->value, &module_id_bitmap, sizeof(module_id_bitmap)); ++ break; ++ default: ++ dev_kfree_skb(skb); ++ return -EINVAL; ++ } ++ ++ ret = ath11k_wmi_cmd_send(wmi, skb, WMI_DBGLOG_CFG_CMDID); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "failed to send WMI_DBGLOG_CFG_CMDID\n"); ++ dev_kfree_skb(skb); ++ } ++ return ret; ++} ++ + static void ath11k_wmi_twt_add_dialog_event(struct ath11k_base *ab, struct sk_buff *skb) + { + const char *status[] = { +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -6111,6 +6111,21 @@ struct wmi_qos_null_tx_cmd { + u32 tx_params_valid; + } __packed; + ++enum wmi_dblog_param { ++ WMI_DEBUG_LOG_PARAM_LOG_LEVEL = 0x1, ++ WMI_DEBUG_LOG_PARAM_VDEV_ENABLE, ++ WMI_DEBUG_LOG_PARAM_VDEV_DISABLE, ++ WMI_DEBUG_LOG_PARAM_VDEV_ENABLE_BITMAP, ++ WMI_DEBUG_LOG_PARAM_MOD_ENABLE_BITMAP, ++ WMI_DEBUG_LOG_PARAM_WOW_MOD_ENABLE_BITMAP, ++}; ++ ++struct wmi_dbglog_config_cmd_fixed_param { ++ u32 tlv_header; ++ u32 dbg_log_param; ++ u32 value; ++} __packed; ++ + #define WMI_MAX_MEM_REQS 32 + + #define MAX_RADIOS 3 +@@ -6496,4 +6511,5 @@ int ath11k_wmi_send_aggr_size_cmd(struct + struct set_custom_aggr_size_params *params); + int ath11k_wmi_send_wmi_ctrl_stats_cmd(struct ath11k *ar, + struct wmi_ctrl_path_stats_cmd_param *param); ++int ath11k_wmi_dbglog_cfg(struct ath11k *ar, u32 param, u64 value); + #endif diff --git a/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-fix-radiotap-rate-info.patch b/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-fix-radiotap-rate-info.patch new file mode 100644 index 000000000..bd6fc13b5 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/237-ath11k-fix-radiotap-rate-info.patch @@ -0,0 +1,153 @@ +From 3a74003841f04a5daac160e26c51d81c1dd99fd7 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Mon, 25 Jan 2021 19:54:00 +0530 +Subject: ath11k: Fix rate in monior mode radiotap header + +Packet Rate info is not part of msdu in mon_dst_ring, +rate is updated from monitor status ring. + +Signed-off-by: Anilkumar Kolli +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 20 ++++++++++++++++---- + drivers/net/wireless/ath/ath11k/hal_rx.c | 1 + + 2 files changed, 17 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -5704,31 +5704,42 @@ ath11k_dp_rx_update_radiotap_he_mu(struc + rtap_buf[rtap_len] = rx_status->he_RU[3]; + } + +-static void ath11k_update_radiotap(struct hal_rx_mon_ppdu_info *ppduinfo, +- struct sk_buff *mon_skb, +- struct ieee80211_rx_status *rxs) ++static void ath11k_update_radiotap(struct ath11k *ar, ++ struct hal_rx_mon_ppdu_info *ppduinfo, ++ struct sk_buff *mon_skb, ++ struct ieee80211_rx_status *rxs) + { ++ struct ieee80211_supported_band *sband; + u8 *ptr = NULL; + ++ rxs->flag |= RX_FLAG_MACTIME_START; ++ rxs->signal = ppduinfo->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; ++ rxs->nss = ppduinfo->nss + 1; ++ + if (ppduinfo->he_mu_flags) { + rxs->flag |= RX_FLAG_RADIOTAP_HE_MU; + rxs->encoding = RX_ENC_HE; + ptr = skb_push(mon_skb, sizeof(struct ieee80211_radiotap_he_mu)); + ath11k_dp_rx_update_radiotap_he_mu(ppduinfo, ptr); +- } +- if (ppduinfo->he_flags) { ++ } else if (ppduinfo->he_flags) { + rxs->flag |= RX_FLAG_RADIOTAP_HE; + rxs->encoding = RX_ENC_HE; + ptr = skb_push(mon_skb, sizeof(struct ieee80211_radiotap_he)); + ath11k_dp_rx_update_radiotap_he(ppduinfo, ptr); ++ rxs->rate_idx = ppduinfo->rate; ++ } else if (ppduinfo->vht_flags) { ++ rxs->encoding = RX_ENC_VHT; ++ rxs->rate_idx = ppduinfo->rate; ++ } else if (ppduinfo->ht_flags) { ++ rxs->encoding = RX_ENC_HT; ++ rxs->rate_idx = ppduinfo->rate; ++ } else { ++ rxs->encoding = RX_ENC_LEGACY; ++ sband = &ar->mac.sbands[rxs->band]; ++ rxs->rate_idx = ath11k_mac_hw_rate_to_idx(sband, ppduinfo->rate, ++ ppduinfo->cck_flag); + } + +- rxs->flag |= RX_FLAG_MACTIME_START; +- rxs->signal = ppduinfo->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; +- +- if (ppduinfo->nss) +- rxs->nss = ppduinfo->nss; +- + rxs->mactime = ppduinfo->tsft; + } + +@@ -5763,7 +5774,7 @@ static int ath11k_dp_rx_mon_deliver(stru + rxs->flag |= RX_FLAG_ALLOW_SAME_PN; + } + rxs->flag |= RX_FLAG_ONLY_MONITOR; +- ath11k_update_radiotap(ppduinfo, mon_skb, rxs); ++ ath11k_update_radiotap(ar, ppduinfo, mon_skb, rxs); + ath11k_dp_rx_deliver_msdu(ar, napi, mon_skb, rxs); + mon_skb = skb_next; + } while (mon_skb); +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -1032,7 +1032,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + info1); + ppdu_info->ldpc = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING, info1); + ppdu_info->gi = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_GI, info1); +- ppdu_info->nss = (ppdu_info->mcs >> 3) + 1; ++ ppdu_info->nss = (ppdu_info->mcs >> 3); + ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU; + break; + } +@@ -1064,6 +1064,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + rate = HAL_RX_LEGACY_RATE_INVALID; + } + ppdu_info->rate = rate; ++ ppdu_info->cck_flag = 1; + ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU; + break; + } +@@ -1137,7 +1138,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + if (ppdu_info->is_stbc && nsts > 0) + nsts = ((nsts + 1) >> 1) - 1; + +- ppdu_info->nss = (nsts & VHT_SIG_SU_NSS_MASK) + 1; ++ ppdu_info->nss = (nsts & VHT_SIG_SU_NSS_MASK); + ppdu_info->bw = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO0_BW, + info0); + ppdu_info->beamformed = info1 & +@@ -1160,7 +1161,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + case HAL_PHYRX_HE_SIG_A_SU: { + struct hal_rx_he_sig_a_su_info *he_sig_a = + (struct hal_rx_he_sig_a_su_info *)tlv_data; +- u32 nsts, cp_ltf, dcm, value; ++ u32 cp_ltf, dcm, value; + ppdu_info->he_flags = 1; + + info0 = __le32_to_cpu(he_sig_a->info0); +@@ -1280,7 +1281,6 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + /* data6 */ + value = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS, info0); + value++; +- ppdu_info->nss = value; + ppdu_info->he_data6 = value; + value = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO1_DOPPLER_IND, info1); + value = value << HE_DOPPLER_SHIFT; +@@ -1303,9 +1303,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + dcm = info0 & HAL_RX_HE_SIG_A_SU_INFO_INFO0_DCM; + cp_ltf = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_CP_LTF_SIZE, + info0); +- nsts = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS, info0); +- +- ppdu_info->nss = nsts + 1; ++ ppdu_info->nss = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS, info0); + ppdu_info->dcm = dcm; + ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU; + break; +@@ -1482,7 +1480,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + + ppdu_info->nss = + FIELD_GET(HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS, +- info0) + 1; ++ info0); + break; + } + case HAL_PHYRX_HE_SIG_B2_OFDMA: { +@@ -1520,7 +1518,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + + ppdu_info->nss = + FIELD_GET(HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_NSTS, +- info0) + 1; ++ info0); + ppdu_info->beamformed = + info0 & HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF; + ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_OFDMA; diff --git a/feeds/wifi-ax/mac80211/patches/qca/238-ath11k-add-cfr-support-for-ipq8074.patch b/feeds/wifi-ax/mac80211/patches/qca/238-ath11k-add-cfr-support-for-ipq8074.patch new file mode 100644 index 000000000..684550245 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/238-ath11k-add-cfr-support-for-ipq8074.patch @@ -0,0 +1,2044 @@ +From 5cd2da1a4d9cf177444d3633d9cfdc0a68573587 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Wed, 10 Feb 2021 18:17:04 +0530 +Subject: [PATCH] ath11k: add CFR capture support for ipq8074 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This change is to add single shot/periodic CFR capture +support for ipq8074. + +To enable/disable cfr feature use command, +echo > /sys/kernel/debug/ieee80211/phyX/ath11k/enable_cfr +where, val: 0 to disable CFR and 1 to enable CFR. + +To enable CFR capture for associated peers, +echo " " + > /sys/kernel/debug/ieee80211/phyX/netdev\:wlanx/stations//cfr_capture +val: 0 - stop CFR capture + 1 - start CFR capture +bw: CFR capture bandwidth + 0 - 20MHZ + 1 - 40MHZ + 2 - 80MHZ +Periodicity: Periodicity at which hardware is expceted to collect CFR dump. + 0 - single shot capture. + non zero - for Periodic captures (value should be multiple of 10). +method: Method used by hardware to collect the CFR dump. + 0 - from the ACKs of QOS NULL packets. + +To enable CFR capture for unassociated clients, +echo “ ” + > /sys/kernel/debug/ieee80211/phyX/ath11k/cfr_unassoc +Mac address: mac address of the client. +Val: 0 - start CFR capture + 1 – stop CFR capture +Periodicity: Periodicity at which hardware is expceted to collect CFR dump. + 0 - single shot capture. + non zero - for Periodic captures (value should be multiple of 10). + +To collect the cfr dump, +cat /sys/kernel/debug/ieee80211/phy0/ath11k/cfr_capture0 > /tmp/cfr.bin + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/Kconfig | 9 + + drivers/net/wireless/ath/ath11k/Makefile | 1 + + drivers/net/wireless/ath/ath11k/cfr.c | 878 ++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/cfr.h | 282 +++++++++ + drivers/net/wireless/ath/ath11k/core.c | 15 + + drivers/net/wireless/ath/ath11k/core.h | 16 +- + drivers/net/wireless/ath/ath11k/dbring.c | 28 +- + drivers/net/wireless/ath/ath11k/dbring.h | 11 +- + drivers/net/wireless/ath/ath11k/debugfs.h | 2 + + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 157 +++++ + drivers/net/wireless/ath/ath11k/hal.c | 2 +- + drivers/net/wireless/ath/ath11k/hw.h | 4 + + drivers/net/wireless/ath/ath11k/mac.c | 11 +- + drivers/net/wireless/ath/ath11k/spectral.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.c | 137 +++- + drivers/net/wireless/ath/ath11k/wmi.h | 91 ++- + local-symbols | 1 + + 17 files changed, 1629 insertions(+), 18 deletions(-) + create mode 100644 drivers/net/wireless/ath/ath11k/cfr.c + create mode 100644 drivers/net/wireless/ath/ath11k/cfr.h + +--- a/drivers/net/wireless/ath/ath11k/Kconfig ++++ b/drivers/net/wireless/ath/ath11k/Kconfig +@@ -84,3 +84,12 @@ config ATH11K_MEM_PROFILE_512M + default n + ---help--- + Enables 512MB memory profile for ath11k ++ ++config ATH11K_CFR ++ bool "QCA ath11k CFR support" ++ depends on ATH11K_DEBUGFS ++ depends on RELAY ++ help ++ Enable ath11k cfr dump support ++ ++ Say Y to enable access to collect cfr data dump via debugfs. +--- a/drivers/net/wireless/ath/ath11k/Makefile ++++ b/drivers/net/wireless/ath/ath11k/Makefile +@@ -28,6 +28,7 @@ ath11k-$(CONFIG_WANT_DEV_COREDUMP) += co + ath11k-$(CPTCFG_ATH11K_SPECTRAL) += spectral.o + ath11k-$(CPTCFG_ATH11K_PKTLOG) += pktlog.o + ath11k-$(CPTCFG_ATH11K_NSS_SUPPORT) += nss.o ++ath11k-$(CPTCFG_ATH11K_CFR) += cfr.o + + obj-$(CPTCFG_ATH11K_AHB) += ath11k_ahb.o + ath11k_ahb-y += ahb.o +--- /dev/null ++++ b/drivers/net/wireless/ath/ath11k/cfr.c +@@ -0,0 +1,878 @@ ++// SPDX-License-Identifier: BSD-3-Clause-Clear ++/* ++ * Copyright (c) 2020 The Linux Foundation. All rights reserved. ++ */ ++ ++#include ++#include "core.h" ++#include "debug.h" ++ ++bool peer_is_in_cfr_unassoc_pool(struct ath11k *ar, u8 *peer_mac) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct cfr_unassoc_pool_entry *entry; ++ int i; ++ ++ if (!ar->cfr_enabled) ++ return false; ++ ++ spin_lock_bh(&cfr->lock); ++ for (i = 0; i < ATH11K_MAX_CFR_ENABLED_CLIENTS; i++) { ++ entry = &cfr->unassoc_pool[i]; ++ if (!entry->is_valid) ++ continue; ++ ++ if (ether_addr_equal(peer_mac, entry->peer_mac)) { ++ /* Remove entry if it is single shot */ ++ if (entry->period == 0) { ++ memset(entry->peer_mac, 0 , ETH_ALEN); ++ entry->is_valid = false; ++ cfr->cfr_enabled_peer_cnt--; ++ } ++ spin_unlock_bh(&cfr->lock); ++ return true; ++ } ++ } ++ ++ spin_unlock_bh(&cfr->lock); ++ ++ return false; ++} ++ ++void ath11k_cfr_lut_update_paddr(struct ath11k *ar, dma_addr_t paddr, ++ u32 buf_id) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct ath11k_cfr_look_up_table *lut; ++ ++ if (cfr->lut) { ++ lut = &cfr->lut[buf_id]; ++ lut->dbr_address = paddr; ++ } ++} ++ ++void ath11k_cfr_decrement_peer_count(struct ath11k *ar, ++ struct ath11k_sta *arsta) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ ++ spin_lock_bh(&cfr->lock); ++ ++ if (arsta->cfr_capture.cfr_enable) ++ cfr->cfr_enabled_peer_cnt--; ++ ++ spin_unlock_bh(&cfr->lock); ++} ++ ++struct ath11k_dbring *ath11k_cfr_get_dbring(struct ath11k *ar) ++{ ++ if (ar->cfr_enabled) ++ return &ar->cfr.rx_ring; ++ else ++ return NULL; ++} ++ ++static int cfr_calculate_tones_form_dma_hdr(struct ath11k_cfir_dma_hdr *hdr) ++{ ++ u8 bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, hdr->info1); ++ u8 preamble = FIELD_GET(CFIR_DMA_HDR_INFO1_PREABLE_TYPE, hdr->info1); ++ ++ switch (preamble) { ++ case ATH11K_CFR_PREAMBLE_TYPE_LEGACY: ++ case ATH11K_CFR_PREAMBLE_TYPE_VHT: ++ switch (bw) { ++ case 0: ++ return TONES_IN_20MHZ; ++ case 1: /* DUP40/VHT40 */ ++ return TONES_IN_40MHZ; ++ case 2: /* DUP80/VHT80 */ ++ return TONES_IN_80MHZ; ++ case 3: /* DUP160/VHT160 */ ++ return TONES_IN_160MHZ; ++ } ++ ++ case ATH11K_CFR_PREAMBLE_TYPE_HT: ++ switch (bw) { ++ case 0: ++ return TONES_IN_20MHZ; ++ case 1: ++ return TONES_IN_40MHZ; ++ } ++ } ++ ++ return TONES_INVALID; ++} ++ ++static inline ++void ath11k_cfr_release_lut_entry(struct ath11k_cfr_look_up_table *lut) ++{ ++ memset(lut, 0, sizeof(*lut)); ++} ++ ++static void ath11k_cfr_rfs_write(struct ath11k *ar, const void *head, ++ u32 head_len, const void *data, u32 data_len, ++ const void * tail, int tail_data) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ ++ if (!ar->cfr.rfs_cfr_capture) ++ return; ++ ++ relay_write(cfr->rfs_cfr_capture, head, head_len); ++ relay_write(cfr->rfs_cfr_capture, data, data_len); ++ relay_write(cfr->rfs_cfr_capture, tail, tail_data); ++ relay_flush(cfr->rfs_cfr_capture); ++} ++ ++static void ath11k_cfr_free_pending_dbr_events(struct ath11k *ar) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct ath11k_cfr_look_up_table *lut = NULL; ++ int i; ++ ++ if (!cfr->lut) ++ return; ++ ++ for (i = 0; i < cfr->lut_num; i++) { ++ lut = &cfr->lut[i]; ++ if (lut->dbr_recv && !lut->tx_recv && ++ (lut->dbr_tstamp < cfr->last_success_tstamp)) { ++ ath11k_dbring_bufs_replenish(ar, &cfr->rx_ring, lut->buff, ++ WMI_DIRECT_BUF_CFR, GFP_ATOMIC); ++ ath11k_cfr_release_lut_entry(lut); ++ cfr->flush_dbr_cnt++; ++ } ++ } ++} ++ ++/* Correlate and relay: This function correlate the data coming from ++ * WMI_PDEV_DMA_RING_BUF_RELEASE_EVENT(DBR event) and ++ * WMI_PEER_CFR_CAPTURE_EVENT(Tx capture event). if both the events ++ * are received and PPDU id matches from the both events, ++ * return CORRELATE_STATUS_RELEASE which means relay the correlated data ++ * to user space. Otherwise return CORRELATE_STATUS_HOLD which means wait ++ * for the second event to come. It will return CORRELATE_STATUS_ERR in ++ * case of any error. ++ * ++ * It also check for the pending DBR events and clear those events ++ * in case of corresponding TX capture event is not received for ++ * the PPDU. ++ */ ++ ++static int ath11k_cfr_correlate_and_relay(struct ath11k *ar, ++ struct ath11k_cfr_look_up_table *lut, ++ u8 event_type) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ u64 diff; ++ ++ if (event_type == ATH11K_CORRELATE_TX_EVENT) { ++ if (lut->tx_recv) ++ cfr->cfr_dma_aborts++; ++ cfr->tx_evt_cnt++; ++ lut->tx_recv = true; ++ } else if (event_type == ATH11K_CORRELATE_DBR_EVENT) { ++ cfr->dbr_evt_cnt++; ++ lut->dbr_recv = true; ++ } ++ ++ if (lut->dbr_recv && lut->tx_recv) { ++ if (lut->dbr_ppdu_id == lut->tx_ppdu_id) { ++ cfr->last_success_tstamp = lut->dbr_tstamp; ++ if (lut->dbr_tstamp > lut->txrx_tstamp) { ++ diff = lut->dbr_tstamp - lut->txrx_tstamp; ++ ath11k_dbg(ar->ab, ATH11K_DBG_CFR, ++ "txrx event -> dbr event delay = %u ms", ++ jiffies_to_msecs(diff)); ++ } else if (lut->txrx_tstamp > lut->dbr_tstamp) { ++ diff = lut->txrx_tstamp - lut->dbr_tstamp; ++ ath11k_dbg(ar->ab, ATH11K_DBG_CFR, ++ "dbr event -> txrx event delay = %u ms", ++ jiffies_to_msecs(diff)); ++ } ++ ++ ath11k_cfr_free_pending_dbr_events(ar); ++ ++ cfr->release_cnt++; ++ return ATH11K_CORRELATE_STATUS_RELEASE; ++ } else { ++ /* ++ * When there is a ppdu id mismatch, discard the TXRX ++ * event since multiple PPDUs are likely to have same ++ * dma addr, due to ucode aborts. ++ */ ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_CFR, ++ "Received dbr event twice for the same lut entry"); ++ lut->tx_recv = false; ++ lut->tx_ppdu_id = 0; ++ cfr->clear_txrx_event++; ++ cfr->cfr_dma_aborts++; ++ return ATH11K_CORRELATE_STATUS_HOLD; ++ } ++ } else { ++ return ATH11K_CORRELATE_STATUS_HOLD; ++ } ++} ++ ++static int ath11k_cfr_process_data(struct ath11k *ar, ++ struct ath11k_dbring_data *param) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct ath11k_cfr_look_up_table *lut; ++ struct ath11k_csi_cfr_header *header; ++ struct ath11k_cfir_dma_hdr dma_hdr; ++ u8 *data; ++ u32 end_magic = ATH11K_CFR_END_MAGIC; ++ u32 buf_id; ++ u32 tones; ++ u32 length; ++ int status; ++ u8 num_chains; ++ int ret = 0; ++ ++ data = param->data; ++ buf_id = param->buf_id; ++ ++ memcpy(&dma_hdr, data, sizeof(struct ath11k_cfir_dma_hdr)); ++ ++ tones = cfr_calculate_tones_form_dma_hdr(&dma_hdr); ++ if (tones == TONES_INVALID) { ++ ath11k_err(ar->ab, "Number of tones received is invalid"); ++ return -EINVAL; ++ } ++ ++ num_chains = FIELD_GET(CFIR_DMA_HDR_INFO1_NUM_CHAINS, ++ dma_hdr.info1); ++ ++ length = sizeof(struct ath11k_cfir_dma_hdr); ++ length += tones * (num_chains + 1); ++ ++ spin_lock_bh(&cfr->lut_lock); ++ ++ if (!cfr->lut) { ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ lut = &cfr->lut[buf_id]; ++ ++ if (!lut) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "lut failure to process cfr data id:%d\n", buf_id); ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ ath11k_dbg_dump(ab, ATH11K_DBG_CFR_DUMP,"data_from_buf_rel:", "", ++ data, length); ++ ++ lut->buff = param->buff; ++ lut->data = data; ++ lut->data_len = length; ++ lut->dbr_ppdu_id = dma_hdr.phy_ppdu_id; ++ lut->dbr_tstamp = jiffies; ++ ++ memcpy(&lut->hdr, &dma_hdr, sizeof(struct ath11k_cfir_dma_hdr)); ++ ++ header = &lut->header; ++ header->u.meta_v2.channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, ++ dma_hdr.info1); ++ header->u.meta_v2.length = length; ++ ++ status = ath11k_cfr_correlate_and_relay(ar, lut, ++ ATH11K_CORRELATE_DBR_EVENT); ++ if (status == ATH11K_CORRELATE_STATUS_RELEASE) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "releasing CFR data to user space"); ++ ath11k_cfr_rfs_write(ar, &lut->header, ++ sizeof(struct ath11k_csi_cfr_header), ++ lut->data, lut->data_len, ++ &end_magic, sizeof(u32)); ++ ath11k_cfr_release_lut_entry(lut); ++ ret = ATH11K_CORRELATE_STATUS_RELEASE; ++ } else if (status == ATH11K_CORRELATE_STATUS_HOLD) { ++ ret = ATH11K_CORRELATE_STATUS_HOLD; ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "tx event is not yet received holding the buf"); ++ } else { ++ ret = ATH11K_CORRELATE_STATUS_ERR; ++ ath11k_cfr_release_lut_entry(lut); ++ ath11k_err(ab, "error in correlating events"); ++ } ++ ++ spin_unlock_bh(&cfr->lut_lock); ++ ++ return ret; ++} ++ ++static void ath11k_cfr_fill_hdr_info(struct ath11k *ar, ++ struct ath11k_csi_cfr_header *header, ++ struct ath11k_cfr_peer_tx_param *params) ++{ ++ header->cfr_metadata_version = ATH11K_CFR_META_VERSION_2; ++ header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; ++ /* TODO: can we add this chip_type to hw param table */ ++ header->chip_type = ATH11K_CFR_RADIO_IPQ8074; ++ header->u.meta_v2.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, ++ params->status); ++ header->u.meta_v2.capture_bw = params->bandwidth; ++ header->u.meta_v2.phy_mode = params->phy_mode; ++ header->u.meta_v2.prim20_chan = params->primary_20mhz_chan; ++ header->u.meta_v2.center_freq1 = params->band_center_freq1; ++ header->u.meta_v2.center_freq2 = params->band_center_freq2; ++ ++ /* Currently CFR data is captured on ACK of a Qos NULL frame. ++ * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy. ++ */ ++ header->u.meta_v2.capture_mode = params->bandwidth ? ++ ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; ++ header->u.meta_v2.capture_type = params->capture_method; ++ header->u.meta_v2.num_rx_chain = ar->num_rx_chains; ++ header->u.meta_v2.sts_count = params->spatial_streams; ++ header->u.meta_v2.timestamp = params->timestamp_us; ++ memcpy(header->u.meta_v2.peer_addr, params->peer_mac_addr, ETH_ALEN); ++ memcpy(header->u.meta_v2.chain_rssi, params->chain_rssi, ++ sizeof(params->chain_rssi)); ++ memcpy(header->u.meta_v2.chain_phase, params->chain_phase, ++ sizeof(params->chain_phase)); ++} ++ ++int ath11k_process_cfr_capture_event(struct ath11k_base *ab, ++ struct ath11k_cfr_peer_tx_param *params) ++{ ++ struct ath11k *ar; ++ struct ath11k_cfr *cfr; ++ struct ath11k_vif *arvif; ++ struct ath11k_cfr_look_up_table *lut = NULL, *temp = NULL; ++ struct ath11k_dbring_element *buff; ++ struct ath11k_csi_cfr_header *header; ++ dma_addr_t buf_addr; ++ u32 end_magic = ATH11K_CFR_END_MAGIC; ++ u8 tx_status; ++ int ret = 0; ++ int status; ++ int i; ++ ++ rcu_read_lock(); ++ arvif = ath11k_mac_get_arvif_by_vdev_id(ab, params->vdev_id); ++ if (!arvif) { ++ ath11k_warn(ab, "Failed to get arvif for vdev id %d\n", ++ params->vdev_id); ++ rcu_read_unlock(); ++ return -ENOENT; ++ } ++ ++ ar = arvif->ar; ++ cfr = &ar->cfr; ++ rcu_read_unlock(); ++ ++ if (WMI_CFR_CAPTURE_STATUS_PEER_PS & params->status) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "CFR capture failed as peer %pM is in powersave", ++ params->peer_mac_addr); ++ return -EINVAL; ++ } ++ ++ if (!(WMI_CFR_PEER_CAPTURE_STATUS & params->status)) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "CFR capture failed for the peer : %pM", ++ params->peer_mac_addr); ++ cfr->tx_peer_status_cfr_fail++; ++ return -EINVAL; ++ } ++ ++ tx_status = FIELD_GET(WMI_CFR_FRAME_TX_STATUS, params->status); ++ ++ if (tx_status != WMI_FRAME_TX_STATUS_OK) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "WMI tx status %d for the peer %pM", ++ tx_status, params->peer_mac_addr); ++ cfr->tx_evt_status_cfr_fail++; ++ return -EINVAL; ++ } ++ ++ buf_addr = (((u64)FIELD_GET(WMI_CFR_CORRELATION_INFO2_BUF_ADDR_HIGH, ++ params->correlation_info_2)) << 32) | ++ params->correlation_info_1; ++ ++ spin_lock_bh(&cfr->lut_lock); ++ ++ if (!cfr->lut) { ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ for (i = 0; i < cfr->lut_num; i++) { ++ temp = &cfr->lut[i]; ++ if (temp->dbr_address == buf_addr) { ++ lut = &cfr->lut[i]; ++ break; ++ } ++ } ++ ++ if (!lut) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "lut failure to process tx event\n"); ++ cfr->tx_dbr_lookup_fail++; ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ lut->tx_ppdu_id = FIELD_GET(WMI_CFR_CORRELATION_INFO2_PPDU_ID, ++ params->correlation_info_2); ++ lut->tx_address1 = params->correlation_info_1; ++ lut->tx_address2 = params->correlation_info_2; ++ lut->txrx_tstamp = jiffies; ++ ++ header = &lut->header; ++ header->start_magic_num = ATH11K_CFR_START_MAGIC; ++ header->vendorid = VENDOR_QCA; ++ header->pltform_type = PLATFORM_TYPE_ARM; ++ ++ ath11k_cfr_fill_hdr_info(ar, header, params); ++ ++ status = ath11k_cfr_correlate_and_relay(ar, lut, ++ ATH11K_CORRELATE_TX_EVENT); ++ if (status == ATH11K_CORRELATE_STATUS_RELEASE) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "Releasing CFR data to user space"); ++ ath11k_cfr_rfs_write(ar, &lut->header, ++ sizeof(struct ath11k_csi_cfr_header), ++ lut->data, lut->data_len, ++ &end_magic, sizeof(u32)); ++ buff = lut->buff; ++ ath11k_cfr_release_lut_entry(lut); ++ ++ ath11k_dbring_bufs_replenish(ar, &cfr->rx_ring, buff, ++ WMI_DIRECT_BUF_CFR, GFP_ATOMIC); ++ } else if (status == ATH11K_CORRELATE_STATUS_HOLD) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "dbr event is not yet received holding buf\n"); ++ } else { ++ ath11k_cfr_release_lut_entry(lut); ++ ret = -EINVAL; ++ } ++ ++ spin_unlock_bh(&cfr->lut_lock); ++ return ret; ++} ++ ++static struct dentry *create_buf_file_handler(const char *filename, ++ struct dentry *parent, ++ umode_t mode, ++ struct rchan_buf *buf, ++ int *is_global) ++{ ++ struct dentry *buf_file; ++ ++ buf_file = debugfs_create_file(filename, mode, parent, buf, ++ &relay_file_operations); ++ *is_global = 1; ++ return buf_file; ++} ++ ++static int remove_buf_file_handler(struct dentry *dentry) ++{ ++ debugfs_remove(dentry); ++ ++ return 0; ++} ++ ++static struct rchan_callbacks rfs_cfr_capture_cb = { ++ .create_buf_file = create_buf_file_handler, ++ .remove_buf_file = remove_buf_file_handler, ++}; ++ ++static ssize_t ath11k_read_file_enable_cfr(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ char buf[32] = {0}; ++ size_t len; ++ ++ mutex_lock(&ar->conf_mutex); ++ len = scnprintf(buf, sizeof(buf), "%d\n", ar->cfr_enabled); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_write_file_enable_cfr(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ u8 enable_cfr; ++ int ret; ++ ++ if (kstrtouint_from_user(ubuf, count, 0, &enable_cfr)) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ if (enable_cfr > 1) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (ar->cfr_enabled == enable_cfr) { ++ ret = count; ++ goto out; ++ } ++ ++ ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_PER_PEER_CFR_ENABLE, ++ enable_cfr, ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "Failed to enable/disable per peer cfr (%d)\n", ++ ret); ++ goto out; ++ } ++ ++ ar->cfr_enabled = enable_cfr; ++ ret = count; ++ ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_enable_cfr = { ++ .read = ath11k_read_file_enable_cfr, ++ .write = ath11k_write_file_enable_cfr, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_write_file_cfr_unassoc(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct cfr_unassoc_pool_entry *entry; ++ char buf[64] = {0}; ++ u8 peer_mac[6]; ++ u32 cfr_capture_enable; ++ u32 cfr_capture_period; ++ int available_idx = -1; ++ int ret, i; ++ ++ simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); ++ ++ mutex_lock(&ar->conf_mutex); ++ spin_lock_bh(&cfr->lock); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ if (!ar->cfr_enabled) { ++ ret = -EINVAL; ++ ath11k_err(ar->ab, "CFR is not enabled on this pdev %d\n", ++ ar->pdev_idx); ++ goto out; ++ } ++ ++ ret = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %u %u", ++ &peer_mac[0], &peer_mac[1], &peer_mac[2], &peer_mac[3], ++ &peer_mac[4], &peer_mac[5], &cfr_capture_enable, ++ &cfr_capture_period); ++ ++ if (ret < 1) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (cfr_capture_enable && ret != 8) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (!cfr_capture_enable) { ++ for (i = 0; i < ATH11K_MAX_CFR_ENABLED_CLIENTS; i++) { ++ entry = &cfr->unassoc_pool[i]; ++ if (ether_addr_equal(peer_mac, entry->peer_mac)) { ++ memset(entry->peer_mac, 0, ETH_ALEN); ++ entry->is_valid = false; ++ cfr->cfr_enabled_peer_cnt--; ++ } ++ } ++ ++ ret = count; ++ goto out; ++ } ++ ++ ++ if (cfr->cfr_enabled_peer_cnt >= ATH11K_MAX_CFR_ENABLED_CLIENTS) { ++ ath11k_info(ar->ab, "Max cfr peer threshold reached\n"); ++ ret = count; ++ goto out; ++ } ++ ++ for (i = 0; i < ATH11K_MAX_CFR_ENABLED_CLIENTS; i++) { ++ entry = &cfr->unassoc_pool[i]; ++ ++ if ((available_idx < 0) && !entry->is_valid) ++ available_idx = i; ++ ++ if (ether_addr_equal(peer_mac, entry->peer_mac)) { ++ ath11k_info(ar->ab, ++ "peer entry already present updating params\n"); ++ entry->period = cfr_capture_period; ++ ret = count; ++ goto out; ++ } ++ } ++ ++ if (available_idx >= 0) { ++ entry = &cfr->unassoc_pool[available_idx]; ++ ether_addr_copy(entry->peer_mac, peer_mac); ++ entry->period = cfr_capture_period; ++ entry->is_valid = true; ++ cfr->cfr_enabled_peer_cnt++; ++ } ++ ++ ret = count; ++out: ++ spin_unlock_bh(&cfr->lock); ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_read_file_cfr_unassoc(struct file *file, ++ char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ char buf[512] = {0}; ++ struct ath11k *ar = file->private_data; ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct cfr_unassoc_pool_entry *entry; ++ int len = 0, i; ++ ++ mutex_lock(&ar->conf_mutex); ++ spin_lock_bh(&cfr->lock); ++ ++ for (i = 0; i < ATH11K_MAX_CFR_ENABLED_CLIENTS; i++) { ++ entry = &cfr->unassoc_pool[i]; ++ if (entry->is_valid) ++ len += scnprintf(buf + len, sizeof(buf) - len, ++ "peer: %pM period: %u\n", ++ entry->peer_mac, entry->period); ++ } ++ ++ spin_unlock_bh(&cfr->lock); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(ubuf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_configure_cfr_unassoc = { ++ .write = ath11k_write_file_cfr_unassoc, ++ .read = ath11k_read_file_cfr_unassoc, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static inline void ath11k_cfr_debug_unregister(struct ath11k *ar) ++{ ++ debugfs_remove(ar->cfr.enable_cfr); ++ ar->cfr.enable_cfr = NULL; ++ debugfs_remove(ar->cfr.cfr_unassoc); ++ ar->cfr.cfr_unassoc = NULL; ++ ++ if (ar->cfr.rfs_cfr_capture) { ++ relay_close(ar->cfr.rfs_cfr_capture); ++ ar->cfr.rfs_cfr_capture = NULL; ++ } ++} ++ ++static inline int ath11k_cfr_debug_register(struct ath11k *ar) ++{ ++ int ret; ++ ++ ar->cfr.rfs_cfr_capture = relay_open("cfr_capture", ++ ar->debug.debugfs_pdev, ++ ar->ab->hw_params.cfr_stream_buf_size, ++ ar->ab->hw_params.cfr_num_stream_bufs, ++ &rfs_cfr_capture_cb, NULL); ++ if (!ar->cfr.rfs_cfr_capture) { ++ ath11k_warn(ar->ab, "failed to open relay for cfr in pdev %d\n", ++ ar->pdev_idx); ++ return -EINVAL; ++ } ++ ++ ar->cfr.enable_cfr = debugfs_create_file("enable_cfr", 0600, ++ ar->debug.debugfs_pdev, ar, ++ &fops_enable_cfr); ++ if (!ar->cfr.enable_cfr) { ++ ath11k_warn(ar->ab, "failed to open debugfs in pdev %d\n", ++ ar->pdev_idx); ++ ret = -EINVAL; ++ goto debug_unregister; ++ } ++ ++ ar->cfr.cfr_unassoc = debugfs_create_file("cfr_unassoc", 0600, ++ ar->debug.debugfs_pdev, ar, ++ &fops_configure_cfr_unassoc); ++ ++ if (!ar->cfr.cfr_unassoc) { ++ ath11k_warn(ar->ab, ++ "failed to open debugfs for unassoc pool in pdev %d\n", ++ ar->pdev_idx); ++ ret = -EINVAL; ++ goto debug_unregister; ++ } ++ ++ return 0; ++ ++debug_unregister : ++ ath11k_cfr_debug_unregister(ar); ++ return ret; ++} ++ ++static int ath11k_cfr_ring_alloc(struct ath11k *ar, ++ struct ath11k_dbring_cap *db_cap) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ int ret; ++ ++ ret = ath11k_dbring_srng_setup(ar, &cfr->rx_ring, ++ 1, db_cap->min_elem); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to setup db ring\n"); ++ return ret; ++ } ++ ++ ath11k_dbring_set_cfg(ar, &cfr->rx_ring, ++ ATH11K_CFR_NUM_RESP_PER_EVENT, ++ ATH11K_CFR_EVENT_TIMEOUT_MS, ++ ath11k_cfr_process_data); ++ ++ ret = ath11k_dbring_buf_setup(ar, &cfr->rx_ring, db_cap); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to setup db ring buffer\n"); ++ goto srng_cleanup; ++ } ++ ++ ret = ath11k_dbring_wmi_cfg_setup(ar, &cfr->rx_ring, WMI_DIRECT_BUF_CFR); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to setup db ring cfg\n"); ++ goto buffer_cleanup; ++ } ++ ++ return 0; ++ ++buffer_cleanup: ++ ath11k_dbring_buf_cleanup(ar, &cfr->rx_ring); ++srng_cleanup: ++ ath11k_dbring_srng_cleanup(ar, &cfr->rx_ring); ++ return ret; ++} ++ ++void ath11k_cfr_ring_free(struct ath11k *ar) ++{ ++ struct ath11k_cfr *cfr = &ar->cfr; ++ ++ ath11k_dbring_srng_cleanup(ar, &cfr->rx_ring); ++ ath11k_dbring_buf_cleanup(ar, &cfr->rx_ring); ++} ++ ++void ath11k_cfr_deinit(struct ath11k_base *ab) ++{ ++ struct ath11k *ar; ++ struct ath11k_cfr *cfr; ++ int i; ++ ++ if (!test_bit(WMI_TLV_SERVICE_CFR_CAPTURE_SUPPORT, ++ ab->wmi_ab.svc_map) || !ab->hw_params.cfr_support) ++ return; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ ar = ab->pdevs[i].ar; ++ cfr = &ar->cfr; ++ ++ ath11k_cfr_debug_unregister(ar); ++ ath11k_cfr_ring_free(ar); ++ ++ spin_lock_bh(&cfr->lut_lock); ++ if (cfr->lut) { ++ kfree(cfr->lut); ++ cfr->lut = NULL; ++ } ++ ++ spin_unlock_bh(&cfr->lut_lock); ++ ar->cfr_enabled = 0; ++ } ++} ++ ++int ath11k_cfr_init(struct ath11k_base *ab) ++{ ++ struct ath11k *ar; ++ struct ath11k_cfr *cfr; ++ struct ath11k_dbring_cap db_cap; ++ struct ath11k_cfr_look_up_table *lut; ++ u32 num_lut_entries; ++ int ret = 0; ++ int i; ++ ++ if (!test_bit(WMI_TLV_SERVICE_CFR_CAPTURE_SUPPORT, ++ ab->wmi_ab.svc_map) || !ab->hw_params.cfr_support) ++ return ret; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ ar = ab->pdevs[i].ar; ++ cfr = &ar->cfr; ++ ++ ret = ath11k_dbring_get_cap(ar->ab, ar->pdev_idx, ++ WMI_DIRECT_BUF_CFR, &db_cap); ++ if (ret) ++ continue; ++ ++ idr_init(&cfr->rx_ring.bufs_idr); ++ spin_lock_init(&cfr->rx_ring.idr_lock); ++ spin_lock_init(&cfr->lock); ++ spin_lock_init(&cfr->lut_lock); ++ ++ num_lut_entries = min((u32)CFR_MAX_LUT_ENTRIES, db_cap.min_elem); ++ ++ cfr->lut = kzalloc(num_lut_entries * sizeof(*lut), GFP_KERNEL); ++ if (!cfr->lut) { ++ ath11k_warn(ab, "failed to allocate lut for pdev %d\n", i); ++ return -ENOMEM; ++ } ++ ++ ret = ath11k_cfr_ring_alloc(ar, &db_cap); ++ if (ret) { ++ ath11k_warn(ab, "failed to init cfr ring for pdev %d\n", i); ++ goto deinit; ++ } ++ ++ spin_lock_bh(&cfr->lock); ++ cfr->lut_num = num_lut_entries; ++ spin_unlock_bh(&cfr->lock); ++ ++ ret = ath11k_cfr_debug_register(ar); ++ if (ret) { ++ ath11k_warn(ab, "failed to register cfr for pdev %d\n", i); ++ goto deinit; ++ } ++ } ++ ++ return 0; ++ ++deinit: ++ ath11k_cfr_deinit(ab); ++ return ret; ++} +--- /dev/null ++++ b/drivers/net/wireless/ath/ath11k/cfr.h +@@ -0,0 +1,282 @@ ++/* SPDX-License-Identifier: BSD-3-Clause-Clear */ ++/* ++ * Copyright (c) 2020 The Linux Foundation. All rights reserved. ++ */ ++ ++#ifndef ATH11K_CFR_H ++#define ATH11K_CFR_H ++ ++#include "dbring.h" ++#include "wmi.h" ++ ++#define ATH11K_CFR_NUM_RESP_PER_EVENT 1 ++#define ATH11K_CFR_EVENT_TIMEOUT_MS 1 ++ ++#define ATH11K_CORRELATE_TX_EVENT 1 ++#define ATH11K_CORRELATE_DBR_EVENT 0 ++ ++#define ATH11K_MAX_CFR_ENABLED_CLIENTS 10 ++ ++#define ATH11K_CFR_START_MAGIC 0xDEADBEAF ++#define ATH11K_CFR_END_MAGIC 0xBEAFDEAD ++ ++#define ATH11K_CFR_RADIO_IPQ8074 23 ++ ++#define VENDOR_QCA 0x8cfdf0 ++#define PLATFORM_TYPE_ARM 2 ++ ++enum ath11k_cfr_meta_version { ++ ATH11K_CFR_META_VERSION_NONE, ++ ATH11K_CFR_META_VERSION_1, ++ ATH11K_CFR_META_VERSION_2, ++ ATH11K_CFR_META_VERSION_3, ++ ATH11K_CFR_META_VERSION_MAX = 0xFF, ++}; ++ ++enum ath11k_cfr_data_version { ++ ATH11K_CFR_DATA_VERSION_NONE, ++ ATH11K_CFR_DATA_VERSION_1, ++ ATH11K_CFR_DATA_VERSION_MAX = 0xFF, ++}; ++ ++enum ath11k_cfr_capture_ack_mode { ++ ATH11K_CFR_CAPTURE_LEGACY_ACK, ++ ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK, ++ ATH11K_CFR_CAPTURE_HT_ACK, ++ ATH11K_CFR_CPATURE_VHT_ACK, ++ ++ /*Always keep this at last*/ ++ ATH11K_CFR_CPATURE_INVALID_ACK ++}; ++ ++enum ath11k_cfr_correlate_status { ++ ATH11K_CORRELATE_STATUS_RELEASE, ++ ATH11K_CORRELATE_STATUS_HOLD, ++ ATH11K_CORRELATE_STATUS_ERR, ++}; ++ ++struct ath11k_cfr_peer_tx_param { ++ u32 capture_method; ++ u32 vdev_id; ++ u8 peer_mac_addr[ETH_ALEN]; ++ u32 primary_20mhz_chan; ++ u32 bandwidth; ++ u32 phy_mode; ++ u32 band_center_freq1; ++ u32 band_center_freq2; ++ u32 spatial_streams; ++ u32 correlation_info_1; ++ u32 correlation_info_2; ++ u32 status; ++ u32 timestamp_us; ++ u32 counter; ++ u32 chain_rssi[WMI_MAX_CHAINS]; ++ u16 chain_phase[WMI_MAX_CHAINS]; ++}; ++ ++struct cfr_metadata_version_1 { ++ u8 peer_addr[ETH_ALEN]; ++ u8 status; ++ u8 capture_bw; ++ u8 channel_bw; ++ u8 phy_mode; ++ u16 prim20_chan; ++ u16 center_freq1; ++ u16 center_freq2; ++ u8 capture_mode; ++ u8 capture_type; ++ u8 sts_count; ++ u8 num_rx_chain; ++ u32 timestamp; ++ u32 length; ++} __packed; ++ ++#define HOST_MAX_CHAINS 8 ++ ++struct cfr_metadata_version_2 { ++ u8 peer_addr[ETH_ALEN]; ++ u8 status; ++ u8 capture_bw; ++ u8 channel_bw; ++ u8 phy_mode; ++ u16 prim20_chan; ++ u16 center_freq1; ++ u16 center_freq2; ++ u8 capture_mode; ++ u8 capture_type; ++ u8 sts_count; ++ u8 num_rx_chain; ++ u32 timestamp; ++ u32 length; ++ u32 chain_rssi[HOST_MAX_CHAINS]; ++ u16 chain_phase[HOST_MAX_CHAINS]; ++} __packed; ++ ++struct ath11k_csi_cfr_header { ++ u32 start_magic_num; ++ u32 vendorid; ++ u8 cfr_metadata_version; ++ u8 cfr_data_version; ++ u8 chip_type; ++ u8 pltform_type; ++ u32 Reserved; ++ union { ++ struct cfr_metadata_version_1 meta_v1; ++ struct cfr_metadata_version_2 meta_v2; ++ } u; ++} __packed; ++ ++enum ath11k_cfr_preamble_type { ++ ATH11K_CFR_PREAMBLE_TYPE_LEGACY, ++ ATH11K_CFR_PREAMBLE_TYPE_HT, ++ ATH11K_CFR_PREAMBLE_TYPE_VHT, ++}; ++ ++#define TONES_IN_20MHZ 256 ++#define TONES_IN_40MHZ 512 ++#define TONES_IN_80MHZ 1024 ++#define TONES_IN_160MHZ 2048 /* 160 MHz isn't supported yet */ ++#define TONES_INVALID 0 ++ ++#define CFIR_DMA_HDR_INFO0_TAG GENMASK(7, 0) ++#define CFIR_DMA_HDR_INFO0_LEN GENMASK(13, 8) ++ ++#define CFIR_DMA_HDR_INFO1_UPLOAD_DONE GENMASK(0, 0) ++#define CFIR_DMA_HDR_INFO1_CAPTURE_TYPE GENMASK(3, 1) ++#define CFIR_DMA_HDR_INFO1_PREABLE_TYPE GENMASK(5, 4) ++#define CFIR_DMA_HDR_INFO1_NSS GENMASK(8, 6) ++#define CFIR_DMA_HDR_INFO1_NUM_CHAINS GENMASK(11, 9) ++#define CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW GENMASK(14, 12) ++#define CFIR_DMA_HDR_INFO1_SW_PEER_ID_VALID GENMASK(15, 15) ++ ++struct ath11k_cfir_dma_hdr { ++ u16 info0; ++ u16 info1; ++ u16 sw_peer_id; ++ u16 phy_ppdu_id; ++}; ++ ++#define CFR_MAX_LUT_ENTRIES 136 ++ ++struct ath11k_cfr_look_up_table { ++ bool dbr_recv; ++ bool tx_recv; ++ u8 *data; ++ u32 data_len; ++ u16 dbr_ppdu_id; ++ u16 tx_ppdu_id; ++ dma_addr_t dbr_address; ++ u32 tx_address1; ++ u32 tx_address2; ++ struct ath11k_csi_cfr_header header; ++ struct ath11k_cfir_dma_hdr hdr; ++ u64 txrx_tstamp; ++ u64 dbr_tstamp; ++ u32 header_length; ++ u32 payload_length; ++ struct ath11k_dbring_element *buff; ++}; ++ ++enum cfr_capture_type { ++ CFR_CAPTURE_METHOD_NULL_FRAME = 0, ++ CFR_CAPURE_METHOD_NULL_FRAME_WITH_PHASE = 1, ++ CFR_CAPTURE_METHOD_PROBE_RESP = 2, ++ CFR_CAPTURE_METHOD_TM = 3, ++ CFR_CAPTURE_METHOD_FTM = 4, ++ CFR_CAPTURE_METHOD_ACK_RESP_TO_TM_FTM = 5, ++ CFR_CAPTURE_METHOD_TA_RA_TYPE_FILTER = 6, ++ CFR_CAPTURE_METHOD_NDPA_NDP = 7, ++ CFR_CAPTURE_METHOD_ALL_PACKET = 8, ++ /* Add new capture methods before this line */ ++ CFR_CAPTURE_METHOD_LAST_VALID, ++ CFR_CAPTURE_METHOD_AUTO = 0xff, ++ CFR_CAPTURE_METHOD_MAX, ++}; ++ ++struct cfr_unassoc_pool_entry { ++ u8 peer_mac[ETH_ALEN]; ++ u32 period; ++ bool is_valid; ++}; ++ ++struct ath11k_cfr { ++ struct ath11k_dbring rx_ring; ++ /* Protects enabled for ath11k_cfr */ ++ spinlock_t lock; ++ struct rchan *rfs_cfr_capture; ++ struct dentry *enable_cfr; ++ struct dentry *cfr_unassoc; ++ u8 cfr_enabled_peer_cnt; ++ struct ath11k_cfr_look_up_table *lut; ++ u32 lut_num; ++ u32 dbr_buf_size; ++ u32 dbr_num_bufs; ++ u32 max_mu_users; ++ /* protect look up table data */ ++ spinlock_t lut_lock; ++ u64 tx_evt_cnt; ++ u64 dbr_evt_cnt; ++ u64 total_tx_evt_cnt; ++ u64 release_cnt; ++ u64 tx_peer_status_cfr_fail; ++ u64 tx_evt_status_cfr_fail; ++ u64 tx_dbr_lookup_fail; ++ u64 last_success_tstamp; ++ u64 flush_dbr_cnt; ++ u64 invalid_dma_length_cnt; ++ u64 clear_txrx_event; ++ u64 cfr_dma_aborts; ++ u64 flush_timeout_dbr_cnt; ++ struct cfr_unassoc_pool_entry unassoc_pool[ATH11K_MAX_CFR_ENABLED_CLIENTS]; ++}; ++ ++#ifdef CPTCFG_ATH11K_CFR ++ ++int ath11k_cfr_init(struct ath11k_base *ab); ++void ath11k_cfr_deinit(struct ath11k_base *ab); ++struct ath11k_dbring *ath11k_cfr_get_dbring(struct ath11k *ar); ++int ath11k_process_cfr_capture_event(struct ath11k_base *ab, ++ struct ath11k_cfr_peer_tx_param *params); ++bool peer_is_in_cfr_unassoc_pool(struct ath11k *ar, u8 *peer_mac); ++void ath11k_cfr_relase_lut_entry(struct ath11k_cfr_look_up_table *lut); ++void ath11k_cfr_lut_update_paddr(struct ath11k *ar, dma_addr_t paddr, ++ u32 buf_id); ++void ath11k_cfr_decrement_peer_count(struct ath11k *ar, ++ struct ath11k_sta *arsta); ++#else ++static inline int ath11k_cfr_init(struct ath11k_base *ab) ++{ ++ return 0; ++} ++static inline void ath11k_cfr_deinit(struct ath11k_base *ab) ++{ ++} ++static inline ++struct ath11k_dbring *ath11k_cfr_get_dbring(struct ath11k *ar) ++{ ++ return NULL; ++} ++static inline bool peer_is_in_cfr_unassoc_pool(struct ath11k *ar, u8 *peer_mac) ++{ ++ return false; ++} ++static inline ++void ath11k_cfr_relase_lut_entry(struct ath11k_cfr_look_up_table *lut) ++{ ++} ++static inline ++int ath11k_process_cfr_capture_event(struct ath11k_base *ab, ++ struct ath11k_cfr_peer_tx_param *params) ++{ ++ return 0; ++} ++static inline void ath11k_cfr_lut_update_paddr(struct ath11k *ar, ++ dma_addr_t paddr, u32 buf_id) ++{ ++} ++static inline void ath11k_cfr_decrement_peer_count(struct ath11k *ar, ++ struct ath11k_sta *arsta) ++{ ++} ++#endif /* CPTCFG_ATH11K_CFR */ ++#endif /* ATH11K_CFR_H */ +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -103,6 +103,11 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = false, + .fwmem_mode_change = false, + .is_qdss_support = false, ++ .cfr_support = true, ++ .cfr_dma_hdr_size = sizeof(struct ath11k_cfir_dma_hdr), ++ .cfr_num_stream_bufs = 255, ++ /* csi_cfr_header + cfr header + max cfr payload */ ++ .cfr_stream_buf_size = 8500, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -843,8 +848,16 @@ static int ath11k_core_pdev_create(struc + goto err_thermal_unregister; + } + ++ ret = ath11k_cfr_init(ab); ++ if (ret) { ++ ath11k_err(ab, "failed to init cfr %d\n", ret); ++ goto err_spectral_unregister; ++ } ++ + return 0; + ++err_spectral_unregister: ++ ath11k_spectral_deinit(ab); + err_thermal_unregister: + ath11k_thermal_unregister(ab); + err_mac_unregister: +@@ -861,6 +874,7 @@ err_pdev_debug: + + static void ath11k_core_pdev_destroy(struct ath11k_base *ab) + { ++ ath11k_cfr_deinit(ab); + ath11k_spectral_deinit(ab); + ath11k_thermal_unregister(ab); + ath11k_mac_unregister(ab); +@@ -1153,6 +1167,7 @@ static int ath11k_core_reconfigure_on_cr + ath11k_hif_irq_disable(ab); + ath11k_dp_pdev_free(ab); + ath11k_spectral_deinit(ab); ++ ath11k_cfr_deinit(ab); + ath11k_hif_stop(ab); + ath11k_wmi_detach(ab); + ath11k_dp_pdev_reo_cleanup(ab); +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -27,6 +27,7 @@ + #include "vendor.h" + #include "rx_desc.h" + #include "nss.h" ++#include "cfr.h" + + extern unsigned int ath11k_skip_radio; + +@@ -401,6 +402,13 @@ struct ath11k_htt_tx_stats { + u32 mu_group[MAX_MU_GROUP_ID]; + }; + ++struct ath11k_per_peer_cfr_capture { ++ u32 cfr_enable; ++ u32 cfr_period; ++ u32 cfr_bandwidth; ++ u32 cfr_method; ++}; ++ + struct ath11k_per_ppdu_tx_stats { + u16 succ_pkts; + u16 failed_pkts; +@@ -458,6 +466,9 @@ struct ath11k_sta { + u32 ps_start_jiffies; + u8 peer_current_ps_valid; + u32 ps_total_duration; ++#ifdef CPTCFG_ATH11K_CFR ++ struct ath11k_per_peer_cfr_capture cfr_capture; ++#endif + }; + + #define ATH11K_MIN_5G_FREQ 4150 +@@ -724,6 +735,10 @@ struct ath11k { + u8 ps_state_enable; + u8 ps_timekeeper_enable; + u8 reset_ps_duration; ++#ifdef CPTCFG_ATH11K_CFR ++ struct ath11k_cfr cfr; ++#endif ++ u8 cfr_enabled; + }; + + struct ath11k_band_cap { +--- a/drivers/net/wireless/ath/ath11k/dbring.c ++++ b/drivers/net/wireless/ath/ath11k/dbring.c +@@ -41,11 +41,11 @@ static void ath11k_dbring_fill_magic_val + } + } + +-static int ath11k_dbring_bufs_replenish(struct ath11k *ar, +- struct ath11k_dbring *ring, +- struct ath11k_dbring_element *buff, +- enum wmi_direct_buffer_module id, +- gfp_t gfp) ++int ath11k_dbring_bufs_replenish(struct ath11k *ar, ++ struct ath11k_dbring *ring, ++ struct ath11k_dbring_element *buff, ++ enum wmi_direct_buffer_module id, ++ gfp_t gfp) + { + struct ath11k_base *ab = ar->ab; + struct hal_srng *srng; +@@ -85,6 +85,9 @@ static int ath11k_dbring_bufs_replenish( + goto err_idr_remove; + } + ++ if (id == WMI_DIRECT_BUF_CFR) ++ ath11k_cfr_lut_update_paddr(ar, paddr, buf_id); ++ + buff->paddr = paddr; + + cookie = FIELD_PREP(DP_RXDMA_BUF_COOKIE_PDEV_ID, ar->pdev_idx) | +@@ -200,8 +203,7 @@ int ath11k_dbring_set_cfg(struct ath11k + + int ath11k_dbring_buf_setup(struct ath11k *ar, + struct ath11k_dbring *ring, +- struct ath11k_dbring_cap *db_cap, +- enum wmi_direct_buffer_module id) ++ struct ath11k_dbring_cap *db_cap) + { + struct ath11k_base *ab = ar->ab; + struct hal_srng *srng; +@@ -217,7 +219,7 @@ int ath11k_dbring_buf_setup(struct ath11 + ring->hp_addr = ath11k_hal_srng_get_hp_addr(ar->ab, srng); + ring->tp_addr = ath11k_hal_srng_get_tp_addr(ar->ab, srng); + +- ret = ath11k_dbring_fill_bufs(ar, ring, id, GFP_KERNEL); ++ ret = ath11k_dbring_fill_bufs(ar, ring, db_cap->id, GFP_KERNEL); + + return ret; + } +@@ -283,6 +285,7 @@ int ath11k_dbring_buffer_release_event(s + int size; + dma_addr_t paddr; + int ret = 0; ++ int status; + + pdev_idx = ev->fixed.pdev_id; + module_id = ev->fixed.module_id; +@@ -312,6 +315,9 @@ int ath11k_dbring_buffer_release_event(s + case WMI_DIRECT_BUF_SPECTRAL: + ring = ath11k_spectral_get_dbring(ar); + break; ++ case WMI_DIRECT_BUF_CFR: ++ ring = ath11k_cfr_get_dbring(ar); ++ break; + default: + ring = NULL; + ath11k_warn(ab, "Recv dma buffer release ev on unsupp module %d\n", +@@ -362,8 +368,12 @@ int ath11k_dbring_buffer_release_event(s + handler_data.data = PTR_ALIGN(vaddr_unalign, + ring->buf_align); + handler_data.data_sz = ring->buf_sz; ++ handler_data.buff = buff; ++ handler_data.buf_id = buf_id; + +- ring->handler(ar, &handler_data); ++ status = ring->handler(ar, &handler_data); ++ if (status == ATH11K_CORRELATE_STATUS_HOLD) ++ continue; + } + + memset(buff, 0, size); +--- a/drivers/net/wireless/ath/ath11k/dbring.h ++++ b/drivers/net/wireless/ath/ath11k/dbring.h +@@ -20,6 +20,8 @@ struct ath11k_dbring_data { + void *data; + u32 data_sz; + struct wmi_dma_buf_release_meta_data meta; ++ struct ath11k_dbring_element *buff; ++ u32 buf_id; + }; + + struct ath11k_dbring_buf_release_event { +@@ -60,13 +62,18 @@ int ath11k_dbring_set_cfg(struct ath11k + u32 event_timeout_ms, + int (*handler)(struct ath11k *, + struct ath11k_dbring_data *)); ++ ++int ath11k_dbring_bufs_replenish(struct ath11k *ar, ++ struct ath11k_dbring *ring, ++ struct ath11k_dbring_element *buff, ++ enum wmi_direct_buffer_module id, ++ gfp_t gfp); + int ath11k_dbring_wmi_cfg_setup(struct ath11k *ar, + struct ath11k_dbring *ring, + enum wmi_direct_buffer_module id); + int ath11k_dbring_buf_setup(struct ath11k *ar, + struct ath11k_dbring *ring, +- struct ath11k_dbring_cap *db_cap, +- enum wmi_direct_buffer_module id); ++ struct ath11k_dbring_cap *db_cap); + int ath11k_dbring_srng_setup(struct ath11k *ar, struct ath11k_dbring *ring, + int ring_num, int num_entries); + int ath11k_dbring_buffer_release_event(struct ath11k_base *ab, +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -1331,6 +1331,157 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++#ifdef CPTCFG_ATH11K_CFR ++static ssize_t ath11k_dbg_sta_write_cfr_capture(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct wmi_peer_cfr_capture_conf_arg arg; ++ u32 cfr_capture_enable = 0, cfr_capture_bw = 0; ++ u32 cfr_capture_method = 0, cfr_capture_period = 0; ++ int ret; ++ char buf[64] = {0}; ++ ++ simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto out; ++ } ++ ++ if (!ar->cfr_enabled) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ ret = sscanf(buf, "%u %u %u %u", &cfr_capture_enable, &cfr_capture_bw, ++ &cfr_capture_period, &cfr_capture_method); ++ ++ if ((ret < 1) || (cfr_capture_enable && ret != 4)) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (cfr_capture_enable == arsta->cfr_capture.cfr_enable && ++ (cfr_capture_period && ++ cfr_capture_period == arsta->cfr_capture.cfr_period) && ++ cfr_capture_bw == arsta->cfr_capture.cfr_bandwidth && ++ cfr_capture_method == arsta->cfr_capture.cfr_method) { ++ ret = count; ++ goto out; ++ } ++ ++ if (!cfr_capture_enable && ++ cfr_capture_enable == arsta->cfr_capture.cfr_enable) { ++ ret = count; ++ goto out; ++ } ++ ++ if (cfr_capture_enable > WMI_PEER_CFR_CAPTURE_ENABLE || ++ cfr_capture_bw > WMI_PEER_CFR_CAPTURE_BW_80MHZ || ++ cfr_capture_bw > sta->bandwidth || ++ cfr_capture_method > CFR_CAPURE_METHOD_NULL_FRAME_WITH_PHASE || ++ cfr_capture_period > WMI_PEER_CFR_PERIODICITY_MAX) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ /* Target expects cfr period in multiple of 10 */ ++ if (cfr_capture_period % 10) { ++ ath11k_err(ar->ab, "periodicity should be 10x\n"); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (ar->cfr.cfr_enabled_peer_cnt >= ATH11K_MAX_CFR_ENABLED_CLIENTS && ++ !arsta->cfr_capture.cfr_enable) { ++ ret = -EINVAL; ++ ath11k_err(ar->ab, "CFR enable peer threshold reached %u\n", ++ ar->cfr.cfr_enabled_peer_cnt); ++ goto out; ++ } ++ ++ if (!cfr_capture_enable) { ++ cfr_capture_bw = arsta->cfr_capture.cfr_bandwidth; ++ cfr_capture_period = arsta->cfr_capture.cfr_period; ++ cfr_capture_method = arsta->cfr_capture.cfr_method; ++ } ++ ++ arg.request = cfr_capture_enable; ++ arg.periodicity = cfr_capture_period; ++ arg.bandwidth = cfr_capture_bw; ++ arg.capture_method = cfr_capture_method; ++ ++ ret = ath11k_wmi_peer_set_cfr_capture_conf(ar, arsta->arvif->vdev_id, ++ sta->addr, &arg); ++ if (ret) { ++ ath11k_warn(ar, "failed to send cfr capture info: vdev_id %u peer %pM\n", ++ arsta->arvif->vdev_id, sta->addr); ++ goto out; ++ } ++ ++ ret = count; ++ ++ spin_lock_bh(&ar->cfr.lock); ++ ++ if (cfr_capture_enable && ++ cfr_capture_enable != arsta->cfr_capture.cfr_enable) ++ cfr->cfr_enabled_peer_cnt++; ++ else if (!cfr_capture_enable) ++ cfr->cfr_enabled_peer_cnt--; ++ ++ spin_unlock_bh(&ar->cfr.lock); ++ ++ arsta->cfr_capture.cfr_enable = cfr_capture_enable; ++ arsta->cfr_capture.cfr_period = cfr_capture_period; ++ arsta->cfr_capture.cfr_bandwidth = cfr_capture_bw; ++ arsta->cfr_capture.cfr_method = cfr_capture_method; ++out: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_dbg_sta_read_cfr_capture(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_sta *sta = file->private_data; ++ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k *ar = arsta->arvif->ar; ++ char buf[512] = {0}; ++ int len = 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ len += scnprintf(buf + len, sizeof(buf) - len, "cfr_enabled = %d\n", ++ arsta->cfr_capture.cfr_enable); ++ len += scnprintf(buf + len, sizeof(buf) - len, "bandwidth = %d\n", ++ arsta->cfr_capture.cfr_bandwidth); ++ len += scnprintf(buf + len, sizeof(buf) - len, "period = %d\n", ++ arsta->cfr_capture.cfr_period); ++ len += scnprintf(buf + len, sizeof(buf) - len, "cfr_method = %d\n", ++ arsta->cfr_capture.cfr_method); ++ ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_peer_cfr_capture = { ++ .write = ath11k_dbg_sta_write_cfr_capture, ++ .read = ath11k_dbg_sta_read_cfr_capture, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++#endif /* CPTCFG_ATH11K_CFR */ ++ + void ath11k_debugfs_sta_op_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct dentry *dir) + { +@@ -1378,4 +1529,10 @@ void ath11k_debugfs_sta_op_add(struct ie + ar->ab->wmi_ab.svc_map)) + debugfs_create_file("htt_peer_stats_reset", 0600, dir, sta, + &fops_htt_peer_stats_reset); ++#ifdef CPTCFG_ATH11K_CFR ++ if (test_bit(WMI_TLV_SERVICE_CFR_CAPTURE_SUPPORT, ++ ar->ab->wmi_ab.svc_map)) ++ debugfs_create_file("cfr_capture", 0400, dir, sta, ++ &fops_peer_cfr_capture); ++#endif/* CPTCFG_ATH11K_CFR */ + } +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -181,7 +181,7 @@ static const struct hal_srng_config hw_s + }, + { /* RXDMA DIR BUF */ + .start_ring_id = HAL_SRNG_RING_ID_RXDMA_DIR_BUF, +- .max_rings = 1, ++ .max_rings = 2, + .entry_size = 8 >> 2, /* TODO: Define the struct */ + .lmac_ring = true, + .ring_dir = HAL_SRNG_DIR_SRC, +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -204,6 +204,10 @@ struct ath11k_hw_params { + bool ce_fwlog_enable; + bool fwmem_mode_change; + bool is_qdss_support; ++ bool cfr_support; ++ u32 cfr_dma_hdr_size; ++ u32 cfr_num_stream_bufs; ++ u32 cfr_stream_buf_size; + }; + + struct ath11k_hw_ops { +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4796,6 +4796,8 @@ static int ath11k_mac_op_sta_state(struc + + kfree(arsta->rx_stats); + arsta->rx_stats = NULL; ++ ++ ath11k_cfr_decrement_peer_count(ar, arsta); + } else if (old_state == IEEE80211_STA_AUTH && + new_state == IEEE80211_STA_ASSOC && + (vif->type == NL80211_IFTYPE_AP || +@@ -5727,6 +5729,7 @@ static int ath11k_mac_mgmt_tx_wmi(struct + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_tx_info *info; + dma_addr_t paddr; ++ bool tx_params_valid = false; + int buf_id; + int ret; + +@@ -5766,7 +5769,13 @@ static int ath11k_mac_mgmt_tx_wmi(struct + return 0; + } + +- ret = ath11k_wmi_mgmt_send(ar, arvif->vdev_id, buf_id, skb); ++ if (ar->cfr_enabled && ++ ieee80211_is_probe_resp(hdr->frame_control) && ++ peer_is_in_cfr_unassoc_pool(ar, hdr->addr1)) ++ tx_params_valid = true; ++ ++ ret = ath11k_wmi_mgmt_send(ar, arvif->vdev_id, buf_id, skb, ++ tx_params_valid); + if (ret) { + ath11k_warn(ar->ab, "failed to send mgmt frame: %d\n", ret); + goto err_unmap_buf; +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -817,7 +817,7 @@ static int ath11k_spectral_ring_alloc(st + ATH11K_SPECTRAL_EVENT_TIMEOUT_MS, + ath11k_spectral_process_data); + +- ret = ath11k_dbring_buf_setup(ar, &sp->rx_ring, db_cap, WMI_DIRECT_BUF_SPECTRAL); ++ ret = ath11k_dbring_buf_setup(ar, &sp->rx_ring, db_cap); + if (ret) { + ath11k_warn(ar->ab, "failed to setup db ring buffer\n"); + goto srng_cleanup; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -612,10 +612,11 @@ struct sk_buff *ath11k_wmi_alloc_skb(str + } + + int ath11k_wmi_mgmt_send(struct ath11k *ar, u32 vdev_id, u32 buf_id, +- struct sk_buff *frame) ++ struct sk_buff *frame, bool tx_params_valid) + { + struct ath11k_pdev_wmi *wmi = ar->wmi; + struct wmi_mgmt_send_cmd *cmd; ++ struct wmi_tx_send_params *params; + struct wmi_tlv *frame_tlv; + struct sk_buff *skb; + u32 buf_len; +@@ -626,6 +627,9 @@ int ath11k_wmi_mgmt_send(struct ath11k * + + len = sizeof(*cmd) + sizeof(*frame_tlv) + roundup(buf_len, 4); + ++ if (tx_params_valid) ++ len += sizeof(*params); ++ + skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); + if (!skb) + return -ENOMEM; +@@ -640,7 +644,7 @@ int ath11k_wmi_mgmt_send(struct ath11k * + cmd->paddr_hi = upper_32_bits(ATH11K_SKB_CB(frame)->paddr); + cmd->frame_len = frame->len; + cmd->buf_len = buf_len; +- cmd->tx_params_valid = 0; ++ cmd->tx_params_valid = tx_params_valid; + + frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); + frame_tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | +@@ -650,6 +654,13 @@ int ath11k_wmi_mgmt_send(struct ath11k * + + ath11k_ce_byte_swap(frame_tlv->value, buf_len); + ++ if (tx_params_valid) { ++ params = (struct wmi_tx_send_params *)(skb->data + (len - sizeof(*params))); ++ params->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TX_SEND_PARAMS) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*params) - TLV_HDR_SIZE); ++ params->tx_params_dword1 |= WMI_TX_PARAMS_DWORD1_CFR_CAPTURE; ++ } ++ + ret = ath11k_wmi_cmd_send(wmi, skb, WMI_MGMT_TX_SEND_CMDID); + if (ret) { + ath11k_warn(ar->ab, +@@ -4053,6 +4064,42 @@ int ath11k_wmi_fils_discovery_tmpl(struc + return ret; + } + ++int ath11k_wmi_peer_set_cfr_capture_conf(struct ath11k *ar, ++ u32 vdev_id, const u8 *mac_addr, ++ struct wmi_peer_cfr_capture_conf_arg *arg) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct wmi_peer_cfr_capture_cmd_fixed_param *cmd; ++ struct sk_buff *skb; ++ int ret; ++ ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); ++ if (!skb) ++ return -ENOMEM; ++ ++ cmd = (struct wmi_peer_cfr_capture_cmd_fixed_param *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, ++ WMI_TAG_PEER_CFR_CAPTURE_CMD) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); ++ ++ ether_addr_copy(cmd->mac_addr.addr, mac_addr); ++ cmd->request = arg->request; ++ cmd->vdev_id = vdev_id; ++ cmd->periodicity = arg->periodicity; ++ cmd->bandwidth = arg->bandwidth; ++ cmd->capture_method = arg->capture_method; ++ ++ ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_PEER_CFR_CAPTURE_CMDID); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "WMI vdev %d failed to send peer cfr capture cmd\n", ++ vdev_id); ++ dev_kfree_skb(skb); ++ } ++ ++ return ret; ++} ++ + int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id, + struct sk_buff *tmpl) + { +@@ -8928,6 +8975,89 @@ static void ath11k_wmi_diag_event(struct + ath11k_fwlog_write(ab,data, tlv_len); + } + ++static void ath11k_wmi_tlv_cfr_cpature_event_fixed_param(const void *ptr, ++ void *data) ++{ ++ struct ath11k_cfr_peer_tx_param *tx_params = ++ (struct ath11k_cfr_peer_tx_param *)data; ++ struct ath11k_wmi_cfr_peer_tx_event_param *params = ++ (struct ath11k_wmi_cfr_peer_tx_event_param *)ptr; ++ ++ tx_params->capture_method = params->capture_method; ++ tx_params->vdev_id = params->vdev_id; ++ ether_addr_copy(tx_params->peer_mac_addr, params->mac_addr.addr); ++ tx_params->primary_20mhz_chan = params->chan_mhz; ++ tx_params->bandwidth = params->bandwidth; ++ tx_params->phy_mode = params->phy_mode; ++ tx_params->band_center_freq1 = params->band_center_freq1; ++ tx_params->band_center_freq2 = params->band_center_freq2; ++ tx_params->spatial_streams = params->sts_count; ++ tx_params->correlation_info_1 = params->correlation_info_1; ++ tx_params->correlation_info_2 = params->correlation_info_2; ++ tx_params->status = params->status; ++ tx_params->timestamp_us = params->timestamp_us; ++ tx_params->counter = params->counter; ++ memcpy(tx_params->chain_rssi, params->chain_rssi, ++ sizeof(tx_params->chain_rssi)); ++} ++ ++static void ath11k_wmi_tlv_cfr_cpature_phase_fixed_param(const void *ptr, ++ void *data) ++{ ++ struct ath11k_cfr_peer_tx_param *tx_params = ++ (struct ath11k_cfr_peer_tx_param *)data; ++ struct ath11k_wmi_cfr_peer_tx_event_phase_param *params = ++ (struct ath11k_wmi_cfr_peer_tx_event_phase_param *)ptr; ++ int i; ++ ++ for (i = 0; i < WMI_MAX_CHAINS; i++) ++ tx_params->chain_phase[i] = params->chain_phase[i]; ++} ++ ++static int ath11k_wmi_tlv_cfr_capture_evt_parse(struct ath11k_base *ab, ++ u16 tag, u16 len, ++ const void *ptr, void *data) ++{ ++ switch (tag) { ++ case WMI_TAG_PEER_CFR_CAPTURE_EVENT: ++ ath11k_wmi_tlv_cfr_cpature_event_fixed_param(ptr, data); ++ break; ++ case WMI_TAG_CFR_CAPTURE_PHASE_PARAM: ++ ath11k_wmi_tlv_cfr_cpature_phase_fixed_param(ptr, data); ++ break; ++ default: ++ ath11k_warn(ab, "Invalid tag received tag %d len %d\n", ++ tag, len); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static void ath11k_wmi_parse_cfr_capture_event(struct ath11k_base *ab, ++ struct sk_buff *skb) ++{ ++ struct ath11k_cfr_peer_tx_param params = {}; ++ int ret; ++ ++ ath11k_dbg_dump(ab, ATH11K_DBG_CFR_DUMP, "cfr_dump:", "", ++ skb->data, skb->len); ++ ++ ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, ++ ath11k_wmi_tlv_cfr_capture_evt_parse, ++ ¶ms); ++ if (ret) { ++ ath11k_warn(ab, "failed to parse cfr capture event tlv %d\n", ++ ret); ++ return; ++ } ++ ++ ret = ath11k_process_cfr_capture_event(ab, ¶ms); ++ if (ret) ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "failed to process cfr cpature ret = %d\n", ret); ++} ++ + static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) + { + struct wmi_cmd_hdr *cmd_hdr; +@@ -9077,6 +9207,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_CTRL_PATH_STATS_EVENTID: + ath11k_wmi_ctrl_path_stats_event(ab, skb); + break; ++ case WMI_PEER_CFR_CAPTURE_EVENTID: ++ ath11k_wmi_parse_cfr_capture_event(ab, skb); ++ break; + /* TODO: Add remaining events */ + default: + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -339,6 +339,10 @@ enum wmi_tlv_cmd_id { + WMI_PEER_REORDER_QUEUE_REMOVE_CMDID, + WMI_PEER_SET_RX_BLOCKSIZE_CMDID, + WMI_PEER_ANTDIV_INFO_REQ_CMDID, ++ WMI_PEER_RESERVED0_CMDID, ++ WMI_PEER_TID_MSDUQ_QDEPTH_THRESH_UPDATE_CMDID, ++ WMI_PEER_TID_CONFIGURATIONS_CMDID, ++ WMI_PEER_CFR_CAPTURE_CMDID, + WMI_BCN_TX_CMDID = WMI_TLV_CMD(WMI_GRP_MGMT), + WMI_PDEV_SEND_BCN_CMDID, + WMI_BCN_TMPL_CMDID, +@@ -966,6 +970,7 @@ enum wmi_tlv_pdev_param { + WMI_PDEV_PARAM_RADIO_CHAN_STATS_ENABLE, + WMI_PDEV_PARAM_RADIO_DIAGNOSIS_ENABLE, + WMI_PDEV_PARAM_MESH_MCAST_ENABLE, ++ WMI_PDEV_PARAM_PER_PEER_CFR_ENABLE = 0xa8, + WMI_PDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD = 0xbc, + WMI_PDEV_PARAM_SET_CMD_OBSS_PD_PER_AC = 0xbe, + WMI_PDEV_PARAM_ENABLE_SR_PROHIBIT = 0xc6, +@@ -1869,7 +1874,9 @@ enum wmi_tlv_tag { + WMI_TAG_NDP_EVENT, + WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301, + WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, ++ WMI_TAG_PEER_CFR_CAPTURE_EVENT = 0x317, + WMI_TAG_MUEDCA_PARAMS_CONFIG_EVENT = 0x32a, ++ WMI_TAG_CFR_CAPTURE_PHASE_PARAM = 0x33b, + WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344, + WMI_TAG_PDEV_SRG_BSS_COLOR_BITMAP_CMD = 0x37b, + WMI_TAG_PDEV_SRG_PARTIAL_BSSID_BITMAP_CMD, +@@ -3494,6 +3501,85 @@ struct wmi_bssid_arg { + const u8 *bssid; + }; + ++enum ath11k_wmi_frame_tx_status { ++ WMI_FRAME_TX_STATUS_OK, ++ WMI_FRAME_TX_STATUS_XRETRY, ++ WMI_FRAME_TX_STATUS_DROP, ++ WMI_FRAME_TX_STATUS_FILTERED, ++}; ++ ++struct wmi_peer_cfr_capture_conf_arg { ++ u32 request; ++ u32 periodicity; ++ u32 bandwidth; ++ u32 capture_method; ++}; ++ ++struct wmi_peer_cfr_capture_cmd_fixed_param { ++ u32 tlv_header; ++ u32 request; ++ struct wmi_mac_addr mac_addr; ++ u32 vdev_id; ++ u32 periodicity; ++ u32 bandwidth; ++ u32 capture_method; ++} __packed; ++ ++#define WMI_PEER_CFR_CAPTURE_ENABLE 1 ++#define WMI_PEER_CFR_CAPTURE_DISABLE 0 ++ ++/* periodicity in ms */ ++#define WMI_PEER_CFR_PERIODICITY_MAX (10*60*1000) ++ ++#define WMI_CFR_FRAME_TX_STATUS GENMASK(1, 0) ++#define WMI_CFR_CAPTURE_STATUS_PEER_PS BIT(30) ++#define WMI_CFR_PEER_CAPTURE_STATUS BIT(31) ++ ++#define WMI_CFR_CORRELATION_INFO2_BUF_ADDR_HIGH GENMASK(3, 0) ++#define WMI_CFR_CORRELATION_INFO2_PPDU_ID GENMASK(31, 16) ++ ++#define WMI_CFR_CFO_MEASUREMENT_VALID GENMASK(0, 0) ++#define WMI_CFR_CFO_MEASUREMENT_RAW_DATA GENMASK(14, 1) ++ ++struct ath11k_wmi_cfr_peer_tx_event_param { ++ u32 capture_method; ++ u32 vdev_id; ++ struct wmi_mac_addr mac_addr; ++ u32 chan_mhz; ++ u32 bandwidth; ++ u32 phy_mode; ++ u32 band_center_freq1; ++ u32 band_center_freq2; ++ u32 sts_count; ++ u32 correlation_info_1; ++ u32 correlation_info_2; ++ u32 status; ++ u32 timestamp_us; ++ u32 counter; ++ u32 chain_rssi[WMI_MAX_CHAINS]; ++ u32 cfo_measurement; ++} __packed; ++ ++struct ath11k_wmi_cfr_peer_tx_event_phase_param { ++ u32 chain_phase[WMI_MAX_CHAINS]; ++} __packed; ++ ++enum ath11k_wmi_cfr_capture_bw { ++ WMI_PEER_CFR_CAPTURE_BW_20MHZ, ++ WMI_PEER_CFR_CAPTURE_BW_40MHZ, ++ WMI_PEER_CFR_CAPTURE_BW_80MHZ, ++ WMI_PEER_CFR_CAPTURE_BW_160MHZ, ++ WMI_PEER_CFR_CAPTURE_BW_80_80MHZ, ++ WMI_PEER_CFR_CAPTURE_BW_MAX, ++}; ++ ++struct ath11k_wmi_peer_cfr_capture_conf { ++ u32 request; ++ u32 periodicity; ++ u32 bandwidth; ++ u32 capture_method; ++}; ++ + struct wmi_start_scan_arg { + u32 scan_id; + u32 scan_req_id; +@@ -6334,7 +6420,7 @@ int ath11k_wmi_cmd_send(struct ath11k_pd + u32 cmd_id); + struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len); + int ath11k_wmi_mgmt_send(struct ath11k *ar, u32 vdev_id, u32 buf_id, +- struct sk_buff *frame); ++ struct sk_buff *frame, bool tx_params_valid); + int ath11k_wmi_qos_null_send(struct ath11k *ar, u32 vdev_id, u32 buf_id, + struct sk_buff *frame); + int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, +@@ -6496,4 +6582,7 @@ int ath11k_wmi_send_aggr_size_cmd(struct + int ath11k_wmi_send_wmi_ctrl_stats_cmd(struct ath11k *ar, + struct wmi_ctrl_path_stats_cmd_param *param); + int ath11k_wmi_dbglog_cfg(struct ath11k *ar, u32 param, u64 value); ++int ath11k_wmi_peer_set_cfr_capture_conf(struct ath11k *ar, ++ u32 vdev_id, const u8 *mac, ++ struct wmi_peer_cfr_capture_conf_arg *arg); + #endif +--- a/local-symbols ++++ b/local-symbols +@@ -140,3 +140,4 @@ ATH11K_DEBUGFS= + ATH11K_TRACING= + ATH11K_SPECTRAL= + ATH11K_PKTLOG= ++ATH11K_CFR= +--- a/drivers/net/wireless/ath/ath11k/debug.h ++++ b/drivers/net/wireless/ath/ath11k/debug.h +@@ -25,6 +25,8 @@ enum ath11k_debug_mask { + ATH11K_DBG_PCI = 0x00001000, + ATH11K_DBG_DP_TX = 0x00001000, + ATH11K_DBG_DP_RX = 0x00002000, ++ ATH11K_DBG_CFR = 0x00008000, ++ ATH11K_DBG_CFR_DUMP = 0x00010000, + ATH11K_DBG_ANY = 0xffffffff, + }; + diff --git a/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Fix-mon-status-ring-rx-tlv-processing.patch b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Fix-mon-status-ring-rx-tlv-processing.patch new file mode 100644 index 000000000..67e999732 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Fix-mon-status-ring-rx-tlv-processing.patch @@ -0,0 +1,49 @@ +From fb86f111da3d60ae6c53c2fe9d4654d14eec9355 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Wed, 3 Feb 2021 22:35:13 +0530 +Subject: [PATCH] ath11k: Fix mon status ring rx tlv processing + +In HE monitor capure, Muliple ring entries TLV contains one +HAL_TLV_STATUS_PPDU_DONE. Do not clear the ppdu_info till the +PPDU status done received. + +This fixes below warning. + "Rate marked as an HE rate but data is invalid: MCS: 6, NSS: 0" + WARNING: at + PC is at ieee80211_rx_napi+0x624/0x840 [mac80211] + +Signed-off-by: Anilkumar Kolli +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -3730,6 +3730,8 @@ int ath11k_dp_rx_process_mon_status(stru + struct ath11k_pdev_mon_stats *rx_mon_stats; + + ppdu_info = &pmon->mon_ppdu_info; ++ memset(ppdu_info, 0, sizeof(*ppdu_info)); ++ ppdu_info->peer_id = HAL_INVALID_PEERID; + rx_mon_stats = &pmon->rx_mon_stats; + + __skb_queue_head_init(&skb_list); +@@ -3740,9 +3742,6 @@ int ath11k_dp_rx_process_mon_status(stru + goto exit; + + while ((skb = __skb_dequeue(&skb_list))) { +- memset(ppdu_info, 0, sizeof(*ppdu_info)); +- ppdu_info->peer_id = HAL_INVALID_PEERID; +- + if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) { + log_type = ATH11K_PKTLOG_TYPE_LITE_RX; + rx_buf_sz = DP_RX_BUFFER_SIZE_LITE; +@@ -3798,6 +3797,8 @@ int ath11k_dp_rx_process_mon_status(stru + spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); + dev_kfree_skb_any(skb); ++ memset(ppdu_info, 0, sizeof(*ppdu_info)); ++ ppdu_info->peer_id = HAL_INVALID_PEERID; + } + exit: + return num_buffs_reaped; diff --git a/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Increment-pending_mgmt_tx-before-tx-send.patch b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Increment-pending_mgmt_tx-before-tx-send.patch new file mode 100644 index 000000000..d4f8f7e9f --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-Increment-pending_mgmt_tx-before-tx-send.patch @@ -0,0 +1,45 @@ +From 2e78fb74a8521a73d072a7732ce7e71370475898 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Mon, 8 Feb 2021 15:41:49 +0530 +Subject: [PATCH] ath11k: Increment pending_mgmt_tx before tx send + +Updated to increment 'num_pending_mgmt_tx' count before invoking +send, to avoid 0 value while decrementing in tx completion handler. + + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/mac.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5833,15 +5833,18 @@ static void ath11k_mgmt_over_wmi_tx_work + } + + arvif = ath11k_vif_to_arvif(skb_cb->vif); ++ mutex_lock(&ar->conf_mutex); + if (ar->allocated_vdev_map & (1LL << arvif->vdev_id) && + arvif->is_started) { ++ atomic_inc(&ar->num_pending_mgmt_tx); + ret = ath11k_mac_mgmt_tx_wmi(ar, arvif, skb); + if (ret) { ++ if (atomic_dec_if_positive(&ar->num_pending_mgmt_tx) < 0) { ++ WARN_ON_ONCE(1); ++ } + ath11k_warn(ar->ab, "failed to tx mgmt frame, vdev_id %d :%d\n", + arvif->vdev_id, ret); + ieee80211_free_txskb(ar->hw, skb); +- } else { +- atomic_inc(&ar->num_pending_mgmt_tx); + } + } else { + ath11k_warn(ar->ab, +@@ -5850,6 +5853,7 @@ static void ath11k_mgmt_over_wmi_tx_work + arvif->is_started); + ieee80211_free_txskb(ar->hw, skb); + } ++ mutex_unlock(&ar->conf_mutex); + } + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-cfr-for-qcn9000.patch b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-cfr-for-qcn9000.patch new file mode 100644 index 000000000..86b7a51d1 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/239-ath11k-cfr-for-qcn9000.patch @@ -0,0 +1,629 @@ +From 2150a4cc70ae0e62bb8de8e3bca0a0a062cb66b0 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Tue, 16 Feb 2021 16:37:25 +0530 +Subject: [PATCH] ath11k: add one shot/periodic cfr capture support for qcn9074 + +This patch add one shot/periodic CFR capture support for +qcn9074. + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/cfr.c | 216 +++++++++++++++++++++----- + drivers/net/wireless/ath/ath11k/cfr.h | 140 ++++++++++++++++- + drivers/net/wireless/ath/ath11k/core.c | 9 ++ + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 1 - + drivers/net/wireless/ath/ath11k/hw.c | 62 ++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 6 + + 6 files changed, 392 insertions(+), 42 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/cfr.c ++++ b/drivers/net/wireless/ath/ath11k/cfr.c +@@ -191,6 +191,18 @@ static int ath11k_cfr_correlate_and_rela + jiffies_to_msecs(diff)); + } + ++ if (ar->ab->hw_rev == ATH11K_HW_QCN9074_HW10) { ++ if (lut->header_length > CFR_HDR_MAX_LEN_WORDS_QCN9074 || ++ lut->payload_length > CFR_DATA_MAX_LEN_QCN9074) { ++ cfr->invalid_dma_length_cnt++; ++ ath11k_dbg(ar->ab, ATH11K_DBG_CFR, ++ "Invalid hdr/payload len hdr %u payload %u\n", ++ lut->header_length, ++ lut->payload_length); ++ return ATH11K_CORRELATE_STATUS_ERR; ++ } ++ } ++ + ath11k_cfr_free_pending_dbr_events(ar); + + cfr->release_cnt++; +@@ -215,6 +227,167 @@ static int ath11k_cfr_correlate_and_rela + } + } + ++static u8 freeze_reason_to_capture_type(void *freeze_tlv) ++{ ++ struct macrx_freeze_capture_channel *freeze = ++ (struct macrx_freeze_capture_channel_v3 *)freeze_tlv; ++ u8 capture_reason = FIELD_GET(MACRX_FREEZE_CC_INFO0_CAPTURE_REASON, ++ freeze->info0); ++ ++ switch (capture_reason) { ++ case FREEZE_REASON_TM: ++ return CFR_CAPTURE_METHOD_TM; ++ case FREEZE_REASON_FTM: ++ return CFR_CAPTURE_METHOD_FTM; ++ case FREEZE_REASON_TA_RA_TYPE_FILTER: ++ return CFR_CAPTURE_METHOD_TA_RA_TYPE_FILTER; ++ case FREEZE_REASON_NDPA_NDP: ++ return CFR_CAPTURE_METHOD_NDPA_NDP; ++ case FREEZE_REASON_ALL_PACKET: ++ return CFR_CAPTURE_METHOD_ALL_PACKET; ++ case FREEZE_REASON_ACK_RESP_TO_TM_FTM: ++ return CFR_CAPTURE_METHOD_ACK_RESP_TO_TM_FTM; ++ default: ++ return CFR_CAPTURE_METHOD_AUTO; ++ } ++ ++ return CFR_CAPTURE_METHOD_AUTO; ++} ++ ++static void ++extract_peer_mac_from_freeze_tlv(void *freeze_tlv, uint8_t *peermac) ++{ ++ struct macrx_freeze_capture_channel_v3 *freeze = ++ (struct macrx_freeze_capture_channel_v3 *)freeze_tlv; ++ ++ peermac[0] = freeze->packet_ta_lower_16 & 0x00FF; ++ peermac[1] = (freeze->packet_ta_lower_16 & 0xFF00) >> 8; ++ peermac[2] = freeze->packet_ta_mid_16 & 0x00FF; ++ peermac[3] = (freeze->packet_ta_mid_16 & 0xFF00) >> 8; ++ peermac[4] = freeze->packet_ta_upper_16 & 0x00FF; ++ peermac[5] = (freeze->packet_ta_upper_16 & 0xFF00) >> 8; ++} ++ ++static int ath11k_cfr_enh_process_data(struct ath11k *ar, ++ struct ath11k_dbring_data *param) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct ath11k_cfr *cfr = &ar->cfr; ++ struct ath11k_cfr_look_up_table *lut; ++ struct ath11k_csi_cfr_header *header; ++ struct ath11k_cfir_enh_dma_hdr dma_hdr; ++ struct cfr_metadata_version_3 *meta; ++ void *mu_rx_user_info = NULL, *freeze_tlv = NULL; ++ u8 *peer_macaddr; ++ u8 *data; ++ u32 buf_id; ++ u32 length; ++ u32 freeze_tlv_len = 0; ++ u32 end_magic = ATH11K_CFR_END_MAGIC; ++ u8 freeze_tlv_ver; ++ u8 capture_type; ++ int ret = 0; ++ int status; ++ ++ data = param->data; ++ buf_id = param->buf_id; ++ ++ memcpy(&dma_hdr, data, sizeof(struct ath11k_cfir_enh_dma_hdr)); ++ ++ freeze_tlv_ver = FIELD_GET(CFIR_DMA_HDR_INFO2_FREEZ_TLV_VER, dma_hdr.info2); ++ ++ if (FIELD_GET(CFIR_DMA_HDR_INFO2_FREEZ_DATA_INC, dma_hdr.info2)) { ++ freeze_tlv = data + sizeof(struct ath11k_cfir_enh_dma_hdr); ++ capture_type = freeze_reason_to_capture_type(freeze_tlv); ++ } ++ ++ if (FIELD_GET(CFIR_DMA_HDR_INFO2_MURX_DATA_INC, dma_hdr.info2)) { ++ if (freeze_tlv_ver == MACRX_FREEZE_TLV_VERSION_3) ++ freeze_tlv_len = sizeof(struct macrx_freeze_capture_channel_v3); ++ else ++ freeze_tlv_len = sizeof(struct macrx_freeze_capture_channel); ++ ++ mu_rx_user_info = data + sizeof(struct ath11k_cfir_enh_dma_hdr) + ++ freeze_tlv_len; ++ } ++ ++ length = FIELD_GET(CFIR_DMA_HDR_INFO0_LEN, dma_hdr.hdr.info0) * 4; ++ length += dma_hdr.total_bytes; ++ ++ spin_lock_bh(&cfr->lut_lock); ++ ++ if (!cfr->lut) { ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ lut = &cfr->lut[buf_id]; ++ if (!lut) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "lut failure to process cfr data id:%d\n", buf_id); ++ spin_unlock_bh(&cfr->lut_lock); ++ return -EINVAL; ++ } ++ ++ ++ ath11k_dbg_dump(ab, ATH11K_DBG_CFR_DUMP,"data_from_buf_rel:", "", ++ data, length); ++ ++ lut->buff = param->buff; ++ lut->data = data; ++ lut->data_len = length; ++ lut->dbr_ppdu_id = dma_hdr.hdr.phy_ppdu_id; ++ lut->dbr_tstamp = jiffies; ++ lut->header_length = FIELD_GET(CFIR_DMA_HDR_INFO0_LEN, dma_hdr.hdr.info0); ++ lut->payload_length = dma_hdr.total_bytes; ++ memcpy(&lut->dma_hdr.enh_hdr, &dma_hdr, sizeof(struct ath11k_cfir_enh_dma_hdr)); ++ ++ header = &lut->header; ++ meta = &header->u.meta_v3; ++ meta->channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, ++ dma_hdr.hdr.info1); ++ meta->num_rx_chain = ++ NUM_CHAINS_FW_TO_HOST(FIELD_GET(CFIR_DMA_HDR_INFO1_NUM_CHAINS, ++ dma_hdr.hdr.info1)); ++ meta->length = length; ++ ++ if (capture_type != CFR_CAPTURE_METHOD_ACK_RESP_TO_TM_FTM) { ++ meta->capture_type = capture_type; ++ meta->sts_count = FIELD_GET(CFIR_DMA_HDR_INFO1_NSS, dma_hdr.hdr.info1) + 1; ++ if (FIELD_GET(CFIR_DMA_HDR_INFO2_MURX_DATA_INC, dma_hdr.info2)) { ++ peer_macaddr = meta->peer_addr.su_peer_addr; ++ if (freeze_tlv) ++ extract_peer_mac_from_freeze_tlv(freeze_tlv, peer_macaddr); ++ } ++ } ++ ++ status = ath11k_cfr_correlate_and_relay(ar, lut, ++ ATH11K_CORRELATE_DBR_EVENT); ++ ++ if (status == ATH11K_CORRELATE_STATUS_RELEASE) { ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "releasing CFR data to user space"); ++ ath11k_cfr_rfs_write(ar, &lut->header, ++ sizeof(struct ath11k_csi_cfr_header), ++ lut->data, lut->data_len, ++ &end_magic, sizeof(u32)); ++ ath11k_cfr_release_lut_entry(lut); ++ ret = ATH11K_CORRELATE_STATUS_RELEASE; ++ } else if (status == ATH11K_CORRELATE_STATUS_HOLD) { ++ ret = ATH11K_CORRELATE_STATUS_HOLD; ++ ath11k_dbg(ab, ATH11K_DBG_CFR, ++ "tx event is not yet received holding the buf"); ++ } else { ++ ath11k_cfr_release_lut_entry(lut); ++ ret = ATH11K_CORRELATE_STATUS_ERR; ++ ath11k_err(ab, "error in processing buf rel event"); ++ } ++ ++ spin_unlock_bh(&cfr->lut_lock); ++ ++ return ret; ++} ++ + static int ath11k_cfr_process_data(struct ath11k *ar, + struct ath11k_dbring_data *param) + { +@@ -274,7 +447,7 @@ static int ath11k_cfr_process_data(struc + lut->dbr_ppdu_id = dma_hdr.phy_ppdu_id; + lut->dbr_tstamp = jiffies; + +- memcpy(&lut->hdr, &dma_hdr, sizeof(struct ath11k_cfir_dma_hdr)); ++ memcpy(&lut->dma_hdr.hdr, &dma_hdr, sizeof(struct ath11k_cfir_dma_hdr)); + + header = &lut->header; + header->u.meta_v2.channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, +@@ -307,38 +480,6 @@ static int ath11k_cfr_process_data(struc + return ret; + } + +-static void ath11k_cfr_fill_hdr_info(struct ath11k *ar, +- struct ath11k_csi_cfr_header *header, +- struct ath11k_cfr_peer_tx_param *params) +-{ +- header->cfr_metadata_version = ATH11K_CFR_META_VERSION_2; +- header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; +- /* TODO: can we add this chip_type to hw param table */ +- header->chip_type = ATH11K_CFR_RADIO_IPQ8074; +- header->u.meta_v2.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, +- params->status); +- header->u.meta_v2.capture_bw = params->bandwidth; +- header->u.meta_v2.phy_mode = params->phy_mode; +- header->u.meta_v2.prim20_chan = params->primary_20mhz_chan; +- header->u.meta_v2.center_freq1 = params->band_center_freq1; +- header->u.meta_v2.center_freq2 = params->band_center_freq2; +- +- /* Currently CFR data is captured on ACK of a Qos NULL frame. +- * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy. +- */ +- header->u.meta_v2.capture_mode = params->bandwidth ? +- ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; +- header->u.meta_v2.capture_type = params->capture_method; +- header->u.meta_v2.num_rx_chain = ar->num_rx_chains; +- header->u.meta_v2.sts_count = params->spatial_streams; +- header->u.meta_v2.timestamp = params->timestamp_us; +- memcpy(header->u.meta_v2.peer_addr, params->peer_mac_addr, ETH_ALEN); +- memcpy(header->u.meta_v2.chain_rssi, params->chain_rssi, +- sizeof(params->chain_rssi)); +- memcpy(header->u.meta_v2.chain_phase, params->chain_phase, +- sizeof(params->chain_phase)); +-} +- + int ath11k_process_cfr_capture_event(struct ath11k_base *ab, + struct ath11k_cfr_peer_tx_param *params) + { +@@ -431,7 +572,7 @@ int ath11k_process_cfr_capture_event(str + header->vendorid = VENDOR_QCA; + header->pltform_type = PLATFORM_TYPE_ARM; + +- ath11k_cfr_fill_hdr_info(ar, header, params); ++ ab->hw_params.hw_ops->fill_cfr_hdr_info(ar, header, params); + + status = ath11k_cfr_correlate_and_relay(ar, lut, + ATH11K_CORRELATE_TX_EVENT); +@@ -451,7 +592,10 @@ int ath11k_process_cfr_capture_event(str + ath11k_dbg(ab, ATH11K_DBG_CFR, + "dbr event is not yet received holding buf\n"); + } else { ++ buff = lut->buff; + ath11k_cfr_release_lut_entry(lut); ++ ath11k_dbring_bufs_replenish(ar, &cfr->rx_ring, buff, ++ WMI_DIRECT_BUF_CFR, GFP_ATOMIC); + ret = -EINVAL; + } + +@@ -758,7 +902,9 @@ static int ath11k_cfr_ring_alloc(struct + ath11k_dbring_set_cfg(ar, &cfr->rx_ring, + ATH11K_CFR_NUM_RESP_PER_EVENT, + ATH11K_CFR_EVENT_TIMEOUT_MS, +- ath11k_cfr_process_data); ++ ((ar->ab->hw_rev == ATH11K_HW_IPQ8074) ? ++ ath11k_cfr_process_data : ++ ath11k_cfr_enh_process_data)); + + ret = ath11k_dbring_buf_setup(ar, &cfr->rx_ring, db_cap); + if (ret) { +--- a/drivers/net/wireless/ath/ath11k/cfr.h ++++ b/drivers/net/wireless/ath/ath11k/cfr.h +@@ -21,9 +21,14 @@ + #define ATH11K_CFR_END_MAGIC 0xBEAFDEAD + + #define ATH11K_CFR_RADIO_IPQ8074 23 ++#define ATH11K_CFR_RADIO_QCN9074 26 ++ ++#define CFR_HDR_MAX_LEN_WORDS_QCN9074 50 ++#define CFR_DATA_MAX_LEN_QCN9074 16384 + + #define VENDOR_QCA 0x8cfdf0 + #define PLATFORM_TYPE_ARM 2 ++#define NUM_CHAINS_FW_TO_HOST(n) ((1 << ((n) + 1)) - 1) + + enum ath11k_cfr_meta_version { + ATH11K_CFR_META_VERSION_NONE, +@@ -92,6 +97,7 @@ struct cfr_metadata_version_1 { + } __packed; + + #define HOST_MAX_CHAINS 8 ++#define MAX_CFR_MU_USERS 4 + + struct cfr_metadata_version_2 { + u8 peer_addr[ETH_ALEN]; +@@ -112,6 +118,30 @@ struct cfr_metadata_version_2 { + u16 chain_phase[HOST_MAX_CHAINS]; + } __packed; + ++struct cfr_metadata_version_3 { ++ u8 status; ++ u8 capture_bw; ++ u8 channel_bw; ++ u8 phy_mode; ++ u16 prim20_chan; ++ u16 center_freq1; ++ u16 center_freq2; ++ u8 capture_mode; ++ u8 capture_type; ++ u8 sts_count; ++ u8 num_rx_chain; ++ u64 timestamp; ++ u32 length; ++ u8 is_mu_ppdu; ++ u8 num_mu_users; ++ union { ++ u8 su_peer_addr[ETH_ALEN]; ++ u8 mu_peer_addr[MAX_CFR_MU_USERS][ETH_ALEN]; ++ } peer_addr; ++ u32 chain_rssi[HOST_MAX_CHAINS]; ++ u16 chain_phase[HOST_MAX_CHAINS]; ++} __packed; ++ + struct ath11k_csi_cfr_header { + u32 start_magic_num; + u32 vendorid; +@@ -123,6 +153,7 @@ struct ath11k_csi_cfr_header { + union { + struct cfr_metadata_version_1 meta_v1; + struct cfr_metadata_version_2 meta_v2; ++ struct cfr_metadata_version_3 meta_v3; + } u; + } __packed; + +@@ -156,6 +187,26 @@ struct ath11k_cfir_dma_hdr { + u16 phy_ppdu_id; + }; + ++#define CFIR_DMA_HDR_INFO2_HDR_VER GENMASK(3, 0) ++#define CFIR_DMA_HDR_INFO2_TARGET_ID GENMASK(7, 4) ++#define CFIR_DMA_HDR_INFO2_CFR_FMT BIT(8) ++#define CFIR_DMA_HDR_INFO2_RSVD BIT(9) ++#define CFIR_DMA_HDR_INFO2_MURX_DATA_INC BIT(10) ++#define CFIR_DMA_HDR_INFO2_FREEZ_DATA_INC BIT(11) ++#define CFIR_DMA_HDR_INFO2_FREEZ_TLV_VER GENMASK(15, 12) ++ ++#define CFIR_DMA_HDR_INFO3_MU_RX_NUM_USERS GENMASK(7, 0) ++#define CFIR_DMA_HDR_INFO3_DECIMATION_FACT GENMASK(11, 8) ++#define CFIR_DMA_HDR_INFO3_RSVD GENMASK(15, 12) ++ ++struct ath11k_cfir_enh_dma_hdr { ++ struct ath11k_cfir_dma_hdr hdr; ++ u16 total_bytes; ++ u16 info2; ++ u16 info3; ++ u16 rsvd; ++}; ++ + #define CFR_MAX_LUT_ENTRIES 136 + + struct ath11k_cfr_look_up_table { +@@ -169,7 +220,10 @@ struct ath11k_cfr_look_up_table { + u32 tx_address1; + u32 tx_address2; + struct ath11k_csi_cfr_header header; +- struct ath11k_cfir_dma_hdr hdr; ++ union { ++ struct ath11k_cfir_dma_hdr hdr; ++ struct ath11k_cfir_enh_dma_hdr enh_hdr; ++ } dma_hdr; + u64 txrx_tstamp; + u64 dbr_tstamp; + u32 header_length; +@@ -193,6 +247,85 @@ enum cfr_capture_type { + CFR_CAPTURE_METHOD_MAX, + }; + ++/* enum macrx_freeze_tlv_version: Reported by uCode in enh_dma_header ++ * MACRX_FREEZE_TLV_VERSION_1: Single MU UL user info reported by MAC ++ * MACRX_FREEZE_TLV_VERSION_2: Upto 4 MU UL user info reported by MAC ++ * MACRX_FREEZE_TLV_VERSION_3: Upto 37 MU UL user info reported by MAC ++ */ ++enum macrx_freeze_tlv_version { ++ MACRX_FREEZE_TLV_VERSION_1 = 1, ++ MACRX_FREEZE_TLV_VERSION_2 = 2, ++ MACRX_FREEZE_TLV_VERSION_3 = 3, ++ MACRX_FREEZE_TLV_VERSION_MAX ++}; ++ ++enum mac_freeze_capture_reason { ++ FREEZE_REASON_TM = 0, ++ FREEZE_REASON_FTM, ++ FREEZE_REASON_ACK_RESP_TO_TM_FTM, ++ FREEZE_REASON_TA_RA_TYPE_FILTER, ++ FREEZE_REASON_NDPA_NDP, ++ FREEZE_REASON_ALL_PACKET, ++ FREEZE_REASON_MAX, ++}; ++ ++#define MACRX_FREEZE_CC_INFO0_FREEZE GENMASK(0, 0) ++#define MACRX_FREEZE_CC_INFO0_CAPTURE_REASON GENMASK(3, 1) ++#define MACRX_FREEZE_CC_INFO0_PKT_TYPE GENMASK(5, 4) ++#define MACRX_FREEZE_CC_INFO0_PKT_SUB_TYPE GENMASK(9, 6) ++#define MACRX_FREEZE_CC_INFO0_RSVD GENMASK(14, 10) ++#define MACRX_FREEZE_CC_INFO0_SW_PEER_ID_VALID GENMASK(15, 15) ++ ++#define MACRX_FREEZE_CC_INFO1_USER_MASK GENMASK(5, 0) ++#define MACRX_FREEZE_CC_INFO1_DIRECTED GENMASK(6, 6) ++#define MACRX_FREEZE_CC_INFO1_RSVD GENMASK(15, 7) ++ ++struct macrx_freeze_capture_channel { ++ u16 info0; ++ u16 sw_peer_id; ++ u16 phy_ppdu_id; ++ u16 packet_ta_lower_16; ++ u16 packet_ta_mid_16; ++ u16 packet_ta_upper_16; ++ u16 packet_ra_lower_16; ++ u16 packet_ra_mid_16; ++ u16 packet_ra_upper_16; ++ u16 tsf_timestamp_15_0; ++ u16 tsf_timestamp_31_16; ++ u16 tsf_timestamp_47_32; ++ u16 tsf_timestamp_63_48; ++ u16 info1; ++}; ++ ++#define MACRX_FREEZE_CC_V3_INFO0_FREEZE GENMASK(0, 0) ++#define MACRX_FREEZE_CC_V3_INFO0_CAPTURE_REASON GENMASK(3, 1) ++#define MACRX_FREEZE_CC_V3_INFO0_PKT_TYPE GENMASK(5, 4) ++#define MACRX_FREEZE_CC_V3_INFO0_PKT_SUB_TYPE GENMASK(9, 6) ++#define MACRX_FREEZE_CC_V3_INFO0_DIRECTED GENMASK(10, 10) ++#define MACRX_FREEZE_CC_V3_INFO0_RSVD GENMASK(14, 11) ++#define MACRX_FREEZE_CC_V3_INFO0_SW_PEER_ID_VALID GENMASK(15, 15) ++ ++/* ++ * freeze_tlv v3 used by qcn9074 ++ */ ++struct macrx_freeze_capture_channel_v3 { ++ u16 info0; ++ u16 sw_peer_id; ++ u16 phy_ppdu_id; ++ u16 packet_ta_lower_16; ++ u16 packet_ta_mid_16; ++ u16 packet_ta_upper_16; ++ u16 packet_ra_lower_16; ++ u16 packet_ra_mid_16; ++ u16 packet_ra_upper_16; ++ u16 tsf_timestamp_15_0; ++ u16 tsf_timestamp_31_16; ++ u16 tsf_timestamp_47_32; ++ u16 tsf_63_48_or_user_mask_36_32; ++ u16 user_index_or_user_mask_15_0; ++ u16 user_mask_31_16; ++}; ++ + struct cfr_unassoc_pool_entry { + u8 peer_mac[ETH_ALEN]; + u32 period; +@@ -238,7 +371,6 @@ struct ath11k_dbring *ath11k_cfr_get_dbr + int ath11k_process_cfr_capture_event(struct ath11k_base *ab, + struct ath11k_cfr_peer_tx_param *params); + bool peer_is_in_cfr_unassoc_pool(struct ath11k *ar, u8 *peer_mac); +-void ath11k_cfr_relase_lut_entry(struct ath11k_cfr_look_up_table *lut); + void ath11k_cfr_lut_update_paddr(struct ath11k *ar, dma_addr_t paddr, + u32 buf_id); + void ath11k_cfr_decrement_peer_count(struct ath11k *ar, +@@ -261,10 +393,6 @@ static inline bool peer_is_in_cfr_unasso + return false; + } + static inline +-void ath11k_cfr_relase_lut_entry(struct ath11k_cfr_look_up_table *lut) +-{ +-} +-static inline + int ath11k_process_cfr_capture_event(struct ath11k_base *ab, + struct ath11k_cfr_peer_tx_param *params) + { +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -247,6 +247,15 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = true, + .fwmem_mode_change = true, + .is_qdss_support = true, ++ .cfr_support = true, ++ .cfr_dma_hdr_size = sizeof(struct ath11k_cfir_enh_dma_hdr), ++ .cfr_num_stream_bufs = 255, ++ /* sizeof (ath11k_csi_cfr_header) + max cfr header(200 bytes) + ++ * max cfr payload(16384 bytes) ++ */ ++ .cfr_stream_buf_size = sizeof(struct ath11k_csi_cfr_header) + ++ (CFR_HDR_MAX_LEN_WORDS_QCN9074 *4) + ++ CFR_DATA_MAX_LEN_QCN9074, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -1384,7 +1384,6 @@ static ssize_t ath11k_dbg_sta_write_cfr_ + } + + if (cfr_capture_enable > WMI_PEER_CFR_CAPTURE_ENABLE || +- cfr_capture_bw > WMI_PEER_CFR_CAPTURE_BW_80MHZ || + cfr_capture_bw > sta->bandwidth || + cfr_capture_method > CFR_CAPURE_METHOD_NULL_FRAME_WITH_PHASE || + cfr_capture_period > WMI_PEER_CFR_PERIODICITY_MAX) { +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -865,6 +865,66 @@ int ath11k_dp_rx_process_mon_rings_qcn90 + return ath11k_dp_rx_process_full_monitor(ab, mac_id, napi, budget); + } + ++void ath11k_hw_ipq8074_fill_cfr_hdr_info(struct ath11k *ar, ++ struct ath11k_csi_cfr_header *header, ++ struct ath11k_cfr_peer_tx_param *params) ++{ ++ header->cfr_metadata_version = ATH11K_CFR_META_VERSION_2; ++ header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; ++ /* TODO: can we add this chip_type to hw param table */ ++ header->chip_type = ATH11K_CFR_RADIO_IPQ8074; ++ header->u.meta_v2.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, ++ params->status); ++ header->u.meta_v2.capture_bw = params->bandwidth; ++ header->u.meta_v2.phy_mode = params->phy_mode; ++ header->u.meta_v2.prim20_chan = params->primary_20mhz_chan; ++ header->u.meta_v2.center_freq1 = params->band_center_freq1; ++ header->u.meta_v2.center_freq2 = params->band_center_freq2; ++ ++ /* Currently CFR data is captured on ACK of a Qos NULL frame. ++ * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy. ++ */ ++ header->u.meta_v2.capture_mode = params->bandwidth ? ++ ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; ++ header->u.meta_v2.capture_type = params->capture_method; ++ header->u.meta_v2.num_rx_chain = ar->cfg_rx_chainmask; ++ header->u.meta_v2.sts_count = params->spatial_streams; ++ header->u.meta_v2.timestamp = params->timestamp_us; ++ memcpy(header->u.meta_v2.peer_addr, params->peer_mac_addr, ETH_ALEN); ++ memcpy(header->u.meta_v2.chain_rssi, params->chain_rssi, ++ sizeof(params->chain_rssi)); ++ memcpy(header->u.meta_v2.chain_phase, params->chain_phase, ++ sizeof(params->chain_phase)); ++} ++ ++void ath11k_hw_qcn9074_fill_cfr_hdr_info(struct ath11k *ar, ++ struct ath11k_csi_cfr_header *header, ++ struct ath11k_cfr_peer_tx_param *params) ++{ ++ header->cfr_metadata_version = ATH11K_CFR_META_VERSION_3; ++ header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; ++ header->chip_type = ATH11K_CFR_RADIO_QCN9074; ++ header->u.meta_v3.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, ++ params->status); ++ header->u.meta_v3.capture_bw = params->bandwidth; ++ header->u.meta_v3.phy_mode = params->phy_mode; ++ header->u.meta_v3.prim20_chan = params->primary_20mhz_chan; ++ header->u.meta_v3.center_freq1 = params->band_center_freq1; ++ header->u.meta_v3.center_freq2 = params->band_center_freq2; ++ header->u.meta_v3.capture_mode = params->bandwidth ? ++ ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; ++ header->u.meta_v3.capture_type = params->capture_method; ++ header->u.meta_v3.num_rx_chain = ar->cfg_rx_chainmask; ++ header->u.meta_v3.sts_count = params->spatial_streams; ++ header->u.meta_v3.timestamp = params->timestamp_us; ++ memcpy(header->u.meta_v3.peer_addr.su_peer_addr, ++ params->peer_mac_addr, ETH_ALEN); ++ memcpy(header->u.meta_v3.chain_rssi, params->chain_rssi, ++ sizeof(params->chain_rssi)); ++ memcpy(header->u.meta_v3.chain_phase, params->chain_phase, ++ sizeof(params->chain_phase)); ++} ++ + const struct ath11k_hw_ops ipq8074_ops = { + .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, + .wmi_init_config = ath11k_init_wmi_config_ipq8074, +@@ -963,6 +1023,7 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, ++ .fill_cfr_hdr_info = ath11k_hw_ipq8074_fill_cfr_hdr_info, + }; + + const struct ath11k_hw_ops qca6390_ops = { +@@ -1058,6 +1119,7 @@ const struct ath11k_hw_ops qcn9074_ops = + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, ++ .fill_cfr_hdr_info = ath11k_hw_qcn9074_fill_cfr_hdr_info, + }; + + /* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */ +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -8,6 +8,9 @@ + + #include "wmi.h" + ++struct ath11k_csi_cfr_header; ++struct ath11k_cfr_peer_tx_param; ++ + /* Target configuration defines */ + #ifdef CPTCFG_ATH11K_MEM_PROFILE_512M + +@@ -260,6 +263,9 @@ struct ath11k_hw_ops { + void (*rx_desc_get_crypto_header)(struct hal_rx_desc *desc, + u8 *crypto_hdr, + enum hal_encrypt_type enctype); ++ void (*fill_cfr_hdr_info)(struct ath11k *ar, ++ struct ath11k_csi_cfr_header *header, ++ struct ath11k_cfr_peer_tx_param *params); + }; + + extern const struct ath11k_hw_ops ipq8074_ops; diff --git a/feeds/wifi-ax/mac80211/patches/qca/244-ath11k-dp-tx-perf.patch b/feeds/wifi-ax/mac80211/patches/qca/244-ath11k-dp-tx-perf.patch new file mode 100644 index 000000000..fc9781a62 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/244-ath11k-dp-tx-perf.patch @@ -0,0 +1,805 @@ +From a19b1279d75dd1306c6eac291e985657f988780c Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Thu, 7 Jan 2021 16:32:30 +0530 +Subject: [PATCH] ath11k: dp_tx perf improvements + + Contains below changes, + 1. Add branch prediction in tx path + 2. Allow fast tx completion by freeing skb when stats is disabled. + 3. Remove mod operator overhead for dst ring access to avoid(to be profiled) + 4. Lockless tcl ring usage since rings are selected per cpu + +Sample stats disable command: +echo 1 > /sys/kernel/debug/ath11k/qcn9000\ hw1.0_0000\:01\:00.0/stats_disable +echo 1 > /sys/kernel/debug/ath11k/ipq8074\ hw2.0/stats_disable + +Signed-off-by: Sriram R +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/dp.c | 7 +- + drivers/net/wireless/ath/ath11k/dp_tx.c | 118 ++++++++++++++++++-------------- + drivers/net/wireless/ath/ath11k/dp_tx.h | 2 + + drivers/net/wireless/ath/ath11k/hal.c | 9 ++- + drivers/net/wireless/ath/ath11k/mac.c | 9 ++- + 6 files changed, 88 insertions(+), 58 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -98,6 +98,7 @@ static inline enum wme_ac ath11k_tid_to_ + enum ath11k_skb_flags { + ATH11K_SKB_HW_80211_ENCAP = BIT(0), + ATH11K_SKB_CIPHER_SET = BIT(1), ++ ATH11K_SKB_TX_STATUS = BIT(2), + }; + + struct ath11k_skb_cb { +@@ -815,10 +816,16 @@ struct ath11k_dp_ring_bp_stats { + struct ath11k_soc_dp_tx_err_stats { + /* TCL Ring Descriptor unavailable */ + u32 desc_na[DP_TCL_NUM_RING_MAX]; ++ /* TCL Ring IDR unavailable */ ++ u32 idr_na[DP_TCL_NUM_RING_MAX]; ++ + /* Other failures during dp_tx due to mem allocation failure + * idr unavailable etc. + */ + atomic_t misc_fail; ++ atomic_t max_fail; ++ /* Tx failures due to NSS Tx error status */ ++ atomic_t nss_tx_fail; + }; + + struct ath11k_soc_dp_stats { +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -410,6 +410,11 @@ static int ath11k_dp_srng_common_setup(s + goto err; + } + ++ if (ab->hw_params.max_tx_ring > DP_TCL_NUM_RING_MAX) { ++ srng = &ab->hal.srng_list[dp->tcl_cmd_ring.ring_id]; ++ ath11k_hal_tx_init_data_ring(ab, srng, HAL_TCL_CMD); ++ } ++ + ret = ath11k_dp_srng_setup(ab, &dp->tcl_status_ring, HAL_TCL_STATUS, + 0, 0, DP_TCL_STATUS_RING_SIZE); + if (ret) { +@@ -437,7 +442,7 @@ static int ath11k_dp_srng_common_setup(s + } + + srng = &ab->hal.srng_list[dp->tx_ring[i].tcl_data_ring.ring_id]; +- ath11k_hal_tx_init_data_ring(ab, srng); ++ ath11k_hal_tx_init_data_ring(ab, srng, HAL_TCL_DATA); + + ath11k_dp_shadow_init_timer(ab, &dp->tx_ring_timer[i], + ATH11K_SHADOW_DP_TIMER_INTERVAL, +@@ -809,10 +814,9 @@ int ath11k_dp_service_srng(struct ath11k + /* Processing of offloaded rings are not required */ + nss_offload = ab->nss.enabled; + +- while (!nss_offload && ab->hw_params.ring_mask->tx[grp_id] >> i) { +- if (ab->hw_params.ring_mask->tx[grp_id] & BIT(i)) +- ath11k_dp_tx_completion_handler(ab, i); +- i++; ++ if (!nss_offload && ab->hw_params.ring_mask->tx[grp_id]) { ++ i = __fls(ab->hw_params.ring_mask->tx[grp_id]); ++ ath11k_dp_tx_completion_handler(ab, i); + } + + if (!nss_offload && ab->hw_params.ring_mask->rx_err[grp_id]) { +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -122,15 +122,16 @@ int ath11k_dp_tx(struct ath11k *ar, stru + int ret; + u8 ring_selector = 0, ring_map = 0; + bool tcl_ring_retry; +- u8 align_pad, htt_meta_size = 0; ++ u8 align_pad, htt_meta_size = 0, max_tx_ring, tcl_ring_id, ring_id; + +- if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags)) ++ if (unlikely(test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))) + return -ESHUTDOWN; + +- if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && +- !ieee80211_is_data(hdr->frame_control)) ++ if (unlikely(!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && ++ !ieee80211_is_data(hdr->frame_control))) + return -ENOTSUPP; + ++ max_tx_ring = ab->hw_params.max_tx_ring; + pool_id = skb_get_queue_mapping(skb) & (ATH11K_HW_MAX_QUEUES - 1); + + /* Let the default ring selection be based on current processor +@@ -140,28 +141,37 @@ int ath11k_dp_tx(struct ath11k *ar, stru + * If all rings are full, we drop the packet. + * //TODO Add throttling logic when all rings are full + */ ++ if (unlikely(atomic_read(&ab->num_max_allowed) > DP_TX_COMP_MAX_ALLOWED)) { ++ atomic_inc(&ab->soc_stats.tx_err.max_fail); ++ ret = -EINVAL; ++ } + ring_selector = smp_processor_id(); + + tcl_ring_sel: + tcl_ring_retry = false; + /* For some chip, it can only use tcl0 to tx */ +- if (ar->ab->hw_params.tcl_0_only) +- ti.ring_id = 0; +- else +- ti.ring_id = ring_selector % DP_TCL_NUM_RING_MAX; ++ if (ar->ab->hw_params.tcl_0_only) { ++ ring_id = 0; ++ tcl_ring_id = 0; ++ } else { ++ ring_id = ring_selector % max_tx_ring; ++ tcl_ring_id = (ring_id == DP_TCL_NUM_RING_MAX) ? ++ DP_TCL_NUM_RING_MAX - 1 : ring_id; ++ } + +- ring_map |= BIT(ti.ring_id); ++ ring_map |= BIT(ring_id); + +- tx_ring = &dp->tx_ring[ti.ring_id]; ++ ti.buf_id = tcl_ring_id + HAL_RX_BUF_RBM_SW0_BM; ++ tx_ring = &dp->tx_ring[tcl_ring_id]; + + spin_lock_bh(&tx_ring->tx_idr_lock); + ret = idr_alloc(&tx_ring->txbuf_idr, skb, 0, + DP_TX_IDR_SIZE - 1, GFP_ATOMIC); + spin_unlock_bh(&tx_ring->tx_idr_lock); + +- if (ret < 0) { +- if (ring_map == (BIT(DP_TCL_NUM_RING_MAX) - 1)) { +- atomic_inc(&ab->soc_stats.tx_err.misc_fail); ++ if (unlikely(ret < 0)) { ++ if (unlikely(ring_map == (BIT(max_tx_ring) - 1))) { ++ ab->soc_stats.tx_err.idr_na[tcl_ring_id]++; + return -ENOSPC; + } + +@@ -184,7 +194,7 @@ tcl_ring_sel: + ti.meta_data_flags = arvif->tcl_metadata; + } + +- if (ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW) { ++ if (unlikely(ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW)) { + if (skb_cb->flags & ATH11K_SKB_CIPHER_SET) { + ti.encrypt_type = + ath11k_dp_tx_get_encrypt_type(skb_cb->cipher); +@@ -205,8 +215,8 @@ tcl_ring_sel: + ti.bss_ast_idx = arvif->ast_idx; + ti.dscp_tid_tbl_idx = 0; + +- if (skb->ip_summed == CHECKSUM_PARTIAL && +- ti.encap_type != HAL_TCL_ENCAP_TYPE_RAW) { ++ if (likely(skb->ip_summed == CHECKSUM_PARTIAL && ++ ti.encap_type != HAL_TCL_ENCAP_TYPE_RAW)) { + ti.flags0 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_IP4_CKSUM_EN, 1) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_UDP4_CKSUM_EN, 1) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_UDP6_CKSUM_EN, 1) | +@@ -273,33 +283,37 @@ tcl_ring_sel: + ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN; + } + ++ ti.data_len = skb->len - ti.pkt_offset; ++ skb_cb->vif = arvif->vif; ++ skb_cb->ar = ar; ++ + ti.paddr = dma_map_single(ab->dev, skb->data, skb->len, DMA_TO_DEVICE); +- if (dma_mapping_error(ab->dev, ti.paddr)) { ++ if (unlikely(dma_mapping_error(ab->dev, ti.paddr))) { + atomic_inc(&ab->soc_stats.tx_err.misc_fail); + ath11k_warn(ab, "failed to DMA map data Tx buffer\n"); + ret = -ENOMEM; + goto fail_remove_idr; + } + +- ti.data_len = skb->len - ti.pkt_offset; + skb_cb->paddr = ti.paddr; +- skb_cb->vif = arvif->vif; +- skb_cb->ar = ar; + +- hal_ring_id = tx_ring->tcl_data_ring.ring_id; ++ if (ring_id == DP_TCL_NUM_RING_MAX) ++ hal_ring_id = dp->tcl_cmd_ring.ring_id; ++ else ++ hal_ring_id = tx_ring->tcl_data_ring.ring_id; ++ + tcl_ring = &ab->hal.srng_list[hal_ring_id]; + + spin_lock_bh(&tcl_ring->lock); +- + ath11k_hal_srng_access_begin(ab, tcl_ring); + + hal_tcl_desc = (void *)ath11k_hal_srng_src_get_next_entry(ab, tcl_ring); +- if (!hal_tcl_desc) { ++ if (unlikely(!hal_tcl_desc)) { + /* NOTE: It is highly unlikely we'll be running out of tcl_ring + * desc because the desc is directly enqueued onto hw queue. + */ + ath11k_hal_srng_access_end(ab, tcl_ring); +- ab->soc_stats.tx_err.desc_na[ti.ring_id]++; ++ ab->soc_stats.tx_err.desc_na[tcl_ring_id]++; + spin_unlock_bh(&tcl_ring->lock); + ret = -ENOMEM; + +@@ -308,8 +322,8 @@ tcl_ring_sel: + * checking this ring earlier for each pkt tx. + * Restart ring selection if some rings are not checked yet. + */ +- if (ring_map != (BIT(DP_TCL_NUM_RING_MAX) - 1) && +- !ar->ab->hw_params.tcl_0_only) { ++ if (unlikely(ring_map != (BIT(max_tx_ring) - 1) && ++ !ar->ab->hw_params.tcl_0_only)) { + tcl_ring_retry = true; + ring_selector++; + } +@@ -320,17 +334,17 @@ tcl_ring_sel: + ath11k_hal_tx_cmd_desc_setup(ab, hal_tcl_desc + + sizeof(struct hal_tlv_hdr), &ti); + ++ atomic_inc(&ar->dp.num_tx_pending); ++ atomic_inc(&ab->num_max_allowed); + ath11k_hal_srng_access_end(ab, tcl_ring); + +- ath11k_dp_shadow_start_timer(ab, tcl_ring, &dp->tx_ring_timer[ti.ring_id]); ++ ath11k_dp_shadow_start_timer(ab, tcl_ring, &dp->tx_ring_timer[ti.buf_id]); + + spin_unlock_bh(&tcl_ring->lock); + + ath11k_dbg_dump(ab, ATH11K_DBG_DP_TX, NULL, "dp tx msdu: ", + skb->data, skb->len); + +- atomic_inc(&ar->dp.num_tx_pending); +- atomic_inc(&ab->num_max_allowed); + + return 0; + +@@ -359,19 +373,18 @@ static void ath11k_dp_tx_free_txbuf(stru + struct sk_buff *msdu; + struct ath11k_skb_cb *skb_cb; + +- spin_lock_bh(&tx_ring->tx_idr_lock); + msdu = idr_find(&tx_ring->txbuf_idr, msdu_id); + if (!msdu) { + ath11k_warn(ab, "tx completion for unknown msdu_id %d\n", + msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); + return; + } + + skb_cb = ATH11K_SKB_CB(msdu); + ++ spin_lock(&tx_ring->tx_idr_lock); + idr_remove(&tx_ring->txbuf_idr, msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); ++ spin_unlock(&tx_ring->tx_idr_lock); + + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + dev_kfree_skb_any(msdu); +@@ -379,7 +392,6 @@ static void ath11k_dp_tx_free_txbuf(stru + ar = ab->pdevs[mac_id].ar; + if (atomic_dec_and_test(&ar->dp.num_tx_pending)) + wake_up(&ar->dp.tx_empty_waitq); +- atomic_dec(&ab->num_max_allowed); + } + + static void +@@ -394,12 +406,10 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + struct ieee80211_vif *vif; + u8 flags = 0; + +- spin_lock_bh(&tx_ring->tx_idr_lock); + msdu = idr_find(&tx_ring->txbuf_idr, ts->msdu_id); +- if (!msdu) { ++ if (unlikely(!msdu)) { + ath11k_warn(ab, "htt tx completion for unknown msdu_id %d\n", + ts->msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); + return; + } + +@@ -408,21 +418,36 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + + ar = skb_cb->ar; + ++ spin_lock(&tx_ring->tx_idr_lock); + idr_remove(&tx_ring->txbuf_idr, ts->msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); ++ spin_unlock(&tx_ring->tx_idr_lock); + + if (atomic_dec_and_test(&ar->dp.num_tx_pending)) + wake_up(&ar->dp.tx_empty_waitq); +- atomic_dec(&ab->num_max_allowed); + + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + +- if (!skb_cb->vif) { ++ flags = skb_cb->flags; ++ ++ /* Free skb here if stats is disabled */ ++ if (ab->stats_disable && !(flags & ATH11K_SKB_TX_STATUS)) { ++ if (msdu->destructor) { ++ msdu->wifi_acked_valid = 1; ++ msdu->wifi_acked = ts->acked; ++ } ++ if (skb_has_frag_list(msdu)) { ++ kfree_skb_list(skb_shinfo(msdu)->frag_list); ++ skb_shinfo(msdu)->frag_list = NULL; ++ } ++ dev_kfree_skb(msdu); ++ return; ++ } ++ ++ if (unlikely(!skb_cb->vif)) { + dev_kfree_skb_any(msdu); + return; + } + +- flags = skb_cb->flags; + vif = skb_cb->vif; + + memset(&info->status, 0, sizeof(info->status)); +@@ -509,9 +534,10 @@ static void ath11k_dp_tx_complete_msdu(s + struct ath11k_peer *peer; + struct ath11k_sta *arsta; + struct ieee80211_vif *vif; ++ struct rate_info rate; + u8 flags = 0; + +- if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) { ++ if (unlikely(WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM))) { + /* Must not happen */ + return; + } +@@ -520,19 +546,34 @@ static void ath11k_dp_tx_complete_msdu(s + + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + ++ flags = skb_cb->flags; ++ ++ /* Free skb here if stats is disabled */ ++ if (ab->stats_disable && !(flags & ATH11K_SKB_TX_STATUS)) { ++ if (msdu->destructor) { ++ msdu->wifi_acked_valid = 1; ++ msdu->wifi_acked = ts->status == HAL_WBM_TQM_REL_REASON_FRAME_ACKED; ++ } ++ if (skb_has_frag_list(msdu)) { ++ kfree_skb_list(skb_shinfo(msdu)->frag_list); ++ skb_shinfo(msdu)->frag_list = NULL; ++ } ++ dev_kfree_skb(msdu); ++ return; ++ } ++ + rcu_read_lock(); + +- if (!rcu_dereference(ab->pdevs_active[ar->pdev_idx])) { ++ if (unlikely(!rcu_dereference(ab->pdevs_active[ar->pdev_idx]))) { + dev_kfree_skb_any(msdu); + goto exit; + } + +- if (!skb_cb->vif) { ++ if (unlikely(!skb_cb->vif)) { + dev_kfree_skb_any(msdu); + goto exit; + } + +- flags = skb_cb->flags; + vif = skb_cb->vif; + + info = IEEE80211_SKB_CB(msdu); +@@ -553,7 +594,7 @@ static void ath11k_dp_tx_complete_msdu(s + (info->flags & IEEE80211_TX_CTL_NO_ACK)) + info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; + +- if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) { ++ if (unlikely(ath11k_debugfs_is_extd_tx_stats_enabled(ar))) { + if (ts->flags & HAL_TX_STATUS_FLAGS_FIRST_MSDU) { + if (ar->last_ppdu_id == 0) { + ar->last_ppdu_id = ts->ppdu_id; +@@ -583,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s + + spin_lock_bh(&ab->base_lock); + peer = ath11k_peer_find_by_id(ab, ts->peer_id); +- if (!peer || !peer->sta) { ++ if (unlikely(!peer || !peer->sta)) { + ath11k_dbg(ab, ATH11K_DBG_DATA, + "dp_tx: failed to find the peer with peer_id %d\n", + ts->peer_id); +@@ -595,13 +636,16 @@ static void ath11k_dp_tx_complete_msdu(s + status.sta = peer->sta; + status.skb = msdu; + status.info = info; +- status.rate = &arsta->last_txrate; ++ rate = arsta->last_txrate; ++ status.rate = &rate; ++ ++ spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); ++ + if (flags & ATH11K_SKB_HW_80211_ENCAP) + ieee80211_tx_status_8023(ar->hw, vif, msdu); + else + ieee80211_tx_status_ext(ar->hw, &status); +- spin_unlock_bh(&ab->base_lock); + return; + exit: + rcu_read_unlock(); +@@ -613,11 +657,11 @@ static inline void ath11k_dp_tx_status_p + { + ts->buf_rel_source = + FIELD_GET(HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE, desc->info0); +- if (ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_FW && +- ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM) ++ if (unlikely(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_FW && ++ ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) + return; + +- if (ts->buf_rel_source == HAL_WBM_REL_SRC_MODULE_FW) ++ if (unlikely(ts->buf_rel_source == HAL_WBM_REL_SRC_MODULE_FW)) + return; + + ts->status = FIELD_GET(HAL_WBM_RELEASE_INFO0_TQM_RELEASE_REASON, +@@ -638,6 +682,22 @@ static inline void ath11k_dp_tx_status_p + ts->rate_stats = 0; + } + ++static inline bool ath11k_dp_tx_completion_valid(struct hal_wbm_release_ring *desc) ++{ ++ struct htt_tx_wbm_completion *status_desc; ++ ++ if (FIELD_GET(HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE, desc->info0) == ++ HAL_WBM_REL_SRC_MODULE_FW) { ++ status_desc = ((u8 *)desc) + HTT_TX_WBM_COMP_STATUS_OFFSET; ++ ++ /* Dont consider HTT_TX_COMP_STATUS_MEC_NOTIFY */ ++ if (FIELD_GET(HTT_TX_WBM_COMP_INFO0_STATUS, status_desc->info0) == ++ HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY) ++ return false; ++ } ++ return true; ++} ++ + void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id) + { + struct ath11k *ar; +@@ -647,10 +707,11 @@ void ath11k_dp_tx_completion_handler(str + struct sk_buff *msdu; + struct hal_tx_status ts = { 0 }; + struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id]; +- int valid_entries; ++ int valid_entries, count = 0, i = 0; + u32 *desc; +- u32 msdu_id; ++ u32 msdu_id, desc_id; + u8 mac_id; ++ struct hal_wbm_release_ring *tx_status; + + spin_lock_bh(&status_ring->lock); + +@@ -665,32 +726,27 @@ void ath11k_dp_tx_completion_handler(str + + ath11k_hal_srng_dst_invalidate_entry(ab, status_ring, valid_entries); + +- while ((ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_head) != +- tx_ring->tx_status_tail) && +- (desc = ath11k_hal_srng_dst_get_next_cache_entry(ab, status_ring))) { +- memcpy(&tx_ring->tx_status[tx_ring->tx_status_head], +- desc, sizeof(struct hal_wbm_release_ring)); +- tx_ring->tx_status_head = +- ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_head); +- } ++ while ((desc = ath11k_hal_srng_dst_get_next_cache_entry(ab, status_ring))) { ++ if (!ath11k_dp_tx_completion_valid(desc)) ++ continue; + +- if ((ath11k_hal_srng_dst_peek(ab, status_ring) != NULL) && +- (ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_head) == tx_ring->tx_status_tail)) { +- /* TODO: Process pending tx_status messages when kfifo_is_full() */ +- ath11k_warn(ab, "Unable to process some of the tx_status ring desc because status_fifo is full\n"); ++ memcpy(&tx_ring->tx_status[count], ++ desc, sizeof(struct hal_wbm_release_ring)); ++ count++; + } + + ath11k_hal_srng_access_end(ab, status_ring); + + spin_unlock_bh(&status_ring->lock); + +- while (ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_tail) != tx_ring->tx_status_head) { +- struct hal_wbm_release_ring *tx_status; +- u32 desc_id; +- +- tx_ring->tx_status_tail = +- ATH11K_TX_COMPL_NEXT(tx_ring->tx_status_tail); +- tx_status = &tx_ring->tx_status[tx_ring->tx_status_tail]; ++ if (atomic_sub_return(count, &ab->num_max_allowed) < 0) { ++ ath11k_warn(ab, "tx completion mismatch count %d ring id %d max_num %d\n", ++ count, tx_ring->tcl_data_ring_id, ++ atomic_read(&ab->num_max_allowed)); ++ } ++ ++ while (count--) { ++ tx_status = &tx_ring->tx_status[i++]; + ath11k_dp_tx_status_parse(ab, tx_status, &ts); + + desc_id = FIELD_GET(BUFFER_ADDR_INFO1_SW_COOKIE, +@@ -698,7 +754,7 @@ void ath11k_dp_tx_completion_handler(str + mac_id = FIELD_GET(DP_TX_DESC_ID_MAC_ID, desc_id); + msdu_id = FIELD_GET(DP_TX_DESC_ID_MSDU_ID, desc_id); + +- if (ts.buf_rel_source == HAL_WBM_REL_SRC_MODULE_FW) { ++ if (unlikely(ts.buf_rel_source == HAL_WBM_REL_SRC_MODULE_FW)) { + ath11k_dp_tx_process_htt_tx_complete(ab, + (void *)tx_status, + mac_id, msdu_id, +@@ -706,16 +762,16 @@ void ath11k_dp_tx_completion_handler(str + continue; + } + +- spin_lock_bh(&tx_ring->tx_idr_lock); + msdu = idr_find(&tx_ring->txbuf_idr, msdu_id); +- if (!msdu) { ++ if (unlikely(!msdu)) { + ath11k_warn(ab, "tx completion for unknown msdu_id %d\n", + msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); + continue; + } ++ ++ spin_lock(&tx_ring->tx_idr_lock); + idr_remove(&tx_ring->txbuf_idr, msdu_id); +- spin_unlock_bh(&tx_ring->tx_idr_lock); ++ spin_unlock(&tx_ring->tx_idr_lock); + + ar = ab->pdevs[mac_id].ar; + +@@ -723,7 +779,6 @@ void ath11k_dp_tx_completion_handler(str + wake_up(&ar->dp.tx_empty_waitq); + + ath11k_dp_tx_complete_msdu(ar, msdu, &ts); +- atomic_dec(&ab->num_max_allowed); + } + } + +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -636,8 +636,11 @@ u32 *ath11k_hal_srng_dst_get_next_entry( + + desc = srng->ring_base_vaddr + srng->u.dst_ring.tp; + +- srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size) % +- srng->ring_size; ++ srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size); ++ ++ /* wrap around to start of ring*/ ++ if (srng->u.dst_ring.tp == srng->ring_size) ++ srng->u.dst_ring.tp = 0; + + /* Try to prefetch the next descriptor in the ring */ + if (srng->flags & HAL_SRNG_FLAGS_CACHED) { +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5969,13 +5969,22 @@ static void ath11k_mac_op_tx(struct ieee + return; + } + ++ /* Must call mac80211 tx status handler, else when stats is disabled we free ++ * the skb from driver. Own tx packets on monitor will also be disabled. ++ */ ++ if ((info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS | IEEE80211_TX_INTFL_NL80211_FRAME_TX)) || ++ info->ack_frame_id || vif->type == NL80211_IFTYPE_MESH_POINT || ++ ar->monitor_vdev_created) ++ skb_cb->flags |= ATH11K_SKB_TX_STATUS; ++ + if (ar->ab->nss.enabled) + ret = ath11k_nss_tx(arvif,skb); + else + ret = ath11k_dp_tx(ar, arvif, skb, + (control->sta) ? control->sta->drv_priv : NULL); +- if (ret) { +- ath11k_warn(ar->ab, "failed to transmit frame %d\n", ret); ++ if (unlikely(ret)) { ++ if (!ar->ab->nss.enabled && ret != -ENOSPC && ret != -ENOMEM) ++ ath11k_warn(ar->ab, "failed to transmit frame %d\n", ret); + ieee80211_free_txskb(ar->hw, skb); + return; + } +--- a/drivers/net/wireless/ath/ath11k/hal_tx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.c +@@ -36,19 +36,18 @@ static const u8 dscp_tid_map[DSCP_TID_MA + void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd, + struct hal_tx_info *ti) + { +- struct hal_tcl_data_cmd *tcl_cmd = (struct hal_tcl_data_cmd *)cmd; ++ struct hal_tcl_data_cmd tcl_cmd, *tcl_desc = (struct hal_tcl_data_cmd *)cmd; + +- tcl_cmd->buf_addr_info.info0 = ++ tcl_cmd.buf_addr_info.info0 = + FIELD_PREP(BUFFER_ADDR_INFO0_ADDR, ti->paddr); +- tcl_cmd->buf_addr_info.info1 = ++ tcl_cmd.buf_addr_info.info1 = + FIELD_PREP(BUFFER_ADDR_INFO1_ADDR, + ((uint64_t)ti->paddr >> HAL_ADDR_MSB_REG_SHIFT)); +- tcl_cmd->buf_addr_info.info1 |= +- FIELD_PREP(BUFFER_ADDR_INFO1_RET_BUF_MGR, +- (ti->ring_id + HAL_RX_BUF_RBM_SW0_BM)) | ++ tcl_cmd.buf_addr_info.info1 |= ++ FIELD_PREP(BUFFER_ADDR_INFO1_RET_BUF_MGR, ti->buf_id) | + FIELD_PREP(BUFFER_ADDR_INFO1_SW_COOKIE, ti->desc_id); + +- tcl_cmd->info0 = ++ tcl_cmd.info0 = + FIELD_PREP(HAL_TCL_DATA_CMD_INFO0_DESC_TYPE, ti->type) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO0_ENCAP_TYPE, ti->encap_type) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE, +@@ -60,24 +59,26 @@ void ath11k_hal_tx_cmd_desc_setup(struct + FIELD_PREP(HAL_TCL_DATA_CMD_INFO0_CMD_NUM, + ti->meta_data_flags); + +- tcl_cmd->info1 = ti->flags0 | ++ tcl_cmd.info1 = ti->flags0 | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_DATA_LEN, ti->data_len) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET, ti->pkt_offset); + +- tcl_cmd->info2 = ti->flags1 | ++ tcl_cmd.info2 = ti->flags1 | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID, ti->tid) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_LMAC_ID, ti->lmac_id); + +- tcl_cmd->info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, ++ tcl_cmd.info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, + ti->dscp_tid_tbl_idx) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX, + ti->bss_ast_idx) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, + ti->bss_ast_hash); +- tcl_cmd->info4 = 0; ++ tcl_cmd.info4 = 0; + + if (ti->enable_mesh) +- ab->hw_params.hw_ops->tx_mesh_enable(ab, tcl_cmd); ++ ab->hw_params.hw_ops->tx_mesh_enable(ab, &tcl_cmd); ++ ++ *tcl_desc = tcl_cmd; + } + + void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id) +@@ -137,7 +138,8 @@ void ath11k_hal_tx_set_dscp_tid_map(stru + ctrl_reg_val); + } + +-void ath11k_hal_tx_init_data_ring(struct ath11k_base *ab, struct hal_srng *srng) ++void ath11k_hal_tx_init_data_ring(struct ath11k_base *ab, struct hal_srng *srng, ++ enum hal_ring_type type) + { + struct hal_srng_params params; + struct hal_tlv_hdr *tlv; +@@ -146,7 +148,7 @@ void ath11k_hal_tx_init_data_ring(struct + + memset(¶ms, 0, sizeof(params)); + +- entry_size = ath11k_hal_srng_get_entrysize(ab, HAL_TCL_DATA); ++ entry_size = ath11k_hal_srng_get_entrysize(ab, type); + ath11k_hal_srng_get_params(ab, srng, ¶ms); + desc = (u8 *)params.ring_base_vaddr; + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1391,10 +1391,22 @@ static ssize_t ath11k_debugfs_dump_soc_d + len += scnprintf(buf + len, size - len, "ring%d: %u\n", + i, soc_stats->tx_err.desc_na[i]); + ++ len += scnprintf(buf + len, size - len, "\nTCL Ring idr Failures:\n"); ++ for (i = 0; i < DP_TCL_NUM_RING_MAX; i++) ++ len += scnprintf(buf + len, size - len, "ring%d: %u\n", ++ i, soc_stats->tx_err.idr_na[i]); ++ ++ len += scnprintf(buf + len, size - len, "\nMax Transmit Failures: %d\n", ++ atomic_read(&soc_stats->tx_err.max_fail)); ++ + len += scnprintf(buf + len, size - len, + "\nMisc Transmit Failures: %d\n", + atomic_read(&soc_stats->tx_err.misc_fail)); + ++ len += scnprintf(buf + len, size - len, ++ "\nNSS Transmit Failures: %d\n", ++ atomic_read(&soc_stats->tx_err.nss_tx_fail)); ++ + len += ath11k_debugfs_dump_soc_ring_bp_stats(ab, buf + len, size - len); + + if (len > size) +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -108,6 +108,8 @@ static const struct ath11k_hw_params ath + .cfr_num_stream_bufs = 255, + /* csi_cfr_header + cfr header + max cfr payload */ + .cfr_stream_buf_size = 8500, ++ /* In addition to TCL ring use TCL_CMD ring also for tx */ ++ .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -157,6 +159,8 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = false, + .fwmem_mode_change = false, + .is_qdss_support = false, ++ /* In addition to TCL ring use TCL_CMD ring also for tx */ ++ .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + }, + { + .name = "qca6390 hw2.0", +@@ -201,6 +205,7 @@ static const struct ath11k_hw_params ath + .ce_fwlog_enable = false, + .fwmem_mode_change = false, + .is_qdss_support = false, ++ .max_tx_ring = 1, + }, + { + .name = "qcn9074 hw1.0", +@@ -256,6 +261,8 @@ static const struct ath11k_hw_params ath + .cfr_stream_buf_size = sizeof(struct ath11k_csi_cfr_header) + + (CFR_HDR_MAX_LEN_WORDS_QCN9074 *4) + + CFR_DATA_MAX_LEN_QCN9074, ++ /* In addition to TCL ring use TCL_CMD ring also for tx */ ++ .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -305,6 +312,7 @@ static const struct ath11k_hw_params ath + .fwmem_mode_change = false, + .cold_boot_calib = true, + .is_qdss_support = false, ++ .max_tx_ring = DP_TCL_NUM_RING_MAX, + }, + { + .hw_rev = ATH11K_HW_QCN6122, +@@ -355,6 +363,7 @@ static const struct ath11k_hw_params ath + .cold_boot_calib = false, + .fwmem_mode_change = false, + .is_qdss_support = true, ++ .max_tx_ring = DP_TCL_NUM_RING_MAX, + }, + }; + +@@ -1391,6 +1400,9 @@ int ath11k_core_pre_init(struct ath11k_b + + ab->enable_memory_stats = ATH11K_DEBUG_ENABLE_MEMORY_STATS; + ++ if (ab->nss.enabled && ab->hw_params.max_tx_ring > DP_TCL_NUM_RING_MAX) ++ ab->hw_params.max_tx_ring = DP_TCL_NUM_RING_MAX; ++ + return 0; + } + EXPORT_SYMBOL(ath11k_core_pre_init); +--- a/drivers/net/wireless/ath/ath11k/hal_tx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.h +@@ -17,7 +17,7 @@ + + struct hal_tx_info { + u16 meta_data_flags; /* %HAL_TCL_DATA_CMD_INFO0_META_ */ +- u8 ring_id; ++ u8 buf_id; + u32 desc_id; + enum hal_tcl_desc_type type; + enum hal_tcl_encap_type encap_type; +@@ -68,5 +68,5 @@ int ath11k_hal_reo_cmd_send(struct ath11 + enum hal_reo_cmd_type type, + struct ath11k_hal_reo_cmd *cmd); + void ath11k_hal_tx_init_data_ring(struct ath11k_base *ab, +- struct hal_srng *srng); ++ struct hal_srng *srng, enum hal_ring_type type); + #endif +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -211,6 +211,7 @@ struct ath11k_hw_params { + u32 cfr_dma_hdr_size; + u32 cfr_num_stream_bufs; + u32 cfr_stream_buf_size; ++ u8 max_tx_ring; + }; + + struct ath11k_hw_ops { diff --git a/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-Fix-ce-interrupt-count.patch b/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-Fix-ce-interrupt-count.patch new file mode 100644 index 000000000..9e85a4ae3 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-Fix-ce-interrupt-count.patch @@ -0,0 +1,61 @@ +From dff7c06e3ffb82c5af9918b14c0fae32bbcafc0d Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Wed, 10 Feb 2021 15:26:54 +0530 +Subject: [PATCH] ath11k: Fix ce interrupt count + +CE11 config was removed and is causing below KASAN issue. + + BUG: KASAN: global-out-of-bounds in 0xffffffbffdfb035c at addr +ffffffbffde6eeac + Read of size 4 by task kworker/u8:2/132 + Address belongs to variable ath11k_core_qmi_firmware_ready+0x1b0/0x5bc [ath11k] + +Fixes: c5000fe803 ("ath11k: Add ipq6018 support") + +Signed-off-by: Anilkumar Kolli +--- + drivers/net/wireless/ath/ath11k/ahb.c | 12 ++++++------ + drivers/net/wireless/ath/ath11k/pci.c | 14 +++++++------- + 2 files changed, 13 insertions(+), 13 deletions(-) + +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/core.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/core.c +@@ -76,7 +76,7 @@ static const struct ath11k_hw_params ath + .host_ce_config = ath11k_host_ce_config_ipq8074, + .ce_count = 12, + .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, +- .target_ce_count = 11, ++ .target_ce_count = 12, + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074, + .svc_to_ce_map_len = 21, + .single_pdev_only = false, +@@ -131,7 +131,7 @@ static const struct ath11k_hw_params ath + .host_ce_config = ath11k_host_ce_config_ipq8074, + .ce_count = 12, + .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, +- .target_ce_count = 11, ++ .target_ce_count = 12, + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq6018, + .svc_to_ce_map_len = 19, + .single_pdev_only = false, +Index: backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/hw.c +=================================================================== +--- backports-20210222-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/hw.c ++++ backports-20210222-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/hw.c +@@ -1446,6 +1446,14 @@ const struct ce_pipe_config ath11k_targe + }, + + /* CE11 Not used */ ++ { ++ .pipenum = __cpu_to_le32(11), ++ .pipedir = __cpu_to_le32(0), ++ .nentries = __cpu_to_le32(0), ++ .nbytes_max = __cpu_to_le32(0), ++ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), ++ .reserved = __cpu_to_le32(0), ++ }, + }; + + /* Map from service/endpoint to Copy Engine. diff --git a/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-add-new-parameters-for-tx-based-capture.patch b/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-add-new-parameters-for-tx-based-capture.patch new file mode 100644 index 000000000..1519ac74c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/245-ath11k-add-new-parameters-for-tx-based-capture.patch @@ -0,0 +1,340 @@ +From f251063dfeb6d6ab15a8a426b6b9238b406704f0 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Wed, 17 Feb 2021 12:10:24 +0530 +Subject: [PATCH] ath11k: add new parameters for tx based capture + +This change add new parameters as part of cfr metadata +for tx based capture dumps. + +Newly added parameters, + * CFO measurement + * per chain AGC gain + * rx start timestamp + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/cfr.c | 8 +-- + drivers/net/wireless/ath/ath11k/cfr.h | 59 +++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 6 +-- + drivers/net/wireless/ath/ath11k/hw.c | 70 +++++++++++++++------------ + drivers/net/wireless/ath/ath11k/wmi.c | 13 ++++- + drivers/net/wireless/ath/ath11k/wmi.h | 5 +- + 6 files changed, 121 insertions(+), 40 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/cfr.c ++++ b/drivers/net/wireless/ath/ath11k/cfr.c +@@ -276,7 +276,7 @@ static int ath11k_cfr_enh_process_data(s + struct ath11k_cfr_look_up_table *lut; + struct ath11k_csi_cfr_header *header; + struct ath11k_cfir_enh_dma_hdr dma_hdr; +- struct cfr_metadata_version_3 *meta; ++ struct cfr_metadata_version_5 *meta; + void *mu_rx_user_info = NULL, *freeze_tlv = NULL; + u8 *peer_macaddr; + u8 *data; +@@ -343,7 +343,7 @@ static int ath11k_cfr_enh_process_data(s + memcpy(&lut->dma_hdr.enh_hdr, &dma_hdr, sizeof(struct ath11k_cfir_enh_dma_hdr)); + + header = &lut->header; +- meta = &header->u.meta_v3; ++ meta = &header->u.meta_v5; + meta->channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, + dma_hdr.hdr.info1); + meta->num_rx_chain = +@@ -450,9 +450,9 @@ static int ath11k_cfr_process_data(struc + memcpy(&lut->dma_hdr.hdr, &dma_hdr, sizeof(struct ath11k_cfir_dma_hdr)); + + header = &lut->header; +- header->u.meta_v2.channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, ++ header->u.meta_v4.channel_bw = FIELD_GET(CFIR_DMA_HDR_INFO1_UPLOAD_PKT_BW, + dma_hdr.info1); +- header->u.meta_v2.length = length; ++ header->u.meta_v4.length = length; + + status = ath11k_cfr_correlate_and_relay(ar, lut, + ATH11K_CORRELATE_DBR_EVENT); +--- a/drivers/net/wireless/ath/ath11k/cfr.h ++++ b/drivers/net/wireless/ath/ath11k/cfr.h +@@ -35,6 +35,8 @@ enum ath11k_cfr_meta_version { + ATH11K_CFR_META_VERSION_1, + ATH11K_CFR_META_VERSION_2, + ATH11K_CFR_META_VERSION_3, ++ ATH11K_CFR_META_VERSION_4, ++ ATH11K_CFR_META_VERSION_5, + ATH11K_CFR_META_VERSION_MAX = 0xFF, + }; + +@@ -77,6 +79,10 @@ struct ath11k_cfr_peer_tx_param { + u32 counter; + u32 chain_rssi[WMI_MAX_CHAINS]; + u16 chain_phase[WMI_MAX_CHAINS]; ++ u32 cfo_measurement; ++ u8 agc_gain[WMI_MAX_CHAINS]; ++ u32 rx_start_ts; ++ u32 rx_ts_reset; + }; + + struct cfr_metadata_version_1 { +@@ -142,6 +148,55 @@ struct cfr_metadata_version_3 { + u16 chain_phase[HOST_MAX_CHAINS]; + } __packed; + ++struct cfr_metadata_version_4 { ++ u8 peer_addr[ETH_ALEN]; ++ u8 status; ++ u8 capture_bw; ++ u8 channel_bw; ++ u8 phy_mode; ++ u16 prim20_chan; ++ u16 center_freq1; ++ u16 center_freq2; ++ u8 capture_mode; ++ u8 capture_type; ++ u8 sts_count; ++ u8 num_rx_chain; ++ u32 timestamp; ++ u32 length; ++ u32 chain_rssi[HOST_MAX_CHAINS]; ++ u16 chain_phase[HOST_MAX_CHAINS]; ++ u32 cfo_measurement; ++ u8 agc_gain[HOST_MAX_CHAINS]; ++ u32 rx_start_ts; ++} __packed; ++ ++struct cfr_metadata_version_5 { ++ u8 status; ++ u8 capture_bw; ++ u8 channel_bw; ++ u8 phy_mode; ++ u16 prim20_chan; ++ u16 center_freq1; ++ u16 center_freq2; ++ u8 capture_mode; ++ u8 capture_type; ++ u8 sts_count; ++ u8 num_rx_chain; ++ u64 timestamp; ++ u32 length; ++ u8 is_mu_ppdu; ++ u8 num_mu_users; ++ union { ++ u8 su_peer_addr[ETH_ALEN]; ++ u8 mu_peer_addr[MAX_CFR_MU_USERS][ETH_ALEN]; ++ } peer_addr; ++ u32 chain_rssi[HOST_MAX_CHAINS]; ++ u16 chain_phase[HOST_MAX_CHAINS]; ++ u32 cfo_measurement; ++ u8 agc_gain[HOST_MAX_CHAINS]; ++ u32 rx_start_ts; ++} __packed; ++ + struct ath11k_csi_cfr_header { + u32 start_magic_num; + u32 vendorid; +@@ -149,11 +204,13 @@ struct ath11k_csi_cfr_header { + u8 cfr_data_version; + u8 chip_type; + u8 pltform_type; +- u32 Reserved; ++ u32 cfr_metadata_len; + union { + struct cfr_metadata_version_1 meta_v1; + struct cfr_metadata_version_2 meta_v2; + struct cfr_metadata_version_3 meta_v3; ++ struct cfr_metadata_version_4 meta_v4; ++ struct cfr_metadata_version_5 meta_v5; + } u; + } __packed; + +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -1386,14 +1386,7 @@ static ssize_t ath11k_dbg_sta_write_cfr_ + if (cfr_capture_enable > WMI_PEER_CFR_CAPTURE_ENABLE || + cfr_capture_bw > sta->bandwidth || + cfr_capture_method > CFR_CAPURE_METHOD_NULL_FRAME_WITH_PHASE || +- cfr_capture_period > WMI_PEER_CFR_PERIODICITY_MAX) { +- ret = -EINVAL; +- goto out; +- } +- +- /* Target expects cfr period in multiple of 10 */ +- if (cfr_capture_period % 10) { +- ath11k_err(ar->ab, "periodicity should be 10x\n"); ++ cfr_capture_period > WMI_PEER_CFR_PERIODICITY_MAX) { + ret = -EINVAL; + goto out; + } +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -852,60 +852,70 @@ void ath11k_hw_ipq8074_fill_cfr_hdr_info + struct ath11k_csi_cfr_header *header, + struct ath11k_cfr_peer_tx_param *params) + { +- header->cfr_metadata_version = ATH11K_CFR_META_VERSION_2; ++ header->cfr_metadata_version = ATH11K_CFR_META_VERSION_4; + header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; ++ header->cfr_metadata_len =sizeof(struct cfr_metadata_version_4); + /* TODO: can we add this chip_type to hw param table */ + header->chip_type = ATH11K_CFR_RADIO_IPQ8074; +- header->u.meta_v2.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, ++ header->u.meta_v4.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, + params->status); +- header->u.meta_v2.capture_bw = params->bandwidth; +- header->u.meta_v2.phy_mode = params->phy_mode; +- header->u.meta_v2.prim20_chan = params->primary_20mhz_chan; +- header->u.meta_v2.center_freq1 = params->band_center_freq1; +- header->u.meta_v2.center_freq2 = params->band_center_freq2; ++ header->u.meta_v4.capture_bw = params->bandwidth; ++ header->u.meta_v4.phy_mode = params->phy_mode; ++ header->u.meta_v4.prim20_chan = params->primary_20mhz_chan; ++ header->u.meta_v4.center_freq1 = params->band_center_freq1; ++ header->u.meta_v4.center_freq2 = params->band_center_freq2; + + /* Currently CFR data is captured on ACK of a Qos NULL frame. + * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy. + */ +- header->u.meta_v2.capture_mode = params->bandwidth ? ++ header->u.meta_v4.capture_mode = params->bandwidth ? + ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; +- header->u.meta_v2.capture_type = params->capture_method; +- header->u.meta_v2.num_rx_chain = ar->cfg_rx_chainmask; +- header->u.meta_v2.sts_count = params->spatial_streams; +- header->u.meta_v2.timestamp = params->timestamp_us; +- memcpy(header->u.meta_v2.peer_addr, params->peer_mac_addr, ETH_ALEN); +- memcpy(header->u.meta_v2.chain_rssi, params->chain_rssi, ++ header->u.meta_v4.capture_type = params->capture_method; ++ header->u.meta_v4.num_rx_chain = ar->cfg_rx_chainmask; ++ header->u.meta_v4.sts_count = params->spatial_streams; ++ header->u.meta_v4.timestamp = params->timestamp_us; ++ header->u.meta_v4.cfo_measurement = params->cfo_measurement; ++ header->u.meta_v4.rx_start_ts = params->rx_start_ts; ++ memcpy(header->u.meta_v4.peer_addr, params->peer_mac_addr, ETH_ALEN); ++ memcpy(header->u.meta_v4.chain_rssi, params->chain_rssi, + sizeof(params->chain_rssi)); +- memcpy(header->u.meta_v2.chain_phase, params->chain_phase, ++ memcpy(header->u.meta_v4.chain_phase, params->chain_phase, + sizeof(params->chain_phase)); ++ memcpy(header->u.meta_v4.agc_gain, params->agc_gain, ++ sizeof(params->agc_gain)); + } + + void ath11k_hw_qcn9074_fill_cfr_hdr_info(struct ath11k *ar, + struct ath11k_csi_cfr_header *header, + struct ath11k_cfr_peer_tx_param *params) + { +- header->cfr_metadata_version = ATH11K_CFR_META_VERSION_3; ++ header->cfr_metadata_version = ATH11K_CFR_META_VERSION_5; + header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1; + header->chip_type = ATH11K_CFR_RADIO_QCN9074; +- header->u.meta_v3.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, ++ header->cfr_metadata_len = sizeof(struct cfr_metadata_version_5); ++ header->u.meta_v5.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, + params->status); +- header->u.meta_v3.capture_bw = params->bandwidth; +- header->u.meta_v3.phy_mode = params->phy_mode; +- header->u.meta_v3.prim20_chan = params->primary_20mhz_chan; +- header->u.meta_v3.center_freq1 = params->band_center_freq1; +- header->u.meta_v3.center_freq2 = params->band_center_freq2; +- header->u.meta_v3.capture_mode = params->bandwidth ? ++ header->u.meta_v5.capture_bw = params->bandwidth; ++ header->u.meta_v5.phy_mode = params->phy_mode; ++ header->u.meta_v5.prim20_chan = params->primary_20mhz_chan; ++ header->u.meta_v5.center_freq1 = params->band_center_freq1; ++ header->u.meta_v5.center_freq2 = params->band_center_freq2; ++ header->u.meta_v5.capture_mode = params->bandwidth ? + ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK; +- header->u.meta_v3.capture_type = params->capture_method; +- header->u.meta_v3.num_rx_chain = ar->cfg_rx_chainmask; +- header->u.meta_v3.sts_count = params->spatial_streams; +- header->u.meta_v3.timestamp = params->timestamp_us; +- memcpy(header->u.meta_v3.peer_addr.su_peer_addr, ++ header->u.meta_v5.capture_type = params->capture_method; ++ header->u.meta_v5.num_rx_chain = ar->cfg_rx_chainmask; ++ header->u.meta_v5.sts_count = params->spatial_streams; ++ header->u.meta_v5.timestamp = params->timestamp_us; ++ header->u.meta_v5.cfo_measurement = params->cfo_measurement; ++ header->u.meta_v5.rx_start_ts = params->rx_start_ts; ++ memcpy(header->u.meta_v5.peer_addr.su_peer_addr, + params->peer_mac_addr, ETH_ALEN); +- memcpy(header->u.meta_v3.chain_rssi, params->chain_rssi, ++ memcpy(header->u.meta_v5.chain_rssi, params->chain_rssi, + sizeof(params->chain_rssi)); +- memcpy(header->u.meta_v3.chain_phase, params->chain_phase, ++ memcpy(header->u.meta_v5.chain_phase, params->chain_phase, + sizeof(params->chain_phase)); ++ memcpy(header->u.meta_v5.agc_gain, params->agc_gain, ++ sizeof(params->agc_gain)); + } + + const struct ath11k_hw_ops ipq8074_ops = { +@@ -955,6 +965,7 @@ const struct ath11k_hw_ops ipq8074_ops = + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, ++ .fill_cfr_hdr_info = ath11k_hw_ipq8074_fill_cfr_hdr_info, + }; + + const struct ath11k_hw_ops ipq6018_ops = { +@@ -1004,7 +1015,6 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, +- .fill_cfr_hdr_info = ath11k_hw_ipq8074_fill_cfr_hdr_info, + }; + + const struct ath11k_hw_ops qca6390_ops = { +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -9043,6 +9043,15 @@ static void ath11k_wmi_tlv_cfr_cpature_e + tx_params->counter = params->counter; + memcpy(tx_params->chain_rssi, params->chain_rssi, + sizeof(tx_params->chain_rssi)); ++ ++ if (WMI_CFR_CFO_MEASUREMENT_VALID & params->cfo_measurement) ++ tx_params->cfo_measurement = FIELD_GET(WMI_CFR_CFO_MEASUREMENT_RAW_DATA, ++ params->cfo_measurement); ++ else ++ tx_params->cfo_measurement = 0; ++ ++ tx_params->rx_start_ts = params->rx_start_ts; ++ tx_params->rx_ts_reset = params->rx_ts_reset; + } + + static void ath11k_wmi_tlv_cfr_cpature_phase_fixed_param(const void *ptr, +@@ -9054,8 +9063,10 @@ static void ath11k_wmi_tlv_cfr_cpature_p + (struct ath11k_wmi_cfr_peer_tx_event_phase_param *)ptr; + int i; + +- for (i = 0; i < WMI_MAX_CHAINS; i++) ++ for (i = 0; i < WMI_MAX_CHAINS; i++) { + tx_params->chain_phase[i] = params->chain_phase[i]; ++ tx_params->agc_gain[i] = params->agc_gain[i]; ++ } + } + + static int ath11k_wmi_tlv_cfr_capture_evt_parse(struct ath11k_base *ab, +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -3569,7 +3569,7 @@ struct wmi_peer_cfr_capture_cmd_fixed_pa + #define WMI_CFR_CORRELATION_INFO2_BUF_ADDR_HIGH GENMASK(3, 0) + #define WMI_CFR_CORRELATION_INFO2_PPDU_ID GENMASK(31, 16) + +-#define WMI_CFR_CFO_MEASUREMENT_VALID GENMASK(0, 0) ++#define WMI_CFR_CFO_MEASUREMENT_VALID BIT(0) + #define WMI_CFR_CFO_MEASUREMENT_RAW_DATA GENMASK(14, 1) + + struct ath11k_wmi_cfr_peer_tx_event_param { +@@ -3589,10 +3589,13 @@ struct ath11k_wmi_cfr_peer_tx_event_para + u32 counter; + u32 chain_rssi[WMI_MAX_CHAINS]; + u32 cfo_measurement; ++ u32 rx_start_ts; ++ u32 rx_ts_reset; + } __packed; + + struct ath11k_wmi_cfr_peer_tx_event_phase_param { + u32 chain_phase[WMI_MAX_CHAINS]; ++ u8 agc_gain[WMI_MAX_CHAINS]; + } __packed; + + enum ath11k_wmi_cfr_capture_bw { diff --git a/feeds/wifi-ax/mac80211/patches/qca/245-compilation_fix.patch b/feeds/wifi-ax/mac80211/patches/qca/245-compilation_fix.patch new file mode 100644 index 000000000..44e31291d --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/245-compilation_fix.patch @@ -0,0 +1,699 @@ +From 9cdb8bae50aca80b593d0f53be5b8efedfc91324 Mon Sep 17 00:00:00 2001 +From: Tamizh Chelvam +Date: Sun, 7 Mar 2021 22:49:26 +0530 +Subject: [PATCH] backport: Compile fix + +Adding these changes to fix compilation issue due to +package upgrade + +Signed-off-by: Tamizh Chelvam +--- + backport-include/linux/skbuff.h | 8 ----- + drivers/net/wireless/ath/ath11k/ahb.c | 2 +- + drivers/net/wireless/ath/ath11k/dbring.c | 4 --- + drivers/net/wireless/ath/ath11k/debug.h | 4 +-- + drivers/net/wireless/ath/ath11k/dp.c | 3 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 45 +++++++++++++++----------- + drivers/net/wireless/ath/ath11k/dp_rx.h | 3 +- + drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- + drivers/net/wireless/ath/ath11k/hw.h | 2 +- + drivers/net/wireless/ath/ath11k/mac.c | 19 +++++------ + drivers/net/wireless/ath/ath11k/mhi.c | 9 +++--- + drivers/net/wireless/ath/ath11k/pci.c | 2 +- + drivers/net/wireless/ath/ath11k/qmi.c | 3 +- + include/linux/backport-refcount.h | 4 +-- + include/net/fq.h | 10 +++++- + include/net/mac80211.h | 1 + + net/mac80211/cfg.c | 4 +-- + net/mac80211/ieee80211_i.h | 4 ++- + net/mac80211/iface.c | 2 -- + net/mac80211/rx.c | 23 +++++++++----- + net/mac80211/tx.c | 54 ++++++++++++++++++++++---------- + 21 files changed, 120 insertions(+), 88 deletions(-) + +--- a/backport-include/linux/skbuff.h ++++ b/backport-include/linux/skbuff.h +@@ -348,14 +348,6 @@ static inline void *backport___skb_push( + } + #define __skb_push LINUX_BACKPORT(__skb_push) + +-static inline void *__skb_put_zero(struct sk_buff *skb, unsigned int len) +-{ +- void *tmp = __skb_put(skb, len); +- +- memset(tmp, 0, len); +- return tmp; +-} +- + static inline void *backport_skb_put_zero(struct sk_buff *skb, unsigned int len) + { + void *tmp = skb_put(skb, len); +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -867,7 +867,7 @@ static int ath11k_ahb_probe(struct platf + ab->pdev = pdev; + ab->hw_rev = (enum ath11k_hw_rev)of_id->data; + ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; +- ab->enable_cold_boot_cal = enable_cold_boot_cal; ++ ab->enable_cold_boot_cal = ath11k_cold_boot_cal; + ab->userpd_id = userpd_id; + + platform_set_drvdata(pdev, ab); +--- a/drivers/net/wireless/ath/ath11k/dbring.c ++++ b/drivers/net/wireless/ath/ath11k/dbring.c +@@ -95,7 +95,6 @@ int ath11k_dbring_bufs_replenish(struct + + ath11k_hal_rx_buf_addr_info_set(desc, paddr, cookie, 0); + +- ath11k_dbring_add_debug_entry(ar, id, DBR_RING_DEBUG_EVENT_REPLENISH, srng); + ath11k_hal_srng_access_end(ab, srng); + + return 0; +@@ -360,9 +359,6 @@ int ath11k_dbring_buffer_release_event(s + dma_unmap_single(ab->dev, buff->paddr, ring->buf_sz, + DMA_FROM_DEVICE); + +- ath11k_dbring_add_debug_entry(ar, module_id, +- DBR_RING_DEBUG_EVENT_RX, srng); +- + if (ring->handler) { + vaddr_unalign = buff->payload; + handler_data.data = PTR_ALIGN(vaddr_unalign, +--- a/drivers/net/wireless/ath/ath11k/debug.h ++++ b/drivers/net/wireless/ath/ath11k/debug.h +@@ -23,8 +23,8 @@ enum ath11k_debug_mask { + ATH11K_DBG_TESTMODE = 0x00000400, + ATH11k_DBG_HAL = 0x00000800, + ATH11K_DBG_PCI = 0x00001000, +- ATH11K_DBG_DP_TX = 0x00001000, +- ATH11K_DBG_DP_RX = 0x00002000, ++ ATH11K_DBG_DP_TX = 0x00002000, ++ ATH11K_DBG_DP_RX = 0x00004000, + ATH11K_DBG_CFR = 0x00008000, + ATH11K_DBG_CFR_DUMP = 0x00010000, + ATH11K_DBG_ANY = 0xffffffff, +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -892,7 +892,8 @@ int ath11k_dp_service_srng(struct ath11k + struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, id, rx_ring, 0, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, ++ GFP_ATOMIC); + } + } + } +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -362,7 +362,8 @@ static inline u8 ath11k_dp_rx_h_msdu_sta + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, + int req_entries, +- enum hal_rx_buf_return_buf_manager mgr) ++ enum hal_rx_buf_return_buf_manager mgr, ++ gfp_t gfp) + { + struct hal_srng *srng; + u32 *desc; +@@ -529,7 +530,7 @@ static int ath11k_dp_rxdma_ring_buf_setu + + rx_ring->bufs_max = num_entries; + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_KERNEL); + return 0; + } + +@@ -2408,7 +2409,7 @@ static void ath11k_dp_rx_h_undecap_snap( + */ + + rx_desc = (void *)msdu->data - sizeof(*rx_desc); +- l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); ++ l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); + + skb_put(msdu, l3_pad_bytes); + skb_pull(msdu, sizeof(struct ath11k_dp_amsdu_subframe_hdr) + l3_pad_bytes); +@@ -2563,11 +2564,11 @@ static void ath11k_dp_rx_h_mpdu(struct a + + /* PN for multicast packets will be checked in mac80211 */ + rxcb = ATH11K_SKB_RXCB(msdu); +- rxcb->is_mcbc = fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(rx_desc); ++ rxcb->is_mcbc = fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); + + if (rxcb->is_mcbc) { +- rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(rx_desc); +- rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(rx_desc); ++ rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); ++ rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); + } + + spin_lock_bh(&ar->ab->base_lock); +@@ -2597,7 +2598,7 @@ static void ath11k_dp_rx_h_mpdu(struct a + else + enctype = peer->sec_type; + } else { +- enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); ++ enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); + } + spin_unlock_bh(&ar->ab->base_lock); + +@@ -2636,7 +2637,7 @@ static void ath11k_dp_rx_h_mpdu(struct a + if (!is_decrypted || fill_crypto_hdr) + return; + +- if (ath11k_dp_rx_h_msdu_start_decap_type(rx_desc) != ++ if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != + DP_RX_DECAP_TYPE_ETHERNET2_DIX) { + hdr = (void *)msdu->data; + hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); +@@ -2789,7 +2790,7 @@ static void ath11k_dp_rx_deliver_msdu(st + } + + if (!(status->flag & RX_FLAG_ONLY_MONITOR)) +- decap = ath11k_dp_rx_h_msdu_start_decap_type(rxcb->rx_desc); ++ decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); + spin_lock_bh(&ar->ab->base_lock); + peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); + if (peer && peer->sta) +@@ -2797,7 +2798,7 @@ static void ath11k_dp_rx_deliver_msdu(st + spin_unlock_bh(&ar->ab->base_lock); + + ath11k_dbg(ar->ab, ATH11K_DBG_DATA, +- "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", ++ "rx skb %pK len %u peer %pM %hhu %s sn %u %s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", + msdu, + msdu->len, + peer ? peer->addr : NULL, +@@ -3136,7 +3137,7 @@ try_again: + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + } + + exit: +@@ -4538,7 +4539,7 @@ exit: + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i], +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + } + + return tot_n_bufs_reaped; +@@ -4851,7 +4852,7 @@ int ath11k_dp_rx_process_wbm_err(struct + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + } + + rcu_read_lock(); +@@ -4960,7 +4961,7 @@ int ath11k_dp_process_rxdma_err(struct a + + if (num_buf_freed) + ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + + return budget - quota; + } +@@ -5634,7 +5635,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11 + + while (msdu) { + +- ath11k_dp_rx_msdus_set_payload(msdu); ++ ath11k_dp_rx_msdus_set_payload(ar, msdu); + if (qos_pkt) { + dest = skb_push(msdu, sizeof(__le16)); + if (!dest) +@@ -5905,12 +5906,12 @@ void ath11k_dp_rx_mon_dest_process(struc + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, + &dp->rxdma_mon_buf_ring, + rx_bufs_used, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + else + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, + &dp->rx_refill_buf_ring, + rx_bufs_used, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, GFP_ATOMIC); + } + } + +@@ -6097,6 +6098,7 @@ ath11k_dp_rx_full_mon_mpdu_pop(struct at + void *rx_msdu_link_desc; + void *p_buf_addr_info, *p_last_buf_addr_info; + int buf_id, i = 0; ++ dma_addr_t paddr; + u32 rx_buf_size, rx_pkt_offset, l2_hdr_offset; + u32 rx_bufs_used = 0; + u32 msdu_cnt = 0; +@@ -6105,7 +6107,12 @@ ath11k_dp_rx_full_mon_mpdu_pop(struct at + u8 rxdma_err; + bool is_frag, is_first_msdu; + bool drop_mpdu = false; ++ u8 rbm; + ++ ath11k_hal_rx_reo_ent_buf_paddr_get(ring_entry, &paddr, ++ &sw_cookie, ++ &p_last_buf_addr_info, &rbm, ++ &msdu_cnt); + rx_mon_stats = &pmon->rx_mon_stats; + + ath11k_hal_rx_sw_mon_ring_buf_paddr_get(ring_entry, sw_mon_entries); +@@ -6217,7 +6224,7 @@ next_msdu: + ath11k_dp_rx_mon_next_link_desc_get(rx_msdu_link_desc, + &sw_mon_entries->mon_dst_paddr, + &sw_mon_entries->mon_dst_sw_cookie, +- &p_buf_addr_info); ++ &rbm, &p_buf_addr_info); + + if (ath11k_dp_rx_monitor_link_desc_return(ar, + p_last_buf_addr_info, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -93,7 +93,8 @@ int ath11k_dp_process_rx(struct ath11k_b + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, + int req_entries, +- enum hal_rx_buf_return_buf_manager mgr); ++ enum hal_rx_buf_return_buf_manager mgr, ++ gfp_t gfp); + int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, + int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, + const void *ptr, void *data), +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -254,7 +254,7 @@ tcl_ring_sel: + + /* Add metadata for sw encrypted vlan group traffic */ + if (!test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) && +- !(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) && ++ !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + !info->control.hw_key && + ieee80211_has_protected(hdr->frame_control)) { + /* HW requirement is that metadata should always point to a +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -203,7 +203,7 @@ struct ath11k_hw_params { + u32 hal_desc_sz; + u32 m3_addr; + u8 reo_dest_ring_map_shift; +- bool cold_boot_calib; ++ bool needs_band_to_mac; + bool ce_fwlog_enable; + bool fwmem_mode_change; + bool is_qdss_support; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -840,8 +840,6 @@ static int ath11k_mac_monitor_vdev_start + } + + +- int ret = 0; +- + ret = ath11k_wmi_vdev_up(ar, ¶ms); + if (ret) { + ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", +@@ -1052,6 +1050,7 @@ static int ath11k_mac_op_config(struct i + { + struct ath11k *ar = hw->priv; + struct ieee80211_conf *conf = &hw->conf; ++ int ret = 0; + + mutex_lock(&ar->conf_mutex); + +@@ -2867,7 +2866,7 @@ static int ath11k_mac_config_obss_pd(str + + /* Set and enable SRG/non-SRG OBSS PD Threshold */ + param_id = WMI_PDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD; +- if (test_bit(ATH11K_FLAG_MONITOR_ENABLED, &ar->monitor_flags)) { ++ if (ar->monitor_started) { + ret = ath11k_wmi_pdev_set_param(ar, param_id, 0, pdev_id); + if (ret) + ath11k_warn(ar->ab, +@@ -3337,7 +3336,6 @@ static void ath11k_mac_op_bss_info_chang + if (changed & BSS_CHANGED_FILS_DISCOVERY || + changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP) + ath11k_mac_fils_discovery(arvif, info); +- + mutex_unlock(&ar->conf_mutex); + } + +@@ -6242,7 +6240,7 @@ ath11k_mac_setup_vdev_create_params(stru + return 0; + } + +-static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, ++static int ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) + { + struct ath11k *ar = hw->priv; +@@ -6257,7 +6255,7 @@ static void ath11k_mac_op_update_vif_off + ret = ath11k_nss_vdev_create(arvif); + if(ret) { + ath11k_warn(ab, "failed to create nss vdev %d\n", ret); +- goto err_vdev_del; ++ return ret; + } + + param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; +@@ -6297,6 +6295,7 @@ static void ath11k_mac_op_update_vif_off + arvif->vdev_id, ret); + vif->offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED; + } ++ return ret; + } + + static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, +@@ -6342,7 +6341,7 @@ static int ath11k_mac_op_add_interface(s + if ((vif->type == NL80211_IFTYPE_AP_VLAN || + vif->type == NL80211_IFTYPE_STATION) && ab->nss.enabled) { + if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET && +- ieee80211_set_hw_80211_encap(vif, true)) { ++ (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)) { + vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR; + arvif->nss.encap = ATH11K_HW_TXRX_ETHERNET; + arvif->nss.decap = ATH11K_HW_TXRX_ETHERNET; +@@ -7325,7 +7324,7 @@ ath11k_mac_op_assign_vif_chanctx(struct + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { + ret = ath11k_mac_monitor_start(ar); + if (ret) +- goto err; ++ goto out; + + arvif->is_started = true; + goto exit; +@@ -8469,6 +8468,8 @@ static void ath11k_mac_update_ch_list(st + band->channels[i].center_freq > freq_high) + band->channels[i].flags |= IEEE80211_CHAN_DISABLED; + } ++ ++ return; + } + + #define ATH11k_5_DOT_9_MIN_FREQ 5845 +@@ -8644,7 +8645,7 @@ static int ath11k_mac_setup_iface_combin + combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | + BIT(NL80211_CHAN_WIDTH_20) | + BIT(NL80211_CHAN_WIDTH_40) | +- ddBIT(NL80211_CHAN_WIDTH_80) | ++ BIT(NL80211_CHAN_WIDTH_80) | + BIT(NL80211_CHAN_WIDTH_80P80) | + BIT(NL80211_CHAN_WIDTH_160); + +--- a/drivers/net/wireless/ath/ath11k/mhi.c ++++ b/drivers/net/wireless/ath/ath11k/mhi.c +@@ -357,14 +357,13 @@ int ath11k_mhi_register(struct ath11k_pc + struct ath11k_base *ab = ab_pci->ab; + struct mhi_controller *mhi_ctrl; + struct mhi_controller_config *ath11k_mhi_config; +- struct mhi_controller_config *ath11k_mhi_config; + struct device_node *np; + int ret, len, sw, aw; + unsigned int *reg, *reg_end; + unsigned long start, size; + bool no_dt_entry = 0; + +- mhi_ctrl = mhi_alloc_controller(); ++ mhi_ctrl = kzalloc(sizeof(*mhi_ctrl), GFP_KERNEL); + if (!mhi_ctrl) + return -ENOMEM; + +@@ -381,7 +380,7 @@ int ath11k_mhi_register(struct ath11k_pc + ret = ath11k_mhi_get_msi(ab_pci); + if (ret) { + ath11k_err(ab, "failed to get msi for mhi\n"); +- mhi_free_controller(mhi_ctrl); ++ kfree(mhi_ctrl); + return ret; + } + +@@ -437,7 +436,7 @@ no_dt_entry: + ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config); + if (ret) { + ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret); +- mhi_free_controller(mhi_ctrl); ++ kfree(mhi_ctrl); + return ret; + } + +@@ -602,7 +601,7 @@ static int ath11k_mhi_set_state(struct a + ret = mhi_pm_suspend(ab_pci->mhi_ctrl); + break; + case ATH11K_MHI_RESUME: +- ret = mhi_pm_resume(ab_pci->mhi_ctrl); ++ //ret = mhi_pm_resume(ab_pci->mhi_ctrl); + break; + case ATH11K_MHI_TRIGGER_RDDM: + ret = mhi_force_rddm_mode(ab_pci->mhi_ctrl); +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -1120,7 +1120,6 @@ static int ath11k_pci_power_up(struct at + { + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + int ret; +- u32 addr; + + ab_pci->register_window = 0; + clear_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags); +@@ -1328,6 +1327,7 @@ static int ath11k_pci_probe(struct pci_d + struct ath11k_base *ab; + struct ath11k_pci *ab_pci; + u32 soc_hw_version, soc_hw_version_major, soc_hw_version_minor; ++ u32 addr; + int ret; + + ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI, +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2646,7 +2646,7 @@ static int ath11k_qmi_respond_fw_mem_req + req->mem_seg[i].type = ab->qmi.target_mem[i].type; + ath11k_dbg(ab, ATH11K_DBG_QMI, + "qmi req mem_seg[%d] 0x%llx %u %u\n", i, +- ab->qmi.target_mem[i].paddr, ++ (u64)ab->qmi.target_mem[i].paddr, + ab->qmi.target_mem[i].size, + ab->qmi.target_mem[i].type); + } +@@ -2827,11 +2827,6 @@ static int ath11k_qmi_assign_target_mem_ + idx++; + break; + case CALDB_MEM_REGION_TYPE: +- if (ab->qmi.target_mem[i].size > ATH11K_QMI_CALDB_SIZE) { +- ath11k_warn(ab, "qmi mem size is low to load caldata\n"); +- return -EINVAL; +- } +- + if (ath11k_host_ddr_addr) { + addr = ath11k_host_ddr_addr + + ATH11K_HOST_DDR_CALDB_OFFSET; +@@ -3171,7 +3166,6 @@ static int ath11k_qmi_load_bdf_qmi(struc + char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE]; + const struct firmware *fw_entry; + struct ath11k_board_data bd; +- int bdf_type; + u32 fw_size, file_type; + u8 *tmp; + int ret = 0; +--- a/include/linux/backport-refcount.h ++++ b/include/linux/backport-refcount.h +@@ -217,7 +217,7 @@ static inline __must_check bool refcount + + static inline void __refcount_inc(refcount_t *r, int *oldp) + { +- __refcount_add(1, r, oldp); ++ refcount_add(1, r); + } + + /** +@@ -244,7 +244,7 @@ static inline __must_check bool refcount + + static inline __must_check bool __refcount_dec_and_test(refcount_t *r, int *oldp) + { +- return atomic_sub_and_test(i, &r->refs); ++ return refcount_sub_and_test(1, r); + } + + /** +--- a/include/net/fq.h ++++ b/include/net/fq.h +@@ -68,7 +68,15 @@ struct fq { + struct list_head tin_backlog; + spinlock_t lock; + u32 flows_cnt; +- siphash_key_t perturbation; ++#if LINUX_VERSION_IS_GEQ(5,3,10) || \ ++ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \ ++ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \ ++ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \ ++ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0) ++ siphash_key_t perturbation; ++#else ++ u32 perturbation; ++#endif + u32 limit; + u32 memory_limit; + u32 memory_usage; +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -218,6 +218,7 @@ enum ieee80211_rx_flags { + }; + + struct ieee80211_rx_data { ++ struct napi_struct *napi; + #if LINUX_VERSION_IS_GEQ(4,19,0) + struct list_head *list; + #else +@@ -298,6 +299,7 @@ struct unsol_bcast_probe_resp_data { + u8 data[]; + }; + ++ + struct ps_data { + /* yes, this looks ugly, but guarantees that we can later use + * bitmap_empty :) +@@ -2170,7 +2172,7 @@ void ieee80211_txq_remove_vlan(struct ie + struct ieee80211_sub_if_data *sdata); + void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats, + struct txq_info *txqi); +-void ieee80211_wake_txqs(struct tasklet_struct *t); ++void ieee80211_wake_txqs(unsigned long data); + void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, + u16 transaction, u16 auth_alg, u16 status, + const u8 *extra, size_t extra_len, const u8 *bssid, +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1491,7 +1491,6 @@ static void ieee80211_iface_work(struct + while ((skb = skb_dequeue(&sdata->skb_queue))) { + struct ieee80211_mgmt *mgmt = (void *)skb->data; + +- kcov_remote_start_common(skb_get_kcov_handle(skb)); + if (ieee80211_is_action(mgmt->frame_control) && + mgmt->u.action.category == WLAN_CATEGORY_BACK) { + int len = skb->len; +@@ -1601,7 +1600,6 @@ static void ieee80211_iface_work(struct + } + + kfree_skb(skb); +- kcov_remote_stop(); + } + + /* then other type-dependent work */ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -38,7 +38,7 @@ + + static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata, + struct net_device *dev, struct sta_info *sta, +- struct sk_buff *skb); ++ struct ieee80211_key *key, struct sk_buff *skb); + /* misc utils */ + + static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, +@@ -3931,6 +3931,7 @@ void __ieee80211_subif_start_xmit(struct + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = sdata->local; ++ struct ieee80211_key *key = NULL; + struct sta_info *sta; + struct sk_buff *next; + struct ieee80211_sub_if_data *ap_sdata; +@@ -4277,19 +4278,20 @@ static void ieee80211_8023_xmit(struct i + memset(info, 0, sizeof(*info)); + + tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; +- tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); +- if (tid_tx) { +- if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) { +- /* fall back to non-offload slow path */ +- __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL); +- return; +- } ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { ++ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); ++ if (tid_tx) { ++ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) { ++ /* fall back to non-offload slow path */ ++ __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL); ++ return; ++ } + +- info->flags |= IEEE80211_TX_CTL_AMPDU; +- if (tid_tx->timeout) +- tid_tx->last_tx = jiffies; ++ info->flags |= IEEE80211_TX_CTL_AMPDU; ++ if (tid_tx->timeout) ++ tid_tx->last_tx = jiffies; ++ } + } +- + if (unlikely(skb->sk && + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS && + !ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD))) +@@ -4331,8 +4333,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + struct net_device *dev) + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +- struct ethhdr *ehdr = (struct ethhdr *)skb->data; +- struct ieee80211_key *key; ++ struct ieee80211_key *key = NULL; + struct sta_info *sta; + + ieee80211_xmit_nss_fixup(skb, dev); +@@ -4348,9 +4349,11 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + goto out; + } + +- if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded || +- !test_sta_flag(sta, WLAN_STA_AUTHORIZED) || +- sdata->control_port_protocol == ehdr->h_proto)) ++ if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_NSS_OFFLOAD)) { ++ if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded)) ++ sta = NULL; ++ goto tx_offload; ++ } else if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded)) + goto skip_offload; + + key = rcu_dereference(sta->ptk[sta->ptk_idx]); +@@ -4360,6 +4363,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + if (key && (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))) + goto skip_offload; + ++tx_offload: + ieee80211_8023_xmit(sdata, dev, sta, key, skb); + goto out; + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -4817,7 +4817,7 @@ void ieee80211_rx_list(struct ieee80211_ + + if (pubsta) { + sta = container_of(pubsta, struct sta_info, sta); +- if (sta && napi) { ++ if (sta) { + if (!(status->flag & RX_FLAG_ONLY_MONITOR)) + atomic_inc(&sta->rx_drv_pkts); + } +@@ -4909,8 +4909,6 @@ void ieee80211_rx_list(struct ieee80211_ + + status->rx_flags = 0; + +- kcov_remote_start_common(skb_get_kcov_handle(skb)); +- + /* + * Frames with failed FCS/PLCP checksum are not returned, + * all other frames are returned without radiotap header +@@ -4930,7 +4928,6 @@ void ieee80211_rx_list(struct ieee80211_ + __ieee80211_rx_handle_packet(hw, pubsta, skb, list); + } + +- kcov_remote_stop(); + return; + drop: + kfree_skb(skb); diff --git a/feeds/wifi-ax/mac80211/patches/qca/245-revert-dev-sw-netstats-txrx-add.patch b/feeds/wifi-ax/mac80211/patches/qca/245-revert-dev-sw-netstats-txrx-add.patch new file mode 100644 index 000000000..0dc4bd403 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/245-revert-dev-sw-netstats-txrx-add.patch @@ -0,0 +1,124 @@ +From 3be7ae2d65b6638c4165d66c1c4b5d82d95517d9 Mon Sep 17 00:00:00 2001 +From: Tamizh Chelvam +Date: Wed, 10 Mar 2021 12:21:49 +0530 +Subject: [PATCH] Revert "net: mac80211: use core API for updating TX/RX stats" + +This reverts 36ec144f041bedc2f14b32faa2da11d4d9660003 commit +in QSDK since 4.4 backports does not support netstats APIs +for tx/rx stats and retaining the original logic for calculating +tx/rx stats. + +Signed-off-by: Tamizh Chelvam +--- + net/mac80211/rx.c | 18 ++++++++++++++---- + net/mac80211/tx.c | 16 +++++++++++++--- + 2 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c +index ee42e3c..6463a54 100644 +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -32,6 +32,16 @@ + #include "wme.h" + #include "rate.h" + ++static inline void ieee80211_rx_stats(struct net_device *dev, u32 len) ++{ ++ struct pcpu_sw_netstats *tstats = this_cpu_ptr(netdev_tstats(dev)); ++ ++ u64_stats_update_begin(&tstats->syncp); ++ tstats->rx_packets++; ++ tstats->rx_bytes += len; ++ u64_stats_update_end(&tstats->syncp); ++} ++ + /* + * monitor mode reception + * +@@ -832,7 +842,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb, + + if (skb) { + skb->dev = sdata->dev; +- dev_sw_netstats_rx_add(skb->dev, skb->len); ++ ieee80211_rx_stats(skb->dev, skb->len); + netif_receive_skb(skb); + } + } +@@ -2614,7 +2624,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) + skb = rx->skb; + xmit_skb = NULL; + +- dev_sw_netstats_rx_add(dev, skb->len); ++ ieee80211_rx_stats(dev, skb->len); + + if (rx->sta) { + /* The seqno index has the same property as needed +@@ -3776,7 +3786,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, + } + + prev_dev = sdata->dev; +- dev_sw_netstats_rx_add(sdata->dev, skb->len); ++ ieee80211_rx_stats(sdata->dev, skb->len); + } + + if (prev_dev) { +@@ -4404,7 +4414,7 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, + + skb->dev = fast_rx->dev; + +- dev_sw_netstats_rx_add(fast_rx->dev, skb->len); ++ ieee80211_rx_stats(fast_rx->dev, skb->len); + + /* The seqno index has the same property as needed + * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS +diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c +index 626d1ba..13b09bb 100644 +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -39,6 +39,16 @@ + static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata, + struct net_device *dev, struct sta_info *sta, + struct ieee80211_key *key, struct sk_buff *skb); ++ ++static inline void ieee80211_tx_stats(struct net_device *dev, u32 len) ++{ ++ struct pcpu_sw_netstats *tstats = this_cpu_ptr(netdev_tstats(dev)); ++ ++ u64_stats_update_begin(&tstats->syncp); ++ tstats->tx_packets++; ++ tstats->tx_bytes += len; ++ u64_stats_update_end(&tstats->syncp); ++} + /* misc utils */ + + static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, +@@ -3386,7 +3396,7 @@ static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata, + if (key) + info->control.hw_key = &key->conf; + +- dev_sw_netstats_tx_add(skb->dev, 1, skb->len); ++ ieee80211_tx_stats(skb->dev, skb->len); + + if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { + tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; +@@ -4022,7 +4032,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, + goto out; + } + +- dev_sw_netstats_tx_add(dev, 1, skb->len); ++ ieee80211_tx_stats(dev, skb->len); + + ieee80211_xmit(sdata, sta, skb); + } +@@ -4291,7 +4301,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata, + + info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)]; + +- dev_sw_netstats_tx_add(dev, 1, skb->len); ++ ieee80211_tx_stats(dev, skb->len); + + if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { + sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/246-ath11k-Add-htt-stats-for-phy-reset-case.patch b/feeds/wifi-ax/mac80211/patches/qca/246-ath11k-Add-htt-stats-for-phy-reset-case.patch new file mode 100644 index 000000000..61bf26a66 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/246-ath11k-Add-htt-stats-for-phy-reset-case.patch @@ -0,0 +1,222 @@ +From d293ae8bf203e42cf2fb29ed68664ad7a0465ab4 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 11 Mar 2021 14:50:13 +0530 +Subject: [PATCH] ath11k: Add htt stats for phy reset case + +New htt stats are added in htt stats type 37, to provide +phy reset stats and counters. + +Usage: echo 37 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type + cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c | 116 +++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h | 99 ++++++++++++++++++ + 2 files changed, 214 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c +@@ -4507,9 +4507,13 @@ static inline void htt_print_phy_stats_t + + len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_PHY_STATS_TLV:\n"); + for (i = 0; i < HTT_STATS_MAX_CHAINS; i++) +- len += HTT_DBG_OUT(buf + len, buf_len - len, "nf_chain[%d] = %d\n", ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "bdf_nf_chain[%d] = %d\n", + i, htt_stats_buf->nf_chain[i]); + ++ for (i = 0; i < HTT_STATS_MAX_CHAINS; i++) ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "runtime_nf_chain[%d] = %d\n", ++ i, htt_stats_buf->runtime_nf_chain[i]); ++ + len += HTT_DBG_OUT(buf + len, buf_len - len, "false_radar_cnt = %u\n", + htt_stats_buf->false_radar_cnt); + len += HTT_DBG_OUT(buf + len, buf_len - len, "radar_cs_cnt = %u\n", +@@ -4527,6 +4531,110 @@ static inline void htt_print_phy_stats_t + stats_req->buf_len = len; + } + ++static inline void htt_print_phy_reset_counters_tlv(const void *tag_buf, ++ struct debug_htt_stats_req *stats_req) ++{ ++ const struct htt_phy_reset_counters_tlv *htt_stats_buf = tag_buf; ++ u8 *buf = stats_req->buf; ++ u32 len = stats_req->buf_len; ++ u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; ++ ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_PHY_RESET_COUNTERS_TLV:\n"); ++ ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "pdev_id = %u\n", ++ htt_stats_buf->pdev_id); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "cf_active_low_fail_cnt = %u\n", ++ htt_stats_buf->cf_active_low_fail_cnt); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "cf_active_low_pass_cnt = %u\n", ++ htt_stats_buf->cf_active_low_pass_cnt); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_off_through_vreg_cnt = %u\n", ++ htt_stats_buf->phy_off_through_vreg_cnt); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "force_calibration_cnt = %u\n", ++ htt_stats_buf->force_calibration_cnt); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "rf_mode_switch_phy_off_cnt = %u\n", ++ htt_stats_buf->rf_mode_switch_phy_off_cnt); ++ ++ if (len >= buf_len) ++ buf[buf_len - 1] = 0; ++ else ++ buf[len] = 0; ++ ++ stats_req->buf_len = len; ++} ++ ++static inline void htt_print_phy_reset_stats_tlv(const void *tag_buf, ++ struct debug_htt_stats_req *stats_req) ++{ ++ const struct htt_phy_reset_stats_tlv *htt_stats_buf = tag_buf; ++ u8 *buf = stats_req->buf; ++ u32 len = stats_req->buf_len; ++ u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE; ++ ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "HTT_PHY_RESET_STATS_TLV:\n"); ++ ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "pdev_id = %u\n", ++ htt_stats_buf->pdev_id); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_mhz = %u\n", ++ htt_stats_buf->chan_mhz); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_band_center_freq1 = %u\n", ++ htt_stats_buf->chan_band_center_freq1); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_band_center_freq2 = %u\n", ++ htt_stats_buf->chan_band_center_freq2); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_phy_mode = %u\n", ++ htt_stats_buf->chan_phy_mode); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_flags = 0x%0x\n", ++ htt_stats_buf->chan_flags); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "chan_num = %u\n", ++ htt_stats_buf->chan_num); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "reset_cause = 0x%0x\n", ++ htt_stats_buf->reset_cause); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "prev_reset_cause = 0x%0x\n", ++ htt_stats_buf->prev_reset_cause); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_warm_reset_src = 0x%0x\n", ++ htt_stats_buf->phy_warm_reset_src); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "rx_gain_tbl_mode = %d\n", ++ htt_stats_buf->rx_gain_tbl_mode); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "xbar_val = 0x%0x\n", ++ htt_stats_buf->xbar_val); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "force_calibration = %u\n", ++ htt_stats_buf->force_calibration); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phyrf_mode = %u\n", ++ htt_stats_buf->phyrf_mode); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_homechan = %u\n", ++ htt_stats_buf->phy_homechan); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_tx_ch_mask = 0x%0x\n", ++ htt_stats_buf->phy_tx_ch_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_rx_ch_mask = 0x%0x\n", ++ htt_stats_buf->phy_rx_ch_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phybb_ini_mask = 0x%0x\n", ++ htt_stats_buf->phybb_ini_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phyrf_ini_mask = 0x%0x\n", ++ htt_stats_buf->phyrf_ini_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_dfs_en_mask = 0x%0x\n", ++ htt_stats_buf->phy_dfs_en_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_sscan_en_mask = 0x%0x\n", ++ htt_stats_buf->phy_sscan_en_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_synth_sel_mask = 0x%0x\n", ++ htt_stats_buf->phy_synth_sel_mask); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_adfs_freq = %u\n", ++ htt_stats_buf->phy_adfs_freq); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "cck_fir_settings = 0x%0x\n", ++ htt_stats_buf->cck_fir_settings); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "phy_dyn_pri_chan = %u\n", ++ htt_stats_buf->phy_dyn_pri_chan); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "cca_thresh = 0x%0x\n", ++ htt_stats_buf->cca_thresh); ++ len += HTT_DBG_OUT(buf + len, buf_len - len, "dyn_cca_status = %u\n", ++ htt_stats_buf->dyn_cca_status); ++ ++ if (len >= buf_len) ++ buf[buf_len - 1] = 0; ++ else ++ buf[len] = 0; ++ ++ stats_req->buf_len = len; ++} ++ + static inline void htt_print_peer_ctrl_path_txrx_stats_tlv(const void *tag_buf, + struct debug_htt_stats_req *stats_req) + { +@@ -4970,6 +5078,12 @@ static int ath11k_dbg_htt_ext_stats_pars + case HTT_STATS_PHY_STATS_TAG: + htt_print_phy_stats_tlv(tag_buf, stats_req); + break; ++ case HTT_STATS_PHY_RESET_COUNTERS_TAG: ++ htt_print_phy_reset_counters_tlv(tag_buf, stats_req); ++ break; ++ case HTT_STATS_PHY_RESET_STATS_TAG: ++ htt_print_phy_reset_stats_tlv(tag_buf, stats_req); ++ break; + case HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG: + htt_print_peer_ctrl_path_txrx_stats_tlv(tag_buf, stats_req); + break; +--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h +@@ -122,6 +122,8 @@ enum htt_tlv_tag_t { + HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, + HTT_STATS_PHY_COUNTERS_TAG = 121, + HTT_STATS_PHY_STATS_TAG = 122, ++ HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, ++ HTT_STATS_PHY_RESET_STATS_TAG = 124, + + HTT_STATS_MAX_TAG, + }; +@@ -1982,12 +1984,52 @@ struct htt_phy_counters_tlv { + + struct htt_phy_stats_tlv { + int nf_chain[HTT_STATS_MAX_CHAINS]; ++ int runtime_nf_chain[HTT_STATS_MAX_CHAINS]; + u32 false_radar_cnt; + u32 radar_cs_cnt; + int ani_level; + u32 fw_run_time; + }; + ++struct htt_phy_reset_counters_tlv { ++ u32 pdev_id; ++ u32 cf_active_low_fail_cnt; ++ u32 cf_active_low_pass_cnt; ++ u32 phy_off_through_vreg_cnt; ++ u32 force_calibration_cnt; ++ u32 rf_mode_switch_phy_off_cnt; ++}; ++ ++struct htt_phy_reset_stats_tlv { ++ u32 pdev_id; ++ u32 chan_mhz; ++ u32 chan_band_center_freq1; ++ u32 chan_band_center_freq2; ++ u32 chan_phy_mode; ++ u32 chan_flags; ++ u32 chan_num; ++ u32 reset_cause; ++ u32 prev_reset_cause; ++ u32 phy_warm_reset_src; ++ u32 rx_gain_tbl_mode; ++ u32 xbar_val; ++ u32 force_calibration; ++ u32 phyrf_mode; ++ u32 phy_homechan; ++ u32 phy_tx_ch_mask; ++ u32 phy_rx_ch_mask; ++ u32 phybb_ini_mask; ++ u32 phyrf_ini_mask; ++ u32 phy_dfs_en_mask; ++ u32 phy_sscan_en_mask; ++ u32 phy_synth_sel_mask; ++ u32 phy_adfs_freq; ++ u32 cck_fir_settings; ++ u32 phy_dyn_pri_chan; ++ u32 cca_thresh; ++ u32 dyn_cca_status; ++}; ++ + struct htt_peer_ctrl_path_txrx_stats_tlv { + u8 peer_mac_addr[6]; + u8 rsvd[2]; diff --git a/feeds/wifi-ax/mac80211/patches/qca/300-ath11k-nss-mesh-offload-support.patch b/feeds/wifi-ax/mac80211/patches/qca/300-ath11k-nss-mesh-offload-support.patch new file mode 100644 index 000000000..263175648 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/300-ath11k-nss-mesh-offload-support.patch @@ -0,0 +1,4567 @@ +From fbe5a76d8c9ff1cf3f906a3c863928fc1adcbc95 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Kathirvel +Date: Tue, 16 Feb 2021 13:44:39 +0530 +Subject: [PATCH] ath11k: Add mesh nss offload support + +- New capability advertising nss offload support for mesh type +- Mesh obj vap and link vap registration/clean up +- Command/event handling +- New .ch files in ath11k for nss mesh offload related debugs +- Tx/Rx data path on mesh link vap uses native wifi format +- Mesh obj vap handls packets in ether format. No Tx on Mesh + obj vap is expected as packets transmitted in slow path is + supposed to be encapsulated in 802.11 format. +- New mac80211-driver callbacks for mesh vap, mpath and mpp + configurations. + +Signed-off-by: Vasanthakumar Thiagarajan + +Change-Id: Ib6950344286ba18fab43586262c62dcd09557614 +Co-developed-by: Karthikeyan Kathirvel +Signed-off-by: Karthikeyan Kathirvel +Signed-off-by: Vasanthakumar Thiagarajan +--- + drivers/net/wireless/ath/ath11k/Makefile | 2 +- + drivers/net/wireless/ath/ath11k/debug_nss.c | 343 +++++++ + drivers/net/wireless/ath/ath11k/debug_nss.h | 24 + + drivers/net/wireless/ath/ath11k/dp.h | 16 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 170 ++- + drivers/net/wireless/ath/ath11k/dp_rx.h | 2 + + drivers/net/wireless/ath/ath11k/mac.c | 36 +- + drivers/net/wireless/ath/ath11k/nss.c | 1482 ++++++++++++++++++++++++--- + drivers/net/wireless/ath/ath11k/nss.h | 63 +- + include/net/mac80211.h | 106 ++ + net/mac80211/cfg.c | 19 +- + net/mac80211/debug.h | 10 + + net/mac80211/debugfs.c | 1 + + net/mac80211/driver-ops.c | 20 + + net/mac80211/driver-ops.h | 7 + + net/mac80211/mesh.h | 5 + + net/mac80211/mesh_hwmp.c | 273 +++++ + net/mac80211/mesh_pathtbl.c | 167 ++- + net/mac80211/rx.c | 8 +- + 19 files changed, 2548 insertions(+), 206 deletions(-) + create mode 100644 drivers/net/wireless/ath/ath11k/debug_nss.c + create mode 100644 drivers/net/wireless/ath/ath11k/debug_nss.h + +--- a/drivers/net/wireless/ath/ath11k/Makefile ++++ b/drivers/net/wireless/ath/ath11k/Makefile +@@ -20,7 +20,7 @@ ath11k-y += core.o \ + wow.o \ + vendor.o + +-ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o ++ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o debug_nss.o + ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o + ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o + ath11k-$(CONFIG_THERMAL) += thermal.o +--- /dev/null ++++ b/drivers/net/wireless/ath/ath11k/debug_nss.c +@@ -0,0 +1,924 @@ ++// SPDX-License-Identifier: BSD-3-Clause-Clear ++/* ++ * Copyright (c) 2020 The Linux Foundation. All rights reserved. ++ */ ++ ++#ifdef CPTCFG_ATH11K_NSS_SUPPORT ++ ++#include ++#include "dp_rx.h" ++#include "nss.h" ++#include "debug.h" ++#include "debug_nss.h" ++ ++static unsigned int ++debug_nss_fill_mpp_dump(struct ath11k_vif *arvif, char *buf, ssize_t size) ++{ ++ struct arvif_nss *nss = &arvif->nss; ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_nss_mpp_entry *entry, *tmp; ++ LIST_HEAD(local_entry); ++ unsigned int len = 0; ++ int i; ++ ++ len += scnprintf(buf + len, size - len, "\nProxy path table\n"); ++ len += scnprintf(buf + len, size - len, "dest_mac_addr\t\tmesh_dest_mac\t\tflags\n"); ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpp_dump, &local_entry); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(entry, tmp, &local_entry, list) { ++ for (i = 0; i < entry->num_entries; i++) ++ len += scnprintf(buf + len, size - len, "%pM\t%pM\t0x%x\n", ++ entry->mpp[i].dest_mac_addr, ++ entry->mpp[i].mesh_dest_mac, entry->mpp[i].flags); ++ list_del(&entry->list); ++ kfree(entry); ++ } ++ ++ return len; ++} ++ ++static int ath11k_nss_dump_mpp_open(struct inode *inode, struct file *file) ++{ ++ struct ath11k_vif *arvif = inode->i_private; ++ struct ath11k *ar = arvif->ar; ++ unsigned long time_left; ++ struct ath11k_nss_dbg_priv_data *priv_data; ++ int ret; ++ ssize_t size = 100; ++ char *buf; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ reinit_completion(&arvif->nss.dump_mpp_complete); ++ ++ priv_data = kzalloc(sizeof(*priv_data), GFP_KERNEL); ++ if (!priv_data) { ++ mutex_unlock(&ar->conf_mutex); ++ return -ENOMEM; ++ } ++ ++ priv_data->arvif = arvif; ++ ret = ath11k_nss_dump_mpp_request(arvif); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to send dump mpp command %d\n", ret); ++ goto err_unlock; ++ } ++ ++ time_left = wait_for_completion_timeout(&arvif->nss.dump_mpp_complete, ++ ATH11K_NSS_MPATH_DUMP_TIMEOUT); ++ if (time_left == 0) { ++ ret = -ETIMEDOUT; ++ goto err_unlock; ++ } ++ ++ mutex_unlock(&ar->conf_mutex); ++ ++ size += (arvif->nss.mpp_dump_num_entries * 200 + 10 * 100); ++ buf = kmalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ priv_data->buf = buf; ++ ++ priv_data->len= debug_nss_fill_mpp_dump(arvif, buf, size); ++ ++ file->private_data = priv_data; ++ ++ return 0; ++ ++err_unlock: ++ kfree(priv_data); ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static int ath11k_nss_dump_mpp_release(struct inode *inode, struct file *file) ++{ ++ struct ath11k_nss_dbg_priv_data *priv_data = file->private_data; ++ ++ kfree(priv_data->buf); ++ kfree(priv_data); ++ return 0; ++} ++ ++static ssize_t ath11k_nss_dump_mpp_read(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_nss_dbg_priv_data *priv_data = file->private_data; ++ struct ath11k_vif *arvif = priv_data->arvif; ++ char *buf = priv_data->buf; ++ struct ath11k *ar = arvif->ar; ++ int ret; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, buf, priv_data->len); ++ ++ mutex_unlock(&ar->conf_mutex); ++ ++ return ret; ++} ++ ++static const struct file_operations fops_nss_dump_mpp_table = { ++ .open = ath11k_nss_dump_mpp_open, ++ .read = ath11k_nss_dump_mpp_read, ++ .release = ath11k_nss_dump_mpp_release, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static unsigned int ++debug_nss_fill_mpath_dump(struct ath11k_vif *arvif, char *buf, ssize_t size) ++{ ++ struct arvif_nss *nss = &arvif->nss; ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_nss_mpath_entry *entry, *tmp; ++ LIST_HEAD(local_entry); ++ unsigned int len = 0; ++ u64 expiry_time; ++ int i; ++ ++ len += scnprintf(buf + len, size - len, "\nmpath table\n"); ++ len += scnprintf(buf + len, size - len, "dest_mac_addr\t\tnext_hop_mac\t\tmetric\t" ++ "expiry_time\thop_count\tflags\tlink_vap_id\n"); ++ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpath_dump, &local_entry); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(entry, tmp, &local_entry, list) { ++ for (i = 0; i < entry->num_entries; i++) { ++ memcpy(&expiry_time, entry->mpath[i].expiry_time, sizeof(u64)); ++ len += scnprintf(buf + len, size - len, "%pM\t%pM\t%u\t%llu\t\t\t%d\t0x%x\t%d\n", ++ entry->mpath[i].dest_mac_addr, ++ entry->mpath[i].next_hop_mac_addr, entry->mpath[i].metric, ++ expiry_time, entry->mpath[i].hop_count, ++ entry->mpath[i].flags, entry->mpath[i].link_vap_id); ++ } ++ kfree(entry); ++ } ++ ++ return len; ++} ++ ++static int ath11k_nss_dump_mpath_open(struct inode *inode, struct file *file) ++{ ++ struct ath11k_vif *arvif = inode->i_private; ++ struct ath11k *ar = arvif->ar; ++ unsigned long time_left; ++ struct ath11k_nss_dbg_priv_data *priv_data; ++ ssize_t size = 200; ++ char *buf; ++ int ret; ++ ++ reinit_completion(&arvif->nss.dump_mpath_complete); ++ ++ priv_data = kzalloc(sizeof(*priv_data), GFP_KERNEL); ++ if (!priv_data) ++ return -ENOMEM; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ priv_data->arvif = arvif; ++ ret = ath11k_nss_dump_mpath_request(arvif); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to send dump mpath command %d\n", ret); ++ goto err_unlock; ++ } ++ ++ time_left = wait_for_completion_timeout(&arvif->nss.dump_mpath_complete, ++ ATH11K_NSS_MPATH_DUMP_TIMEOUT); ++ if (time_left == 0) { ++ ret = -ETIMEDOUT; ++ goto err_unlock; ++ } ++ ++ mutex_unlock(&ar->conf_mutex); ++ ++ size += (arvif->nss.mpath_dump_num_entries * 200 + 10 * 100); ++ buf = kmalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ priv_data->buf = buf; ++ ++ priv_data->len = debug_nss_fill_mpath_dump(arvif, buf, size); ++ ++ file->private_data = priv_data; ++ ++ return 0; ++ ++err_unlock: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static int ath11k_nss_dump_mpath_release(struct inode *inode, struct file *file) ++{ ++ struct ath11k_nss_dbg_priv_data *priv_data = file->private_data; ++ ++ kfree(priv_data->buf); ++ kfree(priv_data); ++ return 0; ++ ++} ++ ++static ssize_t ath11k_nss_dump_mpath_read(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_nss_dbg_priv_data *priv_data = file->private_data; ++ struct ath11k_vif *arvif = priv_data->arvif; ++ char *buf = priv_data->buf; ++ struct ath11k *ar = arvif->ar; ++ int ret; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, buf, priv_data->len); ++ ++ mutex_unlock(&ar->conf_mutex); ++ ++ return ret; ++} ++ ++static const struct file_operations fops_nss_dump_mpath_table = { ++ .open = ath11k_nss_dump_mpath_open, ++ .read = ath11k_nss_dump_mpath_read, ++ .release = ath11k_nss_dump_mpath_release, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_mpath_add(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%u %hhu %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %hhu %hhu", ++ &path.metric, ++ &path.hop_count, ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5], ++ &path.next_hop[0], ++ &path.next_hop[1], ++ &path.next_hop[2], ++ &path.next_hop[3], ++ &path.next_hop[4], ++ &path.next_hop[5], ++ &path.block_mesh_fwd, ++ &path.metadata_type); ++ ++ ++ path.flags |= IEEE80211_MESH_PATH_ACTIVE | IEEE80211_MESH_PATH_RESOLVED; ++ ++ if (ret != 16) ++ return -EINVAL; ++ ++ /* Configure the mpath */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPATH, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpath ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpath_add = { ++ .open = simple_open, ++ .write = ath11k_nss_mpath_add, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_mpp_add(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ if (!arvif->ar->ab->nss.debug_mode) { ++ ret = -EPERM; ++ return ret; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", ++ &path.da[0], ++ &path.da[1], ++ &path.da[2], ++ &path.da[3], ++ &path.da[4], ++ &path.da[5], ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5]); ++ ++ path.flags |= IEEE80211_MESH_PATH_ACTIVE | IEEE80211_MESH_PATH_RESOLVED; ++ ++ if (ret != 12) ++ return -EINVAL; ++ ++ /* Configure the mpp */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPP, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpp ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpp_add = { ++ .open = simple_open, ++ .write = ath11k_nss_mpp_add, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_mpath_update(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%u %hhu %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %hhu %lu %hhu %hhu", ++ &path.metric, ++ &path.hop_count, ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5], ++ &path.next_hop[0], ++ &path.next_hop[1], ++ &path.next_hop[2], ++ &path.next_hop[3], ++ &path.next_hop[4], ++ &path.next_hop[5], ++ &path.old_next_hop[0], ++ &path.old_next_hop[1], ++ &path.old_next_hop[2], ++ &path.old_next_hop[3], ++ &path.old_next_hop[4], ++ &path.old_next_hop[5], ++ &path.mesh_gate, ++ &path.exp_time, ++ &path.block_mesh_fwd, ++ &path.metadata_type); ++ ++ ++ path.flags |= IEEE80211_MESH_PATH_ACTIVE | IEEE80211_MESH_PATH_RESOLVED; ++ ++ if (ret != 24) ++ return -EINVAL; ++ ++ /* Configure the mpath */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPATH, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpath ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpath_update = { ++ .open = simple_open, ++ .write = ath11k_nss_mpath_update, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_mpp_update(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ if (!arvif->ar->ab->nss.debug_mode) { ++ ret = -EPERM; ++ return ret; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", ++ &path.da[0], ++ &path.da[1], ++ &path.da[2], ++ &path.da[3], ++ &path.da[4], ++ &path.da[5], ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5]); ++ ++ path.flags |= IEEE80211_MESH_PATH_ACTIVE | IEEE80211_MESH_PATH_RESOLVED; ++ ++ if (ret != 12) ++ return -EINVAL; ++ ++ /* Configure the mpp */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPP, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpp ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpp_update = { ++ .open = simple_open, ++ .write = ath11k_nss_mpp_update, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++ ++static ssize_t ath11k_nss_mpath_delete(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ if (!arvif->ar->ab->nss.debug_mode) { ++ ret = -EPERM; ++ return ret; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5], ++ &path.next_hop[0], ++ &path.next_hop[1], ++ &path.next_hop[2], ++ &path.next_hop[3], ++ &path.next_hop[4], ++ &path.next_hop[5]); ++ ++ path.flags |= IEEE80211_MESH_PATH_DELETED; ++ ++ if (ret != 12) ++ return -EINVAL; ++ ++ /* Configure the mpath */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPATH, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpath ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpath_del = { ++ .open = simple_open, ++ .write = ath11k_nss_mpath_delete, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_mpp_delete(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ieee80211_mesh_path_offld path = {0}; ++ u8 buf[128] = {0}; ++ int ret; ++ ++ if (!arvif->ar->ab->nss.debug_mode) { ++ ret = -EPERM; ++ return ret; ++ } ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", ++ &path.da[0], ++ &path.da[1], ++ &path.da[2], ++ &path.da[3], ++ &path.da[4], ++ &path.da[5], ++ &path.mesh_da[0], ++ &path.mesh_da[1], ++ &path.mesh_da[2], ++ &path.mesh_da[3], ++ &path.mesh_da[4], ++ &path.mesh_da[5]); ++ ++ path.flags |= IEEE80211_MESH_PATH_DELETED; ++ ++ if (ret != 12) ++ return -EINVAL; ++ ++ /* Configure the mpp */ ++ ret = ath11k_nss_mesh_config_path(arvif->ar, arvif, ++ IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPP, ++ &path); ++ if(ret) { ++ ath11k_warn(arvif->ar->ab, "failed to configure mpp ret %d\n", ret); ++ return -EINVAL; ++ } ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_mpp_del = { ++ .open = simple_open, ++ .write = ath11k_nss_mpp_delete, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++ ++static ssize_t ath11k_nss_assoc_link(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ u8 buf[128] = {0}; ++ int ret; ++ u32 assoc_link = 0; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%u", &assoc_link); ++ ++ if (ret != 1) ++ return -EINVAL; ++ ++ arvif->ar->ab->nss.debug_mode = true; ++ arvif->vif->driver_flags |= IEEE80211_VIF_NSS_OFFLOAD_DEBUG_MODE; ++ ++ ret = ath11k_nss_assoc_link_arvif_to_ifnum(arvif, assoc_link); ++ ++ return ret ? ret : count; ++ ++} ++ ++static const struct file_operations fops_nss_assoc_link = { ++ .open = simple_open, ++ .write = ath11k_nss_assoc_link, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_links(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ char buf[512] = {0}; ++ struct arvif_nss *nss; ++ int len = 0; ++ ++ list_for_each_entry(nss, &mesh_vaps, list) ++ len += scnprintf(buf + len, sizeof(buf) - len, "link id %d\n", ++ nss->if_num); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_nss_links = { ++ .open = simple_open, ++ .read = ath11k_nss_links, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_vap_link_id(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct arvif_nss *nss = &arvif->nss; ++ char buf[512] = {0}; ++ int len = 0; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "link id %d\n", ++ nss->if_num); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_nss_vap_link_id = { ++ .open = simple_open, ++ .read = ath11k_nss_vap_link_id, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_read_mpp_mode(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ char buf[512] = {0}; ++ int len = 0; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%s\n",mpp_mode ? ++ "Host Assisted Learning" : "NSS Independent Learning"); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_nss_write_mpp_mode(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ u8 buf[128] = {0}; ++ int ret; ++ u32 mppath_mode = 0; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%u", &mppath_mode); ++ ++ if (ret != 1) ++ return -EINVAL; ++ ++ mpp_mode = mppath_mode; ++ ++ ret = 0; ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_nss_mpp_mode = { ++ .open = simple_open, ++ .write = ath11k_nss_write_mpp_mode, ++ .read = ath11k_nss_read_mpp_mode, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_write_excep_flags(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ u8 buf[128] = {0}; ++ int ret; ++ struct nss_wifi_mesh_exception_flag_msg msg; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %hhu", ++ &msg.dest_mac_addr[0], ++ &msg.dest_mac_addr[1], ++ &msg.dest_mac_addr[2], ++ &msg.dest_mac_addr[3], ++ &msg.dest_mac_addr[4], ++ &msg.dest_mac_addr[5], ++ &msg.exception); ++ ++ if (ret != 7) ++ return -EINVAL; ++ ++ ret = ath11k_nss_mesh_exception_flags(arvif, &msg); ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_nss_excep_flags = { ++ .open = simple_open, ++ .write = ath11k_nss_write_excep_flags, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_write_metadata_type(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ath11k *ar = arvif->ar; ++ u8 buf[128] = {0}; ++ int ret; ++ u8 pkt_type; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ++ ret = sscanf(buf, "%hhu", &pkt_type); ++ mutex_lock(&ar->conf_mutex); ++ arvif->nss.metadata_type = pkt_type ? NSS_WIFI_MESH_PRE_HEADER_80211 : NSS_WIFI_MESH_PRE_HEADER_NONE; ++ mutex_unlock(&ar->conf_mutex); ++ ++ if (ret != 1) ++ return -EINVAL; ++ ++ ret = 0; ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_nss_metadata_type = { ++ .open = simple_open, ++ .write = ath11k_nss_write_metadata_type, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_nss_write_exc_rate_limit(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ u8 buf[128] = {0}; ++ int ret; ++ struct nss_wifi_mesh_rate_limit_config nss_exc_cfg; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (ret < 0) ++ return ret; ++ ++ buf[ret] = '\0'; ++ ++ ret = sscanf(buf, "%u %u %u", ++ &nss_exc_cfg.exception_num, ++ &nss_exc_cfg.enable, ++ &nss_exc_cfg.rate_limit); ++ ++ if (ret != 3) ++ return -EINVAL; ++ ++ ret = ath11k_nss_exc_rate_config(arvif, &nss_exc_cfg); ++ ++ return ret ? ret : count; ++} ++ ++static const struct file_operations fops_nss_exc_rate_limit = { ++ .open = simple_open, ++ .write = ath11k_nss_write_exc_rate_limit, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++void ath11k_debugfs_nss_mesh_vap_create(struct ath11k_vif *arvif) ++{ ++ struct dentry *debugfs_nss_mesh_dir, *debugfs_dbg_infra; ++ ++ debugfs_nss_mesh_dir = debugfs_create_dir("nss_mesh", arvif->vif->debugfs_dir); ++ debugfs_dbg_infra = debugfs_create_dir("dbg_infra", debugfs_nss_mesh_dir); ++ ++ debugfs_create_file("dump_nss_mpath_table", 0600, ++ debugfs_nss_mesh_dir, arvif, ++ &fops_nss_dump_mpath_table); ++ ++ debugfs_create_file("dump_nss_mpp_table", 0600, ++ debugfs_nss_mesh_dir, arvif, ++ &fops_nss_dump_mpp_table); ++ ++ debugfs_create_file("mpath_add", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpath_add); ++ ++ debugfs_create_file("mpath_update", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpath_update); ++ ++ debugfs_create_file("mpath_del", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpath_del); ++ ++ debugfs_create_file("mpp_add", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpp_add); ++ ++ debugfs_create_file("mpp_update", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpp_update); ++ ++ debugfs_create_file("mpp_del", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_mpp_del); ++ ++ debugfs_create_file("assoc_link", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_assoc_link); ++ ++ debugfs_create_file("vap_linkid", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_vap_link_id); ++ ++ debugfs_create_file("excep_flags", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_excep_flags); ++ ++ debugfs_create_file("metadata_type", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_metadata_type); ++ ++ debugfs_create_file("exc_rate_limit", 0200, ++ debugfs_dbg_infra, arvif, ++ &fops_nss_exc_rate_limit); ++} ++ ++void ath11k_debugfs_nss_soc_create(struct ath11k_base *ab) ++{ ++ struct dentry *debugfs_dbg_infra; ++ ++ debugfs_dbg_infra = debugfs_create_dir("dbg_infra", debugfs_ath11k); ++ ++ debugfs_create_file("links", 0200, ++ debugfs_dbg_infra, ab, ++ &fops_nss_links); ++ ++ debugfs_create_file("mpp_mode", 0600, ++ debugfs_dbg_infra, ab, ++ &fops_nss_mpp_mode); ++} ++ ++#endif +--- /dev/null ++++ b/drivers/net/wireless/ath/ath11k/debug_nss.h +@@ -0,0 +1,35 @@ ++/* SPDX-License-Identifier: BSD-3-Clause-Clear */ ++/* ++ * Copyright (c) 2020 The Linux Foundation. All rights reserved. ++ */ ++ ++#ifndef ATH11K_DEBUG_NSS_H ++#define ATH11K_DEBUG_NSS_H ++ ++#include ++#include ++ ++#define ATH11K_NSS_MPATH_DUMP_TIMEOUT (2 * HZ) ++ ++struct ath11k_vif; ++extern enum nss_wifi_mesh_mpp_learning_mode mpp_mode; ++extern struct list_head mesh_vaps; ++struct ath11k_nss_dbg_priv_data { ++ struct ath11k_vif *arvif; ++ char *buf; ++ unsigned int len; ++}; ++ ++#ifdef CPTCFG_MAC80211_DEBUGFS ++void ath11k_debugfs_nss_mesh_vap_create(struct ath11k_vif *arvif); ++void ath11k_debugfs_nss_soc_create(struct ath11k_base *ab); ++#else ++static inline void ath11k_debugfs_nss_mesh_vap_create(struct ath11k_vif *arvif) ++{ ++} ++static inline void ath11k_debugfs_nss_soc_create(struct ath11k_base *ab) ++{ ++} ++#endif ++ ++#endif +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -1575,15 +1575,29 @@ struct htt_ppdu_stats_usr_cmn_array { + struct htt_tx_ppdu_stats_info tx_ppdu_info[0]; + } __packed; + ++#define HTT_PPDU_STATS_CMPLTN_FLUSH_INFO_FLOW_TYPE GENMASK(7, 0) ++#define HTT_PPDU_STATS_CMPLTN_FLUSH_INFO_NUM_MPDU GENMASK(16, 8) ++#define HTT_PPDU_STATS_CMPLTN_FLUSH_INFO_NUM_MSDU GENMASK(30, 17) ++ ++struct htt_ppdu_stats_cmpltn_flush { ++ u32 drop_reason; ++ u32 info; ++ u8 tid_num; ++ u8 queue_type; ++ u16 sw_peer_id; ++} __packed; ++ + struct htt_ppdu_user_stats { + u16 peer_id; + u16 delay_ba; + u32 tlv_flags; + bool is_valid_peer_id; ++ bool rate_stats_updated; + struct htt_ppdu_stats_user_rate rate; + struct htt_ppdu_stats_usr_cmpltn_cmn cmpltn_cmn; + struct htt_ppdu_stats_usr_cmpltn_ack_ba_status ack_ba; + struct htt_ppdu_stats_user_common common; ++ struct htt_ppdu_stats_cmpltn_flush cmpltn_flush; + }; + + #define HTT_PPDU_STATS_MAX_USERS 37 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1405,6 +1405,68 @@ static int ath11k_htt_tlv_ppdu_stats_par + return 0; + } + ++static void ath11k_dp_ppdu_stats_flush_tlv_parse(struct ath11k_base *ab, ++ struct htt_ppdu_stats_cmpltn_flush *msg) ++{ ++ struct ath11k *ar; ++ struct ieee80211_sta *sta; ++ struct ath11k_sta *arsta; ++ struct ath11k_peer *peer = NULL; ++ struct ieee80211_tx_status status; ++ ++ if (!ab->nss.mesh_nss_offload_enabled) ++ return; ++ ++ rcu_read_lock(); ++ ++ spin_lock_bh(&ab->base_lock); ++ peer = ath11k_peer_find_by_id(ab, msg->sw_peer_id); ++ if (!peer) ++ goto exit; ++ ++ if (peer->vif->type != NL80211_IFTYPE_MESH_POINT) ++ goto exit; ++ ++ if (ether_addr_equal(peer->addr, peer->vif->addr)) ++ goto exit; ++ ++ sta = peer->sta; ++ arsta = (struct ath11k_sta *)sta->drv_priv; ++ ++ memset(&status, 0, sizeof(status)); ++ ++ status.sta = sta; ++ status.rate = &arsta->last_txrate; ++ status.mpdu_fail = FIELD_GET(HTT_PPDU_STATS_CMPLTN_FLUSH_INFO_NUM_MPDU, ++ msg->info); ++ ar = arsta->arvif->ar; ++ ieee80211s_update_metric_ppdu(ar->hw, &status); ++ ++exit: ++ spin_unlock_bh(&ab->base_lock); ++ rcu_read_unlock(); ++} ++ ++static int ath11k_htt_tlv_ppdu_soc_stats_parse(struct ath11k_base *ab, ++ u16 tag, u16 len, const void *ptr, ++ void *data) ++{ ++ switch (tag) { ++ case HTT_PPDU_STATS_TAG_USR_COMPLTN_FLUSH: ++ if (len < sizeof(struct htt_ppdu_stats_cmpltn_flush)) { ++ ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", ++ len, tag); ++ return -EINVAL; ++ } ++ ath11k_dp_ppdu_stats_flush_tlv_parse(ab, ptr); ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ + static void + ath11k_update_per_peer_tx_stats(struct ath11k *ar, + struct htt_ppdu_stats *ppdu_stats, u8 user) +@@ -1431,6 +1493,9 @@ ath11k_update_per_peer_tx_stats(struct a + if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE))) + return; + ++ if (usr_stats->rate_stats_updated) ++ return; ++ + if (usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON)) + is_ampdu = + HTT_USR_CMPLTN_IS_AMPDU(usr_stats->cmpltn_cmn.flags); +@@ -1568,6 +1633,8 @@ ath11k_update_per_peer_tx_stats(struct a + ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx); + } + ++ usr_stats->rate_stats_updated = true; ++ + spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); + } +@@ -1655,8 +1722,10 @@ int ath11k_dp_htt_tlv_iter(struct ath11k + int ret = -EINVAL; + struct htt_ppdu_stats_info * ppdu_info = NULL; + +- ppdu_info = (struct htt_ppdu_stats_info *)data; +- ppdu_info->tlv_bitmap = 0; ++ if (data) { ++ ppdu_info = (struct htt_ppdu_stats_info *)data; ++ ppdu_info->tlv_bitmap = 0; ++ } + while (len > 0) { + if (len < sizeof(*tlv)) { + ath11k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", +@@ -1685,6 +1754,66 @@ int ath11k_dp_htt_tlv_iter(struct ath11k + return 0; + } + ++static void ++ath11k_dp_rx_ppdu_stats_update_tx_comp_status(struct ath11k *ar, ++ struct htt_ppdu_stats_info *ppdu_info) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct ieee80211_sta *sta; ++ struct ath11k_sta *arsta; ++ struct ath11k_peer *peer = NULL; ++ struct htt_ppdu_user_stats* usr_stats = NULL; ++ struct ieee80211_tx_status status; ++ u32 peer_id = 0; ++ int i; ++ ++ lockdep_assert_held(&ar->data_lock); ++ ++ if (!ar->ab->nss.mesh_nss_offload_enabled) ++ return; ++ ++ ath11k_htt_update_ppdu_stats(ar, &ppdu_info->ppdu_stats); ++ ++ rcu_read_lock(); ++ ++ for (i = 0; i < ppdu_info->ppdu_stats.common.num_users; i++) { ++ usr_stats = &ppdu_info->ppdu_stats.user_stats[i]; ++ peer_id = usr_stats->peer_id; ++ spin_lock_bh(&ab->base_lock); ++ peer = ath11k_peer_find_by_id(ab, peer_id); ++ if (!peer) { ++ spin_unlock_bh(&ab->base_lock); ++ continue; ++ } ++ ++ if (peer->vif->type != NL80211_IFTYPE_MESH_POINT) { ++ spin_unlock_bh(&ab->base_lock); ++ goto exit; ++ } ++ ++ if (ether_addr_equal(peer->addr, peer->vif->addr)) { ++ spin_unlock_bh(&ab->base_lock); ++ continue; ++ } ++ ++ sta = peer->sta; ++ arsta = (struct ath11k_sta *)sta->drv_priv; ++ ++ memset(&status, 0, sizeof(status)); ++ ++ status.sta = sta; ++ status.rate = &arsta->last_txrate; ++ status.mpdu_succ = usr_stats->cmpltn_cmn.mpdu_success; ++ ++ ieee80211s_update_metric_ppdu(ar->hw, &status); ++ ++ spin_unlock_bh(&ab->base_lock); ++ } ++ ++exit: ++ rcu_read_unlock(); ++} ++ + static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, + struct sk_buff *skb) + { +@@ -1703,6 +1832,15 @@ static int ath11k_htt_pull_ppdu_stats(st + pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PDEV_ID, msg->info); + ppdu_id = msg->ppdu_id; + ++ if (pdev_id == 0) { ++ ret = ath11k_dp_htt_tlv_iter(ab, msg->data, len, ++ ath11k_htt_tlv_ppdu_soc_stats_parse, ++ NULL); ++ if (ret) ++ ath11k_warn(ab, "failed to parse tlv %d\n", ret); ++ return ret; ++ } ++ + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); + if (!ar) { +@@ -1774,6 +1912,12 @@ static int ath11k_htt_pull_ppdu_stats(st + } + } + ++ /* Stats update for mesh interface used when nss-offload in mesh is enabled */ ++ if ((ppdu_info->frame_type == HTT_STATS_PPDU_FTYPE_DATA && ++ (ppdu_info->tlv_bitmap & (1 << HTT_PPDU_STATS_TAG_USR_RATE)) && ++ ppdu_info->tlv_bitmap & (1 << HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON))) ++ ath11k_dp_rx_ppdu_stats_update_tx_comp_status(ar, ppdu_info); ++ + spin_unlock_bh(&ar->data_lock); + exit: + rcu_read_unlock(); +@@ -3031,6 +3175,23 @@ static void ath11k_dp_rx_process_receive + rcu_read_unlock(); + } + ++void ath11k_dp_rx_from_nss(struct ath11k *ar, struct sk_buff *msdu, ++ struct napi_struct *napi) ++{ ++ struct ieee80211_rx_status rx_status = {0}; ++ struct ath11k_skb_rxcb *rxcb; ++ bool fast_rx = false; ++ ++ rxcb = ATH11K_SKB_RXCB(msdu); ++ ++ ath11k_dp_rx_h_ppdu(ar, rxcb->rx_desc, &rx_status); ++ ath11k_dp_rx_h_mpdu(ar, msdu, rxcb->rx_desc, &rx_status, &fast_rx); ++ ++ rx_status.flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; ++ ++ ath11k_dp_rx_deliver_msdu(ar, napi, msdu, &rx_status); ++} ++ + int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, + struct napi_struct *napi, int budget) + { +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -159,4 +159,6 @@ bool ath11k_dp_rx_h_attn_is_mcbc(struct + struct hal_rx_desc *desc); + u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, + struct hal_rx_desc *desc); ++void ath11k_dp_rx_from_nss(struct ath11k *ar, struct sk_buff *msdu, ++ struct napi_struct *napi); + #endif /* ATH11K_DP_RX_H */ +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3092,6 +3092,16 @@ static void ath11k_mac_op_nss_bss_info_c + ath11k_warn(ar->ab, "failed to set ap_isolate in nss %d\n", ret); + } + ++ if (changed & (BSS_CHANGED_NSS_MESH_TTL | ++ BSS_CHANGED_NSS_MESH_REFRESH_TIME | ++ BSS_CHANGED_NSS_MESH_FWD_ENABLED)) { ++ ret = ath11k_nss_mesh_config_update(vif, changed); ++ if (ret) ++ ath11k_warn(ar->ab, ++ "failed to update mesh nss offload configuration %d\n", ++ ret); ++ } ++ + mutex_unlock(&ar->conf_mutex); + } + +@@ -6056,7 +6066,7 @@ static void ath11k_mac_op_tx(struct ieee + skb_cb->flags |= ATH11K_SKB_TX_STATUS; + + if (ar->ab->nss.enabled) +- ret = ath11k_nss_tx(arvif,skb); ++ ret = ath11k_nss_tx(arvif, skb); + else + ret = ath11k_dp_tx(ar, arvif, skb, + (control->sta) ? control->sta->drv_priv : NULL); +@@ -8449,6 +8459,28 @@ static void ath11k_mac_op_sta_statistics + ath11k_nss_update_sta_stats(arvif, sinfo, sta); + } + ++#ifdef CPTCFG_MAC80211_MESH ++static void ++ath11k_mac_op_config_mesh_offload_path(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ struct ath11k *ar = hw->priv; ++ struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ int ret; ++ ++ if (arvif->ar->ab->nss.debug_mode) { ++ ret = 0; ++ return; ++ } ++ ++ ret = ath11k_nss_mesh_config_path(ar, arvif, cmd, path); ++ if (ret) ++ ath11k_warn(ar->ab, "failed to configure path entry to mesh table %d\n", ret); ++} ++#endif ++ + #define ATH11K_WLAN_PRIO_MAX 0x63 + #define ATH11K_WLAN_PRIO_WEIGHT 0xff + +@@ -8573,6 +8605,9 @@ static const struct ieee80211_ops ath11k + #ifdef CPTCFG_ATH11K_DEBUGFS + .sta_add_debugfs = ath11k_debugfs_sta_op_add, + #endif ++#ifdef CPTCFG_MAC80211_MESH ++ .config_mesh_offload_path = ath11k_mac_op_config_mesh_offload_path, ++#endif + }; + + static void ath11k_mac_update_ch_list(struct ath11k *ar, +@@ -9068,6 +9103,8 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, SUPPORTS_NSS_OFFLOAD); + wiphy_ext_feature_set(ar->hw->wiphy, + NL80211_EXT_FEATURE_VLAN_OFFLOAD); ++ if (ab->nss.mesh_nss_offload_enabled) ++ ieee80211_hw_set(ar->hw, SUPPORTS_MESH_NSS_OFFLOAD); + } + + ret = ieee80211_register_hw(ar->hw); +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -5,6 +5,7 @@ + + #include "mac.h" + #include "nss.h" ++#include "debug_nss.h" + #include "core.h" + #include "peer.h" + #include "dp_tx.h" +@@ -14,6 +15,9 @@ + #include "wmi.h" + #include "../../../../../net/mac80211/sta_info.h" + ++enum nss_wifi_mesh_mpp_learning_mode mpp_mode = NSS_WIFI_MESH_MPP_LEARNING_MODE_INDEPENDENT_NSS; ++LIST_HEAD(mesh_vaps); ++ + /*-----------------------------ATH11K-NSS Helpers--------------------------*/ + + static enum ath11k_nss_opmode +@@ -32,6 +36,30 @@ ath11k_nss_get_vdev_opmode(struct ath11k + return ATH11K_NSS_OPMODE_UNKNOWN; + } + ++static struct ath11k_vif *ath11k_nss_get_arvif_from_dev(struct net_device *dev) ++{ ++ struct wireless_dev *wdev; ++ struct ieee80211_vif *vif; ++ struct ath11k_vif *arvif; ++ ++ if (!dev) ++ return NULL; ++ ++ wdev = dev->ieee80211_ptr; ++ if (!wdev) ++ return NULL; ++ ++ vif = wdev_to_ieee80211_vif(wdev); ++ if (!vif) ++ return NULL; ++ ++ arvif = (struct ath11k_vif *)vif->drv_priv; ++ if (!arvif) ++ return NULL; ++ ++ return arvif; ++} ++ + static void ath11k_nss_wifili_stats_sync(struct ath11k_base *ab, + struct nss_wifili_stats_sync_msg *wlsoc_stats) + { +@@ -248,6 +276,9 @@ void ath11k_nss_wifili_event_receive(str + + switch (msg_type) { + case NSS_WIFILI_INIT_MSG: ++ ab->nss.response = response; ++ complete(&ab->nss.complete); ++ break; + case NSS_WIFILI_PDEV_INIT_MSG: + case NSS_WIFILI_START_MSG: + case NSS_WIFILI_SOC_RESET_MSG: +@@ -256,7 +287,6 @@ void ath11k_nss_wifili_event_receive(str + ab->nss.response = response; + complete(&ab->nss.complete); + break; +- + case NSS_WIFILI_PEER_CREATE_MSG: + if (response != NSS_CMN_RESPONSE_EMSG) + break; +@@ -326,6 +356,13 @@ void ath11k_nss_wifili_event_receive(str + ath11k_dbg(ab, ATH11K_DBG_NSS_WDS, "nss wifili peer 4addr event received %d response %d error %d\n", + msg_type, response, error); + break; ++ case NSS_WIFILI_SEND_MESH_CAPABILITY_INFO: ++ complete(&ab->nss.complete); ++ if (response != NSS_CMN_RESPONSE_EMSG) ++ ab->nss.mesh_nss_offload_enabled = true; ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "nss wifili mesh capability response %d\n", ++ ab->nss.mesh_nss_offload_enabled); ++ break; + default: + ath11k_dbg(ab, ATH11K_DBG_NSS, "unhandled event %d\n", msg_type); + break; +@@ -413,7 +450,9 @@ ath11k_nss_wifili_ext_callback_fn(struct + ath11k_nss_process_mic_error(ab, skb); + break; + default: +- kfree(skb); ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "unknown packet type received in wifili ext cb %d", ++ wepm->pkt_type); ++ dev_kfree_skb_any(skb); + break; + } + } +@@ -728,8 +767,6 @@ ath11k_nss_vdev_special_data_receive(str + { + struct nss_wifi_vdev_per_packet_metadata *wifi_metadata = NULL; + struct nss_wifi_vdev_wds_per_packet_metadata *wds_metadata = NULL; +- struct wireless_dev *wdev; +- struct ieee80211_vif *vif; + struct ath11k_vif *arvif; + struct ath11k_base *ab; + bool drop = false; +@@ -737,24 +774,7 @@ ath11k_nss_vdev_special_data_receive(str + int data_offs = 0; + int ret = 0; + +- if (!dev) { +- dev_kfree_skb_any(skb); +- return; +- } +- +- wdev = dev->ieee80211_ptr; +- if (!wdev) { +- dev_kfree_skb_any(skb); +- return; +- } +- +- vif = wdev_to_ieee80211_vif(wdev); +- if (!vif) { +- dev_kfree_skb_any(skb); +- return; +- } +- +- arvif = (struct ath11k_vif *)vif->drv_priv; ++ arvif = ath11k_nss_get_arvif_from_dev(dev); + if (!arvif) { + dev_kfree_skb_any(skb); + return; +@@ -875,17 +895,1071 @@ ath11k_nss_ext_vdev_data_receive(struct + int data_offs = 0; + int ret; + +- if (!dev) { ++ if (!dev) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ wdev = dev->ieee80211_ptr; ++ if (!wdev) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ vif = wdev_to_ieee80211_vif(wdev); ++ if (!vif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ arvif = (struct ath11k_vif *)vif->drv_priv; ++ if (!arvif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ab = arvif->ar->ab; ++ ++ skb->dev = dev; ++ ++ /* log the original skb received from nss */ ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss ext : ", ++ skb->data, skb->len); ++ ++ ret = ath11k_nss_undecap(arvif, skb, &data_offs, ð_decap); ++ if (ret) { ++ ath11k_warn(ab, "error in nss ext rx undecap, type %d err %d\n", ++ arvif->nss.decap, ret); ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); ++} ++ ++/*------Mesh offload------*/ ++ ++void ath11k_nss_mesh_wifili_event_receive(void *app_data, ++ struct nss_cmn_msg *cmn_msg) ++{ ++ struct nss_wifi_mesh_msg *msg = (struct nss_wifi_mesh_msg *)cmn_msg; ++ struct ath11k_base *ab = app_data; ++ u32 msg_type = msg->cm.type; ++ enum nss_cmn_response response = msg->cm.response; ++ u32 error = msg->cm.error; ++ ++ if (!ab) ++ return; ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "nss mesh event received %d response %d error %d\n", ++ msg_type, response, error); ++ ++ switch (msg_type) { ++ case NSS_WIFI_MESH_MSG_MPATH_ADD: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to add an entry to mpath table mesh_da %pM vdev_id %d\n", ++ (&msg->msg.mpath_add)->dest_mac_addr, ++ (&msg->msg.mpath_add)->link_vap_id); ++ break; ++ case NSS_WIFI_MESH_MSG_MPATH_UPDATE: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab, "failed to update mpath entry mesh_da %pM vdev_id %d" ++ "next_hop %pM metric %d flags 0x%u hop_count %d" ++ "exp_time %u mesh_gate %u\n", ++ (&msg->msg.mpath_update)->dest_mac_addr, ++ (&msg->msg.mpath_update)->link_vap_id, ++ (&msg->msg.mpath_update)->next_hop_mac_addr, ++ (&msg->msg.mpath_update)->metric, ++ (&msg->msg.mpath_update)->path_flags, ++ (&msg->msg.mpath_update)->hop_count, ++ (&msg->msg.mpath_update)->expiry_time, ++ (&msg->msg.mpath_update)->is_mesh_gate); ++ break; ++ case NSS_WIFI_MESH_MSG_MPATH_DELETE: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to remove mpath entry mesh_da %pM" ++ "vdev_id %d\n", ++ (&msg->msg.mpath_del)->mesh_dest_mac_addr, ++ (&msg->msg.mpath_del)->link_vap_id); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_ADD: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to add proxy entry da %pM mesh_da %pM \n", ++ (&msg->msg.proxy_add_msg)->dest_mac_addr, ++ (&msg->msg.proxy_add_msg)->mesh_dest_mac); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_UPDATE: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to update proxy path da %pM mesh_da %pM\n", ++ (&msg->msg.proxy_update_msg)->dest_mac_addr, ++ (&msg->msg.proxy_update_msg)->mesh_dest_mac); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_DELETE: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to remove proxy path entry da %pM mesh_da %pM\n", ++ (&msg->msg.proxy_del_msg)->dest_mac_addr, ++ (&msg->msg.proxy_del_msg)->mesh_dest_mac_addr); ++ break; ++ case NSS_WIFI_MESH_MSG_EXCEPTION_FLAG: ++ if (response == NSS_CMN_RESPONSE_EMSG) ++ ath11k_warn(ab,"failed to add the exception da %pM\n", ++ (&msg->msg.exception_msg)->dest_mac_addr); ++ break; ++ default: ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "unhandled event %d\n", msg_type); ++ break; ++ } ++} ++ ++static void nss_mesh_convert_path_flags(u16 *dest, u16 *src, bool to_nss) ++{ ++ if (to_nss) { ++ if (*src & IEEE80211_MESH_PATH_ACTIVE) ++ *dest |= NSS_WIFI_MESH_PATH_FLAG_ACTIVE; ++ if (*src & IEEE80211_MESH_PATH_RESOLVING) ++ *dest |= NSS_WIFI_MESH_PATH_FLAG_RESOLVING; ++ if (*src & IEEE80211_MESH_PATH_RESOLVED) ++ *dest |= NSS_WIFI_MESH_PATH_FLAG_RESOLVED; ++ if (*src & IEEE80211_MESH_PATH_FIXED) ++ *dest |= NSS_WIFI_MESH_PATH_FLAG_FIXED; ++ } else { ++ if (*src & NSS_WIFI_MESH_PATH_FLAG_ACTIVE) ++ *dest |= IEEE80211_MESH_PATH_ACTIVE; ++ if (*src & NSS_WIFI_MESH_PATH_FLAG_RESOLVING) ++ *dest |= IEEE80211_MESH_PATH_RESOLVING; ++ if (*src & NSS_WIFI_MESH_PATH_FLAG_RESOLVED) ++ *dest |= IEEE80211_MESH_PATH_RESOLVED; ++ if (*src & NSS_WIFI_MESH_PATH_FLAG_FIXED) ++ *dest |= IEEE80211_MESH_PATH_FIXED; ++ } ++} ++ ++static void ath11k_nss_mesh_mpath_refresh(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_path_refresh_msg *refresh_msg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ refresh_msg = &msg->msg.path_refresh_msg; ++ ether_addr_copy(path.mesh_da, refresh_msg->dest_mac_addr); ++ ether_addr_copy(path.next_hop, refresh_msg->next_hop_mac_addr); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh path refresh event from nss, mDA %pM next_hop %pM link_vdev %d\n", ++ refresh_msg->dest_mac_addr, refresh_msg->next_hop_mac_addr, ++ refresh_msg->link_vap_id); ++ ++ ++ if (ab->nss.debug_mode) ++ return; ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_REFRESH); ++ if (ret) ++ ath11k_warn(ab, "failed to notify mpath refresh nss event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_path_not_found(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_mpath_not_found_msg *err_msg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ err_msg = &msg->msg.mpath_not_found_msg; ++ ether_addr_copy(path.da, err_msg->dest_mac_addr); ++ if (err_msg->is_mesh_forward_path) ++ ether_addr_copy(path.ta, err_msg->transmitter_mac_addr); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh path not found event from nss, (m)DA %pM ta %pM link vap %d\n", ++ err_msg->dest_mac_addr, err_msg->transmitter_mac_addr, err_msg->link_vap_id); ++ ++ ++ if (ab->nss.debug_mode) ++ return; ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_PATH_NOT_FOUND); ++ if (ret) ++ ath11k_warn(ab, "failed to notify mpath not found nss event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_path_delete(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_mpath_del_msg *del_msg = &msg->msg.mpath_del; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ ether_addr_copy(path.mesh_da, del_msg->mesh_dest_mac_addr); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh path delete event from nss, mDA %pM vap_id %d\n", ++ del_msg->mesh_dest_mac_addr, del_msg->link_vap_id); ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_DEL); ++ if (ret) ++ ath11k_warn(ab, "failed to notify mpath delete nss event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_path_expiry(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_path_expiry_msg *exp_msg = &msg->msg.path_expiry_msg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ ether_addr_copy(path.mesh_da, exp_msg->mesh_dest_mac_addr); ++ ether_addr_copy(path.next_hop, exp_msg->next_hop_mac_addr); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh path delete event from nss, mDA %pM next_hop %pM if_num %d\n", ++ exp_msg->mesh_dest_mac_addr, exp_msg->next_hop_mac_addr, ++ arvif->nss.if_num); ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_EXP); ++ if (ret) ++ ath11k_warn(ab, "failed to notify mpath expiry nss event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_mpp_learn(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++ { ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_proxy_path_learn_msg *learn_msg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ learn_msg = &msg->msg.proxy_learn_msg; ++ ++ ether_addr_copy(path.mesh_da, learn_msg->mesh_dest_mac); ++ ether_addr_copy(path.da, learn_msg->dest_mac_addr); ++ nss_mesh_convert_path_flags(&path.flags, &learn_msg->path_flags, false); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh proxy learn event from nss, mDA %pM da %pM flags 0x%x if_num %d\n", ++ learn_msg->mesh_dest_mac, learn_msg->dest_mac_addr, ++ learn_msg->path_flags, arvif->nss.if_num); ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_LEARN); ++ if (ret) ++ ath11k_warn(ab, "failed to notify proxy learn event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_mpp_add(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_proxy_path_add_msg *add_msg = &msg->msg.proxy_add_msg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ ether_addr_copy(path.mesh_da, add_msg->mesh_dest_mac); ++ ether_addr_copy(path.da, add_msg->dest_mac_addr); ++ nss_mesh_convert_path_flags(&path.flags, &add_msg->path_flags, false); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh proxy add event from nss, mDA %pM da %pM flags 0x%x if_num %d\n", ++ add_msg->mesh_dest_mac, add_msg->dest_mac_addr, add_msg->path_flags, ++ arvif->nss.if_num); ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_ADD); ++ if (ret) ++ ath11k_warn(ab, "failed to notify proxy add event %d\n", ret); ++} ++ ++static void ath11k_nss_mesh_mpp_update(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_proxy_path_update_msg *umsg; ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ umsg = &msg->msg.proxy_update_msg; ++ ether_addr_copy(path.mesh_da, umsg->mesh_dest_mac); ++ ether_addr_copy(path.da, umsg->dest_mac_addr); ++ nss_mesh_convert_path_flags(&path.flags, &umsg->path_flags, false); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "Mesh proxy update event from nss, mDA %pM da %pM flags 0x%x if_num %d\n", ++ umsg->mesh_dest_mac, umsg->dest_mac_addr, umsg->path_flags, arvif->nss.if_num); ++ ++ ret = ieee80211_mesh_path_offld_change_notify(arvif->vif, &path, ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_UPDATE); ++ if (ret) ++ ath11k_warn(ab, "failed to notify proxy update event %d\n", ret); ++} ++ ++static int ++ath11k_nss_mesh_process_path_table_dump_msg(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct nss_wifi_mesh_path_table_dump *mpath_dump = &msg->msg.mpath_table_dump; ++ struct ath11k_nss_mpath_entry *entry; ++ struct ath11k *ar = arvif->ar; ++ ssize_t len; ++ ++ len = sizeof(struct nss_wifi_mesh_path_dump_entry) * mpath_dump->num_entries; ++ entry = kzalloc(sizeof(*entry) + len, GFP_ATOMIC); ++ if (!entry) ++ return -ENOMEM; ++ ++ memcpy(entry->mpath, mpath_dump->path_entry, len); ++ entry->num_entries = mpath_dump->num_entries; ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_add_tail(&entry->list, &arvif->nss.mpath_dump); ++ arvif->nss.mpath_dump_num_entries += mpath_dump->num_entries; ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ if (!mpath_dump->more_events) ++ complete(&arvif->nss.dump_mpath_complete); ++ ++ return 0; ++} ++ ++static int ++ath11k_nss_mesh_process_mpp_table_dump_msg(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct nss_wifi_mesh_proxy_path_table_dump *mpp_dump; ++ struct ath11k_nss_mpp_entry *entry, *tmp; ++ struct ath11k *ar = arvif->ar; ++ struct arvif_nss *nss = &arvif->nss; ++ ssize_t len; ++ LIST_HEAD(local_entry_exp_update); ++ ++ mpp_dump = &msg->msg.proxy_path_table_dump; ++ ++ len = sizeof(struct nss_wifi_mesh_proxy_path_dump_entry) * mpp_dump->num_entries; ++ entry = kzalloc(sizeof(*entry) + len, GFP_ATOMIC); ++ if (!entry) ++ return -ENOMEM; ++ ++ memcpy(entry->mpp, mpp_dump->path_entry, len); ++ entry->num_entries = mpp_dump->num_entries; ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_add_tail(&entry->list, &arvif->nss.mpp_dump); ++ arvif->nss.mpp_dump_num_entries += mpp_dump->num_entries; ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ if (!mpp_dump->more_events) { ++ if (arvif->nss.mpp_aging) { ++ arvif->nss.mpp_aging = false; ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpp_dump, &local_entry_exp_update); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(entry, tmp, &local_entry_exp_update, list) { ++ if (entry->mpp->time_diff > ATH11K_MPP_EXPIRY_TIMER_INTERVAL_MS) ++ continue; ++ mesh_nss_offld_proxy_path_exp_update(arvif->vif, ++ entry->mpp->dest_mac_addr, ++ entry->mpp->mesh_dest_mac, ++ entry->mpp->time_diff); ++ } ++ /* If mpp_dump_req is true dont free the entry ++ * since it will get freed in debug_nss_fill_mpp_dump ++ * both mpp_aging and mpp_dump_req will be true during ++ * simultaneous accessing of mpp dump entry. So this will ++ * gain the reuse of same dump result for both mpp_aging ++ * and mpp_dump_req */ ++ if (!arvif->nss.mpp_dump_req) { ++ list_for_each_entry_safe(entry, tmp, &local_entry_exp_update, list) ++ kfree(entry); ++ } else { ++ /* Adding back to global nss dump tbl to reuse the same ++ * tbl for mpp dump request ++ */ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&local_entry_exp_update, &nss->mpp_dump); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ } ++ } ++ ++ if (arvif->nss.mpp_dump_req) { ++ complete(&arvif->nss.dump_mpp_complete); ++ arvif->nss.mpp_dump_req = false; ++ } ++ } ++ ++ return 0; ++} ++ ++int ath11k_nss_mesh_exception_flags(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_exception_flag_msg *nss_msg) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ status = nss_wifi_meshmgr_mesh_path_exception(arvif->nss.mesh_handle, nss_msg, ++ msg_cb, arvif->ar->ab); ++ ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(arvif->ar->ab, "failed to set the exception flags\n"); ++ ret = -EINVAL; ++ } ++ ++ return ret; ++} ++ ++int ath11k_nss_exc_rate_config(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_rate_limit_config *nss_exc_cfg) ++{ ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ status = nss_wifi_meshmgr_config_mesh_exception_sync(arvif->nss.mesh_handle, nss_exc_cfg); ++ ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(arvif->ar->ab, "failed to set the exception rate ctrl\n"); ++ ret = -EINVAL; ++ } ++ ++ return ret; ++} ++ ++static void ath11k_nss_mesh_obj_vdev_event_receive(struct net_device *dev, ++ struct nss_wifi_mesh_msg *msg) ++{ ++ struct ath11k_base *ab; ++ struct ath11k_vif *arvif; ++ int ret; ++ ++ arvif = ath11k_nss_get_arvif_from_dev(dev); ++ if (!arvif) ++ return; ++ ++ ab = arvif->ar->ab; ++ ++ switch (msg->cm.type) { ++ case NSS_WIFI_MESH_MSG_PATH_REFRESH: ++ ath11k_nss_mesh_mpath_refresh(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PATH_NOT_FOUND: ++ ath11k_nss_mesh_path_not_found(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_MPATH_DELETE: ++ ath11k_nss_mesh_path_delete(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PATH_EXPIRY: ++ ath11k_nss_mesh_path_expiry(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_LEARN: ++ ath11k_nss_mesh_mpp_learn(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_ADD: ++ ath11k_nss_mesh_mpp_add(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_UPDATE: ++ ath11k_nss_mesh_mpp_update(arvif, msg); ++ break; ++ case NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP: ++ ret = ath11k_nss_mesh_process_path_table_dump_msg(arvif, msg); ++ if (ret) ++ ath11k_warn(arvif->ar->ab, "failed mpath table dump message %d\n", ++ ret); ++ break; ++ case NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP: ++ ret = ath11k_nss_mesh_process_mpp_table_dump_msg(arvif, msg); ++ if (ret) ++ ath11k_warn(arvif->ar->ab, "failed mpp table dump message %d\n", ++ ret); ++ break; ++ default: ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "unknown message type on mesh obj vap %d\n", ++ msg->cm.type); ++ break; ++ } ++} ++ ++static int ath11k_nss_mesh_mpath_add(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_mpath_add_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, "add mpath for mesh_da %pM on radio %d\n", ++ path->mesh_da, ar->pdev->pdev_id); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_mpath_add_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->dest_mac_addr, path->mesh_da); ++ ether_addr_copy(msg->next_hop_mac_addr, path->next_hop); ++ msg->hop_count = path->hop_count; ++ msg->metric = path->metric; ++ nss_mesh_convert_path_flags(&msg->path_flags, &path->flags, true); ++ msg->link_vap_id = arvif->nss.if_num; ++ msg->block_mesh_fwd = path->block_mesh_fwd; ++ msg->metadata_type = path->metadata_type ? NSS_WIFI_MESH_PRE_HEADER_80211: NSS_WIFI_MESH_PRE_HEADER_NONE; ++ ++ status = nss_wifi_meshmgr_mesh_path_add(arvif->nss.mesh_handle, msg, ++ msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to add mpath entry mesh_da %pM radio_id %d status %d\n", ++ path->mesh_da, arvif->nss.if_num, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_mpath_update(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_mpath_update_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, ++ "update mpath mesh_da %pM radio %d next_hop %pM old_next_hop %pM " ++ "metric %d flags 0x%x hop_count %d " ++ "exp_time %lu mesh_gate %d\n", ++ path->mesh_da, ar->pdev->pdev_id, path->next_hop, path->old_next_hop, ++ path->metric, path->flags, path->hop_count, path->exp_time, ++ path->mesh_gate); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_mpath_update_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->dest_mac_addr, path->mesh_da); ++ ether_addr_copy(msg->next_hop_mac_addr, path->next_hop); ++ ether_addr_copy(msg->old_next_hop_mac_addr, path->old_next_hop); ++ msg->hop_count = path->hop_count; ++ msg->metric = path->metric; ++ nss_mesh_convert_path_flags(&msg->path_flags, &path->flags, true); ++ msg->link_vap_id = arvif->nss.if_num; ++ msg->is_mesh_gate = path->mesh_gate; ++ msg->expiry_time = path->exp_time; ++ msg->block_mesh_fwd = path->block_mesh_fwd; ++ msg->metadata_type = path->metadata_type ? NSS_WIFI_MESH_PRE_HEADER_80211: NSS_WIFI_MESH_PRE_HEADER_NONE; ++ ++ msg->update_flags = NSS_WIFI_MESH_PATH_UPDATE_FLAG_NEXTHOP | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_HOPCOUNT | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_METRIC | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_MESH_FLAGS | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_BLOCK_MESH_FWD | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_METADATA_ENABLE_VALID; ++ ++ status = nss_wifi_meshmgr_mesh_path_update(arvif->nss.mesh_handle, msg, ++ msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to update mpath entry mesh_da %pM radio_id %d status %d\n", ++ path->mesh_da, arvif->nss.if_num, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_mpath_del(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_mpath_del_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, "del mpath for mesh_da %pM on radio %d\n", ++ path->mesh_da, ar->pdev->pdev_id); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_mpath_del_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->mesh_dest_mac_addr, path->mesh_da); ++ ether_addr_copy(msg->next_hop_mac_addr, path->next_hop); ++ msg->link_vap_id = arvif->nss.if_num; ++ ++ status = nss_wifi_meshmgr_mesh_path_delete(arvif->nss.mesh_handle, ++ msg, msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to del mpath entry mesh_da %pM radio_id %d status %d\n", ++ path->mesh_da, arvif->nss.if_num, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_mpp_add_cmd(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_proxy_path_add_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, "add mpp mesh_da %pM da %pM\n", ++ path->mesh_da, path->da); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_proxy_path_add_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->dest_mac_addr, path->da); ++ ether_addr_copy(msg->mesh_dest_mac, path->mesh_da); ++ nss_mesh_convert_path_flags(&msg->path_flags, &path->flags, true); ++ ++ status = nss_wifi_meshmgr_mesh_proxy_path_add(arvif->nss.mesh_handle, ++ msg, msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to add mpp entry da %pM mesh_da %pM status %d\n", ++ path->da, path->mesh_da, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_mpp_update_cmd(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_proxy_path_update_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, "update mpp da %pM mesh_da %pM on vap_id %d\n", ++ path->da, path->mesh_da, arvif->nss.if_num); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_proxy_path_update_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->dest_mac_addr, path->da); ++ ether_addr_copy(msg->mesh_dest_mac, path->mesh_da); ++ nss_mesh_convert_path_flags(&msg->path_flags, &path->flags, true); ++ msg->bitmap = NSS_WIFI_MESH_PATH_UPDATE_FLAG_NEXTHOP | ++ NSS_WIFI_MESH_PATH_UPDATE_FLAG_HOPCOUNT; ++ ++ status = nss_wifi_meshmgr_mesh_proxy_path_update(arvif->nss.mesh_handle, ++ msg, msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to update mpp da %pM mesh_da %pM status %d\n", ++ path->da, path->mesh_da, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_mpp_del_cmd(struct ath11k_vif *arvif, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct nss_wifi_mesh_proxy_path_del_msg *msg; ++ struct ath11k *ar = arvif->ar; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_NSS_MESH, "del mpath for mesh_da %pM\n", ++ path->mesh_da); ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_proxy_path_del_msg), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ ether_addr_copy(msg->dest_mac_addr, path->da); ++ ether_addr_copy(msg->mesh_dest_mac_addr, path->mesh_da); ++ ++ status = nss_wifi_meshmgr_mesh_proxy_path_delete(arvif->nss.mesh_handle, msg, ++ msg_cb, ar->ab); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, ++ "failed to add mpath entry mesh_da %pM status %d\n", ++ path->mesh_da, status); ++ ret = -EINVAL; ++ } ++ ++ kfree(msg); ++ ++ return ret; ++} ++ ++int ath11k_nss_mesh_config_path(struct ath11k *ar, struct ath11k_vif *arvif, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ int ret; ++ ++ ++ if (!ar->ab->nss.enabled) ++ return 0; ++ ++ switch (cmd) { ++ case IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPATH: ++ ret = ath11k_nss_mesh_mpath_add(arvif, path); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPATH: ++ ret = ath11k_nss_mesh_mpath_update(arvif, path); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPATH: ++ ret = ath11k_nss_mesh_mpath_del(arvif, path); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPP: ++ ret = ath11k_nss_mesh_mpp_add_cmd(arvif, path); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPP: ++ ret = ath11k_nss_mesh_mpp_update_cmd(arvif, path); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPP: ++ ret = ath11k_nss_mesh_mpp_del_cmd(arvif, path); ++ break; ++ default: ++ ath11k_warn(ar->ab, "unknown mesh path table command type %d\n", cmd); ++ return -EINVAL; ++ } ++ ++ return ret; ++} ++ ++int ath11k_nss_mesh_config_update(struct ieee80211_vif *vif, int changed) ++{ ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_config_msg *nss_msg; ++ struct arvif_nss *nss = &arvif->nss; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ if (!ab->nss.enabled) ++ return 0; ++ ++ if (!ab->nss.mesh_nss_offload_enabled) ++ return -ENOTSUPP; ++ ++ if (!changed) ++ return 0; ++ ++ nss_msg = kzalloc(sizeof(*nss_msg), GFP_KERNEL); ++ if (!nss_msg) ++ return -ENOMEM; ++ ++ if (changed & BSS_CHANGED_NSS_MESH_TTL) { ++ nss_msg->ttl = vif->bss_conf.nss_offld_ttl; ++ nss->mesh_ttl = vif->bss_conf.nss_offld_ttl; ++ nss_msg->config_flags |= NSS_WIFI_MESH_CONFIG_FLAG_TTL_VALID; ++ } ++ ++ if (changed & BSS_CHANGED_NSS_MESH_REFRESH_TIME) { ++ nss_msg->mesh_path_refresh_time = ++ vif->bss_conf.nss_offld_mpath_refresh_time; ++ nss->mpath_refresh_time = ++ vif->bss_conf.nss_offld_mpath_refresh_time; ++ nss_msg->config_flags |= NSS_WIFI_MESH_CONFIG_FLAG_MPATH_REFRESH_VALID; ++ } ++ ++ if (changed & BSS_CHANGED_NSS_MESH_FWD_ENABLED) { ++ nss_msg->block_mesh_forwarding = ++ vif->bss_conf.nss_offld_mesh_forward_enabled; ++ nss->mesh_forward_enabled = ++ vif->bss_conf.nss_offld_mesh_forward_enabled; ++ nss_msg->config_flags |= NSS_WIFI_MESH_CONFIG_FLAG_BLOCK_MESH_FWD_VALID; ++ nss_msg->metadata_type = arvif->nss.metadata_type; ++ nss_msg->config_flags |= NSS_WIFI_MESH_CONFIG_FLAG_METADATA_ENABLE_VALID; ++ } ++ ++ status = nss_wifi_meshmgr_mesh_config_update_sync(arvif->nss.mesh_handle, ++ nss_msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ab, "failed to configure nss mesh obj vdev nss_err:%d\n", ++ status); ++ ret = -EINVAL; ++ } ++ ++ kfree(nss_msg); ++ ++ return ret; ++} ++ ++int ath11k_nss_dump_mpath_request(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct ath11k *ar = arvif->ar; ++ struct arvif_nss *nss = &arvif->nss; ++ struct ath11k_nss_mpath_entry *entry, *tmp; ++ LIST_HEAD(local_entry); ++ nss_tx_status_t status; ++ ++ /* Clean up any stale entries from old events */ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail(&nss->mpath_dump, &local_entry); ++ arvif->nss.mpath_dump_num_entries = 0; ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(entry, tmp, &local_entry, list) ++ kfree(entry); ++ ++ status = nss_wifi_meshmgr_dump_mesh_path_sync(arvif->nss.mesh_handle); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ab, "failed to send mpath dump command on mesh obj vdev nss_err:%d\n", ++ status); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++int ath11k_nss_dump_mpp_request(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct ath11k *ar = arvif->ar; ++ struct arvif_nss *nss = &arvif->nss; ++ struct ath11k_nss_mpp_entry *entry, *tmp; ++ LIST_HEAD(local_entry); ++ nss_wifi_meshmgr_status_t status; ++ ++ if (!arvif->nss.mpp_aging) { ++ /* Clean up any stale entries from old events */ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpp_dump, &local_entry); ++ arvif->nss.mpp_dump_num_entries = 0; ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(entry, tmp, &local_entry, list) { ++ list_del(&entry->list); ++ kfree(entry); ++ } ++ } ++ ++ arvif->nss.mpp_dump_req = true; ++ ++ status = nss_wifi_meshmgr_dump_mesh_proxy_path_sync(arvif->nss.mesh_handle); ++ if (status != NSS_WIFI_MESHMGR_SUCCESS) { ++ if (status == NSS_WIFI_MESHMGR_FAILURE_ONESHOT_ALREADY_ATTACHED) ++ return 0; ++ ath11k_warn(ab, "failed to send mpp dump command on mesh obj vdev nss_err:%d\n", ++ status); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++int ath11k_nss_mpp_timer_cb(struct timer_list *timer) ++{ ++ nss_wifi_mesh_msg_callback_t msg_cb; ++ struct arvif_nss *nss = from_timer(nss, timer,mpp_expiry_timer); ++ struct ath11k_vif *arvif = container_of(nss, struct ath11k_vif, nss); ++ struct ath11k_base *ab = arvif->ar->ab; ++ LIST_HEAD(local_entry); ++ nss_tx_status_t status; ++ ++ msg_cb = (nss_wifi_mesh_msg_callback_t)ath11k_nss_mesh_wifili_event_receive; ++ ++ if (!arvif->nss.mpp_dump_req) ++ arvif->nss.mpp_dump_num_entries = 0; ++ arvif->nss.mpp_aging = true; ++ ++ status = nss_wifi_meshmgr_dump_mesh_proxy_path(arvif->nss.mesh_handle, msg_cb, ab); ++ if (status != NSS_TX_SUCCESS) ++ ath11k_warn(ab, "failed to send mpp dump command from timer nss_err:%d\n", ++ status); ++ ++ mod_timer(&nss->mpp_expiry_timer, ++ jiffies + msecs_to_jiffies(ATH11K_MPP_EXPIRY_TIMER_INTERVAL_MS)); ++ ++ return 0; ++} ++ ++static void ++ath11k_nss_mesh_obj_vdev_data_receive(struct net_device *dev, struct sk_buff *skb, ++ struct napi_struct *napi) ++{ ++ struct ath11k_vif *arvif; ++ struct ath11k_base *ab; ++ char dump_msg[100] = {0}; ++ struct nss_wifi_mesh_per_packet_metadata *wifi_metadata = NULL; ++ ++ arvif = ath11k_nss_get_arvif_from_dev(dev); ++ if (!arvif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ab = arvif->ar->ab; ++ ++ skb->dev = dev; ++ ++ snprintf(dump_msg, sizeof(dump_msg), "nss mesh obj vdev: link id %d ", ++ arvif->nss.if_num); ++ ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "dp rx msdu from nss", dump_msg, ++ skb->data, skb->len); ++ ++ if (arvif->nss.metadata_type == NSS_WIFI_MESH_PRE_HEADER_80211) { ++ wifi_metadata = (struct nss_wifi_mesh_per_packet_metadata *)(skb->data - ++ (sizeof(struct nss_wifi_mesh_per_packet_metadata))); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, ++ "exception from nss on mesh obj vap: pkt_type %d\n", ++ wifi_metadata->pkt_type); ++ switch (wifi_metadata->pkt_type) { ++ case NSS_WIFI_MESH_PRE_HEADER_80211: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "wifi header from nss on mesh obj vdev: ", ++ skb->data - sizeof(*wifi_metadata), sizeof(*wifi_metadata) + skb->len); ++ dev_kfree_skb_any(skb); ++ break; ++ default: ++ dev_kfree_skb_any(skb); ++ } ++ ++ return; ++ } ++ ++ ath11k_nss_deliver_rx(arvif->vif, skb, true, 0, napi); ++} ++ ++static void ++ath11k_nss_mesh_obj_ext_data_callback(struct net_device *dev, struct sk_buff *skb, ++ __attribute__((unused)) struct napi_struct *napi) ++{ ++ struct ath11k_vif *arvif; ++ struct ath11k_base *ab; ++ struct nss_wifi_mesh_encap_ext_pkt_metadata *wifi_metadata = NULL; ++ int metadata_len; ++ ++ arvif = ath11k_nss_get_arvif_from_dev(dev); ++ if (!arvif) { ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ ab = arvif->ar->ab; ++ ++ skb->dev = dev; ++ ++ metadata_len = NSS_WIFI_MESH_ENCAP_METADATA_OFFSET_TYPE + ++ sizeof(struct nss_wifi_mesh_encap_ext_pkt_metadata); ++ ++ /* msdu from nss should contain metadata in headroom ++ * any msdu which has invalid or not contains metadata ++ * will be treated as invalid msdu and dropping it. ++ */ ++ if (!(metadata_len < skb_headroom(skb))) { ++ ath11k_warn(ab, "msdu from nss is having invalid headroom %d\n", skb_headroom(skb)); ++ dev_kfree_skb_any(skb); ++ return; ++ } ++ ++ dma_unmap_single(ab->dev, virt_to_phys(skb->head), ++ metadata_len, ++ DMA_FROM_DEVICE); ++ ++ wifi_metadata = (struct nss_wifi_mesh_encap_ext_pkt_metadata *)(skb->head + ++ NSS_WIFI_MESH_ENCAP_METADATA_OFFSET_TYPE); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "msdu from nss ext_data _cb on mesh obj vdev"); ++ ++ switch (wifi_metadata->pkt_type) { ++ case NSS_WIFI_MESH_ENCAP_EXT_DATA_PKT_TYPE_MPATH_NOT_FOUND_EXC: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "msdu from nss ext_data for mpath not found : ", ++ skb->data, skb->len); ++ skb->protocol = eth_type_trans(skb, dev); ++ skb_reset_network_header(skb); ++ dev_queue_xmit(skb); ++ break; ++ default: ++ ath11k_warn(ab, "unknown packet type received in mesh obj ext data %d", ++ wifi_metadata->pkt_type); ++ dev_kfree_skb_any(skb); ++ } ++} ++ ++static void ++ath11k_nss_mesh_link_vdev_data_receive(void *dev, ++ struct sk_buff *skb, ++ struct napi_struct *napi) ++{ ++ struct ieee80211_vif *vif; ++ struct ath11k_vif *arvif; ++ struct ath11k_base *ab; ++ struct wireless_dev *wdev = (struct wireless_dev *)dev; ++ ++ vif = wdev_to_ieee80211_vif(wdev); ++ if (!vif) { + dev_kfree_skb_any(skb); + return; + } + +- wdev = dev->ieee80211_ptr; +- if (!wdev) { ++ arvif = (struct ath11k_vif *)vif->drv_priv; ++ if (!arvif) { + dev_kfree_skb_any(skb); + return; + } + ++ ab = arvif->ar->ab; ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "msdu from nss data_receive_cb on mesh link vdev: ", ++ skb->data, skb->len); ++ /* data callback for mesh link vap is not expected */ ++ dev_kfree_skb_any(skb); ++} ++ ++static void ++ath11k_nss_mesh_link_vdev_special_data_receive(void *dev, ++ struct sk_buff *skb, ++ __attribute__((unused)) struct napi_struct *napi) ++{ ++ struct ieee80211_vif *vif; ++ struct ath11k_base *ab; ++ struct nss_wifi_vdev_per_packet_metadata *wifi_metadata = NULL; ++ struct ath11k_skb_rxcb *rxcb; ++ struct ath11k_vif *arvif; ++ struct wireless_dev *wdev = (struct wireless_dev *)dev; ++ + vif = wdev_to_ieee80211_vif(wdev); + if (!vif) { + dev_kfree_skb_any(skb); +@@ -900,21 +1974,46 @@ ath11k_nss_ext_vdev_data_receive(struct + + ab = arvif->ar->ab; + +- skb->dev = dev; ++ wifi_metadata = (struct nss_wifi_vdev_per_packet_metadata *)(skb->head + ++ NSS_WIFI_VDEV_PER_PACKET_METADATA_OFFSET); + +- /* log the original skb received from nss */ +- ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss ext : ", +- skb->data, skb->len); ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, ++ "dp special data from nss on mesh link vap: pkt_type %d\n", ++ wifi_metadata->pkt_type); + +- ret = ath11k_nss_undecap(arvif, skb, &data_offs, ð_decap); +- if (ret) { +- ath11k_warn(ab, "error in nss ext rx undecap, type %d err %d\n", +- arvif->nss.decap, ret); ++ switch (wifi_metadata->pkt_type) { ++ case NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_SPL_PACKET: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "special packet meta data from nss on mesh link vdev: ", ++ wifi_metadata, ++ sizeof(struct nss_wifi_vdev_per_packet_metadata)); ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "special packet payload from nss on mesh link vdev: ", ++ skb->data, skb->len); + dev_kfree_skb_any(skb); +- return; ++ break; ++ case NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MCBC_RX: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "mcast packet exception from nss on mesh link vdev: ", ++ skb->data, skb->len); ++ rxcb = ATH11K_SKB_RXCB(skb); ++ rxcb->rx_desc = (struct hal_rx_desc *)skb->head; ++ rxcb->is_first_msdu = rxcb->is_last_msdu = true; ++ rxcb->is_continuation = false; ++ ath11k_dp_rx_from_nss(arvif->ar, skb, napi); ++ break; ++ case NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MESH: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "static exception path from nss on mesh link vdev: ", ++ skb->data, skb->len); ++ dev_kfree_skb_any(skb); ++ break; ++ default: ++ ath11k_warn(ab, "unknown packet type received in mesh link vdev %d", ++ wifi_metadata->pkt_type); ++ dev_kfree_skb_any(skb); ++ break; + } +- +- ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); + } + + int ath11k_nss_tx(struct ath11k_vif *arvif, struct sk_buff *skb) +@@ -923,8 +2022,9 @@ int ath11k_nss_tx(struct ath11k_vif *arv + nss_tx_status_t status; + int encap_type = ath11k_dp_tx_get_encap_type(arvif, skb); + struct ath11k_soc_dp_stats *soc_stats = &ar->ab->soc_stats; ++ char dump_msg[100] = {0}; + +- if(encap_type != arvif->nss.encap) { ++ if (!arvif->ar->ab->nss.debug_mode && encap_type != arvif->nss.encap) { + ath11k_warn(ar->ab, "encap mismatch in nss tx skb encap type %d" \ + "vif encap type %d\n", encap_type, arvif->nss.encap); + goto drop; +@@ -939,16 +2039,41 @@ int ath11k_nss_tx(struct ath11k_vif *arv + ath11k_nss_tx_encap_nwifi(skb); + + send: +- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, +- arvif->vif->type == NL80211_IFTYPE_AP_VLAN ? "ext vdev" : "", +- "nss tx msdu: ", skb->data, skb->len); +- +- if (arvif->vif->type == NL80211_IFTYPE_AP_VLAN) ++ if (arvif->vif->type == NL80211_IFTYPE_AP_VLAN) { ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, "ext vdev", ++ "nss tx msdu: ", skb->data, skb->len); + status = nss_wifi_ext_vdev_tx_buf(arvif->nss.ctx, skb, + arvif->nss.if_num); +- else +- status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, +- arvif->nss.if_num); ++ } else { ++ if (arvif->ar->ab->nss.debug_mode) { ++ if (encap_type == HAL_TCL_ENCAP_TYPE_ETHERNET && ++ !is_multicast_ether_addr(skb->data)) { ++ snprintf(dump_msg, sizeof(dump_msg), ++ "nss tx ucast msdu: %d ", ++ arvif->nss.mesh_handle); ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, "mesh", ++ dump_msg, skb->data, skb->len); ++ status = nss_wifi_meshmgr_tx_buf(arvif->nss.mesh_handle, ++ skb); ++ } else { ++ snprintf(dump_msg, sizeof(dump_msg), ++ "nss tx mcast msdu: %d ", ++ arvif->nss.if_num); ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, "mesh", ++ dump_msg, skb->data, skb->len); ++ status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, ++ arvif->nss.if_num); ++ } ++ } else { ++ snprintf(dump_msg, sizeof(dump_msg), ++ "nss tx msdu: %d ", ++ arvif->nss.if_num); ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_TX, "", ++ dump_msg, skb->data, skb->len); ++ status = nss_wifi_vdev_tx_buf(arvif->ar->nss.ctx, skb, ++ arvif->nss.if_num); ++ } ++ } + + if (status != NSS_TX_SUCCESS) { + ath11k_dbg(ar->ab, (ATH11K_DBG_NSS | ATH11K_DBG_DP_TX), +@@ -1035,6 +2160,9 @@ static int ath11k_nss_vdev_configure(str + + vdev_cfg = &vdev_msg->msg.vdev_config; + ++ if (arvif->vif->type == NL80211_IFTYPE_MESH_POINT) ++ vdev_cfg->vap_ext_mode = WIFI_VDEV_EXT_MODE_MESH_LINK; ++ + vdev_cfg->radio_ifnum = ar->nss.if_num; + vdev_cfg->vdev_id = arvif->vdev_id; + +@@ -1075,6 +2203,37 @@ free: + return ret; + } + ++static int ath11k_nss_mesh_obj_assoc_link_vap(struct ath11k_vif *arvif) ++{ ++ struct nss_wifi_mesh_assoc_link_vap *msg; ++ struct ath11k_base *ab = arvif->ar->ab; ++ nss_tx_status_t status; ++ int ret; ++ ++ msg = kzalloc(sizeof(struct nss_wifi_mesh_assoc_link_vap), GFP_ATOMIC); ++ if (!msg) ++ return -ENOMEM; ++ ++ msg->link_vap_id = arvif->nss.if_num; ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, "nss mesh assoc link vap %d, mesh handle %d\n", ++ arvif->nss.if_num, arvif->nss.mesh_handle); ++ ++ status = nss_wifi_meshmgr_assoc_link_vap_sync(arvif->nss.mesh_handle, msg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ab, "failed mesh obj vdev tx msg for assoc link vap nss_err:%d\n", ++ status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ret = 0; ++free: ++ kfree(msg); ++ ++ return ret; ++} ++ + static void ath11k_nss_vdev_unregister(struct ath11k_vif *arvif) + { + struct ath11k_base *ab = arvif->ar->ab; +@@ -1086,6 +2245,12 @@ static void ath11k_nss_vdev_unregister(s + ath11k_dbg(ab, ATH11K_DBG_NSS, "unregistered nss vdev %d \n", + arvif->nss.if_num); + break; ++ case NL80211_IFTYPE_MESH_POINT: ++ nss_unregister_wifi_vdev_if(arvif->nss.if_num); ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "unregistered nss mesh vdevs mesh link %d\n", ++ arvif->nss.if_num); ++ break; + default: + ath11k_warn(ab, "unsupported interface type %d for nss vdev unregister\n", + arvif->vif->type); +@@ -1093,6 +2258,76 @@ static void ath11k_nss_vdev_unregister(s + } + } + ++static int ath11k_nss_mesh_alloc_register(struct ath11k_vif *arvif, ++ struct net_device *netdev) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct nss_wifi_mesh_config_msg *nss_msg; ++ struct arvif_nss *nss = &arvif->nss; ++ int ret = 0; ++ ++ nss->mesh_ttl = ATH11K_MESH_DEFAULT_ELEMENT_TTL; ++ nss->mpath_refresh_time = 1000; /* msecs */ ++ nss->mesh_forward_enabled = true; ++ ++ nss_msg = kzalloc(sizeof(*nss_msg), GFP_KERNEL); ++ if (!nss_msg) ++ return -ENOMEM; ++ ++ nss_msg->ttl = nss->mesh_ttl; ++ nss_msg->mesh_path_refresh_time = nss->mpath_refresh_time; ++ nss_msg->mpp_learning_mode = mpp_mode; ++ nss_msg->block_mesh_forwarding = 0; ++ ether_addr_copy(nss_msg->local_mac_addr, arvif->vif->addr); ++ nss_msg->config_flags = ++ NSS_WIFI_MESH_CONFIG_FLAG_TTL_VALID | ++ NSS_WIFI_MESH_CONFIG_FLAG_MPATH_REFRESH_VALID | ++ NSS_WIFI_MESH_CONFIG_FLAG_MPP_LEARNING_MODE_VALID | ++ NSS_WIFI_MESH_CONFIG_FLAG_BLOCK_MESH_FWD_VALID | ++ NSS_WIFI_MESH_CONFIG_FLAG_LOCAL_MAC_VALID; ++ ++ arvif->nss.mesh_handle = nss_wifi_meshmgr_if_create_sync(netdev, nss_msg, ++ ath11k_nss_mesh_obj_vdev_data_receive, ++ ath11k_nss_mesh_obj_ext_data_callback, ++ ath11k_nss_mesh_obj_vdev_event_receive); ++ if (arvif->nss.mesh_handle == NSS_WIFI_MESH_HANDLE_INVALID) { ++ ath11k_warn(ab, "failed to create meshmgr\n"); ++ ret = -EINVAL; ++ } ++ ++ kfree(nss_msg); ++ ++ return ret; ++} ++ ++static int ath11k_nss_mesh_vdev_register(struct ath11k_vif *arvif, ++ struct net_device *netdev) ++{ ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_base *ab = ar->ab; ++ nss_tx_status_t status; ++ u32 features = 0; ++ ++ status = nss_register_wifi_vdev_if(ar->nss.ctx, ++ arvif->nss.if_num, ++ ath11k_nss_mesh_link_vdev_data_receive, ++ ath11k_nss_mesh_link_vdev_special_data_receive, ++ ath11k_nss_vdev_event_receive, ++ (struct net_device *)netdev->ieee80211_ptr, ++ features); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ab, "failed to register nss mesh link vdev if_num %d nss_err:%d\n", ++ arvif->nss.if_num, status); ++ nss_unregister_wifi_vdev_if(arvif->nss.if_num); ++ return -EINVAL; ++ } ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "registered nss mesh link vdev if_num %d\n", ++ arvif->nss.if_num); ++ ++ return 0; ++} ++ + static int ath11k_nss_vdev_register(struct ath11k_vif *arvif, + struct net_device *netdev) + { +@@ -1120,6 +2355,13 @@ static int ath11k_nss_vdev_register(stru + arvif->nss.if_num); + + break; ++ case NL80211_IFTYPE_MESH_POINT: ++ if (!ab->nss.mesh_nss_offload_enabled) ++ return -ENOTSUPP; ++ ++ if (ath11k_nss_mesh_vdev_register(arvif, netdev)) ++ return -EINVAL; ++ break; + default: + ath11k_warn(ab, "unsupported interface type %d for nss vdev register\n", + arvif->vif->type); +@@ -1129,6 +2371,60 @@ static int ath11k_nss_vdev_register(stru + return 0; + } + ++static void ath11k_nss_mesh_vdev_free(struct ath11k_vif *arvif) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_nss_mpath_entry *mpath_entry, *mpath_tmp; ++ struct ath11k_nss_mpp_entry *mpp_entry, *mpp_tmp; ++ struct arvif_nss *nss = &arvif->nss, *nss_entry, *nss_tmp; ++ LIST_HEAD(mpath_local_entry); ++ LIST_HEAD(mpp_local_entry); ++ nss_tx_status_t status; ++ ++ del_timer_sync(&nss->mpp_expiry_timer); ++ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpath_dump, &mpath_local_entry); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(mpath_entry, mpath_tmp, &mpath_local_entry, list) { ++ list_del(&mpath_entry->list); ++ kfree(mpath_entry); ++ } ++ ++ spin_lock_bh(&ar->nss.dump_lock); ++ list_splice_tail_init(&nss->mpp_dump, &mpp_local_entry); ++ spin_unlock_bh(&ar->nss.dump_lock); ++ ++ list_for_each_entry_safe(mpp_entry, mpp_tmp, &mpp_local_entry, list) { ++ list_del(&mpp_entry->list); ++ kfree(mpp_entry); ++ } ++ ++ list_for_each_entry_safe(nss_entry, nss_tmp, &mesh_vaps, list) ++ list_del(&nss_entry->list); ++ ++ status = nss_dynamic_interface_dealloc_node( ++ arvif->nss.if_num, ++ NSS_DYNAMIC_INTERFACE_TYPE_VAP); ++ if (status != NSS_TX_SUCCESS) ++ ath11k_warn(ab, "failed to free nss mesh link vdev nss_err:%d\n", ++ status); ++ else ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "nss mesh link vdev interface deallocated\n"); ++ ++ status = nss_wifi_meshmgr_if_destroy_sync(arvif->nss.mesh_handle); ++ ++ if (status != NSS_TX_SUCCESS) ++ ath11k_warn(ab, "failed to free nss mesh object vdev nss_err:%d\n", ++ status); ++ else ++ ath11k_dbg(ab, ATH11K_DBG_NSS, ++ "nss mesh object vdev interface deallocated\n"); ++} ++ + void ath11k_nss_vdev_free(struct ath11k_vif *arvif) + { + struct ath11k_base *ab = arvif->ar->ab; +@@ -1148,6 +2444,9 @@ void ath11k_nss_vdev_free(struct ath11k_ + "nss vdev interface deallocated\n"); + + return; ++ case NL80211_IFTYPE_MESH_POINT: ++ ath11k_nss_mesh_vdev_free(arvif); ++ return; + default: + ath11k_warn(ab, "unsupported interface type %d for nss vdev dealloc\n", + arvif->vif->type); +@@ -1155,11 +2454,92 @@ void ath11k_nss_vdev_free(struct ath11k_ + } + } + +-static int ath11k_nss_vdev_alloc(struct ath11k_vif *arvif) ++struct arvif_nss *ath11k_nss_find_arvif_by_if_num(int if_num) ++{ ++ struct arvif_nss *nss; ++ ++ list_for_each_entry(nss, &mesh_vaps, list) { ++ if (if_num == nss->if_num) ++ return nss; ++ } ++ return NULL; ++} ++ ++int ath11k_nss_assoc_link_arvif_to_ifnum(struct ath11k_vif *arvif, int if_num) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ struct ath11k_vif *arvif_link; ++ struct wireless_dev *wdev; ++ struct arvif_nss *nss; ++ int ret; ++ ++ wdev = ieee80211_vif_to_wdev_relaxed(arvif->vif); ++ if (!wdev) { ++ ath11k_warn(ab, "ath11k_nss: wdev is null\n"); ++ return -EINVAL; ++ } ++ ++ if (!wdev->netdev) { ++ ath11k_warn(ab, "ath11k_nss: netdev is null\n"); ++ return -EINVAL; ++ } ++ ++ nss = ath11k_nss_find_arvif_by_if_num(if_num); ++ if (!nss) { ++ ath11k_warn(ab, "ath11k_nss: unable to find if_num %d\n",if_num); ++ return -EINVAL; ++ } ++ ++ arvif_link = container_of(nss, struct ath11k_vif, nss); ++ ++ ath11k_dbg(ab, ATH11K_DBG_NSS_MESH, ++ "assoc link vap ifnum %d to mesh handle of link id %d\n", ++ arvif_link->nss.if_num, arvif->nss.if_num); ++ ++ arvif_link->nss.mesh_handle = arvif->nss.mesh_handle; ++ ++ ret = ath11k_nss_mesh_obj_assoc_link_vap(arvif_link); ++ if (ret) ++ ath11k_warn(ab, "failed to associate link vap to mesh vap %d\n", ret); ++ ++ return 0; ++} ++ ++static int ath11k_nss_mesh_vdev_alloc(struct ath11k_vif *arvif, ++ struct net_device *netdev) ++{ ++ struct ath11k_base *ab = arvif->ar->ab; ++ int if_num; ++ ++ if (!ab->nss.mesh_nss_offload_enabled) ++ return -ENOTSUPP; ++ ++ if_num = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_VAP); ++ if (if_num < 0) { ++ ath11k_warn(ab, "failed to allocate nss mesh link vdev\n"); ++ return -EINVAL; ++ } ++ ++ arvif->nss.if_num = if_num; ++ ++ INIT_LIST_HEAD(&arvif->nss.list); ++ list_add_tail(&arvif->nss.list, &mesh_vaps); ++ ++ INIT_LIST_HEAD(&arvif->nss.mpath_dump); ++ init_completion(&arvif->nss.dump_mpath_complete); ++ INIT_LIST_HEAD(&arvif->nss.mpp_dump); ++ init_completion(&arvif->nss.dump_mpp_complete); ++ ++ return 0; ++} ++ ++static int ath11k_nss_vdev_alloc(struct ath11k_vif *arvif, ++ struct net_device *netdev) + { + struct ath11k_base *ab = arvif->ar->ab; + enum nss_dynamic_interface_type if_type; + int if_num; ++ int ret; + + /* Initialize completion for verifying NSS message response */ + init_completion(&arvif->nss.complete); +@@ -1181,6 +2561,14 @@ static int ath11k_nss_vdev_alloc(struct + arvif->nss.if_num); + + break; ++ case NL80211_IFTYPE_MESH_POINT: ++ ret = ath11k_nss_mesh_vdev_alloc(arvif, netdev); ++ if (ret) { ++ ath11k_warn(ab, "failed to allocate nss vdev of mesh type %d\n", ++ ret); ++ return ret; ++ } ++ break; + default: + ath11k_warn(ab, "unsupported interface type %d for nss vdev alloc\n", + arvif->vif->type); +@@ -1218,7 +2606,7 @@ int ath11k_nss_vdev_create(struct ath11k + return -EINVAL; + } + +- ret = ath11k_nss_vdev_alloc(arvif); ++ ret = ath11k_nss_vdev_alloc(arvif, wdev->netdev); + if (ret) + return ret; + +@@ -1234,6 +2622,43 @@ int ath11k_nss_vdev_create(struct ath11k + goto unregister_vdev; + + break; ++ case NL80211_IFTYPE_MESH_POINT: ++ ret = ath11k_nss_mesh_alloc_register(arvif, wdev->netdev); ++ if (ret) { ++ ath11k_warn(ab, "failed to alloc and register mesh vap %d\n", ret); ++ goto unregister_vdev; ++ } ++ ++ ret = ath11k_nss_vdev_configure(arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to configure nss mesh link vdev\n"); ++ goto unregister_vdev; ++ } ++ ++ ret = ath11k_nss_mesh_obj_assoc_link_vap(arvif); ++ if (ret) { ++ ath11k_warn(ab, "failed to associate link vap to mesh vap %d\n", ret); ++ goto unregister_vdev; ++ } ++ ++ ret = ath11k_nss_vdev_set_cmd(arvif, ++ NSS_WIFI_VDEV_CFG_MCBC_EXC_TO_HOST_CMD, 1); ++ if (ret) { ++ ath11k_warn(ab, "failed to enable mcast/bcast exception %d\n", ret); ++ goto unregister_vdev; ++ } ++ ++ ath11k_debugfs_nss_mesh_vap_create(arvif); ++ ++ /* This timer cb is called at specified ++ * interval to update mpp exp timeout */ ++ timer_setup(&arvif->nss.mpp_expiry_timer, ++ ath11k_nss_mpp_timer_cb, 0); ++ ++ /* Start the initial timer in 2 secs */ ++ mod_timer(&arvif->nss.mpp_expiry_timer, ++ jiffies + msecs_to_jiffies(2 * HZ)); ++ break; + default: + ret = -ENOTSUPP; + goto unregister_vdev; +@@ -1290,6 +2715,14 @@ int ath11k_nss_vdev_up(struct ath11k_vif + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) + return 0; + ++ if (arvif->vif->type == NL80211_IFTYPE_MESH_POINT) { ++ status = nss_wifi_meshmgr_if_up(arvif->nss.mesh_handle); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss mesh vdev up error %d\n", status); ++ return -EINVAL; ++ } ++ } ++ + vdev_msg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_ATOMIC); + if (!vdev_msg) + return -ENOMEM; +@@ -1342,6 +2775,14 @@ int ath11k_nss_vdev_down(struct ath11k_v + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) + return 0; + ++ if (arvif->vif->type == NL80211_IFTYPE_MESH_POINT) { ++ status = nss_wifi_meshmgr_if_down(arvif->nss.mesh_handle); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ar->ab, "nss mesh vdev up error %d\n", status); ++ return -EINVAL; ++ } ++ } ++ + vdev_msg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_ATOMIC); + if (!vdev_msg) + return -ENOMEM; +@@ -2722,6 +4163,49 @@ static int ath11k_nss_get_dynamic_interf + } + } + ++static int ath11k_nss_mesh_capability(struct ath11k_base *ab) ++{ ++ struct nss_wifili_msg *wlmsg = NULL; ++ nss_wifili_msg_callback_t msg_cb; ++ nss_tx_status_t status; ++ int ret = 0; ++ ++ wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); ++ if (!wlmsg) ++ return -ENOMEM; ++ ++ msg_cb = (nss_wifili_msg_callback_t)ath11k_nss_wifili_event_receive; ++ ++ reinit_completion(&ab->nss.complete); ++ ++ nss_cmn_msg_init(&wlmsg->cm, ab->nss.if_num, ++ NSS_WIFILI_SEND_MESH_CAPABILITY_INFO, ++ sizeof(struct nss_wifili_mesh_capability_info), ++ msg_cb, NULL); ++ ++ status = nss_wifili_tx_msg(ab->nss.ctx, wlmsg); ++ if (status != NSS_TX_SUCCESS) { ++ ath11k_warn(ab, "nss failed to get mesh capability msg %d\n", status); ++ ret = -EINVAL; ++ goto free; ++ } ++ ++ ret = wait_for_completion_timeout(&ab->nss.complete, ++ msecs_to_jiffies(ATH11K_NSS_MSG_TIMEOUT_MS)); ++ if (!ret) { ++ ath11k_warn(ab, "timeout while waiting for mesh capability check\n"); ++ ret = -ETIMEDOUT; ++ goto free; ++ } ++ ++ kfree(wlmsg); ++ return 0; ++ ++free: ++ kfree(wlmsg); ++ return ret; ++} ++ + static int ath11k_nss_init(struct ath11k_base *ab) + { + struct nss_wifili_init_msg *wim = NULL; +@@ -2855,6 +4339,15 @@ static int ath11k_nss_init(struct ath11k + + kfree(wlmsg); + ++ /* Create a mesh links read debugfs entry */ ++ ath11k_debugfs_nss_soc_create(ab); ++ ++ /* Check for mesh capability */ ++ ret = ath11k_nss_mesh_capability(ab); ++ ++ if (ret) ++ ath11k_err(ab, "Mesh offload is not enabled %d\n", ret); ++ + ath11k_dbg(ab, ATH11K_DBG_NSS, "NSS Init Message TX Success %p %d\n", + ab->nss.ctx, ab->nss.if_num); + return 0; +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -8,6 +8,8 @@ + + #include + #include ++#include ++#include "../../../../../net/mac80211/mesh.h" + + struct ath11k; + struct ath11k_base; +@@ -19,8 +21,9 @@ struct hal_rx_mon_ppdu_info; + + /* NSS DBG macro is not included as part of debug enum to avoid + * frequent changes during upgrade*/ +-#define ATH11K_DBG_NSS 0x40000000 +-#define ATH11K_DBG_NSS_WDS 0x80000000 ++#define ATH11K_DBG_NSS 0x20000000 ++#define ATH11K_DBG_NSS_WDS 0x40000000 ++#define ATH11K_DBG_NSS_MESH 0x80000000 + + /* WIFILI Supported Target Types */ + #define ATH11K_WIFILI_TARGET_TYPE_UNKNOWN 0xFF +@@ -57,6 +60,7 @@ struct hal_rx_mon_ppdu_info; + /* Timeout for waiting for response from NSS on TX msg */ + #define ATH11K_NSS_MSG_TIMEOUT_MS 5000 + ++#define ATH11K_MESH_DEFAULT_ELEMENT_TTL 31 + /* Init Flags */ + #define WIFILI_NSS_CCE_DISABLED 0x1 + #define WIFILI_ADDTL_MEM_SEG_SET 0x000000002 +@@ -100,6 +104,8 @@ do { \ + u64_stats_update_end(&tstats->syncp); \ + } while (0) + ++#define ATH11K_MPP_EXPIRY_TIMER_INTERVAL_MS 60 * HZ ++ + enum ath11k_nss_opmode { + ATH11K_NSS_OPMODE_UNKNOWN, + ATH11K_NSS_OPMODE_AP, +@@ -146,10 +152,24 @@ struct ath11k_nss_peer { + struct completion complete; + }; + ++struct ath11k_nss_mpath_entry { ++ struct list_head list; ++ u32 num_entries; ++ struct nss_wifi_mesh_path_dump_entry mpath[0]; ++}; ++ ++struct ath11k_nss_mpp_entry { ++ struct list_head list; ++ u32 num_entries; ++ struct nss_wifi_mesh_proxy_path_dump_entry mpp[0]; ++}; ++ + /* Structure to hold the vif related info for nss offload support */ + struct arvif_nss { + /* dynamic ifnum allocated by nss driver for vif */ + int if_num; ++ /* mesh handle for mesh obj vap */ ++ nss_wifi_mesh_handle_t mesh_handle; + /* Used for completion status for vdev config nss messages */ + struct completion complete; + /* Keep the copy of encap type for nss */ +@@ -169,6 +189,25 @@ struct arvif_nss { + /* WDS cfg should be done only once for ext vdev */ + bool wds_cfg_done; + bool created; ++ ++ bool mpp_aging; ++ bool mpp_dump_req; ++ struct timer_list mpp_expiry_timer; ++ u8 mesh_ttl; ++ bool mesh_forward_enabled; ++ u32 metadata_type; ++ u32 mpath_refresh_time; ++ ++ struct list_head list; ++ struct list_head mpath_dump; ++ /* total number of mpath entries in all of the mpath_dump list */ ++ u32 mpath_dump_num_entries; ++ struct completion dump_mpath_complete; ++ ++ struct list_head mpp_dump; ++ /* total number of mpp entries in all of the mpp_dump list */ ++ u32 mpp_dump_num_entries; ++ struct completion dump_mpp_complete; + }; + + /* Structure to hold the pdev/radio related info for nss offload support */ +@@ -177,6 +216,8 @@ struct ath11k_nss { + int if_num; + /* Radio/pdev Context obtained on pdev register */ + void* ctx; ++ /* protects stats from nss */ ++ spinlock_t dump_lock; + }; + + /* Structure to hold the soc related info for nss offload support */ +@@ -185,11 +226,15 @@ struct ath11k_soc_nss { + bool enabled; + /* turn on/off nss stats support in ath11k */ + bool stats_enabled; ++ /* Mesh offload support as advertised by nss */ ++ bool mesh_nss_offload_enabled; + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + /* soc nss ctx */ + void* ctx; + /* if_num to be used for soc related nss messages */ + int if_num; ++ /* debug mode to disable the regular mesh configuration from mac80211 */ ++ bool debug_mode; + /* Completion to nss message response */ + struct completion complete; + /* Response to nss messages are stored here on msg callback +@@ -245,6 +290,19 @@ void ath11k_nss_update_sta_rxrate(struct + int ath11k_nss_setup(struct ath11k_base *ab); + int ath11k_nss_teardown(struct ath11k_base *ab); + void ath11k_nss_ext_rx_stats(struct ath11k_base *ab, struct htt_rx_ring_tlv_filter *tlv_filter); ++int ath11k_nss_dump_mpath_request(struct ath11k_vif *arvif); ++int ath11k_nss_dump_mpp_request(struct ath11k_vif *arvif); ++#ifdef CPTCFG_MAC80211_MESH ++int ath11k_nss_mesh_config_path(struct ath11k *ar, struct ath11k_vif *arvif, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path); ++#endif ++int ath11k_nss_mesh_config_update(struct ieee80211_vif *vif, int changed); ++int ath11k_nss_assoc_link_arvif_to_ifnum(struct ath11k_vif *arvif, int if_num); ++int ath11k_nss_mesh_exception_flags(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_exception_flag_msg *nss_msg); ++int ath11k_nss_exc_rate_config(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_rate_limit_config *nss_exc_cfg); + #else + static inline int ath11k_nss_tx(struct ath11k_vif *arvif, struct sk_buff *skb) + { +@@ -407,5 +465,35 @@ void ath11k_nss_ext_rx_stats(struct ath1 + { + return; + } ++ ++#ifdef CPTCFG_MAC80211_MESH ++static inline int ++ath11k_nss_mesh_config_path(struct ath11k *ar, struct ath11k_vif *arvif, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ return 0; ++} ++#endif ++static inline int ++ath11k_nss_mesh_config_update(struct ieee80211_vif *vif, int changed) ++{ ++ return 0; ++} ++static int ath11k_nss_assoc_link_arvif_to_ifnum(struct ath11k_vif *arvif, ++ int if_num) ++{ ++ return 0; ++} ++static int ath11k_nss_mesh_exception_flags(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_exception_flag_msg *nss_msg) ++{ ++ return 0; ++} ++int ath11k_nss_exc_rate_config(struct ath11k_vif *arvif, ++ struct nss_wifi_mesh_rate_limit_config *nss_exc_cfg) ++{ ++ return 0; ++} + #endif /* CPTCFG_ATH11K_NSS_SUPPORT */ + #endif +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -127,6 +127,9 @@ + + struct device; + ++struct ieee80211_mesh_path_offld; ++enum ieee80211_mesh_path_offld_cmd; ++ + /** + * enum ieee80211_max_queues - maximum number of queues + * +@@ -366,11 +369,17 @@ enum ieee80211_bss_change { + * to indicate which NSS BSS parameter changed. + * + * @BSS_CHANGED_NSS_AP_ISOLATE: AP Isolate feature in NSS mode ++ * @BSS_CHANGED_NSS_MESH_TTL: TTL update in NSS mesh mode ++ * @BSS_CHANGED_NSS_MESH_REFRESH_TIME: Mesh refresh time in NSS mesh mode ++ * @BSS_CHANGED_NSS_MESH_FWD_ENABLED: NSS offload mesh forward enabled + * + */ + + enum ieee80211_nss_bss_change { + BSS_CHANGED_NSS_AP_ISOLATE = BIT(0), ++ BSS_CHANGED_NSS_MESH_TTL = BIT(1), ++ BSS_CHANGED_NSS_MESH_REFRESH_TIME = BIT(2), ++ BSS_CHANGED_NSS_MESH_FWD_ENABLED = BIT(3), + }; + + /* +@@ -721,6 +730,11 @@ struct ieee80211_bss_conf { + bool nss_ap_isolate; + struct ieee80211_multiple_bssid multiple_bssid; + enum nl80211_beacon_tx_mode beacon_tx_mode; ++ ++ /* Mesh configuration for nss offload */ ++ u8 nss_offld_ttl; ++ bool nss_offld_mesh_forward_enabled; ++ u32 nss_offld_mpath_refresh_time; + }; + + /** +@@ -1150,6 +1164,8 @@ ieee80211_info_get_tx_time_est(struct ie + * @skb: Packet skb (can be NULL if not provided by the driver) + * @rate: The TX rate that was used when sending the packet + * @free_list: list where processed skbs are stored to be free'd by the driver ++ * @mpdu_succ: Number of mpdus successfully transmitted ++ * @mpdu_fail: Number of mpdus failed + */ + struct ieee80211_tx_status { + struct ieee80211_sta *sta; +@@ -1161,6 +1177,8 @@ struct ieee80211_tx_status { + #else + struct sk_buff_head *free_list; + #endif ++ u32 mpdu_succ; ++ u32 mpdu_fail; + }; + + /** +@@ -1661,12 +1679,14 @@ struct ieee80211_channel_switch { + * @IEEE80211_VIF_GET_NOA_UPDATE: request to handle NOA attributes + * and send P2P_PS notification to the driver if NOA changed, even + * this is not pure P2P vif. ++ * @IEEE80211_HW_NSS_OFFLOAD_DEBUG_MODE: It enables the debug mode of nss offload. + */ + enum ieee80211_vif_flags { + IEEE80211_VIF_BEACON_FILTER = BIT(0), + IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), + IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), + IEEE80211_VIF_GET_NOA_UPDATE = BIT(3), ++ IEEE80211_VIF_NSS_OFFLOAD_DEBUG_MODE = BIT(4), + }; + + +@@ -2529,6 +2549,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP, + IEEE80211_HW_SUPPORTS_NSS_OFFLOAD, + IEEE80211_HW_SUPPORTS_MULTI_BSSID_AP, ++ IEEE80211_HW_SUPPORTS_MESH_NSS_OFFLOAD, + + /* keep last, obviously */ + NUM_IEEE80211_HW_FLAGS +@@ -3974,6 +3995,8 @@ enum ieee80211_reconfig_type { + * @set_sar_specs: Update the SAR (TX power) settings. + * @sta_set_decap_offload: Called to notify the driver when a station is allowed + * to use rx decapsulation offload ++ * @config_mesh_offload_path: Configure mesh path table when driver supports mesh offload. ++ * This calback must be atomic. + */ + struct ieee80211_ops { + void (*tx)(struct ieee80211_hw *hw, +@@ -4297,6 +4320,12 @@ struct ieee80211_ops { + void (*sta_set_decap_offload)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, bool enabled); ++#ifdef CPTCFG_MAC80211_MESH ++ void (*config_mesh_offload_path)(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path); ++#endif + }; + + /** +@@ -6989,4 +7018,100 @@ void + ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif, + u64 color_bitmap); + ++/* Defines for Mesh NSS offload */ ++ ++enum ieee80211_mesh_path_offld_cmd { ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPATH, ++ IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPATH, ++ IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPATH, ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPP, ++ IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPP, ++ IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPP, ++}; ++ ++enum ieee80211_mesh_path_offld_action { ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_REFRESH = BIT(0), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_DEL = BIT(1), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_EXP = BIT(2), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_LEARN = BIT(3), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_ADD = BIT(4), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_UPDATE = BIT(5), ++ IEEE80211_MESH_PATH_OFFLD_ACTION_PATH_NOT_FOUND = BIT(6), ++}; ++ ++/* Duplicate defines to make it available to driver */ ++enum ieee80211_mesh_path_flags { ++ IEEE80211_MESH_PATH_ACTIVE = BIT(0), ++ IEEE80211_MESH_PATH_RESOLVING = BIT(1), ++ IEEE80211_MESH_PATH_SN_VALID = BIT(2), ++ IEEE80211_MESH_PATH_FIXED = BIT(3), ++ IEEE80211_MESH_PATH_RESOLVED = BIT(4), ++ IEEE80211_MESH_PATH_REQ_QUEUED = BIT(5), ++ IEEE80211_MESH_PATH_DELETED = BIT(6), ++}; ++ ++struct ieee80211_mesh_path_offld { ++ u8 mesh_da[ETH_ALEN]; ++ u8 da[ETH_ALEN]; ++ u8 next_hop[ETH_ALEN]; ++ u8 old_next_hop[ETH_ALEN]; ++ u8 ta[ETH_ALEN]; ++ u32 metric; ++ unsigned long exp_time; ++ u8 hop_count; ++ u16 flags; /* See &enum ieee80211_mesh_path_flags */ ++ u8 mesh_gate; ++ u8 block_mesh_fwd; ++ u8 metadata_type; ++}; ++ ++#ifdef CPTCFG_MAC80211_MESH ++/** ieee80211_mesh_path_offld_change_notify - Notify mesh path change event. ++ * @vif: Mesh interface on which the event is being reported. ++ * @path: Mesh path which got changed. Please note not all the entries in the ++ * path will have valid information. Based on the action code, it will be ++ * processed. ++ * @action: Type of the event. ++ */ ++int ieee80211_mesh_path_offld_change_notify(struct ieee80211_vif *vif, ++ struct ieee80211_mesh_path_offld *path, ++ enum ieee80211_mesh_path_offld_action action); ++ ++/** ieee80211s_update_metric_ppdu - Upate tx PPDU stats for 11s metric computation ++ * ++ * @hw: the hardware the frame was transmitted by ++ * @st: tx status information ++*/ ++void ieee80211s_update_metric_ppdu(struct ieee80211_hw *hw, ++ struct ieee80211_tx_status *st); ++ ++/** mesh_nss_offld_proxy_path_exp_update - update the expiry time from nss ++ * @vif Mesh interface on which the event is being reported. ++ * @mac: dest_mac_addr of the mesh proxy path ++ * @time_diff: This is the time diff since the mesh peer is active ++ */ ++void mesh_nss_offld_proxy_path_exp_update(struct ieee80211_vif *vif, u8* da, ++ u8* mesh_da, u32 time_diff); ++#else ++static inline int ++ieee80211_mesh_path_offld_change_notify(struct ieee80211_vif *vif, ++ struct ieee80211_mesh_path_offld *path, ++ enum ieee80211_mesh_path_offld_action action) ++{ ++ return 0; ++} ++ ++static inline void ++ieee80211s_update_metric_ppdu(struct ieee80211_hw *hw, ++ struct ieee80211_tx_status *st) ++{ ++} ++ ++static inline void ++mesh_nss_offld_proxy_path_exp_update(struct ieee80211_vif *vif, u8* da, ++ u8* mesh_da, u32 time_diff) ++{ ++} ++#endif ++ + #endif /* MAC80211_H */ +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2289,6 +2289,7 @@ static int ieee80211_update_mesh_config( + struct mesh_config *conf; + struct ieee80211_sub_if_data *sdata; + struct ieee80211_if_mesh *ifmsh; ++ u32 nss_changed = 0; + + sdata = IEEE80211_DEV_TO_SUB_IF(dev); + ifmsh = &sdata->u.mesh; +@@ -2305,8 +2306,11 @@ static int ieee80211_update_mesh_config( + conf->dot11MeshMaxPeerLinks = nconf->dot11MeshMaxPeerLinks; + if (_chg_mesh_attr(NL80211_MESHCONF_MAX_RETRIES, mask)) + conf->dot11MeshMaxRetries = nconf->dot11MeshMaxRetries; +- if (_chg_mesh_attr(NL80211_MESHCONF_TTL, mask)) ++ if (_chg_mesh_attr(NL80211_MESHCONF_TTL, mask)) { + conf->dot11MeshTTL = nconf->dot11MeshTTL; ++ sdata->vif.bss_conf.nss_offld_ttl = nconf->dot11MeshTTL; ++ nss_changed |= BSS_CHANGED_NSS_MESH_TTL; ++ } + if (_chg_mesh_attr(NL80211_MESHCONF_ELEMENT_TTL, mask)) + conf->element_ttl = nconf->element_ttl; + if (_chg_mesh_attr(NL80211_MESHCONF_AUTO_OPEN_PLINKS, mask)) { +@@ -2320,8 +2324,12 @@ static int ieee80211_update_mesh_config( + if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, mask)) + conf->dot11MeshHWMPmaxPREQretries = + nconf->dot11MeshHWMPmaxPREQretries; +- if (_chg_mesh_attr(NL80211_MESHCONF_PATH_REFRESH_TIME, mask)) ++ if (_chg_mesh_attr(NL80211_MESHCONF_PATH_REFRESH_TIME, mask)) { + conf->path_refresh_time = nconf->path_refresh_time; ++ sdata->vif.bss_conf.nss_offld_mpath_refresh_time = ++ nconf->path_refresh_time; ++ nss_changed |= BSS_CHANGED_NSS_MESH_REFRESH_TIME; ++ } + if (_chg_mesh_attr(NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, mask)) + conf->min_discovery_timeout = nconf->min_discovery_timeout; + if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, mask)) +@@ -2356,8 +2364,12 @@ static int ieee80211_update_mesh_config( + if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) + conf->dot11MeshHWMPRannInterval = + nconf->dot11MeshHWMPRannInterval; +- if (_chg_mesh_attr(NL80211_MESHCONF_FORWARDING, mask)) ++ if (_chg_mesh_attr(NL80211_MESHCONF_FORWARDING, mask)) { + conf->dot11MeshForwarding = nconf->dot11MeshForwarding; ++ sdata->vif.bss_conf.nss_offld_mesh_forward_enabled = ++ nconf->dot11MeshForwarding; ++ nss_changed |= BSS_CHANGED_NSS_MESH_FWD_ENABLED; ++ } + if (_chg_mesh_attr(NL80211_MESHCONF_RSSI_THRESHOLD, mask)) { + /* our RSSI threshold implementation is supported only for + * devices that report signal in dBm. +@@ -2398,6 +2410,7 @@ static int ieee80211_update_mesh_config( + conf->dot11MeshConnectedToAuthServer = + nconf->dot11MeshConnectedToAuthServer; + ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON); ++ ieee80211_nss_bss_info_change_notify(sdata, nss_changed); + return 0; + } + +--- a/net/mac80211/debug.h ++++ b/net/mac80211/debug.h +@@ -63,6 +63,12 @@ + #define MAC80211_MESH_PS_DEBUG 0 + #endif + ++#ifdef CPTCFG_MAC80211_MESH_OFFLOAD_DEBUG ++#define MAC80211_MESH_OFFLOAD_DEBUG 1 ++#else ++#define MAC80211_MESH_OFFLOAD_DEBUG 0 ++#endif ++ + #ifdef CPTCFG_MAC80211_TDLS_DEBUG + #define MAC80211_TDLS_DEBUG 1 + #else +@@ -182,6 +188,10 @@ do { \ + _sdata_dbg(MAC80211_MESH_PS_DEBUG, \ + sdata, fmt, ##__VA_ARGS__) + ++#define moffld_dbg(sdata, fmt, ...) \ ++ _sdata_dbg(MAC80211_MESH_OFFLOAD_DEBUG, \ ++ sdata, fmt, ##__VA_ARGS__) ++ + #define tdls_dbg(sdata, fmt, ...) \ + _sdata_dbg(MAC80211_TDLS_DEBUG, \ + sdata, fmt, ##__VA_ARGS__) +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -411,6 +411,7 @@ static const char *hw_flag_names[] = { + FLAG(SUPPORTS_CONC_MON_RX_DECAP), + FLAG(SUPPORTS_NSS_OFFLOAD), + FLAG(SUPPORTS_MULTI_BSSID_AP), ++ FLAG(SUPPORTS_MESH_NSS_OFFLOAD), + #undef FLAG + }; + +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -347,3 +347,23 @@ int drv_ampdu_action(struct ieee80211_lo + + return ret; + } ++ ++#ifdef CPTCFG_MAC80211_MESH ++void drv_config_mesh_offload_path(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path) ++{ ++ if (!check_sdata_in_driver(sdata)) ++ return; ++ ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_MESH_NSS_OFFLOAD)) ++ return; ++ ++ if (local->ops->config_mesh_offload_path) ++ local->ops->config_mesh_offload_path(&local->hw, ++ &sdata->vif, cmd, path); ++ ++ /* TODO: trace event */ ++} ++#endif +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -1450,4 +1450,10 @@ static inline void drv_sta_set_decap_off + trace_drv_return_void(local); + } + ++#ifdef CPTCFG_MAC80211_MESH ++void drv_config_mesh_offload_path(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ enum ieee80211_mesh_path_offld_cmd cmd, ++ struct ieee80211_mesh_path_offld *path); ++#endif + #endif /* __MAC80211_DRIVER_OPS */ +--- a/net/mac80211/mesh.h ++++ b/net/mac80211/mesh.h +@@ -277,6 +277,10 @@ void mesh_rx_path_sel_frame(struct ieee8 + struct ieee80211_mgmt *mgmt, size_t len); + struct mesh_path * + mesh_path_add(struct ieee80211_sub_if_data *sdata, const u8 *dst); ++struct mesh_path *__mesh_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst); ++int __mpp_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst, const u8 *mpp); + + int mesh_path_add_gate(struct mesh_path *mpath); + int mesh_path_send_to_gates(struct mesh_path *mpath); +@@ -318,6 +322,7 @@ void mesh_path_discard_frame(struct ieee + void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata); + + bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt); ++void mesh_nss_offld_path_update(struct mesh_path *mpath, bool is_mpath, u8 *old_next_hop_addr); + + #ifdef CPTCFG_MAC80211_MESH + static inline +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -360,6 +360,13 @@ u32 airtime_link_metric_get(struct ieee8 + return (u32)result; + } + ++static inline struct sta_info * ++next_hop_deref_protected(struct mesh_path *mpath) ++{ ++ return rcu_dereference_protected(mpath->next_hop, ++ lockdep_is_held(&mpath->state_lock)); ++} ++ + /** + * hwmp_route_info_get - Update routing info to originator and transmitter + * +@@ -383,9 +390,10 @@ static u32 hwmp_route_info_get(struct ie + { + struct ieee80211_local *local = sdata->local; + struct mesh_path *mpath; +- struct sta_info *sta; ++ struct sta_info *sta, *next_hop; + bool fresh_info; + const u8 *orig_addr, *ta; ++ u8 old_next_hop_addr[ETH_ALEN] = {0}; + u32 orig_sn, orig_metric; + unsigned long orig_lifetime, exp_time; + u32 last_hop_metric, new_metric; +@@ -486,7 +494,10 @@ static u32 hwmp_route_info_get(struct ie + } + + if (fresh_info) { +- if (rcu_access_pointer(mpath->next_hop) != sta) ++ next_hop = rcu_dereference(mpath->next_hop); ++ if (next_hop) ++ ether_addr_copy(old_next_hop_addr, next_hop->sta.addr); ++ if (next_hop != sta) + mpath->path_change_count++; + mesh_path_assign_nexthop(mpath, sta); + mpath->flags |= MESH_PATH_SN_VALID; +@@ -504,6 +515,8 @@ static u32 hwmp_route_info_get(struct ie + /* draft says preq_id should be saved to, but there does + * not seem to be any use for it, skipping by now + */ ++ ++ mesh_nss_offld_path_update(mpath, true, old_next_hop_addr); + } else + spin_unlock_bh(&mpath->state_lock); + } +@@ -534,7 +547,10 @@ static u32 hwmp_route_info_get(struct ie + } + + if (fresh_info) { +- if (rcu_access_pointer(mpath->next_hop) != sta) ++ next_hop = rcu_dereference(mpath->next_hop); ++ if (next_hop) ++ ether_addr_copy(old_next_hop_addr, next_hop->sta.addr); ++ if (next_hop != sta) + mpath->path_change_count++; + mesh_path_assign_nexthop(mpath, sta); + mpath->metric = last_hop_metric; +@@ -547,6 +563,8 @@ static u32 hwmp_route_info_get(struct ie + /* init it at a low value - 0 start is tricky */ + ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1); + mesh_path_tx_pending(mpath); ++ ++ mesh_nss_offld_path_update(mpath, true, old_next_hop_addr); + } else + spin_unlock_bh(&mpath->state_lock); + } +@@ -683,15 +701,6 @@ static void hwmp_preq_frame_process(stru + } + } + +- +-static inline struct sta_info * +-next_hop_deref_protected(struct mesh_path *mpath) +-{ +- return rcu_dereference_protected(mpath->next_hop, +- lockdep_is_held(&mpath->state_lock)); +-} +- +- + static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, + struct ieee80211_mgmt *mgmt, + const u8 *prep_elem, u32 metric) +@@ -1326,3 +1335,272 @@ void mesh_path_tx_root_frame(struct ieee + return; + } + } ++ ++static int mesh_path_offld_mpath_refresh(struct ieee80211_sub_if_data *sdata, ++ u8 *mda) ++{ ++ struct mesh_path *mpath; ++ ++ rcu_read_lock(); ++ ++ mpath = mesh_path_lookup(sdata, mda); ++ if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE)) { ++ moffld_dbg(sdata, ++ "mpath lookup failed during path refresh for %pM, is_mpath %d\n", ++ mda, mpath != NULL); ++ rcu_read_unlock(); ++ return -ENOENT; ++ } ++ ++ if (!(mpath->flags & MESH_PATH_RESOLVING) && !(mpath->flags & MESH_PATH_FIXED)) ++ mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); ++ ++ rcu_read_unlock(); ++ ++ return 0; ++} ++ ++static int mesh_path_offld_mpath_del(struct ieee80211_sub_if_data *sdata, u8 *da) ++{ ++ struct mesh_path *mpath, *mppath; ++ ++ rcu_read_lock(); ++ ++ mpath = mesh_path_lookup(sdata, da); ++ if (!mpath) { ++ moffld_dbg(sdata, "mpath lookup failed for %pM during duplicate mpath removal\n", ++ da); ++ rcu_read_unlock(); ++ return -ENOENT; ++ } ++ ++ mppath = mpp_path_lookup(sdata, da); ++ if (!mppath) { ++ moffld_dbg(sdata, "proxy path lookup failed for %pM during duplicate mpath removal\n", ++ da); ++ rcu_read_unlock(); ++ return -EINVAL; ++ } ++ ++ mesh_path_del(sdata, mpath->dst); ++ ++ rcu_read_unlock(); ++ ++ return 0; ++} ++ ++static int mesh_path_offld_mpath_exp(struct ieee80211_sub_if_data *sdata, u8 *mda) ++{ ++ struct mesh_path *mpath; ++ ++ rcu_read_lock(); ++ ++ mpath = mesh_path_lookup(sdata, mda); ++ if (!mpath) { ++ mpath = mesh_path_add(sdata, mda); ++ if (IS_ERR(mpath)) { ++ rcu_read_unlock(); ++ moffld_dbg(sdata, ++ "failed to add mpath for %pM during mpath exp\n", mda); ++ return PTR_ERR(mpath); ++ } ++ } ++ ++ spin_lock_bh(&mpath->state_lock); ++ mpath->flags &= ~MESH_PATH_ACTIVE; ++ spin_unlock_bh(&mpath->state_lock); ++ ++ if (!(mpath->flags & MESH_PATH_RESOLVING) && ++ mesh_path_sel_is_hwmp(sdata)) ++ mesh_queue_preq(mpath, PREQ_Q_F_START); ++ ++ rcu_read_unlock(); ++ ++ return 0; ++} ++ ++static int mesh_path_offld_mpp_learn(struct ieee80211_sub_if_data *sdata, ++ u8 *da, u8 *mda) ++{ ++ struct mesh_path *mppath; ++ int ret; ++ ++ rcu_read_lock(); ++ mppath = mpp_path_lookup(sdata, da); ++ if (mppath) { ++ moffld_dbg(sdata, "proxy path for da %pM mesh_da %pM already exists\n", ++ da, mda); ++ rcu_read_unlock(); ++ return -EEXIST; ++ } ++ ++ ret = mpp_path_add(sdata, da, mda); ++ if (ret) ++ moffld_dbg(sdata, "failed to add proxy path entry (%d): da %pM mesh_da %pM\n", ++ ret, da, mda); ++ ++ rcu_read_unlock(); ++ ++ return ret; ++} ++ ++static int mesh_path_offld_mpp_add(struct ieee80211_sub_if_data *sdata, ++ u8 *da, u8 *mda) ++{ ++ struct mesh_path *mppath; ++ int ret; ++ ++ rcu_read_lock(); ++ mppath = mpp_path_lookup(sdata, da); ++ if (mppath) { ++ moffld_dbg(sdata, "proxy path for da %pM mesh_da %pM already exists\n", ++ da, mda); ++ rcu_read_unlock(); ++ return -EEXIST; ++ } ++ ++ ret = __mpp_path_add(sdata, da, mda); ++ if (ret) ++ moffld_dbg(sdata, "failed to add proxy path entry (%d): da %pM mesh_da %pM\n", ++ ret, da, mda); ++ ++ rcu_read_unlock(); ++ ++ return ret; ++} ++ ++static int mesh_path_offld_mpp_update(struct ieee80211_sub_if_data *sdata, ++ u8 *da, u8 *mda) ++{ ++ struct mesh_path *mppath; ++ ++ rcu_read_lock(); ++ mppath = mpp_path_lookup(sdata, da); ++ if (!mppath) { ++ moffld_dbg(sdata, ++ "proxy path lookup for da %pM failed during MPP update with mesh_da %pM\n", ++ da, mda); ++ rcu_read_unlock(); ++ return -ENOENT; ++ } else { ++ spin_lock_bh(&mppath->state_lock); ++ if (!ether_addr_equal(mppath->mpp, mda)) ++ memcpy(mppath->mpp, mda, ETH_ALEN); ++ mppath->exp_time = jiffies; ++ spin_unlock_bh(&mppath->state_lock); ++ } ++ rcu_read_unlock(); ++ ++ return 0; ++} ++ ++static int mesh_path_offld_mpath_not_found(struct ieee80211_sub_if_data *sdata, ++ u8 *mda, u8 *ta) ++{ ++ struct mesh_path *mpath; ++ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; ++ ++ rcu_read_lock(); ++ ++ mpath = mesh_path_lookup(sdata, mda); ++ if (!mpath) { ++ mpath = mesh_path_add(sdata, mda); ++ if (IS_ERR(mpath)) { ++ moffld_dbg(sdata, "mpath add failed for mesh_da %pM (%lu)\n", ++ mda, PTR_ERR(mpath)); ++ rcu_read_unlock(); ++ return PTR_ERR(mpath); ++ } ++ } ++ ++ if (!(mpath->flags & MESH_PATH_RESOLVING) && ++ mesh_path_sel_is_hwmp(sdata)) ++ mesh_queue_preq(mpath, PREQ_Q_F_START); ++ ++ rcu_read_unlock(); ++ ++ if (!is_zero_ether_addr(ta)) ++ mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl, ++ mda, 0, WLAN_REASON_MESH_PATH_NOFORWARD, ta); ++ ++ return 0; ++} ++ ++void ieee80211s_update_metric_ppdu(struct ieee80211_hw *hw, ++ struct ieee80211_tx_status *st) ++{ ++ struct sta_info *sta; ++ int i, num_mpdu; ++ bool failed; ++ ++ if (!st->sta) ++ return; ++ ++ if (st->mpdu_succ) { ++ num_mpdu = st->mpdu_succ; ++ failed = false; ++ } else if (st->mpdu_fail) { ++ num_mpdu = st->mpdu_fail; ++ failed = true; ++ } else ++ return; ++ ++ sta = container_of(st->sta, struct sta_info, sta); ++ if (!ieee80211_vif_is_mesh(&sta->sdata->vif)) ++ return; ++ ++ for (i = 0; i < num_mpdu; i++) { ++ ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, failed * 100); ++ if (ewma_mesh_fail_avg_read(&sta->mesh->fail_avg) > ++ LINK_FAIL_THRESH) ++ mesh_plink_broken(sta); ++ ++ if (!st->rate) ++ continue; ++ ++ ewma_mesh_tx_rate_avg_add(&sta->mesh->tx_rate_avg, ++ cfg80211_calculate_bitrate(st->rate)); ++ } ++} ++EXPORT_SYMBOL(ieee80211s_update_metric_ppdu); ++ ++int ieee80211_mesh_path_offld_change_notify(struct ieee80211_vif *vif, ++ struct ieee80211_mesh_path_offld *path, ++ enum ieee80211_mesh_path_offld_action action) ++{ ++ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); ++ int ret = -ENOTSUPP; ++ ++ moffld_dbg(sdata, "received mesh offload event %d\n", action); ++ ++ switch (action) { ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_REFRESH: ++ ret = mesh_path_offld_mpath_refresh(sdata, path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_DEL: ++ ret = mesh_path_offld_mpath_del(sdata, path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPATH_EXP: ++ ret = mesh_path_offld_mpath_exp(sdata, path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_LEARN: ++ ret = mesh_path_offld_mpp_learn(sdata, path->da, path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_ADD: ++ ret = mesh_path_offld_mpp_add(sdata, path->da, path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_MPP_UPDATE: ++ ret = mesh_path_offld_mpp_update(sdata, path->da, ++ path->mesh_da); ++ break; ++ case IEEE80211_MESH_PATH_OFFLD_ACTION_PATH_NOT_FOUND: ++ ret = mesh_path_offld_mpath_not_found(sdata, path->da, ++ path->ta); ++ break; ++ default: ++ break; ++ } ++ ++ return ret; ++} ++EXPORT_SYMBOL(ieee80211_mesh_path_offld_change_notify); +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -14,6 +14,7 @@ + #include "wme.h" + #include "ieee80211_i.h" + #include "mesh.h" ++#include "driver-ops.h" + + static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath); + +@@ -72,6 +73,63 @@ static void mesh_table_free(struct mesh_ + kfree(tbl); + } + ++void mesh_nss_offld_proxy_path_exp_update(struct ieee80211_vif *vif, u8* da, u8* mesh_da, u32 inactive_time) ++{ ++ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); ++ struct mesh_table *tbl = sdata->u.mesh.mpp_paths; ++ struct mesh_path *mppath; ++ struct hlist_node *n; ++ unsigned long expiry; ++ ++ spin_lock_bh(&tbl->walk_lock); ++ hlist_for_each_entry_safe(mppath, n, &tbl->walk_head, walk_list) { ++ if(!ether_addr_equal(da, mppath->dst) || !ether_addr_equal(mesh_da, mppath->mpp)) ++ continue; ++ if ((!(mppath->flags & MESH_PATH_RESOLVING)) && ++ (!(mppath->flags & MESH_PATH_FIXED))) { ++ expiry = jiffies - msecs_to_jiffies(inactive_time); ++ mppath->exp_time = time_after(mppath->exp_time, expiry) ? ++ mppath->exp_time : expiry; ++ } ++ } ++ spin_unlock_bh(&tbl->walk_lock); ++} ++EXPORT_SYMBOL(mesh_nss_offld_proxy_path_exp_update); ++ ++void mesh_nss_offld_path_update(struct mesh_path *mpath, bool is_mpath, u8 *old_next_hop_addr) ++{ ++ struct ieee80211_mesh_path_offld path = {0}; ++ struct sta_info *next_hop; ++ struct ieee80211_sub_if_data *sdata = mpath->sdata; ++ ++ ++ path.metric = mpath->metric; ++ if (time_before(jiffies, mpath->exp_time)) ++ path.exp_time = jiffies_to_msecs(mpath->exp_time - jiffies); ++ ++ path.hop_count = mpath->hop_count; ++ path.flags = mpath->flags; ++ path.mesh_gate = mpath->is_gate; ++ if (is_mpath) { ++ ether_addr_copy(path.mesh_da, mpath->dst); ++ } else { ++ ether_addr_copy(path.mesh_da, mpath->mpp); ++ ether_addr_copy(path.da, mpath->dst); ++ } ++ ++ next_hop = rcu_dereference(mpath->next_hop); ++ if (next_hop) ++ ether_addr_copy(path.next_hop, next_hop->addr); ++ ++ if (old_next_hop_addr) ++ ether_addr_copy(path.old_next_hop, old_next_hop_addr); ++ ++ drv_config_mesh_offload_path(sdata->local, sdata, ++ is_mpath ? IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPATH : ++ IEEE80211_MESH_PATH_OFFLD_CMD_UPDATE_MPP, ++ &path); ++} ++ + /** + * mesh_path_assign_nexthop - update mesh path next hop + * +@@ -209,16 +267,23 @@ static void mesh_path_move_to_queue(stru + + + static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst, +- struct ieee80211_sub_if_data *sdata) ++ struct ieee80211_sub_if_data *sdata, ++ bool is_mpath) + { + struct mesh_path *mpath; ++ bool update; ++ struct sta_info *next_hop; + + mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params); + + if (mpath && mpath_expired(mpath)) { + spin_lock_bh(&mpath->state_lock); ++ next_hop = rcu_dereference(mpath->next_hop); ++ update = !!(mpath->flags & MESH_PATH_ACTIVE); + mpath->flags &= ~MESH_PATH_ACTIVE; + spin_unlock_bh(&mpath->state_lock); ++ if (update && is_mpath) ++ mesh_nss_offld_path_update(mpath, true, next_hop ? next_hop->addr : NULL); + } + return mpath; + } +@@ -235,13 +300,13 @@ static struct mesh_path *mpath_lookup(st + struct mesh_path * + mesh_path_lookup(struct ieee80211_sub_if_data *sdata, const u8 *dst) + { +- return mpath_lookup(sdata->u.mesh.mesh_paths, dst, sdata); ++ return mpath_lookup(sdata->u.mesh.mesh_paths, dst, sdata, true); + } + + struct mesh_path * + mpp_path_lookup(struct ieee80211_sub_if_data *sdata, const u8 *dst) + { +- return mpath_lookup(sdata->u.mesh.mpp_paths, dst, sdata); ++ return mpath_lookup(sdata->u.mesh.mpp_paths, dst, sdata, false); + } + + static struct mesh_path * +@@ -303,6 +368,7 @@ mpp_path_lookup_by_idx(struct ieee80211_ + int mesh_path_add_gate(struct mesh_path *mpath) + { + struct mesh_table *tbl; ++ struct sta_info *next_hop; + int err; + + rcu_read_lock(); +@@ -315,6 +381,7 @@ int mesh_path_add_gate(struct mesh_path + goto err_rcu; + } + mpath->is_gate = true; ++ next_hop = rcu_dereference(mpath->next_hop); + mpath->sdata->u.mesh.num_gates++; + + spin_lock(&tbl->gates_lock); +@@ -323,6 +390,8 @@ int mesh_path_add_gate(struct mesh_path + + spin_unlock_bh(&mpath->state_lock); + ++ mesh_nss_offld_path_update(mpath, true, next_hop ? next_hop->addr : NULL); ++ + mpath_dbg(mpath->sdata, + "Mesh path: Recorded new gate: %pM. %d known gates\n", + mpath->dst, mpath->sdata->u.mesh.num_gates); +@@ -339,16 +408,21 @@ err_rcu: + */ + static void mesh_gate_del(struct mesh_table *tbl, struct mesh_path *mpath) + { ++ struct sta_info *next_hop; ++ + lockdep_assert_held(&mpath->state_lock); + if (!mpath->is_gate) + return; + ++ next_hop = rcu_dereference(mpath->next_hop); + mpath->is_gate = false; + spin_lock_bh(&tbl->gates_lock); + hlist_del_rcu(&mpath->gate_list); + mpath->sdata->u.mesh.num_gates--; + spin_unlock_bh(&tbl->gates_lock); + ++ mesh_nss_offld_path_update(mpath, true, next_hop ? next_hop->addr : NULL); ++ + mpath_dbg(mpath->sdata, + "Mesh path: Deleted gate: %pM. %d known gates\n", + mpath->dst, mpath->sdata->u.mesh.num_gates); +@@ -386,17 +460,8 @@ struct mesh_path *mesh_path_new(struct i + return new_mpath; + } + +-/** +- * mesh_path_add - allocate and add a new path to the mesh path table +- * @dst: destination address of the path (ETH_ALEN length) +- * @sdata: local subif +- * +- * Returns: 0 on success +- * +- * State: the initial state of the new path is set to 0 +- */ +-struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata, +- const u8 *dst) ++struct mesh_path *__mesh_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst) + { + struct mesh_table *tbl; + struct mesh_path *mpath, *new_mpath; +@@ -437,8 +502,36 @@ struct mesh_path *mesh_path_add(struct i + return new_mpath; + } + +-int mpp_path_add(struct ieee80211_sub_if_data *sdata, +- const u8 *dst, const u8 *mpp) ++/** ++ * mesh_path_add - allocate and add a new path to the mesh path table ++ * @dst: destination address of the path (ETH_ALEN length) ++ * @sdata: local subif ++ * ++ * Returns: 0 on success ++ * ++ * State: the initial state of the new path is set to 0 ++ */ ++struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst) ++{ ++ struct mesh_path *new_path; ++ struct ieee80211_mesh_path_offld path = {0}; ++ ++ new_path = __mesh_path_add(sdata, dst); ++ if (IS_ERR(new_path)) ++ return new_path; ++ ++ ether_addr_copy(path.mesh_da, dst); ++ ++ drv_config_mesh_offload_path(sdata->local, sdata, ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPATH, ++ &path); ++ ++ return new_path; ++} ++ ++int __mpp_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst, const u8 *mpp) + { + struct mesh_table *tbl; + struct mesh_path *new_mpath; +@@ -474,6 +567,25 @@ int mpp_path_add(struct ieee80211_sub_if + return ret; + } + ++int mpp_path_add(struct ieee80211_sub_if_data *sdata, ++ const u8 *dst, const u8 *mpp) ++{ ++ struct ieee80211_mesh_path_offld path = {0}; ++ int ret; ++ ++ ret = __mpp_path_add(sdata, dst, mpp); ++ if (ret) ++ return ret; ++ ++ ether_addr_copy(path.mesh_da, mpp); ++ ether_addr_copy(path.da, dst); ++ ++ drv_config_mesh_offload_path(sdata->local, sdata, ++ IEEE80211_MESH_PATH_OFFLD_CMD_ADD_MPP, ++ &path); ++ ++ return 0; ++} + + /** + * mesh_plink_broken - deactivates paths and sends perr when a link breaks +@@ -524,11 +636,37 @@ static void mesh_path_free_rcu(struct me + kfree_rcu(mpath, rcu); + } + +-static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath) ++static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath, ++ bool is_mpath_tbl) + { ++ struct ieee80211_mesh_path_offld path = {0}; ++ struct sta_info *next_hop; ++ struct ieee80211_sub_if_data *sdata = mpath->sdata; ++ ++ ++ path.metric = mpath->metric; ++ path.exp_time = mpath->exp_time; ++ path.hop_count = mpath->hop_count; ++ path.flags = mpath->flags; ++ if (is_mpath_tbl) { ++ ether_addr_copy(path.mesh_da, mpath->dst); ++ } else { ++ ether_addr_copy(path.mesh_da, mpath->mpp); ++ ether_addr_copy(path.da, mpath->dst); ++ } ++ ++ next_hop = rcu_dereference(mpath->next_hop); ++ if (next_hop) ++ ether_addr_copy(path.next_hop, next_hop->addr); ++ + hlist_del_rcu(&mpath->walk_list); + rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params); + mesh_path_free_rcu(tbl, mpath); ++ ++ drv_config_mesh_offload_path(sdata->local, sdata, ++ is_mpath_tbl ? IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPATH : ++ IEEE80211_MESH_PATH_OFFLD_CMD_DELETE_MPP, ++ &path); + } + + /** +@@ -552,7 +690,7 @@ void mesh_path_flush_by_nexthop(struct s + spin_lock_bh(&tbl->walk_lock); + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { + if (rcu_access_pointer(mpath->next_hop) == sta) +- __mesh_path_del(tbl, mpath); ++ __mesh_path_del(tbl, mpath, true); + } + spin_unlock_bh(&tbl->walk_lock); + } +@@ -567,19 +705,19 @@ static void mpp_flush_by_proxy(struct ie + spin_lock_bh(&tbl->walk_lock); + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { + if (ether_addr_equal(mpath->mpp, proxy)) +- __mesh_path_del(tbl, mpath); ++ __mesh_path_del(tbl, mpath, false); + } + spin_unlock_bh(&tbl->walk_lock); + } + +-static void table_flush_by_iface(struct mesh_table *tbl) ++static void table_flush_by_iface(struct mesh_table *tbl, bool is_mpath_tbl) + { + struct mesh_path *mpath; + struct hlist_node *n; + + spin_lock_bh(&tbl->walk_lock); + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { +- __mesh_path_del(tbl, mpath); ++ __mesh_path_del(tbl, mpath, is_mpath_tbl); + } + spin_unlock_bh(&tbl->walk_lock); + } +@@ -594,8 +732,8 @@ static void table_flush_by_iface(struct + */ + void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata) + { +- table_flush_by_iface(sdata->u.mesh.mesh_paths); +- table_flush_by_iface(sdata->u.mesh.mpp_paths); ++ table_flush_by_iface(sdata->u.mesh.mesh_paths, true); ++ table_flush_by_iface(sdata->u.mesh.mpp_paths, false); + } + + /** +@@ -609,7 +747,7 @@ void mesh_path_flush_by_iface(struct iee + */ + static int table_path_del(struct mesh_table *tbl, + struct ieee80211_sub_if_data *sdata, +- const u8 *addr) ++ const u8 *addr, bool is_mpath_tbl) + { + struct mesh_path *mpath; + +@@ -620,7 +758,7 @@ static int table_path_del(struct mesh_ta + return -ENXIO; + } + +- __mesh_path_del(tbl, mpath); ++ __mesh_path_del(tbl, mpath, is_mpath_tbl); + spin_unlock_bh(&tbl->walk_lock); + return 0; + } +@@ -641,7 +779,7 @@ int mesh_path_del(struct ieee80211_sub_i + /* flush relevant mpp entries first */ + mpp_flush_by_proxy(sdata, addr); + +- err = table_path_del(sdata->u.mesh.mesh_paths, sdata, addr); ++ err = table_path_del(sdata->u.mesh.mesh_paths, sdata, addr, true); + sdata->u.mesh.mesh_paths_generation++; + return err; + } +@@ -744,7 +882,10 @@ void mesh_path_flush_pending(struct mesh + */ + void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop) + { ++ struct sta_info *old_next_hop; ++ + spin_lock_bh(&mpath->state_lock); ++ old_next_hop = rcu_dereference(mpath->next_hop); + mesh_path_assign_nexthop(mpath, next_hop); + mpath->sn = 0xffff; + mpath->metric = 0; +@@ -757,6 +898,8 @@ void mesh_path_fix_nexthop(struct mesh_p + /* init it at a low value - 0 start is tricky */ + ewma_mesh_fail_avg_add(&next_hop->mesh->fail_avg, 1); + mesh_path_tx_pending(mpath); ++ ++ mesh_nss_offld_path_update(mpath, true, old_next_hop ? old_next_hop->addr : NULL); + } + + int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata) +@@ -794,7 +937,7 @@ free_path: + + static + void mesh_path_tbl_expire(struct ieee80211_sub_if_data *sdata, +- struct mesh_table *tbl) ++ struct mesh_table *tbl, bool is_mpath_tbl) + { + struct mesh_path *mpath; + struct hlist_node *n; +@@ -804,15 +947,15 @@ void mesh_path_tbl_expire(struct ieee802 + if ((!(mpath->flags & MESH_PATH_RESOLVING)) && + (!(mpath->flags & MESH_PATH_FIXED)) && + time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) +- __mesh_path_del(tbl, mpath); ++ __mesh_path_del(tbl, mpath, is_mpath_tbl); + } + spin_unlock_bh(&tbl->walk_lock); + } + + void mesh_path_expire(struct ieee80211_sub_if_data *sdata) + { +- mesh_path_tbl_expire(sdata, sdata->u.mesh.mesh_paths); +- mesh_path_tbl_expire(sdata, sdata->u.mesh.mpp_paths); ++ mesh_path_tbl_expire(sdata, sdata->u.mesh.mesh_paths, true); ++ mesh_path_tbl_expire(sdata, sdata->u.mesh.mpp_paths, false); + } + + void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata) +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2862,6 +2862,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + struct mesh_path *mppath; + char *proxied_addr; + char *mpp_addr; ++ bool update = false; + + if (is_multicast_ether_addr(hdr->addr1)) { + mpp_addr = hdr->addr3; +@@ -2881,10 +2882,15 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + mpp_path_add(sdata, proxied_addr, mpp_addr); + } else { + spin_lock_bh(&mppath->state_lock); +- if (!ether_addr_equal(mppath->mpp, mpp_addr)) ++ if (!ether_addr_equal(mppath->mpp, mpp_addr)) { + memcpy(mppath->mpp, mpp_addr, ETH_ALEN); ++ update = true; ++ } + mppath->exp_time = jiffies; + spin_unlock_bh(&mppath->state_lock); ++ ++ if (update) ++ mesh_nss_offld_path_update(mppath, false, NULL); + } + rcu_read_unlock(); + } +--- a/drivers/net/wireless/ath/ath11k/debug.h ++++ b/drivers/net/wireless/ath/ath11k/debug.h +@@ -9,6 +9,7 @@ + #include "trace.h" + #include "debugfs.h" + ++extern struct dentry *debugfs_ath11k; + enum ath11k_debug_mask { + ATH11K_DBG_AHB = 0x00000001, + ATH11K_DBG_WMI = 0x00000002, +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -2547,6 +2547,9 @@ static struct sk_buff *ieee80211_build_h + info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; + #endif + ++ info = IEEE80211_SKB_CB(skb); ++ memset(info, 0, sizeof(*info)); ++ + /* convert Ethernet header to proper 802.11 header (based on + * operation mode) */ + ethertype = (skb->data[12] << 8) | skb->data[13]; +@@ -2593,6 +2596,13 @@ static struct sk_buff *ieee80211_build_h + break; + #ifdef CPTCFG_MAC80211_MESH + case NL80211_IFTYPE_MESH_POINT: ++ if (ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD) && ++ (sdata->vif.driver_flags & IEEE80211_VIF_NSS_OFFLOAD_DEBUG_MODE) && ++ !(is_multicast_ether_addr(skb->data))) { ++ info->flags = IEEE80211_TX_CTL_HW_80211_ENCAP; ++ goto nss_mesh; ++ } ++ + if (!is_multicast_ether_addr(skb->data)) { + struct sta_info *next_hop; + bool mpp_lookup = true; +@@ -2868,10 +2878,10 @@ static struct sk_buff *ieee80211_build_h + + skb_reset_mac_header(skb); + +- info = IEEE80211_SKB_CB(skb); +- memset(info, 0, sizeof(*info)); +- +- info->flags = info_flags; ++#ifdef CPTCFG_MAC80211_MESH ++nss_mesh: ++#endif ++ info->flags |= info_flags; + info->ack_frame_id = info_id; + info->band = band; + info->control.flags = ctrl_flags; +@@ -3944,6 +3954,7 @@ void __ieee80211_subif_start_xmit(struct + struct ieee80211_key *key = NULL; + struct sta_info *sta; + struct sk_buff *next; ++ struct ieee80211_tx_info *info; + struct ieee80211_sub_if_data *ap_sdata; + + if (unlikely(skb->len < ETH_HLEN)) { +@@ -4040,9 +4051,15 @@ void __ieee80211_subif_start_xmit(struct + goto out; + } + +- ieee80211_tx_stats(dev, skb->len); +- +- ieee80211_xmit(sdata, sta, skb); ++ info = IEEE80211_SKB_CB(skb); ++ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) { ++ if (sta) ++ key = rcu_dereference(sta->ptk[sta->ptk_idx]); ++ ieee80211_8023_xmit(sdata, dev, sta, key, skb); ++ } else { ++ ieee80211_tx_stats(dev, skb->len); ++ ieee80211_xmit(sdata, sta, skb); ++ } + } + goto out; + out_free: diff --git a/feeds/wifi-ax/mac80211/patches/qca/301-ath11k-nss-mcbc-exception.patch b/feeds/wifi-ax/mac80211/patches/qca/301-ath11k-nss-mcbc-exception.patch new file mode 100644 index 000000000..d81d48c20 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/301-ath11k-nss-mcbc-exception.patch @@ -0,0 +1,119 @@ +From 91df8aa674d2d4064ab22f47515c3fb126527208 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Kathirvel +Date: Thu, 12 Nov 2020 15:02:56 +0530 +Subject: [PATCH] ath11k: NSS MCBC Exception added for STA + +Since NSS FW is not supporting PN check for MCBC pkts, those pkts are +excepted from NSS offload to pass through mac80211 PN check. + +Signed-off-by: Karthikeyan Kathirvel +Change-Id: I4a6ac67a1c2cf3ab7a219d0953907191606a5e70 +--- + drivers/net/wireless/ath/ath11k/nss.c | 128 +++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/nss.h | 51 ++++---- + 2 files changed, 153 insertions(+), 26 deletions(-) + create mode 100644 mac80211/patches/301-ath11k-nss-mcbc-exception.patch + +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -769,6 +769,7 @@ ath11k_nss_vdev_special_data_receive(str + struct nss_wifi_vdev_wds_per_packet_metadata *wds_metadata = NULL; + struct ath11k_vif *arvif; + struct ath11k_base *ab; ++ struct ath11k_skb_rxcb *rxcb; + bool drop = false; + bool eth_decap = false; + int data_offs = 0; +@@ -799,15 +800,32 @@ ath11k_nss_vdev_special_data_receive(str + return; + } + +- if (eth_decap && wifi_metadata->pkt_type == +- NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN) { +- wds_metadata = &wifi_metadata->metadata.wds_metadata; +- ath11k_nss_vdev_spl_receive_ext_wdsdata(arvif, skb, +- wds_metadata, &drop); +- } ++ switch(wifi_metadata->pkt_type) { ++ case NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN: ++ if (eth_decap) { ++ wds_metadata = &wifi_metadata->metadata.wds_metadata; ++ ath11k_nss_vdev_spl_receive_ext_wdsdata(arvif, skb, ++ wds_metadata, &drop); ++ } ++ if (!drop) ++ ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); ++ break; ++ case NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MCBC_RX: ++ ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", ++ "mcbc packet exception from nss: ", ++ skb->data, skb->len); ++ rxcb = ATH11K_SKB_RXCB(skb); ++ rxcb->rx_desc = (struct hal_rx_desc *)skb->head; ++ rxcb->is_first_msdu = rxcb->is_last_msdu = true; ++ rxcb->is_continuation = false; ++ rxcb->is_mcbc = true; ++ ath11k_dp_rx_from_nss(arvif->ar, skb, napi); ++ break; + +- if (!drop) +- ath11k_nss_deliver_rx(arvif->vif, skb, eth_decap, data_offs, napi); ++ default: ++ ath11k_warn(ab, "unsupported pkt_type %d from nss\n", wifi_metadata->pkt_type); ++ dev_kfree_skb_any(skb); ++ } + } + + static void +@@ -1953,6 +1971,7 @@ ath11k_nss_mesh_link_vdev_special_data_r + rxcb->rx_desc = (struct hal_rx_desc *)skb->head; + rxcb->is_first_msdu = rxcb->is_last_msdu = true; + rxcb->is_continuation = false; ++ rxcb->is_mcbc = true; + ath11k_dp_rx_from_nss(arvif->ar, skb, napi); + break; + case NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MESH: +@@ -2568,8 +2587,15 @@ int ath11k_nss_vdev_create(struct ath11k + goto free_vdev; + + switch (arvif->vif->type) { +- case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_STATION: ++ ret = ath11k_nss_vdev_set_cmd(arvif, ++ NSS_WIFI_VDEV_CFG_MCBC_EXC_TO_HOST_CMD, ++ ATH11K_NSS_ENABLE_MCBC_EXC); ++ if (ret) { ++ ath11k_err(ab, "failed to set MCBC in nss %d\n", ret); ++ goto unregister_vdev; ++ } ++ case NL80211_IFTYPE_AP: + ret = ath11k_nss_vdev_configure(arvif); + if (ret) + goto unregister_vdev; +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -106,6 +106,9 @@ do { \ + + #define ATH11K_MPP_EXPIRY_TIMER_INTERVAL_MS 60 * HZ + ++/* Enables the MCBC exception in NSS fw, 1 = enable */ ++#define ATH11K_NSS_ENABLE_MCBC_EXC 1 ++ + enum ath11k_nss_opmode { + ATH11K_NSS_OPMODE_UNKNOWN, + ATH11K_NSS_OPMODE_AP, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2711,7 +2711,11 @@ static void ath11k_dp_rx_h_mpdu(struct a + + /* PN for multicast packets will be checked in mac80211 */ + rxcb = ATH11K_SKB_RXCB(msdu); +- rxcb->is_mcbc = fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); ++ ++ if (!ar->ab->nss.enabled) ++ rxcb->is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); ++ ++ fill_crypto_hdr = rxcb->is_mcbc; + + if (rxcb->is_mcbc) { + rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); diff --git a/feeds/wifi-ax/mac80211/patches/qca/301-debugfs-support-for-ani-parameters.patch b/feeds/wifi-ax/mac80211/patches/qca/301-debugfs-support-for-ani-parameters.patch new file mode 100644 index 000000000..e0f1619f1 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/301-debugfs-support-for-ani-parameters.patch @@ -0,0 +1,548 @@ +From b6b05d6e9b69d76053cc6997e1cedf2e4c9c24c0 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Sun, 18 Apr 2021 16:51:56 +0530 +Subject: [PATCH] debugfs-support-for-ani-parameters + +Signed-off-by: Hari Chandrakanthan +--- + drivers/net/wireless/ath/ath11k/core.h | 8 + + drivers/net/wireless/ath/ath11k/debugfs.c | 308 ++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 6 + + drivers/net/wireless/ath/ath11k/mac.c | 3 + + drivers/net/wireless/ath/ath11k/wmi.c | 74 +++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 18 ++ + 6 files changed, 417 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h +index 07a7175..c1dc737 100644 +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -740,6 +740,7 @@ struct ath11k { + struct ath11k_cfr cfr; + #endif + u8 cfr_enabled; ++ bool ani_enabled; + }; + + struct ath11k_band_cap { +@@ -988,6 +989,13 @@ struct ath11k_base { + u32 rx_hash; + bool stats_disable; + ++ u32 ani_poll_period; ++ u32 ani_listen_period; ++ int ani_ofdm_level; ++ int ani_cck_level; ++ struct completion ani_ofdm_event; ++ struct completion ani_cck_event; ++ + /* must be last */ + u8 drv_priv[0] __aligned(sizeof(void *)); + }; +diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c +index 2636931..f04395a 100644 +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -3692,6 +3692,302 @@ static const struct file_operations fops_disable_dyn_bw = { + .open = simple_open + }; + ++static ssize_t ath11k_read_ani_enable(struct file *file, char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ char buf[32]; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%d\n",ar->ani_enabled); ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_write_ani_enable(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int ret; ++ u8 enable; ++ ++ if (kstrtou8_from_user(user_buf, count, 0, &enable)) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->ani_enabled == enable) { ++ ret = count; ++ goto exit; ++ } ++ ++ ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_ANI_ENABLE, ++ enable, ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "ani_enable failed from debugfs: %d\n", ret); ++ goto exit; ++ } ++ ar->ani_enabled = enable; ++ ret = count; ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_ani_enable = { ++ .read = ath11k_read_ani_enable, ++ .write = ath11k_write_ani_enable, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_read_ani_poll_period(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ char buf[32]; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%u\n", ar->ab->ani_poll_period); ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_write_ani_poll_period(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int ret; ++ u32 ani_poll_period; ++ ++ if (kstrtou32_from_user(user_buf, count, 0, &ani_poll_period)) ++ return -EINVAL; ++ ++ if(ani_poll_period > ATH11K_ANI_POLL_PERIOD_MAX) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_ANI_POLL_PERIOD, ++ ani_poll_period, ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "ani poll period write failed in debugfs: %d\n", ret); ++ goto exit; ++ } ++ ar->ab->ani_poll_period = ani_poll_period; ++ ret = count; ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_ani_poll_period = { ++ .read = ath11k_read_ani_poll_period, ++ .write = ath11k_write_ani_poll_period, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static ssize_t ath11k_read_ani_listen_period(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int len = 0; ++ char buf[32]; ++ ++ len = scnprintf(buf, sizeof(buf) - len, "%u\n", ar->ab->ani_listen_period); ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t ath11k_write_ani_listen_period(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int ret; ++ u32 ani_listen_period = 0; ++ ++ if (kstrtou32_from_user(user_buf, count, 0, &ani_listen_period)) ++ return -EINVAL; ++ ++ if(ani_listen_period > ATH11K_ANI_LISTEN_PERIOD_MAX) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, ++ ani_listen_period, ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "ani listen period write failed in debugfs: %d\n", ret); ++ goto exit; ++ } ++ ar->ab->ani_listen_period = ani_listen_period; ++ ret = count; ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_ani_listen_period = { ++ .read = ath11k_read_ani_listen_period, ++ .write = ath11k_write_ani_listen_period, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++static int ath11k_debug_get_ani_level(struct ath11k *ar) ++{ ++ unsigned long time_left; ++ int ret; ++ ++ lockdep_assert_held(&ar->conf_mutex); ++ ++ reinit_completion(&(ar->ab->ani_ofdm_event)); ++ ++ ret = ath11k_wmi_pdev_get_ani_level(ar, WMI_PDEV_GET_ANI_OFDM_CONFIG_CMDID, ++ ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "failed to request ofdm ani level: %d\n", ret); ++ return ret; ++ } ++ time_left = wait_for_completion_timeout(&ar->ab->ani_ofdm_event, 1 * HZ); ++ if (time_left == 0) ++ return -ETIMEDOUT; ++ ++ if (ar->ab->target_caps.phy_capability & WHAL_WLAN_11G_CAPABILITY) { ++ reinit_completion(&(ar->ab->ani_cck_event)); ++ ret = ath11k_wmi_pdev_get_ani_level(ar, WMI_PDEV_GET_ANI_CCK_CONFIG_CMDID, ++ ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "failed to request cck ani level: %d\n", ret); ++ return ret; ++ } ++ time_left = wait_for_completion_timeout(&ar->ab->ani_cck_event, 1 * HZ); ++ if (time_left == 0) ++ return -ETIMEDOUT; ++ } ++ ++ return 0; ++} ++ ++static ssize_t ath11k_read_ani_level(struct file *file, char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ char buf[128]; ++ int ret, len = 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto unlock; ++ } ++ ++ if(!ar->ani_enabled) { ++ len += scnprintf(buf, sizeof(buf), "ANI is disabled\n"); ++ } else { ++ ret = ath11k_debug_get_ani_level(ar); ++ if (ret) { ++ ath11k_warn(ar, "failed to request ani level: %d\n", ret); ++ goto unlock; ++ } ++ len += scnprintf(buf, sizeof(buf), "ofdm level %d cck level %d\n", ++ ar->ab->ani_ofdm_level, ar->ab->ani_cck_level); ++ } ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++ ++unlock: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static ssize_t ath11k_write_ani_level(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ char buf[32] = {0}; ++ ssize_t rc; ++ u32 ofdm_param = 0, cck_param = 0; ++ int ofdm_level, cck_level; ++ int ret; ++ ++ rc = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); ++ if (rc < 0) ++ return rc; ++ ++ buf[*ppos - 1] = '\0'; ++ ++ ret = sscanf(buf, "%d %d", &ofdm_level, &cck_level); ++ ++ if (ret != 2) ++ return -EINVAL; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH11K_STATE_ON && ar->state != ATH11K_STATE_RESTARTED) { ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ if ((ofdm_level >= ATH11K_ANI_LEVEL_MIN && ofdm_level <= ATH11K_ANI_LEVEL_MAX) || ++ (ofdm_level == ATH11K_ANI_LEVEL_AUTO)) { ++ ofdm_param = WMI_PDEV_PARAM_ANI_OFDM_LEVEL; ++ } else { ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ if((ar->ab->target_caps.phy_capability & WHAL_WLAN_11G_CAPABILITY)) { ++ if ((cck_level >= ATH11K_ANI_LEVEL_MIN && ++ cck_level <= ATH11K_ANI_LEVEL_MAX) || ++ (cck_level == ATH11K_ANI_LEVEL_AUTO)) { ++ cck_param = WMI_PDEV_PARAM_ANI_CCK_LEVEL; ++ } else { ++ ret = -EINVAL; ++ goto exit; ++ } ++ } ++ ++ ret = ath11k_wmi_pdev_set_param(ar, ofdm_param, ofdm_level, ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "failed to set ANI ofdm level :%d\n", ret); ++ goto exit; ++ } ++ ++ if (cck_param) { ++ ret = ath11k_wmi_pdev_set_param(ar, cck_param, cck_level, ++ ar->pdev->pdev_id); ++ if (ret) { ++ ath11k_warn(ar, "failed to set ANI cck level :%d\n", ret); ++ goto exit; ++ } ++ } ++ ++ ret = count; ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_ani_level = { ++ .write = ath11k_write_ani_level, ++ .read = ath11k_read_ani_level, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +@@ -3716,6 +4012,8 @@ int ath11k_debugfs_register(struct ath11k *ar) + ath11k_debugfs_fw_stats_init(ar); + ath11k_init_pktlog(ar); + init_completion(&ar->tpc_complete); ++ init_completion(&ab->ani_ofdm_event); ++ init_completion(&ab->ani_cck_event); + + debugfs_create_file("ext_tx_stats", 0644, + ar->debug.debugfs_pdev, ar, +@@ -3781,6 +4079,16 @@ int ath11k_debugfs_register(struct ath11k *ar) + + debugfs_create_file("enable_dbr_debug", 0200, ar->debug.debugfs_pdev, + ar, &fops_dbr_debug); ++ ++ debugfs_create_file("ani_enable", S_IRUSR | S_IWUSR, ++ ar->debug.debugfs_pdev, ar, &fops_ani_enable); ++ debugfs_create_file("ani_level", S_IRUSR | S_IWUSR, ++ ar->debug.debugfs_pdev, ar, &fops_ani_level); ++ debugfs_create_file("ani_poll_period", S_IRUSR | S_IWUSR, ++ ar->debug.debugfs_pdev, ar, &fops_ani_poll_period); ++ debugfs_create_file("ani_listen_period", S_IRUSR | S_IWUSR, ++ ar->debug.debugfs_pdev, ar, &fops_ani_listen_period); ++ + return 0; + } + +diff --git a/drivers/net/wireless/ath/ath11k/debugfs.h b/drivers/net/wireless/ath/ath11k/debugfs.h +index e08034c..95a8372 100644 +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -211,6 +211,12 @@ do { \ + #define ATH11K_MEMORY_STATS_DEC(_struct, _field, _size) + #endif + ++#define ATH11K_ANI_LEVEL_MAX 30 ++#define ATH11K_ANI_LEVEL_MIN -5 ++#define ATH11K_ANI_LEVEL_AUTO 0x80 ++#define ATH11K_ANI_POLL_PERIOD_MAX 3000 ++#define ATH11K_ANI_LISTEN_PERIOD_MAX 3000 ++ + #ifdef CPTCFG_ATH11K_DEBUGFS + int ath11k_debugfs_create(void); + void ath11k_debugfs_destroy(void); +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index 29cbc33..a68ab06 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6153,6 +6153,9 @@ static int ath11k_mac_op_start(struct ieee80211_hw *hw) + rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], + &ab->pdevs[ar->pdev_idx]); + ++ /*ani is enabled by default*/ ++ ar->ani_enabled = true; ++ + return 0; + + err: +diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c +index 173d217..1fbba1b 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -8370,6 +8370,74 @@ ath11k_wmi_pdev_csa_switch_count_status_event(struct ath11k_base *ab, + kfree(tb); + } + ++int ath11k_wmi_pdev_get_ani_level(struct ath11k *ar, u32 cmd_id, u8 pdev_id) ++{ ++ struct ath11k_pdev_wmi *wmi = ar->wmi; ++ struct wmi_pdev_get_ani_level_cmd *cmd = NULL; ++ struct sk_buff *skb; ++ int ret; ++ enum wmi_tlv_tag temp_tlv_tag; ++ ++ switch(cmd_id) { ++ case WMI_PDEV_GET_ANI_OFDM_CONFIG_CMDID: ++ temp_tlv_tag = WMI_TAG_PDEV_GET_ANI_OFDM_CONFIG_CMD; ++ break; ++ case WMI_PDEV_GET_ANI_CCK_CONFIG_CMDID: ++ temp_tlv_tag = WMI_TAG_PDEV_GET_ANI_CCK_CONFIG_CMD; ++ break; ++ default: ++ ath11k_warn(ar->ab, "Invalid cmd %d\n", cmd_id); ++ return -EINVAL; ++ } ++ ++ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); ++ if (!skb) ++ return -ENOMEM; ++ ++ cmd = (struct wmi_pdev_get_ani_level_cmd *)skb->data; ++ cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, temp_tlv_tag) | ++ FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); ++ cmd->pdev_id = pdev_id; ++ ++ ret = ath11k_wmi_cmd_send(wmi, skb, cmd_id); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); ++ dev_kfree_skb(skb); ++ } ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "WMI pdev pdev id %d\n", pdev_id); ++ ++ return ret; ++} ++ ++static int ath11k_wmi_event_ani_ofdm_level(struct ath11k_base *ab, ++ struct sk_buff *skb) ++{ ++ const struct wmi_pdev_ani_event *ev; ++ ++ ev = (struct wmi_pdev_ani_event *)skb->data; ++ if (WARN_ON(skb->len < sizeof(*ev))) ++ return -EPROTO; ++ ++ ab->ani_ofdm_level = ev->ani_level; ++ complete(&ab->ani_ofdm_event); ++ return 0; ++} ++ ++static int ath11k_wmi_event_ani_cck_level(struct ath11k_base *ab, ++ struct sk_buff *skb) ++{ ++ const struct wmi_pdev_ani_event *ev; ++ ++ ev = (struct wmi_pdev_ani_event *)skb->data; ++ if (WARN_ON(skb->len < sizeof(*ev))) ++ return -EPROTO; ++ ++ ab->ani_cck_level = ev->ani_level; ++ complete(&(ab->ani_cck_event)); ++ return 0; ++} ++ + static void + ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff *skb) + { +@@ -9587,6 +9655,12 @@ static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) + case WMI_PEER_CFR_CAPTURE_EVENTID: + ath11k_wmi_parse_cfr_capture_event(ab, skb); + break; ++ case WMI_PDEV_ANI_CCK_LEVEL_EVENTID: ++ ath11k_wmi_event_ani_cck_level(ab, skb); ++ break; ++ case WMI_PDEV_ANI_OFDM_LEVEL_EVENTID: ++ ath11k_wmi_event_ani_ofdm_level(ab, skb); ++ break; + /* TODO: Add remaining events */ + default: + ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); +diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h +index 55f51fa..d74128f 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -117,6 +117,12 @@ enum { + WMI_HOST_WLAN_2G_5G_CAP = 0x3, + }; + ++enum wlan_mode_capability { ++ WHAL_WLAN_11A_CAPABILITY = 0x1, ++ WHAL_WLAN_11G_CAPABILITY = 0x2, ++ WHAL_WLAN_11AG_CAPABILITY = 0x3, ++}; ++ + /* Parameters used for WMI_VDEV_PARAM_AUTORATE_MISC_CFG command. + * Used only for HE auto rate mode. + */ +@@ -2753,6 +2759,11 @@ struct wmi_p2p_noa_descriptor { + u32 start_time; + }; + ++struct wmi_pdev_ani_event { ++ u32 tlv_header; ++ u32 ani_level; ++} __packed; ++ + struct channel_param { + u8 chan_id; + u8 pwr; +@@ -3148,6 +3159,12 @@ struct wmi_fwtest_set_param_cmd_param { + u32 param_value; + }; + ++struct wmi_pdev_get_ani_level_cmd { ++ u32 tlv_header; ++ u32 pdev_id; ++ u32 param_id; ++} __packed; ++ + struct wmi_pdev_set_param_cmd { + u32 tlv_header; + u32 pdev_id; +@@ -6694,4 +6711,5 @@ int ath11k_wmi_dbglog_cfg(struct ath11k *ar, u32 param, u64 value); + int ath11k_wmi_peer_set_cfr_capture_conf(struct ath11k *ar, + u32 vdev_id, const u8 *mac, + struct wmi_peer_cfr_capture_conf_arg *arg); ++int ath11k_wmi_pdev_get_ani_level(struct ath11k *ar, u32 param_id, u8 pdev_id); + #endif +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-Add-support-to-parse-new-wmi-event-for-6G-reg.patch b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-Add-support-to-parse-new-wmi-event-for-6G-reg.patch new file mode 100644 index 000000000..0ab477f2c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-Add-support-to-parse-new-wmi-event-for-6G-reg.patch @@ -0,0 +1,728 @@ +From 3d0653d618e62e969ecb5f3bf8c35a2c5b64d531 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 25 Mar 2021 23:23:50 +0530 +Subject: [PATCH] ath11k: Add support to parse new wmi event for 6G regulatory + +In order to support different power levels of 6G AP and client, new +wmi event for regulatory is added in FW (WMI_REG_CHAN_LIST_CC_EXT_EVENTID) +to provide new parameters required for 6G regulatory rules. + +FW advertises its capability of handling new event in wmi service ready +event. Based on that, host needs to set host_service_flags in wmi init +command to indicate that host supports processing of new wmi event. +Based on advertised host capability, FW decides to send old event +(WMI_REG_CHAN_LIST_CC_EVENTID) or new event(WMI_REG_CHAN_LIST_CC_EXT_EVENTID). + +Added support for parsing 2G/5G/6G reg rules and other parameters from +WMI_REG_CHAN_LIST_CC_EXT_EVENTID, to populate the channel lists. +Since 6G requires additional power value fields(PSD info), reg rule parsing +function is updated accordingly to handle it. + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/reg.c | 36 +++- + drivers/net/wireless/ath/ath11k/wmi.c | 361 +++++++++++++++++++++++++++++++++- + drivers/net/wireless/ath/ath11k/wmi.h | 101 ++++++++++ + 3 files changed, 487 insertions(+), 11 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/reg.c ++++ b/drivers/net/wireless/ath/ath11k/reg.c +@@ -513,7 +513,7 @@ ath11k_reg_build_regd(struct ath11k_base + { + struct ieee80211_regdomain *tmp_regd, *default_regd, *new_regd = NULL; + struct cur_reg_rule *reg_rule; +- u8 i = 0, j = 0; ++ u8 i = 0, j = 0, k = 0; + u8 num_rules; + u16 max_bw; + u32 flags; +@@ -521,6 +521,13 @@ ath11k_reg_build_regd(struct ath11k_base + + num_rules = reg_info->num_5g_reg_rules + reg_info->num_2g_reg_rules; + ++ /* FIXME: Currently taking reg rules for 6G only from Indoor AP mode list. ++ * This can be updated to choose the combination dynamically based on AP ++ * type and client type, after complete 6G regulatory support is added. ++ */ ++ if (reg_info->is_ext_reg_event) ++ num_rules += reg_info->num_6g_reg_rules_ap[WMI_REG_INDOOR_AP]; ++ + if (!num_rules) + goto ret; + +@@ -566,6 +573,12 @@ ath11k_reg_build_regd(struct ath11k_base + * per other BW rule flags we pass from here + */ + flags = NL80211_RRF_AUTO_BW; ++ } else if (reg_info->is_ext_reg_event && reg_info->num_6g_reg_rules_ap[WMI_REG_INDOOR_AP] && ++ (k < reg_info->num_6g_reg_rules_ap[WMI_REG_INDOOR_AP])) { ++ reg_rule = reg_info->reg_rules_6g_ap_ptr[WMI_REG_INDOOR_AP] + k++; ++ max_bw = min_t(u16, reg_rule->max_bw, ++ reg_info->max_bw_6g_ap[WMI_REG_INDOOR_AP]); ++ flags = NL80211_RRF_AUTO_BW; + } else { + break; + } +@@ -593,12 +606,21 @@ ath11k_reg_build_regd(struct ath11k_base + continue; + } + +- ath11k_dbg(ab, ATH11K_DBG_REG, +- "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", +- i + 1, reg_rule->start_freq, reg_rule->end_freq, +- max_bw, reg_rule->ant_gain, reg_rule->reg_power, +- tmp_regd->reg_rules[i].dfs_cac_ms, +- flags); ++ if (reg_info->is_ext_reg_event) { ++ ath11k_dbg(ab, ATH11K_DBG_REG, ++ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d) \n", ++ i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, ++ reg_rule->ant_gain, reg_rule->reg_power, ++ tmp_regd->reg_rules[i].dfs_cac_ms, flags, reg_rule->psd_flag, ++ reg_rule->psd_eirp); ++ } else { ++ ath11k_dbg(ab, ATH11K_DBG_REG, ++ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", ++ i + 1, reg_rule->start_freq, reg_rule->end_freq, ++ max_bw, reg_rule->ant_gain, reg_rule->reg_power, ++ tmp_regd->reg_rules[i].dfs_cac_ms, ++ flags); ++ } + } + + tmp_regd->n_reg_rules = i; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -101,6 +101,8 @@ static const struct wmi_tlv_policy wmi_t + = { .min_len = sizeof(struct wmi_vdev_stopped_event) }, + [WMI_TAG_REG_CHAN_LIST_CC_EVENT] + = { .min_len = sizeof(struct wmi_reg_chan_list_cc_event) }, ++ [WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT] ++ = { .min_len = sizeof(struct wmi_reg_chan_list_cc_ext_event) }, + [WMI_TAG_MGMT_RX_HDR] + = { .min_len = sizeof(struct wmi_mgmt_rx_hdr) }, + [WMI_TAG_MGMT_TX_COMPL_EVENT] +@@ -4371,6 +4373,9 @@ ath11k_wmi_copy_resource_config(struct w + wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; + wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; + wmi_cfg->max_num_group_keys = tg_cfg->max_num_group_keys; ++ wmi_cfg->host_service_flags &= ~(1 << WMI_RSRC_CFG_HOST_SERVICE_FLAG_REG_CC_EXT_SUPPORT_BIT); ++ wmi_cfg->host_service_flags |= tg_cfg->is_reg_cc_ext_event_supported << ++ WMI_RSRC_CFG_HOST_SERVICE_FLAG_REG_CC_EXT_SUPPORT_BIT; + } + + static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi, +@@ -4591,6 +4596,9 @@ int ath11k_wmi_cmd_init(struct ath11k_ba + config.ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD; + config.beacon_tx_offload_max_vdev += config.ema_max_vap_cnt; + ++ if (test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT, ab->wmi_ab.svc_map)) ++ config.is_reg_cc_ext_event_supported = 1; ++ + if (ab->nss.enabled) + config.max_num_group_keys = ATH11K_GROUP_KEYS_NUM_MAX; + +@@ -5414,6 +5422,8 @@ static int ath11k_pull_reg_chan_list_upd + else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_FAIL) + reg_info->status_code = REG_SET_CC_STATUS_FAIL; + ++ reg_info->is_ext_reg_event = false; ++ + reg_info->min_bw_2g = chan_list_event_hdr->min_bw_2g; + reg_info->max_bw_2g = chan_list_event_hdr->max_bw_2g; + reg_info->min_bw_5g = chan_list_event_hdr->min_bw_5g; +@@ -5464,6 +5474,347 @@ static int ath11k_pull_reg_chan_list_upd + return 0; + } + ++static struct cur_reg_rule ++*create_ext_reg_rules_from_wmi(u32 num_reg_rules, ++ struct wmi_regulatory_ext_rule_struct *wmi_reg_rule) ++{ ++ struct cur_reg_rule *reg_rule_ptr; ++ u32 count; ++ ++ reg_rule_ptr = kzalloc((num_reg_rules * sizeof(*reg_rule_ptr)), ++ GFP_ATOMIC); ++ ++ if (!reg_rule_ptr) ++ return NULL; ++ ++ for (count = 0; count < num_reg_rules; count++) { ++ reg_rule_ptr[count].start_freq = ++ FIELD_GET(REG_RULE_START_FREQ, ++ wmi_reg_rule[count].freq_info); ++ reg_rule_ptr[count].end_freq = ++ FIELD_GET(REG_RULE_END_FREQ, ++ wmi_reg_rule[count].freq_info); ++ reg_rule_ptr[count].max_bw = ++ FIELD_GET(REG_RULE_MAX_BW, ++ wmi_reg_rule[count].bw_pwr_info); ++ reg_rule_ptr[count].reg_power = ++ FIELD_GET(REG_RULE_REG_PWR, ++ wmi_reg_rule[count].bw_pwr_info); ++ reg_rule_ptr[count].ant_gain = ++ FIELD_GET(REG_RULE_ANT_GAIN, ++ wmi_reg_rule[count].bw_pwr_info); ++ reg_rule_ptr[count].flags = ++ FIELD_GET(REG_RULE_FLAGS, ++ wmi_reg_rule[count].flag_info); ++ reg_rule_ptr[count].psd_flag = ++ FIELD_GET(REG_RULE_PSD_INFO, ++ wmi_reg_rule[count].psd_power_info); ++ reg_rule_ptr[count].psd_eirp = ++ FIELD_GET(REG_RULE_PSD_EIRP, ++ wmi_reg_rule[count].psd_power_info); ++ } ++ ++ return reg_rule_ptr; ++} ++ ++static int ath11k_pull_reg_chan_list_ext_update_ev(struct ath11k_base *ab, ++ struct sk_buff *skb, ++ struct cur_regulatory_info *reg_info) ++{ ++ const void **tb; ++ const struct wmi_reg_chan_list_cc_ext_event *ext_chan_list_event_hdr; ++ struct wmi_regulatory_ext_rule_struct *ext_wmi_reg_rule; ++ u32 num_2g_reg_rules, num_5g_reg_rules; ++ u32 num_6g_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ u32 num_6g_reg_rules_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++ u32 total_reg_rules = 0; ++ int ret, i, j; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory ext channel list\n"); ++ ++ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); ++ if (IS_ERR(tb)) { ++ ret = PTR_ERR(tb); ++ ath11k_warn(ab, "failed to parse tlv: %d\n", ret); ++ return ret; ++ } ++ ++ ext_chan_list_event_hdr = tb[WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT]; ++ if (!ext_chan_list_event_hdr) { ++ ath11k_warn(ab, "failed to fetch reg chan list ext update ev\n"); ++ kfree(tb); ++ return -EPROTO; ++ } ++ ++ reg_info->num_2g_reg_rules = ext_chan_list_event_hdr->num_2g_reg_rules; ++ reg_info->num_5g_reg_rules = ext_chan_list_event_hdr->num_5g_reg_rules; ++ reg_info->num_6g_reg_rules_ap[WMI_REG_INDOOR_AP] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_ap_lpi; ++ reg_info->num_6g_reg_rules_ap[WMI_REG_STANDARD_POWER_AP] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_ap_sp; ++ reg_info->num_6g_reg_rules_ap[WMI_REG_VERY_LOW_POWER_AP] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_ap_vlp; ++ ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) { ++ reg_info->num_6g_reg_rules_client[WMI_REG_INDOOR_AP][i] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_client_lpi[i]; ++ reg_info->num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][i] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_client_sp[i]; ++ reg_info->num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] = ++ ext_chan_list_event_hdr->num_6g_reg_rules_client_vlp[i]; ++ } ++ ++ num_2g_reg_rules = reg_info->num_2g_reg_rules; ++ total_reg_rules += num_2g_reg_rules; ++ num_5g_reg_rules = reg_info->num_5g_reg_rules; ++ total_reg_rules += num_5g_reg_rules; ++ ++ if ((num_2g_reg_rules > MAX_REG_RULES) || (num_5g_reg_rules > MAX_REG_RULES)) { ++ ath11k_warn(ab, "Num reg rules for 2G/5G exceeds max limit (num_2g_reg_rules: %d num_5g_reg_rules: %d max_rules: %d)\n", ++ num_2g_reg_rules, num_5g_reg_rules, MAX_REG_RULES); ++ kfree(tb); ++ return -EINVAL; ++ } ++ ++ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) { ++ num_6g_reg_rules_ap[i] = reg_info->num_6g_reg_rules_ap[i]; ++ ++ if (num_6g_reg_rules_ap[i] > MAX_6G_REG_RULES) { ++ ath11k_warn(ab, "Num 6G reg rules for AP mode(%d) exceeds max limit (num_6g_reg_rules_ap: %d, max_rules: %d)\n", ++ i, num_6g_reg_rules_ap[i], MAX_6G_REG_RULES); ++ kfree(tb); ++ return -EINVAL; ++ } ++ ++ total_reg_rules += num_6g_reg_rules_ap[i]; ++ } ++ ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) { ++ num_6g_reg_rules_client[WMI_REG_INDOOR_AP][i] = ++ reg_info->num_6g_reg_rules_client[WMI_REG_INDOOR_AP][i]; ++ total_reg_rules += num_6g_reg_rules_client[WMI_REG_INDOOR_AP][i]; ++ ++ num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][i] = ++ reg_info->num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][i]; ++ total_reg_rules += num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][i]; ++ ++ num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] = ++ reg_info->num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][i]; ++ total_reg_rules += num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][i]; ++ ++ if ((num_6g_reg_rules_client[WMI_REG_INDOOR_AP][i] > MAX_6G_REG_RULES) || ++ (num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][i] > MAX_6G_REG_RULES) || ++ (num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] > MAX_6G_REG_RULES)) { ++ ath11k_warn(ab, "Num 6g client reg rules exceeds max limit, for client(type: %d)\n", i); ++ kfree(tb); ++ return -EINVAL; ++ } ++ } ++ ++ if (!total_reg_rules) { ++ ath11k_warn(ab, "No reg rules available\n"); ++ kfree(tb); ++ return -EINVAL; ++ } ++ ++ memcpy(reg_info->alpha2, &ext_chan_list_event_hdr->alpha2, ++ REG_ALPHA2_LEN); ++ ++ /* FIXME: Currently FW includes 6G reg rule also in 5G rule ++ * list for country US. ++ * Having same 6G reg rule in 5G and 6G rules list causes ++ * intersect check to be true, and same rules will be shown ++ * multiple times in iw cmd. So added hack below to avoid ++ * parsing 6G rule from 5G reg rule list, and this can be ++ * removed later, after FW updates to remove 6G reg rule ++ * from 5G rules list. ++ */ ++ if (memcmp(reg_info->alpha2, "US", 2) == 0) { ++ reg_info->num_5g_reg_rules = REG_US_5G_NUM_REG_RULES; ++ num_5g_reg_rules = reg_info->num_5g_reg_rules; ++ } ++ ++ reg_info->dfs_region = ext_chan_list_event_hdr->dfs_region; ++ reg_info->phybitmap = ext_chan_list_event_hdr->phybitmap; ++ reg_info->num_phy = ext_chan_list_event_hdr->num_phy; ++ reg_info->phy_id = ext_chan_list_event_hdr->phy_id; ++ reg_info->ctry_code = ext_chan_list_event_hdr->country_id; ++ reg_info->reg_dmn_pair = ext_chan_list_event_hdr->domain_code; ++ ++ switch(ext_chan_list_event_hdr->status_code) { ++ case WMI_REG_SET_CC_STATUS_PASS: ++ reg_info->status_code = REG_SET_CC_STATUS_PASS; ++ break; ++ case WMI_REG_CURRENT_ALPHA2_NOT_FOUND: ++ reg_info->status_code = REG_CURRENT_ALPHA2_NOT_FOUND; ++ break; ++ case WMI_REG_INIT_ALPHA2_NOT_FOUND: ++ reg_info->status_code = REG_INIT_ALPHA2_NOT_FOUND; ++ break; ++ case WMI_REG_SET_CC_CHANGE_NOT_ALLOWED: ++ reg_info->status_code = REG_SET_CC_CHANGE_NOT_ALLOWED; ++ break; ++ case WMI_REG_SET_CC_STATUS_NO_MEMORY: ++ reg_info->status_code = REG_SET_CC_STATUS_NO_MEMORY; ++ break; ++ case WMI_REG_SET_CC_STATUS_FAIL: ++ reg_info->status_code = REG_SET_CC_STATUS_FAIL; ++ break; ++ } ++ ++ reg_info->is_ext_reg_event = true; ++ ++ reg_info->min_bw_2g = ext_chan_list_event_hdr->min_bw_2g; ++ reg_info->max_bw_2g = ext_chan_list_event_hdr->max_bw_2g; ++ reg_info->min_bw_5g = ext_chan_list_event_hdr->min_bw_5g; ++ reg_info->max_bw_5g = ext_chan_list_event_hdr->max_bw_5g; ++ reg_info->min_bw_6g_ap[WMI_REG_INDOOR_AP] = ++ ext_chan_list_event_hdr->min_bw_6g_ap_lpi; ++ reg_info->max_bw_6g_ap[WMI_REG_INDOOR_AP] = ++ ext_chan_list_event_hdr->max_bw_6g_ap_lpi; ++ reg_info->min_bw_6g_ap[WMI_REG_STANDARD_POWER_AP] = ++ ext_chan_list_event_hdr->min_bw_6g_ap_sp; ++ reg_info->max_bw_6g_ap[WMI_REG_STANDARD_POWER_AP] = ++ ext_chan_list_event_hdr->max_bw_6g_ap_sp; ++ reg_info->min_bw_6g_ap[WMI_REG_VERY_LOW_POWER_AP] = ++ ext_chan_list_event_hdr->min_bw_6g_ap_vlp; ++ reg_info->max_bw_6g_ap[WMI_REG_VERY_LOW_POWER_AP] = ++ ext_chan_list_event_hdr->max_bw_6g_ap_vlp; ++ ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) { ++ reg_info->min_bw_6g_client[WMI_REG_INDOOR_AP][i] = ++ ext_chan_list_event_hdr->min_bw_6g_client_lpi[i]; ++ reg_info->max_bw_6g_client[WMI_REG_INDOOR_AP][i] = ++ ext_chan_list_event_hdr->max_bw_6g_client_lpi[i]; ++ reg_info->min_bw_6g_client[WMI_REG_STANDARD_POWER_AP][i] = ++ ext_chan_list_event_hdr->min_bw_6g_client_sp[i]; ++ reg_info->max_bw_6g_client[WMI_REG_STANDARD_POWER_AP][i] = ++ ext_chan_list_event_hdr->max_bw_6g_client_sp[i]; ++ reg_info->min_bw_6g_client[WMI_REG_VERY_LOW_POWER_AP][i] = ++ ext_chan_list_event_hdr->min_bw_6g_client_vlp[i]; ++ reg_info->max_bw_6g_client[WMI_REG_VERY_LOW_POWER_AP][i] = ++ ext_chan_list_event_hdr->max_bw_6g_client_vlp[i]; ++ } ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "%s:cc_ext %s dsf %d BW: min_2g %d max_2g %d min_5g %d max_5g %d", ++ __func__, reg_info->alpha2, reg_info->dfs_region, ++ reg_info->min_bw_2g, reg_info->max_bw_2g, ++ reg_info->min_bw_5g, reg_info->max_bw_5g); ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "num_2g_reg_rules %d num_5g_reg_rules %d", ++ num_2g_reg_rules, num_5g_reg_rules); ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "num_6g_reg_rules_ap_lpi: %d num_6g_reg_rules_ap_sp: %d num_6g_reg_rules_ap_vlp: %d", ++ num_6g_reg_rules_ap[WMI_REG_INDOOR_AP], num_6g_reg_rules_ap[WMI_REG_STANDARD_POWER_AP], ++ num_6g_reg_rules_ap[WMI_REG_VERY_LOW_POWER_AP]); ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "6g Regular client: num_6g_reg_rules_lpi: %d num_6g_reg_rules_sp: %d num_6g_reg_rules_vlp: %d", ++ num_6g_reg_rules_client[WMI_REG_INDOOR_AP][WMI_REG_DEFAULT_CLIENT], ++ num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][WMI_REG_DEFAULT_CLIENT], ++ num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][WMI_REG_DEFAULT_CLIENT]); ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "6g Subordinate client: num_6g_reg_rules_lpi: %d num_6g_reg_rules_sp: %d num_6g_reg_rules_vlp: %d", ++ num_6g_reg_rules_client[WMI_REG_INDOOR_AP][WMI_REG_SUBORDINATE_CLIENT], ++ num_6g_reg_rules_client[WMI_REG_STANDARD_POWER_AP][WMI_REG_SUBORDINATE_CLIENT], ++ num_6g_reg_rules_client[WMI_REG_VERY_LOW_POWER_AP][WMI_REG_SUBORDINATE_CLIENT]); ++ ++ ext_wmi_reg_rule = ++ (struct wmi_regulatory_rule_ext_struct *)((u8 *)ext_chan_list_event_hdr ++ + sizeof(*ext_chan_list_event_hdr) ++ + sizeof(struct wmi_tlv)); ++ ++ if (num_2g_reg_rules) { ++ reg_info->reg_rules_2g_ptr = create_ext_reg_rules_from_wmi(num_2g_reg_rules, ++ ext_wmi_reg_rule); ++ ++ if (!reg_info->reg_rules_2g_ptr) { ++ kfree(tb); ++ ath11k_warn(ab, "Unable to Allocate memory for 2g rules\n"); ++ return -ENOMEM; ++ } ++ } ++ ++ if (num_5g_reg_rules) { ++ ext_wmi_reg_rule += num_2g_reg_rules; ++ reg_info->reg_rules_5g_ptr = create_ext_reg_rules_from_wmi(num_5g_reg_rules, ++ ext_wmi_reg_rule); ++ ++ if (!reg_info->reg_rules_5g_ptr) { ++ kfree(tb); ++ ath11k_warn(ab, "Unable to Allocate memory for 5g rules\n"); ++ return -ENOMEM; ++ } ++ } ++ ++ ext_wmi_reg_rule += num_5g_reg_rules; ++ ++ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) { ++ reg_info->reg_rules_6g_ap_ptr[i] = ++ create_ext_reg_rules_from_wmi(num_6g_reg_rules_ap[i], ++ ext_wmi_reg_rule); ++ ++ if (!reg_info->reg_rules_6g_ap_ptr[i]) { ++ kfree(tb); ++ ath11k_warn(ab, "Unable to Allocate memory for 6g ap rules\n"); ++ return -ENOMEM; ++ } ++ ++ ext_wmi_reg_rule += num_6g_reg_rules_ap[i]; ++ } ++ ++ for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++) { ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) { ++ reg_info->reg_rules_6g_client_ptr[j][i] = ++ create_ext_reg_rules_from_wmi(num_6g_reg_rules_client[j][i], ++ ext_wmi_reg_rule); ++ ++ if (!reg_info->reg_rules_6g_client_ptr[j][i]) { ++ kfree(tb); ++ ath11k_warn(ab, "Unable to Allocate memory for 6g client rules\n"); ++ return -ENOMEM; ++ } ++ ++ ext_wmi_reg_rule += num_6g_reg_rules_client[j][i]; ++ } ++ } ++ ++ reg_info->client_type = ext_chan_list_event_hdr->client_type; ++ reg_info->rnr_tpe_usable = ext_chan_list_event_hdr->rnr_tpe_usable; ++ reg_info->unspecified_ap_usable = ++ ext_chan_list_event_hdr->unspecified_ap_usable; ++ reg_info->domain_code_6g_ap[WMI_REG_INDOOR_AP] = ++ ext_chan_list_event_hdr->domain_code_6g_ap_lpi; ++ reg_info->domain_code_6g_ap[WMI_REG_STANDARD_POWER_AP] = ++ ext_chan_list_event_hdr->domain_code_6g_ap_sp; ++ reg_info->domain_code_6g_ap[WMI_REG_VERY_LOW_POWER_AP] = ++ ext_chan_list_event_hdr->domain_code_6g_ap_vlp; ++ ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) { ++ reg_info->domain_code_6g_client[WMI_REG_INDOOR_AP][i] = ++ ext_chan_list_event_hdr->domain_code_6g_client_lpi[i]; ++ reg_info->domain_code_6g_client[WMI_REG_STANDARD_POWER_AP][i] = ++ ext_chan_list_event_hdr->domain_code_6g_client_sp[i]; ++ reg_info->domain_code_6g_client[WMI_REG_VERY_LOW_POWER_AP][i] = ++ ext_chan_list_event_hdr->domain_code_6g_client_vlp[i]; ++ } ++ ++ reg_info->domain_code_6g_super_id = ++ ext_chan_list_event_hdr->domain_code_6g_super_id; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, "6g client_type: %d domain_code_6g_super_id: %d", ++ reg_info->client_type, reg_info->domain_code_6g_super_id); ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory ext channel list\n"); ++ ++ kfree(tb); ++ return 0; ++} ++ + static int ath11k_pull_peer_del_resp_ev(struct ath11k_base *ab, struct sk_buff *skb, + struct wmi_peer_delete_resp_event *peer_del_resp) + { +@@ -6782,12 +7133,12 @@ static bool ath11k_reg_is_world_alpha(ch + return alpha[0] == '0' && alpha[1] == '0'; + } + +-static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *skb) ++static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *skb, enum wmi_reg_chan_list_cmd_type id) + { + struct cur_regulatory_info *reg_info = NULL; + struct ieee80211_regdomain *regd = NULL; + bool intersect = false; +- int ret = 0, pdev_idx; ++ int ret = 0, pdev_idx, i, j; + struct ath11k *ar; + + reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC); +@@ -6796,7 +7147,11 @@ static int ath11k_reg_chan_list_event(st + goto fallback; + } + +- ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info); ++ if (id == WMI_REG_CHAN_LIST_CC_ID) ++ ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info); ++ else ++ ret = ath11k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info); ++ + if (ret) { + ath11k_warn(ab, "failed to extract regulatory info from received event\n"); + goto fallback; +@@ -6898,6 +7253,14 @@ mem_free: + if (reg_info) { + kfree(reg_info->reg_rules_2g_ptr); + kfree(reg_info->reg_rules_5g_ptr); ++ if (reg_info->is_ext_reg_event) { ++ for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) ++ kfree(reg_info->reg_rules_6g_ap_ptr[i]); ++ ++ for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++) ++ for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) ++ kfree(reg_info->reg_rules_6g_client_ptr[j][i]); ++ } + kfree(reg_info); + } + return ret; +@@ -9146,7 +9509,10 @@ static void ath11k_wmi_tlv_op_rx(struct + ath11k_service_ready_ext2_event(ab, skb); + break; + case WMI_REG_CHAN_LIST_CC_EVENTID: +- ath11k_reg_chan_list_event(ab, skb); ++ ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_ID); ++ break; ++ case WMI_REG_CHAN_LIST_CC_EXT_EVENTID: ++ ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_EXT_ID); + break; + case WMI_READY_EVENTID: + ath11k_ready_event(ab, skb); +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -815,6 +815,7 @@ enum wmi_tlv_event_id { + WMI_RMC_NEW_LEADER_EVENTID = WMI_TLV_CMD(WMI_GRP_RMC), + WMI_REG_CHAN_LIST_CC_EVENTID = WMI_TLV_CMD(WMI_GRP_REGULATORY), + WMI_11D_NEW_COUNTRY_EVENTID, ++ WMI_REG_CHAN_LIST_CC_EXT_EVENTID, + WMI_NDI_CAP_RSP_EVENTID = WMI_TLV_CMD(WMI_GRP_PROTOTYPE), + WMI_NDP_INITIATOR_RSP_EVENTID, + WMI_NDP_RESPONDER_RSP_EVENTID, +@@ -1903,6 +1904,9 @@ enum wmi_tlv_tag { + /* TODO add all the missing cmds */ + WMI_TAG_QOS_NULL_FRAME_TX_SEND = 0x3A6, + WMI_TAG_QOS_NULL_FRAME_TX_STATUS, ++ WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9, ++ WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT, ++ + WMI_CTRL_PATH_CAL_STATS = 0x3BC, + + WMI_TAG_MAX +@@ -2175,6 +2179,7 @@ enum wmi_tlv_service { + WMI_TLV_SERVICE_FSE_CMEM_ALLOC_SUPPORT = 262, + WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE = 263, + WMI_TLV_SERVICE_QOS_NULL_FRAME_TX_OVER_WMI = 264, ++ WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT = 281, + + WMI_MAX_EXT2_SERVICE + }; +@@ -2386,6 +2391,7 @@ struct wmi_init_cmd { + + #define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5) + #define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18) ++#define WMI_RSRC_CFG_HOST_SERVICE_FLAG_REG_CC_EXT_SUPPORT_BIT 4 + + struct wmi_resource_config { + u32 tlv_header; +@@ -2968,6 +2974,8 @@ struct rx_reorder_queue_remove_params { + #define REG_RULE_MAX_BW 0x0000ffff + #define REG_RULE_REG_PWR 0x00ff0000 + #define REG_RULE_ANT_GAIN 0xff000000 ++#define REG_RULE_PSD_INFO BIT(2) ++#define REG_RULE_PSD_EIRP 0xffff0000 + + #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0) + #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1) +@@ -4300,6 +4308,8 @@ struct wmi_he_rate_set { + + #define MAX_REG_RULES 10 + #define REG_ALPHA2_LEN 2 ++#define MAX_6G_REG_RULES 5 ++#define REG_US_5G_NUM_REG_RULES 4 + + enum wmi_start_event_param { + WMI_VDEV_START_RESP_EVENT = 0, +@@ -4362,6 +4372,21 @@ enum { + WMI_REG_SET_CC_STATUS_FAIL = 5, + }; + ++enum wmi_reg_6g_ap_type { ++ WMI_REG_INDOOR_AP = 0, ++ WMI_REG_STANDARD_POWER_AP = 1, ++ WMI_REG_VERY_LOW_POWER_AP = 2, ++ WMI_REG_CURRENT_MAX_AP_TYPE, ++ WMI_REG_MAX_SUPP_AP_TYPE = WMI_REG_VERY_LOW_POWER_AP, ++ WMI_REG_MAX_AP_TYPE = 7, ++}; ++ ++enum wmi_reg_6g_client_type { ++ WMI_REG_DEFAULT_CLIENT = 0, ++ WMI_REG_SUBORDINATE_CLIENT = 1, ++ WMI_REG_MAX_CLIENT_TYPE = 2, ++}; ++ + struct cur_reg_rule { + u16 start_freq; + u16 end_freq; +@@ -4369,6 +4394,8 @@ struct cur_reg_rule { + u8 reg_power; + u8 ant_gain; + u16 flags; ++ bool psd_flag; ++ u16 psd_eirp; + }; + + struct cur_regulatory_info { +@@ -4380,6 +4407,7 @@ struct cur_regulatory_info { + u8 alpha2[REG_ALPHA2_LEN + 1]; + u32 dfs_region; + u32 phybitmap; ++ bool is_ext_reg_event; + u32 min_bw_2g; + u32 max_bw_2g; + u32 min_bw_5g; +@@ -4388,6 +4416,28 @@ struct cur_regulatory_info { + u32 num_5g_reg_rules; + struct cur_reg_rule *reg_rules_2g_ptr; + struct cur_reg_rule *reg_rules_5g_ptr; ++ enum wmi_reg_6g_client_type client_type; ++ bool rnr_tpe_usable; ++ bool unspecified_ap_usable; ++ /* TODO: All 6G related info can be stored only for required ++ * combination instead of all types, to optimize memory usage. ++ */ ++ u8 domain_code_6g_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ u8 domain_code_6g_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++ u32 domain_code_6g_super_id; ++ u32 min_bw_6g_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ u32 max_bw_6g_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ u32 min_bw_6g_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++ u32 max_bw_6g_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++ u32 num_6g_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ u32 num_6g_reg_rules_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++ struct cur_reg_rule *reg_rules_6g_ap_ptr[WMI_REG_CURRENT_MAX_AP_TYPE]; ++ struct cur_reg_rule *reg_rules_6g_client_ptr[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; ++}; ++ ++enum wmi_reg_chan_list_cmd_type { ++ WMI_REG_CHAN_LIST_CC_ID = 0, ++ WMI_REG_CHAN_LIST_CC_EXT_ID = 1, + }; + + struct wmi_reg_chan_list_cc_event { +@@ -4418,6 +4468,61 @@ struct wmi_vdev_delete_resp_event { + u32 vdev_id; + } __packed; + ++#define WMI_REG_CLIENT_MAX 4 ++ ++struct wmi_reg_chan_list_cc_ext_event { ++ u32 status_code; ++ u32 phy_id; ++ u32 alpha2; ++ u32 num_phy; ++ u32 country_id; ++ u32 domain_code; ++ u32 dfs_region; ++ u32 phybitmap; ++ u32 min_bw_2g; ++ u32 max_bw_2g; ++ u32 min_bw_5g; ++ u32 max_bw_5g; ++ u32 num_2g_reg_rules; ++ u32 num_5g_reg_rules; ++ u32 client_type; ++ u32 rnr_tpe_usable; ++ u32 unspecified_ap_usable; ++ u32 domain_code_6g_ap_lpi; ++ u32 domain_code_6g_ap_sp; ++ u32 domain_code_6g_ap_vlp; ++ u32 domain_code_6g_client_lpi[WMI_REG_CLIENT_MAX]; ++ u32 domain_code_6g_client_sp[WMI_REG_CLIENT_MAX]; ++ u32 domain_code_6g_client_vlp[WMI_REG_CLIENT_MAX]; ++ u32 domain_code_6g_super_id; ++ u32 min_bw_6g_ap_sp; ++ u32 max_bw_6g_ap_sp; ++ u32 min_bw_6g_ap_lpi; ++ u32 max_bw_6g_ap_lpi; ++ u32 min_bw_6g_ap_vlp; ++ u32 max_bw_6g_ap_vlp; ++ u32 min_bw_6g_client_sp[WMI_REG_CLIENT_MAX]; ++ u32 max_bw_6g_client_sp[WMI_REG_CLIENT_MAX]; ++ u32 min_bw_6g_client_lpi[WMI_REG_CLIENT_MAX]; ++ u32 max_bw_6g_client_lpi[WMI_REG_CLIENT_MAX]; ++ u32 min_bw_6g_client_vlp[WMI_REG_CLIENT_MAX]; ++ u32 max_bw_6g_client_vlp[WMI_REG_CLIENT_MAX]; ++ u32 num_6g_reg_rules_ap_sp; ++ u32 num_6g_reg_rules_ap_lpi; ++ u32 num_6g_reg_rules_ap_vlp; ++ u32 num_6g_reg_rules_client_sp[WMI_REG_CLIENT_MAX]; ++ u32 num_6g_reg_rules_client_lpi[WMI_REG_CLIENT_MAX]; ++ u32 num_6g_reg_rules_client_vlp[WMI_REG_CLIENT_MAX]; ++} __packed; ++ ++struct wmi_regulatory_ext_rule_struct { ++ u32 tlv_header; ++ u32 freq_info; ++ u32 bw_pwr_info; ++ u32 flag_info; ++ u32 psd_power_info; ++}; ++ + struct wmi_peer_delete_resp_event { + u32 vdev_id; + struct wmi_mac_addr peer_macaddr; +@@ -6010,6 +6115,7 @@ struct target_resource_config { + u32 twt_ap_sta_count; + u32 ema_max_vap_cnt; + u32 ema_max_profile_period; ++ bool is_reg_cc_ext_event_supported; + }; + + enum wmi_tpc_pream_bw { diff --git a/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-add-177-channel-to-5G-channel-list.patch b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-add-177-channel-to-5G-channel-list.patch new file mode 100644 index 000000000..b092024ed --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-add-177-channel-to-5G-channel-list.patch @@ -0,0 +1,41 @@ +From 69be0c192eba71f6a5411d03d486c7f59d567621 Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Tue, 23 Mar 2021 17:51:12 +0530 +Subject: [PATCH] ath11k: add 177 channel to 5G channel list + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/core.h | 4 ++-- + drivers/net/wireless/ath/ath11k/mac.c | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h +index 325a97f..a319da6 100644 +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -474,8 +474,8 @@ struct ath11k_sta { + #define ATH11K_MIN_5G_FREQ 4150 + #define ATH11K_MIN_6G_FREQ 5925 + #define ATH11K_MAX_6G_FREQ 7125 +-#define ATH11K_NUM_CHANS 101 +-#define ATH11K_MAX_5G_CHAN 173 ++#define ATH11K_NUM_CHANS 102 ++#define ATH11K_MAX_5G_CHAN 177 + + enum ath11k_state { + ATH11K_STATE_OFF, +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index d6d14c4..cd639d0 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -97,6 +97,7 @@ static const struct ieee80211_channel ath11k_5ghz_channels[] = { + CHAN5G(165, 5825, 0), + CHAN5G(169, 5845, 0), + CHAN5G(173, 5865, 0), ++ CHAN5G(177, 5885, 0), + }; + + static const struct ieee80211_channel ath11k_6ghz_channels[] = { +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-tx-mgmt-cleanup-fix.patch b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-tx-mgmt-cleanup-fix.patch new file mode 100644 index 000000000..4b861318d --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/302-ath11k-tx-mgmt-cleanup-fix.patch @@ -0,0 +1,102 @@ +From de7df710540275b29231a989a3a65af9f6cf7659 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Wed, 31 Mar 2021 07:59:52 +0530 +Subject: [PATCH] ath11k: Avoid NULL ptr access during mgmt tx cleanup + +Currently skb_cb values such as ar,vif is not filled during +WMI mgmt tx. Though this is generally not used during callback, +On interface removal, the remaining idr cleanup callback +uses the ar ptr from skb_cb from mgmt txmgmt_idr. Hence +fill them during tx call for proper usage. + +Also free the skb which is missing currently in these +callbacks. + +Crash_info: + +[19282.489476] Unable to handle kernel NULL pointer dereference at virtual address 00000000 +[19282.489515] pgd = 91eb8000 +[19282.496702] [00000000] *pgd=00000000 +[19282.502524] Internal error: Oops: 5 [#1] PREEMPT SMP ARM +[19282.783728] PC is at ath11k_mac_vif_txmgmt_idr_remove+0x28/0xd8 [ath11k] +[19282.789170] LR is at idr_for_each+0xa0/0xc8 + +Signed-off-by: Sriram R +--- + drivers/net/wireless/ath/ath11k/mac.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5691,23 +5691,36 @@ static int __ath11k_set_antenna(struct a + return 0; + } + +-int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx) ++static void ath11k_mac_tx_mgmt_free(struct ath11k *ar, int buf_id) + { +- struct sk_buff *msdu = skb; ++ struct sk_buff *msdu; + struct ieee80211_tx_info *info; +- struct ath11k *ar = ctx; +- struct ath11k_base *ab = ar->ab; + + spin_lock_bh(&ar->txmgmt_idr_lock); +- idr_remove(&ar->txmgmt_idr, buf_id); ++ msdu = idr_remove(&ar->txmgmt_idr, buf_id); + spin_unlock_bh(&ar->txmgmt_idr_lock); +- dma_unmap_single(ab->dev, ATH11K_SKB_CB(msdu)->paddr, msdu->len, ++ ++ /* msdu is already removed if msdu is NULL, ++ * if msdu is not NULL we free the skb below and ++ * idr wont be seen if any concurent tx completion happen ++ */ ++ if (!msdu) ++ return; ++ ++ dma_unmap_single(ar->ab->dev, ATH11K_SKB_CB(msdu)->paddr, msdu->len, + DMA_TO_DEVICE); + + info = IEEE80211_SKB_CB(msdu); + memset(&info->status, 0, sizeof(info->status)); + + ieee80211_free_txskb(ar->hw, msdu); ++} ++ ++int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx) ++{ ++ struct ath11k *ar = ctx; ++ ++ ath11k_mac_tx_mgmt_free(ar, buf_id); + + return 0; + } +@@ -5716,17 +5729,10 @@ static int ath11k_mac_vif_txmgmt_idr_rem + { + struct ieee80211_vif *vif = ctx; + struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB((struct sk_buff *)skb); +- struct sk_buff *msdu = skb; + struct ath11k *ar = skb_cb->ar; +- struct ath11k_base *ab = ar->ab; + +- if (skb_cb->vif == vif) { +- spin_lock_bh(&ar->txmgmt_idr_lock); +- idr_remove(&ar->txmgmt_idr, buf_id); +- spin_unlock_bh(&ar->txmgmt_idr_lock); +- dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, +- DMA_TO_DEVICE); +- } ++ if (skb_cb->vif == vif) ++ ath11k_mac_tx_mgmt_free(ar, buf_id); + + return 0; + } +@@ -5767,6 +5773,8 @@ static int ath11k_mac_mgmt_tx_wmi(struct + } + + ATH11K_SKB_CB(skb)->paddr = paddr; ++ ATH11K_SKB_CB(skb)->vif = arvif->vif; ++ ATH11K_SKB_CB(skb)->ar = ar; + + if (ieee80211_is_qos_nullfunc(hdr->frame_control)) { + ret = ath11k_wmi_qos_null_send(ar, arvif->vdev_id, buf_id, skb); diff --git a/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-Fix-for-incorrect-PHY-mode-for-Legacy-modes-P.patch b/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-Fix-for-incorrect-PHY-mode-for-Legacy-modes-P.patch new file mode 100644 index 000000000..90ebfe08e --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-Fix-for-incorrect-PHY-mode-for-Legacy-modes-P.patch @@ -0,0 +1,191 @@ +From 58b9bfce32f7e1d0979e65160a941661c95dadfd Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Mon, 17 May 2021 16:43:15 +0530 +Subject: [PATCH] ath11k : fix for incorrect PHY mode for Legacy modes (Pre-11ax) + +AP phymode is always set as “MODE_11AX_HE” from ath11k_phymodes[][] +in ath11k_mac_vdev_start_restart(). To get the configured phymode in +CFR meta data, ath11k_cfr_chan_to_phymode() is introduced. + +Signed-off-by: Abinaya Kalaiselvan +Signed-off-by: Hari Chandrakanthan +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/hw.c | 4 +- + drivers/net/wireless/ath/ath11k/mac.c | 119 +++++++++++++++++++++++++++++++++ + 3 files changed, 122 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h +index 827b8b4..206e63c 100644 +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -751,6 +751,7 @@ struct ath11k { + #endif + u8 cfr_enabled; + bool ani_enabled; ++ enum wmi_phy_mode cfr_phymode; + }; + + struct ath11k_band_cap { +diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c +index 2563efc..af40d7f 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -860,7 +860,7 @@ void ath11k_hw_ipq8074_fill_cfr_hdr_info(struct ath11k *ar, + header->u.meta_v4.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, + params->status); + header->u.meta_v4.capture_bw = params->bandwidth; +- header->u.meta_v4.phy_mode = params->phy_mode; ++ header->u.meta_v4.phy_mode = ar->cfr_phymode; + header->u.meta_v4.prim20_chan = params->primary_20mhz_chan; + header->u.meta_v4.center_freq1 = params->band_center_freq1; + header->u.meta_v4.center_freq2 = params->band_center_freq2; +@@ -896,7 +896,7 @@ void ath11k_hw_qcn9074_fill_cfr_hdr_info(struct ath11k *ar, + header->u.meta_v5.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS, + params->status); + header->u.meta_v5.capture_bw = params->bandwidth; +- header->u.meta_v5.phy_mode = params->phy_mode; ++ header->u.meta_v5.phy_mode = ar->cfr_phymode; + header->u.meta_v5.prim20_chan = params->primary_20mhz_chan; + header->u.meta_v5.center_freq1 = params->band_center_freq1; + header->u.meta_v5.center_freq2 = params->band_center_freq2; +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index d0e187e..dddbedc 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -607,6 +607,124 @@ static void ath11k_pdev_caps_update(struct ath11k *ar) + ar->txpower_scale = WMI_HOST_TP_SCALE_MAX; + } + ++static inline enum wmi_phy_mode ++ath11k_cfr_chan_to_phymode(struct ath11k_vif *arvif) ++{ ++ struct cfg80211_chan_def def; ++ enum wmi_phy_mode phymode = MODE_UNKNOWN; ++ ++ if (ath11k_mac_vif_chan(arvif->vif, &def)) ++ return -EPERM; ++ ++ switch (def.chan->band) { ++ case NL80211_BAND_2GHZ: ++ switch (def.width) { ++ case NL80211_CHAN_WIDTH_20_NOHT: ++ if (def.chan->flags & IEEE80211_CHAN_NO_OFDM) ++ phymode = MODE_11B; ++ else ++ phymode = MODE_11G; ++ break; ++ case NL80211_CHAN_WIDTH_20: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE20_2G; ++ else { ++ if (arvif->vht_cap) ++ phymode = MODE_11AC_VHT20_2G; ++ else ++ phymode = MODE_11NG_HT20; ++ } ++ break; ++ case NL80211_CHAN_WIDTH_40: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE40_2G; ++ else { ++ if (arvif->vht_cap) ++ phymode = MODE_11AC_VHT40_2G; ++ else ++ phymode = MODE_11NG_HT40; ++ } ++ break; ++ default: ++ break; ++ } ++ break; ++ case NL80211_BAND_5GHZ: ++ switch (def.width) { ++ case NL80211_CHAN_WIDTH_20_NOHT: ++ phymode = MODE_11A; ++ break; ++ case NL80211_CHAN_WIDTH_20: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE20; ++ else { ++ if (arvif->vht_cap) ++ phymode = MODE_11AC_VHT20; ++ else ++ phymode = MODE_11NA_HT20; ++ } ++ break; ++ case NL80211_CHAN_WIDTH_40: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE40; ++ else { ++ if (arvif->vht_cap) ++ phymode = MODE_11AC_VHT40; ++ else ++ phymode = MODE_11NA_HT40; ++ } ++ break; ++ case NL80211_CHAN_WIDTH_80: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE80; ++ else ++ phymode = MODE_11AC_VHT80; ++ break; ++ case NL80211_CHAN_WIDTH_160: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE160; ++ else ++ phymode = MODE_11AC_VHT160; ++ break; ++ case NL80211_CHAN_WIDTH_80P80: ++ if (arvif->vif->bss_conf.he_support) ++ phymode = MODE_11AX_HE80_80; ++ else ++ phymode = MODE_11AC_VHT80_80; ++ break; ++ default: ++ break; ++ } ++ break; ++ case NL80211_BAND_6GHZ: ++ switch (def.width) { ++ case NL80211_CHAN_WIDTH_20: ++ phymode = MODE_11AX_HE20; ++ break; ++ case NL80211_CHAN_WIDTH_40: ++ phymode = MODE_11AX_HE40; ++ break; ++ case NL80211_CHAN_WIDTH_80: ++ phymode = MODE_11AX_HE80; ++ break; ++ case NL80211_CHAN_WIDTH_160: ++ phymode = MODE_11AX_HE160; ++ break; ++ case NL80211_CHAN_WIDTH_80P80: ++ phymode = MODE_11AX_HE80_80; ++ break; ++ default: ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ ++ WARN_ON(phymode == MODE_UNKNOWN); ++ return phymode; ++} ++ + static int ath11k_mac_txpower_recalc(struct ath11k *ar) + { + struct ath11k_pdev *pdev = ar->pdev; +@@ -1112,6 +1230,7 @@ static int __ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif, struct sk_buff + vht_cap = (void *)(vht_cap_ie + 2); + arvif->vht_cap = vht_cap->vht_cap_info; + } ++ ar->cfr_phymode = ath11k_cfr_chan_to_phymode(arvif); + + if (cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, + WLAN_OUI_TYPE_MICROSOFT_WPA, +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-send-beacon-template-after-vdev_start-restart.patch b/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-send-beacon-template-after-vdev_start-restart.patch new file mode 100644 index 000000000..78f087e61 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/303-ath11k-send-beacon-template-after-vdev_start-restart.patch @@ -0,0 +1,51 @@ +From 9a70441a25595254334ab45bd23690f78390402b Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 7 Apr 2021 14:40:09 +0530 +Subject: [PATCH] ath11k: send beacon template after vdev_start/restart during + csa + +Firmware has added assert if beacon template is received after +vdev_down. Firmware expects beacon template after vdev_start +and before vdev_up. This change is needed to support MBSSID EMA +cases in firmware. + +Hence, Change the sequence in ath11k as expected from firmware. +This new change is not causing any issues with older +firmware. + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/mac.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index 79d59a9..7b3ad57 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -7137,11 +7137,6 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, + if (WARN_ON(!arvif->is_up)) + continue; + +- ret = ath11k_mac_setup_bcn_tmpl(arvif); +- if (ret) +- ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n", +- ret); +- + ret = ath11k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def); + if (ret) { + ath11k_warn(ab, "failed to restart vdev %d: %d\n", +@@ -7149,6 +7144,11 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, + continue; + } + ++ ret = ath11k_mac_setup_bcn_tmpl(arvif); ++ if (ret) ++ ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n", ++ ret); ++ + params.vdev_id = arvif->vdev_id, + params.bssid = arvif->bssid, + params.aid = arvif->aid, +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/303-mac80211-support-to-track-mesh-beacon-miss-event.patch b/feeds/wifi-ax/mac80211/patches/qca/303-mac80211-support-to-track-mesh-beacon-miss-event.patch new file mode 100644 index 000000000..f87aa5b2c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/303-mac80211-support-to-track-mesh-beacon-miss-event.patch @@ -0,0 +1,297 @@ +From 71b5c29dc6fe94e6bd070bcd2d6ad7ee9595db91 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Wed, 19 May 2021 10:22:26 +0530 +Subject: [PATCH] mac80211 : support to track mesh beacon miss event + +Signed-off-by: Hari Chandrakanthan +--- + include/net/mac80211.h | 8 +++++++ + net/mac80211/debugfs.c | 36 ++++++++++++++++++++++++++++++ + net/mac80211/debugfs_netdev.c | 28 +++++++++++++++++++++++ + net/mac80211/mesh.c | 6 +++++ + net/mac80211/mesh.h | 5 ++++- + net/mac80211/mesh_plink.c | 52 +++++++++++++++++++++++++++++++++++++++++++ + net/mac80211/sta_info.c | 1 + + net/mac80211/sta_info.h | 4 ++++ + 8 files changed, 139 insertions(+), 1 deletion(-) + +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index 002cd40..9709d80 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1809,6 +1809,7 @@ struct ieee80211_vif { + + bool color_change_active; + u8 color_change_color; ++ u8 bmiss_threshold; + + /* must be last */ + u8 drv_priv[] __aligned(sizeof(void *)); +@@ -2555,6 +2556,12 @@ enum ieee80211_hw_flags { + NUM_IEEE80211_HW_FLAGS + }; + ++enum ieee80211_dbg_mask { ++ IEEE80211_HW_DBG_BMISS_LOG = 0x00000001, ++ IEEE80211_HW_DBG_DRIVER_LOG = 0x00000002, ++ IEEE80211_HW_MAX_DBG_MASK = 0x00000004 ++}; ++ + /** + * struct ieee80211_hw - hardware information and state + * +@@ -2717,6 +2724,7 @@ struct ieee80211_hw { + u8 tx_sk_pacing_shift; + u8 weight_multiplier; + u32 max_mtu; ++ u32 dbg_mask; + }; + + static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw, +diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c +index c3fc9fa..87dd864 100644 +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -334,6 +334,41 @@ static const struct file_operations force_tx_status_ops = { + .llseek = default_llseek, + }; + ++static ssize_t dbg_mask_read(struct file *file, char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_local *local = file->private_data; ++ char buf[10]; ++ int len = 0; ++ ++ len = scnprintf(buf, sizeof(buf), "0x%x\n", local->hw.dbg_mask); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t dbg_mask_write(struct file *file, const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ieee80211_local *local = file->private_data; ++ int ret; ++ u32 mask; ++ ++ ret = kstrtou32_from_user(user_buf, count, 0, &mask); ++ if (ret || mask >= IEEE80211_HW_MAX_DBG_MASK) ++ return -EINVAL; ++ ++ local->hw.dbg_mask = mask; ++ ++ return count; ++} ++ ++static const struct file_operations dbg_mask_ops = { ++ .write = dbg_mask_write, ++ .read = dbg_mask_read, ++ .open = simple_open, ++ .llseek = default_llseek, ++}; ++ + #ifdef CONFIG_PM + static ssize_t reset_write(struct file *file, const char __user *user_buf, + size_t count, loff_t *ppos) +@@ -575,6 +610,7 @@ void debugfs_hw_add(struct ieee80211_local *local) + DEBUGFS_ADD(power); + DEBUGFS_ADD(hw_conf); + DEBUGFS_ADD_MODE(force_tx_status, 0600); ++ DEBUGFS_ADD(dbg_mask); + + if (local->ops->wake_tx_queue) + DEBUGFS_ADD_MODE(aqm, 0600); +diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c +index 7d4ad09..f9b2529 100644 +--- a/net/mac80211/debugfs_netdev.c ++++ b/net/mac80211/debugfs_netdev.c +@@ -300,6 +300,32 @@ static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata, + } + IEEE80211_IF_FILE_RW(smps); + ++int ieee80211_if_fmt_bmiss_threshold(const struct ieee80211_sub_if_data *sdata, ++ char *buf, int buflen) ++{ ++ return snprintf(buf, buflen, "%u\n", sdata->vif.bmiss_threshold); ++} ++ ++static ssize_t ieee80211_if_parse_bmiss_threshold(struct ieee80211_sub_if_data *sdata, ++ const char *buf, int buflen) ++{ ++ int ret; ++ u8 val; ++ ++ ret = kstrtou8(buf, 0, &val); ++ if (ret) ++ return ret; ++ ++ if (!val) ++ return -EINVAL; ++ ++ sdata->vif.bmiss_threshold = val; ++ ++ return buflen; ++} ++ ++IEEE80211_IF_FILE_RW(bmiss_threshold); ++ + static ssize_t ieee80211_if_parse_tkip_mic_test( + struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) + { +@@ -684,6 +710,7 @@ static void add_ap_files(struct ieee80211_sub_if_data *sdata) + DEBUGFS_ADD(num_buffered_multicast); + DEBUGFS_ADD_MODE(tkip_mic_test, 0200); + DEBUGFS_ADD_MODE(multicast_to_unicast, 0600); ++ DEBUGFS_ADD_MODE(bmiss_threshold, 0600); + } + + static void add_vlan_files(struct ieee80211_sub_if_data *sdata) +@@ -704,6 +731,7 @@ static void add_mesh_files(struct ieee80211_sub_if_data *sdata) + { + DEBUGFS_ADD_MODE(tsf, 0600); + DEBUGFS_ADD_MODE(estab_plinks, 0400); ++ DEBUGFS_ADD_MODE(bmiss_threshold, 0600); + } + + static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) +diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c +index 9c064bb..18089c8 100644 +--- a/net/mac80211/mesh.c ++++ b/net/mac80211/mesh.c +@@ -162,6 +162,8 @@ void mesh_sta_cleanup(struct sta_info *sta) + struct ieee80211_sub_if_data *sdata = sta->sdata; + u32 changed = mesh_plink_deactivate(sta); + ++ del_timer_sync(&sta->mesh->bmiss_timer); ++ + if (changed) + ieee80211_mbss_info_change_notify(sdata, changed); + } +@@ -1357,6 +1359,10 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, + if (ifmsh->csa_role != IEEE80211_MESH_CSA_ROLE_INIT && + !sdata->vif.csa_active) + ieee80211_mesh_process_chnswitch(sdata, &elems, true); ++ ++ if (stype != IEEE80211_STYPE_PROBE_RESP) { ++ mesh_bmiss_update(sdata, mgmt, &elems, rx_status); ++ } + } + + if (ifmsh->sync_ops) +diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h +index 9f1f024..0c6eea6 100644 +--- a/net/mac80211/mesh.h ++++ b/net/mac80211/mesh.h +@@ -287,7 +287,9 @@ int mesh_path_send_to_gates(struct mesh_path *mpath); + int mesh_gate_num(struct ieee80211_sub_if_data *sdata); + u32 airtime_link_metric_get(struct ieee80211_local *local, + struct sta_info *sta); +- ++void mesh_bmiss_update(struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_mgmt *mgmt, struct ieee802_11_elems *ie, ++ struct ieee80211_rx_status *rx_status); + /* Mesh plinks */ + void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata, + u8 *hw_addr, struct ieee802_11_elems *ie, +@@ -322,6 +324,7 @@ void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata, + void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata); + + bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt); ++void mesh_bmiss_event(struct timer_list *t); + void mesh_nss_offld_path_update(struct mesh_path *mpath, bool is_mpath, u8 *old_next_hop_addr); + + #ifdef CPTCFG_MAC80211_MESH +diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c +index e840277..df54b8d 100644 +--- a/net/mac80211/mesh_plink.c ++++ b/net/mac80211/mesh_plink.c +@@ -597,6 +597,58 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, + return sta; + } + ++void mesh_bmiss_update(struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_mgmt *mgmt, ++ struct ieee802_11_elems *elems, ++ struct ieee80211_rx_status *rx_status) ++{ ++ struct sta_info *sta; ++ u32 timeout; ++ ++ /* mesh_sta_info_get api returns with rcu_read_lock */ ++ sta = mesh_sta_info_get(sdata, mgmt->sa, elems, rx_status); ++ if (!sta) ++ goto unlock_rcu; ++ ++ if (!(sta->local->hw.dbg_mask & IEEE80211_HW_DBG_BMISS_LOG) || ++ !sta->sdata->vif.bmiss_threshold) ++ goto unlock_rcu; ++ ++ sta->mesh->bmiss_count = 0; ++ sta->mesh->beacon_int = mgmt->u.beacon.beacon_int; ++ timeout = sta->mesh->beacon_int * sta->sdata->vif.bmiss_threshold; ++ ++ mod_timer(&sta->mesh->bmiss_timer, (jiffies + msecs_to_jiffies(timeout))); ++ ++unlock_rcu: ++ rcu_read_unlock(); ++} ++ ++void mesh_bmiss_event(struct timer_list *t) ++{ ++ struct mesh_sta *mesh = from_timer(mesh, t, bmiss_timer); ++ struct sta_info *sta; ++ u32 timeout; ++ ++ rcu_read_lock(); ++ sta = mesh->plink_sta; ++ ++ if (!(sta->local->hw.dbg_mask & IEEE80211_HW_DBG_BMISS_LOG) || ++ !sta->sdata->vif.bmiss_threshold) ++ goto unlock_rcu; ++ ++ mesh->bmiss_count++; ++ sdata_info(sta->sdata, "Beacon miss count %u from %pM\n", ++ mesh->bmiss_count, sta->sta.addr); ++ ++ timeout = sta->mesh->beacon_int * sta->sdata->vif.bmiss_threshold; ++ ++ mod_timer(&sta->mesh->bmiss_timer, (jiffies + msecs_to_jiffies(timeout))); ++ ++unlock_rcu: ++ rcu_read_unlock(); ++} ++ + /* + * mesh_neighbour_update - update or initialize new mesh neighbor. + * +diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c +index 43771f3..550a610 100644 +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -379,6 +379,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, + !sdata->u.mesh.user_mpm) + timer_setup(&sta->mesh->plink_timer, mesh_plink_timer, + 0); ++ timer_setup(&sta->mesh->bmiss_timer, mesh_bmiss_event, 0); + sta->mesh->nonpeer_pm = NL80211_MESH_POWER_ACTIVE; + } + #endif +diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h +index 01deec7..2e2122e 100644 +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -415,6 +415,10 @@ struct mesh_sta { + enum nl80211_mesh_power_mode peer_pm; + enum nl80211_mesh_power_mode nonpeer_pm; + ++ struct timer_list bmiss_timer; ++ u32 bmiss_count; ++ u32 beacon_int; ++ + /* moving percentage of failed MSDUs */ + struct ewma_mesh_fail_avg fail_avg; + /* moving average of tx bitrate */ +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/304-ath11k-remove-cal_done-check-during-probe.patch b/feeds/wifi-ax/mac80211/patches/qca/304-ath11k-remove-cal_done-check-during-probe.patch new file mode 100644 index 000000000..d8d6e89c9 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/304-ath11k-remove-cal_done-check-during-probe.patch @@ -0,0 +1,32 @@ +From 610f6387768be2323257cfcc422589f5b417003f Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Fri, 9 Apr 2021 18:12:02 +0530 +Subject: [PATCH] ath11k: remove cal_done check during probe + +cal_done is set when calibration done qmi message is received. +In some race conditions, cal done is received even before host +wait starts for calibration done. Hence, remove check cal_done +check in ath11k_qmi_fwreset_from_cold_boot() as this is called +only from probe. + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c +index 75d382e..18cc3ff 100644 +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -3541,7 +3541,7 @@ int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab) + { + int timeout; + +- if (ab->enable_cold_boot_cal == 0 || ab->qmi.cal_done || ++ if (ab->enable_cold_boot_cal == 0 || + ab->hw_params.cold_boot_calib == 0) + return 0; + +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/305-001-mac80211-Add-support-to-handle-AWGN-interference-for-6G.patch b/feeds/wifi-ax/mac80211/patches/qca/305-001-mac80211-Add-support-to-handle-AWGN-interference-for-6G.patch new file mode 100644 index 000000000..14f74d3f2 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/305-001-mac80211-Add-support-to-handle-AWGN-interference-for-6G.patch @@ -0,0 +1,118 @@ +From 8903b905962c705a1dc46eed60c162b7346497f9 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 6 May 2021 13:31:49 +0530 +Subject: [PATCH] mac80211: Add support to handle AWGN interference for 6G + +On receiving AWGN interference indication, mac80211 triggers actions +to bringdown the interface and indicates the same to userspace using +existing NL80211_CMD_STOP_AP interface, so as to avoid transmission +in that channel. + +Signed-off-by: Lavanya Suresh +--- + include/net/mac80211.h | 7 +++++++ + net/mac80211/ieee80211_i.h | 4 ++++ + net/mac80211/iface.c | 2 ++ + net/mac80211/util.c | 26 ++++++++++++++++++++++++++ + 4 files changed, 39 insertions(+) + +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index df3c728..a91a7f9 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -6245,6 +6245,13 @@ void ieee80211_radar_detected(struct ieee80211_hw *hw); + void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); + + /** ++ * ieee80211_awgn_detected - inform that awgn interference is detected ++ * ++ * @vif: &struct ieee80211_vif pointer from the add_interface callback. ++ */ ++void ieee80211_awgn_detected(struct ieee80211_vif *vif); ++ ++/** + * ieee80211_request_smps - request SM PS transition + * @vif: &struct ieee80211_vif pointer from the add_interface callback. + * @smps_mode: new SM PS mode +diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h +index 448e8bd..200d325 100644 +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -952,6 +952,8 @@ struct ieee80211_sub_if_data { + bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */ + struct cfg80211_chan_def csa_chandef; + ++ struct work_struct awgn_detected_work; ++ + struct work_struct color_change_finalize_work; + + struct list_head assigned_chanctx_list; /* protected by chanctx_mtx */ +@@ -1778,6 +1780,8 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, + void ieee80211_csa_finalize_work(struct work_struct *work); + int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_csa_settings *params); ++/* awgn interference handling */ ++void ieee80211_awgn_interference_detected_work(struct work_struct *work); + + /* color change handling */ + void ieee80211_color_change_finalize_work(struct work_struct *work); +diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c +index 1169a1c..7d441ac 100644 +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -471,6 +471,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do + sdata_unlock(sdata); + + cancel_work_sync(&sdata->csa_finalize_work); ++ cancel_work_sync(&sdata->awgn_detected_work); + + cancel_delayed_work_sync(&sdata->dfs_cac_timer_work); + +@@ -1660,6 +1661,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, + INIT_WORK(&sdata->work, ieee80211_iface_work); + INIT_WORK(&sdata->recalc_smps, ieee80211_recalc_smps_work); + INIT_WORK(&sdata->csa_finalize_work, ieee80211_csa_finalize_work); ++ INIT_WORK(&sdata->awgn_detected_work, ieee80211_awgn_interference_detected_work); + INIT_WORK(&sdata->color_change_finalize_work, ieee80211_color_change_finalize_work); + INIT_LIST_HEAD(&sdata->assigned_chanctx_list); + INIT_LIST_HEAD(&sdata->reserved_chanctx_list); +diff --git a/net/mac80211/util.c b/net/mac80211/util.c +index a00ed23..56f490b 100644 +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -3929,6 +3929,32 @@ u32 ieee80211_chandef_downgrade(struct cfg80211_chan_def *c) + return ret; + } + ++void ieee80211_awgn_interference_detected_work(struct work_struct *work) ++{ ++ struct ieee80211_sub_if_data *sdata = ++ container_of(work, struct ieee80211_sub_if_data, awgn_detected_work); ++ ++ sdata_lock(sdata); ++ ++ if (!ieee80211_sdata_running(sdata)) ++ goto unlock; ++ ++ cfg80211_stop_iface(sdata->local->hw.wiphy, &sdata->wdev, ++ GFP_KERNEL); ++ ++unlock: ++ sdata_unlock(sdata); ++} ++ ++void ieee80211_awgn_detected(struct ieee80211_vif *vif) ++{ ++ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); ++ ++ ieee80211_queue_work(&sdata->local->hw, ++ &sdata->awgn_detected_work); ++} ++EXPORT_SYMBOL(ieee80211_awgn_detected); ++ + /* + * Returns true if smps_mode_new is strictly more restrictive than + * smps_mode_old. +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/305-002-ath11k-Add-support-to-handle-AWGN-interference-for-6G.patch b/feeds/wifi-ax/mac80211/patches/qca/305-002-ath11k-Add-support-to-handle-AWGN-interference-for-6G.patch new file mode 100644 index 000000000..aae591567 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/305-002-ath11k-Add-support-to-handle-AWGN-interference-for-6G.patch @@ -0,0 +1,342 @@ +From a7c191e95212c2169b8155ba8456d37c2f33ca65 Mon Sep 17 00:00:00 2001 +From: Lavanya Suresh +Date: Thu, 6 May 2021 13:31:08 +0530 +Subject: [PATCH] ath11k: Add support to handle AWGN interference for 6G + +When AWGN interference is detected in any 6G channel, FW indicates it to +host using WMI_DCS_INTERFERENCE_EVENT. Added support to parse new wmi +event to get AWGN interference info and indicate to mac80211. + +AWGN interference detection support in FW will be advertised in wmi service +ready event, based on which host can decide to handle and process interference +events. + +Added debugfs support to simulate AWGN interference from host, for testing +purposes. +Usage: +echo 1 > /sys/kernel/debug/ath11k/qcn9074\ hw1.0_000X\:01\:00.0/ +mac0/simulate_awgn + +Signed-off-by: Lavanya Suresh +--- + drivers/net/wireless/ath/ath11k/debugfs.c | 25 +++++ + drivers/net/wireless/ath/ath11k/wmi.c | 176 ++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 29 +++++ + 3 files changed, 230 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -2161,6 +2161,35 @@ static const struct file_operations fops + .open = simple_open + }; + ++static ssize_t ath11k_write_simulate_awgn(struct file *file, ++ const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ int ret; ++ ++ mutex_lock(&ar->conf_mutex); ++ if (ar->state != ATH11K_STATE_ON) { ++ ret = -ENETDOWN; ++ goto exit; ++ } ++ ++ ret = ath11k_wmi_simulate_awgn(ar); ++ if (ret) ++ goto exit; ++ ++ ret = count; ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ return ret; ++} ++ ++static const struct file_operations fops_simulate_awgn = { ++ .write = ath11k_write_simulate_awgn, ++ .open = simple_open ++}; ++ + static ssize_t ath11k_write_btcoex(struct file *file, + const char __user *ubuf, + size_t count, loff_t *ppos) +@@ -3765,6 +3794,12 @@ int ath11k_debugfs_register(struct ath11 + &ar->dfs_block_radar_events); + } + ++ if (ar->hw->wiphy->bands[NL80211_BAND_6GHZ]) { ++ debugfs_create_file("simulate_awgn", 0200, ++ ar->debug.debugfs_pdev, ar, ++ &fops_simulate_awgn); ++ } ++ + debugfs_create_file("enable_m3_dump", 0644, + ar->debug.debugfs_pdev, ar, + &fops_enable_m3_dump); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -8419,6 +8419,143 @@ exit: + kfree(tb); + } + ++static int ath11k_wmi_awgn_intf_subtlv_parser(struct ath11k_base *ab, ++ u16 tag, u16 len, ++ const void *ptr, void *data) ++{ ++ int ret = 0; ++ struct wmi_dcs_awgn_info *awgn_info; ++ ++ switch (tag) { ++ case WMI_TAG_DCS_AWGN_INT_TYPE: ++ awgn_info = (struct wmi_dcs_awgn_info *)ptr; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "AWGN Info: channel width: %d, chan freq: %d, center_freq0: %d, center_freq1: %d, bw_intf_bitmap: %d\n", ++ awgn_info->channel_width, awgn_info->chan_freq, awgn_info->center_freq0, awgn_info->center_freq1, ++ awgn_info->chan_bw_interference_bitmap); ++ break; ++ default: ++ ath11k_warn(ab, ++ "Received invalid tag for wmi dcs interference in subtlvs\n"); ++ return -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++static int ath11k_wmi_dcs_awgn_event_parser(struct ath11k_base *ab, ++ u16 tag, u16 len, ++ const void *ptr, void *data) ++{ ++ int ret = 0; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, "wmi dcs awgn event tag 0x%x of len %d rcvd\n", ++ tag, len); ++ ++ switch (tag) { ++ case WMI_TAG_DCS_INTERFERENCE_EVENT: ++ /* Fixed param is already processed*/ ++ break; ++ case WMI_TAG_ARRAY_STRUCT: ++ /* len 0 is expected for array of struct when there ++ * is no content of that type to pack inside that tlv ++ */ ++ if (len == 0) ++ return 0; ++ ret = ath11k_wmi_tlv_iter(ab, ptr, len, ++ ath11k_wmi_awgn_intf_subtlv_parser, ++ data); ++ break; ++ default: ++ ath11k_warn(ab, "Received invalid tag for wmi dcs interference event\n"); ++ ret = -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++static void ++ath11k_wmi_dcs_awgn_interference_event(struct ath11k_base *ab, ++ struct sk_buff *skb) ++{ ++ const struct wmi_dcs_interference_ev *dcs_intf_ev; ++ struct wmi_dcs_awgn_info *awgn_info; ++ struct ath11k *ar; ++ struct ath11k_vif *arvif; ++ const struct wmi_tlv *tlv; ++ u16 tlv_tag; ++ u8 *ptr; ++ int ret; ++ ++ if (!test_bit(WMI_TLV_SERVICE_DCS_AWGN_INT_SUPPORT, ab->wmi_ab.svc_map)) { ++ ath11k_warn(ab, "firmware doesn't support awgn interference, so dropping dcs interference ev\n"); ++ return; ++ } ++ ++ ptr = skb->data; ++ ++ if (skb->len < (sizeof(*dcs_intf_ev) + TLV_HDR_SIZE)) { ++ ath11k_warn(ab, "dcs interference event size invalid\n"); ++ return; ++ } ++ ++ tlv = (struct wmi_tlv *)ptr; ++ tlv_tag = FIELD_GET(WMI_TLV_TAG, tlv->header); ++ ptr += sizeof(*tlv); ++ ++ if (tlv_tag == WMI_TAG_DCS_INTERFERENCE_EVENT) { ++ dcs_intf_ev = (struct wmi_dcs_interference_ev*)ptr; ++ ++ ath11k_dbg(ab, ATH11K_DBG_WMI, ++ "pdev awgn detected on pdev %d, interference type %d\n", ++ dcs_intf_ev->pdev_id, dcs_intf_ev->interference_type); ++ ++ if (dcs_intf_ev->interference_type != WMI_DCS_AWGN_INTF) { ++ ath11k_warn(ab, "interference type is not awgn\n"); ++ return; ++ } ++ } else { ++ ath11k_warn(ab, "dcs interference event received with wrong tag\n"); ++ return; ++ } ++ ++ ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, ++ ath11k_wmi_dcs_awgn_event_parser, ++ awgn_info); ++ if (ret) { ++ ath11k_warn(ab, "failed to parse awgn tlv %d\n", ret); ++ return; ++ } ++ ++ rcu_read_lock(); ++ ar = ath11k_mac_get_ar_by_pdev_id(ab, dcs_intf_ev->pdev_id); ++ if (!ar) { ++ ath11k_warn(ab, "awgn detected in invalid pdev id(%d)\n", ++ dcs_intf_ev->pdev_id); ++ goto exit; ++ } ++ ++ if (!ar->supports_6ghz) { ++ ath11k_warn(ab, "pdev does not supports 6G, so dropping dcs interference event\n"); ++ goto exit; ++ } ++ ++ ath11k_info(ab, "Interface(pdev %d) will be disabled because of AWGN interference\n", ++ dcs_intf_ev->pdev_id); ++ ++ list_for_each_entry(arvif, &ar->arvifs, list) { ++ if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { ++ ieee80211_awgn_detected(arvif->vif); ++ } ++ } ++ ++exit: ++ rcu_read_unlock(); ++} ++ + static void ath11k_wmi_tm_event_segmented(struct ath11k_base *ab, u32 cmd_id, + struct sk_buff *skb) + { +@@ -9566,6 +9703,9 @@ static void ath11k_wmi_tlv_op_rx(struct + case WMI_WOW_WAKEUP_HOST_EVENTID: + ath11k_wmi_event_wow_wakeup_host(ab, skb); + break; ++ case WMI_DCS_INTERFERENCE_EVENTID: ++ ath11k_wmi_dcs_awgn_interference_event(ab, skb); ++ break; + case WMI_PDEV_GET_TPC_STATS_EVENTID: + ath11k_process_tpc_stats(ab, skb); + break; +@@ -9728,6 +9868,42 @@ int ath11k_wmi_simulate_radar(struct ath + return ath11k_wmi_send_unit_test_cmd(ar, wmi_ut, dfs_args); + } + ++ ++int ath11k_wmi_simulate_awgn(struct ath11k *ar) ++{ ++ struct ath11k_vif *arvif; ++ u32 awgn_args[WMI_AWGN_MAX_TEST_ARGS]; ++ struct wmi_unit_test_cmd wmi_ut; ++ bool arvif_found = false; ++ ++ if (!test_bit(WMI_TLV_SERVICE_DCS_AWGN_INT_SUPPORT, ar->ab->wmi_ab.svc_map)) { ++ ath11k_warn(ar->ab, "firmware doesn't support awgn interference, so can't simulate it\n"); ++ return -EOPNOTSUPP; ++ } ++ ++ list_for_each_entry(arvif, &ar->arvifs, list) { ++ if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { ++ arvif_found = true; ++ break; ++ } ++ } ++ ++ if (!arvif_found) ++ return -EINVAL; ++ ++ awgn_args[WMI_AWGN_TEST_AWGN_INT] = WMI_UNIT_TEST_AWGN_INTF_TYPE; ++ awgn_args[WMI_AWGN_TEST_BITMAP] = WMI_UNIT_TEST_AWGN_PRIMARY_20; ++ ++ wmi_ut.vdev_id = arvif->vdev_id; ++ wmi_ut.module_id = WMI_AWGN_UNIT_TEST_MODULE; ++ wmi_ut.num_args = WMI_AWGN_MAX_TEST_ARGS; ++ wmi_ut.diag_token = WMI_AWGN_UNIT_TEST_TOKEN; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "Triggering AWGN Simulation\n"); ++ ++ return ath11k_wmi_send_unit_test_cmd(ar, wmi_ut, awgn_args); ++} ++ + int ath11k_wmi_pdev_m3_dump_enable(struct ath11k *ar, u32 enable) { + struct ath11k_vif *arvif; + u32 m3_args[WMI_M3_MAX_TEST_ARGS]; +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -1903,6 +1903,7 @@ enum wmi_tlv_tag { + WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT, + + WMI_CTRL_PATH_CAL_STATS = 0x3BC, ++ WMI_TAG_DCS_AWGN_INT_TYPE = 0x3C5, + + WMI_TAG_MAX + }; +@@ -2175,6 +2176,7 @@ enum wmi_tlv_service { + WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE = 263, + WMI_TLV_SERVICE_QOS_NULL_FRAME_TX_OVER_WMI = 264, + WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT = 281, ++ WMI_TLV_SERVICE_DCS_AWGN_INT_SUPPORT = 286, + + WMI_MAX_EXT2_SERVICE + }; +@@ -4216,6 +4218,17 @@ struct wmi_dfs_unit_test_arg { + u32 radar_param; + }; + ++#define WMI_AWGN_UNIT_TEST_MODULE 0x18 ++#define WMI_AWGN_UNIT_TEST_TOKEN 0 ++#define WMI_UNIT_TEST_AWGN_INTF_TYPE 1 ++#define WMI_UNIT_TEST_AWGN_PRIMARY_20 0x01 ++ ++enum wmi_awgn_test_args_idx { ++ WMI_AWGN_TEST_AWGN_INT, ++ WMI_AWGN_TEST_BITMAP, ++ WMI_AWGN_MAX_TEST_ARGS, ++}; ++ + #define WMI_M3_UNIT_TEST_MODULE 0x22 + #define WMI_M3_UNIT_TEST_TOKEN 0 + +@@ -4843,6 +4856,21 @@ struct wmi_pdev_radar_ev { + s32 sidx; + } __packed; + ++#define WMI_DCS_AWGN_INTF 0x04 ++ ++struct wmi_dcs_awgn_info { ++ u32 channel_width; ++ u32 chan_freq; ++ u32 center_freq0; ++ u32 center_freq1; ++ u32 chan_bw_interference_bitmap; ++} __packed; ++ ++struct wmi_dcs_interference_ev { ++ u32 interference_type; ++ u32 pdev_id; ++} __packed; ++ + struct wmi_pdev_temperature_event { + /* temperature value in Celcius degree */ + s32 temp; +@@ -6636,6 +6664,7 @@ void ath11k_wmi_fw_stats_fill(struct ath + struct ath11k_fw_stats *fw_stats, u32 stats_id, + char *buf); + int ath11k_wmi_simulate_radar(struct ath11k *ar); ++int ath11k_wmi_simulate_awgn(struct ath11k *ar); + int ath11k_wmi_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id); + int ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id); + int ath11k_wmi_send_twt_add_dialog_cmd(struct ath11k *ar, diff --git a/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-add-hw_param-for-wakeup_mhi.patch b/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-add-hw_param-for-wakeup_mhi.patch new file mode 100644 index 000000000..7eb6c9234 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-add-hw_param-for-wakeup_mhi.patch @@ -0,0 +1,149 @@ +From 64f2a21dd6358addcf27d391d4c217e958c7014a Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 14 Apr 2021 15:31:27 +0530 +Subject: [PATCH] ath11k: add hw_param for wakeup_mhi + +wakeup mhi is needed before pci_read/write only for QCA6390. +Since wakeup & release mhi is enabled for all platforms, +below mhi assert is seen in QCN9074. + +Disable wakeup/release mhi using hw_param for other hardwares. + +Kernel panic - not syncing: dev_wake != 0 +CPU: 2 PID: 13535 Comm: procd Not tainted 4.4.60 #1 +Hardware name: Generic DT based system +[<80316dac>] (unwind_backtrace) from [<80313700>] (show_stack+0x10/0x14) +[<80313700>] (show_stack) from [<805135dc>] (dump_stack+0x7c/0x9c) +[<805135dc>] (dump_stack) from [<8032136c>] (panic+0x84/0x1f8) +[<8032136c>] (panic) from [<80549b24>] (mhi_pm_disable_transition+0x3b8/0x5b8) +[<80549b24>] (mhi_pm_disable_transition) from [<80549ddc>] (mhi_power_down+0xb8/0x100) +[<80549ddc>] (mhi_power_down) from [<7f5242b0>] (ath11k_mhi_op_status_cb+0x284/0x3ac [ath11k_pci]) +[E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process +[E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process +[E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process +[<7f5242b0>] (ath11k_mhi_op_status_cb [ath11k_pci]) from [<7f524878>] (ath11k_mhi_stop+0x10/0x20 [ath11k_pci]) +[<7f524878>] (ath11k_mhi_stop [ath11k_pci]) from [<7f525b94>] (ath11k_pci_power_down+0x54/0x90 [ath11k_pci]) +[<7f525b94>] (ath11k_pci_power_down [ath11k_pci]) from [<8056b2a8>] (pci_device_shutdown+0x30/0x44) +[<8056b2a8>] (pci_device_shutdown) from [<805cfa0c>] (device_shutdown+0x124/0x174) +[<805cfa0c>] (device_shutdown) from [<8033aaa4>] (kernel_restart+0xc/0x50) +[<8033aaa4>] (kernel_restart) from [<8033ada8>] (SyS_reboot+0x178/0x1ec) +[<8033ada8>] (SyS_reboot) from [<80301b80>] (ret_fast_syscall+0x0/0x34) + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/core.c | 6 ++++++ + drivers/net/wireless/ath/ath11k/hw.h | 1 + + drivers/net/wireless/ath/ath11k/pci.c | 12 ++++++++---- + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c +index 7b446e0..7691859 100644 +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -110,6 +110,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .cfr_stream_buf_size = 8500, + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, ++ .wakeup_mhi = false, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -161,6 +162,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .is_qdss_support = false, + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, ++ .wakeup_mhi = false, + }, + { + .name = "qca6390 hw2.0", +@@ -206,6 +208,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .fwmem_mode_change = false, + .is_qdss_support = false, + .max_tx_ring = 1, ++ .wakeup_mhi = true, + }, + { + .name = "qcn9074 hw1.0", +@@ -263,6 +266,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + CFR_DATA_MAX_LEN_QCN9074, + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, ++ .wakeup_mhi = false, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -313,6 +317,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .cold_boot_calib = true, + .is_qdss_support = false, + .max_tx_ring = DP_TCL_NUM_RING_MAX, ++ .wakeup_mhi = false, + }, + { + .hw_rev = ATH11K_HW_QCN6122, +@@ -364,6 +369,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .fwmem_mode_change = false, + .is_qdss_support = true, + .max_tx_ring = DP_TCL_NUM_RING_MAX, ++ .wakeup_mhi = false, + }, + }; + +diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h +index 80723ca..b99ecb5 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -208,6 +208,7 @@ struct ath11k_hw_params { + bool fwmem_mode_change; + bool is_qdss_support; + bool cfr_support; ++ bool wakeup_mhi; + u32 cfr_dma_hdr_size; + u32 cfr_num_stream_bufs; + u32 cfr_stream_buf_size; +diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c +index 6b138ab..494888e 100644 +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -169,7 +169,8 @@ void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) + /* for offset beyond BAR + 4K - 32, may + * need to wakeup MHI to access. + */ +- if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ++ if (ab->hw_params.wakeup_mhi && ++ test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && + offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_get_sync(ab_pci->mhi_ctrl->mhi_dev); + +@@ -193,7 +194,8 @@ void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) + } + } + +- if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ++ if (ab->hw_params.wakeup_mhi && ++ test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && + offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_put(ab_pci->mhi_ctrl->mhi_dev); + } +@@ -207,7 +209,8 @@ u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) + /* for offset beyond BAR + 4K - 32, may + * need to wakeup MHI to access. + */ +- if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ++ if (ab->hw_params.wakeup_mhi && ++ test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && + offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_get_sync(ab_pci->mhi_ctrl->mhi_dev); + +@@ -231,7 +234,8 @@ u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) + } + } + +- if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ++ if (ab->hw_params.wakeup_mhi && ++ test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && + offset >= ACCESS_ALWAYS_OFF && ab_pci->mhi_ctrl) + mhi_device_put(ab_pci->mhi_ctrl->mhi_dev); + +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-fix-radar-detection-issue-in-160mhz.patch b/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-fix-radar-detection-issue-in-160mhz.patch new file mode 100644 index 000000000..617762153 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/305-ath11k-fix-radar-detection-issue-in-160mhz.patch @@ -0,0 +1,126 @@ +From 2e25abb2008e0eed96ad6fe8f58881f31e1bf486 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Mon, 19 Apr 2021 11:11:06 +0530 +Subject: [PATCH] ath11k: fix radar detection issue in 160mhz + +Failed to detect RADAR pulses in the secondary 80mhz when the +the AP's primary 80mzh is in non-dfs region in 160mhz. + +This is due to host is not setting WMI channel flags WMI_CHAN_INFO_DFS +and WMI_CHAN_INFO_DFS_FREQ2 in case of primary 80 is in non-dfs region. +HALPHY detects the RADAR pulses only when thse channel flags are set. + +Fix this issue by setting WMI channel flags WMI_CHAN_INFO_DFS and +WMI_CHAN_INFO_DFS_FREQ2 based on the radar_enabled flag from channel +context. + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/mac.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6864,7 +6864,7 @@ static void ath11k_mac_op_remove_chanctx + static int + ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, + const struct cfg80211_chan_def *chandef, +- bool restart) ++ bool restart, bool radar_enabled) + { + struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; +@@ -6903,8 +6903,7 @@ ath11k_mac_vdev_start_restart(struct ath + arg.channel.chan_radar = + !!(chandef->chan->flags & IEEE80211_CHAN_RADAR); + +- arg.channel.freq2_radar = +- !!(chandef->chan->flags & IEEE80211_CHAN_RADAR); ++ arg.channel.freq2_radar = radar_enabled; + + arg.channel.passive = arg.channel.chan_radar; + +@@ -7026,15 +7025,19 @@ err: + } + + static int ath11k_mac_vdev_start(struct ath11k_vif *arvif, +- const struct cfg80211_chan_def *chandef) ++ const struct cfg80211_chan_def *chandef, ++ bool radar_enabled) + { +- return ath11k_mac_vdev_start_restart(arvif, chandef, false); ++ return ath11k_mac_vdev_start_restart(arvif, chandef, false, ++ radar_enabled); + } + + static int ath11k_mac_vdev_restart(struct ath11k_vif *arvif, +- const struct cfg80211_chan_def *chandef) ++ const struct cfg80211_chan_def *chandef, ++ bool radar_enabled) + { +- return ath11k_mac_vdev_start_restart(arvif, chandef, true); ++ return ath11k_mac_vdev_start_restart(arvif, chandef, true, ++ radar_enabled); + } + + struct ath11k_mac_change_chanctx_arg { +@@ -7106,7 +7109,7 @@ ath11k_mac_update_vif_chan(struct ath11k + if (WARN_ON(!arvif->is_started)) + continue; + +- if (WARN_ON(!arvif->is_up)) ++ if (!arvif->is_up) + continue; + + ret = ath11k_nss_vdev_down(arvif); +@@ -7135,16 +7138,17 @@ ath11k_mac_update_vif_chan(struct ath11k + if (WARN_ON(!arvif->is_started)) + continue; + +- if (WARN_ON(!arvif->is_up)) +- continue; +- +- ret = ath11k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def); ++ ret = ath11k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def, ++ vifs[i].new_ctx->radar_enabled); + if (ret) { + ath11k_warn(ab, "failed to restart vdev %d: %d\n", + arvif->vdev_id, ret); + continue; + } + ++ if (!arvif->is_up) ++ continue; ++ + ret = ath11k_mac_setup_bcn_tmpl(arvif); + if (ret) + ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n", +@@ -7224,7 +7228,8 @@ static void ath11k_mac_op_change_chanctx + if (WARN_ON(changed & IEEE80211_CHANCTX_CHANGE_CHANNEL)) + goto unlock; + +- if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH) ++ if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH || ++ changed & IEEE80211_CHANCTX_CHANGE_RADAR) + ath11k_mac_update_active_vif_chan(ar, ctx); + + /* TODO: Recalc radar detection */ +@@ -7244,7 +7249,8 @@ static int ath11k_start_vdev_delay(struc + if (WARN_ON(arvif->is_started)) + return -EBUSY; + +- ret = ath11k_mac_vdev_start(arvif, &arvif->chanctx.def); ++ ret = ath11k_mac_vdev_start(arvif, &arvif->chanctx.def, ++ arvif->chanctx.radar_enabled); + if (ret) { + ath11k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n", + arvif->vdev_id, vif->addr, +@@ -7327,7 +7333,7 @@ ath11k_mac_op_assign_vif_chanctx(struct + goto exit; + } + +- ret = ath11k_mac_vdev_start(arvif, &ctx->def); ++ ret = ath11k_mac_vdev_start(arvif, &ctx->def, ctx->radar_enabled); + if (ret) { + ath11k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n", + arvif->vdev_id, vif->addr, diff --git a/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-add-vdev-start-flag-to-disable-hw-encryp.patch b/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-add-vdev-start-flag-to-disable-hw-encryp.patch new file mode 100644 index 000000000..c3b9b5865 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-add-vdev-start-flag-to-disable-hw-encryp.patch @@ -0,0 +1,45 @@ +From 5bf167984d6db67389ff597ca2a45d176224e17d Mon Sep 17 00:00:00 2001 +From: Maharaja Kennadyrajan +Date: Mon, 26 Apr 2021 18:32:07 +0530 +Subject: [PATCH] ath11k: Add vdev start flag to disable hardware encryption + +Enable WMI_VDEV_START_HW_ENCRYPTION_DISABLED flag in +vdev_start cmd to notify firmware to disable hardware +encryption for a vdev. This is set if raw mode software +encryption is enabled. + +Signed-off-by: Maharaja Kennadyrajan +--- + drivers/net/wireless/ath/ath11k/wmi.c | 3 +++ + drivers/net/wireless/ath/ath11k/wmi.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c +index 1fbba1b..26f5d8c 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -984,6 +984,9 @@ int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg, + + cmd->flags |= WMI_VDEV_START_LDPC_RX_ENABLED; + ++ if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) ++ cmd->flags |= WMI_VDEV_START_HW_ENCRYPTION_DISABLED; ++ + ptr = skb->data + sizeof(*cmd); + chan = ptr; + +diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h +index d74128f..23c704d 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2715,6 +2715,7 @@ struct wmi_vdev_down_cmd { + #define WMI_VDEV_START_HIDDEN_SSID BIT(0) + #define WMI_VDEV_START_PMF_ENABLED BIT(1) + #define WMI_VDEV_START_LDPC_RX_ENABLED BIT(3) ++#define WMI_VDEV_START_HW_ENCRYPTION_DISABLED BIT(4) + + struct wmi_ssid { + u32 ssid_len; +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-sta-dbg-level-log.patch b/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-sta-dbg-level-log.patch new file mode 100644 index 000000000..bfdbea6be --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/306-ath11k-sta-dbg-level-log.patch @@ -0,0 +1,424 @@ +From 3fb34916b37bb56d1f956191b438a7447e134c77 Mon Sep 17 00:00:00 2001 +From: Tamizh Chelvam +Date: Tue, 30 Mar 2021 12:34:08 +0530 +Subject: [PATCH] ath11k: Add support for peer dbg level logs + +Signed-off-by: Tamizh Chelvam +--- + drivers/net/wireless/ath/ath11k/core.h | 7 +++ + drivers/net/wireless/ath/ath11k/debug.h | 1 + + drivers/net/wireless/ath/ath11k/debugfs.c | 97 +++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/debugfs.h | 5 ++ + drivers/net/wireless/ath/ath11k/mac.c | 79 +++++++++++++++++++++---- + drivers/net/wireless/ath/ath11k/mac.h | 1 + + drivers/net/wireless/ath/ath11k/peer.c | 3 + + drivers/net/wireless/ath/ath11k/wmi.c | 7 +++ + 8 files changed, 189 insertions(+), 11 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -231,6 +231,11 @@ struct ath11k_mgmt_frame_stats { + u32 tx_compl_fail[ATH11K_STATS_MGMT_FRM_TYPE_MAX]; + }; + ++struct ath11k_mac_filter { ++ struct list_head list; ++ u8 peer_mac[ETH_ALEN]; ++}; ++ + struct ath11k_vif { + u32 vdev_id; + enum wmi_vdev_type vdev_type; +@@ -284,6 +289,9 @@ struct ath11k_vif { + struct ieee80211_chanctx_conf chanctx; + struct dentry *debugfs_twt; + struct ath11k_mgmt_frame_stats mgmt_stats; ++ /* protected by conf_mutex */ ++ struct list_head mac_filters; ++ u32 mac_filter_count; + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct arvif_nss nss; + struct list_head ap_vlan_arvifs; +--- a/drivers/net/wireless/ath/ath11k/debug.h ++++ b/drivers/net/wireless/ath/ath11k/debug.h +@@ -28,6 +28,7 @@ enum ath11k_debug_mask { + ATH11K_DBG_DP_RX = 0x00004000, + ATH11K_DBG_CFR = 0x00008000, + ATH11K_DBG_CFR_DUMP = 0x00010000, ++ ATH11K_DBG_PEER = 0x00020000, + ATH11K_DBG_ANY = 0xffffffff, + }; + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -453,6 +453,108 @@ static const struct file_operations ath1 + .read = ath11k_read_wmi_ctrl_path_stats, + }; + ++static ssize_t ath11k_write_mac_filter(struct file *file, ++ const char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ath11k_mac_filter *mac_filter; ++ struct ath11k_mac_filter *i; ++ struct ath11k *ar = arvif->ar; ++ bool found = false; ++ u8 buf[64] = {0}; ++ int ret; ++ unsigned int val; ++ ++ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count); ++ if (ret < 0) ++ return ret; ++ ++ mac_filter = kzalloc(sizeof(*mac_filter), GFP_ATOMIC); ++ if (!mac_filter) ++ return -ENOMEM; ++ ++ buf[ret] = '\0'; ++ ret = sscanf(buf, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx %u", ++ &mac_filter->peer_mac[0], &mac_filter->peer_mac[1], ++ &mac_filter->peer_mac[2], &mac_filter->peer_mac[3], ++ &mac_filter->peer_mac[4], &mac_filter->peer_mac[5], ++ &val); ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (!list_empty(&arvif->mac_filters)) { ++ list_for_each_entry(i, &arvif->mac_filters, list) { ++ if (ether_addr_equal(i->peer_mac, mac_filter->peer_mac)) { ++ found = true; ++ break; ++ } ++ } ++ } ++ ++ if (!found && val) { ++ list_add(&mac_filter->list, &arvif->mac_filters); ++ arvif->mac_filter_count++; ++ } else if (found && !val) { ++ list_del(&i->list); ++ kfree(i); ++ arvif->mac_filter_count--; ++ } ++ ++ mutex_unlock(&ar->conf_mutex); ++ return count; ++} ++ ++static ssize_t ath11k_read_mac_filter(struct file *file, char __user *ubuf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k_vif *arvif = file->private_data; ++ struct ath11k *ar = arvif->ar; ++ struct ath11k_mac_filter *i; ++ int len = 0, ret; ++ char *buf; ++ int size; ++ ++ size = (arvif->mac_filter_count * 20) + 25; ++ ++ buf = kzalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (list_empty(&arvif->mac_filters)) { ++ len += scnprintf(buf + len, size - len, "List is Empty\n"); ++ goto exit; ++ } ++ ++ len += scnprintf(buf + len, size - len, "Mac address entries :\n"); ++ list_for_each_entry(i, &arvif->mac_filters, list) { ++ len += scnprintf(buf + len, size - len, "%pM\n", i->peer_mac); ++ } ++ ++exit: ++ mutex_unlock(&ar->conf_mutex); ++ ret = simple_read_from_buffer(ubuf, count, ppos, buf, len); ++ kfree(buf); ++ return ret; ++ ++} ++ ++static const struct file_operations fops_mac_filter = { ++ .read = ath11k_read_mac_filter, ++ .write = ath11k_write_mac_filter, ++ .open = simple_open ++}; ++ ++void ath11k_debugfs_dbg_mac_filter(struct ath11k_vif *arvif) ++{ ++ debugfs_create_file("mac_filter", 0644, ++ arvif->vif->debugfs_dir, arvif, ++ &fops_mac_filter); ++ INIT_LIST_HEAD(&arvif->mac_filters); ++} ++ + void ath11k_debugfs_wmi_ctrl_stats(struct ath11k_vif *arvif) + { + debugfs_create_file("wmi_ctrl_stats", 0644, +--- a/drivers/net/wireless/ath/ath11k/debugfs.h ++++ b/drivers/net/wireless/ath/ath11k/debugfs.h +@@ -182,11 +182,16 @@ enum ath11k_dbg_aggr_mode { + + #ifdef CPTCFG_MAC80211_DEBUGFS + void ath11k_debugfs_twt(struct ath11k_vif *arvif, bool enable); ++void ath11k_debugfs_dbg_mac_filter(struct ath11k_vif *arvif); + #else + static inline void ath11k_debugfs_twt(struct ath11k_vif *arvif, bool enable) + { + + } ++ ++static void ath11k_debugfs_dbg_mac_filter(struct ath11k_vif *arvif) ++{ ++} + #endif + + void ath11k_debug_aggr_size_config_init(struct ath11k_vif *arvif); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4046,6 +4046,25 @@ ath11k_mac_bitrate_mask_num_vht_rates(st + return num_rates; + } + ++bool ath11k_mac_sta_level_info(struct ath11k_vif *arvif, ++ struct ieee80211_sta *sta) ++{ ++ struct ath11k_mac_filter *peer; ++ ++ lockdep_assert_held(&arvif->ar->conf_mutex); ++ ++ if (arvif->vif->type == NL80211_IFTYPE_AP_VLAN || ++ list_empty(&arvif->mac_filters) || !sta) ++ return true; ++ ++ list_for_each_entry(peer, &arvif->mac_filters, list) { ++ if (ether_addr_equal(peer->peer_mac, sta->addr)) ++ return true; ++ } ++ ++ return false; ++} ++ + static int + ath11k_mac_bitrate_mask_num_he_rates(struct ath11k *ar, + enum nl80211_band band, +@@ -4187,9 +4206,15 @@ static int ath11k_station_assoc(struct a + enum nl80211_band band; + struct cfg80211_bitrate_mask *mask; + u8 num_vht_rates, num_he_rates; ++ bool peer_dbg_info; + + lockdep_assert_held(&ar->conf_mutex); + ++ peer_dbg_info = ath11k_mac_sta_level_info(arvif, sta); ++ if (peer_dbg_info) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac assoc sta %pM\n", ++ sta->addr); ++ + if (WARN_ON(ath11k_mac_vif_chan(vif, &def))) + return -EPERM; + +@@ -4270,10 +4295,16 @@ static int ath11k_station_disassoc(struc + struct ieee80211_sta *sta) + { + struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ bool peer_dbg_info; + int ret = 0; + + lockdep_assert_held(&ar->conf_mutex); + ++ peer_dbg_info = ath11k_mac_sta_level_info(arvif, sta); ++ if (peer_dbg_info) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac disassoc sta %pM\n", ++ sta->addr); ++ + if (!sta->wme) { + arvif->num_legacy_stations--; + ret = ath11k_recalc_rtscts_prot(arvif); +@@ -4305,6 +4336,7 @@ static void ath11k_sta_rc_update_wk(stru + int err, num_vht_rates, num_he_rates; + const struct cfg80211_bitrate_mask *mask; + struct peer_assoc_params peer_arg; ++ bool peer_dbg_info; + + arsta = container_of(wk, struct ath11k_sta, update_wk); + sta = container_of((void *)arsta, struct ieee80211_sta, drv_priv); +@@ -4332,6 +4364,8 @@ static void ath11k_sta_rc_update_wk(stru + + mutex_lock(&ar->conf_mutex); + ++ peer_dbg_info = ath11k_mac_sta_level_info(arvif, sta); ++ + nss = max_t(u32, 1, nss); + nss = min(nss, max(max(ath11k_mac_max_ht_nss(ht_mcs_mask), + ath11k_mac_max_vht_nss(vht_mcs_mask)), +@@ -4346,8 +4380,9 @@ static void ath11k_sta_rc_update_wk(stru + } + + if (changed & IEEE80211_RC_NSS_CHANGED) { +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac update sta %pM nss %d\n", +- sta->addr, nss); ++ if (peer_dbg_info) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac update sta %pM nss %d\n", ++ sta->addr, nss); + + err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, + WMI_PEER_NSS, nss); +@@ -4357,8 +4392,9 @@ static void ath11k_sta_rc_update_wk(stru + } + + if (changed & IEEE80211_RC_SMPS_CHANGED) { +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac update sta %pM smps %d\n", +- sta->addr, smps); ++ if (peer_dbg_info) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac update sta %pM smps %d\n", ++ sta->addr, smps); + + err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, + WMI_PEER_MIMO_PS_STATE, smps); +@@ -4368,6 +4404,10 @@ static void ath11k_sta_rc_update_wk(stru + } + + if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { ++ if (peer_dbg_info) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac update supp rates for sta %pM\n", ++ sta->addr); ++ + mask = &arvif->bitrate_mask; + num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, + mask); +@@ -4435,6 +4475,7 @@ static void ath11k_sta_use_4addr_wk(stru + struct ath11k_base *ab; + struct ath11k_peer *wds_peer; + u8 wds_addr[ETH_ALEN]; ++ bool peer_dbg_info; + u32 wds_peer_id; + int ret = 0; + +@@ -4444,13 +4485,18 @@ static void ath11k_sta_use_4addr_wk(stru + ar = arvif->ar; + ab = ar->ab; + ++ mutex_lock(&ar->conf_mutex); ++ peer_dbg_info = ath11k_mac_sta_level_info(arvif, sta); ++ mutex_unlock(&ar->conf_mutex); ++ + if (ab->nss.enabled && arvif->vif->type == NL80211_IFTYPE_AP_VLAN) { + ap_vlan_arvif = arsta->arvif; + arvif = ap_vlan_arvif->nss.ap_vif; + } + +- ath11k_dbg(ab, ATH11K_DBG_MAC, +- "setting USE_4ADDR for peer %pM\n", sta->addr); ++ if (peer_dbg_info) ++ ath11k_dbg(ab, ATH11K_DBG_PEER, ++ "setting USE_4ADDR for STA %pM\n", sta->addr); + + ret = ath11k_wmi_set_peer_param(ar, sta->addr, + arvif->vdev_id, +@@ -4618,6 +4664,7 @@ static int ath11k_mac_station_add(struct + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; + struct peer_create_params peer_param; ++ bool peer_dbg_info; + int ret; + + lockdep_assert_held(&ar->conf_mutex); +@@ -4629,6 +4676,7 @@ static int ath11k_mac_station_add(struct + goto exit; + } + ++ peer_dbg_info = ath11k_mac_sta_level_info(arvif, sta); + arsta->rx_stats = kzalloc(sizeof(*arsta->rx_stats), GFP_KERNEL); + if (!arsta->rx_stats) { + ret = -ENOMEM; +@@ -4646,8 +4694,9 @@ static int ath11k_mac_station_add(struct + goto free_rx_stats; + } + +- ath11k_dbg(ab, ATH11K_DBG_MAC, "Added peer: %pM for VDEV: %d\n", +- sta->addr, arvif->vdev_id); ++ if (peer_dbg_info) ++ ath11k_dbg(ab, ATH11K_DBG_PEER, "Added peer: %pM for VDEV: %d\n", ++ sta->addr, arvif->vdev_id); + + ret = ath11k_mac_ap_ps_recalc(ar); + if (ret) { +@@ -4664,8 +4713,9 @@ static int ath11k_mac_station_add(struct + } + + if (ieee80211_vif_is_mesh(vif)) { +- ath11k_dbg(ab, ATH11K_DBG_MAC, +- "setting USE_4ADDR for mesh peer %pM\n", sta->addr); ++ if (peer_dbg_info) ++ ath11k_dbg(ab, ATH11K_DBG_PEER, ++ "setting USE_4ADDR for mesh peer %pM\n", sta->addr); + ret = ath11k_wmi_set_peer_param(ar, sta->addr, + arvif->vdev_id, + WMI_PEER_USE_4ADDR, 1); +@@ -4782,7 +4832,7 @@ static int ath11k_mac_op_sta_state(struc + ath11k_warn(ar->ab, "Failed to delete peer: %pM for VDEV: %d\n", + sta->addr, arvif->vdev_id); + else +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Removed peer: %pM for VDEV: %d\n", ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "Removed peer: %pM for VDEV: %d\n", + sta->addr, arvif->vdev_id); + + ath11k_mac_dec_num_stations(arvif, sta); +@@ -4860,6 +4910,10 @@ static int ath11k_mac_op_sta_state(struc + spin_unlock_bh(&ar->ab->base_lock); + } + ++ if (ath11k_mac_sta_level_info(arvif, sta)) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "mac sta %pM old state %d new state :%d\n", ++ sta->addr, old_state, new_state); ++ + mutex_unlock(&ar->conf_mutex); + return ret; + } +@@ -6411,6 +6465,8 @@ static int ath11k_mac_op_add_interface(s + goto err; + } + ++ ath11k_debugfs_dbg_mac_filter(arvif); ++ + switch (vif->type) { + case NL80211_IFTYPE_UNSPECIFIED: + case NL80211_IFTYPE_STATION: +--- a/drivers/net/wireless/ath/ath11k/mac.h ++++ b/drivers/net/wireless/ath/ath11k/mac.h +@@ -166,4 +166,5 @@ enum hal_encrypt_type ath11k_dp_tx_get_e + void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif); + void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb); + void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id); ++bool ath11k_mac_sta_level_info(struct ath11k_vif *arvif, struct ieee80211_sta *sta); + #endif +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -753,6 +753,9 @@ int ath11k_peer_create(struct ath11k *ar + + ar->num_peers++; + ++ if (ath11k_mac_sta_level_info(arvif, sta)) ++ ath11k_dbg(ar->ab, ATH11K_DBG_PEER, "Peer created %pM\n", param->peer_addr); ++ + spin_unlock_bh(&ar->ab->base_lock); + + return 0; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -7946,9 +7946,6 @@ static void ath11k_peer_sta_kickout_even + goto exit; + } + +- ath11k_dbg(ab, ATH11K_DBG_WMI, "peer sta kickout event %pM", +- arg.mac_addr); +- + ieee80211_report_low_ack(sta, 10); + + exit: diff --git a/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-6GHz-Add-support-to-send-beacon-in-configured.patch b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-6GHz-Add-support-to-send-beacon-in-configured.patch new file mode 100644 index 000000000..bdfe856b8 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-6GHz-Add-support-to-send-beacon-in-configured.patch @@ -0,0 +1,89 @@ +From 966791c66fedb9dde45465fad3025b78633373dd Mon Sep 17 00:00:00 2001 +From: Rameshkumar Sundaram +Date: Fri, 7 May 2021 17:24:50 +0530 +Subject: [PATCH] ath11k: 6GHz Add support to send beacon in configured phymode + +For 6GHz band, FW expects WMI_VDEV_PARAM_6GHZ_PARAMS with required bit values +set to transmit beacon, probe and FD frames in configured phy mode. +Without this param regardless of phy mode, 6GHz beacons are sent only in +20M bandwidth. + +Hence adding support to send this vdev param during vdev creation and +phymode update events, so that beacons will be sent in configured phymode. + +This command is also sent in 11AX_HE20 mode to unset non ht dup params of the vdev +if set earlier during phy mode changes. + +Signed-off-by: Rameshkumar Sundaram +--- + drivers/net/wireless/ath/ath11k/mac.c | 27 +++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.h | 8 ++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index cbd4813..454c7e6 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6934,6 +6934,29 @@ static void ath11k_mac_op_remove_chanctx(struct ieee80211_hw *hw, + mutex_unlock(&ar->conf_mutex); + } + ++static int ath11k_mac_set_6g_nonht_dup_conf(struct ath11k_vif *arvif, const struct cfg80211_chan_def *chandef) ++{ ++ struct ath11k *ar = arvif->ar; ++ int ret = 0; ++ bool is_nontx_ap = !!(arvif->vif->multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING); ++ enum wmi_phy_mode mode = ath11k_phymodes[chandef->chan->band][chandef->width]; ++ ++ if ((arvif->vdev_type == WMI_VDEV_TYPE_AP) && !is_nontx_ap && ++ (chandef->chan->band == NL80211_BAND_6GHZ)) { ++ int param_id = WMI_VDEV_PARAM_6GHZ_PARAMS; ++ uint8_t value = 0; ++ if (mode > MODE_11AX_HE20) { ++ value |= WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_BEACON; ++ value |= WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_BCAST_PROBE_RSP; ++ value |= WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_FD_FRAME; ++ } ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Set 6GHz non-ht dup params for vdev %pM , vdev_id %d param %d value %d\n", ++ arvif->vif->addr, arvif->vdev_id, param_id, value); ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param_id, value); ++ } ++ return ret; ++} ++ + static int + ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, + const struct cfg80211_chan_def *chandef, +@@ -7054,6 +7077,10 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, + ath11k_warn(ab, "failed to set txbf conf for vdev %d: %d\n", + arvif->vdev_id, ret); + ++ ret = ath11k_mac_set_6g_nonht_dup_conf(arvif, chandef); ++ if (ret) ++ ath11k_warn(ab, "failed to set 6G non-ht dup conf for vdev %d: %d\n", ++ arvif->vdev_id, ret); + return 0; + } + +diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h +index 23c704d..d6ec11d 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.h ++++ b/drivers/net/wireless/ath/ath11k/wmi.h +@@ -2230,6 +2230,14 @@ enum { + /* preablbe short */ + #define WMI_VDEV_PREAMBLE_SHORT 0x2 + ++/** 6GHZ params **/ ++/* Control to enable/disable beacon tx in non-HT duplicate */ ++#define WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_BEACON BIT(0) ++/* Control to enable/disable broadcast probe response tx in non-HT duplicate */ ++#define WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_BCAST_PROBE_RSP BIT(1) ++/* Control to enable/disable FILS discovery frame tx in non-HT duplicate */ ++#define WMI_VDEV_6GHZ_BITMAP_NON_HT_DUPLICATE_FD_FRAME BIT(2) ++ + enum wmi_peer_smps_state { + WMI_PEER_SMPS_PS_NONE = 0x0, + WMI_PEER_SMPS_STATIC = 0x1, +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-Fix-target-assert-during-channel-switch.patch b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-Fix-target-assert-during-channel-switch.patch new file mode 100644 index 000000000..f012d8a45 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-Fix-target-assert-during-channel-switch.patch @@ -0,0 +1,65 @@ +From b0b8a0aa0584afacc024ef7b99acb06b6fe7a132 Mon Sep 17 00:00:00 2001 +From: Venkateswara Naralasetty +Date: Fri, 7 May 2021 18:51:33 +0530 +Subject: [PATCH] ath11k: Fix target assert during channel switch + +Updating the new bandwidth for the peer after the channel switch from +sta_rc_update work may result in target asset if in case new bandwidth +is greater than the peer phymode configured from peer assoc command. +Since, no peer assoc comamnd sent for the peer during channel switch. + +For example, initially AP is in HE40 mode. So, peer phymode will be +configured as MODE_11AX_HE40. Now user change the channel with bw HE80 +then the peer bandwidth is configured as HE80 from sta_rc_update. +Which results in target assert due to peer bandwidth is grater than +the peer phymode. + +Fix this issue by sending peer assoc command before setting the updated +peer bw to fw. + +Signed-off-by: Venkateswara Naralasetty +--- + drivers/net/wireless/ath/ath11k/mac.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index cbd4813..fae44b9 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4371,11 +4371,29 @@ static void ath11k_sta_rc_update_wk(struct work_struct *wk) + ath11k_mac_max_he_nss(he_mcs_mask))); + + if (changed & IEEE80211_RC_BW_CHANGED) { +- err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, +- WMI_PEER_CHWIDTH, bw); ++ /* Send peer assoc command before peer bandwidth param set to ++ * avoid the target assert due to mismatch between the peer phymode ++ * and peer bandwidth. ++ */ ++ ath11k_peer_assoc_prepare(ar, arvif->vif, sta, &peer_arg, true); ++ ++ peer_arg.is_assoc = false; ++ err = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg); + if (err) +- ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n", +- sta->addr, bw, err); ++ ath11k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n", ++ sta->addr, arvif->vdev_id, err); ++ else { ++ if (!wait_for_completion_timeout(&ar->peer_assoc_done, 1 * HZ)) ++ ath11k_warn(ar->ab, "failed to get peer assoc conf event for %pM vdev %i\n", ++ sta->addr, arvif->vdev_id); ++ else { ++ err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, ++ WMI_PEER_CHWIDTH, bw); ++ if (err) ++ ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n", ++ sta->addr, bw, err); ++ } ++ } + } + + if (changed & IEEE80211_RC_NSS_CHANGED) { +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-fix-256-BA-mode.patch b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-fix-256-BA-mode.patch new file mode 100644 index 000000000..c303bfb0a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/307-ath11k-fix-256-BA-mode.patch @@ -0,0 +1,41 @@ +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index cbd48137a3c5..7290175ceaf3 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3104,6 +3104,21 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, + arvif->do_not_send_tmpl = true; + else + arvif->do_not_send_tmpl = false; ++ ++ if (vif->bss_conf.he_support) { ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, ++ WMI_VDEV_PARAM_BA_MODE, ++ WMI_BA_MODE_BUFFER_SIZE_256); ++ if (ret) { ++ ath11k_warn(ar->ab, ++ "failed to set BA BUFFER SIZE 256 for vdev: %d\n", ++ arvif->vdev_id); ++ } else { ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, ++ "Set BA BUFFER SIZE 256 for VDEV: %d\n", ++ arvif->vdev_id); ++ } ++ } + } + + if (changed & (BSS_CHANGED_BEACON_INFO | BSS_CHANGED_BEACON)) { +@@ -3141,14 +3156,6 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, + + if (arvif->is_up && vif->bss_conf.he_support && + vif->bss_conf.he_oper.params) { +- ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +- WMI_VDEV_PARAM_BA_MODE, +- WMI_BA_MODE_BUFFER_SIZE_256); +- if (ret) +- ath11k_warn(ar->ab, +- "failed to set BA BUFFER SIZE 256 for vdev: %d\n", +- arvif->vdev_id); +- + param_id = WMI_VDEV_PARAM_HEOPS_0_31; + param_value = vif->bss_conf.he_oper.params; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, diff --git a/feeds/wifi-ax/mac80211/patches/qca/307-mac80211-support-to-dump-cont-tx-fail-count-in-mesh.patch b/feeds/wifi-ax/mac80211/patches/qca/307-mac80211-support-to-dump-cont-tx-fail-count-in-mesh.patch new file mode 100644 index 000000000..01476a016 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/307-mac80211-support-to-dump-cont-tx-fail-count-in-mesh.patch @@ -0,0 +1,352 @@ +From 55099b7989862821d1a8c3eea3ba1c309ecf40d5 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Wed, 16 Jun 2021 16:59:36 +0530 +Subject: [PATCH] mac80211 - support to dump continuous tx fail count in mesh + +Signed-off-by: Hari Chandrakanthan +--- + include/net/cfg80211.h | 5 +++ + include/uapi/linux/nl80211.h | 6 ++++ + net/mac80211/debugfs_sta.c | 46 +++++++++++++++++++++++++ + net/mac80211/mesh_hwmp.c | 82 ++++++++++++++++++++++++++++++++++++++++++-- + net/mac80211/mesh_pathtbl.c | 12 +++++++ + net/mac80211/sta_info.h | 15 ++++++++ + net/wireless/nl80211.c | 22 ++++++++++++ + 7 files changed, 185 insertions(+), 3 deletions(-) + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -7550,6 +7550,11 @@ void cfg80211_cqm_pktloss_notify(struct + void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer, + u32 num_packets, u32 rate, u32 intvl, gfp_t gfp); + ++void cfg80211_cqm_mpath_change_notify(struct net_device *dev, ++ const u8 *peer, ++ enum nl80211_mpath_change_notify event, ++ gfp_t gfp); ++ + /** + * cfg80211_cqm_beacon_loss_notify - beacon loss event + * @dev: network device +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -5012,6 +5012,11 @@ enum nl80211_ps_state { + NL80211_PS_ENABLED, + }; + ++enum nl80211_mpath_change_notify { ++ NL80211_MPATH_METRIC_CHANGE, ++ NL80211_MPATH_BROKEN_NOTIFY, ++}; ++ + /** + * enum nl80211_attr_cqm - connection quality monitor attributes + * @__NL80211_ATTR_CQM_INVALID: invalid +@@ -5056,6 +5061,7 @@ enum nl80211_attr_cqm { + NL80211_ATTR_CQM_TXE_INTVL, + NL80211_ATTR_CQM_BEACON_LOSS_EVENT, + NL80211_ATTR_CQM_RSSI_LEVEL, ++ NL80211_ATTR_CQM_MPATH_CHANGE_EVENT, + + /* keep last */ + __NL80211_ATTR_CQM_AFTER_LAST, +--- a/net/mac80211/debugfs_sta.c ++++ b/net/mac80211/debugfs_sta.c +@@ -508,6 +508,49 @@ static ssize_t sta_ht_capa_read(struct f + } + STA_OPS(ht_capa); + ++static ssize_t sta_tx_fail_cnt_read(struct file *file, char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ char buf[12 * MAX_TX_FAIL_CNT], *p = buf; ++ int i; ++ ++ if(!sta->mesh) { ++ p += scnprintf(p, sizeof(buf) + buf - p, "tx_fail_cnt is supported only for mesh\n"); ++ return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); ++ } ++ ++ for (i = 0; i < MAX_TX_FAIL_CNT; i++) { ++ if (!sta->mesh->tx_fail_cnt[i]) ++ continue; ++ p += scnprintf(p, sizeof(buf) + buf - p, "%d : %u\n",i, ++ sta->mesh->tx_fail_cnt[i]); ++ } ++ return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); ++} ++ ++static ssize_t sta_tx_fail_cnt_write(struct file *file, ++ const char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct sta_info *sta = file->private_data; ++ int ret; ++ u8 val; ++ ++ ret = kstrtou8_from_user(userbuf, count, 0, &val); ++ ++ if (!sta->mesh || ret || val >= MESH_TX_FAILURE_LOG_CTRL_MAX) ++ return -EINVAL; ++ ++ if (val & MESH_RESET_TX_FAIL_COUNT) ++ memset(sta->mesh->tx_fail_cnt, 0, sizeof(u32) * MAX_TX_FAIL_CNT); ++ ++ sta->mesh->tx_fail_log = val; ++ return count; ++} ++ ++STA_OPS_RW(tx_fail_cnt); ++ + static ssize_t sta_vht_capa_read(struct file *file, char __user *userbuf, + size_t count, loff_t *ppos) + { +@@ -1196,6 +1239,9 @@ void ieee80211_sta_debugfs_add(struct st + DEBUGFS_ADD(reset_mac80211_rx_pkts_flow); + DEBUGFS_ADD(mac80211_tx_pkts_flow); + DEBUGFS_ADD(mac80211_rx_pkts_flow); ++#ifdef CPTCFG_MAC80211_MESH ++ DEBUGFS_ADD(tx_fail_cnt); ++#endif + + DEBUGFS_ADD_COUNTER(rx_duplicates, rx_stats.num_duplicates); + DEBUGFS_ADD_COUNTER(rx_fragments, rx_stats.fragments); +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -71,6 +71,9 @@ static inline u16 u16_field_get(const u8 + #define SN_LT(x, y) ((s32)(x - y) < 0) + #define MAX_SANE_SN_DELTA 32 + ++#define MP_DIFF(a, b) (((a) > (b)) ? ((a) - (b)) : ((b) - (a))) ++#define LOG_PERCENT_DIFF 30 ++ + static inline u32 SN_DELTA(u32 x, u32 y) + { + return x >= y ? x - y : y - x; +@@ -297,11 +300,24 @@ void ieee80211s_update_metric(struct iee + struct ieee80211_tx_status *st) + { + struct ieee80211_tx_info *txinfo = st->info; +- int failed; ++ int failed = 0; + struct rate_info rinfo; + + failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK); + ++ if (failed) ++ sta->mesh->fail_cnt++; ++ else if (sta->mesh->fail_cnt) { ++ if (sta->mesh->fail_cnt >= MAX_TX_FAIL_CNT && ++ (sta->mesh->tx_fail_log & MESH_ENABLE_MPL_LOG)) ++ sdata_info(sta->sdata, " MESH MPL HIGHER fail count %u for peer %pM\n", ++ sta->mesh->fail_cnt, sta->sta.addr); ++ ++ if(sta->mesh->fail_cnt < MAX_TX_FAIL_CNT) ++ sta->mesh->tx_fail_cnt[sta->mesh->fail_cnt]++; ++ sta->mesh->fail_cnt = 0; ++ } ++ + /* moving average, scaled to 100. + * feed failure as 100 and success as 0 + */ +@@ -367,6 +383,30 @@ next_hop_deref_protected(struct mesh_pat + lockdep_is_held(&mpath->state_lock)); + } + ++void mesh_continuous_tx_fail_cnt(struct sta_info *sta, ++ enum nl80211_mpath_change_notify event) ++{ ++ int i; ++ ++ if (!(sta->mesh->tx_fail_log & MESH_ENABLE_TX_FAIL_COUNT_LOG)) ++ return; ++ ++ cfg80211_cqm_mpath_change_notify(sta->sdata->dev, sta->sta.addr, ++ event, GFP_ATOMIC); ++ ++ sdata_info(sta->sdata, "MESH MPL continuous fail count :\n"); ++ for (i = 0; i < MAX_TX_FAIL_CNT; i++) { ++ if (!sta->mesh->tx_fail_cnt[i]) ++ continue; ++ ++ sdata_info(sta->sdata, "%d cont tx failure occurred %u times\n", i, ++ sta->mesh->tx_fail_cnt[i]); ++ } ++ ++ sdata_info(sta->sdata, "current continuous tx fail count %u\n", ++ sta->mesh->fail_cnt); ++} ++ + /** + * hwmp_route_info_get - Update routing info to originator and transmitter + * +@@ -400,6 +440,8 @@ static u32 hwmp_route_info_get(struct ie + u32 last_hop_metric, new_metric; + bool process = true; + u8 hopcount; ++ int signal_avg; ++ bool mpath_metric_change = 0; + + rcu_read_lock(); + sta = sta_info_get(sdata, mgmt->sa); +@@ -498,8 +540,23 @@ static u32 hwmp_route_info_get(struct ie + next_hop = rcu_dereference(mpath->next_hop); + if (next_hop) + ether_addr_copy(old_next_hop_addr, next_hop->sta.addr); +- if (next_hop != sta) ++ if (next_hop != sta) { + mpath->path_change_count++; ++ mpath_dbg(sdata, "MESH MPU dst %pM next hop %pM" ++ " metric %d ft 0x%x\n", ++ mpath->dst, sta->addr, last_hop_metric, action); ++ } else if (MP_DIFF(last_hop_metric, mpath->metric) > ++ (mpath->metric*LOG_PERCENT_DIFF)/100) { ++ signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); ++ mpath_dbg(sdata, "MESH MPLMU DIRECT dst %pM next hop" ++ " %pM metric from %d to %d ft 0x%x signal %d" ++ "dbm signal_avg %d dbm\n", ++ mpath->dst, sta->addr, mpath->metric, ++ last_hop_metric, action, ++ sta->rx_stats.last_signal, ++ signal_avg); ++ mpath_metric_change = 1; ++ } + mesh_path_assign_nexthop(mpath, sta); + mpath->flags |= MESH_PATH_SN_VALID; + mpath->metric = new_metric; +@@ -551,8 +608,23 @@ static u32 hwmp_route_info_get(struct ie + next_hop = rcu_dereference(mpath->next_hop); + if (next_hop) + ether_addr_copy(old_next_hop_addr, next_hop->sta.addr); +- if (next_hop != sta) ++ if (next_hop != sta) { + mpath->path_change_count++; ++ mpath_dbg(sdata, "MESH MPU dst %pM next hop %pM" ++ " metric %d ft 0x%x\n", ++ mpath->dst, sta->addr, last_hop_metric, action); ++ } else if (MP_DIFF(last_hop_metric, mpath->metric) > ++ (mpath->metric*LOG_PERCENT_DIFF)/100) { ++ signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); ++ mpath_dbg(sdata, "MESH MPLMU DIRECT dst %pM next hop" ++ " %pM metric from %d to %d ft 0x%x signal" ++ " %d dbm signal_avg %d dbm\n", ++ mpath->dst, sta->addr, mpath->metric, ++ last_hop_metric, action, ++ sta->rx_stats.last_signal, ++ signal_avg); ++ mpath_metric_change = 1; ++ } + mesh_path_assign_nexthop(mpath, sta); + mpath->metric = last_hop_metric; + mpath->exp_time = time_after(mpath->exp_time, exp_time) +@@ -570,6 +642,9 @@ static u32 hwmp_route_info_get(struct ie + spin_unlock_bh(&mpath->state_lock); + } + ++ if (mpath_metric_change) ++ mesh_continuous_tx_fail_cnt(sta, NL80211_MPATH_METRIC_CHANGE); ++ + rcu_read_unlock(); + + return process ? new_metric : 0; +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -601,6 +601,7 @@ void mesh_plink_broken(struct sta_info * + struct mesh_table *tbl = sdata->u.mesh.mesh_paths; + static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + struct mesh_path *mpath; ++ int paths_deactivated = 0, signal_avg; + + rcu_read_lock(); + hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) { +@@ -615,9 +616,20 @@ void mesh_plink_broken(struct sta_info * + sdata->u.mesh.mshcfg.element_ttl, + mpath->dst, mpath->sn, + WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast); ++ ++paths_deactivated; + } + } + rcu_read_unlock(); ++ if (paths_deactivated) { ++ signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); ++ if(sta->mesh->tx_fail_log & MESH_ENABLE_MPL_LOG) ++ sdata_info(sta->sdata, " MESH MPL link to %pM is broken and" ++ " %d path deactivated signal %d dbm signal_avg %d dbm\n", ++ sta->addr, paths_deactivated, ++ sta->rx_stats.last_signal, ++ signal_avg); ++ mesh_continuous_tx_fail_cnt(sta, NL80211_MPATH_BROKEN_NOTIFY); ++ } + } + + static void mesh_path_free_rcu(struct mesh_table *tbl, +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -123,6 +123,15 @@ enum ieee80211_sta_info_flags { + #define HT_AGG_STATE_STOP_CB 7 + #define HT_AGG_STATE_SENT_ADDBA 8 + ++#define MAX_TX_FAIL_CNT 50 ++ ++enum mesh_tx_failure_log_control{ ++ MESH_RESET_TX_FAIL_COUNT = BIT(0), ++ MESH_ENABLE_TX_FAIL_COUNT_LOG = BIT(1), ++ MESH_ENABLE_MPL_LOG = BIT(2), ++ MESH_TX_FAILURE_LOG_CTRL_MAX = BIT(3) ++}; ++ + DECLARE_EWMA(avg_signal, 10, 8) + enum ieee80211_agg_stop_reason { + AGG_STOP_DECLINED, +@@ -423,6 +432,10 @@ struct mesh_sta { + struct ewma_mesh_fail_avg fail_avg; + /* moving average of tx bitrate */ + struct ewma_mesh_tx_rate_avg tx_rate_avg; ++ ++ u32 fail_cnt; ++ u32 tx_fail_cnt[MAX_TX_FAIL_CNT]; ++ u8 tx_fail_log; + }; + + DECLARE_EWMA(signal, 10, 8) +@@ -834,6 +847,8 @@ u8 sta_info_tx_streams(struct sta_info * + void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta); + void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta); + void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta); ++void mesh_continuous_tx_fail_cnt(struct sta_info *sta, ++ enum nl80211_mpath_change_notify event); + + unsigned long ieee80211_sta_last_active(struct sta_info *sta); + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -17439,6 +17439,28 @@ void cfg80211_cqm_txe_notify(struct net_ + } + EXPORT_SYMBOL(cfg80211_cqm_txe_notify); + ++void cfg80211_cqm_mpath_change_notify(struct net_device *dev, ++ const u8 *peer, ++ enum nl80211_mpath_change_notify event, ++ gfp_t gfp) ++{ ++ struct sk_buff *msg; ++ ++ msg = cfg80211_prepare_cqm(dev, peer, gfp); ++ if (!msg) ++ return; ++ ++ if (nla_put_u32(msg, NL80211_ATTR_CQM_MPATH_CHANGE_EVENT, event)) ++ goto nla_put_failure; ++ ++ cfg80211_send_cqm(msg, gfp); ++ return; ++ ++ nla_put_failure: ++ nlmsg_free(msg); ++} ++EXPORT_SYMBOL(cfg80211_cqm_mpath_change_notify); ++ + void cfg80211_cqm_pktloss_notify(struct net_device *dev, + const u8 *peer, u32 num_packets, gfp_t gfp) + { diff --git a/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-fix-potential-wmi_mgmt_tx_queue-race-condition.patch b/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-fix-potential-wmi_mgmt_tx_queue-race-condition.patch new file mode 100644 index 000000000..6674fabcb --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-fix-potential-wmi_mgmt_tx_queue-race-condition.patch @@ -0,0 +1,41 @@ +From 5bb4a0bee3b2196ced72c35bd0ba0b238971c721 Mon Sep 17 00:00:00 2001 +From: Miaoqing Pan +Date: Thu, 13 May 2021 10:37:00 +0530 +Subject: [PATCH] ath11k: fix potential wmi_mgmt_tx_queue race condition + +There is a potential race condition between skb_queue_len() +and skb_queue_tail(), the former may get old value before +updated by the latter. + +So use skb_queue_len_lockless() instead. And also use '>=', +in case we queue a few SKBs simultaneously. + +Found while discussing a similar fix for ath10k: +https://patchwork.kernel.org/project/linux-wireless/patch/1608515579-1066-1-git-send-email-miaoqing@codeaurora.org/ + +No functional changes, compile tested only. + +Signed-off-by: Miaoqing Pan +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1613630709-704-1-git-send-email-miaoqing@codeaurora.org +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/mac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index 60475ad7cf8e..9bc132d44e4e 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5953,7 +5953,7 @@ static int ath11k_mac_tx_over_wmi(struct ath11k *ar, struct sk_buff *skb, + return -EBUSY; + } + +- if (skb_queue_len(q) == ATH11K_TX_MGMT_NUM_PENDING_MAX) { ++ if (skb_queue_len_lockless(q) >= ATH11K_TX_MGMT_NUM_PENDING_MAX) { + ath11k_warn(ar->ab, "mgmt tx queue is full\n"); + return -ENOSPC; + } +-- +2.31.1 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-poll-reo-status-ipq5018.patch b/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-poll-reo-status-ipq5018.patch new file mode 100644 index 000000000..e86468c31 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/308-ath11k-poll-reo-status-ipq5018.patch @@ -0,0 +1,278 @@ +From d890c6d602307c9297df12c7d0287f9ffd26208b Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Wed, 12 May 2021 19:21:09 +0530 +Subject: [PATCH] ath11k: poll reo status ring for IPQ5018 + +Currently reo status interrupts are not received +due to wrong mapping of the reo status interrupt +line in IPQ5018. + +Hence, until the mapping is resolved in HW, use +polling to reap the reo status ring. Rather than +a period timer to reap the ring, the timer is +triggered only on sending a reo command with +status request. + +Without proper reaping of the ring, backpressure +and ring full issues are seen in multi client test +setups which leads to flooding the console with +error messages reporting failure to send reo cmds. + +Can be reverted once HW solution is available. + +Signed-off-by: Sriram R +--- + drivers/net/wireless/ath/ath11k/core.c | 8 ++++- + drivers/net/wireless/ath/ath11k/dp.c | 59 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/dp.h | 8 +++++ + drivers/net/wireless/ath/ath11k/dp_tx.c | 4 +++ + drivers/net/wireless/ath/ath11k/hw.c | 31 +++++++++++++++++ + drivers/net/wireless/ath/ath11k/hw.h | 2 ++ + 6 files changed, 111 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -111,6 +111,7 @@ static const struct ath11k_hw_params ath + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, ++ .reo_status_poll = false, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -163,6 +164,7 @@ static const struct ath11k_hw_params ath + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, ++ .reo_status_poll = false, + }, + { + .name = "qca6390 hw2.0", +@@ -209,6 +211,7 @@ static const struct ath11k_hw_params ath + .is_qdss_support = false, + .max_tx_ring = 1, + .wakeup_mhi = true, ++ .reo_status_poll = false, + }, + { + .name = "qcn9074 hw1.0", +@@ -267,6 +270,7 @@ static const struct ath11k_hw_params ath + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, ++ .reo_status_poll = false, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -282,7 +286,7 @@ static const struct ath11k_hw_params ath + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), + .hw_ops = &ipq5018_ops, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, +- .ring_mask = &ath11k_hw_ring_mask_ipq8074, ++ .ring_mask = &ath11k_hw_ring_mask_ipq5018, + .regs = &ipq5018_regs, + .m3_addr = ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS, + .spectral_fft_sz = 2, +@@ -318,6 +322,7 @@ static const struct ath11k_hw_params ath + .is_qdss_support = false, + .max_tx_ring = DP_TCL_NUM_RING_MAX, + .wakeup_mhi = false, ++ .reo_status_poll = true, + }, + { + .hw_rev = ATH11K_HW_QCN6122, +@@ -333,7 +338,7 @@ static const struct ath11k_hw_params ath + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), + .hw_ops = &qcn6122_ops, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122, +- .ring_mask = &ath11k_hw_ring_mask_ipq8074, ++ .ring_mask = &ath11k_hw_ring_mask_ipq5018, + .regs = &qcn6122_regs, + .m3_addr = ATH11K_QMI_QCN6122_M3_DUMP_ADDRESS, + .spectral_fft_sz = 2, +@@ -370,6 +375,7 @@ static const struct ath11k_hw_params ath + .is_qdss_support = true, + .max_tx_ring = DP_TCL_NUM_RING_MAX, + .wakeup_mhi = false, ++ .reo_status_poll = true, + }, + }; + +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -367,12 +367,66 @@ void ath11k_dp_stop_shadow_timers(struct + ath11k_dp_shadow_stop_timer(ab, &ab->dp.reo_cmd_timer); + } + ++static void ath11k_dp_handle_reo_status_timer(struct timer_list *timer) ++{ ++ struct ath11k_dp *dp = from_timer(dp, timer, reo_status_timer); ++ struct ath11k_base *ab = dp->ab; ++ ++ spin_lock_bh(&dp->reo_cmd_lock); ++ dp->reo_status_timer_running = false; ++ spin_unlock_bh(&dp->reo_cmd_lock); ++ ++ ath11k_dp_process_reo_status(ab); ++} ++ ++void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab) ++{ ++ struct ath11k_dp *dp = &ab->dp; ++ ++ if (!ab->hw_params.reo_status_poll) ++ return; ++ ++ spin_lock_bh(&dp->reo_cmd_lock); ++ if (dp->reo_status_timer_running) { ++ spin_unlock_bh(&dp->reo_cmd_lock); ++ return; ++ } ++ dp->reo_status_timer_running = true; ++ spin_unlock_bh(&dp->reo_cmd_lock); ++ ++ mod_timer(&dp->reo_status_timer, jiffies + ++ msecs_to_jiffies(ATH11K_REO_STATUS_POLL_TIMEOUT_MS)); ++} ++ ++static void ath11k_dp_stop_reo_status_timer(struct ath11k_base *ab) ++{ ++ struct ath11k_dp *dp = &ab->dp; ++ ++ if (!ab->hw_params.reo_status_poll) ++ return; ++ ++ del_timer_sync(&dp->reo_status_timer); ++ dp->reo_status_timer_running = false; ++} ++ ++static void ath11k_dp_init_reo_status_timer(struct ath11k_base *ab) ++{ ++ struct ath11k_dp *dp = &ab->dp; ++ ++ if (!ab->hw_params.reo_status_poll) ++ return; ++ ++ timer_setup(&dp->reo_status_timer, ++ ath11k_dp_handle_reo_status_timer, 0); ++} ++ + static void ath11k_dp_srng_common_cleanup(struct ath11k_base *ab) + { + struct ath11k_dp *dp = &ab->dp; + int i; + + ath11k_dp_stop_shadow_timers(ab); ++ ath11k_dp_stop_reo_status_timer(ab); + ath11k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring); + ath11k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring); + ath11k_dp_srng_cleanup(ab, &dp->tcl_status_ring); +@@ -394,6 +448,8 @@ static int ath11k_dp_srng_common_setup(s + int i, ret; + u32 ring_hash_map; + ++ ath11k_dp_init_reo_status_timer(ab); ++ + ret = ath11k_dp_srng_setup(ab, &dp->wbm_desc_rel_ring, + HAL_SW2WBM_RELEASE, 0, 0, + DP_WBM_RELEASE_RING_SIZE); +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -44,6 +44,8 @@ struct dp_rx_tid { + #define DP_MON_PURGE_TIMEOUT_MS 100 + #define DP_MON_SERVICE_BUDGET 128 + ++#define ATH11K_REO_STATUS_POLL_TIMEOUT_MS 10 ++ + struct dp_reo_cache_flush_elem { + struct list_head list; + struct dp_rx_tid data; +@@ -293,6 +295,10 @@ struct ath11k_dp { + spinlock_t reo_cmd_lock; + struct ath11k_hp_update_timer reo_cmd_timer; + struct ath11k_hp_update_timer tx_ring_timer[DP_TCL_NUM_RING_MAX]; ++ ++ /* reo status timer and flags */ ++ struct timer_list reo_status_timer; ++ bool reo_status_timer_running; + }; + + /* HTT definitions */ +@@ -1925,5 +1931,6 @@ void ath11k_dp_shadow_init_timer(struct + struct ath11k_hp_update_timer *update_timer, + u32 interval, u32 ring_id); + void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab); ++void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab); + + #endif +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -807,6 +807,10 @@ int ath11k_dp_tx_send_reo_cmd(struct ath + if (cmd_num == 0) + return -EINVAL; + ++ /* Trigger reo status polling if required */ ++ if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS) ++ ath11k_dp_start_reo_status_timer(ab); ++ + if (!cb) + return 0; + +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -1321,6 +1321,37 @@ const struct ath11k_hw_ring_mask ath11k_ + }, + }; + ++const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq5018 = { ++ .tx = { ++ ATH11K_TX_RING_MASK_0, ++ ATH11K_TX_RING_MASK_1, ++ ATH11K_TX_RING_MASK_2, ++ }, ++ .rx_mon_status = { ++ 0, 0, 0, ++ ATH11K_RX_MON_STATUS_RING_MASK_0, ++ }, ++ .rx = { ++ 0, 0, 0, 0, ++ ATH11K_RX_RING_MASK_0, ++ ATH11K_RX_RING_MASK_1, ++ ATH11K_RX_RING_MASK_2, ++ ATH11K_RX_RING_MASK_3, ++ }, ++ .rx_err = { ++ ATH11K_RX_ERR_RING_MASK_0, ++ }, ++ .rx_wbm_rel = { ++ ATH11K_RX_WBM_REL_RING_MASK_0, ++ }, ++ .rxdma2host = { ++ ATH11K_RXDMA2HOST_RING_MASK_0, ++ }, ++ .host2rxdma = { ++ ATH11K_HOST2RXDMA_RING_MASK_0, ++ }, ++}; ++ + /* Target firmware's Copy Engine configuration. */ + const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[] = { + /* CE0: host->target HTC control and raw streams */ +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -213,6 +213,7 @@ struct ath11k_hw_params { + u32 cfr_num_stream_bufs; + u32 cfr_stream_buf_size; + u8 max_tx_ring; ++ bool reo_status_poll; + }; + + struct ath11k_hw_ops { +@@ -283,6 +284,7 @@ extern const struct ath11k_hw_ops qcn612 + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074; ++extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq5018; + + static inline + int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw, diff --git a/feeds/wifi-ax/mac80211/patches/qca/308-cfg80211-Fetch-wiphy-dfs-domain-if-it-is-self-manage.patch b/feeds/wifi-ax/mac80211/patches/qca/308-cfg80211-Fetch-wiphy-dfs-domain-if-it-is-self-manage.patch new file mode 100644 index 000000000..3871e0b1a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/308-cfg80211-Fetch-wiphy-dfs-domain-if-it-is-self-manage.patch @@ -0,0 +1,41 @@ +From d08b74269ff8a35d9bd695610e1dad0fc38f1b66 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Mon, 10 May 2021 18:23:56 +0530 +Subject: [PATCH] cfg80211: Fetch wiphy dfs domain if it is self managed + +Currently during CAC start or other radar events, the DFS +domain is fetched from cfg based on global dfs setting. + +But this could be different in case of self managed wiphy's +in case the self managed driver updates it database or supports +regions which has DFS domain set to UNSET in cfg80211 glocal +regdomain. + +This avoids AP bringup failure for these self managed drivers +in certain countries. + +Signed-off-by: Sriram R +--- + net/wireless/reg.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/net/wireless/reg.c b/net/wireless/reg.c +index bc5d311..f3bf028 100644 +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -182,6 +182,12 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy) + if (!wiphy_regd) + goto out; + ++ /* In case the wiphy is self managed, return its dfs domain */ ++ if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) { ++ rcu_read_unlock(); ++ return wiphy_regd->dfs_region; ++ } ++ + if (wiphy_regd->dfs_region == regd->dfs_region) + goto out; + +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/pending/212-ath11k-clear-frag-cache-on-key-install.patch b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-Clear-the-fragment-cache-during-key-install.patch similarity index 72% rename from feeds/wifi-ax/mac80211/patches/pending/212-ath11k-clear-frag-cache-on-key-install.patch rename to feeds/wifi-ax/mac80211/patches/qca/309-ath11k-Clear-the-fragment-cache-during-key-install.patch index ab4b588d7..1785ecc9a 100644 --- a/feeds/wifi-ax/mac80211/patches/pending/212-ath11k-clear-frag-cache-on-key-install.patch +++ b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-Clear-the-fragment-cache-during-key-install.patch @@ -1,30 +1,31 @@ -From 0e23a88c63d6abbeaef8ec90bd29584b7c5068bd Mon Sep 17 00:00:00 2001 +From a60eea4345deccc023fd629c571fe7ca068bb878 Mon Sep 17 00:00:00 2001 From: Sriram R Date: Thu, 10 Dec 2020 14:20:50 +0530 Subject: [PATCH] ath11k: Clear the fragment cache during key install Currently the fragment cache setup during peer assoc is -cleared during peer delete. In case a key reinstallation -happens with the same peer, possibilitites are same fragment cache -where some fragments were added before key installation could be clubbed -with fragments received after. In ideal cases where -this could result in wrong PN since we expect all fragments to -have incrementing PN, this behavior could be explioted +cleared only during peer delete. In case a key reinstallation +happens with the same peer, the same fragment cache with old +fragments added before key installation could be clubbed +with fragments received after. This might be exploited to mix fragments of different data resulting in a proper unintended reassembled packet to be passed up the stack. +Hence flush the fragment cache on every key installation. + Signed-off-by: Sriram R --- - drivers/net/wireless/ath/ath11k/dp_rx.c | 19 +++++++++++++++++++ + + drivers/net/wireless/ath/ath11k/dp_rx.c | 18 ++++++++++++++++++ drivers/net/wireless/ath/ath11k/dp_rx.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 6 ++++++ - 3 files changed, 26 insertions(+) + 3 files changed, 25 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c -index 0fa25c1..06bbd6e 100644 +index 1d9aa1b..3382f8b 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -844,6 +844,25 @@ static void ath11k_dp_rx_frags_cleanup(struct dp_rx_tid *rx_tid, bool rel_link_d +@@ -852,6 +852,24 @@ static void ath11k_dp_rx_frags_cleanup(struct dp_rx_tid *rx_tid, bool rel_link_d __skb_queue_purge(&rx_tid->rx_frags); } @@ -43,7 +44,6 @@ index 0fa25c1..06bbd6e 100644 + spin_lock_bh(&ar->ab->base_lock); + + ath11k_dp_rx_frags_cleanup(rx_tid, true); -+ + } +} + @@ -51,10 +51,10 @@ index 0fa25c1..06bbd6e 100644 { struct dp_rx_tid *rx_tid; diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.h b/drivers/net/wireless/ath/ath11k/dp_rx.h -index f005ded..732f9a7 100644 +index bf39931..623da3b 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.h +++ b/drivers/net/wireless/ath/ath11k/dp_rx.h -@@ -68,6 +68,7 @@ int ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif, +@@ -49,6 +49,7 @@ int ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif, const u8 *peer_addr, enum set_key_cmd key_cmd, struct ieee80211_key_conf *key); @@ -63,16 +63,16 @@ index f005ded..732f9a7 100644 void ath11k_peer_rx_tid_delete(struct ath11k *ar, struct ath11k_peer *peer, u8 tid); diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c -index 4c88eab..91d645e 100644 +index 4df425d..9d0ff15 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3707,6 +3707,12 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, +@@ -2779,6 +2779,12 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, */ spin_lock_bh(&ab->base_lock); peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); + + /* flush the fragments cache during key (re)install to -+ * ensure all frags in the new frag list belong to the same key. ++ * ensure all frags in the new frag list belong to the same key. + */ + if (peer && cmd == SET_KEY) + ath11k_peer_frags_flush(ar, peer); diff --git a/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-fix-cpu-stall.patch b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-fix-cpu-stall.patch new file mode 100644 index 000000000..26cf17518 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-fix-cpu-stall.patch @@ -0,0 +1,89 @@ +From: Karthikeyan Periyasamy +Subject: [PATCH] ath11k: avoid RCU cpu stall + +The following problems can result in RCU CPU stall warning +1. A CPU looping in an RCU read-side critical section +2. A CPU looping with interrupts disabled +3. A CPU looping with preemption disabled +4. A CPU looping with bottom halves disabled +scenario 1: +As per the above step 4, avoid spin_lock_bh() while +reporting low_ack to user. + +scenario 2: +As per the above step 1 & 4, avoid rcu_read_lock() while +reporting mgmt rx through bottom halve disable call ieee80211_rx_ni() + +Signed-off-by: Karthikeyan Periyasamy +--- +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -7429,6 +7429,7 @@ static void ath11k_mgmt_rx_event(struct + struct ieee80211_vif *vif; + struct ath11k_vif *arvif; + struct ath11k_mgmt_frame_stats *mgmt_stats; ++ struct ieee80211_hw *hw; + u16 frm_type = 0; + + if (ath11k_pull_mgmt_rx_params_tlv(ab, skb, &rx_ev) != 0) { +@@ -7459,6 +7460,8 @@ static void ath11k_mgmt_rx_event(struct + goto exit; + } + ++ hw = ar->hw; ++ + if (rx_ev.status & WMI_RX_STATUS_ERR_MIC) + status->flag |= RX_FLAG_MMIC_ERROR; + +@@ -7559,8 +7562,11 @@ skip_mgmt_stats: + status->freq, status->band, status->signal, + status->rate_idx); + +- ieee80211_rx_ni(ar->hw, skb); ++ rcu_read_unlock(); ++ ++ ieee80211_rx_ni(hw, skb); + ++ return; + exit: + rcu_read_unlock(); + } +@@ -7913,6 +7919,7 @@ static void ath11k_peer_sta_kickout_even + struct ieee80211_sta *sta; + struct ath11k_peer *peer; + struct ath11k *ar; ++ u32 vdev_id; + + if (ath11k_pull_peer_sta_kickout_ev(ab, skb, &arg) != 0) { + ath11k_warn(ab, "failed to extract peer sta kickout event"); +@@ -7926,15 +7933,20 @@ static void ath11k_peer_sta_kickout_even + peer = ath11k_peer_find_by_addr(ab, arg.mac_addr); + + if (!peer) { ++ spin_unlock_bh(&ab->base_lock); + ath11k_warn(ab, "peer not found %pM\n", + arg.mac_addr); + goto exit; + } + +- ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); ++ vdev_id = peer->vdev_id; ++ ++ spin_unlock_bh(&ab->base_lock); ++ ++ ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); + if (!ar) { + ath11k_warn(ab, "invalid vdev id in peer sta kickout ev %d", +- peer->vdev_id); ++ vdev_id); + goto exit; + } + +@@ -7949,7 +7961,6 @@ static void ath11k_peer_sta_kickout_even + ieee80211_report_low_ack(sta, 10); + + exit: +- spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-support-to-calculate-medium-busy.patch b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-support-to-calculate-medium-busy.patch new file mode 100644 index 000000000..b33d0c944 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/309-ath11k-support-to-calculate-medium-busy.patch @@ -0,0 +1,187 @@ +From 6b97399c2fe5fa8b5d2ee5560bd20106d453fcab Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Wed, 16 Jun 2021 17:33:17 +0530 +Subject: [PATCH] ath11k : support to calculate medium busy + +Signed-off-by: Hari Chandrakanthan +--- + drivers/net/wireless/ath/ath11k/debugfs.c | 26 ++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/wmi.c | 25 +++++++++++++++++++++++++ + include/net/mac80211.h | 1 + + net/mac80211/mesh_hwmp.c | 11 +++++++---- + net/mac80211/mesh_pathtbl.c | 5 +++-- + 5 files changed, 62 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c +index cace542..51343c1 100644 +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -4192,6 +4192,30 @@ static const struct file_operations fops_ani_level = { + .llseek = default_llseek, + }; + ++static ssize_t ath11k_medium_busy_read(struct file *file, ++ char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath11k *ar = file->private_data; ++ u8 buf[50]; ++ size_t len = 0; ++ ++ mutex_lock(&ar->conf_mutex); ++ len += scnprintf(buf + len, sizeof(buf) - len, ++ "Medium Busy in percentage %u\n", ++ ar->hw->medium_busy); ++ mutex_unlock(&ar->conf_mutex); ++ ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static const struct file_operations fops_medium_busy = { ++ .read = ath11k_medium_busy_read, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +@@ -4302,6 +4326,8 @@ int ath11k_debugfs_register(struct ath11k *ar) + ar->debug.debugfs_pdev, ar, &fops_ani_poll_period); + debugfs_create_file("ani_listen_period", S_IRUSR | S_IWUSR, + ar->debug.debugfs_pdev, ar, &fops_ani_listen_period); ++ debugfs_create_file("medium_busy", S_IRUSR, ar->debug.debugfs_pdev, ar, ++ &fops_medium_busy); + + return 0; + } +diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c +index 595f8fe..5404a75 100644 +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6589,9 +6589,12 @@ int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb, + { + const void **tb; + const struct wmi_stats_event *ev; ++ struct ath11k *ar; + const void *data; + int i, ret; + u32 len = skb->len; ++ u64 time; ++ u64 time_busy; + + tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, len, GFP_ATOMIC); + if (IS_ERR(tb)) { +@@ -6617,6 +6620,16 @@ int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb, + stats->pdev_id = ev->pdev_id; + stats->stats_id = 0; + ++ rcu_read_lock(); ++ ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); ++ if(!ar) { ++ ath11k_warn(ab, "couldn't get ar for pdev id %d in pull fw ev\n", ++ ev->pdev_id); ++ rcu_read_unlock(); ++ kfree(tb); ++ return -EPROTO; ++ } ++ + for (i = 0; i < ev->num_pdev_stats; i++) { + const struct wmi_pdev_stats *src; + struct ath11k_fw_stats_pdev *dst; +@@ -6640,7 +6653,16 @@ int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb, + ath11k_wmi_pull_pdev_stats_tx(&src->tx, dst); + ath11k_wmi_pull_pdev_stats_rx(&src->rx, dst); + list_add_tail(&dst->list, &stats->pdevs); ++ ++ spin_lock_bh(&ar->data_lock); ++ time = div_u64(dst->cycle_count, ab->cc_freq_hz); ++ if(ar && time) { ++ time_busy = div_u64(dst->rx_clear_count, ab->cc_freq_hz); ++ ar->hw->medium_busy = div_u64((time_busy * 100), time); ++ } ++ spin_unlock_bh(&ar->data_lock); + } ++ rcu_read_unlock(); + + for (i = 0; i < ev->num_vdev_stats; i++) { + const struct wmi_vdev_stats *src; +@@ -8069,6 +8091,9 @@ static void ath11k_chan_info_event(struct ath11k_base *ab, struct sk_buff *skb) + SURVEY_INFO_TIME_BUSY; + survey->time = div_u64(ch_info_ev.cycle_count, cc_freq_hz); + survey->time_busy = div_u64(ch_info_ev.rx_clear_count, cc_freq_hz); ++ if (survey->time) ++ ar->hw->medium_busy = div_u64((survey->time_busy * 100), ++ survey->time); + } + exit: + spin_unlock_bh(&ar->data_lock); +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index 743749c..7518ba3 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -2725,6 +2725,7 @@ struct ieee80211_hw { + u8 weight_multiplier; + u32 max_mtu; + u32 dbg_mask; ++ u8 medium_busy; + }; + + static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw, +diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c +index 40bf52b..b602ad1 100644 +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -538,11 +538,12 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, + signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); + mpath_dbg(sdata, "MESH MPLMU DIRECT dst %pM next hop" + " %pM metric from %d to %d ft 0x%x signal %d" +- "dbm signal_avg %d dbm\n", ++ "dbm signal_avg %d dbm medium_busy %u\n", + mpath->dst, sta->addr, mpath->metric, + last_hop_metric, action, + sta->rx_stats.last_signal, +- signal_avg); ++ signal_avg, ++ sta->local->hw.medium_busy); + mpath_metric_change = 1; + } + mesh_path_assign_nexthop(mpath, sta); +@@ -603,11 +604,13 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, + signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); + mpath_dbg(sdata, "MESH MPLMU DIRECT dst %pM next hop" + " %pM metric from %d to %d ft 0x%x signal" +- " %d dbm signal_avg %d dbm\n", ++ " %d dbm signal_avg %d dbm" ++ " medium_busy %u\n", + mpath->dst, sta->addr, mpath->metric, + last_hop_metric, action, + sta->rx_stats.last_signal, +- signal_avg); ++ signal_avg, ++ sta->local->hw.medium_busy); + mpath_metric_change = 1; + } + +diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c +index e171cc1..37576a1 100644 +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -614,10 +614,11 @@ void mesh_plink_broken(struct sta_info *sta) + signal_avg = -ewma_signal_read(&sta->rx_stats_avg.signal); + if(sta->mesh->tx_fail_log & MESH_ENABLE_MPL_LOG) + sdata_info(sta->sdata, " MESH MPL link to %pM is broken and" +- " %d path deactivated signal %d dbm signal_avg %d dbm\n", ++ " %d path deactivated signal %d dbm signal_avg %d dbm" ++ " medium_busy : %d\n", + sta->addr, paths_deactivated, + sta->rx_stats.last_signal, +- signal_avg); ++ signal_avg, sta->local->hw.medium_busy); + mesh_continuous_tx_fail_cnt(sta, NL80211_MPATH_BROKEN_NOTIFY); + } + } +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-Drop-multicast-fragments.patch b/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-Drop-multicast-fragments.patch new file mode 100644 index 000000000..efbffef6e --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-Drop-multicast-fragments.patch @@ -0,0 +1,40 @@ +From 68906132ee41601381529e2a0131b7ed20483787 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Wed, 5 May 2021 07:28:38 +0530 +Subject: [PATCH] ath11k: Drop multicast fragments + +Fragments needs to be received only as unicast, drop +multicast fragments to avoid any undesired behavior. + +Signed-off-by: Sriram R +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c +index e8f0db7..56ea0de 100644 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -3535,6 +3535,7 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, + u8 tid; + int ret = 0; + bool more_frags; ++ bool is_mcbc; + + rx_desc = (struct hal_rx_desc *)msdu->data; + peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); +@@ -3542,6 +3543,11 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, + seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); + frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); + more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); ++ is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); ++ ++ /* Multicast/Broadcast fragments are not expected */ ++ if (is_mcbc) ++ return -EINVAL; + + if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || + !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-fix-max-peer-count-in-ipq5018-and-qcn6122.patch b/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-fix-max-peer-count-in-ipq5018-and-qcn6122.patch new file mode 100644 index 000000000..3931b9d65 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/310-ath11k-fix-max-peer-count-in-ipq5018-and-qcn6122.patch @@ -0,0 +1,151 @@ +From ca828a24a8caf9d370f89927176fca481b27bdd5 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Thu, 27 May 2021 12:43:00 +0530 +Subject: [PATCH] ath11k : fix max peer count in ipq5018 and qcn6122 + +When fw receives the peer_create wmi cmd for 129th peer, the peer pool in +fw gets exhausted and it leads to Q6 crash in ipq5018 and qcn6122. + +Currently the maximum number of peers is set as 512 and the maximum +number of vdevs is set as (16+1) for all the platforms with 1GB profile. + +But the maximum number of peers is 128 and the maximum number of +vdevs is (8+1) for ipq5018 and qcn6122 with 1GB profile. + +Signed-off-by: Hari Chandrakanthan +--- + drivers/net/wireless/ath/ath11k/core.c | 26 ++++++++++++++++++++++++-- + drivers/net/wireless/ath/ath11k/core.h | 1 - + drivers/net/wireless/ath/ath11k/hw.h | 7 ++++--- + 3 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c +index f73e48c..0f25293 100644 +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -54,6 +54,9 @@ EXPORT_SYMBOL(ath11k_skip_radio); + + struct ath11k_base *ath11k_soc; + ++static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers[]; ++static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers_ipq5018[]; ++ + static const struct ath11k_hw_params ath11k_hw_params[] = { + { + .hw_rev = ATH11K_HW_IPQ8074, +@@ -112,6 +115,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, + .reo_status_poll = false, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .hw_rev = ATH11K_HW_IPQ6018_HW10, +@@ -165,6 +169,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, + .reo_status_poll = false, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .name = "qca6390 hw2.0", +@@ -212,6 +217,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = 1, + .wakeup_mhi = true, + .reo_status_poll = false, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .name = "qcn9074 hw1.0", +@@ -271,6 +277,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .wakeup_mhi = false, + .reo_status_poll = false, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .hw_rev = ATH11K_HW_IPQ5018, +@@ -323,6 +330,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = DP_TCL_NUM_RING_MAX, + .wakeup_mhi = false, + .reo_status_poll = true, ++ .num_vdevs_peers = ath11k_vdevs_peers_ipq5018, + }, + { + .hw_rev = ATH11K_HW_QCN6122, +@@ -376,9 +384,25 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { + .max_tx_ring = DP_TCL_NUM_RING_MAX, + .wakeup_mhi = false, + .reo_status_poll = true, ++ .num_vdevs_peers = ath11k_vdevs_peers_ipq5018, + }, + }; + ++static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers_ipq5018[] = { ++ { ++ .num_vdevs = (8 + 1), ++ .num_peers = 128, ++ }, ++ { ++ .num_vdevs = (8 + 1), ++ .num_peers = 128, ++ }, ++ { ++ .num_vdevs = 8, ++ .num_peers = 128, ++ }, ++}; ++ + static const struct ath11k_num_vdevs_peers ath11k_vdevs_peers[] = { + { + .num_vdevs = (16 + 1), +@@ -799,8 +823,6 @@ static int ath11k_core_soc_create(struct ath11k_base *ab) + ath11k_info(ab, "Booting in ftm mode - %d\n", ab->fw_mode); + } + +- ab->num_vdevs_peers = &ath11k_vdevs_peers; +- + ret = ath11k_qmi_init_service(ab); + if (ret) { + ath11k_err(ab, "failed to initialize qmi :%d\n", ret); +diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h +index 206e63c..363ff8f 100644 +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -990,7 +990,6 @@ struct ath11k_base { + bool ce_latency_stats_enable; + u32 ce_remap_base_addr; + atomic_t num_max_allowed; +- struct ath11k_num_vdevs_peers *num_vdevs_peers; + int userpd_id; + struct ath11k_internal_pci ipci; + bool enable_memory_stats; +diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h +index c3cdef8..c1b2ab9 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -30,10 +30,10 @@ struct ath11k_cfr_peer_tx_param; + #define ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE 1816 + #else + /* Num VDEVS per radio */ +-#define TARGET_NUM_VDEVS (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_vdevs) +-#define TARGET_NUM_PEERS_PDEV (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_peers + TARGET_NUM_VDEVS) ++#define TARGET_NUM_VDEVS (ab->hw_params.num_vdevs_peers[ab->qmi.target_mem_mode].num_vdevs) ++#define TARGET_NUM_PEERS_PDEV (ab->hw_params.num_vdevs_peers[ab->qmi.target_mem_mode].num_peers + TARGET_NUM_VDEVS) + /* Max num of stations (per radio) */ +-#define TARGET_NUM_STATIONS (ab->num_vdevs_peers[ab->qmi.target_mem_mode].num_peers) ++#define TARGET_NUM_STATIONS (ab->hw_params.num_vdevs_peers[ab->qmi.target_mem_mode].num_peers) + #define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_DEFAULT + #define ATH11K_DP_TX_COMP_RING_SIZE 32768 + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024 +@@ -214,6 +214,7 @@ struct ath11k_hw_params { + u32 cfr_stream_buf_size; + u8 max_tx_ring; + bool reo_status_poll; ++ const struct ath11k_num_vdevs_peers *num_vdevs_peers; + }; + + struct ath11k_hw_ops { +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/310-mac80211-fix-deadlock-in-AP-VLAN-handling.patch b/feeds/wifi-ax/mac80211/patches/qca/310-mac80211-fix-deadlock-in-AP-VLAN-handling.patch new file mode 100644 index 000000000..e753a37cb --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/310-mac80211-fix-deadlock-in-AP-VLAN-handling.patch @@ -0,0 +1,76 @@ +From e2e678b776705f63ef5421e3d65883b404e55ef2 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Wed, 19 May 2021 15:11:49 +0530 +Subject: [PATCH] mac80211: fix deadlock in AP/VLAN handling + +Syzbot reports that when you have AP_VLAN interfaces that are up +and close the AP interface they belong to, we get a deadlock. No +surprise - since we dev_close() them with the wiphy mutex held, +which goes back into the netdev notifier in cfg80211 and tries to +acquire the wiphy mutex there. + +To fix this, we need to do two things: + 1) prevent changing iftype while AP_VLANs are up, we can't + easily fix this case since cfg80211 already calls us with + the wiphy mutex held, but change_interface() is relatively + rare in drivers anyway, so changing iftype isn't used much + (and userspace has to fall back to down/change/up anyway) + 2) pull the dev_close() loop over VLANs out of the wiphy mutex + section in the normal stop case + +Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") +Signed-off-by: Johannes Berg +Signed-off-by: Seevalamuthu Mariappan +--- + net/mac80211/iface.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c +index 20327cf..c6f79ce 100644 +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -491,14 +491,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do + + cancel_work_sync(&sdata->color_change_finalize_work); + +- /* APs need special treatment */ + if (sdata->vif.type == NL80211_IFTYPE_AP) { +- struct ieee80211_sub_if_data *vlan, *tmpsdata; +- +- /* down all dependent devices, that is VLANs */ +- list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans, +- u.vlan.list) +- dev_close(vlan->dev); + WARN_ON(!list_empty(&sdata->u.ap.vlans)); + } else if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { + /* remove all packets in parent bc_buf pointing to this dev */ +@@ -659,6 +652,16 @@ static int ieee80211_stop(struct net_device *dev) + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + ++ /* close all dependent VLAN interfaces before locking wiphy */ ++ if (sdata->vif.type == NL80211_IFTYPE_AP) { ++ struct ieee80211_sub_if_data *vlan, *tmpsdata; ++ ++ /* down all dependent devices, that is VLANs */ ++ list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans, ++ u.vlan.list) ++ dev_close(vlan->dev); ++ } ++ + wiphy_lock(sdata->local->hw.wiphy); + if (sdata->nssctx) { + nss_virt_if_destroy_sync(sdata->nssctx); +@@ -1746,6 +1749,9 @@ static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, + + switch (sdata->vif.type) { + case NL80211_IFTYPE_AP: ++ if (!list_empty(&sdata->u.ap.vlans)) ++ return -EBUSY; ++ break; + case NL80211_IFTYPE_STATION: + case NL80211_IFTYPE_ADHOC: + case NL80211_IFTYPE_OCB: +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/311-001-mac80211-properly-handle-A-MSDUs-that-start-with-an-RFC-1042-header.patch b/feeds/wifi-ax/mac80211/patches/qca/311-001-mac80211-properly-handle-A-MSDUs-that-start-with-an-RFC-1042-header.patch new file mode 100644 index 000000000..c688fddf9 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/311-001-mac80211-properly-handle-A-MSDUs-that-start-with-an-RFC-1042-header.patch @@ -0,0 +1,77 @@ +From a1d5ff5651ea592c67054233b14b30bf4452999c Mon Sep 17 00:00:00 2001 +From: Mathy Vanhoef +Date: Tue, 11 May 2021 20:02:44 +0200 +Subject: mac80211: properly handle A-MSDUs that start with an RFC 1042 header + +Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042 +header. This can occur in practice when the destination MAC address +equals AA:AA:03:00:00:00. More importantly, this simplifies the next +patch to mitigate A-MSDU injection attacks. + +Cc: stable@vger.kernel.org +Signed-off-by: Mathy Vanhoef +Link: https://lore.kernel.org/r/20210511200110.0b2b886492f0.I23dd5d685fe16d3b0ec8106e8f01b59f499dffed@changeid +Signed-off-by: Johannes Berg +--- + include/net/cfg80211.h | 4 ++-- + net/mac80211/rx.c | 2 +- + net/wireless/util.c | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 5224f885a99a..58c2cd417e89 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -5760,7 +5760,7 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); + */ + int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, + const u8 *addr, enum nl80211_iftype iftype, +- u8 data_offset); ++ u8 data_offset, bool is_amsdu); + + /** + * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 +@@ -5772,7 +5772,7 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, + static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, + enum nl80211_iftype iftype) + { +- return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0); ++ return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false); + } + + /** +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c +index 531232b91bc4..f14d32a5001d 100644 +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2682,7 +2682,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset) + if (ieee80211_data_to_8023_exthdr(skb, ðhdr, + rx->sdata->vif.addr, + rx->sdata->vif.type, +- data_offset)) ++ data_offset, true)) + return RX_DROP_UNUSABLE; + + ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, +diff --git a/net/wireless/util.c b/net/wireless/util.c +index 382c5262d997..39966a873e40 100644 +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -542,7 +542,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen); + + int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, + const u8 *addr, enum nl80211_iftype iftype, +- u8 data_offset) ++ u8 data_offset, bool is_amsdu) + { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + struct { +@@ -629,7 +629,7 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, + skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)); + tmp.h_proto = payload.proto; + +- if (likely((ether_addr_equal(payload.hdr, rfc1042_header) && ++ if (likely((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) && + tmp.h_proto != htons(ETH_P_AARP) && + tmp.h_proto != htons(ETH_P_IPX)) || + ether_addr_equal(payload.hdr, bridge_tunnel_header))) diff --git a/feeds/wifi-ax/mac80211/patches/qca/311-002-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch b/feeds/wifi-ax/mac80211/patches/qca/311-002-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch new file mode 100644 index 000000000..1b503f6af --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/311-002-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch @@ -0,0 +1,46 @@ +From 2b8a1fee3488c602aca8bea004a087e60806a5cf Mon Sep 17 00:00:00 2001 +From: Mathy Vanhoef +Date: Tue, 11 May 2021 20:02:45 +0200 +Subject: cfg80211: mitigate A-MSDU aggregation attacks + +Mitigate A-MSDU injection attacks (CVE-2020-24588) by detecting if the +destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP) +header, and if so dropping the complete A-MSDU frame. This mitigates +known attacks, although new (unknown) aggregation-based attacks may +remain possible. + +This defense works because in A-MSDU aggregation injection attacks, a +normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means +the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042 +header. In other words, the destination MAC address of the first A-MSDU +subframe contains the start of an RFC1042 header during an aggregation +attack. We can detect this and thereby prevent this specific attack. +For details, see Section 7.2 of "Fragment and Forge: Breaking Wi-Fi +Through Frame Aggregation and Fragmentation". + +Note that for kernel 4.9 and above this patch depends on "mac80211: +properly handle A-MSDUs that start with a rfc1042 header". Otherwise +this patch has no impact and attacks will remain possible. + +Cc: stable@vger.kernel.org +Signed-off-by: Mathy Vanhoef +Link: https://lore.kernel.org/r/20210511200110.25d93176ddaf.I9e265b597f2cd23eb44573f35b625947b386a9de@changeid +Signed-off-by: Johannes Berg +--- + net/wireless/util.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/wireless/util.c b/net/wireless/util.c +index 39966a873e40..7ec021a610ae 100644 +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -771,6 +771,9 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, + remaining = skb->len - offset; + if (subframe_len > remaining) + goto purge; ++ /* mitigate A-MSDU aggregation injection attacks */ ++ if (ether_addr_equal(eth.h_dest, rfc1042_header)) ++ goto purge; + + offset += sizeof(struct ethhdr); + last = remaining <= subframe_len + padding; diff --git a/feeds/wifi-ax/mac80211/patches/qca/311-ath11k-configure-nss-thread-priority-during-pdev_ini.patch b/feeds/wifi-ax/mac80211/patches/qca/311-ath11k-configure-nss-thread-priority-during-pdev_ini.patch new file mode 100644 index 000000000..9b110609c --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/311-ath11k-configure-nss-thread-priority-during-pdev_ini.patch @@ -0,0 +1,101 @@ +From 246e530a47d9adab9106fb6f2b92197cace17e53 Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Fri, 21 May 2021 14:16:22 +0530 +Subject: [PATCH] ath11k: configure nss radio priority during pdev_init + +pdev's priority value is read from dts. Get scheme_id +using pdev priority. Configure scheme_id during pdev_init. + +Signed-off-by: Seevalamuthu Mariappan +--- + drivers/net/wireless/ath/ath11k/nss.c | 20 +++++++++++++++++++- + drivers/net/wireless/ath/ath11k/nss.h | 3 +++ + 2 files changed, 22 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -4126,6 +4126,7 @@ static int ath11k_nss_init(struct ath11k + nss_tx_status_t status; + struct ath11k_dp *dp; + int i, ret; ++ struct device *dev = ab->dev; + + dp = &ab->dp; + +@@ -4147,6 +4148,8 @@ static int ath11k_nss_init(struct ath11k + /* fill rx parameters to initialize rx context */ + wim->wrip.tlv_size = sizeof(struct hal_rx_desc); + wim->wrip.rx_buf_len = DP_RXDMA_NSS_REFILL_RING_SIZE; ++ if (of_property_read_bool(dev->of_node, "nss-radio-priority")) ++ wim->flags |= WIFILI_MULTISOC_THREAD_MAP_ENABLE; + + /* fill hal srng message */ + wim->hssm.dev_base_addr = (u32)ab->mem_pa; +@@ -4332,11 +4335,13 @@ int ath11k_nss_pdev_init(struct ath11k_b + struct nss_wifili_msg *wlmsg = NULL; + nss_wifili_msg_callback_t msg_cb; + nss_tx_status_t status; ++ struct device *dev = ab->dev; + int radio_if_num = -1; + int refill_ring_id; + int features = 0; + int dyn_if_type; +- int ret, i; ++ int ret, i, scheme_id = 0; ++ u32 nss_radio_priority; + + dyn_if_type = ath11k_nss_get_dynamic_interface_type(ab); + +@@ -4365,6 +4370,15 @@ int ath11k_nss_pdev_init(struct ath11k_b + ath11k_dbg(ab, ATH11K_DBG_NSS, "nss pdev init - id:%d init ctxt:%p ifnum:%d\n", + ar->pdev->pdev_id, ar->nss.ctx, ar->nss.if_num); + ++ if (!of_property_read_u32(dev->of_node, "nss-radio-priority", &nss_radio_priority)) { ++ scheme_id = nss_wifili_thread_scheme_alloc(ab->nss.ctx, ar->nss.if_num, nss_radio_priority); ++ if (scheme_id == WIFILI_SCHEME_ID_INVALID) { ++ ath11k_warn(ab, "received invalid scheme_id, configuring default value\n"); ++ scheme_id = 0; ++ } ++ } ++ ath11k_dbg(ab, ATH11K_DBG_NSS, "ifnum: %d scheme_id: %d nss_radio_priority: %d\n", ar->nss.if_num, scheme_id, nss_radio_priority); ++ + wlmsg = kzalloc(sizeof(struct nss_wifili_msg), GFP_ATOMIC); + if (!wlmsg) { + ret = -ENOMEM; +@@ -4379,6 +4393,7 @@ int ath11k_nss_pdev_init(struct ath11k_b + pdevmsg->lmac_id = ar->lmac_id; + pdevmsg->target_pdev_id = ar->pdev->pdev_id; + pdevmsg->num_rx_swdesc = WIFILI_RX_DESC_POOL_WEIGHT * DP_RXDMA_BUF_RING_SIZE; ++ pdevmsg->scheme_id = scheme_id; + + /* Store rxdma ring info to the message */ + refill_ring_id = ar->dp.rx_refill_buf_ring.refill_buf_ring.ring_id; +@@ -4687,6 +4702,9 @@ int ath11k_nss_pdev_deinit(struct ath11k + /* pdev deinit msg success, dealloc, deregister and return */ + ret = 0; + ++ /* reset thread scheme*/ ++ nss_wifili_thread_scheme_dealloc(ab->nss.ctx, ar->nss.if_num); ++ + nss_dynamic_interface_dealloc_node(ar->nss.if_num, dyn_if_type); + nss_unregister_wifili_radio_if(ar->nss.if_num); + free: +--- a/drivers/net/wireless/ath/ath11k/nss.h ++++ b/drivers/net/wireless/ath/ath11k/nss.h +@@ -64,6 +64,7 @@ struct hal_rx_mon_ppdu_info; + /* Init Flags */ + #define WIFILI_NSS_CCE_DISABLED 0x1 + #define WIFILI_ADDTL_MEM_SEG_SET 0x000000002 ++#define WIFILI_MULTISOC_THREAD_MAP_ENABLE 0x10 + + /* ATH11K NSS PEER Info */ + /* Host memory allocated for peer info storage in nss */ +@@ -95,6 +96,8 @@ struct hal_rx_mon_ppdu_info; + /* Enables the MCBC exception in NSS fw, 1 = enable */ + #define ATH11K_NSS_ENABLE_MCBC_EXC 1 + ++#define WIFILI_SCHEME_ID_INVALID -1 ++ + enum ath11k_nss_opmode { + ATH11K_NSS_OPMODE_UNKNOWN, + ATH11K_NSS_OPMODE_AP, diff --git a/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-add-ampdu-id-in-802.11-radiotap-header.patch b/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-add-ampdu-id-in-802.11-radiotap-header.patch new file mode 100644 index 000000000..13c2ed1eb --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-add-ampdu-id-in-802.11-radiotap-header.patch @@ -0,0 +1,250 @@ +From 3f962ed9a4079964c48e321fd928a2719038d881 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Fri, 28 May 2021 23:53:57 +0530 +Subject: [PATCH] ath11k: add ampdu id in 802.11 radiotap header + +AMPDU aggregate reference number is generated by +driver internally which is same across each +subframe of an ampdu. + +For fetching AMPDU-ID, we need to concatenate +ppdu_id from mpdu_info and tlv_usr from tlv heder. +while parsing monitor TLV data with HAL_RX_MPDU_START +TLV tag, ampdu id is fetched from mpdu_info and +updated to corresponding mac80211 structure during +ath11k_update_radiotap. + +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 6 ++++++ + drivers/net/wireless/ath/ath11k/hal_rx.c | 13 ++++++++++++ + drivers/net/wireless/ath/ath11k/hal_rx.h | 16 ++++++++------ + drivers/net/wireless/ath/ath11k/hw.c | 36 +++++++++++++++++++++++++------- + drivers/net/wireless/ath/ath11k/hw.h | 1 + + 5 files changed, 58 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c +index 85fc903..bfdb8c2 100644 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -5912,11 +5912,17 @@ static void ath11k_update_radiotap(struct ath11k *ar, + { + struct ieee80211_supported_band *sband; + u8 *ptr = NULL; ++ u16 ampdu_id = ppduinfo->ampdu_id[ppduinfo->userid]; + + rxs->flag |= RX_FLAG_MACTIME_START; + rxs->signal = ppduinfo->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; + rxs->nss = ppduinfo->nss + 1; + ++ if (ampdu_id) { ++ rxs->flag |= RX_FLAG_AMPDU_DETAILS; ++ rxs->ampdu_reference = ampdu_id; ++ } ++ + if (ppduinfo->he_mu_flags) { + rxs->flag |= RX_FLAG_RADIOTAP_HE_MU; + rxs->encoding = RX_ENC_HE; +diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c +index c376fe8..38146ba 100644 +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -903,6 +903,13 @@ ath11k_hal_rx_populate_mu_user_info(void *rx_tlv, struct hal_rx_mon_ppdu_info *p + } + + static ++u16 ath11k_hal_rxdesc_get_hal_mpdu_ppdu_id(struct ath11k_base *ab, ++ struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_hal_ppdu_id(mpdu_info); ++} ++ ++static + u16 ath11k_hal_rxdesc_get_hal_mpdu_peerid(struct ath11k_base *ab, + struct hal_rx_mpdu_info *mpdu_info) + { +@@ -1564,6 +1571,12 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, + ppdu_info->peer_id = peer_id; + + ppdu_info->mpdu_len += ath11k_hal_rxdesc_get_hal_mpdu_len(ab,mpdu_info); ++ ++ if (userid < HAL_MAX_UL_MU_USERS) { ++ ppdu_info->userid = userid; ++ ppdu_info->ampdu_id[userid] = ++ ath11k_hal_rxdesc_get_hal_mpdu_ppdu_id(ab, mpdu_info); ++ } + break; + } + case HAL_RXPCU_PPDU_END_INFO: { +diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.h b/drivers/net/wireless/ath/ath11k/hal_rx.h +index bdc0735..282a27b 100644 +--- a/drivers/net/wireless/ath/ath11k/hal_rx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h +@@ -222,6 +222,8 @@ struct hal_rx_mon_ppdu_info { + u32 num_users; + u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP]; + struct hal_rx_user_status userstats[HAL_MAX_UL_MU_USERS]; ++ u8 userid; ++ u16 ampdu_id[HAL_MAX_UL_MU_USERS]; + }; + + #define HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VALID BIT(30) +@@ -443,21 +445,23 @@ struct hal_rx_phyrx_rssi_legacy_info { + __le32 info0; + } __packed; + +-#define HAL_RX_MPDU_INFO_INFO0_PEERID GENMASK(31, 16) +-#define HAL_RX_MPDU_INFO_INFO1_MPDU_LEN GENMASK(13, 0) ++#define HAL_RX_MPDU_INFO_INFO0_PPDU_ID GENMASK(31, 16) ++#define HAL_RX_MPDU_INFO_INFO1_PEERID GENMASK(31, 16) ++#define HAL_RX_MPDU_INFO_INFO2_MPDU_LEN GENMASK(13, 0) + struct hal_rx_mpdu_info_ipq8074 { +- __le32 rsvd0; + __le32 info0; +- __le32 rsvd1[11]; + __le32 info1; ++ __le32 rsvd1[11]; ++ __le32 info2; + __le32 rsvd2[9]; + } __packed; + + struct hal_rx_mpdu_info_ipq9074 { +- __le32 rsvd0[10]; ++ __le32 rsvd0[9]; + __le32 info0; +- __le32 rsvd1[2]; + __le32 info1; ++ __le32 rsvd1[2]; ++ __le32 info2; + __le32 rsvd2[9]; + } __packed; + +diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c +index af40d7f..548c09f 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -368,19 +368,26 @@ static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) + } + + static +-u16 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) ++u16 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id(struct hal_rx_mpdu_info *mpdu_info) + { +- return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID, ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PPDU_ID, + __le32_to_cpu(mpdu_info->u.ipq8074.info0)); + } + + static +-u32 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++u16 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) + { +- return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_PEERID, + __le32_to_cpu(mpdu_info->u.ipq8074.info1)); + } + ++static ++u32 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO2_MPDU_LEN, ++ __le32_to_cpu(mpdu_info->u.ipq8074.info2)); ++} ++ + #ifdef CPTCFG_ATH11K_MEM_PROFILE_512M + static void ath11k_hw_ipq8074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) + { +@@ -703,19 +710,26 @@ static void ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring(struct ath11k_base * + } + + static +-u16 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) ++u16 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id(struct hal_rx_mpdu_info *mpdu_info) + { +- return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID, ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PPDU_ID, + __le32_to_cpu(mpdu_info->u.qcn9074.info0)); + } + + static +-u32 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++u16 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_peerid(struct hal_rx_mpdu_info *mpdu_info) + { +- return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_PEERID, + __le32_to_cpu(mpdu_info->u.qcn9074.info1)); + } + ++static ++u32 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len(struct hal_rx_mpdu_info *mpdu_info) ++{ ++ return FIELD_GET(HAL_RX_MPDU_INFO_INFO2_MPDU_LEN, ++ __le32_to_cpu(mpdu_info->u.qcn9074.info2)); ++} ++ + #ifdef CPTCFG_ATH11K_MEM_PROFILE_512M + static void ath11k_hw_qcn9074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) + { +@@ -966,6 +980,7 @@ const struct ath11k_hw_ops ipq8074_ops = { + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + .fill_cfr_hdr_info = ath11k_hw_ipq8074_fill_cfr_hdr_info, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id, + }; + + const struct ath11k_hw_ops ipq6018_ops = { +@@ -1015,6 +1030,7 @@ const struct ath11k_hw_ops ipq6018_ops = { + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id, + }; + + const struct ath11k_hw_ops qca6390_ops = { +@@ -1061,6 +1077,7 @@ const struct ath11k_hw_ops qca6390_ops = { + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id, + //TODO + /* .rx_desc_get_da_mcbc, + .rx_desc_mac_addr2_valid, +@@ -1115,6 +1132,7 @@ const struct ath11k_hw_ops qcn9074_ops = { + .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, + .fill_cfr_hdr_info = ath11k_hw_qcn9074_fill_cfr_hdr_info, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id, + }; + + /* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */ +@@ -1165,6 +1183,7 @@ const struct ath11k_hw_ops ipq5018_ops = { + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id, + }; + + const struct ath11k_hw_ops qcn6122_ops = { +@@ -1215,6 +1234,7 @@ const struct ath11k_hw_ops qcn6122_ops = { + .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, + .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, + .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, ++ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id, + }; + + #define ATH11K_TX_RING_MASK_0 0x1 +diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h +index c1b2ab9..ae5241b 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -273,6 +273,7 @@ struct ath11k_hw_ops { + void (*fill_cfr_hdr_info)(struct ath11k *ar, + struct ath11k_csi_cfr_header *header, + struct ath11k_cfr_peer_tx_param *params); ++ u16 (*rx_desc_get_hal_ppdu_id) (struct hal_rx_mpdu_info *mpdu_info); + }; + + extern const struct ath11k_hw_ops ipq8074_ops; +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-fix-FCS_ERR-flag-in-radio-tap-header.patch b/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-fix-FCS_ERR-flag-in-radio-tap-header.patch new file mode 100644 index 000000000..e3ad2fc0a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/312-ath11k-fix-FCS_ERR-flag-in-radio-tap-header.patch @@ -0,0 +1,74 @@ +From efaaa893140d8659f6b3c81e67bed47566963c55 Mon Sep 17 00:00:00 2001 +From: P Praneesh +Date: Thu, 27 May 2021 22:57:01 +0530 +Subject: [PATCH] ath11k: fix FCS_ERR flag in radio tap header + +In radio tap header, BAD FCS flag is not updated +properly because driver failed to update FCS_ERR +flag in monitor mode. + +In rx_desc, FCS_ERR information is available in +rx_attention structure and presence of this field +indicates corresponding frame failed FCS check. + +Signed-off-by: P Praneesh +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c +index b8fa3d2..af7e920 100644 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -5761,7 +5761,7 @@ static struct sk_buff * + ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar, + u32 mac_id, struct sk_buff *head_msdu, + struct sk_buff *last_msdu, +- struct ieee80211_rx_status *rxs) ++ struct ieee80211_rx_status *rxs, bool *fcs_err) + { + struct ath11k_base *ab = ar->ab; + struct sk_buff *msdu, *mpdu_buf, *prev_buf; +@@ -5771,6 +5771,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar, + struct ieee80211_hdr_3addr *wh; + struct rx_attention *rx_attention; + static u32 pkt_type = 0; ++ u32 err_bitmap; + + pkt_type++; + mpdu_buf = NULL; +@@ -5780,6 +5781,10 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar, + + rx_desc = (struct hal_rx_desc *)head_msdu->data; + rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); ++ err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention); ++ ++ if (err_bitmap & DP_RX_MPDU_ERR_FCS) ++ *fcs_err = true; + + if (ath11k_dp_rxdesc_get_mpdulen_err(rx_attention)) + return NULL; +@@ -5952,14 +5957,19 @@ static int ath11k_dp_rx_mon_deliver(struct ath11k *ar, u32 mac_id, + struct ath11k_pdev_dp *dp = &ar->dp; + struct sk_buff *mon_skb, *skb_next, *header; + struct ieee80211_rx_status *rxs = &dp->rx_status; ++ bool fcs_err = false; + + mon_skb = ath11k_dp_rx_mon_merg_msdus(ar, mac_id, head_msdu, +- tail_msdu, rxs); ++ tail_msdu, rxs, &fcs_err); + if (!mon_skb) + goto mon_deliver_fail; + + header = mon_skb; + rxs->flag = 0; ++ ++ if (fcs_err) ++ rxs->flag = RX_FLAG_FAILED_FCS_CRC; ++ + do { + skb_next = mon_skb->next; + if (!skb_next) +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-drop-A-MSDUs-on-old-ciphers.patch b/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-drop-A-MSDUs-on-old-ciphers.patch new file mode 100644 index 000000000..79bc75e1e --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-drop-A-MSDUs-on-old-ciphers.patch @@ -0,0 +1,60 @@ +From 270032a2a9c4535799736142e1e7c413ca7b836e Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 11 May 2021 20:02:46 +0200 +Subject: mac80211: drop A-MSDUs on old ciphers + +With old ciphers (WEP and TKIP) we shouldn't be using A-MSDUs +since A-MSDUs are only supported if we know that they are, and +the only practical way for that is HT support which doesn't +support old ciphers. + +However, we would normally accept them anyway. Since we check +the MMIC before deaggregating A-MSDUs, and the A-MSDU bit in +the QoS header is not protected in TKIP (or WEP), this enables +attacks similar to CVE-2020-24588. To prevent that, drop A-MSDUs +completely with old ciphers. + +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20210511200110.076543300172.I548e6e71f1ee9cad4b9a37bf212ae7db723587aa@changeid +Signed-off-by: Johannes Berg +--- + net/mac80211/rx.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c +index f14d32a5001d..8a72d48ad6e0 100644 +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -6,7 +6,7 @@ + * Copyright 2007-2010 Johannes Berg + * Copyright 2013-2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018-2020 Intel Corporation ++ * Copyright (C) 2018-2021 Intel Corporation + */ + + #include +@@ -2739,6 +2739,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) + if (is_multicast_ether_addr(hdr->addr1)) + return RX_DROP_UNUSABLE; + ++ if (rx->key) { ++ /* ++ * We should not receive A-MSDUs on pre-HT connections, ++ * and HT connections cannot use old ciphers. Thus drop ++ * them, as in those cases we couldn't even have SPP ++ * A-MSDUs or such. ++ */ ++ switch (rx->key->conf.cipher) { ++ case WLAN_CIPHER_SUITE_WEP40: ++ case WLAN_CIPHER_SUITE_WEP104: ++ case WLAN_CIPHER_SUITE_TKIP: ++ return RX_DROP_UNUSABLE; ++ default: ++ break; ++ } ++ } ++ + return __ieee80211_rx_h_amsdu(rx, 0); + } + diff --git a/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-fix-invalid-nss-config.patch b/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-fix-invalid-nss-config.patch new file mode 100644 index 000000000..f5082f3dd --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/312-mac80211-fix-invalid-nss-config.patch @@ -0,0 +1,32 @@ +From b46dcb02b9d78fffa48c1a032a307695d263f6b4 Mon Sep 17 00:00:00 2001 +From: Thiraviyam Mariyappan +Date: Tue, 25 May 2021 23:37:08 +0530 +Subject: [PATCH] mac80211: fix invalid nss config + +In HE-enabled STAs, HE-MCS Rx map filled with value 3 for all eight spacial +streams if tx/rxantenna configured as invalid value. Because of this, peer_nss +computed as 0 caused q6 crash during WMI_PEER_ASSOC_CMDID. +With this patch, HE STA supports at least single spactial stream HE-MCSs 0 to 7 +(transmit and receive) in all supported channel widths and fixing the q6 crash. + +Signed-off-by: Thiraviyam Mariyappan +--- + net/mac80211/he.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/net/mac80211/he.c ++++ b/net/mac80211/he.c +@@ -194,6 +194,13 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct + &he_cap_ie[sizeof(he_cap->he_cap_elem) + mcs_nss_size], + he_ppe_size); + ++ if (he_cap->he_mcs_nss_supp.rx_mcs_80 == cpu_to_le16(0xFFFF)) { ++ he_cap->has_he = false; ++ sdata_info(sdata, "Ignoring HE IE from %pM due to invalid rx_mcs_80\n", ++ sta->addr); ++ return; ++ } ++ + he_cap->has_he = true; + + sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta); diff --git a/feeds/wifi-ax/mac80211/patches/qca/313-ath11k-fix-q6-crash-on-vdev-delete.patch b/feeds/wifi-ax/mac80211/patches/qca/313-ath11k-fix-q6-crash-on-vdev-delete.patch new file mode 100644 index 000000000..c8c1d495a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/313-ath11k-fix-q6-crash-on-vdev-delete.patch @@ -0,0 +1,153 @@ +From 1cf6cb1ea65953048c1920ba22d68ae16ba3722d Mon Sep 17 00:00:00 2001 +From: Sowmiya Sree Elavalagan +Date: Mon, 31 May 2021 18:54:36 +0530 +Subject: [PATCH] ath11k: fix q6 crash on vdev delete + +Add interface call did not wait for vdev delete to complete on interface create +failures, and was trying to create another vdev with deleted vap's vdev id. Hence +host tried sending command to fw for vdev id which was removed on previous +vdev delete causing q6 crash. ath11k_wmi_vdev_set_param_cmd was invoked for +vdev which got deleted, before calling ath11k_wmi_vdev_create for that vdev. + +Signed-off-by: Sowmiya Sree Elavalagan +--- + drivers/net/wireless/ath/ath11k/mac.c | 81 +++++++++++++++++++++-------------- + 1 file changed, 49 insertions(+), 32 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index ed16227..931e035 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6491,12 +6491,6 @@ static int ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, + if (ab->nss.enabled && vif->type == NL80211_IFTYPE_AP_VLAN) + return 0; + +- ret = ath11k_nss_vdev_create(arvif); +- if(ret) { +- ath11k_warn(ab, "failed to create nss vdev %d\n", ret); +- return ret; +- } +- + param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; + if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET || + (vif->type != NL80211_IFTYPE_STATION && +@@ -6537,6 +6531,42 @@ static int ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, + return ret; + } + ++static int ath11k_mac_vdev_delete(struct ath11k *ar, struct ath11k_vif *arvif) ++{ ++ unsigned long time_left; ++ struct ieee80211_vif *vif = arvif->vif; ++ int ret = 0; ++ ++ lockdep_assert_held(&ar->conf_mutex); ++ ++ reinit_completion(&ar->vdev_delete_done); ++ ++ ath11k_nss_vdev_delete(arvif); ++ ++ ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); ++ if (ret) { ++ ath11k_warn(ar->ab, "failed to delete WMI vdev %d: %d\n", ++ arvif->vdev_id, ret); ++ return ret; ++ } ++ ++ time_left = wait_for_completion_timeout(&ar->vdev_delete_done, ++ ATH11K_VDEV_DELETE_TIMEOUT_HZ); ++ if (time_left == 0) { ++ ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); ++ return -ETIMEDOUT; ++ } ++ ++ ar->ab->free_vdev_map |= 1LL << (arvif->vdev_id); ++ ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); ++ ar->num_created_vdevs--; ++ ++ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", ++ vif->addr, arvif->vdev_id); ++ ++ return ret; ++} ++ + static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) + { +@@ -6684,8 +6714,17 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, + list_add(&arvif->list, &ar->arvifs); + spin_unlock_bh(&ar->data_lock); + +- if (ath11k_mac_op_update_vif_offload(hw, vif)) ++ ret = ath11k_nss_vdev_create(arvif); ++ if(ret) { ++ ath11k_warn(ab, "failed to create nss vdev %d\n", ret); ++ goto err_vdev_del; ++ } ++ ++ ret = ath11k_mac_op_update_vif_offload(hw, vif); ++ if (ret) { ++ ath11k_warn(ab, "failed to update vif offload\n"); + goto err_vdev_del; ++ } + + if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) + param_value = ATH11K_HW_TXRX_ETHERNET; +@@ -6836,11 +6875,7 @@ err_peer_del: + } + + err_vdev_del: +- ath11k_nss_vdev_delete(arvif); +- ath11k_wmi_vdev_delete(ar, arvif->vdev_id); +- ar->num_created_vdevs--; +- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); +- ab->free_vdev_map |= 1LL << arvif->vdev_id; ++ ath11k_mac_vdev_delete(ar, arvif); + spin_lock_bh(&ar->data_lock); + list_del(&arvif->list); + spin_unlock_bh(&ar->data_lock); +@@ -6870,7 +6905,6 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw, + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_vif *ap_vlan_arvif, *tmp; + struct ath11k_base *ab = ar->ab; +- unsigned long time_left; + int ret; + int i; + +@@ -6912,31 +6946,14 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw, + } + } + +- reinit_completion(&ar->vdev_delete_done); +- +- ath11k_nss_vdev_delete(arvif); + +- ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); ++ ret = ath11k_mac_vdev_delete(ar, arvif); + if (ret) { +- ath11k_warn(ab, "failed to delete WMI vdev %d: %d\n", ++ ath11k_warn(ab, "failed to delete vdev %d: %d\n", + arvif->vdev_id, ret); + goto err_vdev_del; + } + +- time_left = wait_for_completion_timeout(&ar->vdev_delete_done, +- ATH11K_VDEV_DELETE_TIMEOUT_HZ); +- if (time_left == 0) { +- ath11k_warn(ab, "Timeout in receiving vdev delete response\n"); +- goto err_vdev_del; +- } +- +- ab->free_vdev_map |= 1LL << (arvif->vdev_id); +- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); +- ar->num_created_vdevs--; +- +- ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", +- vif->addr, arvif->vdev_id); +- + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { + ar->monitor_vdev_id = -1; + ar->monitor_vdev_created = false; +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/313-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch b/feeds/wifi-ax/mac80211/patches/qca/313-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch new file mode 100644 index 000000000..44d97e4f9 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/313-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch @@ -0,0 +1,98 @@ +From a8c4d76a8dd4fb9666fc8919a703d85fb8f44ed8 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 11 May 2021 20:02:50 +0200 +Subject: mac80211: do not accept/forward invalid EAPOL frames + +EAPOL frames are used for authentication and key management between the +AP and each individual STA associated in the BSS. Those frames are not +supposed to be sent by one associated STA to another associated STA +(either unicast for broadcast/multicast). + +Similarly, in 802.11 they're supposed to be sent to the authenticator +(AP) address. + +Since it is possible for unexpected EAPOL frames to result in misbehavior +in supplicant implementations, it is better for the AP to not allow such +cases to be forwarded to other clients either directly, or indirectly if +the AP interface is part of a bridge. + +Accept EAPOL (control port) frames only if they're transmitted to the +own address, or, due to interoperability concerns, to the PAE group +address. + +Disable forwarding of EAPOL (or well, the configured control port +protocol) frames back to wireless medium in all cases. Previously, these +frames were accepted from fully authenticated and authorized stations +and also from unauthenticated stations for one of the cases. + +Additionally, to avoid forwarding by the bridge, rewrite the PAE group +address case to the local MAC address. + +Cc: stable@vger.kernel.org +Co-developed-by: Jouni Malinen +Signed-off-by: Jouni Malinen +Link: https://lore.kernel.org/r/20210511200110.cb327ed0cabe.Ib7dcffa2a31f0913d660de65ba3c8aca75b1d10f@changeid +Signed-off-by: Johannes Berg +--- + net/mac80211/rx.c | 33 +++++++++++++++++++++++++++------ + 1 file changed, 27 insertions(+), 6 deletions(-) + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2521,13 +2521,13 @@ static bool ieee80211_frame_allowed(stru + struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; + + /* +- * Allow EAPOL frames to us/the PAE group address regardless +- * of whether the frame was encrypted or not. ++ * Allow EAPOL frames to us/the PAE group address regardless of ++ * whether the frame was encrypted or not, and always disallow ++ * all other destination addresses for them. + */ +- if (ehdr->h_proto == rx->sdata->control_port_protocol && +- (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || +- ether_addr_equal(ehdr->h_dest, pae_group_addr))) +- return true; ++ if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol)) ++ return ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || ++ ether_addr_equal(ehdr->h_dest, pae_group_addr); + + if (ieee80211_802_1x_port_control(rx) || + ieee80211_drop_unencrypted(rx, fc)) +@@ -2600,8 +2600,28 @@ static void ieee80211_deliver_skb_to_loc + cfg80211_rx_control_port(dev, skb, noencrypt); + dev_kfree_skb(skb); + } else { ++ struct ethhdr *ehdr = (void *)skb_mac_header(skb); ++ + memset(skb->cb, 0, sizeof(skb->cb)); + ++ /* ++ * 802.1X over 802.11 requires that the authenticator address ++ * be used for EAPOL frames. However, 802.1X allows the use of ++ * the PAE group address instead. If the interface is part of ++ * a bridge and we pass the frame with the PAE group address, ++ * then the bridge will forward it to the network (even if the ++ * client was not associated yet), which isn't supposed to ++ * happen. ++ * To avoid that, rewrite the destination address to our own ++ * address, so that the authenticator (e.g. hostapd) will see ++ * the frame, but bridge won't forward it anywhere else. Note ++ * that due to earlier filtering, the only other address can ++ * be the PAE group address. ++ */ ++ if (unlikely(skb->protocol == sdata->control_port_protocol && ++ !ether_addr_equal(ehdr->h_dest, sdata->vif.addr))) ++ ether_addr_copy(ehdr->h_dest, sdata->vif.addr); ++ + netif_rx_nss(rx, skb); + } + } +@@ -2641,6 +2661,7 @@ ieee80211_deliver_skb(struct ieee80211_r + if ((sdata->vif.type == NL80211_IFTYPE_AP || + sdata->vif.type == NL80211_IFTYPE_AP_VLAN) && + !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && ++ ehdr->h_proto != rx->sdata->control_port_protocol && + (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) { + if (is_multicast_ether_addr(ehdr->h_dest) && + ieee80211_vif_get_num_mcast_if(sdata) != 0) { diff --git a/feeds/wifi-ax/mac80211/patches/qca/314-001-ath11k-add-peer-rhash-table-support.patch b/feeds/wifi-ax/mac80211/patches/qca/314-001-ath11k-add-peer-rhash-table-support.patch new file mode 100644 index 000000000..40ee9b802 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/314-001-ath11k-add-peer-rhash-table-support.patch @@ -0,0 +1,826 @@ +From 985edaabe31628237a6771d091d3cda0d8e16065 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Periyasamy +Date: Thu, 3 Jun 2021 15:07:12 +0530 +Subject: [PATCH] ath11k: add peer rhash table support + +peer lookup operation consume more CPU cycle when more clients +are connected. It leads to degrade in KPI measurement in UL data +traffic with 128 clients. In 64bit system not able to meet the +expected measurement for the TCP UL test case. To fix this +issue by reducing the peer lookup operation by introducing +rhash based lookup instead of linear based lookup. + +TCP UL 128 Clients test case Observation: +Before fix - ~480 Mbps +After fix - ~860 Mbps + +Signed-off-by: Karthikeyan Periyasamy +--- + drivers/net/wireless/ath/ath11k/core.h | 9 ++ + drivers/net/wireless/ath/ath11k/mac.c | 15 +++ + drivers/net/wireless/ath/ath11k/peer.c | 164 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/peer.h | 8 ++ + 4 files changed, 196 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -678,6 +678,13 @@ struct ath11k { + struct completion vdev_setup_done; + struct completion vdev_delete_done; + ++ /* ++ * The rhashtable containing struct ath11k_peer keyed by mac addr ++ * protected under ab->base_lock spin lock ++ */ ++ struct rhashtable *rhead_peer_addr; ++ struct rhashtable_params rhash_peer_addr_param; ++ + int num_peers; + int max_num_peers; + u32 num_started_vdevs; +@@ -921,6 +928,11 @@ struct ath11k_base { + struct ath11k_pdev __rcu *pdevs_active[MAX_RADIOS]; + struct ath11k_hal_reg_capabilities_ext hal_reg_cap[MAX_RADIOS]; + unsigned long long free_vdev_map; ++ ++ /* The rhashtable containing struct ath11k_peer keyed by id */ ++ struct rhashtable *rhead_peer_id; ++ struct rhashtable_params rhash_peer_id_param; ++ + struct list_head peers; + wait_queue_head_t peer_mapping_wq; + u8 mac_addr[ETH_ALEN]; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -876,6 +876,7 @@ void ath11k_mac_peer_cleanup_all(struct + spin_lock_bh(&ab->base_lock); + list_for_each_entry_safe(peer, tmp, &ab->peers, list) { + ath11k_peer_rx_tid_cleanup(ar, peer); ++ ath11k_peer_rhash_delete(ar, peer); + list_del(&peer->list); + kfree(peer); + } +@@ -4749,7 +4750,7 @@ static void ath11k_sta_use_4addr_wk(stru + vif = ap_vlan_arvif->vif; + + spin_lock_bh(&ab->base_lock); +- wds_peer = ath11k_peer_find_by_addr(ab, sta->addr); ++ wds_peer = ath11k_peer_find_by_addr(ar, sta->addr); + if (!wds_peer) { + spin_unlock_bh(&ab->base_lock); + ath11k_warn(ab, "mac sta use 4addr failed to find peer %pM\n", +@@ -4998,15 +4999,16 @@ exit: + return ret; + } + +-static int ath11k_mac_cfg_dyn_vlan(struct ath11k_base *ab, ++static int ath11k_mac_cfg_dyn_vlan(struct ath11k *ar, + struct ath11k_vif *ap_vlan_arvif, + struct ieee80211_sta *sta) + { ++ struct ath11k_base *ab = ar->ab; + struct ath11k_peer *peer; + int peer_id, ret; + + spin_lock_bh(&ab->base_lock); +- peer = ath11k_peer_find_by_addr(ab, sta->addr); ++ peer = ath11k_peer_find_by_addr(ar, sta->addr); + if (!peer) { + ath11k_warn(ab, "failed to find peer for %pM\n", sta->addr); + spin_unlock_bh(&ab->base_lock); +@@ -5076,6 +5078,7 @@ static int ath11k_mac_op_sta_state(struc + if (peer && peer->sta == sta) { + ath11k_warn(ar->ab, "Found peer entry %pM n vdev %i after it was supposedly removed\n", + vif->addr, arvif->vdev_id); ++ ath11k_peer_rhash_delete(ar, peer); + peer->sta = NULL; + list_del(&peer->list); + kfree(peer); +@@ -5115,7 +5118,7 @@ static int ath11k_mac_op_sta_state(struc + } else if (ar->ab->nss.enabled && + vif->type == NL80211_IFTYPE_AP_VLAN && + !arsta->use_4addr_set) { +- ret = ath11k_mac_cfg_dyn_vlan(ar->ab, arvif, sta); ++ ret = ath11k_mac_cfg_dyn_vlan(ar, arvif, sta); + if (ret) + ath11k_warn(ar->ab, "failed to cfg dyn vlan for peer %pM: %d\n", + sta->addr, ret); +@@ -7769,7 +7772,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc + + if (ab->hw_params.vdev_start_delay && + arvif->vdev_type == WMI_VDEV_TYPE_MONITOR && +- ath11k_peer_find_by_addr(ab, ar->mac_addr)) ++ ath11k_peer_find_by_addr(ar, ar->mac_addr)) + ath11k_peer_delete(ar, arvif->vdev_id, ar->mac_addr); + + if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { +@@ -9205,6 +9208,8 @@ void ath11k_mac_unregister(struct ath11k + + __ath11k_mac_unregister(ar); + } ++ ++ ath11k_peer_rhash_tbl_destroy(ab); + } + + static int __ath11k_mac_register(struct ath11k *ar) +@@ -9433,6 +9438,10 @@ int ath11k_mac_register(struct ath11k_ba + + ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1; + ++ ret = ath11k_peer_rhash_tbl_init(ab); ++ if (ret) ++ return ret; ++ + for (i = 0; i < ab->num_radios; i++) { + pdev = &ab->pdevs[i]; + ar = pdev->ar; +@@ -9463,6 +9472,8 @@ err_cleanup: + __ath11k_mac_unregister(ar); + } + ++ ath11k_peer_rhash_tbl_destroy(ab); ++ + return ret; + } + +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -27,40 +27,20 @@ struct ath11k_peer *ath11k_peer_find(str + return NULL; + } + +-static struct ath11k_peer *ath11k_peer_find_by_pdev_idx(struct ath11k_base *ab, +- u8 pdev_idx, const u8 *addr) +-{ +- struct ath11k_peer *peer; +- +- lockdep_assert_held(&ab->base_lock); +- +- list_for_each_entry(peer, &ab->peers, list) { +- if (peer->pdev_idx != pdev_idx) +- continue; +- if (!ether_addr_equal(peer->addr, addr)) +- continue; +- +- return peer; +- } +- +- return NULL; +-} +- +-struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, ++struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k *ar, + const u8 *addr) + { + struct ath11k_peer *peer; + +- lockdep_assert_held(&ab->base_lock); ++ lockdep_assert_held(&ar->ab->base_lock); + +- list_for_each_entry(peer, &ab->peers, list) { +- if (!ether_addr_equal(peer->addr, addr)) +- continue; ++ if (!ar->rhead_peer_addr) ++ return NULL; + +- return peer; +- } ++ peer = rhashtable_lookup_fast(ar->rhead_peer_addr, addr, ++ ar->rhash_peer_addr_param); + +- return NULL; ++ return peer; + } + + struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, +@@ -70,11 +50,13 @@ struct ath11k_peer *ath11k_peer_find_by_ + + lockdep_assert_held(&ab->base_lock); + +- list_for_each_entry(peer, &ab->peers, list) +- if (peer_id == peer->peer_id) +- return peer; ++ if (!ab->rhead_peer_id) ++ return NULL; + +- return NULL; ++ peer = rhashtable_lookup_fast(ab->rhead_peer_id, &peer_id, ++ ab->rhash_peer_id_param); ++ ++ return peer; + } + + struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab, +@@ -407,6 +389,7 @@ void ath11k_peer_ast_cleanup(struct ath1 + void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id) + { + struct ath11k_peer *peer; ++ struct ath11k *ar; + + spin_lock_bh(&ab->base_lock); + +@@ -417,9 +400,20 @@ void ath11k_peer_unmap_event(struct ath1 + goto exit; + } + ++ rcu_read_lock(); ++ ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); ++ if (!ar) { ++ ath11k_warn(ab, "peer-unmap-event: unknown peer vdev id %d\n", ++ peer->vdev_id); ++ goto cleanup; ++ } ++ + ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "htt peer unmap vdev %d peer %pM id %d\n", + peer->vdev_id, peer->addr, peer_id); + ++ ath11k_peer_rhash_delete(ar, peer); ++cleanup: ++ rcu_read_unlock(); + list_del(&peer->list); + kfree(peer); + wake_up(&ab->peer_mapping_wq); +@@ -461,6 +455,7 @@ void ath11k_peer_unmap_v2_event(struct a + if (ar->bss_peer && ether_addr_equal(ar->bss_peer->addr, peer->addr)) + ar->bss_peer = NULL; + #endif ++ ath11k_peer_rhash_delete(ar, peer); + free_peer: + rcu_read_unlock(); + list_del(&peer->list); +@@ -587,6 +582,70 @@ static int ath11k_wait_for_peer_common(s + return 0; + } + ++static inline int ath11k_peer_rhash_insert(struct ath11k_base *ab, ++ struct rhashtable *rtbl, ++ struct rhash_head *rhead, ++ struct rhashtable_params *params, ++ void *key) ++{ ++ struct ath11k_peer *tmp; ++ ++ lockdep_assert_held(&ab->base_lock); ++ ++ tmp = rhashtable_lookup_get_insert_fast(rtbl, rhead, *params); ++ ++ if (!tmp) ++ return 0; ++ else if (IS_ERR(tmp)) ++ return PTR_ERR(tmp); ++ else ++ return -EEXIST; ++} ++ ++static inline int ath11k_peer_rhash_remove(struct ath11k_base *ab, ++ struct rhashtable *rtbl, ++ struct rhash_head *rhead, ++ struct rhashtable_params *params) ++{ ++ lockdep_assert_held(&ab->base_lock); ++ ++ return rhashtable_remove_fast(rtbl, rhead, *params); ++} ++ ++static int ath11k_peer_rhash_add(struct ath11k *ar, struct ath11k_peer *peer) ++{ ++ struct ath11k_base *ab = ar->ab; ++ int ret; ++ ++ lockdep_assert_held(&ab->base_lock); ++ ++ if (!ab->rhead_peer_id || !ar->rhead_peer_addr) ++ return -EPERM; ++ ++ ret = ath11k_peer_rhash_insert(ab, ab->rhead_peer_id, &peer->rhash_id, ++ &ab->rhash_peer_id_param, &peer->peer_id); ++ if (ret) { ++ ath11k_warn(ab, "failed to add peer %pM with id %d in rhash_id ret %d\n", ++ peer->addr, peer->peer_id, ret); ++ return ret; ++ } ++ ++ ret = ath11k_peer_rhash_insert(ab, ar->rhead_peer_addr, &peer->rhash_addr, ++ &ar->rhash_peer_addr_param, &peer->addr); ++ if (ret) { ++ ath11k_warn(ab, "failed to add peer %pM with id %d in rhash_addr ret %d\n", ++ peer->addr, peer->peer_id, ret); ++ goto err_clean; ++ } ++ ++ return 0; ++ ++err_clean: ++ ath11k_peer_rhash_remove(ab, ab->rhead_peer_id, &peer->rhash_id, ++ &ab->rhash_peer_id_param); ++ return ret; ++} ++ + void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id) + { + struct ath11k_peer *peer, *tmp_peer; +@@ -612,6 +671,7 @@ void ath11k_peer_cleanup(struct ath11k * + &peer->ast_entry_list, ase_list) + ath11k_peer_del_ast(ar, ast_entry); + ++ ath11k_peer_rhash_delete(ar, peer); + list_del(&peer->list); + kfree(peer); + ar->num_peers--; +@@ -688,7 +748,7 @@ int ath11k_peer_create(struct ath11k *ar + struct ath11k_peer *peer; + struct ieee80211_vif *vif = arvif->vif; + struct ath11k_sta *arsta; +- int ret; ++ int ret, err_ret; + + lockdep_assert_held(&ar->conf_mutex); + +@@ -699,7 +759,7 @@ int ath11k_peer_create(struct ath11k *ar + } + + spin_lock_bh(&ar->ab->base_lock); +- peer = ath11k_peer_find_by_pdev_idx(ar->ab, ar->pdev_idx, param->peer_addr); ++ peer = ath11k_peer_find_by_addr(ar, param->peer_addr); + if (peer) { + spin_unlock_bh(&ar->ab->base_lock); + return -EINVAL; +@@ -727,22 +787,14 @@ int ath11k_peer_create(struct ath11k *ar + ath11k_warn(ar->ab, "failed to find peer %pM on vdev %i after creation\n", + param->peer_addr, param->vdev_id); + +- reinit_completion(&ar->peer_delete_done); +- +- ret = ath11k_wmi_send_peer_delete_cmd(ar, param->peer_addr, +- param->vdev_id); +- if (ret) { +- ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", +- param->vdev_id, param->peer_addr); +- return ret; +- } +- +- ret = ath11k_wait_for_peer_delete_done(ar, param->vdev_id, +- param->peer_addr); +- if (ret) +- return ret; ++ ret = -ENOENT; ++ goto cleanup; ++ } + +- return -ENOENT; ++ ret = ath11k_peer_rhash_add(ar, peer); ++ if (ret) { ++ spin_unlock_bh(&ar->ab->base_lock); ++ goto cleanup; + } + + peer->pdev_idx = ar->pdev_idx; +@@ -778,4 +830,231 @@ int ath11k_peer_create(struct ath11k *ar + spin_unlock_bh(&ar->ab->base_lock); + + return 0; ++ ++cleanup: ++ reinit_completion(&ar->peer_delete_done); ++ ++ err_ret = ath11k_wmi_send_peer_delete_cmd(ar, param->peer_addr, ++ param->vdev_id); ++ if (err_ret) { ++ ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM ret %d\n", ++ param->vdev_id, param->peer_addr, err_ret); ++ goto exit; ++ } ++ ++ err_ret = ath11k_wait_for_peer_delete_done(ar, param->vdev_id, ++ param->peer_addr); ++ if (err_ret) ++ ath11k_warn(ar->ab, "failed wait for peer %pM delete done id %d ret %d\n", ++ param->peer_addr, param->vdev_id, err_ret); ++ ++exit: ++ return ret; ++} ++ ++int ath11k_peer_rhash_delete(struct ath11k *ar, struct ath11k_peer *peer) ++{ ++ struct ath11k_base *ab = ar->ab; ++ int ret; ++ ++ lockdep_assert_held(&ab->base_lock); ++ ++ if (!ab->rhead_peer_id || !ar->rhead_peer_addr) ++ return -EPERM; ++ ++ ret = ath11k_peer_rhash_remove(ab, ab->rhead_peer_id, &peer->rhash_id, ++ &ab->rhash_peer_id_param); ++ if (ret) { ++ ath11k_warn(ab, "failed to remove peer %pM id %d in rhash_id ret %d\n", ++ peer->addr, peer->peer_id, ret); ++ return ret; ++ } ++ ++ ret = ath11k_peer_rhash_remove(ab, ar->rhead_peer_addr, &peer->rhash_addr, ++ &ar->rhash_peer_addr_param); ++ if (ret) { ++ ath11k_warn(ab, "failed to remove peer %pM id %d in rhash_addr ret %d\n", ++ peer->addr, peer->peer_id, ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int ath11k_peer_rhash_id_tbl_init(struct ath11k_base *ab) ++{ ++ struct rhashtable_params *param; ++ struct rhashtable *rhash_id_tbl; ++ int ret; ++ size_t size; ++ ++ if (ab->rhead_peer_id) ++ return 0; ++ ++ size = sizeof(*ab->rhead_peer_id); ++ rhash_id_tbl = kzalloc(size, GFP_KERNEL); ++ if (!rhash_id_tbl) { ++ ath11k_warn(ab, "failed to init rhash id table due to no mem (size %zu)\n", ++ size); ++ return -ENOMEM; ++ } ++ ++ param = &ab->rhash_peer_id_param; ++ ++ param->key_offset = offsetof(struct ath11k_peer, peer_id); ++ param->head_offset = offsetof(struct ath11k_peer, rhash_id); ++ param->key_len = sizeof_field(struct ath11k_peer, peer_id); ++ param->automatic_shrinking = true; ++ param->nelem_hint = ab->num_radios * TARGET_NUM_PEERS_PDEV; ++ ++ ret = rhashtable_init(rhash_id_tbl, param); ++ if (ret) { ++ ath11k_warn(ab, "failed to init peer id rhash table %d\n", ret); ++ goto err_free; ++ } ++ ++ spin_lock_bh(&ab->base_lock); ++ ++ if (!ab->rhead_peer_id) { ++ ab->rhead_peer_id = rhash_id_tbl; ++ } else { ++ spin_unlock_bh(&ab->base_lock); ++ ath11k_warn(ab, "already peer rhash id init done id_tbl: %p\n", ++ ab->rhead_peer_id); ++ goto cleanup_tbl; ++ } ++ ++ spin_unlock_bh(&ab->base_lock); ++ ++ return 0; ++ ++cleanup_tbl: ++ rhashtable_destroy(rhash_id_tbl); ++err_free: ++ kfree(rhash_id_tbl); ++ ++ return ret; ++} ++ ++static int ath11k_peer_rhash_addr_tbl_init(struct ath11k *ar) ++{ ++ struct ath11k_base *ab = ar->ab; ++ struct rhashtable_params *param; ++ struct rhashtable *rhash_addr_tbl; ++ int ret; ++ size_t size; ++ ++ if (ar->rhead_peer_addr) ++ return 0; ++ ++ size = sizeof(*ar->rhead_peer_addr); ++ rhash_addr_tbl = kzalloc(size, GFP_KERNEL); ++ if (!rhash_addr_tbl) { ++ ath11k_warn(ab, "failed to init rhash addr table due to no mem (size %zu)\n", ++ size); ++ return -ENOMEM; ++ } ++ ++ param = &ar->rhash_peer_addr_param; ++ ++ param->key_offset = offsetof(struct ath11k_peer, addr); ++ param->head_offset = offsetof(struct ath11k_peer, rhash_addr); ++ param->key_len = sizeof_field(struct ath11k_peer, addr); ++ param->automatic_shrinking = true; ++ param->nelem_hint = TARGET_NUM_PEERS_PDEV; ++ ++ ret = rhashtable_init(rhash_addr_tbl, param); ++ if (ret) { ++ ath11k_warn(ab, "failed to init peer addr rhash table %d\n", ret); ++ goto err_free; ++ } ++ ++ spin_lock_bh(&ab->base_lock); ++ ++ if (!ar->rhead_peer_addr) { ++ ar->rhead_peer_addr = rhash_addr_tbl; ++ } else { ++ spin_unlock_bh(&ab->base_lock); ++ ath11k_warn(ab, "already peer rhash addr init done addr_tbl: %p pdev_idx %d\n", ++ ar->rhead_peer_addr, ar->pdev_idx); ++ goto cleanup_tbl; ++ } ++ ++ spin_unlock_bh(&ab->base_lock); ++ ++ return 0; ++ ++cleanup_tbl: ++ rhashtable_destroy(rhash_addr_tbl); ++err_free: ++ kfree(rhash_addr_tbl); ++ ++ return ret; ++} ++ ++static inline void ath11k_peer_rhash_id_tbl_destroy(struct ath11k_base *ab) ++{ ++ if (!ab->rhead_peer_id) ++ return; ++ ++ rhashtable_destroy(ab->rhead_peer_id); ++ kfree(ab->rhead_peer_id); ++ ab->rhead_peer_id = NULL; ++} ++ ++static inline void ath11k_peer_rhash_addr_tbl_destroy(struct ath11k *ar) ++{ ++ if (!ar->rhead_peer_addr) ++ return; ++ ++ rhashtable_destroy(ar->rhead_peer_addr); ++ kfree(ar->rhead_peer_addr); ++ ar->rhead_peer_addr = NULL; ++} ++ ++int ath11k_peer_rhash_tbl_init(struct ath11k_base *ab) ++{ ++ struct ath11k_pdev *pdev; ++ int ret, i; ++ ++ ret = ath11k_peer_rhash_id_tbl_init(ab); ++ if (ret) ++ return ret; ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ ++ ret = ath11k_peer_rhash_addr_tbl_init(pdev->ar); ++ if (ret) ++ goto cleanup_addr_tbl; ++ } ++ ++ return 0; ++ ++cleanup_addr_tbl: ++ for (i = i - 1; i >= 0; i--) { ++ pdev = &ab->pdevs[i]; ++ ath11k_peer_rhash_addr_tbl_destroy(pdev->ar); ++ } ++ ath11k_peer_rhash_id_tbl_destroy(ab); ++ ++ return ret; ++} ++ ++void ath11k_peer_rhash_tbl_destroy(struct ath11k_base *ab) ++{ ++ struct ath11k_pdev *pdev; ++ int i; ++ ++ spin_lock_bh(&ab->base_lock); ++ ++ ath11k_peer_rhash_id_tbl_destroy(ab); ++ ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ ++ ath11k_peer_rhash_addr_tbl_destroy(pdev->ar); ++ } ++ ++ spin_unlock_bh(&ab->base_lock); + } +--- a/drivers/net/wireless/ath/ath11k/peer.h ++++ b/drivers/net/wireless/ath/ath11k/peer.h +@@ -80,6 +80,10 @@ struct ath11k_peer { + /* protected by ab->data_lock */ + struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1]; + struct dp_rx_tid rx_tid[IEEE80211_NUM_TIDS + 1]; ++ /* peer id based rhashtable list pointer */ ++ struct rhash_head rhash_id; ++ /* peer addr based rhashtable list pointer */ ++ struct rhash_head rhash_addr; + + /* Info used in MMIC verification of + * RX fragments +@@ -105,7 +109,7 @@ void ath11k_peer_map_v2_event(struct ath + bool is_wds); + struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, + const u8 *addr); +-struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, ++struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k *ar, + const u8 *addr); + struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id); + struct ath11k_peer *ath11k_peer_find_by_ast(struct ath11k_base *ab, int ast_hash); +@@ -117,6 +121,9 @@ int ath11k_wait_for_peer_delete_done(str + const u8 *addr); + struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab, + int vdev_id); ++int ath11k_peer_rhash_tbl_init(struct ath11k_base *ab); ++void ath11k_peer_rhash_tbl_destroy(struct ath11k_base *ab); ++int ath11k_peer_rhash_delete(struct ath11k *ar, struct ath11k_peer *peer); + + #ifdef CPTCFG_ATH11K_NSS_SUPPORT + struct ath11k_ast_entry *ath11k_peer_ast_find_by_addr(struct ath11k_base *ab, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2667,12 +2667,15 @@ static void ath11k_dp_rx_h_undecap(struc + } + + static struct ath11k_peer * +-ath11k_dp_rx_h_find_peer(struct ath11k_base *ab, struct sk_buff *msdu) ++ath11k_dp_rx_h_find_peer(struct ath11k *ar, struct sk_buff *msdu) + { ++ struct ath11k_base *ab = ar->ab; + struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); + struct hal_rx_desc *rx_desc = rxcb->rx_desc; + struct ath11k_peer *peer = NULL; ++ + lockdep_assert_held(&ab->base_lock); ++ + if (rxcb->peer_id) + peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); + if (peer) +@@ -2681,7 +2684,7 @@ ath11k_dp_rx_h_find_peer(struct ath11k_b + if (!rx_desc || + !(ath11k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) + return NULL; +- peer = ath11k_peer_find_by_addr(ab, ath11k_dp_rxdesc_get_mpdu_start_addr2(ab, rx_desc)); ++ peer = ath11k_peer_find_by_addr(ar, ath11k_dp_rxdesc_get_mpdu_start_addr2(ab, rx_desc)); + return peer; + } + +@@ -2725,7 +2728,7 @@ static bool ath11k_dp_rx_check_fast_rx(s + return false; + + /* check if the msdu needs to be bridged to our connected peer */ +- f_peer = ath11k_peer_find_by_addr(ar->ab, ehdr->h_dest); ++ f_peer = ath11k_peer_find_by_addr(ar, ehdr->h_dest); + + if (f_peer && f_peer != peer) + return false; +@@ -2764,7 +2767,7 @@ static void ath11k_dp_rx_h_mpdu(struct a + } + + spin_lock_bh(&ar->ab->base_lock); +- peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); ++ peer = ath11k_dp_rx_h_find_peer(ar, msdu); + if (peer) { + /* If the pkt is a valid IP packet and peer supports + * fast rx, deliver directly to net, also note that +@@ -2987,7 +2990,7 @@ static void ath11k_dp_rx_deliver_msdu(st + if (!(status->flag & RX_FLAG_ONLY_MONITOR)) + decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); + spin_lock_bh(&ar->ab->base_lock); +- peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); ++ peer = ath11k_dp_rx_h_find_peer(ar, msdu); + if (peer && peer->sta) + pubsta = peer->sta; + spin_unlock_bh(&ar->ab->base_lock); +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -556,7 +556,7 @@ static int ath11k_nss_undecap_raw(struct + + spin_lock_bh(&ab->base_lock); + +- peer = ath11k_peer_find_by_addr(ab, hdr->addr2); ++ peer = ath11k_peer_find_by_addr(ar, hdr->addr2); + if (!peer) { + ath11k_warn(ab, "peer not found for raw/nwifi undecap, drop this packet\n"); + spin_unlock_bh(&ab->base_lock); +@@ -3345,7 +3345,7 @@ void ath11k_nss_update_sta_stats(struct + return; + + spin_lock_bh(&ab->base_lock); +- peer = ath11k_peer_find_by_addr(ab, sta->addr); ++ peer = ath11k_peer_find_by_addr(ar, sta->addr); + if (!peer) { + ath11k_dbg(ab, ATH11K_DBG_NSS, "sta stats: unable to find peer %pM\n", + sta->addr); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6028,7 +6028,7 @@ static int wmi_process_tx_comp(struct at + frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); + + spin_lock_bh(&ar->ab->base_lock); +- peer = ath11k_peer_find_by_addr(ar->ab, hdr->addr2); ++ peer = ath11k_peer_find_by_addr(ar, hdr->addr2); + if (!peer) { + spin_unlock_bh(&ar->ab->base_lock); + ath11k_warn(ar->ab, "failed to find peer to update txcompl mgmt stats\n"); +@@ -7563,9 +7563,9 @@ static void ath11k_mgmt_rx_event(struct + + spin_lock_bh(&ab->base_lock); + +- peer = ath11k_peer_find_by_addr(ab, hdr->addr1); ++ peer = ath11k_peer_find_by_addr(ar, hdr->addr1); + if(!peer) +- peer = ath11k_peer_find_by_addr(ab, hdr->addr3); ++ peer = ath11k_peer_find_by_addr(ar, hdr->addr3); + if (!peer) { + spin_unlock_bh(&ab->base_lock); + goto skip_mgmt_stats; +@@ -7978,8 +7978,9 @@ static void ath11k_peer_sta_kickout_even + struct wmi_peer_sta_kickout_arg arg = {}; + struct ieee80211_sta *sta; + struct ath11k_peer *peer; ++ struct ath11k_pdev *pdev; + struct ath11k *ar; +- u32 vdev_id; ++ int i; + + if (ath11k_pull_peer_sta_kickout_ev(ab, skb, &arg) != 0) { + ath11k_warn(ab, "failed to extract peer sta kickout event"); +@@ -7990,7 +7991,13 @@ static void ath11k_peer_sta_kickout_even + + spin_lock_bh(&ab->base_lock); + +- peer = ath11k_peer_find_by_addr(ab, arg.mac_addr); ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ ar = pdev->ar; ++ peer = ath11k_peer_find_by_addr(ar, arg.mac_addr); ++ if (peer) ++ break; ++ } + + if (!peer) { + spin_unlock_bh(&ab->base_lock); +@@ -7999,17 +8006,8 @@ static void ath11k_peer_sta_kickout_even + goto exit; + } + +- vdev_id = peer->vdev_id; +- + spin_unlock_bh(&ab->base_lock); + +- ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); +- if (!ar) { +- ath11k_warn(ab, "invalid vdev id in peer sta kickout ev %d", +- vdev_id); +- goto exit; +- } +- + sta = ieee80211_find_sta_by_ifaddr(ar->hw, + arg.mac_addr, NULL); + if (!sta) { +@@ -9502,8 +9500,10 @@ ath11k_wmi_event_peer_sta_ps_state_chg(s + struct ath11k_peer *peer; + struct ath11k *ar; + struct ath11k_sta *arsta; ++ struct ath11k_pdev *pdev; + u32 peer_previous_ps_state; + u8 peer_addr[ETH_ALEN]; ++ int i; + + ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data; + ether_addr_copy(peer_addr, ev->peer_macaddr.addr); +@@ -9512,7 +9512,13 @@ ath11k_wmi_event_peer_sta_ps_state_chg(s + + spin_lock_bh(&ab->base_lock); + +- peer = ath11k_peer_find_by_addr(ab, peer_addr); ++ for (i = 0; i < ab->num_radios; i++) { ++ pdev = &ab->pdevs[i]; ++ ar = pdev->ar; ++ peer = ath11k_peer_find_by_addr(ar, peer_addr); ++ if (peer) ++ break; ++ } + + if (!peer) { + ath11k_warn(ab, "peer not found %pM\n", +@@ -9521,16 +9527,6 @@ ath11k_wmi_event_peer_sta_ps_state_chg(s + + spin_unlock_bh(&ab->base_lock); + goto exit; +- } +- +- ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); +- +- if (!ar) { +- ath11k_warn(ab, "invalid vdev id in peer sta ps state change ev %d", +- peer->vdev_id); +- +- spin_unlock_bh(&ab->base_lock); +- goto exit; + } + + sta = peer->sta; diff --git a/feeds/wifi-ax/mac80211/patches/qca/314-002-ath11k-fix-ce-dp-address-alignment.patch b/feeds/wifi-ax/mac80211/patches/qca/314-002-ath11k-fix-ce-dp-address-alignment.patch new file mode 100644 index 000000000..06018001a --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/314-002-ath11k-fix-ce-dp-address-alignment.patch @@ -0,0 +1,168 @@ +From 9b38ea43cd19cc6bd9a1330c1d4ee9d9c77e448c Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Fri, 25 Jun 2021 20:44:59 +0530 +Subject: [PATCH] ath11k: fix CE and DP address alignment + +srng dma address and virtual address should be aligned with byte instead +of pointer type. Alignment should be based on dma address instead +of virtual address. Also CE dma allocations are freed with unaligned +address instead of aligned address. so corrected all address alignment. + +Signed-off-by: Hari Chandrakanthan +Signed-off-by: Karthikeyan Periyasamy +--- + drivers/net/wireless/ath/ath11k/ce.c | 24 +++++++++++++----------- + drivers/net/wireless/ath/ath11k/ce.h | 4 ++-- + drivers/net/wireless/ath/ath11k/dp.c | 14 ++++++++++---- + drivers/net/wireless/ath/ath11k/hal.h | 3 ++- + 4 files changed, 27 insertions(+), 18 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c +index 453079a..4b5bbef 100644 +--- a/drivers/net/wireless/ath/ath11k/ce.c ++++ b/drivers/net/wireless/ath/ath11k/ce.c +@@ -619,6 +619,7 @@ ath11k_ce_alloc_ring(struct ath11k_base *ab, int nentries, int desc_sz) + { + struct ath11k_ce_ring *ce_ring; + dma_addr_t base_addr; ++ unsigned long off; + + ce_ring = kzalloc(struct_size(ce_ring, skb, nentries), GFP_KERNEL); + if (ce_ring == NULL) +@@ -647,12 +648,13 @@ ath11k_ce_alloc_ring(struct ath11k_base *ab, int nentries, int desc_sz) + + ce_ring->base_addr_ce_space_unaligned = base_addr; + +- ce_ring->base_addr_owner_space = PTR_ALIGN( +- ce_ring->base_addr_owner_space_unaligned, +- CE_DESC_RING_ALIGN); +- ce_ring->base_addr_ce_space = ALIGN( +- ce_ring->base_addr_ce_space_unaligned, ++ ce_ring->base_addr_ce_space = (dma_addr_t) ALIGN( ++ (unsigned long)ce_ring->base_addr_ce_space_unaligned, + CE_DESC_RING_ALIGN); ++ off = (unsigned long)ce_ring->base_addr_ce_space - ++ (unsigned long)ce_ring->base_addr_ce_space_unaligned; ++ ce_ring->base_addr_owner_space = (void *) ++ ((unsigned long)ce_ring->base_addr_owner_space_unaligned + off); + + return ce_ring; + } +@@ -1004,8 +1006,8 @@ void ath11k_ce_free_pipes(struct ath11k_base *ab) + dma_free_coherent(ab->dev, + pipe->src_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN, +- pipe->src_ring->base_addr_owner_space, +- pipe->src_ring->base_addr_ce_space); ++ pipe->src_ring->base_addr_owner_space_unaligned, ++ pipe->src_ring->base_addr_ce_space_unaligned); + ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, + pipe->src_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN); +@@ -1018,8 +1020,8 @@ void ath11k_ce_free_pipes(struct ath11k_base *ab) + dma_free_coherent(ab->dev, + pipe->dest_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN, +- pipe->dest_ring->base_addr_owner_space, +- pipe->dest_ring->base_addr_ce_space); ++ pipe->dest_ring->base_addr_owner_space_unaligned, ++ pipe->dest_ring->base_addr_ce_space_unaligned); + ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, + pipe->dest_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN); +@@ -1033,8 +1035,8 @@ void ath11k_ce_free_pipes(struct ath11k_base *ab) + dma_free_coherent(ab->dev, + pipe->status_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN, +- pipe->status_ring->base_addr_owner_space, +- pipe->status_ring->base_addr_ce_space); ++ pipe->status_ring->base_addr_owner_space_unaligned, ++ pipe->status_ring->base_addr_ce_space_unaligned); + ATH11K_MEMORY_STATS_DEC(ab, ce_ring_alloc, + pipe->status_ring->nentries * desc_sz + + CE_DESC_RING_ALIGN); +diff --git a/drivers/net/wireless/ath/ath11k/ce.h b/drivers/net/wireless/ath/ath11k/ce.h +index 5808be6..e099b14 100644 +--- a/drivers/net/wireless/ath/ath11k/ce.h ++++ b/drivers/net/wireless/ath/ath11k/ce.h +@@ -140,7 +140,7 @@ struct ath11k_ce_ring { + /* Host address space */ + void *base_addr_owner_space_unaligned; + /* CE address space */ +- u32 base_addr_ce_space_unaligned; ++ dma_addr_t base_addr_ce_space_unaligned; + + /* Actual start of descriptors. + * Aligned to descriptor-size boundary. +@@ -150,7 +150,7 @@ struct ath11k_ce_ring { + void *base_addr_owner_space; + + /* CE address space */ +- u32 base_addr_ce_space; ++ dma_addr_t base_addr_ce_space; + + /* HAL ring id */ + u32 hal_ring_id; +diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c +index 157a21e..d42b867 100644 +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -245,6 +245,8 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, + int max_entries = ath11k_hal_srng_get_max_entries(ab, type); + int ret; + bool cached; ++ unsigned long off; ++ u8 align = HAL_RING_BASE_ALIGN; + + if (max_entries < 0 || entry_sz < 0) + return -EINVAL; +@@ -252,6 +254,9 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, + if (num_entries > max_entries) + num_entries = max_entries; + ++ if (type == HAL_RXDMA_DIR_BUF) ++ align = HAL_RXDMA_DIR_BUF_RING_BASE_ALIGN; ++ + /* Allocate the reo dst and tx completion rings from cacheable memory */ + switch (type) { + case HAL_REO_DST: +@@ -265,7 +270,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, + if (ab->nss.enabled) + cached = false; + +- ring->size = (num_entries * entry_sz) + HAL_RING_BASE_ALIGN - 1; ++ ring->size = (num_entries * entry_sz) + align - 1; + + if (!cached) { + ring->vaddr_unaligned = dma_alloc_coherent(ab->dev, ring->size, +@@ -281,9 +286,10 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, + + ATH11K_MEMORY_STATS_INC(ab, dma_alloc, ring->size); + +- ring->vaddr = PTR_ALIGN(ring->vaddr_unaligned, HAL_RING_BASE_ALIGN); +- ring->paddr = ring->paddr_unaligned + ((unsigned long)ring->vaddr - +- (unsigned long)ring->vaddr_unaligned); ++ ring->paddr = (dma_addr_t) ALIGN((unsigned long)ring->paddr_unaligned, ++ align); ++ off = (unsigned long)ring->paddr - (unsigned long)ring->paddr_unaligned; ++ ring->vaddr = (u32 *) ((unsigned long)ring->vaddr_unaligned + off); + + params.ring_base_vaddr = ring->vaddr; + params.ring_base_paddr = ring->paddr; +diff --git a/drivers/net/wireless/ath/ath11k/hal.h b/drivers/net/wireless/ath/ath11k/hal.h +index e9728fa..f1bdb99 100644 +--- a/drivers/net/wireless/ath/ath11k/hal.h ++++ b/drivers/net/wireless/ath/ath11k/hal.h +@@ -21,7 +21,8 @@ struct ath11k_base; + #define HAL_NUM_MPDU_LINKS_PER_QUEUE_DESC 12 + #define HAL_MAX_AVAIL_BLK_RES 3 + +-#define HAL_RING_BASE_ALIGN 8 ++#define HAL_RING_BASE_ALIGN 32 ++#define HAL_RXDMA_DIR_BUF_RING_BASE_ALIGN 8 + + #define HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX 32704 + /* TODO: Check with hw team on the supported scatter buf size */ +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch b/feeds/wifi-ax/mac80211/patches/qca/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch new file mode 100644 index 000000000..c8aa895d7 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch @@ -0,0 +1,124 @@ +From e58249f0a5826926c0e96acea4dfbc8683cfaaab Mon Sep 17 00:00:00 2001 +From: Rameshkumar Sundaram +Date: Wed, 9 Jun 2021 17:32:30 +0530 +Subject: [PATCH] ath11k: Fix peer lookup failure in mgmt tx completion + +In mgmt tx completion handler, peer lookup is done using address 2 +of transmitted frame to find arvif and update mgmt tx completion stats. +For STA interface, self peer will not be created and hence +peer lookup with address 2 keeps failing. +Fix this by obtaining vif directly from SKB_CB for updating stats. + +Possible vif removal races: +1. If vif removed before tx completion all idrs associated to the vif +would've been flushed and finding msdu with idr will fail, +hence tx completion wont be processed therafter. +2. Added data lock to protect vif removal during tx completion processing. + +Signed-off-by: Rameshkumar Sundaram +--- + drivers/net/wireless/ath/ath11k/mac.c | 2 ++ + drivers/net/wireless/ath/ath11k/wmi.c | 53 ++++++++++++++++------------------- + 2 files changed, 26 insertions(+), 29 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -7066,8 +7066,10 @@ err_vdev_del: + kfree(arvif->vlan_keyid_map); + ath11k_peer_cleanup(ar, arvif->vdev_id); + ++ spin_lock_bh(&ar->data_lock); + idr_for_each(&ar->txmgmt_idr, + ath11k_mac_vif_txmgmt_idr_remove, vif); ++ spin_unlock_bh(&ar->data_lock); + + for (i = 0; i < DP_TCL_NUM_RING_MAX; i++) { + spin_lock_bh(&ab->dp.tx_ring[i].tx_idr_lock); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -5989,12 +5989,12 @@ static int wmi_process_tx_comp(struct at + struct ieee80211_tx_info *info; + struct ath11k_skb_cb *skb_cb; + struct ieee80211_hdr *hdr; +- struct ath11k_peer *peer; + struct ieee80211_vif *vif; + struct ath11k_vif *arvif; + struct ath11k_mgmt_frame_stats *mgmt_stats; + u16 frm_type; + ++ spin_lock_bh(&ar->data_lock); + spin_lock_bh(&ar->txmgmt_idr_lock); + msdu = idr_find(&ar->txmgmt_idr, tx_compl_param->desc_id); + +@@ -6002,6 +6002,7 @@ static int wmi_process_tx_comp(struct at + ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", + tx_compl_param->desc_id); + spin_unlock_bh(&ar->txmgmt_idr_lock); ++ spin_unlock_bh(&ar->data_lock); + return -ENOENT; + } + +@@ -6010,6 +6011,28 @@ static int wmi_process_tx_comp(struct at + + skb_cb = ATH11K_SKB_CB(msdu); + dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); ++ hdr = (struct ieee80211_hdr *)msdu->data; ++ ++ if (ieee80211_is_mgmt(hdr->frame_control)) { ++ frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); ++ vif = skb_cb->vif; ++ ++ if (!vif) { ++ ath11k_warn(ar->ab, "failed to find vif to update txcompl mgmt stats\n"); ++ goto skip_mgmt_stats; ++ } ++ ++ arvif = ath11k_vif_to_arvif(vif); ++ mgmt_stats = &arvif->mgmt_stats; ++ ++ if (!tx_compl_param->status) ++ mgmt_stats->tx_compl_succ[frm_type]++; ++ else ++ mgmt_stats->tx_compl_fail[frm_type]++; ++ } ++ ++skip_mgmt_stats: ++ spin_unlock_bh(&ar->data_lock); + + info = IEEE80211_SKB_CB(msdu); + if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !tx_compl_param->status) +@@ -6024,34 +6047,6 @@ static int wmi_process_tx_comp(struct at + */ + info->status.rates[0].idx = -1; + +- hdr = (struct ieee80211_hdr *)msdu->data; +- frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control); +- +- spin_lock_bh(&ar->ab->base_lock); +- peer = ath11k_peer_find_by_addr(ar, hdr->addr2); +- if (!peer) { +- spin_unlock_bh(&ar->ab->base_lock); +- ath11k_warn(ar->ab, "failed to find peer to update txcompl mgmt stats\n"); +- goto skip_mgmt_stats; +- } +- +- vif = peer->vif; +- spin_unlock_bh(&ar->ab->base_lock); +- +- spin_lock_bh(&ar->data_lock); +- arvif = ath11k_vif_to_arvif(vif); +- mgmt_stats = &arvif->mgmt_stats; +- +- if (ieee80211_is_mgmt(hdr->frame_control)) { +- if (!tx_compl_param->status) +- mgmt_stats->tx_compl_succ[frm_type]++; +- else +- mgmt_stats->tx_compl_fail[frm_type]++; +- } +- +- spin_unlock_bh(&ar->data_lock); +- +-skip_mgmt_stats: + ieee80211_tx_status_irqsafe(ar->hw, msdu); + + /* WARN when we received this event without doing any mgmt tx */ diff --git a/feeds/wifi-ax/mac80211/patches/qca/317-ath11k-Fix-PDEV_ID-bitmask-for-HTT_PPDU_STATS-request.patch b/feeds/wifi-ax/mac80211/patches/qca/317-ath11k-Fix-PDEV_ID-bitmask-for-HTT_PPDU_STATS-request.patch new file mode 100644 index 000000000..1c6e2256d --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/317-ath11k-Fix-PDEV_ID-bitmask-for-HTT_PPDU_STATS-request.patch @@ -0,0 +1,34 @@ +From 46373b5b7fbf88a3ac71c8d45519d21a5308d834 Mon Sep 17 00:00:00 2001 +From: Rameshkumar Sundaram +Date: Wed, 2 Jun 2021 15:50:13 +0530 +Subject: [PATCH] ath11k: Fix PDEV_ID bitmask for HTT_PPDU_STATS request + +HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU_STATS request message +was set as bit 8 to 15, bit 8 is reserved for soc stats and pdev id +starts from bit 9. Hence changed the bitmask form bit 9 to 15. +Without this, per peer tx stats is not updated. + +Fix: Ib6950344286ba18fab43586262c62dcd09557614 + +Signed-off-by: Rameshkumar Sundaram +--- + drivers/net/wireless/ath/ath11k/dp.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h +index 71c764e..ee91f63 100644 +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -563,7 +563,8 @@ struct htt_ppdu_stats_cfg_cmd { + } __packed; + + #define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0) +-#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 8) ++#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8) ++#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9) + #define HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK GENMASK(31, 16) + + enum htt_ppdu_stats_tag_type { +-- +2.7.4 + diff --git a/feeds/wifi-ax/mac80211/patches/qca/318-ath11k-avoid-false-error-code-to-mac80211-in-vap-create.patch b/feeds/wifi-ax/mac80211/patches/qca/318-ath11k-avoid-false-error-code-to-mac80211-in-vap-create.patch new file mode 100644 index 000000000..dfda406c0 --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/318-ath11k-avoid-false-error-code-to-mac80211-in-vap-create.patch @@ -0,0 +1,49 @@ +From: Karthikeyan Periyasamy +Date: Thu, 23 Jun 2021 15:07:12 +0530 +Subject: [PATCH] ath11k: avoid false error code in add interface + +return error code is not properly return to mac80211. The return code +is overwrite by the error handling return codes so mac80211 treats as +success for the non created VAP. Then we are getting remove interface +callback for non created VAP and proceeds to the self peer delete WMI +request leads to FW assert since its already deleted on the cleanup +of the add interface callback. + +Signed-off-by: Karthikeyan Periyasamy +--- + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6680,7 +6680,7 @@ static int ath11k_mac_op_add_interface(s + u32 param_id, param_value; + u16 nss; + int i; +- int ret; ++ int ret, err_ret; + int bit; + + vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; +@@ -6954,17 +6954,17 @@ err_peer_del: + if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { + reinit_completion(&ar->peer_delete_done); + +- ret = ath11k_wmi_send_peer_delete_cmd(ar, vif->addr, +- arvif->vdev_id); +- if (ret) { ++ err_ret = ath11k_wmi_send_peer_delete_cmd(ar, vif->addr, ++ arvif->vdev_id); ++ if (err_ret) { + ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", + arvif->vdev_id, vif->addr); + goto err_keyid; + } + +- ret = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id, +- vif->addr); +- if (ret) ++ err_ret = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id, ++ vif->addr); ++ if (err_ret) + goto err_keyid; + + ar->num_peers--; diff --git a/feeds/wifi-ax/mac80211/patches/qca/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch b/feeds/wifi-ax/mac80211/patches/qca/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch new file mode 100644 index 000000000..9d424a59e --- /dev/null +++ b/feeds/wifi-ax/mac80211/patches/qca/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch @@ -0,0 +1,244 @@ +From 210b20357989ace8bb5c861b37e25b6c986c816d Mon Sep 17 00:00:00 2001 +From: Sathishkumar Muruganandam +Date: Thu, 1 Jul 2021 13:08:54 +0530 +Subject: [PATCH] ath11k: fix double free of peer rx_tid during reo cmd failure + +Peer rx_tid is locally copied thrice during peer_rx_tid_cleanup to send +REO_CMD_UPDATE_RX_QUEUE followed by REO_CMD_FLUSH_CACHE to flush all +aged REO descriptors from HW cache. + +When sending REO_CMD_FLUSH_CACHE fails, we do dma unmap of already +mapped rx_tid->vaddr and free it. This is not checked during +reo_cmd_list_cleanup() and dp_reo_cmd_free() before trying to free and +unmap again. + +Fix this by setting rx_tid->vaddr NULL in rx tid delete and also wherever +freeing it to check in reo_cmd_list_cleanup() and reo_cmd_free() before +trying to free again. + +Prevent REO cmd failures causing double free by increasing REO cmd +ring size and moving REO status ring mask to IRQ group 3 from group +0 to separate from tx completion ring on IRQ group 0 which may delay +reo status processing. + +Signed-off-by: Sathishkumar Muruganandam +--- + drivers/net/wireless/ath/ath11k/dp.h | 2 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 66 ++++++++++++++++++------- + drivers/net/wireless/ath/ath11k/hw.c | 1 + + 3 files changed, 49 insertions(+), 20 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h +index ee91f630191a..49fee63ab6d4 100644 +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -224,7 +224,7 @@ struct ath11k_pdev_dp { + #define DP_REO_REINJECT_RING_SIZE 32 + #define DP_RX_RELEASE_RING_SIZE 1024 + #define DP_REO_EXCEPTION_RING_SIZE 128 +-#define DP_REO_CMD_RING_SIZE 128 ++#define DP_REO_CMD_RING_SIZE 256 + #define DP_REO_STATUS_RING_SIZE 2048 + #define DP_RXDMA_BUF_RING_SIZE 4096 + #define DP_RXDMA_REFILL_RING_SIZE ATH11K_DP_RXDMA_REFILL_RING_SIZE +diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c +index b8c8fd4c3f45..15c330d3550f 100644 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -698,13 +698,18 @@ void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab) + struct ath11k_dp *dp = &ab->dp; + struct dp_reo_cmd *cmd, *tmp; + struct dp_reo_cache_flush_elem *cmd_cache, *tmp_cache; ++ struct dp_rx_tid *rx_tid; + + spin_lock_bh(&dp->reo_cmd_lock); + list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) { + list_del(&cmd->list); +- dma_unmap_single(ab->dev, cmd->data.paddr, +- cmd->data.size, DMA_BIDIRECTIONAL); +- kfree(cmd->data.vaddr); ++ rx_tid = &cmd->data; ++ if (rx_tid->vaddr) { ++ dma_unmap_single(ab->dev, rx_tid->paddr, ++ rx_tid->size, DMA_BIDIRECTIONAL); ++ kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; ++ } + kfree(cmd); + } + +@@ -712,9 +717,13 @@ void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab) + &dp->reo_cmd_cache_flush_list, list) { + list_del(&cmd_cache->list); + dp->reo_cmd_cache_flush_count--; +- dma_unmap_single(ab->dev, cmd_cache->data.paddr, +- cmd_cache->data.size, DMA_BIDIRECTIONAL); +- kfree(cmd_cache->data.vaddr); ++ rx_tid = &cmd_cache->data; ++ if (rx_tid->vaddr) { ++ dma_unmap_single(ab->dev, rx_tid->paddr, ++ rx_tid->size, DMA_BIDIRECTIONAL); ++ kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; ++ } + kfree(cmd_cache); + } + spin_unlock_bh(&dp->reo_cmd_lock); +@@ -729,9 +738,12 @@ static void ath11k_dp_reo_cmd_free(struct ath11k_dp *dp, void *ctx, + ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", + rx_tid->tid, status); + +- dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); ++ if (rx_tid->vaddr) { ++ dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, ++ DMA_BIDIRECTIONAL); ++ kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; ++ } + } + + static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab, +@@ -770,6 +782,7 @@ static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab, + dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, + DMA_BIDIRECTIONAL); + kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; + } + } + +@@ -790,8 +803,11 @@ static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx, + } + + elem = kzalloc(sizeof(*elem), GFP_ATOMIC); +- if (!elem) ++ if (!elem) { ++ ath11k_warn(ab, "failed to alloc reo_cache_flush_elem, rx tid %d\n", ++ rx_tid->tid); + goto free_desc; ++ } + + elem->ts = jiffies; + memcpy(&elem->data, rx_tid, sizeof(*rx_tid)); +@@ -822,6 +838,7 @@ free_desc: + dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, + DMA_BIDIRECTIONAL); + kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; + } + + void ath11k_peer_rx_tid_delete(struct ath11k *ar, +@@ -834,6 +851,8 @@ void ath11k_peer_rx_tid_delete(struct ath11k *ar, + if (!rx_tid->active) + return; + ++ rx_tid->active = false; ++ + cmd.flag = HAL_REO_CMD_FLG_NEED_STATUS; + cmd.addr_lo = lower_32_bits(rx_tid->paddr); + cmd.addr_hi = upper_32_bits(rx_tid->paddr); +@@ -849,7 +868,9 @@ void ath11k_peer_rx_tid_delete(struct ath11k *ar, + kfree(rx_tid->vaddr); + } + +- rx_tid->active = false; ++ rx_tid->vaddr = NULL; ++ rx_tid->paddr = 0; ++ rx_tid->size = 0; + } + + static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab, +@@ -985,7 +1006,8 @@ static void ath11k_dp_rx_tid_mem_free(struct ath11k_base *ab, + + peer = ath11k_peer_find(ab, vdev_id, peer_mac); + if (!peer) { +- ath11k_warn(ab, "failed to find the peer to free up rx tid mem\n"); ++ ath11k_warn(ab, "failed to find the peer %pM to free up rx tid mem\n", ++ peer_mac); + goto unlock_exit; + } + +@@ -998,6 +1020,7 @@ static void ath11k_dp_rx_tid_mem_free(struct ath11k_base *ab, + kfree(rx_tid->vaddr); + + rx_tid->active = false; ++ rx_tid->vaddr = NULL; + + unlock_exit: + spin_unlock_bh(&ab->base_lock); +@@ -1043,7 +1066,8 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + + peer = ath11k_peer_find(ab, vdev_id, peer_mac); + if (!peer) { +- ath11k_warn(ab, "failed to find the peer to set up rx tid\n"); ++ ath11k_warn(ab, "failed to find the peer %pM to set up rx tid\n", ++ peer_mac); + spin_unlock_bh(&ab->base_lock); + return -ENOENT; + } +@@ -1056,7 +1080,8 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + ba_win_sz, ssn, true); + spin_unlock_bh(&ab->base_lock); + if (ret) { +- ath11k_warn(ab, "failed to update reo for rx tid %d\n", tid); ++ ath11k_warn(ab, "failed to update reo for peer %pM rx tid %d\n", ++ peer_mac, tid); + return ret; + } + +@@ -1064,8 +1089,8 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + peer_mac, paddr, + tid, 1, ba_win_sz); + if (ret) +- ath11k_warn(ab, "failed to send wmi command to update rx reorder queue, tid :%d (%d)\n", +- tid, ret); ++ ath11k_warn(ab, "failed to send wmi rx reorder queue, peer %pM tid :%d (%d)\n", ++ peer_mac, tid, ret); + return ret; + } + +@@ -1098,6 +1123,8 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + ret = dma_mapping_error(ab->dev, paddr); + if (ret) { + spin_unlock_bh(&ab->base_lock); ++ ath11k_warn(ab, "failed to dma map for peer %pM rx tid :%d setup\n", ++ peer_mac, tid); + goto err_mem_free; + } + +@@ -1111,15 +1138,16 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, + ret = ath11k_wmi_peer_rx_reorder_queue_setup(ar, vdev_id, peer_mac, + paddr, tid, 1, ba_win_sz); + if (ret) { +- ath11k_warn(ar->ab, "failed to setup rx reorder queue, tid :%d (%d)\n", +- tid, ret); ++ ath11k_warn(ar->ab, "failed to setup rx reorder queue, peer %pM tid: %d (%d)\n", ++ peer_mac, tid, ret); + ath11k_dp_rx_tid_mem_free(ab, peer_mac, vdev_id, tid); + } + + return ret; + + err_mem_free: +- kfree(vaddr); ++ kfree(rx_tid->vaddr); ++ rx_tid->vaddr = NULL; + + return ret; + } +diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c +index 76ffb60428c5..36aa74180555 100644 +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -1308,6 +1308,7 @@ const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074 = { + ATH11K_RX_WBM_REL_RING_MASK_0, + }, + .reo_status = { ++ 0, 0, 0, + ATH11K_REO_STATUS_RING_MASK_0, + }, + .rxdma2host = { +-- +2.31.1 + diff --git a/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch b/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch index 17b55d3a0..14f4e835f 100644 --- a/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch +++ b/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch @@ -1,25 +1,26 @@ -From 6ec4c8f7d24c34c5855278fe13bde4e5e43ba293 Mon Sep 17 00:00:00 2001 +From 193d8f3f91f2a536e904404ab6a0c00a159a14fa Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 18 Jul 2020 08:53:44 +0200 -Subject: [PATCH 17/43] ipq807x: add the Qualcomm AX target support +Subject: [PATCH 01/27] ipq807x: add the Qualcomm AX target support Signed-off-by: John Crispin --- config/Config-kernel.in | 9 + include/image.mk | 6 +- + include/kernel-version.mk | 2 +- package/boot/uboot-envtools/files/ipq807x | 37 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 + target/linux/ipq807x/109-logspam.patch | 24 + target/linux/ipq807x/Makefile | 22 + .../ipq807x/base-files/etc/board.d/01_leds | 36 + .../ipq807x/base-files/etc/board.d/02_network | 77 + - .../etc/hotplug.d/firmware/10-ath11k-caldata | 89 + + .../etc/hotplug.d/firmware/10-ath11k-caldata | 90 + .../ipq807x/base-files/etc/init.d/aq_phy | 15 + .../ipq807x/base-files/etc/init.d/bootcount | 12 + .../linux/ipq807x/base-files/etc/init.d/wdt | 14 + ...G4_v5.4.B-AQR_CIG_WIFI_ID44715_VER1673.cld | Bin 0 -> 391170 bytes .../base-files/lib/upgrade/platform.sh | 64 + - target/linux/ipq807x/config-4.4 | 823 +++++++++ + target/linux/ipq807x/config-4.4 | 824 +++++++++ .../arm/boot/dts/qcom-ipq6018-cig-wf188.dts | 18 + .../arm/boot/dts/qcom-ipq6018-cig-wf188n.dts | 18 + .../boot/dts/qcom-ipq6018-edgecore-eap101.dts | 18 + @@ -34,10 +35,10 @@ Signed-off-by: John Crispin target/linux/ipq807x/image/Makefile | 26 + target/linux/ipq807x/image/ipq60xx.mk | 47 + target/linux/ipq807x/image/ipq807x.mk | 72 + - target/linux/ipq807x/ipq60xx/config-default | 144 ++ + target/linux/ipq807x/ipq60xx/config-default | 122 ++ .../linux/ipq807x/ipq60xx/profiles/default.mk | 9 + target/linux/ipq807x/ipq60xx/target.mk | 8 + - target/linux/ipq807x/ipq807x/config-default | 75 + + target/linux/ipq807x/ipq807x/config-default | 78 + .../linux/ipq807x/ipq807x/profiles/default.mk | 9 + target/linux/ipq807x/ipq807x/target.mk | 7 + target/linux/ipq807x/modules.mk | 61 + @@ -48,11 +49,10 @@ Signed-off-by: John Crispin target/linux/ipq807x/patches/104-wf194c.patch | 816 +++++++++ .../patches/105-fix-dtc-gcc10-build.patch | 11 + target/linux/ipq807x/patches/106-eap101.patch | 993 +++++++++++ - .../ipq807x/patches/107-ed2-compile.patch | 12 + .../linux/ipq807x/patches/108-log-spam.patch | 37 + target/linux/ipq807x/patches/109-tplink.patch | 1518 +++++++++++++++++ .../ipq807x/patches/110-add-esmt-nand.patch | 37 + - 47 files changed, 9330 insertions(+), 1 deletion(-) + 47 files changed, 9302 insertions(+), 2 deletions(-) create mode 100644 package/boot/uboot-envtools/files/ipq807x create mode 100644 target/linux/ipq807x/109-logspam.patch create mode 100644 target/linux/ipq807x/Makefile @@ -93,7 +93,6 @@ Signed-off-by: John Crispin create mode 100644 target/linux/ipq807x/patches/104-wf194c.patch create mode 100644 target/linux/ipq807x/patches/105-fix-dtc-gcc10-build.patch create mode 100644 target/linux/ipq807x/patches/106-eap101.patch - create mode 100644 target/linux/ipq807x/patches/107-ed2-compile.patch create mode 100644 target/linux/ipq807x/patches/108-log-spam.patch create mode 100644 target/linux/ipq807x/patches/109-tplink.patch create mode 100644 target/linux/ipq807x/patches/110-add-esmt-nand.patch @@ -142,6 +141,19 @@ index 6fc02a3f6b..92b23321b1 100644 -o $(2).tmp $(1) $(LINUX_DIR)/scripts/dtc/dtc -O dtb \ -i$(dir $(1)) $(DTC_FLAGS) $(4) \ +diff --git a/include/kernel-version.mk b/include/kernel-version.mk +index 3c109c13c8..dff01895be 100644 +--- a/include/kernel-version.mk ++++ b/include/kernel-version.mk +@@ -11,7 +11,7 @@ LINUX_VERSION-4.14 = .193 + LINUX_VERSION-5.4 = .142 + LINUX_VERSION-5.10 = .27 + +-LINUX_KERNEL_HASH-4.4.60 = 2cd8df6f1ac6a5329c5a286ec9b5956215977221a1b731597ed169fff74a9659 ++LINUX_KERNEL_HASH-4.4.60 = e7f2f47acf17497d6ffd713eda65c025b3df0bce09faa8c04712bf1b3cfc9fdb + LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03 + LINUX_KERNEL_HASH-5.4.142 = 99785728968564ba27c7e552d024b560072dcbc885540912eabb5c021e231451 + LINUX_KERNEL_HASH-5.10.27 = d99dc9662951299c53a0a8d8c8d0a72a16ff861d20e927c0f9b14f63282d69d9 diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x new file mode 100644 index 0000000000..6c429f1852 @@ -233,7 +245,7 @@ index 0000000000..79ee61dc77 + return 0; diff --git a/target/linux/ipq807x/Makefile b/target/linux/ipq807x/Makefile new file mode 100644 -index 0000000000..66031ace35 +index 0000000000..97c770df4a --- /dev/null +++ b/target/linux/ipq807x/Makefile @@ -0,0 +1,22 @@ @@ -248,7 +260,7 @@ index 0000000000..66031ace35 +CPU_TYPE:=cortex-a7 + +KERNEL_PATCHVER:=4.4 -+KERNEL_NAME_SUFFIX=-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce ++KERNEL_NAME_SUFFIX=-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016 + +include $(INCLUDE_DIR)/target.mk +DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \ @@ -386,10 +398,10 @@ index 0000000000..eaa440943b +exit 0 diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata new file mode 100755 -index 0000000000..93f429ec51 +index 0000000000..536115a118 --- /dev/null +++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata -@@ -0,0 +1,89 @@ +@@ -0,0 +1,90 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 @@ -453,14 +465,14 @@ index 0000000000..93f429ec51 + ;; + esac + ;; -+ath11k/qcn9000/hw1.0/caldata_1.bin) ++ath11k/QCN9074/hw1.0/caldata_1.bin) + case "$board" in + qcom,ipq807x-hk14) + caldata_extract "0:ART" 0x26800 0x20000 + ;; + esac + ;; -+ath11k/qcn9000/hw1.0/caldata_2.bin) ++ath11k/QCN9074/hw1.0/caldata_2.bin) + case "$board" in + qcom,ipq807x-hk14) + caldata_extract "0:ART" 0x4C000 0x20000 @@ -469,6 +481,7 @@ index 0000000000..93f429ec51 + ;; +ath11k-macs) + case "$board" in ++ edgecore,eap101|\ + edgecore,eap102|\ + cig,wf188n) + ath11k_generate_macs @@ -4789,10 +4802,10 @@ index 0000000000..de64559bce +} diff --git a/target/linux/ipq807x/config-4.4 b/target/linux/ipq807x/config-4.4 new file mode 100644 -index 0000000000..b897b435bf +index 0000000000..eeb1fec76c --- /dev/null +++ b/target/linux/ipq807x/config-4.4 -@@ -0,0 +1,823 @@ +@@ -0,0 +1,824 @@ +# CONFIG_AHCI_IPQ is not set +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_ALLOW_DEV_COREDUMP is not set @@ -4993,6 +5006,7 @@ index 0000000000..b897b435bf +CONFIG_DEBUG_GPIO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" ++# CONFIG_DEBUG_MEM_USAGE is not set +# CONFIG_DEBUG_UART_8250 is not set +# CONFIG_DEBUG_USER is not set +CONFIG_DECOMPRESS_GZIP=y @@ -5574,8 +5588,8 @@ index 0000000000..b897b435bf +# CONFIG_QCA_MINIDUMP_DEBUG is not set +# CONFIG_QRTR_USB is not set +# CONFIG_QRTR_FIFO is not set -+# CONFIG_QRTR_MHI is not set -+# CONFIG_MHI_BUS is not set ++CONFIG_QRTR_MHI=y ++CONFIG_MHI_BUS=y +# CONFIG_MHI_QTI is not set +# CONFIG_MHI_NETDEV is not set +# CONFIG_MHI_DEBUG is not set @@ -5606,11 +5620,11 @@ index 0000000000..b897b435bf +CONFIG_LEDS_GPIO=y +# CONFIG_ARCH_IPQ256M is not set +CONFIG_SKB_FIXED_SIZE_2K=y -+CONFIG_IPQ_MEM_PROFILE=512 ++# CONFIG_IPQ_MEM_PROFILE is not set +# CONFIG_VIRTIO_NET is not set +# CONFIG_QCA_85XX_SWITCH is not set +CONFIG_AQ_PHY=y -+# CONFIG_DIAG_CHAR is not set ++CONFIG_DIAG_CHAR=y +# CONFIG_HW_RANDOM_VIRTIO is not set +# CONFIG_BOOTCONFIG_PARTITION is not set +# CONFIG_CRYPTO_DEV_QCEDEV is not set @@ -7386,20 +7400,16 @@ index 0000000000..2b23357323 +TARGET_DEVICES += tplink_ex447 diff --git a/target/linux/ipq807x/ipq60xx/config-default b/target/linux/ipq807x/ipq60xx/config-default new file mode 100644 -index 0000000000..73c01b4466 +index 0000000000..3d7c59698e --- /dev/null +++ b/target/linux/ipq807x/ipq60xx/config-default -@@ -0,0 +1,144 @@ +@@ -0,0 +1,122 @@ +CONFIG_ALLOC_BUFFERS_IN_4K_CHUNKS=y +CONFIG_ANDROID=y +# CONFIG_ANDROID_BINDER_IPC is not set +# CONFIG_AQ_PHY is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y -+# CONFIG_ARCH_IPQ256M is not set -+# CONFIG_ARCH_IPQ40XX is not set -+# CONFIG_ARCH_IPQ5018 is not set +CONFIG_ARCH_IPQ6018=y -+# CONFIG_ARCH_IPQ806x is not set +# CONFIG_ARCH_MSM8X60 is not set +CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8 +CONFIG_ARM_DMA_USE_IOMMU=y @@ -7408,7 +7418,6 @@ index 0000000000..73c01b4466 +CONFIG_ARM_SMMU=y +CONFIG_ASN1=y +CONFIG_ASSOCIATIVE_ARRAY=y -+# CONFIG_BOOTCONFIG_PARTITION is not set +CONFIG_CACHE_L2X0=y +CONFIG_CLZ_TAB=y +CONFIG_CMA=y @@ -7418,7 +7427,6 @@ index 0000000000..73c01b4466 +CONFIG_CMA_DEBUGFS=y +CONFIG_CMA_SIZE_MBYTES=0 +CONFIG_CMA_SIZE_SEL_MBYTES=y -+# CONFIG_CNSS_QCN9000 is not set +CONFIG_CORESIGHT=y +CONFIG_CORESIGHT_CSR=y +CONFIG_CORESIGHT_CTI=y @@ -7435,8 +7443,6 @@ index 0000000000..73c01b4466 +CONFIG_CRC_CCITT=m +CONFIG_CRYPTO_AKCIPHER=y +CONFIG_CRYPTO_AKCIPHER2=y -+# CONFIG_CRYPTO_DEV_QCEDEV is not set -+# CONFIG_CRYPTO_DEV_QCRYPTO is not set +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y @@ -7450,7 +7456,6 @@ index 0000000000..73c01b4466 +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SHA512=y -+CONFIG_DIAG_CHAR=m +CONFIG_DMA_CMA=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DT_IDLE_STATES=y @@ -7460,7 +7465,8 @@ index 0000000000..73c01b4466 +CONFIG_EXTCON_USB_GPIO=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FREEZER=y -+# CONFIG_HW_RANDOM_VIRTIO is not set ++CONFIG_GPIO_WATCHDOG=y ++CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y +CONFIG_IOMMU_API=y +CONFIG_IOMMU_DMA=y +CONFIG_IOMMU_IOVA=y @@ -7471,10 +7477,7 @@ index 0000000000..73c01b4466 +CONFIG_IOMMU_SUPPORT=y +CONFIG_ION=y +CONFIG_ION_MSM=y -+# CONFIG_IPQ_APSS_5018 is not set +CONFIG_IPQ_APSS_6018=y -+# CONFIG_IPQ_FLASH_16M_PROFILE is not set -+# CONFIG_IPQ_GCC_5018 is not set +CONFIG_IPQ_GCC_6018=y +CONFIG_IPQ_MEM_PROFILE=256 +CONFIG_KASAN_SHADOW_OFFSET=0x5f000000 @@ -7484,7 +7487,6 @@ index 0000000000..73c01b4466 +CONFIG_MIGRATION=y +CONFIG_MPILIB=y +CONFIG_MSM_SECURE_BUFFER=y -+# CONFIG_MTD_NAND_SERIAL is not set +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NUM_ALT_PARTITION=16 @@ -7493,9 +7495,6 @@ index 0000000000..73c01b4466 +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PAGE_OFFSET=0x80000000 -+# CONFIG_PAGE_SCOPE_MULTI_PAGE_READ is not set -+# CONFIG_PHY_IPQ_UNIPHY_PCIE is not set -+# CONFIG_PINCTRL_IPQ5018 is not set +CONFIG_PINCTRL_IPQ6018=y +# CONFIG_PKCS7_MESSAGE_PARSER is not set +# CONFIG_PL310_ERRATA_588369 is not set @@ -7505,13 +7504,9 @@ index 0000000000..73c01b4466 +CONFIG_PPS=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PWM_IPQ4019=y -+# CONFIG_QCA_85XX_SWITCH is not set +CONFIG_QCOM_APM=y +CONFIG_QCOM_DCC=y -+# CONFIG_QCOM_MDT_LOADER is not set +CONFIG_QCOM_QMI_HELPERS=y -+# CONFIG_QTI_BT_TTY is not set -+# CONFIG_QTI_EUD is not set +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_SPMI=y +CONFIG_REGULATOR_CPR3=y @@ -7527,13 +7522,10 @@ index 0000000000..73c01b4466 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_VFIO is not set +CONFIG_VIRTIO=y -+# CONFIG_VIRTIO_NET is not set +CONFIG_VIRTUALIZATION=y +CONFIG_VMSPLIT_2G=y +# CONFIG_VMSPLIT_3G is not set +CONFIG_WANT_DEV_COREDUMP=y -+CONFIG_GPIO_WATCHDOG=y -+CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y diff --git a/target/linux/ipq807x/ipq60xx/profiles/default.mk b/target/linux/ipq807x/ipq60xx/profiles/default.mk new file mode 100644 index 0000000000..f47e73acfc @@ -7565,10 +7557,10 @@ index 0000000000..cf2bf7b9cd +endef diff --git a/target/linux/ipq807x/ipq807x/config-default b/target/linux/ipq807x/ipq807x/config-default new file mode 100644 -index 0000000000..837fdcda8a +index 0000000000..f1e8aadc9c --- /dev/null +++ b/target/linux/ipq807x/ipq807x/config-default -@@ -0,0 +1,75 @@ +@@ -0,0 +1,78 @@ +# CONFIG_AHCI_IPQ is not set +CONFIG_ARCH_IPQ807x=y +# CONFIG_DIAGFWD_BRIDGE_CODE is not set @@ -7643,7 +7635,10 @@ index 0000000000..837fdcda8a +CONFIG_QCOM_QMI_POWER_COLLAPSE=y +CONFIG_RMNET_CTL=y +CONFIG_RMNET_CTL_DEBUG=y -+# CONFIG_MHI_BUS_TEST is not set ++CONFIG_MHI_BUS_TEST=y ++CONFIG_MHI_DEBUG=y ++CONFIG_MHI_NETDEV=y ++CONFIG_MHI_UCI=y diff --git a/target/linux/ipq807x/ipq807x/profiles/default.mk b/target/linux/ipq807x/ipq807x/profiles/default.mk new file mode 100644 index 0000000000..f47e73acfc @@ -12278,24 +12273,6 @@ index 0000000000..188870b8dc ++&nss_crypto { ++ status = "ok"; ++}; -diff --git a/target/linux/ipq807x/patches/107-ed2-compile.patch b/target/linux/ipq807x/patches/107-ed2-compile.patch -new file mode 100644 -index 0000000000..8122f9ee7d ---- /dev/null -+++ b/target/linux/ipq807x/patches/107-ed2-compile.patch -@@ -0,0 +1,12 @@ -+Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/include/linux/qcom_scm.h -+=================================================================== -+--- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/include/linux/qcom_scm.h -++++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/include/linux/qcom_scm.h -+@@ -14,6 +14,7 @@ -+ #define __QCOM_SCM_H -+ -+ #include -++#include -+ -+ #define QCOM_KERNEL_AUTH_CMD 0x15 -+ #define QCOM_SCM_PAS_AUTH_DEBUG_RESET_CMD 0x14 diff --git a/target/linux/ipq807x/patches/108-log-spam.patch b/target/linux/ipq807x/patches/108-log-spam.patch new file mode 100644 index 0000000000..94b2a3ffd5 diff --git a/profiles/cig_wf194c.yml b/profiles/cig_wf194c.yml index 13e1507f6..d6ef420b8 100644 --- a/profiles/cig_wf194c.yml +++ b/profiles/cig_wf194c.yml @@ -10,6 +10,5 @@ feeds: include: - wifi-ax - ucentral-ap -packages: - - kmod-usb-serial - - kmod-usb-serial-pl2303 +diffconfig: | + CONFIG_KERNEL_IPQ_MEM_PROFILE=0 diff --git a/profiles/edgecore_eap102.yml b/profiles/edgecore_eap102.yml index 2f8b82b04..e5f2b73bb 100644 --- a/profiles/edgecore_eap102.yml +++ b/profiles/edgecore_eap102.yml @@ -17,3 +17,5 @@ packages: - bluez-daemon - bluez-utils - usbutils +diffconfig: | + CONFIG_KERNEL_IPQ_MEM_PROFILE=0 diff --git a/profiles/qcom_hk14.yml b/profiles/qcom_hk14.yml index a9c33238a..6516a3531 100644 --- a/profiles/qcom_hk14.yml +++ b/profiles/qcom_hk14.yml @@ -10,5 +10,5 @@ feeds: include: - wifi-ax - ucentral-ap -packages: - - kmod-ath11k-pci +diffconfig: | + CONFIG_KERNEL_IPQ_MEM_PROFILE=0